Author Archive

Cookie Law Article

by on May.08, 2012, under News, Technology

I’ve had an article I wrote for work picked up by a few blogs recently – the UK is gradually waking up to the fact that endemic use of cookies (and similar technologies such as flash cookies) may not be such a cool idea and that the widespread use of this stuff is not great for personal privacy.

That is, unless you are an Internet Marketeer…

Impending ‘Cookie law’ could mean £500k fine for businesses

 

Leave a Comment more...

Project Management Rap

by on May.08, 2012, under Random, Video

Straight from the school of ridiculousness that is my mate Chris (ace Sax dude and management trainer) comes this bizarro cheese-fest of a music video extolling the virtues of the GANTT chart…

Be warned – kittens may suffer as a result of watching this video!

 

 

Leave a Comment more...

Accurate Postcode data for the UK and Northern Ireland

by on Jun.06, 2011, under Knowledge Base, Technology


Getting accurate postcode data for use in my programs has proved to be an interesting technical challenge, despite the availability of free services such as those from Google.

I needed a UK postcode to Latitude/Longitude conversion tool that would work offline, which made the Google API’s completely useless.

A freely available dataset was made available from the Ordnance Survey under the moniker of “Code-point open”, however this is missing some data (notably Northern Ireland) so can’t really be called complete, and additionally it does not provide locations in Latitude/Longitude, but instead it uses Ordnance Survey Grid references.

If you need to do this, then hopefully the tools here will be of some help.

First we need to grab the Ordnance Survey Code-point open dataset. They don’t provide a straight link, so you will need to register to actually get access to the data. Once downloaded and extracted you will have a folder full of CSV files.

Secondly we need to convert the grid references to more useable LatLong values. Chris Veness has written some Javascript to do just that – as well as writing some incredibly informative articles about how this stuff actually works (there’s some horrible maths involved!). I spent a couple of evenings converting his scripts to Python and wrote a little data extract utility which put all the data into a SQLite3 database.

Another couple of hours to write a set of wrapper functions around the database and include the validation rules from the UK government data schema and hey presto! We have a usable postcode_utils module.

This just leaves Northern Ireland…

It turns out that the Northern Ireland Statistics and Research Agency (NISRA) have some GIS data available in ESRI ShapeFile format. There is a useful Python library to work with ESRI Shapefiles and it took a matter of minutes to extract the coordinates from the NISRA data, that provides postcodes in… bah! another Grid System, but this time it’s the Irish Grid!

Some more hunting online to get the right values for the grid transformations and the Geoid dimensions used for each grid system and a bit of tinkering with Chris Veness’ code and we are done! Here is a Sqlite3 database containing all the postcodes in Great Britain and Northern Ireland with accurate Latitude and Longitudes (more accurate than some Web Services I could mention) and some Python to use with it. Also, this information is all freely available and free for use commercially and non-commercial use (provided you give attribution as mentioned on the various sites linked to above).

If you find this useful, please let me know by using the comments feature. Also, if anybody has a source of data for the Channel Islands or the Isle of Man I would be very please to find them!

3 Comments :, , , , more...

Generating HTML5 using XSLT

by on Jan.28, 2011, under Technology, Tutorials

HTML5 Logo

Recently, I have been updating some of my HTML generation tools to output valid HTML5, rather than the XHTML 1.0 standard I have been using for the last few years. The main advantage from my perspective is the ability to use the more semantic block elements, such as the nav, section and article elements.

In general this is a fairly straightforward task, as I am generating clean XHTML using XSLT and my template library works pretty well, but I ran into some problems whilst validating the output using the W3C Validator.

The first issue is to sort the DOCTYPE out. The XHTML doctype looks like this:

<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

This is easy to generate in XSLT using the following output element.

<xsl:output encoding="UTF-8" indent="yes" method="xml"
    omit-xml-declaration="yes"
    doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />

This unfortunately forces the document to validate against the XHTML 1.0 specification which does not include all the lovely new semantic elements – which means that my new documents are suddenly invalid!

We need to generate:

<!DOCTYPE html>

which is really hard to do using XSLT. I have read a number of articles that suggest you output the element as text, however this is extremely ugly and as it turns out, incorrect.

The correct XSLT incantation is:

<xsl:output
     method="xml"
     doctype-system="about:legacy-compat"
     encoding="UTF-8"
     indent="yes" />

This forces use of a dummy DTD (about:legacy-compat), which is the W3C recommended way of not using a standard DTD URI.

Now the W3C validator will happily validate against the HTML5 specification rather than the XHTML 1.0 specification.

11 Comments :, , , , , , more...

The Strange (Knighton Heath Demo) – giveaway

by on Jan.15, 2011, under Free downloads, Music, The Strange

White Strat

Although I don’t seem to have any early recordings of The Strange, I managed to locate these which were made by the last incarnation of the original line-up (Dave, Richard and myself with Graham White on drums) some time in the late 90′s. The demo was made at Knighton Heath Music Centre in Poole and was engineered by Dave Thomas (of Manitou fame).

This era was probably the last time that The Strange was a going concern as a live band – once Graham quit (for personal reasons unrelated to the band) we migrated to my flat, and although did lots more interesting experimentation, the music would have been harder to perform live relying as it did on drum loops, samples and sequencing as much as on drums, guitar, synth and bass.

Anyway, enough rambling, here are the tracks.

These Wings

Monkey

Small World Big Sky

1 Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!