Thursday, December 21, 2006

Yarm School Prank

It was pointed out to me the other day that the posh boys at Yarm Grammar School, a £900 per month private school, have drawn a penis on the roof of one of the buildings which is clearly visible on Google Maps.

Yarm Grammar School on Google Maps
Children are so immature.


Wednesday, December 20, 2006

iTunes "Recently Played" list on your website

The other evening I set about putting my iTunes "Recently Played" list on a web page. Not only that, but updating it regularly throughout the day. I got it working and you can see the songs that are on my turntable right now. It updates every hour and is automatically uploaded to my website, as if by magic.

Screenshot of iTunes in action
The non-technically minded need read no further.

Using XSLT to transform the iTunes XML library file

After investigating and discarding some AppleScript and Automator options, I ended up plumping for an XSLT solution. The iTunes application saves a snapshot of its library, playlists and smartlists in a file called "iTunes Music Library.xml". Translating this file into HTML should be a simple job but Apple's XML style is pretty poor; it's a list of key-property pairs, which is pretty nasty to transform.

XSLT is a open standard that describes the transformation of XML into other text-based forms using an XSL stylesheet. It has a pretty steep learning curve, so it's not for the faint hearted.

How does the transformation work?

A smart-list called 'Recently Added' is sought in the XML file using the XPath query:

/plist/dict/array/dict[string[1]='Recently Played']

The list contains an array of integers which represent the IDs of the tracks in the list. The songs that are represented by these IDs are found in the XML with the XPath


where $trackid is the ID of the track to be fetched. The iTunes XML to HTML XSL stylesheet can be found here. It runs in a couple of seconds on my Powerbook G4 on a 4000 song library.

How do I do the XSLT?

XSLT is easily done with free software tools such as Xalan or Saxon. I have always found "xsltproc" that comes with libXSLT to be small and fast. If you have "xsltproc" working, then a simple shell script can do the job:

xsltproc songs.xsl itunes.xml >the-ape-turntable.xhtml
scp the-ape-turntable.xhtml username@domainname:directory/

The script can be set to run periodically by installing it into a "crontab".

Other applications of this technique

The XSL stylsheet can be easily modified to work on any of the other Smart Lists e.g. "Top 50 Most Played", "Recently Added" or any Smart-Lists you have created yourself.

Labels: , ,

Saturday, December 16, 2006


Cyberspace is a funny old place. People seem to have a lot of time on their hands - enough to spend it walking around imaginary worlds, trading imaginary goods to imaginary people. Here are a couple of examples:

Second Life

Second Life ScreenshotSecond Life is a multi-player, three-dimensional world which you access from your computer. You create your avatar (how you look), walk and fly around the landscape chatting to people, spending your virtual money. You are paid a weekly salary and you can earn more by selling stuff to other Second Lifers - not real stuff, but virtual stuff like outfits, artwork, music etc.

Not all of Second Life is pornography. Big business is starting to muscle in and use it as a training environment to deliver seminars or as a way of promoting music via virtual concerts.

The bizarre thing is people spend their real money buying virtual-real-estate in Second Life. You actually have to pay ground rent per square metre for your building. There are two million residents of Second Life. You can try it out for free. I did. I was bored to sobs.


Eve Online screenshotEve is like Elite used to be on the BBC Micro except that the other spacecraft are controlled by other real people around the world. You are some sort of space trader person in huge galaxy. You fly around buying stuff, selling stuff or fighting. If it takes 45 minutes to fly to Alpha Centauri, you have to sit there watching space go by for 45 actual minutes!

Again, bizarrely, people pay real money for virtual stuff like spaceships. Try searching for Eve Online on eBay.

I'm going to have a lie down now. My head's hurting.


Wednesday, December 13, 2006

Christmas Presents

No-one likes Christmas as much as I do. I like the excitement of Christmas Eve, the presents, the music, the cheer and the warm indoor feeling. I'm not keen on Christmas cards, decorations, shopping or the "real meaning of Christmas" stuff. I do have fond memories of Christmas presents past:

Action man gear

Vintage Action Man - 1970sOne Christmas morning I gratefully received some garb for my Action Man. It consisted of a knitted jumper, a tent made from canvas and a wire coat-hanger for the frame and some sleeping bags. All of this gear was hand-made, the inspiration coming from Blue Peter. The action man had rubberised hands which were designed to grip the accompanying rifle but soon perished, leaving our hero a few fingers short of a compliment.

