Ben Godfrey

Archive for December, 2003

Xmas lard

Christmas is over. It was good. I’ve spent over a week doing practically nothing and eating lots. No wonder I have noticeable podge. I’m a thin guy, but I have a beer belly, a gut, a tummy, a small parcel of lard lodged behind my belly button. I think it’s time to start swimming or running again. Some kind of movement at least.

I was at my parents before Christmas, always a recipe for fat. I was there for four whole days, which was really nice. I got to spend lots of quality time with both my Mum and my Dad (who are divorced and resettled in new relationships). Louise came up with me, but had to go back to work whilst I stayed on, so I got to spend time with my parents with Louise and later on my own, which was also nice.

Then we had Louise’s family over for Christmas day, the same as last year. We watched LOTR and Episode II and most of Captain Corelli’s Mandolin and ate loads of Turkey. Louise’s MUm had bought a million presents to add to the million we already had. We got lots of kitchen stuff. We had a really nice Christmas day followed by a very quiet Boxing day. I had Turkey fried with Soy and chillis for supper. I thought it might be good. It wasn’t really very nice at all. The day after that I ate an entire pack of sausages, mostly wrapped in bacon. OD-ing on pork ain’t pretty.

Since then Louise and I have been going to shops to get out of the house and not a lot else. First Kensington on Saturday, then Chelsea yesterday (huge pancakes for breakfast), then just Tesco and, of all places, Homebase today. We’re thinking about moving some furniture around and getting a new desk, one big enough for us both to use. As a result of being in shops we’ve been spending money we don’t really want to be spending. I haven’t billed as much as I would have liked recently and I’m going to have to take it a bit more slowly for a while. I’ve got no work really in January as we’re going on holiday for the last two weeks. Come the end of February I’m going to be quite skint. I have savings, but I don’t really want to dip into them. Oh well, I guess that’s Christmas with a credit card for you. I’ve definitely been less careful and aware of my cash levels since I got my card. The fact that I’ve been quite comfortable this year hasn’t helped either. Although, this time last year I was desperately borrowing money from my parents, so at least it’s much better than that. Also, I can never forget that I’m actually in the richest 3% of the world’s population. Something my lard proves beyond doubt.

There’s always time for XSLT

Was just perusing O’Reilly’s XSLT Cookbook in Books Etc. The guy does some interesting stuff including generating lots of code, e.g. C++ program fragments from UML definitions, diagramming XML with SVG and much more. One thing that caught my eye was using XSLT to populate an HTML form with some data from an XML document.

He had some HTML that didn’t look all that much like:

<form>
    <input type="text" id="city" value=""/>
</form>

The XML would then be something pretty simple. E.g.:

<address>
    <city>London</city>
</address>

The XSLT to combine the two, which I can’t recall exactly right now (it’s in the examples zip file), just copied the template HTML document to the output HTML document, but would apply a template to the element matching input[@id=”city”] which inserts the corresponding data from the XML.

This is slightly more effort in this case than a PHP solution:

<form>
    <input type="text" id="city" value="<?= $city ?>"/>
</form>

However, the advantage is that the input template is kept clean of any syntax other than plain vanilla HTML (or preferably XHTML). This is a tangible advantage. For all the simplicity claimed for server-side languages, particularly JSP custom tags, they are never going to match up to plain old HTML. A distinct bonus is just being able to use whatever editing tool you care for. Although Dreamweaver is very good, relying on it’s abilities to manipulate server-side pages requires that designers understand why they need to use those capabilities and the ramifications of the elements they create. If you can say to someone, “just make me an HTML page with demo data in, set the id’s right”, it’s going to be much more straightforward, especially if the designers belong to another organisation, as is the case in my work sometimes.

This is all very well and dandy for forms, but what about a more general solution? This blog for example uses templates that have conditional and repeating sections as well as access to variables. What would be really nice would be to exploit the fact that CSS layout has lead to careful IDing and classification of many elements in HTML pages. Example:

<div id="blogentry">
    <div class="title">Title</div>
    <div class="date">Posted on <span id="date">date</span></div>
    <div class="content">Content</div>
    </div>
</div>

For the purposes of your designers, you throw them some CSS that styles elements that will be replaced in red or with strikethough or something. Then they can see variables in the document. Then, you’d use XSLT to find the elements they’ve created by ID or class and replace them with the actual blog data, throwing out their demo data, even doing things like applying a template that loops over multiple entries to div[@id=”blogentry”]. As with the original XSLT cookbook example, the only requirement between the designer and the developer is that they agree on which IDs and classes are special. This doesn’t even have to be done ahead of time if it’s a simple project, the designer can just send over the page and the developer can pick out the IDs that the designer has used.

