blog archive contact about feed

Rob's Blog - September 2004

Contents

Here are Rob's Blog entries for September 2004.

Blog entries for other months can be found in the main blog index.

My First FOAF File

I've just put up my FOAFfile on the site.

It was initially generated using Leigh Dodd's FOAF-a-Matic.

FOAF is an interesting use of RDF. It is used to describe people and the links between them in a machine readable way.

You can see my FOAF file parsed by FOAF Explorer.

There are lots of opportunities to expand the information stored in the FOAF file due to the use of RDF. I can even create new elements as long as I provide a namespace for them and reference it in the rdf:RDF as an XML namespace.

One particularly interesting use of FOAF is Edd Dumbill's BlueFOAF. It uses Bluetooth to scan for friends and show who is near you in real life. However, it's usefulness may be limited as most Bluetooth devices only have a 10 metre range and so you could probably see your friends. :-)

PERMALINK - My First FOAF File
Entered: 2004-09-30 09:32:56
Modified: 2004-10-12 12:10:02

Guns Don't Kill People, Rabbits Do!

I saw this amusing take on Goldie Looking Chain's song, Guns don't kill people, rappers do.

Some of the road painters in Colchester have painted "Guns don't kill people, rabbits do" onto their vehicle.

Gun's don't kill people, rabbits do!

Entered: 2004-09-26 14:05:17
Modified: 2004-09-26 14:06:09

Red Bull Car

The Red Bull car is currently parked outside the office.

Red Bull Car

PERMALINK - Red Bull Car
Entered: 2004-09-21 16:18:15

My First CPAN Module

My first publicly released Perl module has reached CPAN.

Nokia::File::NFB allows the creation and manipulation of existing Nokia .nfb and .nfc files. These files are created by the Nokia PC Suite backup and restore program.

The perl module lets me go in and extract data from the backup files of my Nokia 7250 and Nokia 7610 phones. You still need to know how to actually handle that data, all the module does is extract, or allow you to add, new data.

Entered: 2004-09-21 09:24:53

Goldie Looking Chain In The Office

The GLC popped into the office today for a webchat on Kerrang.com.

Here are a couple of pictures taken with my Nokia 7610 camera phone of the guys in action.

Goldie Looking Chain

Goldie Looking Chain chatting away

Entered: 2004-09-16 13:55:55
Modified: 2004-09-27 09:05:01

Alternating Table Rows With Template Toolkit And CSS

Whilst looking at a potential recode of the Smash Hits Chart website, I came across the need to make each alternate row in the main chart table a different colour.

As the recode will be using Template Toolkit, this is simple.

The chart is passed as a list, so we have to iterate over it to get each entry out. I do this using a simple [% FOREACH %]. Template Toolkit thoughtfully provides us with a Template::Iterator object called loop inside the FOREACH block, so we can use the index() method to get the current elements list position. Using this, we just need to check if the value is odd or even to decide what colour to make the row.

Let's see some sample code. To change the row's colour I'm going to use two CSS classes called lite and dark.

<table> [% FOREACH entry = chart %] <tr class="[% IF loop.index % 2 %]lite[% ELSE %]dark[% END %]"> <td>[% entry.position %]</td> <td>[% entry.artist %]</td> <td>[% entry.track %]</td> <tr> [% END %] </table>

The magic is in the line loop.index % 2. It takes the remainer (modulus) of loop.index divided by 2. This returns either 0 or 1, which is what Template Toolkit uses to determine truth, so can be used directly in the IF statement.

Entered: 2004-09-13 16:09:48
Modified: 2009-03-19 11:46:52

A Visit To Bosham

Sunday saw me visit the historic town of Bosham in West Sussex.

Bosham was the place where King Canute famously demonstrated that he could not turn back the tide and got his feet wet.

King Canute's 8 year old daughter is buried in Bosham church.

Inside Bosham Church

The tide is also still important in Bosham. The coast road floods each high tide, and the pub has to have a watertight bulkhead door.

Flooded Bosham road

Watertight Bosham pub door.

PERMALINK - A Visit To Bosham
Entered: 2004-09-13 09:25:16

Morrisons Christmas Stock Goes On Sale

As summer is over, it must be time to start stocking up on Christmas goodies.

My Life As A Morrisons Employee, a blog written by (unsurprisingly) a Morrisons employee, says the first of Morrisons Christmas stock went on sale at 3pm on Friday, 3rd September.

That means there are only just over 100 shopping days left until Christmas. Buy now to avoid disappointment!

Entered: 2004-09-07 10:54:47
Modified: 2004-09-07 10:55:13

