The HTML Doctype

If you’ve been following HTML 5, then you’ve seen the new doctype:

<!DOCTYPE HTML>

…compared to the old HTML 4.01 one…

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">

It starts out the same… but doesn’t have any of the version information. It’s also much easier to remember (has anyone memorised the old one?)

Is it time yet to use the HTML 5 Doctype?

Hold on a second… did I just say HTML 5 doctype? Nothing in it says anything about a version, let alone version 5. According to the draft HTML 5 Specification, the doctype “is a mostly useless, but required, header”. Its only purpose is to convince browsers to render the page in standards mode. From the draft HTML 5 Specification:

DOCTYPEs are required for legacy reasons. When omitted, browsers tend to use a different rendering mode that is incompatible with some specifications. Including the DOCTYPE in a document ensures that the browser makes a best-effort attempt at following the relevant specifications.

So, where does that leave us now?

To answer the previous question first, yes, we can use the new doctype now. Even Google does on their home page.

If you use the ‘new’ HTML doctype, then you are just saying that the page is HTML (not XHTML or something else), and you want the browser to render your page in standards mode. It doesn’t mean you’re using ‘HTML 5’ — will the doctype change again for HTML 6? Who knows? …but I don’t think it will.

— but you might still want to be careful. On client sites, I would still use the HTML 4.01 Strict Doctype (not XHTML, but that’s another story…). On personal sites, I will use the new HTML doctype — it’s still relatively new, so you need to be prepared to change things if it causes unknown and unpredictable side-effects (but there shouldn’t be).

Could we have been using the <!doctype html> doctype before ‘HTML 5’ even existed? All that really matters is that the browser knows that you’re serving HTML, and it renders the page in standards mode. So, I suppose we could have.

Upgrading WordPress

In the last couple of days, I’ve upgraded 4 different WordPress installations — across local and production servers, including 2 WordPress µ. Local servers are ok to upgrade, production servers are a pain.

Everything went pretty smoothly, except this blog…

The FTP connection kept on failing, and not uploading all the files. Some files got half uploaded, and things just didn’t work out nicely. The whole process took forever, because of the huge number of files (it takes longer to upload a lot of small files than one big file). When I thought it was finished, I later found out that not all the wp-admin files got uploaded properly.

By then, I was really frustrated with the whole thing, so I just deleted all the wordpress files (except wp-content of course) to start all over again. I was going to just upload the whole archive file together, and un-compress it on the server, but uploading that failed half-way as well.

In the end, I just uploaded all the files almost one-by-one, which wasn’t fun (it was more like 5 at a time, because that turned out to be reliable as well). Maybe I should stop being such a cheapskate, and use a paid web host instead… with reliable FTP.

That’s not all…

Another issue I had was I found that if you tried to visit my blog during all this, you were served a page with a bunch of random WordPress PHP code printed out. Imagine if it printed out your hard-coded database password or an API key or something similar. That could turn out badly. How should you upgrade websites securely? Maybe next time I will change the .htaccess file to block all requests and show an “upgrading…” page. Is there a better way of doing this?

Spraypaint Brushes Set 1

They’re finally here! You can download my first pack of photoshop brushes:

Spraypaint Brushes Set 1 (18 MB)

(Sorry — I don’t have a nice beautiful download button. I could make you wait longer, but I think it would be better if I just give you the brushes!)

UPDATE: You can now get them along with some other goodies from my stock resources page too.

Here’s a little demo picture. It’s not the nicest looking thing ever, but it demonstrates the kind of textures you can create with the brushes:

Spraypaint Photoshop Brushes

To make these, I just spray-painted a couple of pieces of paper, and scanned them at 900dpi. My scanner isn’t the best, but it isn’t too bad. The brushes aren’t super sharp at the largest size, but they do all go up to around 2500px diameter.

photoshop screenshot

Spraypaint

Stay tuned for set 2! (the back side of the paper has some interesting textures as well…)

Coming Soon… Photoshop Brushes!

Today I was playing around with some black spray paint (don’t worry, I didn’t do anything bad). I painted some white paper so I can make some Photoshop brushes! Here’s a quick preview:

Spraypaint

Right now, I have lots of work to get done, so it will be a few days before these are ready to give away. Make sure you subscribe to the feed if you want to be notified as soon as they’re available.

3D Graphics in the Web Browser

Google has developed a new plugin to run 3D graphics in web browsers! It’s called O3D and the aim is that sometime it will be standards and built into all browsers.

Once you’ve installed it, you can run the demos, including a platform game!