Simon Willison’s Weblog

Subscribe

Items in Jan, 2003

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


Off to amsterdam

Off to Amsterdam. Back Sunday.

[... 5 words]

Python bits and bobs

Two fun bits from the Daily Python URL today (still without permalinks). SQLObject is an object-relational mapper class which can create objects that directly map to rows in a relational database, making INSERTs and UPDATEs much simpler. I’ve tried to write this kind of thing in PHP before with mixed results, so I’m quite tempted to pinch the idea of tracking foreign keys and joins for my next attempt. More immediately useful however is rlcompleter2 which adds tab based auto completion to the Python interactive prompt. I had a play with it earlier and it was definitely an improvement on the vanilla command line.

[... 110 words]

Switched

I never thought I’d actually do it, but I’ve switched. Not to one of these (I only wish I could afford it), but to Mandrake 9. The way I figured it I only ever use Windows 98 for browsing the web, editing text files and messing around with Python, so I might as well get stuck in to a more exciting operating system with the same capabilities.

[... 238 words]

Mmm... pie

Weebl and Bob like pie. I also like pie. Luckily for me, my girlfriend, while frequently a disaster in the kitchen (rice and OXO gravy anyone?), is a truly accomplished pie chef as of last night. She has posted her delectable recipe here. Her chocolate chip cookies are even better.

[... 57 words]

More markovers

Other weblogs.com remakes: (via Scripting News): Gary Taylor, Dave Polaschek, Douglas Bowman. Doug’s is particularly impressive, featuring an almost pixel perfect recreation of the original page with nice semantic markup and nods towards accessibility as well.

[... 40 words]

Weblogs.com table using floats

I’ve knocked up another attempt at Weblogs.com in CSS, this time using floats instead of absolute/relative positioning. It seems to work pretty well.

[... 30 words]

K5 text ads

Via Inluminent, a short Q&Awith Rusty of K5 discussing the site’s innovative new text-ads-with-comments format.

[... 335 words]

Weblogs markover

Also, I know it isn’t what Dave was after but I’ve recreated the front page of Weblogs.com in structural/semantic XHTML and CSS as well. Again, it works fine in Phoenix and IE 6 but probably needs a few tweaks for other modern browsers (and Netscape 4 gets a plain layout without any styles at all). I’ve actually got quite a large collection of “markovers” now—I started doing them last year while learning CSS and they have been accumulating ever since. One of these days I plan to put them online together with a basic overview of the techniques used and problems encountered with each one.

[... 123 words]

Weblogs table as an ordered list

Dave Winer:

[... 259 words]

Dynamic Python class methods

Dynamically extending APIs: Mark Pilgrim demonstrates how Python’s “new” module can be used to dynamically add new methods to existing classes at run time, and shows how this can be used to increase productivity when parsing XML. I’ve long been impressed with Python’s ability to add new methods to an object at runtime just by assigning a function reference to an object property but I had no idea it was possible to do this with classes as well. If you liked that tip, Dive Into Python has in depth explanations of more obscure Python features than you can shake a stick at.

[... 108 words]

Work safe CSS

Here’s a novel use of a stylesheet switcher: Providing a “work safe” edition of a weblog.

[... 33 words]

Letter to the editor spam

Scott is horrified by the fact that some American political organisations are co-ordinating massive “letter to the editor” campaigns using email lists and websites. It’s certainly a worrying trend, but once again Google comes to the rescue. Try this query and see for yourself.

[... 59 words]

MySQL adds subselects

MySQL Adds Subselects, Upgrades Performance and Security:

[... 92 words]

Adequacy gone

It looks like Adequacy.org has come to an end. For those unfamiliar with the site, it was a truly unique evolution of the common internet troll. Adequacy specialised in posting stories that were deliberately designed to cause controversy, then sending out carefully crafted “invitations” to any online communities that were most likely to take the bait. Since, unlike other trolling situations, the trolls were now in control of the discussion they could prolong the scam by deleting any comments which had figured out what was going on and were trying to warn other clueless participants.

[... 151 words]

Another standards rant

A message to clueless website authors is an entertaining and informative rant against browser specific, standards incompliant sites. Via Aquarionics.

[... 25 words]

Python path module

The path Python module (via The Daily Python-URL) is a nice looking wrapper class for Python’s oft-confusing os.path module. Check out this neat code comparison:

[... 103 words]

DOM support tables

PPK’s ever excellent JavaScript Section now features updated DOM compatibility tables for W3C Core and W3C HTML. The tables contain detailed descriptions of suport for DOM features in IE 5 and 6 for Windows, IE for Mac, Mozilla 1.2, Safari 1.0 Beta, Opera 7 Beta and iCab 2.8.2. I’ve been playing around with the DOM quite a lot recently and the differences between IE and Mozilla were driving me up the wall—I only wish I’d found this fantastic resource sooner.

[... 164 words]

Anil Dash on diamonds

