My programming projects

Welcome to the website of Benjamin Alexander. Nowadays I basically use it to mess around with programming. Here is a list of projects I have done or am working on at the moment, split into three parts - completed projects, projects in development and projects no longer in development.

Completed projects

These projects may still have more work done on them, but they are fully operational as they are.

Sports prediction game

This is my longest project, the one I have put the most work into and the one I have got the most pleasure from. It is a program into which you can put the fixtures for a sporting competition, people then enter what they think the scores will be and then points are awarded depending on how close their prediction was to the actual result. The person with the most points at the end is the winner.

The program is easily adaptable for different sports/competitions, I have run it for the Football World Cup and European Championships, and for the Rugby World Cup, 6 Nations and Rugby Championships (formerly the Tri-Nations). I have put some effort in to make the website secure, which is something that is particularly important when you have a database behind the scenes that includes people's personal details.

Across all the different competitions I have run, I have had a total of 160 entries for a total of 6143 predictions from 198 sport matches. Most of these results also have a link to a match report on the BBC, which means the website is also a nice database of football and rugby results.


Webley is loosely based on the little known board game, Wembley, which recreates the "magic of the FA Cup with amazing fidelity" through the use of rolling dice. It's fairly silly. My father-in-law mentioned that it might be fun to have a computerised version, and the more I thought about it, the more I thought it WOULD be fun to write and to play.

First you choose how big you want the competition to be (from 31 games to over 100), then the teams are distributed between the players, and then the game starts. Each team rolls a computerised dice to see how many goals they have scored - the winning team goes through. The numbers on the dice are dependant on a couple of factors - most notably what league the team plays in. It's essentially random. The fun comes from cheering on teams you like, booing teams you don't, and the occasional "cupset" where a team from a lower league beats a higher team.

There are a number of improvements compared to playing the board game version. These include.... a bigger array of teams, team ground names being displayed, random football pictures being displayed and historic results all being stored so you can relive past glories.

Blood Bowl Database

Blood Bowl is a tabletop game by Games Workshop, which is somewhat like American football, except more cartoon violence and comedy. It was made into a computer game and I take part in a league with some friends. After the game, a few files are produced in SQLite format. There are a few programs out there which can take these files and do interesting stuff with them, but none of them did everything the players in our league wanted them to do.

So, after a year or so of using only other tools, I decided to write my own. There's a lot more functionality to add, but it's fully functional and usable as it is. After a match, the files are uploaded. The SQLite files are then copied "as-is" into a MySQL database before the data is processed - some of it is simply copy-paste, but some of it involves updating existing records, making changes to several tables and so on.

As well as enjoying having my own little robust ETL process, this project was also good for practicing using object-orientated code, and modern PHP interfaces for MySQL. Future plans involve more google charts and importing the events file from the matches, which is a text file and will thus present a different challenge to importing SQLite files.

There are a number of improvements compared to playing the board game version. These include.... a bigger array of teams, team ground names being displayed, random football pictures being displayed and historic results all being stored so you can relive past glories.

Projects in development

Raspberry Pi

A whole community has built up around the Raspberry Pi, a tiny Linux computer that costs 30. The stated aim is to get the ability to program out to the masses, but tons of hobbyists are buying them too and doing all sorts of things with them. I decided to join in without any firm final goal, just tinkering and seeing where I end up. Click the link to view my blog, designed for people, like me, who are generally quite geeky but know almost nothing about Linux.

In the end I bought a touchscreen for it and set it up in the computer. It's a bit buggy though and I haven't got around to fixing it yet. It still has its uses though, and I really enjoyed learning Python and getting some OOP practice in.

Family Tree

The idea for this came from an occasional fleeting interest in my ancestry, and also as I got married I wanted to learn who all my wife's relatives are and how they fit in. A relational database is the natural place for this information. SQL Server was chosen as I had many MySQL projects in place already, and so I would have some personal data to test things on. Also, I could use it as a base to start learning a .NET language which could be useful thing to have on my CV.

The basics for this are in place already. I have planned the database well to store everyone, and written a script which can use a lookup table to find the relationship between any two people. The front end displays some basic information and lists their close relatives.

Future plans : to tidy up the front end, make data editable, enhance the data that can be stored and to learn about deployment options/security.

Rota creator

My church has a lot of rotas and a lot of people who help out with various things. I thought it would be a good idea to build a program to allocate some of the more complex tasks. The plan is for it to work over any given period, to have the ability to mark when someone couldn't help out, to have other elements of flexibility and to produce a fair and equal rota so far as possible. Also I would like it to be able to export results in CSV if so desired.

So far I have built most of the guts of the data storage part of the program and have a decent idea of how the various parts of the solution will fit together.

I haven't quite decided if it will have a SQL back-end or not. On one hand it will be a more robust solution if it does, but it shouldn't be complicated enough to need it and there was a part of me that enjoyed all the hacking around that was needed to get the pre-SQL version of my sports prediction game working, and I would like to have another go at it.

Improved National Rail live departure boards

This is borne out of a love for trains, my wife being a regular commuter on the trains and a knowledge of how rubbish the live departure boards can be. The basic problem is that they are hopelessly optimistic - if they are running late they always assume they will make up time that they rarely do. The only information displayed when you type in, say, "Oxford" on the national rail website will be that it is expected to be, say, 10 minutes late. However, if you click through, you can see that your train was 30 minutes late leaving the previous station so that's a more accurate estimation of when it will actually arrive at Oxford.

Another problem is that it doesn't realise, for example, that Oxford only has 1 northbound platform, so if an earlier train is running a few minutes late, that will have an impact.

All this information is available, it's just a matter of pulling it off the National Rail Enquiries website and presenting it all on one page. The basics are in place, but there's more to be done regarding presentation, click-throughs, presentation and reporting on live disruptions.

No longer used/abandoned

Sports prediction game - first version

This is similar to the now-used sports prediction game, but this was before I had a host with a MySQL database and before I was even that into databases. This meant that all information had to be stored in text files which meant a lot of code written.

This is impressive in its way; I had to write a lot of fiddly code to manipulate the text files in the right way and it did all work. However there are many advantages to upgrading to a database - easier to query the data and to store it, the ability to easily view past results, better security etc. Also the concept of sessions was absent from this version, so any time someone wanted to make a change, they had to put their password in. Nevertheless, this project was not without use as it could be used by someone whose host has PHP but does not have a MySQL database too.

It's also good to look at in comparison with my current prediction game site so you can see how far my coding/presentation skills have come. Do note that I lost a lot of the data in a web host disaster so it only shows the scores as of midway through the World Cup. Suffice to say I changed web hosts...

Online photo album

Worried about the privacy concerns behind sharing photos on facebook, I decided to code my own personal photo sharing website, requiring a logon, and I could restrict who could see what photos.

The basics of the security, logon and rendering large photos at a smaller resolution (and hence download) are working and I used it to share photos from a recent reunion I held for my university friends, and got some useful feedback. The logon code was borrowed from my predictions game site.

There is basic tagging functionality in there as well. I hope to expand on this, organize the photos better and upload a lot more photos. I also hoped to do some fun stuff with GPS however the GPS-enabled camera I bought hardly ever records the location and stores the EXIF data in a way that PHP finds impossible to understand, so that doesn't look likely at the moment.

This was abandoned when I bought a Syonology NAS, which includes their excellent Photo Station software, which can do all I was trying to do and more.