Author: Barry van Oudtshoorn

  • A brief history of Toothbrush Depilation

    Toothbrush depilation, or, as it is known to its practitioners, “toothbrush depilation”, is a vibrant and exciting competitive sport. Although it has been around for the last two hundred years or so, it only came to the public notice when Hammurabi’s daughter, Hammuribena, was viciously murdered in Babylon. The ensuing civil war has guaranteed toothbrush depilation’s place in the homes and hearts of Australia’s most-beloved families.

    Perhaps surprisingly, the sport has remained relatively unchanged from its Babylonian days, notwithstanding the French revolutionaries’ attempts to “simplify” and “democratise” it. Two teams attempt to remove the bristles from between five and six toothbrushes. Judges award points based on the number of bristles removed, their angular displacement, and the size of the bribe. Many have called for toothbrush depilation to be played at the Olympics, but unfortunately they had the wrong number, and so their calls could not be connected.

    In Australia, the sport has had something of a checkered history. Forced underground by Hughes, it later experienced an upsurge in popularity under Menzies and Howard. Its detractors claim that it constitutes cruel and unusual punishment; its pundits counter this by pointing out that the detractors are all wimps.

    With growing numbers of young Australians choosing toothbrush depilation over other, perhaps more conventional sports, it looks set to sweep the world in the new millenium. A bright future of bristles, bribes, and bloody murders beckons!

  • Autobiography

    I was asked today to write a short autobiography to go on the company website. This is what I wrote:

    Barry van Oudtshoorn hails from the snow-clad plains of the Serengeti delta. Overcoming his debilitating muteness (Barry was born without a larynx), he has become an accomplished ventriloquist and master orator. He has presided over Presidential coming-of-age ceremonies and the marriages of seventeen Catholic priests, both in Uzbekistan and abroad.

    The winner of the inaugural bi-annual toothbrush-depilation contest in 2010 (and a runner up the year before that), Barry leads a quiet life. Despite being married to Ariel, he has led a comfortable and well-cooked life. Barry enjoys making jellies wobble and cutting his toenails.

    I’m not sure that this will be what goes up, though…

  • (Un)quoted HTML attributes

    In HTML, it’s perfectly valid to write something like this:

    [sourcecode language=”html”]

    Lorem ipsum dolor sit amet etc.

    [/sourcecode]

    Indeed, Internet Explorer 7 and 8 favour this approach. Whereas Firefox, for example, would return the above as

    [sourcecode language=”html”]

    Lorem ipsum dolor sit amet etc.

    [/sourcecode]

    when retrieving it using innerHTML, IE 7 & 8 only quotes attributes that satisfy certain criteria:

    • Any attributes that contain spaces;
    • Some magic set of standard attributes, such as href;
    • Any custom attributes you may have specified.

    Unfortunately, however, this doesn’t constitute well-formed XML. In the software I develop at work, we produce PDFs that can include user-generated HTML. To do this, we use XSL:FO — an XML-based system. You can see where this is going: the backend requires valid XML, but the frontend is sending through HTML. The simplest way to fix this is with a simple regex, like so:

    [sourcecode language=”javascript”]var s = ‘

    Lorem ipsum dolor sit amet etc.

    ‘;
    s = s.replace(/=([^”‘`>\s]+)/g, ‘=”$1″‘);
    // s === ‘

    Lorem ipsum dolor sit amet etc.

    ‘[/sourcecode]

    Bear in mind that this regex is by no means perfect. It will, for example, convert this:

    [sourcecode language=”html”]

    Lorem ipsum

    dolor sit=amet

    [/sourcecode]

    into this:

    [sourcecode language=”html”]

    Lorem ipsum

    dolor sit=”amet.[/sourcecode]

    …which is obviously not what we want. I spent a while trying to come up with a regex that would solve this problem, but I stopped pretty soon. What’s really needed here is a parser: something that can take in the tag soup that Internet Explorer produces, and produce valid XHTML (which is valid XML). A quick search reveals myriad implementations in various languages — Python, Java, even JavaScript.

    So, after all that, what’s the take-away from this post? Just this: web browsers (slightly older versions of Internet Explorer in particular) are imperfect. XML was borne out of HTML, and is much less forgiving; whether or not its strictness is a good thing is up for debate. I guess that it’s a bit like reading Shakespeare nowadays: you can pretty much understand it, but every now and then you have to reach for a dictionary to make sense of what’s going on. Of course, when you don’t understand something in Shakespeare, you don’t fall over in a heap, but let’s not stretch the analogy too far.

    In brief

    When retrieving the innerHTML of an element (or using contenteditable), Internet Explorer doesn’t always wrap attribute values in quotes. The solution to this is not a magnificently obtuse regex, but a tag-soup parser that can return valid XML.

  • [Music] Juggernaut

    A piece in the same vein as Fluorescent. My wife describes this piece as “dystopian”. I, of course, had to reply with this rather witty riposte: “Dystopia? I ’ardly even know ’er!”.

    This piece is somewhat heavier than some of my other recent endeavours, but hopefully not too much so. In terms of VSTis, it makes use of the usual culprits: Reaktor, Massive, FM8, and Kontakt.

    [audio:http://www.barryvan.com.au/music/Juggernaut.mp3]
    (Download)

    Creative Commons License
    Juggernaut by Barry van Oudtshoorn is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

  • [Music] Fluorescent

    So I’ve been playing a bit of Unreal Tournament 3 of late, and UT3 happens to have a pretty awesome demoscene-inspired soundtrack. I guess it was inevitable that I should would go down that path as well! This piece is the result. It gave me the chance to dust off some of my less-often-used VSTis; Reaktor, Absynth and Battery all get a look-in on this track.

    [audio:http://www.barryvan.com.au/music/Fluorescent.mp3]
    (Download)

    Creative Commons License
    Fluorescent by Barry van Oudtshoorn is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

  • [Music] Frequency

    This track is, in many ways, a harkening back to my earlier compositions. Its structure is more straightforward, its arrangement is more natural and less synthetic, and it came about from a session in front of the piano. These elements form the basis of much of my earlier work, and, if I’m honest, they probably define my preferred method of composition.

    Let me know what you think!

    [audio:http://www.barryvan.com.au/music/frequency.mp3]
    (Download)

    Creative Commons License
    Frequency by Barry van Oudtshoorn is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

  • [Music] Cascade

    This track is actually from a couple of weeks ago. I just never got round to putting it up here. 🙂 It’s really a background track: something you listen to while you do something else. Part of the idea behind it was to make a melange of disparate “instruments”, and smoosh them together to make something that’s coherent. Let me know what you think!

    [audio:http://www.barryvan.com.au/music/cascade.mp3]
    (Download)

    Creative Commons License
    Cascade by Barry van Oudtshoorn is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

  • Labour Day Camping Photos

    Following the Labour Day long weekend here in WA, I thought I’d put up a couple of the photos that I took down near Walpole. My mother-in-law owns a property in the bush thereabouts, and my wife and I went to stay in the two-and-a-half-walled shack on the property.

  • Piece-a-week: Marcato Potato

    And so we continue both the piece-a-week idea and the poor track nomenclature. This week, I wrote a piece that is quite ridiculously positive, but with a kind of twisted almost-dissonance running through it. Not particularly well-expressed, perhaps, but you’ll hopefully understand the meaning when you listen to the piece.

    [audio:http://www.barryvan.com.au/music/Marcato potato.mp3]
    (Download)

    Creative Commons License
    Marcato Potato by Barry van Oudtshoorn is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

  • CSSMin updated

    I’ve updated my CSSMin project with a couple of new features and bugfixes. Download or fork it on GitHub!

    What is it?

    CSSMin takes your CSS file and strips out everything that’s not needed — spaces, extra semicolons, redundant units, and so on. That’s great, but there are loads of programs that do that. A shell script could do that! So what makes CSSMin different?

    When you deliver content over the web, best practice is to deliver it gzipped. CSSMin takes your CSS file, and optimises it for gzip compression. This means that there’s a smaller payload delivered over the wire, which results in a faster experience for your users. It does this optimisation by ensuring that the properties inside your selectors are ordered consistently (alphabetically) and in lower case. That way, the gzip algorithm can work at its best.

    What this means in practice is that your gzipped CSSMin-ed files are significantly smaller than plain gzipped CSS, and noticeably smaller than files that have been compressed by other means (say, YUI).

    In this update:

    Nested properties are now fully supported.

    This means that the following CSS:
    [sourcecode language=”css”]@-webkit-keyframes ‘fadeUp’ {
    from { opacity: 0; }
    to { opacity: 1; }
    }[/sourcecode]
    is compressed down to
    [sourcecode language=”css”]@-webkit-keyframes ‘fadeUp'{from{opacity:0}to{opacity:1}}[/sourcecode]
    Your nested properties will have their contents compressed with all of the other tricks in system, but their order will be retained.

    Thanks to bloveridge for reporting this bug and verifying the fix.

    Font weights are replaced by their numeric counterparts.

    [sourcecode language=”css”].alpha {
    font-weight: bold;
    }
    .beta {
    font-weight: normal;
    }[/sourcecode]
    becomes
    [sourcecode language=”css”].alpha{font-weight:700}.beta{font-weight:400}[/sourcecode]
    Values supported are “lighter”, “normal”, “bold”, and “bolder”.

    Quotes are stripped where possible.

    [sourcecode language=”css”].alpha {
    background: url(‘ponies.png’);
    font-family: ‘Times New Roman’, ‘Arial’;
    }[/sourcecode]
    becomes
    [sourcecode language=”css”].alpha{background:url(ponies.png);font-family:’Times New Roman’,arial}[/sourcecode]

    As much text as possible is changed to lower-case.

    Only selectors, quoted strings (such as ‘Times New Roman’) and url() values are left intact.

    Note that this means that if you mix the case of your selectors (for example, SPAN and span), your compression will be sub-optimal.

    Thanks

    Some of the ideas for this update were inspired by Lottery Post’s CSS Compressor.

    Start using it!

    Requirements

    You will need a recent version of Java and the Java compiler.

    Download

    Download or fork it on GitHub.

    Usage

    1. Compile the Java: [sourcecode]# javac CSSMin.java[/sourcecode]
    2. Run your CSS through it: [sourcecode]# java CSSMin [input] [output][/sourcecode]

    If you don’t specify an output file, the result will be dumped to stdout. Warnings and errors are written to stderr.

    Results

    These are the results of compressing the main CSS file for one of the webapps I develop at work. Note that many of these compressors only offer an online service, which means that they can’t easily be used as part of your general build process.

     Original size (bytes)Gzipped size (bytes)
    Plain8193812291
    YUI6443410198
    LotteryPost6360910165
    CSS Drive6927510795
    CSSMin637919896

    Feedback

    Let me know how you go with it — bug reports and feature requests are always welcome!

  • Piece-a-week: The subtle monkey

    This year, I’ve decided to try something new with my music. I’m going to endeavour to produce something each week, and put it up here for public consumption. The idea is that it’ll force me to write more music. Bear in mind that I can’t guarantee that what I put up will be any good! 🙂

    So, to kick it all off, here’s a track I wrote in not very much time, entitled “The subtle monkey”. (Track nomenclature has never been one of my strong points.) Let me know what you think!

    [audio:http://www.barryvan.com.au/music/The subtle monkey.mp3]
    (Download)

    Creative Commons License
    The Subtle Monkey by Barry van Oudtshoorn is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

  • Emmanuel: God with us

    My wife and I have just finished our Christmas carols album, “Emmanuel: God with us”. On it, you’ll find brand new orchestral arrangements of ten great carols.

    It’s available for digital download now at bandcamp. You can listen to each of the tracks in full above, and decide whether or not you want to help support poor starving musicians like ourselves. 🙂

    Each track is going for around $1 (or more, if you’re so inclined!), and you can pick up the whole album for $5 or more. You can also get your hands on a physical CD if you like — just let me know!