Problems worthy of attack prove their worth by hitting back. —Piet Hein

Wednesday, 31 October 2007

Mixing with MD5

MD5 and cryptographic hash functions in general have many uses - not least integrity checking and password storage. They have the property of mixing the input in an unpredictable but deterministic way. This can be very useful - and not just in security applications. Here are two great examples I came across recently: partitioning users into groups for controlled experiments on the web, and Dopplr's colour-coding of cities. Neat.

Moved to Wales

Well the phone line is yet to be enabled, but in the meantime I've got this view to stare at.

Sunday, 14 October 2007

Moving to Wales

Next week we are moving to the Brecon Beacons in Wales. This is a big change for us: I've been living in London for the past 11 years and Eliane for the last 17. But in some ways it's not so big as we both grew up in small towns. We're renting a barn on a hill, and Eliane is already planning the veg patch.

Work-wise I shall be leaving Kizoom at the end of November. I am one of the three original members (with Nick Knowles and Mike Storey) of the team that started Kizoom in September 1999, in Nick's library (Islington people have libraries and garages).

After that I shall be working freelance and specializing in Hadoop. The plan is to work from home as much as possible, but I'm realistic about the need to travel to make this happen. So - if you need help with a Hadoop-related project, please get in touch.

Tuesday, 2 October 2007

Zero-width Negative Lookbehind

Mainly for my own reference:

perl -ple 's/(?<![+-\d])(\d+)/\+$1/g'

This will ensure all integers in a string have a leading sign. So for example, "+163, 163, -163" becomes "+163, +163, -163". It works using a zero-width negative lookbehind assertion: in this case the only "163" in the string that matches is the one that is not preceded by a plus sign, a minus sign, or a digit.

This came up at work today (thanks Robin).