Archives for January 2009

gethostbyname_r()


Share



[digg=http://digg.com/linux_unix/gethostbyname_r] Okay, so I can’t really go into too much of the big picture since this is from the day job, but I can certainly tear into gethostbyname_r() a bit.

For part of what we’re doing, we’re sending a RADIUS message using the freeradius project’s radius client library. So, nice and simple (after you’ve done some setup):

result = rc_acct(rh, 0, send);

Easy enough, right? So it fails. Specifically, it segfaults and since it’s in a multithreaded server, it’s a pain to track down. And I mean a pain. Hours of fun with DDD, gdb, nana and finally printf() lead to here:

res = gethostbyname_r(hostname, &hostbuf, tmphostbuf, hostbuflen, &hp, &herr)

Ah. gethostbyname_r(), the glibc2-reentrant thread-safe version of gethostbyname(). Except that it’s deprecated, and has the unique property of working differently on just about every machine out there.

And of course, in my machine, and the server, it’s going… Read the rest

Nokia E71


Share



[digg=http://digg.com/hardware/Choosing_the_Nokia_E71] At the moment, I use a Sony Ericcson k750i as my phone. It’s solid, has good reception and audio and battery life. It has an easy-to-use camera with a flash which is important for me because that’s how I record and store whiteboard sessions. It has bluetooth for file transfer (of the whiteboard photos) and hands-free headsets (it’s illegal in Ireland to drive while using a mobile phone, so the headset – and the voice recognition dialing – are quite useful). It has an FM radio and an MP3 player for when I’m on the train. I’ve got Opera Mini installed on it so I can even check my email and websites, though writing anything with T9 is something a sane person only takes on in extremis. It’s even red :D It’s been a very good phone for me and I have almost no complaints about it.

But it’s time for a change.

 

Nominated


Share



 

Gunk


Share



[digg=http://digg.com/hardware/Kinesis_Contoured_keyboard_gunk] Back when I was finishing my undergrad degree, my final year project (which is a big part of the final degree exams in Trinity) was in Java on a Sun SPARCstation 4 (at the time, one of the more powerful boxen you could get access to as an undergrad). The project was a fair bit of fun, writing a robot controller in Java just as 1.2 was coming out of beta. Lots of long hours were spent in that lab with three or four others working on their projects, and quite a few all-nighters interspersed with the odd game of networked bomberman :D I even managed to get a published paper out of it.

The downside to all of this fun was the Type 5 keyboard.

 

Kada2.py output


Share



[digg=http://digg.com/programming/Target_shooting_scores_and_analysis_with_python] Ray asked to see what the output of the kada2 script I’ve been working on looks like – only problem is that I’ve been using a real datafile for development, so it has people’s names in it. To avoid any shoutyness, one quick python script to read in the members.kda file and write it back out to test.kda with all the names changed to John Smith; then a quick run with this file as the members.kda file and some imagemagick conversions and viola, the current kada.py output.