Category Archives: Computers

A greasemonky script for

One of my hobbies is rowing, a sport that requires lots of organisation- you need one rower per seat in the boat plus one cox (most of the time) and often a bank party and/or coach to all turn up at the same time. At my club this problem is tackled using a website where each member enters their availability; this data is then used by outing cordinators to schedule sessions when the correct people can make it. On the whole this works well, but the website does some things that make it more awkward than it needs to be when I come to filling in my availabilty:

  1. Closed outings are still displayed; they clutter up the list without providing any useful information (simply being available doesn’t mean that I’m actually rowing)
  2. There are a series of options that are redundant for our club (for some reason the creator of the software thinks that coaches want specific excuses for unavailability)
  3. There are constant suggestions of going rowing at silly o’clock in the morning. This is more of a problem with the outing co-ordinators, but still something that can be fixed by software
    What squadlist used to look like
    Continue reading

Baking a Hello World Cake

I have a soft spot for esoteric programming languages. They are (usually) perfectly functional languages, in the rather loose sense that they are Turing complete and thus capable of solving all the same problems as any other language; they do, however, function in an intentionally roundabout way. They include several types: those that minimise the instructions possible such that everything must be spelt out in the simplest possible terms, those that intentionally obfuscate in a parody of ‘real’ languages, and those that aim to represent the program as some other set of instructions; this is the class into which a language called chef falls.

The full specifications are here, however the general idea is to make the program look as much like a recipe as possible. Variables are ingredients, stacks are mixing bowls, input comes via the fridge, output goes via baking dishes and so on. The specification explicitly requires that “Program recipes should not only generate valid output, but be easy to prepare and delicious.”. Continue reading

RoboNucleicAcid: Genetically Generated Robocode Bots

Genetic algorithms is the name given to a branch of computing that uses a similar process to biological evolution to discover good solutions to problems that have many possible solutions, some better than others. GAs are generally used where the fitness function (that is to say, the function that defines how good a solution is) is far too complex to even begin to work backwards to a good/best solution. Robocode is a Java teaching game that is played by programming the behaviour of simple fighting robots; it provides a good place to experiment with GAs as there are an essentially infinite number of possible bots which are only capable of having their fitness measured by pitting them in battles. Continue reading

Adding wi-fi to a Raspberry Pi without a powered hub

It is a commonly known problem that the Raspberry Pi cannot provide enough power for most USB wi-fi adapters. This can be solved with the use of a powered hub, however I have plans to integrate the Raspberry Pi into other devices; due to space constraints I decided that it would be better to convert a dongle to draw power separately to its data connection, also taking the opportunity to reduce the distance that it projects past the end of the board.
The modified dongle plugged into the top USB port of a Raspberry pi Continue reading

A script to download 4oD

Anyone living in the UK will be familiar with the superb video on demand service run by Channel4; while it does have years worth of programmes, it doesn’t have an option to view the content without an internet connection. This is particularly frustrating as my TV doesn’t have an internet connection, although it does have support for USB mass storage devices. To work around this, I’ve written a ruby script that downloads 4oD videos to local MPEG-4 files. Continue reading

Updating my youtube music player

Recently the youtube search results page changed slightly; this caused my youtube music player to stop working properly. I’ve rewritten parts of it; not only to work with the new youtube search, but I’ve also taken the opportunity to improve a few other areas.

The biggest change is the integration of an automatic pause feature based on bluetooth proximity sensing. If a bluetooth device’s MAC address is entered, the music will automatically pause when that device leaves visible range; once it returns, the music will resume automatically. I have also added the ability to use 3 basic commands at the search prompt: /skip /pause and /play; they do exactly what you’d expect. Continue reading

Pausing Banshee using bluetooth proximity

In my continued efforts to control everything with bluetooth proximity, I’ve successfully nailed another target: Banshee media player. Banshee is the default media player supplied with Ubuntu and has some surprisingly useful command line arguments that allow it to be controlled from ruby scripts. I’ve written one that pauses banshee if I leave the room while something is playing and then resumes where it left off as I re-enter the room. Continue reading

Improving the aerial on a mini bluetooth dongle

I, like many people, have a soft spot for the online purveyor of tat that is ebay. When I wanted to add bluetooth connectivity to my desktop I went bought myself a miniature bluetooth dongle for about £1.50.
The miniature bluetooth dongle
It certainly manages being miniature and providing bluetooth connectivity, although the advertised 10m range is a little optimistic. After having troubles with proximity mains control due to a couple of dead spots, I got thinking about ways to improve the signal. Quite quickly I realised that the aerial was a good place to look. Continue reading

Using text to speech to announce new emails on arrival home

I’ve done some more tinkering with bluetooth proximity detection and have succeeded in making my life slightly more like a science fiction film. When I arrive home, my computer uses text to speech to greet me and tell me if I’ve got any new emails. This reuses the code from last week to detect the presence of my phone via bluetooth, with the slight alteration of tracking what the previous state was. We only want to trigger the announcement when the phone returns to the room, not the whole time the phone is in the room. Continue reading

Controlling the mains with bluetooth proximity

I’ve found another use for my parallel port controlled socket box; by using it in conjunction with a bluetooth dongle, I can detect when I have wandered out of the room. I can turn off a load of peripherals, then turn them all back on when I return to the room seamlessly. I’ve simply plugged the extension leads which power my monitors, speakers, kettle, lamps and fan into the parallel controlled socket then let a ruby script act as the brains of the operation. Continue reading