Topics

Errors Done Right

Error ScreenshotI just installed the Safari Tidy plugin. It really enhances the “View Source” command in Safari (see image, right), by highlighting validation errors and adding line numbers. It also adds this nice little status display (below):

Status Display

Which correctly tells me that there’s a problem on this page. The problem is that I’m using the type="search" attribute on the search text field. Which renders as a normal text box on all browsers except Safari, where it gives it nice rounded corners like other search boxes on the system and remembers previous searches for you.

It seems likely that this will become part of the official XHTML specs, in which case that error will disappear. But I don’t see a problem with keeping it there for now.

UPDATE: Errors Gone Wrong

Oh well, it was nice while it lasted. Something went wrong, and now I can’t view the source. It’s as if the content of the source window is getting lost above the top of the frame, and resizing and so on don’t help. I don’t know what preferences to try deleting, so I’ve uninstalled it for now.

Filed under: , on September 13, 2006 at 10:11 pm

Voldemort - Then and Now

Looking at the date, I thought I’d post an article I wrote for my school newspaper four years ago, when I was young and naïve. I thought it’d be interesting to see how much my opinion on this matter had changed.

Voldemort

Some terrible things happened on September the eleventh, but I think people are being a little silly about it afterwards.

There are similarities between what’s happening now and the Harry Potter storyline. A terrible event occurs, and people are still so frightened that they can’t bear to mention the name. You never find newspapers printing, “this new technological breakthrough could eliminate events like the terrorist attack on the World Trade Center,� they say “this could eliminate events similar to those of September the eleventh�, or even “the September the eleventh incident�.

Maybe people are still frightened, but people mustn’t live in fear all their lives; that would be admitting that the terrorists have won and we might as well hand the world over to Osama bin Laden right away. In a society where mentioning terrorism gets you a disapproving look, terrorism has had the desired effect already.

The effect can only lead to worse things. If people see that even a newspaper can’t bear to publish such a simple phrase, that the editors are afraid of what it may lead to, then they will become afraid themselves. It is an effect similar to normal people spreading propaganda to themselves, eliminating the need for the ones it helps to do it.

And just in case anyone thinks that I am being slightly unfeeling here, I will mention something else. One of the most sensible people that I’ve seen in this matter, someone who talked about the terrorist attack without the merest hint of a shudder was a captain from the New York fire department. He was at the scene, and he had no long-term ill effects. A true Harry Potter.

So… what’s changed? Well, now people are simply calling it “nine eleven”. And here in the UK, we had our own little terrorist attack (and at least we were considerate enough to have it on the seventh of the seventh - a date that works across the pond as well as it does here). And I don’t think I’d use a Harry Potter reference nowadays. And I’d have been considerate enough to remember the fireman’s name. But I still think my past self’s point is valid.

Filed under: on September 11, 2006 at 9:58 pm

Points, Ems and Exes – Great Design, Poor Acronym

I think there’s space for a new web design app. Let me give you the concept:

People that are used to designing for print like control. When someone like this wants to design a website, they like to be able to get everything perfect, and they want to feel that everyone will see the same thing that they see, regardless of their browser. And they go about it in the following ways:

  1. Use Flash
  2. Use absolute positioning and pixel values

The problem with option one is… no, wait. The problems with option 1 are numerous. No one really likes Flash when it’s not used in its proper place. It takes ages to load, and you can never get anywhere with it, and you can’t scale the text. And they always make it really dark and moody, and there are all these little transitions… ugh.

The problem with option two is that when you try to increase the text size, you get all sorts of issues.

So the answer is to define everything in a unit that scales along with the text. Percent, points, ems and exes all do this. More and more websites are using this technique, a big one being Yahoo. This leaves you with only one problem – you can’t tell the background to scale in the same way, which was part of my difficulty in my previous post.

But that’s a small problem. A bigger problem is the fact that print designers like to use applications like InDesign, rather than learning XHTML code and W3C standards and valid CSS and so on. So we need to make an application that does that.

I guess this is the sort of thing that could be nicely done in JavaScript, but I get the feeling that these people would rather have something more tangible, like a .app or a .exe. And then it’s easy - just make a graphic design application that’s generating XHTML and CSS behind the scenes. Boxes would be positioned absolutely, in… let’s say… ems. They could drag their columns wherever they liked, and we would be safe in the knowledge that they’re making nicely zoomable, accessible websites. And we’d be chuckling behind their backs, and they wouldn’t see what was so funny… oh, it would be glorious!

The one thing we’d have to get them to do would be to define the ‘flow’ – the order in which the elements appear in the source code. So we tell them to drag a line from element to element, in the order in which they want it to be read. Tell them it’s for marketing or something. And there we go – a way to siphon all that design talent into an accessible form on the web. Problem solved.

Filed under: on September 8, 2006 at 1:34 am

Pretty and Nice Rules

Ornate SpacersOkay. What’s the solution here? I want to separate blocks of text with something more interesting than nothing. Perhaps an ornate rule, like the one in the picture. But I also want all dimensions on that site to be defined in ems, so that the exact layout is preserved when the user changes the size. And I can’t find a way to do it.

The way that works is to have a <img class="ornaterule" src="/images/ornaterule.whatever" />, with .ornaterule {height: 1em;} defined in the stylesheet. But that’s crazy. That can’t be the best way.

The so the obvious progression from there is to define an :after pseudo-selector to include the above after each paragraph. Except that that doesn’t work, because you’re only allowed to include a “string”, and staring blankly at w3.org’s pages for a while left me with the impression that a “string” can’t include tags.

Okay, then. What next? Well, I suppose the <hr /> tag is semantic, right? Or at least, UAs know what to do with it, and it looks nice in the source code, and presumably it can be styled… So I had a quick search around. Apparently it’s not easy. The most attractive solution I could find was this one, which comes close to being nice enough, but it wouldn’t allow its height to be defined in anything other than pixels.

Well, if that’s the best that can be done, then I might as well just use

p {
background: no-repeat center top url(/images/ornaterule.whatever); padding-top: 20px; }

and avoid having that tag at all.

So that’s what I have at the moment. But it’d be really nice if there was a way of defining the height of the images in something other than pixels.

Filed under: on September 3, 2006 at 11:58 pm

Work in Progress

Early renderAnd so here’s an early image of the basic mesh. My first model in Blender. (Well, the first one that wasn’t from a tutorial).

I was trying to make a Thwaites 3-ton swivel dumper truck. When I was messing around on one of these big toys, the idea came to me for a pretty simple 3D game. Hopefully, I should be able to get something working that might be fairly fun to play with.

This would, however, be my first 3D game. I plan to use OpenGL and SDL, and use Blender for all the models. So far I have the model rotating in a window. Which is a start, but is frankly inadequate for today’s gaming market. So I need to get some textures on there, and get some terrain in there, and sort out some physics or something, and establish a control system, and add in some effects…

Okay, so this might take a while. But at least there’s no suspension to worry about, and no skidding. We’ll see how far I get with this…

Oh, and I really need to write a .obj or .raw importer or something, instead of going through the file by hand and adding glVertex3fs everywhere. It gets tiring very quickly.

Edit: Wow, this is just crying out for some tight wrapping around that image… oh well… a project for another day.

Filed under: , on September 1, 2006 at 12:38 am

Powered by WordPress