Monday 19th May 2003

Parsing Around

Well, last week had a fair amount of work for the usual suspects, with a few interesting anecdotes. Security can be remarkably ignorant sometimes, as Andy T and I found to our amusement. Unfortunately, they can also stare in the right direction occaisionally; into space perhaps, but that’s all that was needed to curtail one expedition. But as time goes on, I find more and more places "just like that bit in Half-life where…"

This weekend and today I have been mainly swearing, thinking too hard and pulling my hair out. Here’s a tip for you all - if you ever find yourself faced with an undocumented, unreliable (both in missing or optional data blocks, and fluctuating data labels), ‘Human Friendly’ file format, which is merely stdout printfs of a program redirected into a text file (and so barely even qualifies as a file format), and are asked to parse it using C (oh, go on, with the help of glib 1.0, but nothing else), then run a mile. Did I forget to mention that these files can be easily 1,405,182 lines long (no, that’s not a random number, meet my bayer_dz_md file), and that your text viewer of choice (remember, you need to work out the file format as you go along, so a text viewer and multiple examples are a necessity) has to cope with 50MB files without barfing? Fun stuff, I assure you. Actually, if you’ve any sense, you’ll make sure that I don’t get a chance to assure you. ("Don’t mention the project - I mentioned it once, but I think I got away with it!")

Monday 12th May 2003

Down Hill and Up Dale

I’ve figured out why my weblog has been going downhill of late. With my new chilled out attitude (and a few changes of scenery, figuratively speaking) I no longer want to rant about things as much. So I don’t write things on my weblog so often. When I do get round to writing things, I’m probably quite bored. And that means I’ve usually been doing something boring just beforehand, and that’s why I’ve been warbling on about html and css incessantly recently. Not because it’s interesting, but if my day has got boring enough that I think about such stuff, then it’s probably boring enough that I’ll spout about it too.

So in an attempt to redress the balance, I’m going to write about more interesting things I’ve done recently. More interesting for me anyway, YMMV. (Oh, OK, one little html ramble - I’m not pandering to IE’s shortcomings any more - I know the difference between an abbreviation and an acronym, and I’m sticking to my principles on this one.)

Did anyone watch Bremner, Bird and Fortune last night? Now that was some scary stuff. I have this horrible feeling that it’s all completely true. It’s really entertaining to watch, but last night’s episode wasn’t really funny; I just had my jaw hanging for most of it, and kept muttering ‘no way!’ throughout. Shock and disbelief would accurately describe it - if you didn’t watch it then you missed out, but I don’t know if you can see it online or get the transcripts from anywhere. And I’m not going to abuse it by trying to summarise it here.

Most of what I did yesterday was walking back from Roehampton through Richmond park, Barnes and along the Thames. Which was really, really cool (especially all the little public footpaths through Barnes), and well worth the sore legs by the end of it. I’ve got a few other walks lined up, but they’re on hold at the moment, until I get some more of my project done (and subject to it not being quite as miserable weather as it is today).

And now, before I start talking about the new versions of xine I’ve been fiddling with, the way that I quote things like a hacker (apparently), my opinons on the linux file hierarchy, or anything else, I’m going to stop.

Friday 9th May 2003

More Markup Stuff

Well, that’s my exams over. Woohoo! That means a few things - firstly, my head hurts (really badly), and also that I’m back to writing weblog entries. Oh joy, oh rapture, I hear you cry.

Sam continues to make progress in perfecting his weblog, but there’s still some issues I have with the new fireburst layout, validatable as it may be. Now here I walk with my eyes wide open into pot / kettle territory, since I’ve made most of these mistakes too. I just haven’t got round to fixing them yet, if indeed they ever do get fixed. Firstly, headers - he doesn’t use any h tags, just other elements (predominantly div and spans) styled to look like headers. That’s bad, mmkay? Secondly, there’s the links - there’s a menu down the side, with a list of links. A list that is. LIST. See where I’m going? Any element which has one and only one child element is probably redundant, and is certainly redundant if the child element is the same as the parent - so no <div> <div> content </div> </div> please. And for a page with some links and one bit of content, nesting divs four deep is bad karma; there are only three (or so) sections to the page, never mind trying to justify four levels of hierarchy. Line breaks (br tags) can only be justified where the end of a line has a meaning - for songs and computer code - anything else is just whitespace and should be taken care of using margins and padding. Inline styling is bad (I’ve spotted one) and external stylesheets are better than style sections - that allows webservers to return ‘304 not modified’ to a big chunk of data, and thereby speeds your site up. UTF-8 has better karma than ascii (just trust me here). The acronyms need marking as such, and some method of skipping over the menu would be good - you don’t want a voice reader reading all your links out every time (or put the menu after the main content, and style it into place…). Widths in em units allows the content boxes to change in size when the user changes their font settings - if I crank my font size up, the menu links are cropped.

But the best of the lot, is the alternative text for the accessibility icon. If I read the page in lynx (like Sam suggested), I’m not supposed to feel that I’m missing out on not seeing the pictures. So if the alternative text mentions a picture, then it’s a bad alternative text. Doing so on the accessibility icon is just beautiful!

I’m not trying to be overly critical of Sam’s code (well, perhaps I am), since it’s pretty darned good already. Validating pages is all I really ask for - stylesheet layouts, semantically ‘correct’ markup, and accessibility issues are worthy goals, but I don’t mind when people choose not to go that far.

For anyone who’s tried doing funky stuff with stylesheets, have a look at the CSS2 Selectors, drool for a while, then the CSS3 Selectors, drool some more, and then realise some of the very cool things you could do (like styling internal and external links differently - even without using icons to do so). Finished drooling? I said could do for a reason - it’s only Mozilla that supports half of those - Internet Explorer doesn’t even do CSS2 yet, and it’s been a full W3C standard since 12 May 1998. Which is very, very, very irritating. I’ve (almost) finished a complete degree in less time than that.