Archive for January, 2006

Young man, here’s a language for you

Sunday, January 22nd, 2006

Just found this brilliant filk at http://www.dpawson.co.uk/xsl/sect1/intro.html:


RSS is dead, long live Atom!… err… sort of…

Saturday, January 21st, 2006

Having found out that, unlike RSS, Atom allows embedded XHTML (and moreover is infinitely better defined), I’ve spent this evening converting my blog to emit it instead of RSS. So, if you’re reading this at http://sucs.org/~pwb/blog/blog.py, you’re looking at Atom with XSL instead of the old RSS with XSL. For some silly reason Atom still uses plain text dates instead of XML, but that’s not actually a huge problem for the XSL as the format it does use, ISO 8601, can be manipulated using an XSL date-time library.

Annoyingly, it seems that although Planet understands Atom to a degree, it can only cope with content as CDATA (which ought not to be interpreted as XHTML elements, as Planet does, but rather as plain text). So my feed, whose content elements contain XHTML divs and are marked with the type="xhtml" attribute as the Atom spec dictates, are nonetheless stupidly interpreted as plain text. It’s exactly the reverse of how it should be handled. So my old RSS feed is still there, at least until such time as Planet gets fixed, but is deprecated and will probably not get maintained any more.

Open sauce

Sunday, January 15th, 2006

Yes, I was bored…


class Gravy extends Sauce throws UtensilNotFoundException {
    public Sauce(Ingredient meatJuice, Ingredient flour) {
        Utensil whisk = kitchen.findUtensil("whisk");
        Utensil bowl = kitchen.findUtensil("bowl");
        bowl.add(meatJuice);
        bowl.add(flour);
        do {
        whisk.whisk(bowl);
        } until (bowl.contentsAreSmooth());
     // try to serve in a jug; if there is no jug handy, just serve it from the bowl
        try {
            Utensil jug = kitchen.findUtensil("jug");
            if (jug.isDirty()) jug.washUp();
            bowl.pourInto(jug);
        } catch (UtensilNotFoundException e) { }
    }
}

Recipe by me, but put in the public domain.