Archive: January 2005

Always the beautiful answer

January 19, 2005

I really want E.E. Cummings: Complete Poems 1904-1962.

His use of punctuation, and his syntax in general, is fascinating. What do you make of this?

if i love You

if i love You
(thickness means
worlds inhabited by roamingly
stern bright faeries

if you love
me) distance is mind carefully
luminous with innumerable gnomes
Of complete dream

if we love each (shyly)
other, what clouds do or Silently
Flowers resembles beauty
less than our breathing

Announcing js-markdown

January 5, 2005

Announcing js-markdown, a (partial) implementation of Markdown in JavaScript.

Ark 0.12

January 3, 2005

Ark 0.12 fixes a bug in Ark 0.11 where I’d mixed up some options so “don’t save” actually meant “overwrite”. Oops?

In 0.11 I added the code to get the current file size from the FireFox cache, and like FireFox, where I stole it from, it chokes on URLs with a # fragment identifier. This is presumably because only the http://example.com/index.php part of http://example.com/index.php#fragment is a document.

Ark just strips the fragment off now, since it shouldn’t be used in archive filenames anyway.

Lastly, I noticed that FireFox wasn’t picking a default extension for text/plain files, which is probably the Right Way. But I wanted .txt, so there you go. (Being the sole user of my software really makes it easy to bow to consumer demand.)

Ignorance is Bliss

January 8, 2005

Now the city, it’s divided into four zones you know, each occupied by a power. The American, the British, the Russian and the French. But the centre of the city, that’s international; policed by an international patrol, one member of each of the four powers. Wonderful. What a hope they had, all strangers to the place and none of them could speak the same language. Except a sort of smattering of German. Good fellows on the whole, did their best, you know.

(From the introduction to “The Third Man“.)

“The Third Man” was truly excellent, but I found it strange — and sometimes infuriating — that so much of it was in German. Not strange that it contained German dialogue (the film being set, after all, in post-war Vienna), but that it wasn’t translated. Not dubbed, not subtitled. I’ve become spoiled, and have come to expect subtitles as a matter of course. Especially in movies like this, where the dialogue is chiefly English.

It was like being on the bus while other passengers chat in some foreign language: they pause and laugh uproariously; you tend to assume they’re laughing at you. Actually understanding them would bring little value to your bus experience (it would probably make it less interesting); but not knowing, there’ll always be that anxiety, that uncertainty.

Irritating as it was, I think I saw the film as it was intended to be seen: with no, or very little, understanding of the foreign dialogue — just “a sort of smattering of German”. And, not knowing, it was a brilliant cinematic device.

Holly Martins, the protagonist, can’t speak German either. He’s helped out by various English-speakers when it’s necessary to the plot, but much of the dialogue remains untranslated. Primarily, it creates a sense of alienation. Holly is alone in a strange place, and we — in the same linguistic boat — find it easy to identify with him. It adds mystery, as with the rantings of the mad old woman wrapped up in her blanket — should she merely be instructing the police to avoid walking on her carpet, or telling an amusing anecdote about an onion, she would cut a rather less sinister figure.

Movies like “The Core” are easier to swallow if you’re completely ignorant of science, but I’ve never seen another movie that’s improved by ignorance of language. (Except, now that I think about it, “Lost in Translation“, where the language barrier was central.)

The question is, if I’d understood it all, would the film have been less? Or would it have been more? I’m sure it’d have been very different.

Illudium PU-36 Explosive Codeolulator

January 28, 2005

The standard way of marking up code blocks is to use the <code> and <pre>. The former indicates that it is code; the latter that it is preformatted. Without the <pre>, whitespace gets lost, ruining–for example–function indentation. This is fine until you post a very long line, which–being preformatted and not following normal word-wrap rules — doesn’t fit on the page.

Normally I wouldn’t care that it happened here, because as far as I knew, lines would just extend further out into the white. But then I realized that IE stretches the content div, displacing the sidebar. Horror!

There are a couple of solutions, but the prettiest by far is a trick invented, as far as I know, by Simon Willison. A code block can be presented as an ordered list of code spans, with the added usefulness of line numbers. More to the point, code spans will happily word-wrap.

Thus I present the Codeolulator, a plugin for WordPress 1.5. (It will not work with 1.2.)

PHP-CGI “No input file specified” fix

January 19, 2005

Dreamhost prefers users to run PHP as CGI program rather than as an Apache module, for security reasons. I’m totally fine with this, but it has some drawbacks. The only one I’ve actually noticed is that it utterly breaks custom 404 pages. I think this is fixed in PHP 5, but it’s still in whatever version this server is running.

The server doesn’t spring a 404 error because it’s just passing the requested filename as a parameter to php.cgi, wherever it may reside. When it can’t find the file, it responds with its own error message:

No input file specified

If you’ve gone to the trouble to set up custom pages in your site style, it’s more than a little annoying to have them replaced by something so utterly useless, unhelpful, and downright confusing.

But now, I notice, someone’s posted a solution! It’s a clever bit of mod_rewrite hackery.