Caution

The Cautionary Tale of J Random Newbie. Found whilst reading Joel Spolsky’s commentary on programming culture, which discusses ESR’s new book The Art Of Unix Programming. Spolsky’s article is great. Sounds like the book is pretty interesting too.

Spolsky’s core point is the differences in culture between Unix and Windows. He discusses how this applies to Linux on the desktop. It is his view that Linux on the desktop will fail (or at least has done so far) because the Unix culture values stuff that’s useful for programmers more than stuff that’s useful to users. He uses OS X — a version of Unix made for users, not programmers- as an interesting example . OS X dares to do things like superimpose a highly simplified filing GUI on top of /, something which works well, despite much paranoia from the community before they got to play with it (including myself). It’s because of things like this that OS X is now the most broadly distributed version of Unix. As an aside, OS X’s deft blending of user and programmer tools is why I love it and would never switch over to either of the polarised OSes unless forced to do so.

I still think it would be nice to have a desktop Linux, or something like it, to compete with the other two big desktops. I like to believe that the value there is in the openness. But after reading Spolsky’s article, I wonder if this is just practically valuable to programmers and hackers and not really all that useful to the end-users that make up 99% of computer users (J Random Newbie discusses one reason why). The hope is that the increased openness helps lead towards better software for everybody. I think it’s hard to say if this is actually true. If we went back in time and replaced fledgling Windows 1.0 with an open source OS that then grew to the size of Windows today, what would be better about that OS, the apps that run on it or the world at large? Could an open source OS even have grown that much without the might of the single unified Microsoft behind it?

Metaaaaal!

I’m listening to Metallica. It rocks. Quite literally, mate. Two caveats: It’s old Metallica (…And Justice For All) and I stole it off Soulseek. Chortle.

I actually really like that Hetfield guitar sound, which is about the only time I’ve admitted to liking anybody’s guitar sound, although in reality I guess I actually like quite a few people’s guitar sound: Page, Bowie, Santana, Prince, Babe Ruth (as in The Mexican off Dirtchamber Sessions), Ramones of course, Zappa, loads of others.

I’m doing the hand sign of the devil a lot.

Friends page

I added a links page. A friend of mine asked me to link to his band’s site. I’d only been handing out links when people asked for them, not because of any policy, just because I was lazy. Anyway, I ran out of space on the front page, so I had to move them out.

I made the graphics on the page using Proce55ing. The fine art, as Joshua Davis puts it of “waiting to capture that moment in time — the beautiful accident”.

Vim Regular Expressions

A useful guide to using regular expressions in Vim, which is bit different from Perl or Posix systems.

Proce55ing

I think I’ve written about Proce55ing before. It’s a cool little Java tool for making graphics applets really easily. It’s a veneer over Java’s own graphics functionality (and other stuff, sound, networking), but an extremely fun and useful one. Kind of like Flash in a way, but more programmery. It’s a great piece of software, it makes it fun to play in code.

Today I messed around with the 3D functions. They’re pretty basic, but they’re extremely simple to use. I realised that if I’d taken the time to write myself a library of simple rotateY, translate, etc. functions, like p5 has, I would have had a much easier time with 3D. It’s always been the maths that raise the entry price too high, so I should have done it once and left it behind me. Being able to visualise the operations I’m doing by way of outputting them as cubes has also increased my understanding of the maths as well.

Anyway, I made some nice vector 3D stuff, will show it off when the time comes. Nothing new has gone into the content section for a while.

Site-specific stylesheets

A new thing that’s coming around, I think perhaps down to Eric Meyer, is giving the body tag of your pages an ID related to your URL so that people can create styles in their user sheets that specifically tackle issues they might have with your site. E.g. this site now has <body id="aftnn-org">, you can put a style like the following in your user sheet, if you can’t read my fonts:

body#aftnn-org * { font-size: larger; }

This idea found it’s way to www-style today. Apparently something similar has been proposed before, in 1999! Way to go W3C. This would be a valuable technology for users with accessibility problems to leverage. It’s a bandaid, yes, but one which empowers the user to make good on the individual mistakes of each author. However, it’s only valuable if those users can actually find and use the feature. At the moment there is no form of site-specific syntax in CSS itself (although it does lend itself to the above hack) and I think that a push from the W3C will be required if this is to help the minority of users who really need it. It gives user sheets the power they really need to be useful.

