Simon Willison’s Weblog

Subscribe

Entries in 2004

Filters: Type: entry × Year: 2004 × Sorted by date


News site registration

The single hottest topic in the online news industry at the moment is that of required registration. A number of large news sites (the New York Times, the Washington Post, the Chicago Tribune) have moved to this model, and many local newspapers are following suit.

[... 660 words]

Per-site user stylesheets

I’ve been thinking a lot about per-site user stylsheets recently. Eric Meyer’s CSS signatures are great for sites that support them (as this site does), but the sites that really need altering are highly unlikely to carry them. I posted a comment to that effect on photomatt.net a while ago, and thankfully it was spotted by Ryan Tomayko who has published a simple brilliant hack that uses XBL in Mozilla’s user stylesheet to execute JavaScript which adds a CSS signature to every site you visit.

[... 261 words]

Instant authentication against an existing web application

I was thinking today about the problem of querying an existing authentication database from a new application—exactly the kind of thing web services are useful for. Then I realised that any web application protected by HTTP Basic authentication already provides a standard API against which queries can be run. Here’s the Python code to do exactly that:

[... 187 words]

PHP 5 is out!

It’s finally here! Unfortunately PHP.net, while a great site in most respects, fails miserably when it comes to permalinks for news items and/or new software releases. You can grab it from their downloads page, and read more about it in the changelog. Now all it needs is widespread adoption. Unfortunately, something tells me PHP 4 is going to stick around for a long, long time.

[... 73 words]

Compile everything with a one-liner

The other day, we noticed that the .py files in our main mod_python application at work did not have corresponding compiled .pyc files. mod_python runs as the unprivileged apache user, which on our server doesn’t have the required permissions to write the compiled .pyc files in to the directories in which our code lives.

[... 111 words]

Fancy a job?

My placement here in Lawrence, Kansas comes to an end in a few months time, and I’m now in the interesting position of needing to find my own replacement. I’m not going to beat around the bush: this is a fantastic job and an excellent opportunity for anyone looking for a way in to the online news industry. The team here has won so many awards it’s hard to keep track of them all, and is very well respected within the industry.

[... 447 words]

Tantek’s Fridge

Recently spotted on Tantek’s fridge:

[... 18 words]

I have some gmail invites

I have four gmail invites left. The first four people to leave a comment with their email address can have them (put it in the email field and fill in a URL as well if you’re worried about spam harvesters—the email won’t be displayed but I’ll still have access to it). No random gift or good deed necessary—consider it a “thank you” for reading.

[... 144 words]

The orange XML icon sucks

I’m not a fan of the orange XML icon, even though I use it on my categories page. I love the concept of a universally recognised icon for RSS feeds, but XML is simply the wrong acronym to put on it. Don’t think it’s liable to cause confusion? Check out this excerpt from Journalism.co.uk (emphasis mine):

[... 160 words]

Embracing Best Practice

D. Keith Robinson is Sick of Web Standards, and to a certain extent, so am I. Like Keith, I’m not sick of standards themselves; I’ve been using them for over two years now and couldn’t conceive of developing without them. Unlike Keith, I’m not tired of advocating them—but I thoroughly believe that it’s time to extend the discussion.

[... 396 words]

Backporting from Python 2.3 to Python 2.2

We have a home-grown templating system at work, which I intend to dedicate an entry to some time in the future. We originally wrote it in Python 2.2, but upgraded to Python 2.3 a while ago and have since been evolving our code in that environment. Today I found a need to load the most recent version of our templating system on to a small, long neglected application that had been running the original version ever since it had enough features to be usable.

[... 356 words]

OS X Tip: Remapping keyboard shortcuts

On my Mac, Apple+W is the shortcut for closing a window (or tab in a tabbed application such as Safari or Firefox) while Apple+Q quits the application completely. These keys are right next to each other on the keyboard. Today, for the final time, I hit the wrong key and accidentally sent a couple of days accumulation of useful browser windows straight in to the abyss. I say for the last time because my intended IRC rant about the stupidity of setting those two keys right next to each other was cut off by Richard Soderberg, who showed me how to remap keyboard shortcuts for any application in OS X.

[... 242 words]

They Work For You

Today is/was (you never can tell with these wretched time zone differences) NotCon 2004, London’s premiere low-cost, informal, one-day technology conference. Friday’s MiniNTK promised the unveiling of a new project from the people behind FaxYourMP and PublicWhip and sure enough, here it is: TheyWorkForYou.com.

[... 210 words]

Wikipedia enhancements

I don’t know when it happened, but Wikipedia has a stylish new design in mostly valid XHTML 1.0 Transitional (the front page validates, some of the inside pages do not) with a CSS layout to boot. They even have an option to turn off the single layout table used on their home page. The site seems much easier to navigate now and the organisation of the front page is a masterpiece of information architecture. When you’ve got over 250,000 articles just in the English version providing a useful home page is going to be a challenge, but Wikipedia pulls it off with aplomb.

