Simon Willison’s Weblog

Subscribe

Items in Aug, 2003

Filters: Year: 2003 × Month: Aug × Sorted by date


On mod_python

So, I’m getting stuck in to mod_python in a pretty big way at the moment. I’ve never even used mod_perl before, so coming from PHP this is turning out to be a real eye opener.

[... 332 words]

Learning mod_rewrite

I think I’ve finally cracked mod_rewrite, thanks mainly to SitePoint. Key resources:

[... 60 words]

Too much accessibility

Tom Gilder is right on target with his latest rant about sites that add accessiblity features without thinking about their consequences. Accessibility frequently involves adding new markup but you can definitely have too much of a good thing.

[... 40 words]

HTML: More structural than semantic

Semantic markup is getting a lot of blog coverage at the moment, following a starter post by Jason Kottke. There’s some great content flowing around (Dave Shea, Doug Bowman and Paul Scrivens in particular devote whole essays to the topic) but the central point is the same: just because a page validates doesn’t mean it’s good HTML; semantic markup is equally if not more important for building good pages.

[... 274 words]

Great liquid design example

I’ve started browsing the web at 1600x1200, because I have a nice big monitor and a tendency to browse with my font size set to large. At this resolution you really begin to appreciate the argument put forward by fixed-width site design advocates that liquid designs can end up plain unreadable on some setups. I could just reduce the size of my browser window, but I’m lazy. Instead I’ll point out that the Rocky Mountain Harley-Davidson dealership is a liquid site that manages to look great even at ludicrously high resolutions. It’s got some very decent CSS and structural markup under the hood as well.

[... 109 words]

Banning Google Comments

Russell Beattie has an ingenious solution to the problem caused by weblog un-savvy Google users turning up on old entries and posting comments on them, without properly understanding the nature of the site. He simply displays the page without a comments form if he spots Google in the user’s referrer. I’d be tempted to do the same thing on this site if I didn’t find the comments on my ancient MSN Messenger rant so amusing.

[... 83 words]

Advocating Standards

Ian Lloyd: Designing for the future, and the training gap. Ian highlights the frustrations faced by all web standards advocates when trying to encourage their less web-enthused co-workers to take the leap. I’ve been incredibly lucky in that both Incutio and LJ-World have a remarkably forward thinking approach to web standards, but I can still identify with the spirit of Ian’s article.

[... 441 words]

Hire Meyer

Congratulations to Eric Meyer on the launch of his new consultancy business, Complex Spiral Consulting (named after his famous css/edge demo). The new company’s tag line is “Helping clients improve the bottom line through the use of Web standards”, so it looks like the theme of standards advocacy is continued from his role at Netscape. Eric has also promised a series of occasional articles/tutorials, the first of which explains some useful techniques for using floats as part of CSS designs.

[... 87 words]

XML textarea validation bookmarklet

Jesse Ruderman’s Blogidate bookmarklets cycle through all of the textareas on the current page and submit their contents for validation. I suggested an alternative approach, and to my great delight has has followed it up with the essential Blogidate XML well-formedness. One click, and each textarea on the page will be checked to see if it contains valid XHTML. If it does, the background goes green—if not, it goes red. Hopefully I’ll never post another invalid entry (my previous solution broke when I switched to application/xml+xhtml).

[... 98 words]

Code Kata

I recently read my way through The Pragmatic Programmer and found it easily lived up to my epectations based on reviews I’ve seen on the web. Dave Thomas, one of the book’s authors, has an excellent weblog on which he has been posting a series of programming exercises called Kata. Some are programming problems while some are more related to software design, but each one provides an interesting thought exercise with no instantly obvious solution.

[... 77 words]

ML Types Explained

From a link on the mailing list edition of comp.lang.python, this talk on strong typing (in the form of heavily annotated slides) is an explanation of the ML type system and why it really doesn’t suck. From the same thread, Felix is a new high level C++ style language with an ML style type system which looks like it could be worth experimenting with.

[... 72 words]

I’m in Kansas

If you’ve been wondering why the site has been so quiet for the past few days, here’s the reason: I’ve moved to the States! To cut a long story short, I’m here in sunny Lawrence for a couple of weeks preparing for a year long industrial placement at the Lawrence Journal-World, which should start for real in October (depending on my Visa application). To call this an exciting opportunity would be an understatement. The team I’m working with have won a ton of awards, and have a fearsome reputation within the industry. I’m joining Adrian Holovaty (recently interviewed on zlog) as a web developer working on KUSports, LJWorld and the excellent Lawrence.com. The company itself is remarkably forward thinking, especially in its approach to the web (no need to support Netscape 4)—there’s a good overview of what makes the Journal World special here, which includes a video interview with my boss, Rob Curley.

[... 206 words]

Firebird sidebars coming soon

Mozillazine are carrying a preview of the next release of the excellent Firebird browser, with the most exciting new feature being the new support for Mozilla style sidebars (previously known as web panels). I’m looking forward to being able to browse with my blo.gs powered blogroll in a side panel again.

[... 60 words]

3 column CSS layouts: Easier than you might think