My Action Man served bravely for several years an his infantry capacity until armoured reinforcements arrived in the form of a green plastic tank. This wasn't the "official" Action Man tank, but a cheaper rival brand's tank. It was slightly smaller than the genuine product so he had difficulty persuing the war effort clumsily jammed into the turret.

I may be mistaken, but I may have had a motorcycle and sidecar for my Action man. I'm pretty sure he wasn't the "eagle eye" model.

I think my Action Man looked something like the one in the picture and nothing like the skateboarding, base-jumping, surf dudes that pass for Action Men now.

Subuteo Floodlights

Subuteo setI was a keen player of the flick football Subbuteo game Subbuteo and had a generic red and blue team that were often imagined to be Middlesbrough and Hartlepool, respectively. The men, on their sturdy circular bases, often were snapped by a misplaced elbow or foot. Casualties were glued with large blobs of Araldite making the players much heavier on their return from injury and with the appearance that their feet were encased in toffee.

The basic set contained a cloth pitch, two teams of players (the goalies had large green handles attached to their bases) and a couple of balls. More elaborate sets contained scoreboards, surrounding fencing and even stands.

One Christmas, I asked for a set of floodlights to add some night-time authenticity to my games (see picture of a top-of-the-range set that came with floodlights). Instead I got two pieces of chipboard hinged together with a light fitting screwed onto it. It was, however, really bright.

There was a home-made theme to a lot of my presents. I think my parents, like Action Man, thought the war had never ended.

TCR - Total Control Racing

TCR - Total Control RacingScalextic was the market leader in the field of model racing cars but I found it a bit mindless - just press the controller down and watch the cars racing around. A TV advert for TCR caught my eye. You could make the cars change lanes to overtake if you wanted to. It came with two racing cars and a "Jam Car" - car that was slower than the rest and had to be overtaken every few laps.

I got the pictured set one Christmas and was thrilled with it. It soon became a bit of pain because all of the electrical contacts became dodgy as they aged and soon it was a useless.


2006 in pictures

George Bush and a crying baby
As the year ends, the press fills its pages with review material. In a similar vain, see Reuters' Year in Pictures.

Saturday, December 09, 2006

Babyshambles in Middlesbrough

Pete Doherty's band Babyshambles are playing Middlesbrough Town Hall on Monday night. If I had known about it, I would have got tickets. Perhaps Pete will be bringing Kate Moss up to do bit of Christmas shopping in the Dundas Arcade. I've heard that Roy Mallinson, Middlesbrough's double-hard Mayor, is keen for Babyshambles to do bit of Fleetwood Mac and maybe even open a new branch of Greggs with him.

The only depiction of this historic event is through the medium of post-it note art.

Post-it Note Art #8: Pete Doherty, Kate Moss and Roy Mallinson open a new branch of Greggs

Post it Note Art #8 - Pete Doherty, Kate Moss and Roy Mallinson open a new branch of Greggs

Labels: , ,

Thursday, December 07, 2006

I am a pensioner

The other day, I took the day off work because I've got some holidays to use up before the end of the year. I didn't have anything specific to do, I just picked a random Tuesday. It felt like I was an old aged pensioner. I did a few "messages":
  • posted a parcel
  • took some books back to the library
  • did some light shopping
  • had a nice cup of tea
  • listened to Radio 4
  • browsed my local book shop
  • had a spot of lunch
  • tidied up a bit
  • did a bit of music
  • had a nice cup of tea and a biscuit while listening to Radio 4

I think I'm going to enjoy being old and decrepit.

Saturday, December 02, 2006

Walking back from Teesside Park

Teesside Retail Park is ridiculously busy at weekends. Ever since the tatty sports outlets, bed retailers and tat shops were replaced with the likes of Marks & Spencers, Borders and Virgin Megastore, the place has been far too busy to contemplate visiting.

But at Christmas time, there are some essential items to get. While driving along the A66 today I decided to get dropped off and walk back. It seemed like a fine idea; there's a footbridge over the A19 which means it should be a 20 minute walk for me. What I didn't realise was that the footbridge is miles away from the shops (just behind the bingo/cinema). Too late to turn back, pitch black and cold, I set off from M&S with some presents and a chicken in search of the footbridge. My route is highlighted below. (maps courtesy of Google Maps):
Walking back from Teesside Park
The journey involved walking behind all the shops, over a bridge, over some dark muddy scrub land behind the Hollywood bowl, up a 85 degree slope up to the foot bridge, over a fence, through a dimly lit park and along Whiney Banks Road to Acklam Road. it was about 40 minutes in all.

What I need is another footbridge between Stainsby Road and the back of Borders. That would make it about 12 minutes door-to-door.