Nov 17 2009
a green leaf

Health and safety at work

This is a photo I took in Bejing a few years ago and have been meaning to upload it for ages.  The picture is of a couple of guys repairing a telephone line (or some sort of overhead cable).  The work was undertaken in the face of oncoming traffic.

ladder_guy

Street work in Bejing


Nov 16 2009
a green leaf

Introducing JTestConnect

logo

A couple of months ago I finished the first version of JTestConnect. It is a tool for supporting development teams with their unit test strategies.

You can annotate your interfaces/classes with annotations describing how the object should be tested. The tool then sits in the build process and can interrupt a build if test classes/methods are missing.

Ideally, this would be added to a Continuous Integration build system to enforce test coverage of important classes.

A more detailed description of what it does can be found on the project home page.


Nov 16 2009
a green leaf

Detecting HTML5 Features in Javascript

How can you detect if your browser supports HTML5 features in javascript?  Here’s how:

function isHTML5CanvasSupported() {
    return (typeof HTMLCanvasElement != 'undefined');
}

function isHTML5VideoSupported() {
    return (typeof HTMLVideoElement != 'undefined');
}

function isHTMLClientSideDBSupported() {
    return (window.openDatabase);
}

Have fun!


Mar 9 2009
a green leaf

A Nice Place For A Swim…

A nice place for a swim!

Near to Tikal in Northern Guatemala


Mar 6 2009
a green leaf

Using EasyMock to Create Stub Objects

There are two competing philosophies with regard to unit testing strategies; state based testing and behavior based testing. In state based testing we configure a starting state, execute a test method, and then examine the resultant state/returned result. In behavior driven testing we ensure that our test object collaborates with its dependencies in an expected way.

Continue reading


Feb 7 2009
a green leaf

Security Conference 2009 Protests

Some photos from the growing crowd protesting the Munich security conference.  The pictures were taken from Marienplatz (where the town hall is). The birds eye view pictures were taken from the upper floors of a bookshop in the square. I had been chatting away to a pair who were also enjoying the same vantage point. I mentioned that I had asked myself whether or not it would be a good idea to go taking pictures of all the police and vehicles and what ever else. One of them asked me “why?”, and I answered that “you never know”. He seemed irritated at my apparent mistrust of the police. I don’t mistrust the police (at least not in Germany), but you can always be in the wrong place at the wrong time. As I walked away my girlfriend pointed out that they both had hidden walkie-talkies and were actually under cover police officers. I went to the next floor up to get some more photos and noticed another man standing taking a picture with his mobile phone. After a few seconds of me pointing and clicking (and chatting) I heard his hidden radio (turned down to not attract undue attention). There were two more men on the top floor idly chatting with a bag at their feet and huddled against the window blocking the view. I received a strange look as I approached them as if their fellow officers had radioed up for them to look out for a suspiciously chatty Englishman.
g8_1g8_2g8_3g8_4
Continue reading


Feb 5 2009
a green leaf

Random Number Generator

Random Numbers

Random Numbers


Jan 30 2009
a green leaf

How Anaemic Domain Models Cause Bad Software

Using an anaemic domain model is often considered an anti-pattern.  The reason for this is that it encourages coders to duplicate code needlessly.  This is going to be a fairly short (and fairly trivial) post explaining one of the mechanisms by which this occurs (with an example).  The mechanism can be avoided with careful planning and strict coding discipline but it is quite a lot easier to apply good encapsulation.  The difficulty with avoiding the pit falls of an anaemic domain increases exponentially as more team members work on the project.
None of this will be new for anybody with a moderate understanding of OOP, but it is interesting to see how a small number of fairly innocent steps can lead to a real mess.

Continue reading


Jan 28 2009
a green leaf

The Curious Case of Matthew Smith

Some of you may remember those ZX Spectrum classics Manic Miner and Jet Set Willy (if not go here and here to play them in your browser immediately because you are missing out on some important computing history!). You may not know the fascinating story of Matthew Smith, the programmer who dreamt up and programmed these games.

jsw

You only have to look at Jet Set Willy to see that this is the brainchild of an eccentric.  Willy has thrown a party and his dominating housekeeper refuses to allow him to go to sleep until he has tidied everything up.  Through out the house are such nightmarish creatures as snapping toilets and killer telephones.  Willy doesn’t live in a bungalow; he lives in a mansion of ludicrous proportions (presumably paid for from his wealth acquired in the mining business), filled with deadly traps.  The various rooms of the house have names such as “The Banyan Tree” which he can use to climb up into the upper regions of his home.  The monsters kill with a single touch and the user is forced to jump with pixel precision to avoid falling into chasms and eventually being crushed by an enormous boot (in a Monty Python like manner).

After writing the game Matthew became the computer programmer equivalent of a rock star and eventually vanished of the face of the Earth.  His whereabouts were unknown and he became somewhat of a legend.  The mystery of Matthew Smith stirred many rumours, some true, some untrue.

Then, one day out of the blue, he came back.  Here is an interview with him recently broadcast.  He is no longer the long haired bedroom coder, but he still has a wild look in his eyes.


Jan 19 2009
a green leaf

Bonsai Tree

The bonsai tree in the sidebar changes every day.  It loses the leaves slowly through the week until, at the end of the week, it has none left.  As the new week begins, new leaves begin to sprout and the cycle repeats itself.  The tree graphics were done using the free graphics tool Inkscape and the graphics switching using a small piece of PHP code.  Please come back again tomorrow to see how the tree it doing.