Nasa's Space Shuttle Atlantis Transiting the Sun
Tank Wars in G3D
Spooky Case of the Wem Ghost
Compiling and Installing Freespace 2 on Ubuntu Linux
Reading Email with PHP and IMAP/POP3
Installing Proprietary nVidia Drivers on Ubuntu Linux
Spooky Case of the Wem Ghost Tuesday, 18th May 10
compton

There's an interesting story doing the rounds which you may or probably won't have seen recently. The Shropshire Star reports on an old chap who spotted what appears to be a very uncanny resemblance between a 1920s B&W photograph and a famous picture of an alleged local ghost.

See the story with full images here.

I was intrigued, and decided to compare the two images a bit closer, and there does seem to be a striking resemblance. See what you think using the image below. Click and drag the Fade control to fade from the 1990s image of the so-called Wem ghost to the 1920s image of a very much alive and sulky looking girl. You can use the other slider to zoom in or out on the image for a closer peek.

These images are both taken from the Shropshire Star story, and are untouched except to shrink the 'ghost' one so that it is the same size as the

 ... ...
Software Development Employers in Birmingham, UK Monday, 25th October 10
compton

Rather than go through agencies, who charge a big fat fee and often only serve as an obstruction between employer and potential employee, you can apply direct to the company, if you can find them. Coder Stack only posts jobs direct from employers.

Below is an independent list I've put together of software development firms in Birmingham, UK. If you know any I have missed, please do let me know in the comments. Thanks, and good luck in your search.

Proteus Software is based at Birmingham Business Park, B37 7YD, and they produce warehouse management software using Progress infrastructure software.

Borwell Software is a Small, Professional Software House based in Malvern that

 ... ...
Taking a Dump with MySQL Monday, 1st December 08
compton

The mysqldump command is widely documented because it really can be very useful, and also because it offers a blistering array of options. It's most obvious use is for dumping databases for backup or relocation purposes:

mysqldump [options] [database [tables]]


It can either dump a whole database in one go, or you can specify a list of specific tables to be dumped.

Dumps are simply SQL statements which when executed will recreate the database (or specific tables or rows). This makes the command potentially useful for cross-platform data-exports, should that ever be important. Consequently though, mysqldump's output will benefit hugely from compression, which is easily accomplished by piping the output into gzip:

mysqldump --extended-insert=FALSE --compact -c -C --single-transaction --add-drop-table --quick -u dbuser -p myDatabase myTable1 myTable2
 ... ...
Javascript Snippets Friday, 5th September 08
compton

Finding an Element's X and Y Position


