Tuesday, January 18, 2011

Flakturm of awesome.

Look closely and you'll see flocks of unicorns running around the tower.

Monday, January 17, 2011

An honest printer



Way to go, HP.

Monday, January 25, 2010

Thursday, October 15, 2009

Tuesday, October 13, 2009

Saturday, September 19, 2009

Fortran can't be used to count the human population

Yesterday at work, like any friday when i plan to leave early, came the dreaded last-minute to-be-fixed-urgently bug in the program, forcing me to delve further into some 20-year-old Fortran mess. Let's not mention the hour spent trying to make sense of the useless email conversation with sometimes contradictory statements from people having mostly no idea what was going on, together with the "Fix it!" tag; it turned out that the Fortran code was supposed to read some (real) numbers from an input file, and that action had started to fail as those numbers where getting bigger. In the end, my colleague in charge of the other program writing the input the Fortran code was coughing up on fixed it in the input itself, just by adding a comma at the end of the big numbers, as we had determined everything was fine in that case.

Still, it took me a while to figure out what had been happening, since any other (smaller) number produced no problem whatsoever, even without comma. One last test made it clear: The offender was something around 2.2 billions, and everything was fine up to 2.1 billions... Or more exactly up to 2147483647, since that is (2^8)^4/2-1, i.e. the maximum value that's possible to store in a (signed) 4-byte integer. There was then somewhere a cast to make it a float for the rest of the program, and thus things started to get ugly above that limit.

In the end, if you ever write a program with a counter for the total population on the Earth, you'd better use a real variable or make sure your integer is really an integer*8...

Friday, July 24, 2009

Convert pictures from fancy cameras

Use dcraw to convert raw images (e.g. .nef) to something more useful for simple people like me.

find .*nef -exec dcraw -w {} \;
find ./dsc_0*ppm -exec convert {} {}.jpg \;