Wrong Type Of Cloud

More trouble for Southern's new Electrostar selective door opening.

Metro is reporting the 7.08am service from Victoria to the Sussex Coast was delayed because of "the wrong type of cloud".

The coulds were preventing the new Electrostar train's GPS system from picking up the train's location, forcing the driver to manually open the doors, an operation that may seem simple, but actually took 45 minutes.

Southern claim that staff were wrong to blame atmospheric conditions, but claimed the fault was actually to do with faulty components onboard the train.

Entered: 2004-09-06 10:00:45

On A Bendy 73 Bus

Today was my first trip on one of the new bendy 73 buses from Victoria to Oxford Circus.

Bendy 73 bus at Victoria

Although my last blog entry on the subject was one of optimism, actually travelling on the bus wasn't a pleasant experience.

The inside is very crammed and everyone was very tightly packed. Due to lack of space, people near the back of the bus tring to get off found it incredibly difficult as there was no space for the standing people to move into as they tried to get past.

The bus is supposed to be accessible, but it didn't seem very good. Stopping along Oxford Street the bus wasn't able to get close to the kerb, so pointed in at a V angle. Maybe it was because I was at the back it was worse, and maybe the front was close in.

There are no conductors on the bus as they were all made redundant with the ending of the Routemaster, and as the Oyster card readers don't work at present, most people were travelling for free.

Inside a bendy 73 bus

PERMALINK - On A Bendy 73 Bus
Entered: 2004-09-06 09:33:04
Modified: 2004-09-06 09:34:07

Printer Friendly Links Using CSS

I have been looking at ways to improve the printer friendly version of my site lately.

Once printed, URLs of links aren't printed, and sometimes that's not a good thing.

I was thinking about listing all the URLs at the end of page and hiding them with by turning off their visability on the master CSS file, and only having them visable using the print CSS file.

However, I came across an interesting article on A List Apart called Going To Print. This suggested using the power of CSS2 and CSS3 to show the URL as part of the link. For example, a this link...

A List Apart

would become...

A List Apart (http://www.alistapart.com/)

Mozilla based browsers such as Firefox implement CSS2 and some of the CSS3 recommendation specification. Unfortunately Microsoft's Internet Explorer doesn't, so this won't for users wanting to print from that particular browser.

To add the URL after the link text, we have to use the CSS2 pseudo-element selector :after. For printer friendly version of my site, I only want links that are part of the mainbody class to be expanded.

.mainbody a:link:after, .mainbody a:visited:after { content: " (" attr(href) ") "; font-size: 80%; font-family: Courier, sans-serif; }

Here I'm making sure any visted or unvisited links are treated equally when being selected by the stylesheet. I'm adding the value of the href attribute, surrounded by brackets, to the content of the element. I'm also using a fixed width font and shrinking the text size down a bit.

This is fine, but unfortunately if I use relative links on the page it gives me results like

Rob's Blog (/robblog/)

instead of

Rob's Blog (http://www.robertprice.co.uk/robblog/).

This is where CSS3 comes to the rescue. We can use a conditional attribute selector to see if the href attribute starts with /. If it does we know it's a relative link and we want to prefix the URL with http://www.robertprice.co.uk. We do this using the following bit of CSS.

.mainbody a[href^="/"]:after { content: " (http://www.robertprice.co.uk" attr(href) ") "; }

The downside of using CSS3 is that it is not a finalised standard, and as a result breaks the W3C's CSS Validator.

We can put this in a printer only stylesheet using HTML like this, ensuring the media attribute is set to print

<link rel="stylesheet" href="/includes/printstyle.css" type="text/css" media="print" title="printer stylesheet" />
Entered: 2004-09-03 14:02:38
Modified: 2004-09-03 14:06:38

Attitude, The Worlds Largest Pig

This is Attitude, the worlds largest pig.

He lives at Mistley Animal Rescue Centre and it's estimated he weighs about 100 stone. This snap was taken on Sunday on a trip to the centre.

Attitude, the worlds largest pig

Entered: 2004-09-01 09:31:53

Satellites To Blame For Faulty Doors On Electrostar

Southern have confirmed to the BBC that it's a satellite fault that locks it's trains doors.

The selective door opening monitors the position of the train via GPS and opens the correct number of doors when the train is at a station with a short platform. However, the signal strength varies meaning an accurate reading isn't always possible forcing the driver to reset the system and open the doors manually.

I have blogged my experiences of this before, see the related links for some further details...

Entered: 2004-09-01 09:10:10