Skip to Content | Skip to Navigation | Skip to Search
Very True Things
“He talks to himself sometimes because he’s the only one who understands what he’s saying.”

Archive for the 'Work' category


I’ve been meaning to learn how to use a JavaScript library for some time. I first learnt JavaScript when it originally appeared in Netscape 2 and wasn’t working with it much in the years when it was knocked into shape by some proper programmers, so a library seemed to be the best short cut to more modern coding styles.

Looking at the various libraries I ranked them in order of attractiveness as jQuery > YUI > Prototype > Dojo. This was based on a first glance at file size, amount of documentation and supported features. That was over a year ago.

With jQuery in the lead it would be surprising of John Resig’s talk at @media would do much to change it my mind. But I decided to put his advice into practice and download a library and try it out. Twenty minutes after downloading jQuery I was starting to update a copy of the code used on VisitLondon.com

From this (not the greatest piece of JavaScript in the world - it was written by multiple authors in a bit of a rush - but not the worst either):

function topmenuClear() {
 var navRoot = document.getElementById("topmenu");
 for (var i=0; i<navRoot.childNodes.length; i++) {
  var node = navRoot.childNodes[i];
   if (node.nodeName=="LI") {
    node.className=node.className.replace("over", "");
    node.childNodes[0].className="";
   }
 }
}
function topmenuHover() {
 if(document.getElementById("topmenu")) {
  var navRoot = document.getElementById("topmenu");
  for (var i=0; i<navRoot.childNodes.length; i++) {
   var node = navRoot.childNodes[i];
   if (node.nodeName=="LI") {
    node.onmouseover=function() {
     clearTimeout(navTimer); topmenuClear();
     this.className+=" over";
     this.childNodes[0].className="over";
    };
    node.onmouseout=function() {
     navTimer = setTimeout(topmenuClear,2000);
    };
   }
  }
 }
}
function showlang() {
 if(document.getElementById('lang-list').style.display == "none") {
  document.getElementById('lang-list').style.display = "block";
 } else if (document.getElementById('lang-list').style.display == "block") {
  document.getElementById('lang-list').style.display = "none";
 }
}

To this:

function topmenuClear() {
 $("#topmenu > li").removeClass("over");
 $("#topmenu > li > *").removeClass("over");
}
function topmenuHover() {
 $("#topmenu > li").mouseover(function(){
  clearTimeout(navTimer); topmenuClear();
  $(this).addClass("over");
  $(this).find(":first").addClass("over");
 });
 $("#topmenu > li").mouseout(function(){
  navTimer = setTimeout(topmenuClear,2000);
 });
}
function showlang() {
 $("#lang-list").toggle();
}

Okay, so that’s probably the easiest part of our code to modify as it’s doing a very basic task - toggling visibility and adding event handlers - but it makes a dramatic difference to the complexity of the code. I’ve still got a lot of work and testing to do but I’d like to reach the point where the only JavaScript coding I have to do is implementing our functionality rather than reimplementing common functions.

Very True Mood:(chipper) chipper

@media 2008

Better late than never, what did I make of @media last week?

  • Number of talks that included LOL Cats: 1½
  • Number of talks that included Rick Rolling: 2
  • Number of talks that included comedy graphs: 2
  • Number of talks that included mention of Twitter being down all the time: I lost count, but at least 4

There are a few technical subjects (HTML 5, WAI ARIA, jQuery) that I hope to post more about later so here are a few impressions of each session:

Jeffrey Veen included some of my favourite charts in his talk (I have favourite charts/graphs/maps - what do you mean that you don’t?). Indi Young made me think that every single project I’d ever worked on had been poorly planned. Drew McLellan says “everyone hates their CMS” and he’s right. According to Stuart Langridge the fact that we use 410 responses on VisitLondon.com puts us in a very elite group. Nate Koechley explained why what I do is really very important. Richard Ishida baffled the audience with Unicode.

Good fun all round, roll on 2009.


Today [info]pink_weasel has been visiting her brother in his new flat. As said flat is in Bracknell, I declined. ;-)

Though mostly I was just too knackered from a frustrating week at work and a lack of sleep. So I stayed at home and cleared out a cupboard, played some computer games (the final cut scene in Unreal Tournament 3 reminds me of the end of Blake’s 7) and chilled out.

The farmers’ market in West Norwood seems to be struggling. Only six stalls this week - two meat, one veg, one bread, two pointless.

My computer runs a lot better with the case open. This probably isn’t a good sign. Still, soon I’ll have a Wii to play with so the damn PC will be relegated to email checking only.

