This scheme comes from Kent Beck, and it’s an excellent technique to train yourself into writing better code. I use it to teach good programming practice. This is how I coach programmers, and it works. First, write code that you know works. Any moron can write code that works. This is called hacking, and it’s [...]

It’s a while since I wrote a techy article here. Let’s change that. Last week I was asked how to handle running a shell command from Ruby, with the added requirement that if the command took longer than a certain time it should time out. Running commands from ruby is easy, and you should watch [...]

I took the boy for a haircut on Monday. We didn’t want him to lose an ear, so I traipsed across London to a special children’s hairdressers. It was pretty exciting – the boy got to sit in a pedal-car aeroplane and watch a bit of Cars on a small DVD player, in a room [...]

We should strongly resist building architectures of control in public service. They empower the petty, and promote the bureaucratic over the human. This is why I oppose what the BBC is doing with its content protection. The humane solution is not to regulate these architectures, but to remove them. But, first up, another architecture of [...]

Another week, another hack-day. And another book made from twitter feeds. I was so pleased with the hardback version of my twitter book that I knew I had to make another book. And quickly. At the Warblecamp hackday last Saturday/Sunday I set about making book from one of the twitter events I’d been following. The [...]

In other news, I made a book. A book of all my tweets since December 2007. I’m still not sure what I think about the exercise. Twitter’s the closest thing I have to a diary. I’ve never tweeted specifically in order to make a daily record, but that’s the form I chose for the book. [...]

Scraperwiki is brilliant. YQL is brilliant. Now, they can get together and make lots of datababies. Using the simple webservice I’ve written, it’s a bit easier to use scraperwiki data in YQL queries and to mash up scraperwiki data with other YQL sources. YQL YQL presents a uniform query interface, modelled on SQL, for various [...]

Christmas tree decoration seen in Canary Wharf shopping centre reads: CCTV in operation here. This has to be a prank, right? There’s no way, even in the Orwellian Albtraum of Canary Wharf, that someone would have decided this an appropriate Christmas decoration for the shopping centre’s christmas trees. Alas, I fear it’s real and intentional: [...]

A friend asked me yesterday if I could snap together a script to build a local database of tweets using the twitter search API. This is what I came up with. The script takes one argument – the term to search on – and creates a sqlite3 database in the current directory containing all the [...]

Ruby is an excellent language for writing small scripts to glue stuff together. Here’s a script I knocked together that lets you play a zcode text adventure (interactive fiction) with your friends in Campfire. You’ll need a room, account, etc. in Campfire; you’ll need to compile this version of dumb-frotz; and you’ll need a zcode [...]