Author Archive

Election visualisation

Sunday, November 27th, 2011

I have hacked up a booth-by-booth visualisation of votes in Wellington Central. The visible (non-occluded) area of each circle is proportionate to the party vote received, and the circles proceed inwards from most votes. It only shows the top three five parties at each booth at the moment (from skimming over the data, further down than that they become negligibly small). It’s not really as interesting as I’d hoped, but I may try it on other electorates that might show something better later on.

Update: I’ve extended it to the top five, rather than three, parties, and it gets a little more interesting then. The fifth-place party varies quite a bit.

Update 2: More electorates:

Announcing retail – tail with regular expressions

Saturday, November 26th, 2011

I have broken down and implemented my own tail command. retail can output that part of a file (or pipe) following the last match of a regular expression, which can be useful for logfiles and various other kinds of data. It is also a fully compliant implementation of the POSIX.1-2008 tail command, so you can theoretically replace your system tail with it.

The driving use case of this for me is log files – I want to get all of the file after the current occurrence of some event. After establishing that I couldn’t do that with sed, and that although I probably could with awk it would be a bad idea, I set about writing this in C. It does exactly what I want, and I’ve also been over the POSIX tail spec to add everything from that as well, so it is a usable tail command.

The code is on GitHub (for the moment at least), accessible with `git clone git://github.com/mwh/retail.git`, or in an automatic tarball https://github.com/mwh/retail/tarball/master . Although it satisfies my original use-case there are a couple of additions I’d still like to make along with efficiency improvements, and, of course – patches welcome.

Some usage examples:

retail -r Beginning logfile.log

Output everything after the last occurrence of “Beginning” in the file.

retail -r Beginning -u 'succeeded|error' -f logfile.log

Same as the last one, and continue reading as any lines are appended until one matches /succeeded|error/ (i.e., it contains either of those words), and then terminate.

retail -n +10

Start printing at line 10, until the end of the file. Just like in regular tail. Negative numbers, bare [-+]N, and -c work too.

Once more, retail.

LCA video

Friday, October 22nd, 2010

The video from my GoboLinux talk at linux.conf.au earlier this year is finally up. I can’t watch (too many claps), but it’s there for anybody else who wants.

The /System/Aliens talk from the Distro Summit is still missing in action. I’m not sure whether it’s coming or not, but it’s looking unlikely at this point.

De-Vodafoning the Nexus One

Saturday, October 9th, 2010

A few weeks ago I bought a Nexus One from Vodafone, which unfortunately comes with a Vodafone-specific firmware that doesn’t allow upgrading to any new versions that haven’t been blessed by corporate in the UK. I’d prefer to have the stock firmware, and I’d particularly prefer to have the recent 2.2.1 update, so I have reflashed it to the standard Google firmware.

I used the instructions from here (a Vodafone UK forum thread!), and it all went smoothly. There’s no unlocking of the boot loader and no rooting of the device involved. The update took fifteen minutes or so and progressed pretty much on its own. I had to set a few things up again afterwards – the SwiftKey keyboard wasn’t activated, and Google Earth and Sky Map weren’t automatically restored the way the other applications were. No major issues.

I’m now running stock FRG83 Android 2.2.1, automatically upgraded from FRG33 shortly after install (make sure it’s on wifi not too long after update, or it’ll pull down 80MB over the mobile network). I started from the Vodafone FRF91, which is distinguished from the stock FRF91 by the kernel version display in “About Phone” showing “haley@…” instead of “android-build@…”. Search terms mentioned, I’ll just say it all went well, even if there were perhaps other things I could have done with my time right now.

Nexus One, cell data, and parcels

Tuesday, September 28th, 2010

Since Android seems interesting and the Nexus One looks like the best (and openest) option available, I picked one up the other day. I got it from Vodafone in the end, after a failed attempt to get it from a parallel importer. It’s cheaper from Vodafone at this point anyway. I’m using it on 2degrees at the moment and will probably make that jump too.

Vodafone has a new shipment of them in, and these ones don’t seem to they do have the Vodafone-specific firmware that the original lot did: they come with 2.2 (Froyo), FRF91, but still tied to Vodafone. I was all prepared to reflash to the stock firmware but it isn’t necessary any more, which is a plus, (or, alternatively, it is a Vodafone firmware, they’ve just stopped showing it in the version number. I will keep the reflashing in mind for the future then, but for the moment I’m leaving it. Edit 2: I updated it). It still excluded Google Goggles, but that was easily installed from the market. It’s all going well so far but it’ll take a while longer to make a sensible assessment. I hope to get some development done for the platform in a couple of months, which was a lot of the point of the exercise.

And on the subject of cellphones, mostly for my own reference: a database of New Zealand cell tower locations.

One more: NZ Post lets you track parcels via Twitter. That’s pretty neat.

Link dump completed.

LaTeX symbol classifier

Saturday, May 29th, 2010

This is pretty neat: a tool that lets you draw symbols and tells you the LaTeX name for them. Much easier than searching through the symbol listing.