In a recent issue of the Sitepoint Tech Times newsletter, Kevin Yank explains (in detail, with pictures) the recurring problem in CSS of trying to create a three column layout with columns of equal height and a footer spanning all three. If you don’t yet understand the problem, you will once you’ve read his article. Kevin suggests a javascript fix for the problem, but fails to mention that by using floats instead of absolutely positioned divs for the side columns a three column layout with a full width footer can be achieved without resorting to javascript. Pixy’s 3 columns, no hacks demonstrates this technique in action. In addition, the CSS-Discuss Wiki has a comprehensive list of 3 column layouts that demonstrate a number of other techniques for solving the same problem.

[... 142 words]

Atom API

Mark Pilgrim has posted an extensively documented demonstration of the current draft of the Atom API, a REST style web service interface for posting to and editing weblogs. It looks like it will be a fun standard to implement; the basic idea (as with all REST services) is to obtain as much leverage as possible out of the HTTP standard, using lesser known methods such as PUT and DELETE in addition to the more common GET and POST. The authentication mechanism is particularly interesting: since Apache’s support for digest authentication requires an additional module that many hosts may not provide, the Atom guys have created their own based around new Atom-Authenticate HTTP headers.

[... 227 words]

PHP Library Tips

Kellan Elliott-McCrea (author of the popular Magpie RSS parser): A Few Tips for Writing Useful Libraries in PHP. Kellan makes the interesting observation that PHP encourages a culture in which most development occurs in the context of either full applications or C extensions, with few people devoting themselves to releasing libraries.

[... 56 words]

Note to self

When writing an XML parsing class in PHP, don’t forget the ampersands in the following code snippet:

[... 85 words]

Python never copies implicitly

10 Python pitfalls by Hans Novak (via Simon Brunning) is essential reading for anyone with more than a passing interest in Python. Python never copies implicitly. If only that were true of PHP.

[... 42 words]

Artificial Diamonds

Wired: The New Diamond Age. Two companies in the US have perfected techniques for creating cheap artificial diamonds, virtually indistinguishable from the real thing. The story of how they got there is riveting—retired army generals purchasing cold war soviet technology, veiled death threats to scientists at conferences and best of all, a very real threat to the De Beers diamond cartel / monopoly.

[... 137 words]

On blogging technique and better tabbed browsing

I’m addicted to tabs. Several times a day, I scan down my blogroll looking for blogs that have updated since I last checked, then middle click each one to open it up in a new tab in the background. I then work my way through each one, reading the earlier ones while the later ones are still loading (tabbed browsing makes being stuck on a modem a lot less painful). If I see anything interesting linked to from a blog entry I’m reading, I’ll middle click that as well. Within a few short minutes I’ll have so many tabs open I’ll be running out of space in my tab bar.

[... 399 words]

Firebird and Mozilla chrome URLs

Jesse Ruderman (of indispensible bookmarklets fame) now has a blog. It’s off to a good start: here’s a useful summary of the different chrome URLs available in Firebird and Mozilla.

[... 42 words]

Multi part forms with Javascript

Andy Arikawa has a nice demonstration showing how multi page forms can be served up as a single page using some simple Javascript, resulting in a clearer form without loading times in between each page.

[... 279 words]

Python script shell integration

In another silly Python/Windows hack, Hans Nowak shows how a simple Python script to move a file up to its parent directory can be added to the contextual menu for all Windows files. I can think of all kinds of useful tricks that can be enabled using this tool: instant uploading of a file to an online Photo Gallery for example.

[... 62 words]

Improved FormProcessor class

I get one or two emails a week about my FormProcessor class, making it the most popular of all of the code experiments I’ve posted on this site. Each time I’m asked if I plan to update it soon, and each time I reply that while I’d love to go back to it, I can’t promise I’ll ever get the time to take it further. The great news is that Peter Bowyer of Maple Design has been working with my code and has made a number of huge improvements to it. If you liked my version, you’ll love his evolution of it: it adds support for radio buttons, checkboxes and select fields and he’s got a number of other interesting ideas up his sleeve for the future.

[... 133 words]

Moveably Type with XSLT

Kevin Davis has set up an impressive demonstration of the power of Moveable Type templates when combined with browser-side XSLT transformations. He’s set up MT to output an XML document containing just his entries (similar to an RSS feed), along with a link to an XSLT stylesheet that causes Mozilla and IE 6 to transform the entry and render it as XHTML.

[... 88 words]

Don’t use document.all

I’ve lost count of the number of Javascript scripts I’ve seen floating around that include the equivalent of the following code snippet:

[... 164 words]

Self-contained data: URI kitchen

I couldn’t resist this. Hixie has released a new version of his data: URI kitchen, to celebrate the addition of data: URI support to the latest Opera beta. In the spirit of recursion, I present this reformulation of the data: URI kitchen that uses client side Javascript. What better way to deliver such a thing than as a data URI?

[... 94 words]

Code personalities

Danny O’Brien compares Perl with Python. Best observation: Python code just doesn’t have much personality compared to Perl.

[... 22 words]

Notepad popups

Ever time I see something like this I’m reminded of how truly irritating the internet would be if I hadn’t switched to Firebird.

[... 27 words]

Neat tip for clean URLs

Here’s one of the neatest tips for clean URLs I’ve seen yet, from Thijs van der Vossen. He’s come up with a mod_rewrite rule that checks to see if the requested file exists if you add .html on to the end of it, and serves it up if that’s the case. I’m posting the full code snippet here because it’s just too good to risk losing to link-rot in the distant future:

[... 88 words]