Please visit my new campsite listing site ukcampingmap.co.uk


Archive for January, 2010

Paper

Friday, January 29th, 2010

I don’t think I’ve mentioned it before, but for the past half year or so I’ve been living as the lodger in the basement of a big family home. The patriarch is a psychologist, and on the ground floor his surgery is located. Sometimes patients come down to the basement to use my toilet.

Today I noticed (possibly influenced by the marvellous film Kenny) that in the space of a few minutes (while I was making coffee) a patient managed to use an entire roll of toilet paper. I don’t mean that a toilet roll was gone, but that one had been completely unravelled, leaving only the cardboard tube behind.

Which leaves me unsure as to whether he should be seeing a psychologist or booking himself in for an endoscopy.

Probably the best example of the sort of stuff I’d do

Thursday, January 28th, 2010

This blog is meant to do two things:

  1. Let the world know that I’m a decent front-end web developer
  2. Be the focus for a new doomsday cult

Number two is progressing nicely as no-one has gotten wise to my subliminal messages yet, but what of number one?

Let’s evaluate:

  • Design – it’s not finished yet (and never will be as I will hopefully do a redesign next month when I have a bit more time), which doesn’t look so good
  • Javascript, CSS, HTML – apart from mentioning the odd bug/annoyance there’s very little to show what I can do with these… aside from my jQuery plugins which hardly have pride of place either

Over the last few months I’ve come across a few blogs which, unlike mine, really cut the mustard when it comes to being an extended portfolio, putting mine to shame.

jasonsantamaria.com and dustincurtis.com are a little bit twitter generation for my liking, but one can’t deny that their blogs, where every article has a different design, are great examples of showing off on your blog.

But my favourite, which I came across today, has got to be www.romancortes.com. Most of his most recent posts feature him achieving visual effects which simply have to involve Flash… only they don’t, and in many cases achieve quite striking results without even using javascript; just pure CSS/HTML. As he himself admits, most of the demos aren’t much use in a practical website, but they’re still pretty impressive in showing what surprising visual effects can be achieved, and figuring out how he did them is quite a good test of your understanding of CSS. My favourites are the coke can and the old master.

Obviously, when you see that someone has managed to animate a rolling coke can using just one static image of a coke can label and some CSS, and after the initial wow has subsided, a Peep Show quote springs to mind:

Super Hans: I think this is probably the best example of the sort of stuff we’d do we’ve ever had.
Jez: Oh yeah. ’cause sometimes it’s really hard actually to do your own ideas

Do I have it in me to produce a more stunning showcase of what I can do? Who knows, but having just learned The Mason’s Apron on guitar I feel invincible!!!

Immunodeficiency

Tuesday, January 26th, 2010

I just solved  a bug which stemmed from the fact I forgot that javascript is a referential language, i.e. if you have a variable and you set another variable equal to it then it doesn’t in general clone the original variable, but merely just points both variables towards the same underlying object. This only applies to Arrays and Objects though, and to prove it here is a little demo (it turns out you can embed javascript straight into wordpress posts now!)

Irritatingly, if you have a bug which is caused by forgetting this principle then this will also make it hard to debug because it also affects how firebug reports information to you. When you console.log() an object or an array, firebug does the same as javascript – it creates a reference to an underlying object in the DOM. So, if you’ve been logging an object repeatedly in order to pinpoint when a rogue change takes place firebug will consistently provide you with references to the object as it is after your script’s finished running – not much use.

However, there is an easy way out*. console has methods other than .log(), and possibly the most useful is console.dir(). console.dir() takes a snapshot of any object or array, printing out each of its properties without maintaining a reference to the underlying object, and therefore giving a you a snapshot of an object as it is at the time.

*And a hard way (console.log() the properties of an object individually), which is how I resolved my bug, before  looked into what other methods console had