A puzzle: I got a £50 cheque from YouGov. I thought I only had half that amount on my account there and as I haven’t been able to log in for a few months (I’ve requested password resets but the email never arrives) I really don’t know what’s going on.

Hmph.

Very True Mood:(melancholy) melancholy
Very True Music:Let's Talk About Girls - The Undertones

Visit London employs just under 100 people. So what are the odds that it employs someone who overlapped with me at Balliol and is just about to employ someone who was in the year above me at Reigate Grammar (and also employs someone who happens to be my wife)?

Very True Mood:(confused) confused

I met Jeremy Beadle once. He was hosting a charity quiz night that WW sent a team along to.

No one had him on their lists for this year’s Deadpool game.


This morning we launched a revised version of the Visit London home page. Along with a tie up with Trip Advisor, a new Japanese site and a site for the China in London season, as well as lots of behind the scenes improvements, it’s been a really packed January.

One thing that crosses over from behind the scenes to public is the addition of microformats to the site. hCard, hCalendar and hReview are all in use. Whilst hCard was straightforward to implement I found the hCalendar and hReview formats a little tricky to apply to our data. Anyway, install Operator and take Firefox for a whirl on the site and see what you find.


Rugby tomorrow. Oh yes, it’s Six Nations time again.

Very True Mood:accomplished
Very True Music:Coin-Operated Boy - The Dresden Dolls

Hi [ContactFirstName],

I have a web designer role based in Surrey.

My client is looking for somebody who can work self-sufficient and turn projects round quickly, while maintaining high standards both visually and technically.

If you have any of the following this will be useful.
AJAX, BACK-END BUILT WEBSITE AND Action script.

What is a “BACK-END BUILT WEBSITE”? And does “[ContactFirstName]” know how to build one?

Oh, and of course they can’t tell the difference between a designer and a developer (nor the difference between an adjective and an adverb).


Saw The Lord of the Rings musical courtesy of work and the producers. It’s not really fair to call it a musical as it barely contains more songs than the books do, though the fight scenes are superbly choreographed to music. The producers prefer the term ’spectacle’ and it fits that label very well. The design element is superb - Black Riders, Ents, Shelob, the Balrog are all achieved on stage in innovative but effective ways that you probably wouldn’t imagine. The use of crutches and prosthetics to distinguish the orcs may not be very politically correct but it does convey the twisted and deformed nature of their creation.

It’s quite long but still has to compress the story somewhat. The first act follows the first book reasonably closely (no Tom Bombardil, though he does get namechecked at the end, no Barrow Wights, no Glorfindel, and the Nazgul attacks on the Prancing Pony and Weathertop are combined), but after the interval things start to diverge rather more. I was starting to get suspicious when Boromir kept on talking about “The Kingdom of Men” rather than Gondor and it turned out that they had indeed combined Rohan and Gondor - and hence Theoden and Denethor, and Helm’s Deep and Pelennor Fields. Whilst this moved the plot along quite quickly it removed some of the subtlety from the story and a lot of “fan favourite” characters and scenes - no Eomer, no Eowyn, no Faramir, no Palantír, no Wormtongue, no Paths of the Dead, no Witch King. On the plus side they do, briefly, include the Scouring of the Shire.

The performances ranged from the very good to the very camp but even Malcolm Storry as an excellent Gandalf suffers somewhat in comparison with Ian McKellan in the films. In fact the hardest thing to keep in mind when reviewing or just watching the stage version is that it’s an independent adaptation of the book not the film. It aims for a very different feel - more mythic, more rooted in fairy tales, rather than the “realistic” fantasy of the films. In this sense it’s perhaps a little truer to the spirit of Tolkein even if it taks much bigger liberties with his story.


For the second time I got an invite to do a YouGov survey, only to discover after a couple of questions that it was about the work of my employer.

Oh well. 50p is 50p and I did ‘fess up in the free text answers.

Very True Mood:(mellow) mellow

I have a week off work. What shall I do with myself? Ooo, the possibilities are endless. I’ll probably spend a lot of time sleeping and surfing the web.

The last two weeks or so has been busy enough even with the drawback of needing to go and be stroppy in the office every day. It all started with the work summer party at London Zoo, which didn’t seem to involve eating any of the animals, but [info]pink_weasel got to molest a llama and only just failed in her mission to smuggle a penguin out with her. Last Saturday I attended a wedding where I got into a bubble blowing contest with a small child.

The weasel and I went to see Elling on Wednesday and it’s every bit as good as the reviews have been saying.

And last night was the much anticipated launch party for the new visitlondon.com web site. Which I still haven’t blogged about properly. Oh well.

I need a holiday. Oh good, I’ve got one. :-)

Very True Mood:(optimistic) optimistic

It lives.

More later.