[... 220 words]

A few more thoughts on plinks

From the comments on my plinks entry, it seems some people are seeing ugly green hash marks all over the place. If that includes you, you need to force-reload my stylesheet to ensure you are getting the copy with the plink hiding styles.

[... 444 words]

plinks—a purple numbers variant

Via Tim Bray, I came across the concept of Purple Numbers. In a nutshell these are permalinks attached to every paragraph on a page which, to paraphrase Tim, make every paragraph on a page a first-class Web citizen.

[... 1213 words]

Time to fix those broken pages

I have a whole bunch of gripes about Internet Explorer, but my personal favourite is the way it will render a document served with a text/plain Content-Type header if it thinks the file might contain HTML. The direct result of this is that people with misconfigured web servers who are serving their HTML with the wrong Content-Type frequently don’t realise, so when users of better behaved browsers such as FireFox visit they get hit in the face with a page of raw source code.

[... 307 words]

Executing JavaScript on page load

Peter-Paul Koch recently wrote:

[... 772 words]

TBL on TLDs

Tim Berners Lee (how many TLA celebrities is that now?): New Top Level Domains Considered Harmful. Read the whole thing—Tim blows the .xxx and .mobi proposals out of the water and takes a neat swipe at for-profit registrars in the process. Reading this, the main thing that struck me is how incredibly forward thinking TBL really is. People complain about the long duration of W3C processes and the futuristic nature of the semantic web but the W3C are trying to build technologies that will still be relevant ten or twenty years from now. When you consider the longevity of TCP/IP, this is a really smart strategy. It’s a shame so many people involved with the web have trouble thinking past the next few months.

[... 147 words]

Domain Keys Explained

Via Jeremy Zawodny,, Yahoo’s Anti-Spam Resource Center have published an explanation of their proposed Domain Keys spam fighting technique. At first glance it looks very promising. There’s no centralised authority, no requirements for changes to existing protocols and the central concept is extremely easy to understand. Essentially, mail servers generate a public/private key pair and sign outgoing messages with the private key, while publishing the public key as part of their DNS record. Because only they can publish to their public key in this way the signature can be used to confirm that the sender of the email has not been spoofed. The presence or lack of a signature can be used as part of the process of identifying spam.

[... 155 words]

Atom discussion minutes

The minutes from the Atom/W3C discussion in New York have been posted online. Unfortunately the default formatting is pretty difficult to follow. I found it a lot easier to figure out who was saying what after applying the following CSS (using the test styles bookmarklet):

[... 81 words]

Defending against the OS X help: vulnerability

There’s a nasty OS X vulnerability under discussion at the moment which lets a web page execute code on your machine by taking advantage of a flaw in the “help:” protocol. There’s a non-malicious demonstration of the exploit on this page, and Jay Allen is hosting a discussion on the exploit and ways to avoid it.

[... 253 words]

Supplemental Results

Does anyone know what Google means when it says that something is a “Supplemental Result”?

[... 16 words]

Simple mini-languages with PHP

I linked to PDML the other day in my blogmarks, but beyond a cursory glance I hadn’t really dug in to what makes it tick. Dumky over at Curiosity is bliss points out that it makes use of an ingenious output buffering trick. To create a PDML document, you add a single line to the top of a page that includes and executes the PDML library (written in PHP). The rest of the document is written in the custom PDML markup language. The script uses output buffering to capture the rest of the page, then executes a callback function that actually processes the page content (see ob_start() for details).

[... 195 words]

W3C Internationalisation Guidelines

Via Phil Ringnalda, the W3C have published three useful articles on HTML internationalisation techniques. In classic W3C style, the boilerplate and verbiage at the start of the documents threatens to overwhelm the actual content. Here’s a tip: jump straight to chapter 2, which is normally where the interesting stuff starts. Here are the ammended links:

[... 88 words]

Google approved PageRank stripping

Blogger are now using the redirect-without-PageRank technique to protect their hosted blogs against comment spam (also used by Moveable Type). At the risk of sounding incredibly pleased with myself (which I am), that was my idea! Sweet.

[... 213 words]

Switch statements in Python

Python doesn’t support a native switch statement. I’ve found myself using the following coding idiom instead recently which seems to work pretty well:

[... 114 words]

What makes a geek?

Meri has a great post up entitled Because We Are Geeks, which highlights the differences between geeks and the rest of the world and asks if geeks are really suited to designing and marketing products for non-geeks.

[... 148 words]

Don’t make me lie to you

So what’s the deal with this?

[... 194 words]

CSS History

John Allsopp: Message To The Messengers—Props to the old school:

[... 151 words]