Leaving wordpress.com?


WordPress
WordPress (Photo credit: Adriano Gasparri)

I first had a blog when they were still called “web logs” (yes, kids, that’s where it comes from) – I never thought it would take off, though I also thought it was one of those ideas (like intranets – remember them?) that were so beautifully simple that I wish I had thought of it. So, what do I know anyway?

I used to host my own (WordPress) blog and I am wondering if I should do that again. It’s not that I dislike wordpress.com, but it’s a pain not being able to post any Javascript or similar material. The disadvantage, of course is the cost (hosting – I used to host the blog on a machine at home but that’s just too extra as my kids would say – or did, I think this this term is already out of fashion) and the hassle of upgrades (though if I set the permissions right that should go away).

Any thoughts, any one?

How many languages can you recognise?


Java (programming language)
Java (programming language) (Photo credit: Wikipedia)

This site has an extensive online quiz on computer languages.

I managed just 11/75 (actually it was 12/75 but I pressed the wrong key when typing ‘Java’): a miserable 14.67%.

I missed some of the languages I use regularly yet got some I have never used, or maybe not used for close to 30 years (though I did, relatively recently, translate the Reingold-Tilford algorithm for drawing Red-Black trees from the original Pascal into C++, so maybe that helped.)

Love to know how you score.

The tyranny of the arts graduates continues


Michael Gove speaking at the Conservative Part...
Image via Wikipedia

I imagine in Michael Gove‘s world, this has been a good week. The UK’s secretary of state for education has been in the news a lot this week, and that seems to be the key metric for him – after all his qualifications for the job essentially seem to be that he was once a journalist (and a militant and active trade unionist – a friend who worked with him at the BBC once told me he was deployed to ensure that “the Tories all came out” during disputes at the Corporation in 1994.)

The two equal pinnacles of Mr Gove’s week would appear to be his writing a preface (!) to the Bible that he is sending to all schools (he doesn’t seem to understand that Catholic schools – of which there are rather a lot – will not use the text he is sending them, never mind the questions of what the state-maintained Jewish and Muslim schools will think) and a speech he gave to Cambridge University earlier in the week where he waxed lyrical about high literature but seemed to have nothing or next-to-nothing to say about engineering, maths and science.

Matt Pearson puts it so much better than I ever could:

Gove rarely talks of skills which can be used in the modern economy, he does not mention collaboration and teamwork, communication skills and the ability to use a range of technologies to get a job done. He does not talk of creativity and entrepreneurship, of engaging with the information society and introducing young people to the rigours of engineering or computer programming. Presumably as his own education did not cover these elements, and Jane Austen wrote very little in JavaScript, these disciplines have not entered his purview.

530 lines of Javascript


I have just written that amount of code in what I persist in thinking of as a toy language (it was actually somewhat longer until I refactored the code to group some common functions together),

I had to do this for a coursework exercise – a lot of effort to be honest for what is at stake – processing a rather large XML file with some XSL. The Javascript essentially manages the parameters.

At the end my conclusion is that I don’t really see why anybody would want to write that much client code if they could possibly help it. Of course it transfers the computational burden to the client – but at the cost of hundreds of lines of interpreted code which is essentially under the control of the people who write the engines in the Firefox and IE browsers. In the real world that points towards a support nightmare.

Having written a fair bit of Perl (and AJAX) stuff in the past the whole thing felt unnatural – dozens of lines, much of it designed to handle the differences between the browser engines, that could have been handled simply on the server side.

One thing that I was convinced of was the potential power of XSLT: though I was not quite prepared for the revelation that it is Turing complete (ie it would be possible to write some XSL that would process any algorithm/task solvable through a finite number of mechanical steps). Though I shudder to think of how big a stylesheet would be required to handle all but the smallest of task.

But the potential power of XSLT is not the same of thinking of many practical uses for it!

Dealing with 0x80600001 errors


Maybe you have just seen a message like this:

Error: uncaught exception: [Exception… “Component returned failure code: 0x80600001 [nsIXSLTProcessor.importStylesheet]”  nsresult: “0x80600001 (<unknown>)”  location: “JS frame :: file:///home/adrian/webtech/cia.html :: fulltable :: line 47”  data: no]

If you have then chances are you are working on some XSL/XSLT (the above comes from a piece of coursework I am working on which manipulates an XML representation of data from the CIA World Fact Book).

The error indicates that your XSL is broken and non-compliant and the problem is that Firefox/Mozilla is much stricter about what is broken than it is likely your command line XSLT processor is: the piece of XSL which generated the above message seemed to fly through xsltproc on my Linux box.

The best way to fix this is to take out the lines, one by one, from your XSL and look for the one that breaks the transformation. To avoid being inadvertently tied up in some issue of plagiarism later on I cannot post the XSL I was working on when this came up, but I had a line like this:

<xsl:apply-templates match="//item"/>

That is bad XSL – the match should be a select but as xsltproc happily covered up for my mistake and generated the XHTML I was looking for I could not understand why Firefox was flagging the error on this line of Javascript xsltproc.importStylesheet(xmlxsl).

It also took me a while to find an online explanation, so I wrote this.