I’m arguing in favour of the addition of something along the lines of:

@scope url="http://www.yahoo.com" {

color: red;
}

Which is very close to the original proposal, but we’ve been discussing some potential enhancements as well.

Partay!

The Superflat party was a success IMHO. It was quite a lot of work and fairly tiring, but I had a really good time and I met some cool new people as well. Louise and I spent a good chunk of Saturday evening tidying up in preparation and then another chunk of Sunday tidying up the aftermath. Hell, the floor needed washing anyway.

Mat, Ben and Greg came down from Norwich and arrived at about seven, just as we finished getting ready. We promptly took Mat to the supermarket and left Greg and Ben in charge of the venue. We bought a stack of booze and headed back, to find that the passive man had turned up in our absence, with a dangerous looking bottle of Tequila in tow. After that people started turning up in dribs over the hours. Adam played a mix of tunes to kick things off, including some tracks from his prize, the Italian Job soundtrack. It was a really good warm up set, good natured and fun. Ben played some hip hop, which was also really enjoyable. Then I played tongue-in-cheek electroclash, which went down OK I think. We let Adam play more and then Tom and I played all of our jungle classics (well favourites anyway).

So that was the party in music, and that was much of it anyway for me. Playing two sets you kind of miss things. JC and a whole bunch of people turned up just as things were getting a touch quieter and revived everything nicely. I didn’t know most of them either, so it was cool to talk to new people. Ted’s friend Brian and his American chums who were around earlier were cool to talk to and I think we’re going to try and find them again.

At it’s peak it was a pretty good party. It wasn’t a student party like we used to have. No dancing, practically no drugs, better booze and less passing out, but also fewer people. I made everyone take their shoes off as well! The end part was funny though. The last few of us hung around until dawn. They did lines off the coffee table, I sat and played Mario Kart and completed it on 100cc, thus opening up the special cup. I kept offering the controller around, but nobody took it off me. Just as well, I was in the zone. The next day the general state of fried brain lead me to actually hallucinate Mario Kart whilst in the shower.

The next day was obviously a total write off. I was really shaky for some reason. We managed to get things cleaned up, again with Charlie’s help, and when we sorted it all out we’d made a pretty good profit in booze form.

Hooray for parties, but it’ll be a while until we have another I think. I have only good feelings from it, but it was exhausting.

Mac OS X Panther Mail.app Junk Mail bug and workaround

Panther’s copy of Mail has a bug where junk email is recognised but not moved to the Junk folder, even when automatic mode is selected, if no other rules are present (i.e. non-junk rules). A workaround is to create a dummy rule. Mine says something like:

if from is equal to “vdssb 1 3208222vb3vb33097”
and from does not equal “vdssb 1 3208222vb3vb33097”
set the text colour to red

Silly, but effective.

Thanks to “Jon” who posted this workaround on Jim Bassett’s weblog.

PHP 5

Read a brief intro to PHP 5 today. Looks good. Passing by reference by default, exceptions and dereferencing objects returned from functions (leading to Java-style getThing()->getSubThing->makeStuff() chaining), amongst other good stuff. Found a moderately interesting article about it’s potential as well.

More IA stuff

IASlash. Exactly what it says.

Plus: a Webmonkey Information Architecture Tutorial! Joy. Now, if I could just get people to read it.

George Soros and American Supremacy

George Soros has come out against Bush, big-time, effectively pledging as much cash as is required to defeat him. Soros has $7bn to play with.

An article by Soros attacking Bush’s foreign policy, published in the Atlantic, makes pretty interesting reading. As does a K5 MLP post, or, more specifically, the comments.

I’ve bumped into quite a lot of right-wing rhetoric recently. They throw a lot of mud at liberals. I guess the left wing throws a fair amount of mud back, but I find the right’s attacks personal and disingenuous. Mat linked to the talking Ann Coulter doll today, eugh, the hideousness. As far as I’m aware, Coulter has no role except to fling mud from the right-wing and she does so in a way which is often self-defeating.

However, such is the bitterness and unwavering power of right-wing comment, I find myself kind of lost at the moment politically. I have my basic beliefs, equality, freedom, but these words are practically hollow in the 21st century. Bush uses them more than anybody else. My problem is that I have no rhetoric, no verbal weapons to win an argument. If Ann Coulter turned up for a discussion tomorrow, she would kick my ass. I find this troubling.

UIE

A wicked good usability site. Contains practical solutions!