Anil Dash: Diamonds are for never. A thoroughly entertaining and educating rant about the Diamond industry. Some day I hope to be this articulate.

[... 25 words]

More body ID fun

Scott Andrew points out another smart trick with body tag ID attributes—selectively showing and hiding navigation elements depending on the current page. This is a really neat idea, but it does lead to a blurring of the lines between structure and presentation—if a navigation section isn’t relevant to a particular page this should be mirrored in the markup rather than worked around by the CSS. That said, there are some nice presentational touches which could be achieved with this technique without sacrificing structural purity, such as highlighting the navigation menu item for the current page in a different colour:

[... 158 words]

More Vellum

Vellum 1.0a4 is out, and features comment support via a new Comments plugin and an Audience generic object type that abstracts the concept of “responses to your post” and is also used for Pingback support. Different response types within the same interface is a very neat idea, as Sam Ruby has demonstrated with his integrated comments, referral tracking, Pingbacks and TrackBacks. Stuart also suggests auto-discovery of You-Know-Me information from the URL of your weblog, presumably by another link element. This is a great idea, but I have reservations about the performance trade off as unauthenticated comment systems will have to retrieve the poster’s home page in the background every time they make a post.

[... 132 words]

Stylesheet parsing gets complicated

Craig Saila points to the SearchEngineWatch Webpage Size Checker. It’s a nice tool, but it doesn’t appear to take the size of linked style sheets in to account. I was playing around with the idea of a web page cache written in Python over Christmas and I hit the same kind of problem—while finding linked stylesheets using Python’s HTML parser wasn’t too difficult (and could be achieved equally well using a regular expression) things get a lot hairier when you start to take @import statements and CSS defined background images / custom bullet images in to account. Again I imagine a solution could be hacked out with regular expressions but a nicer method would be some kind of CSS parser (the Python standard library has yet to include one). Maybe another project for a rainy day...

[... 154 words]

Scaling the two way web

Another Dave inspired post: It seems I misunderstood Dave’s objections to blogging feedback mechanisms yesterday. I thought he was ruling out what I see as an invaluable tool for low traffic bloggers, but in fact his main complaint was that things like comments / TrackBacks and so forth simply don’t scale. Mark Pilgrim echos his complaints, pointing out how overwhelmed his blog was with auto-linkbacks from his Safari review. l.m.orchard concurrs: At present, I’m safe. My rating is Mostly Harmless, so all my open systems are mostly free from abuse. But, the first time I really strike a nerve somewhere, I’m a sitting duck.

[... 271 words]

You know me

Dave Winer: The “You Know Me” Button. Dave hates posting comments on blogs and then having to check back constantly to see if anyone has replied (I do too). Sam Ruby’s solution is to provide the comments as a separate RSS feed for each of his entries, but Dave wants something more automatic that won’t clog up his aggregator. Dave’s new proposal is intruiging to say the least. When you sign up for an account with a discussion forum you have the option of configuring a link to an “identity server” able to respond to a specific protocol. Once this has been done, the discussion software “pings” your identity server with your username and a message whenever someone responds to one of your posts.

[... 402 words]

A global conversation

Dave Winer on TrackBacks and push backs (and presumably PingBack as well):

[... 317 words]

Recursive how?

I just can’t figure out how Recursive was made.

[... 10 words]

Pythonology

Pythonology (via Deadly Bloody Serious about Python) is a Python advocacy site aimed at software engineers and managers. The site has a fantastic collection of case studies, Python Success Stories, which an interesting piece describing why and how Rackspace migrated their main enterprise data system from PHP to Python.

[... 65 words]

Alternative rollover script

And here’s Daniel Nolan’s standards compliant rollover script, which uses a different approach (based on rollover images using a standard naming convention with a suffix attached to the name of the original image) but achieves the same effect, working in Opera 7 as well. It also uses a neat way of adding events using javascript function prototypes.

[... 58 words]

Better image rollovers

When browsing through other site’s source code, some of the ugliest HTML occurs when the site uses one of the most basic javascript effects: The image rollover. There are a myriad of these scripts available for free on the web, but as far as I can tell every single one of them requires event handling code to be added to the markup of the page.

[... 341 words]

The Eric Eldred act

Larry Lessig has a new campaign: a “copyright tax” that kicks in 50 years in to a copyright term, demanding copyright owners to pay a nominal fee ($1—$50) to maintain control of their copyright. Unused works that are no longer profitable should then default to falling in to the public domain, while more commercial works can stay copyrighted. Larry’s idea was first announced in this New York Times Op-Ed and is also covered on Lessig’s blog. He has also published an FAQ.

[... 107 words]

Spam conference

It sounds like Paul Graham’s Spam Conference was a huge success, with attendance rocketing to 560 from the original estimate of 50—60. Scott Johnson sings its praise and promises a full write up later on. In the meantime, webcasts of the talks are available on the conference website.

[... 58 words]