The following JavaScript function will return an array containing the X position of an element's left edge, the Y position of the element's top edge (these two are the element's top left corner), the element's right edge's X value and its bottom edge's Y value (and these two are the element's bottom right corner).
<script> function getCoords(element) { var curleft = curtop = 0; var originalObj = element; if (element.offsetParent) { do { curleft += element.offsetLeft; curtop += element.offsetTop; } while (element = element.offsetParent); } return [curleft, curtop, curleft + originalObj.offsetWidth, curtop + originalObj.offsetHeight]; } </script>

To demonstrate it, the following mouse handler has been attached to the page. Click on any item to see a  ... ...
Garmin Edge 205 GPS Cycle Training Tool Saturday, 20th December 08
compton

The Garmin Edge (image stolen from www.tramsoft.ch) is a pretty cool little bicycle gadget. It is basically a cycle-mounted GPS receiver. It has no maps - you can't use it to plot a route along the public roads like you can with a car sat nav.

You can however program it with a route which you've planned elsewhere (e.g. Google maps), and you can also record a route which you can download on to your PC. As well as this it's also an accurate speedometer - which is what I was really looking for when I came across it.

To download data to and from the device, I use a program called gpsbabel, which runs under Linux, Windows and Mac OS-X. To download a recording of a route, use:

gpsbabel -t -i garmin -f /dev/ttyUSB0 -o gpx

 ... ...
Compiling and Installing Freespace 2 on Ubuntu Linux Sunday, 30th December 07
compton

The first thing to do is install Freespace 2 under WINE (you will need WINE already installed and configured for this step). If you have the retail CDs, insert the first disk, browse to it in nautilus and double click the setup.exe file. As a Windows executable, it should start up using WINE. If you don't own the retail disks, read up on the open freespace wiki and forums for other methods of getting hold of the necessary data files for the game.

Proceed through the setup as if on Windows, but without the nagging feeling of nausea. I installed to the default location, although you may be able to install to another location. The only thing you may get stuck on is when it asks for the next disk - here you just need to put in the required disk, and change the path in the dialog accordingly (eg when you put in the 2nd disk, change the path from /media/cdrom/FREESPACE2_1/ to /media/cdrom/FREESPACE2_2/).

Once

 ... ...
Nasa's Space Shuttle Atlantis Transiting the Sun 16 May 09
compton

The following image shows the space shuttle Atlantis in transit across the sun. It was taken on Tuesday, 12th May 2009, by some froggy-sounding geezer called Thierry Legault, about 100 Km south of the Kennedy Space Center in Florida, USA:



Here's another image from the sequence, which lasted 4

 ... ...
Reading Email with PHP and IMAP/POP3 20 Apr 07
compton

Sending email is very simple in PHP, thanks to the mail() function. So what about receiving it? Obviously this would be useful for webmail, but my intention is to allow remote control of a PHP app, which is restricted to specific IPs.

The idea is this:

  1. Check at set intervals for email from a specific sender containing a specific phrase
  2. Send an email to that sender containing a unique code and asking for confirmation by reply (this is to
 ... ...
XML Parsing and Display of GPX data in Java 26 Jan 09
compton

With all these GPX recordings of routes I'm collecting, I wanted to view and compare details of past routes in a more user-friendly manner than poring through reams of XML output. The Google Maps API would be great to incorporate somehow, and it is freely available for JavaScript use. However I decided to be awkward and write a desktop application in Java. I'm figuring that I'll find some way around the problem of getting graphical map imagery later.

So far I have a small Java

 ... ...
Choc Chip Cookies 2 Jun 11
compton
250g brown sugar
250g white sugar
280g butter
2 eggs
300g choc, broken
half tsp bicarbonate of soda
half tsp salt
500g plain flour

mix sugar and butter until creamy & fluffy. Add eggs and choc chips. Add bicarb & salt to flour, then mix into other ingredients.

Place golf-ball sized amounts of mixture evenly on a baking tray.

Cook in a preheated oven at 180 c for 12 minutes until lightly golden.
Favourite Wallpapers and Desktop Themes 17 May 09
compton
Here are some wallpaper images that I've found around the place.
Future of Computing: Silent, Capable, Low Power 13 Mar 09
compton

In the early days of home PCs, back in the days of the 386 CPU, the machines ran almost completely noiselessly. The processor itself required no fan, and there was no call for case fans. The only fan would be found in the power supply, where it cooled the large step-down transformers.

Not so any more. Start up your home PC and you might as well be transported to the deck of an aircraft carrier. You have a CPU cooling fan, often another fan on your graphics card, and more and more

 ... ...
Installing Proprietary nVidia Drivers on Ubuntu Linux 22 Dec 07
compton
This article refers to Ubuntu Gutsy Gibbon (7.10, 32-bit), but the upgrade to Hardy Heron (8.4) also messed up my screen resolutions, as I expected it would. At least this time I was prepared, and I was relieved that the script here works just as well with Hardy. It also appears to work on Debian - at least, it worked great for me on Debian amd64.

I had had a load of problems getting the default restricted drivers running when I upgraded to Gutsy, and at  ... ...
Joomla Templates 23 Nov 06
compton

The Joomla Template system is very powerful and seemingly elegant. It will be essential for our graphic designers to be able to create templates that give the required professional, and unique, look and feel to our clients' sites. Part of this will necessitate an awareness of exactly how the templates work, so that new ones can be built and deployed smoothly.

There are actually two sets of templates on a site - the public ones which determine how the public pages appear, and the

 ... ...
Making Joomla Modules 4 Dec 06
compton

There are two essential files: one the XML descriptor, and two the PHP code. Both filenames begin mod_, then are followed by the name of the module, and the appropriate file extension of course.

So, to make a new featured items module (or really a special offers module) is fairly straightforward. The problem is how to mark products for display in this module. It would require some new field in the database, say an extra column in the #__{vm}_product

 ... ...
A Simple Terrain Model 5 Jun 07
compton

I now want to look into how terrain can be modelled in a 3D game. My feeling is that the terrain model must support a couple of functions, as a minimum. These are elevation(x,y,z), which returns the height of terrain below the co-ordinates passed in, and slope(x,y,z), which returns the slope of the terrain at the specified point.

If we consider a simple single-level terrain, then we can say y =

 ... ...
xorg.conf Settings for a 5-button Mouse in Linux 23 Dec 07
compton

Replace the existing entry for your mouse in /etc/X11/xorg.conf with the following and restart X:

Section "InputDevice"
   Identifier   "Configured

 ... ...
Tank Wars in G3D 2 Aug 06
compton

This little game will be a simple two player effort, where each player controls a tank within a restricted environment. The environment is a simple rectangle, where the players' tanks can only move within that rectangle. Also within the rectangle would be various static obstacles. The obstacles would be implemented as an array of Wall instances, à la space-station interior in my first OpenGL game.

The player controls their tank in Battlezone style - each side's tread can be moved

 ... ...
Formating the Category Listing 11 Dec 06
compton

The category listing is displayed on the VirtueMart 'home page', ie option=com_virtuemart on the URL, but no page or other parameter.

Going into the /templates/soinnovate/index.php file, and uncommenting the call to mosMainBody(), reveals that the content of the page I'm looking at is built by this function.

Searching for function

 ... ...
Finally Fixing the Broken Spoke on my Bicycle 6 Apr 07
compton

Since early last week, my pushbike has had a broken spoke: the first spoke to break on this bike. My previous bike was always getting broken spokes - for normal people, this is apparently unheard of. I put it down to a combination of the facts that I rode that bike regularly - daily to work pretty much every day for 2 years, plus pretty much everywhere else: swimming pool, pub, shops... It had done well over 1000 miles of pretty tough urban riding. Also, I weigh somewhere around 15 stone, and

 ... ...
The State vs The People 8 Jan 11
compton

what is the role of state? By definition, the state and the people are distinct. Regardless of the current spin that we have a democracy - rule by the people - only an idiot or deluded idealist would think we have any such thing. In fact we currently live in a liberal capitalist state.

Is the state's function to serve the people, or are the people to serve the state?

There is pressure from both sides, the idealists who believe that the state exists to serve the people on

 ... ...
Duplication and ET 25 Jan 06
compton

A friend of mine recently said that watching kids is fascinating because you can see how they copy each other, and that copying is at the heart of learning. It appears to be a basic element of human nature - if we hear a sound, such as a car engine or a strange animal cry, we can often do a reasonable attempt at duplicating it with our own voice. Babies and children learn language and behaviour in large part by copying what they've witnessed others say and do in similar

 ... ...
Convert GPX to OpenGIS KML Encoding Standard (OGC KML) 21 Dec 08
compton

There are a myriad of XML formats for encoding GPS data. Google has a preference for Keyhole Markup Language (KML) and its zipped form, KMZ. gpsbabel, an open source tool for interacting with GPS devices that is compatible with Linux, Windows and Mac OS-X, has GPX (GPS eXchange Format, an XML schema designed for the transfer of GPS

 ... ...
Minor Prang 24 Apr 07
compton

Returning from Redditch in the Carisma, along the main road to Birmingham (the A441 or A411 I think), I came round a corner and noticed a guy walking on the pavement. He was just coming up to a drive way, with some kind of round sign, perhaps No Entry. He was holding the red plates of the trade plater, so I decided to stop and offer him a lift. I checked mirrors, indicated, and pulled in.

The car behind me appeared to have no difficulty stopping, it certainly didn't appear to be

 ... ...
World Cup 27 Jun 06
compton

Quarter finals now. Germany against Argentina - Germany won all their Group games, and won 2-0 against Sweden. Should win surely? Odds on them are 2.76, pretty good. 3.05 for a draw. I could see Germany doing it 2-1 or 1-0.

Also up are Italy vs Ukraine. From the odds, Italy are the clear favourites. 1.63 on them to win, 7.6 on Ukraine to win. 3.75 for a draw.

Brazil vs France - Brazil favourites, 1.94 and 4.8 on France. Draw 3.5

England are playing Portugal.

 ... ...