Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Abigail (26)

Abigail
  (email not shown publicly)

Journal of Abigail (26)

Tuesday July 04, 2006
02:18 PM

Buggy locking code.

I was using the following code to prevent two instances of a program to run at the same time:

  use Fcntl qw [:flock :DEFAULT];
  my $lock_file = "...";

  sysopen my $fh => $lock_file, O_RDWR | O_CREAT
      or die "sysopen: $!";
  exit unless flock $fh => LOCK_EX | LOCK_NB;

  ... Code ...

  END {! -f $lock_file || unlink $lock_file || warn "unlink: $!"}

It turned out to be incorrect. Can you spot the mistake?

Wednesday January 18, 2006
10:00 AM

Final hour

It's my last hour at my current employment. My desk is almost empty - and what's on it has to stay here, unfortunally. Checked in the latest versions of the sources I've been working on - the last feature added was less than half an hour ago. Finished the documentation. Instructed the person taking over my project, making sure he can build the distribution as well. Saved the few files worth keeping on my laptop (well, the companies laptop, I'll have to return it later...). Cleared out all my accounts on the various machines. Removed most of the non-system files on my desktop - what needs to be done is scratching the disk.

One cup of tea to go. Then a few goodbyes, and off I go. Two weeks of vacation, and on Feb 1, I'll start a new gig.

Tuesday January 10, 2006
10:18 AM

Conferences in 2006.

I've started drawing plans which conferences/workshops to visit in 2006. Not all dates are known to me (probably many of the conferences themselves are (still) unknown to me). And my definitive schedule will depend on how flexible my new employer will be. My top three:
  • Nordic Perl Workshop, Oslo, 15-16 June.
  • YAPC North America, Chicago, 26-28 June.
  • YAPC Europe. Birmingham, August/September.

Perhaps one or two smaller European workshops, specially if their dates are on a weekend. I very much liked the London Perl Workshop, and if there's one this year, I'll try to make it there.

Is there a web site that lists all planned conferences/workshops? That would be extremely convenient.

Monday January 09, 2006
09:35 AM

Book review: "The world according to Clarkson"

I bought this book when I was returning from the London Perl Workshop. Clarkson is a journalist/presentor, probably most known from the television program "Top Gear". But he also writes articles in the "Sunday Times", and this book contains a collection of them, approximately from the 2001-2003 era. Each article is about four pages long, and has Clarkson telling or ranting about a subject in his unique style. Other than you might expect, the articles aren't about cars - but almost everything passes the revue. Not a shocking book, but if you like Clarkson's style, it's an amusing way to pass time.
Friday January 06, 2006
10:27 AM

1kb to spare.

One of the things I've done in my current (almost finished) gig is creating a linux distro for a small device. Require: the entire distro needs to be installed from a floppy disk.

So I had about 42kb of free space on my 1680kb floppy disk when I got this feature request yesterday. Whether I could fit in a 'real' ps, instead of busybox's ps. Right. A real ps, with just 42 kb to spare.

In order to save space, all binaries (except for the kernel) on the distro have been compiled using uClibc, which is very nice gcc front end to produce really small, statically linked, binaries. As part of the make process of the distribution, any tool that isn't found on our (quite bare) RedHat servers is compiled as well. Including uClibc.

So, I set off to compile ps with uClibc. No go. It needs a compiler configured for wide chars. I configure uClibc so it can deal with wide chars. ps compiles, and seems to work! Now, will it all fit on the floppy disk? I no longer need ps in busybox, so I kick out the module and attempt to create a floppy disk. It's too big! Not a lot - I can fit the compressed initrd on the floppy disk, but not two additional, small files.

I notice that the other binaries are slightly larger than they used to be. Must be because they now have wide char support compiled in. Aha! What if I create two compilers - one with wide char support to compile 'ps', and the other without wide char support for the rest? A bit of Makefile hacking, and I end with a floppy disk with 1 or 2 kb to spare (the amount of kb to spare fluctuates from build to build - there's a compressed file system on the floppy and filesystems contain timestamps. And if they are just right, they compress better...).

That's going to be last feature added.

Thursday January 05, 2006
05:37 PM

Radio

Right now, my favourite radio program has a special show, the first program was exactly 30 years ago. It's a daily program, 365 broadcasts a year, on the last hour of the day. I can't remember the first broadcast, but I do remember listening to the 1,000th broadcast. Soon they'll reach the 11,000th broadcast.

Time flies. I'm getting old.

Monday January 02, 2006
06:41 PM

Hiking in 2005

On the last day of the year, we made our last hike of the year. This year, I kept a record - I've made 40 hikes, for a total distance of 543km. The shortest one was 5km, the longest 33km. A few times, I hiked alone, but Jet, Stanley, Adriana, Jurgen and Allison hiked with me as well.

In 2006, I'd like to do 600km at least.

09:33 AM

Fjords

Last night, we tried a new game we purchased last month. It's a two player game called Fjords. It's one part tile laying (as in Carcassonne), and one part area claiming (as in Go). The theme is that you're discovering a land consisting for water, mountains and fields, and you have to build farms and claim more land for your clan than your opponent. It makes for a quick game (one round takes about 15 to 20 minutes, rules suggest to play three rounds, but each round is independent and all you carry over is the score). The rules are pretty simple, but the game is challenging enough to be interesting, without requiring a lot of strategy. As in most 999 games, the quality of the material is sturdy, and the artwork is well done.
Friday December 30, 2005
08:09 PM

Three book reviews

It's Christmas vacation, so I spend some time reading books. I finished three of them the past couple of days.

First I finished 100 mannen (100 men) by Mart Smeets. Mart Smeets is a sports journalist, and he has covered the Tour de France for about 30 years now. In this book, he describes 100 cyclists who have participated in the Tour de France - a short article for each rider. It's full with stories, amusing ones, heroic ones, many with a personal touch. It brings up a lot of memories - since the 1970s, I've spend countless hours in front of the TV every July.

Second, Amerikanen zijn niet gek (Americans aren't crazy) by Charles Groenhuijsen. Groenhuijsen is a journalist working for the Dutch television, who has spend the last 16 years in the USA. In the book, he describes how Americans are, and how they differ from Europeans. Unlike many others, he doesn't do it to poke fun at Americans, or to reiterate myths. Instead, he describes how the American society came to be, and why it's unlikely to change. His conclusion: America is a hard society with good manners, Europe is a social society with bad manners. I'd say, a must read for every European who easily ciritizes or generalizes Americans.

The book I finished today (well, technically, yesterday) is Watching the English by Kate Fox. I picked up the book during my 10 minute shopping spree on Gatwick when returning home from the London Perl Workshop. Kate Fox is an anthropologist who tries to describe what "Englishness" is. She has spend countless hours observing people queueing, ordering drinks in pubs, commuting to work, etc. She looks how people behave in work situations, at home, how they spend their free time, how they handle sex, etc, and describes everything in reoccuring rules. Quite an interesting read, and maybe next time I visit England, I can understand people better. (Yeah, London.pm, with my new knowledge, I just have to look at your clothes, or the car you drive in to determine your class).

Currently reading: The World According to Clarkson, by Jeremy Clarkson.

Monday December 26, 2005
05:53 PM

White Christmas

It's 10 minutes before Christmas ends (here, in the civilized world, we have two days of Christmas), and it just started snowing.

A white Christmas after all.