Archive for March, 2006

An exercise for the reader?

I get annoyed by tech articles with code examples that contain basic errors. The latest I read is Kurt Cagle’s recent instalment on understanding XForms.

He has two examples of XML documents that are not well-formed: a cardinal sin for a tech article about XML. He and the O’Reilly editors must at least test all XML examples in an XML editor to check well-formedness.

One of the examples also has a namespace prefix misspelt. Then Kurt describes how many people find XML namespaces difficult to read and understand. No wonder!

Correcting errors should not be left as an exercise for the reader.

Primitive digital cinema

The other day I had my first digital in-cinema experience. I saw In Search of Mozart at the Schonell Cinema and, shortly after it started, noticed that it looked different.

There were no scratches or specks that flash by. Next I noticed the fine horizontal lines that were always present in the image. I turned around and saw that the projector was digital. Cool!

Then I started noticing digital artifacts that were occasionally annoying:

  • jagged diagonal lines with high contrast (e.g. the keys of a piano)
  • somewhat flat and ‘washed out’ colours in some scenes
  • ‘halos’ on some high-contrast edges of objects

These are all symptoms of low-quality digital images: no anti-aliasing, poor colour management and crude digital sharpening. Overall these artifacts reminded me of early, inexpensive digital camera images. No doubt we will see improvements in digital cinema images as we have seen them in still photography.

I did enjoy the movie because of the subject matter and because the digital artifacts were not always obvious. My wife did not notice that the movie looked any different to a projected film.

Encoding headaches: the big boys can get it wrong, too

Anyone who has seriously wrangled web content and especially XML will have encountered headaches with encoding. You see junk characters or little rectangles (signifying unknown characters) in your browser instead of the correct ones.

In general, they happen when the rendering component is expecting one encoding but the stream it receives is encoded with another. One common case is when a web page purports to be encoded in UTF-8 (via an HTTP header and/or a meta tag) but actually contains Windows-1252 encoding because its contents were pasted directly in from a Word document (for example).

These kinds of mistakes are to be expected from web amateurs but even pure web companies can make a hash of it. This recent example is from Bloglines:

Encoding error in Bloglines

My exploration yielded the following information.

  • I saw the same problem in Firefox, Camino and Safari.
  • There is no encoding problem with the article itself on oreillynet.com.
  • The Atom feed appears to be encoded properly.
  • The Bloglines frame source shows that this HTML is written using JavaScript and that the JS strings have junk in them.

An extract from the source is here:

Source of encoding error in Bloglines

Is it hard wrangling encoding in JavaScript? Do you need to be careful with string constants in JavaScript? I haven’t used JavaScript with non-ASCII characters so I am not sure.

(Oh yes, the French is wrong, too. The word is égalité, not equalité.)

Go like I went

In popular speech, especially of younger people (pick your generational moniker), I have heard for many years forms of the verb go. Examples are:

“I went, ‘You are crazy!’ and he went, ‘I am not!’”

During the past few years it is amazingly common to hear forms of the combination be like. I recently heard a young woman at work say:

“So I’m like, ‘You’ve been smoking.’ And he was like, ‘I was not!’”

Where do these usages come from?