RewriteEngine on
Rewritecond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule \.php$ /404.html

!-f checks to see if the requested .php location exists and is a real file. If not the rewrite rule will direct to the chosen error document. The only real drawback I can see is that it’ll mess with requests for things other than real files — notably, symlinks.

It’s also not perfect if you have a single error.php file, and use $_SERVER['REDIRECT_STATUS'] to display different messages for different error types, since the server still doesn’t think there’s an error. Instead, you have to do something like this:

RewriteRule \.php$ /error.php?error=404

And then check $_GET['error'] in the script. But it’s still much, much better than nothing.

Princess Robot

January 11, 2005

Like most anime fans — native speakers excepted — I don’t understand Japanese very well. We all pick up words here and there, but that’s about it. Things are, naturally, complicated by differences in alphabet — “Kareshi Kanojo no Jijou” mightn’t be understandable, but, at least, it looks less formidable than “彼氏彼女の事情”.

Often I don’t ever find out what the title of a series means, since the fansubbers, for whatever reason, leave it Japanese.

Over the past few days I’ve been watching “舞-HiME”, a show about schoolgirls with giant robots fighting demon things. Static Subs anglicized the title as “My Hime”; in irritating-but-typical fashion, it’s also a pun: the protagnist’s name is “Mai”.

“Hime” means princess.

The wordplay is more than just on Mai’s homophonous name. It’s “HiME”, not “Hime”; that in itself is a horrific acronym-pun on “__Hi__ghly-advanced __M__aterializing __E__quipment”. This adds another layer: my princess, my highly-advanced materializing equipment, Mai [the character] highly-advanced materializing equipment, etc.

A search on “My Hime” at AnimeNfo returned no results (and it was this event which you can blame for my entire hopeless excursion into amateur translation), because “舞-HiME” isn’t “My Hime” at all.

It only answers to “Mai Hime”, because the kanji in the title (which is indeed the character’s name) is only homophonous with “my”. It’s a completely different word. The pun on “my” is presumably intended, and is in the URL of the official website, but still: using the kanji for her name opens up a whole new world of possible puns.

It’s probably stretching things a little too far to assume any wordplay encompasses the other “mai” homophones, no matter how delightfully confusing that would get. But, surely, it’s fair to look at the meaning of her name?

Apparently it means “dance” or “dancing”, and this is definitely my favoured translation. See, forget the puns on “my princess” and all that, the show is — evidently — about highly advanced dancing robots. So far I’ve seen swords, giant robots, guns, giant flying fiery robots, monsters, and a freakish half-chariot half-scorpion giant robot; what is left but dancing? It’s just around the corner, I’m sure of it.

Unexpected Character

January 25, 2005

I wasn’t getting any Google lovin’, so I post this for myself in case it happens again.

Accessing the PHP CGI directly (if you — hypothetically, say — redirected to $_SERVER['SCRIPT_NAME'] with PHP in CGI mode) can spring errors like so:

Warning: Unexpected character in input: '' (ASCII=6) state=1 in /usr/local/dh/cgi-system/php.cgi on line 124  
Warning: Unexpected character in input: '' (ASCII=8) state=1 in /usr/local/dh/cgi-system/php.cgi on line 124
Parse error: parse error, unexpected '/' in /usr/local/dh/cgi-system/php.cgi on line 124

Try $_SERVER['PHP_SELF'].

User JavaScript

January 18, 2005

There was some excitement a while back about the potential of user style sheets and CSS signatures. By applying personal CSS rules, users can browse the web the way they, not the page designers, want. If underlined links offends your aesthetic sensibilities, you can have them rendered plain. If you agree with Jakob Nielsen, you can underline links which uncaring designers have left tragically unadorned.

By applying site-specific personal CSS rules, users can quite literally redesign the sites they browse. The body element on Eric Meyer’s pages, for example, always has an id of www-meyerweb-com. Since, personally, I’m not a big fan of the blue entry headings, I can put a rule like this in my user CSS file:

#www-meyerweb-com h3 a { color: black; }

Simply done. Throw in a browser supporting XBL and the possbilities are limitless.

What really has me excited, though, is the idea of site-specific user JavaScript.

WordPress bookmarklet Bloglines userscript

January 22, 2005

What I love about userscripts is the freedom to add functionality I want, whether it’s useful for anybody else or not.

Bloglines has a “clip blog” feature, where I can republish clippings from items I read, with or without commentary, to a Bloglines-hosted blog. Useful, I guess, but I already have a blog — thanks but no thanks; if I want to link to something then I’ll do it from here.

This userscript replaces the “Clip/Blog This” links with a WordPress bookmarklet popup, sending the item title and link instead of the usual document title and location. It has to process everything twice — XPath/DOM magic to change it in the document tree, and a regular expression to modify the JavaScript-cached version used to actually generate the page — but it’s basically instant, except that it won’t change until a page is fully loaded. I only notice on image-heavy feeds.

Oh, and it removes the “Email This” link while it’s there, since I find it utterly useless.

This page contains the archive of articles posted to rephrase.net during January 2005.