Code Golf

CSLU did code golf today. I did 1 and a half tasks, which were: Output the first 100 prime numbers Output e to 100 decimal places Prime numbers I’m quite proud of this, I managed to do this in 55 characters initially but then after some collaboration with the rest of the club shrunk it […]

Ruby gem – json_serialisable

I was working on a ruby project and stumbed upon my first valid application of metaprogramming. I was creating json serialisation methods and realised they were all practically identical. So I looked at how attr_accessor worked and then wrote my own class method called attr_serialisable. This method generated serialisation methods automatically. Example Given a class […]

Arduino Gas Sensor – Part 2

Previously So I left the last article with the following: Well apart from the hardware I need, so issues need to be addressed which may or may not require extra hardware – as I’ve just thought of them. DateTime equivalent object for when I register a pulse Work out how long these will last on […]

Having trouble updating WordPress if your server is running vsftp?

The latest update to vsftp has, in their own words: – Add stronger checks for the configuration error of running with a writeable root directory inside a chroot(). This may bite people who carelessly turned on chroot_local_user but such is life. This kind of makes it useless for a virtual user setup. A work around […]

Fountain code challenge

For the second term of the 2011/2012 academic year I’ve made a small challenge for members of CSLU. Details are found on the PDF. Good luck. P.S a bit of background reading can be found here. PDF: CSLU Lent Challenge EDIT: Document has been updated with some clarifications.

Arduino Gas Meter Sensor – Part 1

Motivation My newly ordered Arduino Uno came in the post today so I got to start building with it! An upcoming sensing deployment needs a way of sensing gas usage, so I’m building a basic sensor to measure it. Luckily, most gas meters have an LED pulse which goes off every so often and we […]


I found this cool graphing JS library which has a wordpress plugin! It’s called JSXGraph and is rather nifty!. Here is an example graphs showing Facebook users over time. var brd = JXG.JSXGraph.initBoard(‘box’, {boundingbox: [-50, 900, 3000, -150], keepaspectratio:true, axis:true, grid:0, showNavigation:false}); brd.suspendUpdate(); //Points for graph var p = []; p[0] = brd.create(‘point’, [0,0], {style:6,name:””}); […]

Programming languages course

So I ran a talk on learning programming languages last week. It was the second time I had done that particular talk, and in this case the hardware setup went smoothly – as it was done by Stephen Wattam the CSLU VP. We had a pretty good turn out, mostly of year year undergraduate students […]

Rain – Agent-based water

Well I’ve been wanting to do this for a while now, and on Sunday with a freshly installed (and therefore speedy) net book under my belt, I thought I’d have a crack at it. Last year (maybe even 2 years now) ago, I made a weak plasmoid generator with the intention of using it for […]

Grub error 15 on installing ArchLinux

If anyone else has this error thrown inexplicably after installing a fresh version of Arch, you may want to look at this handy post, which will solve all your problems.