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 \;

Monday, July 20, 2009

Resetting a mysql root password

*sigh* again!

1. Stop the mysqld daemon process.
2. Start the mysqld daemon process with the --skip-grant-tables option.
3. Start the mysql client with the -u root option.
4. Execute the UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
5. Execute the FLUSH PRIVILEGES; command.

From: http://www.tech-faq.com/reset-mysql-password.shtml

Tuesday, June 23, 2009

mac os on a dell mini 9

For those who want the speed of mac os X on a slow processor, and the glamor of owning a dell mini 9
(so exclusive that you even can't buy one anymore), there is: mac os on a dell mini 9



Saturday, June 6, 2009

Ghost windows in Firefox

The weirdest thing just happened to me: Firefox was using an excessive amount of cpu. Ok, that doesn't seem too unusual; but as it was constantly over 80%, no matter what i had open, i started worrying about the extra heating for my thighs... After some unfruitful searches (plus a couple of reboots etc), i finally restarted in safe mode; and there they were, two extra windows with flash-heavy sites that i certainly never requested myself. Most probably pop-ups that came from the sites where i downloaded emulators for my vintage gaming binge recently, judging from the contents of the offenders... Crazy, i had never noticed them before. Could it be that they really stayed hidden all that time, quietly(!) eating up my cpu??

Monday, June 1, 2009

Vintage video games are fun

(for 5 minutes, approx.)

This week-end, i tried to fight boredom and frustration of not having a playstation 3 by looking at what i could get from the internet as a gaming experience. Oh, i would have bought a ps3 already, have i had a tv... And, i do have a psp, but i'm tired of that tiny screen since i spend my days reading the news on my iphone...

So, here's what i found: There's this arcade-game machine emulator called MAME, with a version for mac OS. You can play Fatal Fury:
or marvel super heroes:
or gazillions of similar-looking fighting arcade games... Nostalgia was the motivation there, as i remember reading about this Neo Geo game console in magazinesas a teenager, without ever having an opportunity to approach the thing in the area where i grew up, let alone buy one. Crazy how it was supposed to be 100 times much better than the common-people nintendo or sega stuff we all had. And now, it looks, well... slightly outdated.

That's how i had fun for half a minute; the rest of the 5 minute entertainment was actually provided by a similar experience, but with a megadrive (or genesis) emulator, which allowed me to replay games i used to like...
Amazing how many hours i could spend then, trying to memorize the whereabouts of silly ninjas and other pitfalls, which was not particularly fascinating but totally necessary since more often than not, one tiny mistake meant you could do it all over again.
Yes, i haven't got any better over time, but at least i still remember the trick to get you infinite shurikens! Otherwise i might not have made it to the second half of the first stage.

But, fortunately, there is still the beautiful ice hockey game which kept a good friend and i busy for years...
I know, i know... where did i leave that psp?...

Monday, April 13, 2009

Installing subversion 1.5 on ubuntu 8.04

The Subclipse 1.4.x svn plugin for eclipse expects only svn 1.5. Ubuntu comes with 1.4, so we have a problem.

I'm not the only one with this problem, so I found clues here linking to here.

Unfortunately, that was outdated information, and fortunately, it is now a bit easier:

Probably first make sure that the keyring package is installed.
apt-get install debian-archive-keyring


Then go to the clazzes.org launchpad site. Follow the instructions there! This involves adding a key for that package using apt-key, and adding the deb files to /etc/apt/sources.list

sudo apt-get update


sudo apt-get install subversion


comment the clazzes.org repositories out of /etc/apt/sources.list and rerun

sudo apt-get update


Messy, but it works. (Only for subclipse 1.4.x!! Not for later/earlier versions)

creepy

Thursday, April 9, 2009

German movie title translations

You really have to wonder what we, the audience, did to deserve this.

Saturday, March 28, 2009

ubuntu and umts, not a happy couple

Tired of random unsuccessful connections via my huawei umts modem, I started paying attention to my wvdial output.


.....
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Sat Mar 28 22:52:15 2009
--> Warning: Could not modify /etc/ppp/pap-secrets: Permission denied
--> --> PAP (Password Authentication Protocol) may be flaky.
--> Warning: Could not modify /etc/ppp/chap-secrets: Permission denied
--> --> CHAP (Challenge Handshake) may be flaky.
--> Pid of pppd: 15700
--> Using interface ppp0
--> pppd: ��[06][08]��[06][08]H�[06][08]
--> pppd: ��[06][08]��[06][08]H�[06][08]
--> pppd: ��[06][08]��[06][08]H�[06][08]
--> pppd: ��[06][08]��[06][08]H�[06][08]
--> pppd: ��[06][08]��[06][08]H�[06][08]
--> pppd: ��[06][08]��[06][08]H�[06][08]
--> local IP address 10.40.242.234
--> pppd: ��[06][08]��[06][08]H�[06][08]
--> remote IP address 10.64.64.64
--> pppd: ��[06][08]��[06][08]H�[06][08]
--> primary DNS address 10.11.12.13
--> pppd: ��[06][08]��[06][08]H�[06][08]
--> secondary DNS address 10.11.12.14
--> pppd: ��[06][08]��[06][08]H�[06][08]


That doesn't look like a valid dns address! And it isn't. Apparently, this is a known bug:

https://bugs.launchpad.net/ubuntu/+source/ppp/+bug/331322

It might be due to different software at the mobile internet cells that the modem connects to, in some cases an ms-dns is sent, and rejected by pppd. In that case, the bogus dns addresses mentioned above are sent, disabling your internet, while your modem is connected.

To work around this, you need to add working nameservers in /etc/resolv.conf (don't forget that during a pppd session, the file is overwritten, and a backup is made. Change that too)

Furthermore, /etc/wvdial.conf needs to have

Auto DNS = No

And /etc/ppp/peers/wvdial needs to have commented out the usepeerdns option:

#usepeerdns


This should solve the problem! Care has to be taken that the dns addresses from your umts provider will always be in the /etc/resolv.conf file. I am not sure how to ensure this after connecting to wlan, vpn, etc, the ubuntu network manager will likely overwrite the /etc/resolv.conf file

Tuesday, February 10, 2009

EEE factory reset.

Only works if you didn't throw your eee from the second floor, breaking its screen, and if you still have the original CD with linux + the windows drivers:

Connect external cd drive via usb, insert disc, press F2 during boot, select CD drive as first boot medium, then go to "advanced options" or whatever it's called, set "OS Installation" to "Start" save & exit the BIOS, Now in about 15 minutes it will install the original image. Warnihg: all data will be lost, duh!

Sunday, February 8, 2009

[UPDATE] Transcend 16 GB SDHC in the dell mini 9 w Ubuntu

---

[UPDATE]: Problem solved itself, without no clear reason. There seems to be a problem with Ubuntu and too short timeouts for the SD interface in the kernel. (SD via USB devices like in the EEE seem to have less problems, theoretically. Practically, at least in the first generation EEE, the hardware chosen for the SD card reader would overheat and become instable, unusable even.)

---

Card from the package, into the dell, nothing happens at all. The output of dmesg shows bad news:

[ 13.393035] mmc0: new SDHC card at address b368
[ 13.393122] mmcblk0: mmc0:b368 SDC 15693824KiB
[ 13.393176] mmcblk0:<3>mmcblk0: error -84 transferring data
[ 13.395423] end_request: I/O error, dev mmcblk0, sector 0
[ 13.395431] Buffer I/O error on device mmcblk0, logical block 0
[ 13.395882] mmcblk0: error -84 transferring data
[ 13.395887] end_request: I/O error, dev mmcblk0, sector 0
[ 13.395893] Buffer I/O error on device mmcblk0, logical block 0
...snip...
[ 13.396827] mmcblk0: error -84 transferring data
[ 13.396832] end_request: I/O error, dev mmcblk0, sector 0
[ 13.396837] Buffer I/O error on device mmcblk0, logical block 0
[ 13.397300] mmcblk0: error -84 transferring data
[ 13.397306] end_request: I/O error, dev mmcblk0, sector 0
[ 13.397311] Buffer I/O error on device mmcblk0, logical block 0
[ 13.397325] ldm_validate_partition_table(): Disk read failed.
[ 13.397852] mmcblk0: error -84 transferring data
...snip...
[ 13.397857] end_request: I/O error, dev mmcblk0, sector 0
[ 13.397862] Buffer I/O error on device mmcblk0, logical block 0
[ 13.398464] mmcblk0: error -84 transferring data
...snip...

[ 13.398911] end_request: I/O error, dev mmcblk0, sector 0
[ 13.398919] Buffer I/O error on device mmcblk0, logical block 0
[ 13.399389] mmcblk0: error -84 transferring data
[ 13.399396] end_request: I/O error, dev mmcblk0, sector 0
[ 13.399402] Buffer I/O error on device mmcblk0, logical block 0
[ 13.399422] Dev mmcblk0: unable to read RDB block 0
[ 13.399840] mmcblk0: error -84 transferring data
[ 13.399850] end_request: I/O error, dev mmcblk0, sector 0
[ 13.400323] mmcblk0: error -84 transferring data
[ 13.400331] end_request: I/O error, dev mmcblk0, sector 0
[ 13.400759] mmcblk0: error -84 transferring data
[ 13.400767] end_request: I/O error, dev mmcblk0, sector 24
[ 13.401251] mmcblk0: error -84 transferring data
[ 13.401260] end_request: I/O error, dev mmcblk0, sector 24
[ 13.401718] mmcblk0: error -84 transferring data
[ 13.401724] end_request: I/O error, dev mmcblk0, sector 0
[ 13.402190] mmcblk0: error -84 transferring data
[ 13.402195] end_request: I/O error, dev mmcblk0, sector 0
[ 13.402209] unable to read partition table


Is the card prepartitioned at all? Maybe not. /dev/mmcblk0 exists, so there is still hope.


$ sudo fdisk /dev/mmcblk0

Unable to open /dev/mmcblk0


So much for hope. Card is recognized perfectly fine on the eeepc.

Sunday, February 1, 2009

windows 3.1 on a PSP

It's pretty functional, this PSP.



This was the only video about windows 3.1 on a PSP that didn't involve crappy nu-metal.

Friday, January 30, 2009

Schweinegehirn

Exquisite cooking during an economic recession, it's still possible!

Thursday, January 29, 2009

Installing android on the eee

It is possible/easy! Engadget has the pictures, Google has the instructions.

Will try it out now that my eee is not my main machine anymore!

Blending a PSP with an EEE

Gives the Pandora.

Sounds like an ugly mess, looks like an ugly mess:



Production versions should be better though.

Tuesday, January 6, 2009

Movie review: Tideland

Reviewing: Tideland (2005) (imdb entry)



If not to stop the sea-sickness induced by the constant swinging of the camera angles (see example above), you just want it all to be ended for the better good of the depicted people, the actors, and your own peace of mind. Luckily it ends, but unfortunately still leaves lots of space even more fucked-up sequel: really, what good can come from someone who voluntarily takes a train in the US.