Friday, October 18, 2019

Oily coffee beans

So we have a Gaggia Brera superautomatic espresso maker. It makes great espresso but refuses to feed oily coffee beans. Here's a list of those that aren't and those that are too oily.

Not too oily:
In between
  • Verena Street Shot Tower Espresso
Too oily:
  • Dazbog White Nights Espresso
  • Kicking Horse Cliff Hanger Espresso
  • Kicking Horse Three Sisters
It'd be nice if the roasters would come up with a method to express this. In general of course, we can look for light or medium roast, but there is little consistency between the light/medium/dark roast oiliness.

Friday, July 5, 2019

This just gets worse and worse

More macos strangeness.
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>

int main(int argc, char** argv) {
    int pid = fork();

    if (pid == 0) {
        printf("child, errno: %d\n", errno);
        exit(0);
    } else {
        printf("parent, errno: %d\n", errno);
        exit(0);
    }
}

And here's the output under macos.
$ ./a.out 
parent, errno: 0
child, errno: 22
The fork man page doesn't even list "Invalid argument" as a possible errno value...

Sunday, June 23, 2019

MacOS/Darwin/Mach sleep weirdness

A system call to sleep returns 0 as it should, but set errno to 60 "ETIMEDOUT Operation timed out." which it really shouldn't, especially on a return of 0. https://pubs.opengroup.org/onlinepubs/009695399/functions/sleep.html states "No errors are defined." Here's some C proof.
#include <stdio.h>
#include <unistd.h>
#include <sys/errno.h>

int main(int argc, char **argv) {
    printf("this looks good: %d\n", sleep(1));
    printf("this does not: %d\n", errno);
}
And the output.
this looks good: 0
this does not: 60

Sunday, February 10, 2019

We're not in Kansas

I've been using the excellent MaxMind Geo IP database (https://www.maxmind.com) in a Python application (https://github.com/drsjb80/HPotter). Interestingly, when I look a MSU Denver's IP address:
 
$ python3
Python 3.7.1 (default, Nov 18 2018, 09:59:08)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import geoip2.database
>>> reader = geoip2.database.Reader('/usr/local/lib/python3.7/site-packages/_maxminddb_geolite2/GeoLite2-City.mmdb')
>>> reader.city('147.153.5.6').location
geoip2.records.Location(average_income=None, metro_code=None, time_zone=None, population_density=None, longitude=-97.822, postal_code=None, postal_confidence=None, accuracy_radius=5, latitude=37.751)


the lat/long says we're in Kansas, in the middle of a reservior acutally:
 Who knew?

Thursday, January 11, 2018

Nikon View NX and sleepy OS X

For some unknown reason, View NX from Nikon craps out when OS X goes to screen saver. Here is what I had to change the power settings to in order to export ~500 photos without being present during:
I suppose I could spend the time to figure out which setting matters and/or dtrace the process, but really Nikon: is this my resposibility? Your software matters almost as much as your hardware.

Sunday, November 12, 2017

Tuesday, October 10, 2017

Install jar in local Maven directory

I'm not sure why I couldn't find an easy reference on what to change in a pom.xml file to install a jar in the local Maven repository. Lots of complicated command lines (a few of which actually worked) and little else. I'm not sure why everyone feels the need to make things more complicated than they are. Regardless, here's what worked for me.
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-install-plugin</artifactId>
  <version>2.5.1</version>
  <configuration>
    <file>${basedir}/target/${artifactId}-${version}.jar</file>
  </configuration>
</plugin>
A mvn install:install-file then does the trick.