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 →
I like drinking tea, however it’s not unusual for me to make the tea then get distracted and forget until 20 minutes later; this results in warm, stewed cup of disappointment instead of the tea I’d intended. To help prevent such tragedies, I’ve made myself a teapot stand that reminds me to pour the tea once it’s sufficiently brewed: Continue reading →
When we were younger, my brother and I had a game of ‘brother-proofing’ each others cards; this consisted of covering the envelope with as much tape as we could before we were told off for wasting it. This year I decided to revive this game; on Christmas day I presented my brother with his card: Continue reading →
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 →
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. Continue reading →
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 →
I recently got my hands on a Nexus 7 tablet; while it is capable of supporting USB peripherals, like most tablets it lacks a USB A socket. Instead, the micro USB socket must be used with a USB OTG (On-The-Go) cable; this utilises the otherwise unused fifth pin in the micro USB plug to switch the tablet into host mode. To avoid having to carry around an extra, I’ve added a switch to allow a lead to function both in standard and OTG mode. Continue reading →
With the nights drawing in, sitting in the garden without some form of heater in the evening is starting to become less appealing. Combined with an abundance of wood as a result of the several trees I felled this summer, building a log burner seemed like an excellent idea. I decided to base it on an old 7kg gas bottle that was lying around; it’s a nice size and shape, and made of thick, good quality steel that won’t burn through easily. Continue reading →
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 →
I recently bought a new camera; it’s a Canon Powershot A800. Although it’s only a basic compact camera, I specifically chose one that can run CHDK; this is a replacement firmware that allows access to just about every feature imaginable. One thing I wanted to try was to take regular shots over the course of a night so that I could combine them to create a photo of star trails. I quickly realised that powering the camera with batteries limited shooting to a couple of hours and the cost of batteries was going to start mounting up. With canon wanting about £50 for an official mains adaptor it was time to make my own. This is what I came up with: Continue reading →