Simon Willison’s Weblog

Subscribe

Entries

Filters: Sorted by date

PHP5 info from Sterling Hughes

Sterling Hughes has posted the slides he will be using for his presentation on PHP 5 next week. They provide a great deal of insight in to the new additions to look forward to in PHP 5, including a few I hadn’t heard about before.

[... 209 words]

coWiki uses PHP5

coWiki is the first open source project I have seen being developed with PHP 5, using snapshots from CVS. It looks like a really neat wiki system. Of particular interest for PHP heads is the development log on the front page (sorry, no permalinks) which provides some insight in to the progress of PHP 5’s development.

Conference woes

Like Stuart, I’m severely tempted by the UK Python conference—as a student it would cost me £85 to go for the first day, not including train fairs. That’s a lot of money (considering I currently have none) for 4 sessions and the opportunity of a BOF meeting, but it’s quite rare for the UK to host a conference on something I’m heavily interested in (I’m yet to go to one). These tips on getting the most out of a conference would certainly come in handy.

[... 129 words]

Some PHP notes

I ran an intermediate to advanced PHP session at University today, on behalf of BCSS. The turn out wasn’t particularly impressive, probably because the only lecture today had been cancelled so there were a lot fewer people from our course on campus than I had expected (the session was arranged because a piece of group coursework we are working on at the moment uses PHP). The notes I put together from the course are available online. They were put together in a bit of a hurry, so please tell me if you spot any mistakes. Topics covered include sessions and cookies, classes and objects, references and some brief notes on writing secure code.

Useful python resources

A bunch of useful Python resources:

[... 68 words]

Dithered DOM scripts

Dithered.com’s DOM Scripts follow an interesting philosophy:

[... 131 words]

Javascript prototypes

Andrew Hayward (a friend from Uni who has recently started blogging) has been playing with javascript’s prototypes. prototype is a value related to a particular class from which all instances of that class are created—only in javascript classes are actually functions... and then it all gets really complicated.

[... 146 words]

Haunted by old hacks

Paul Hammond is seeking the perfect way of marking up code snippets. He examines several methods, including this interesting specimen:

[... 122 words]

mod_psp

Sterling Hughes (recently blogrolled) has been working on mod_psp, a Python Server Pages module for Apache. He’s up to version 0.2.1 already. Stuart once told me that the toughest problem when embedding Python code in HTML is figuring out how to deal with indentation blocks—PSP appears to handle this by letting the indentation “leak” in to the HTML, which seems a bit of an ugly workaround. Still, if the module ends up being any where near as straight forward to install and use as PHP it could become a very useful tool.

Great new bookmarklets

Via Zeldman, Ian Lloyd (who has recently re-launched his personal blog) has released a pair of invaluable bookmarklets for dissecting the structure of properly marked up pages: Show and label divs with ids and Show and label divs with classes. Combine with Liorean’s ViewStyles and ViewScripts for best effect.

PHP and Javascript spell checker

Last week I commented that Sam Ruby’s spell checking feature could be made even funkier with the addition of a javascript powered “corrections” menu. I spent a few hours this afternoon playing with the idea, and I’ve now got quite a nice proof of concept:

[... 186 words]

Flash Functionality not quite so flash

What Do I Know points to Macromedia’s progress report explaining how thy have been responding to feedback on their recent site redesign. Todd Dominey makes the following insightful observation:

[... 200 words]

The onion gets it spot on

Okay, now I have absolutely no intention of taking this blog in a political direction (for the record I’m anti-war) but I’ve seen a couple of links to the Onion recently that I just can’t resist blogging. First up is Bush: “Our Long National Nightmare of Peace and Propserity is Finally Over” which was written two years ago but, read now, just looks spookily accurate (link via Back-to-Iraq). The second one is the absolute classic God Angrily Clarifies “Don’t Kill” Rule, linked by Simon Brunning.

Clearing out my tabs

I’ve inadvertantly discovered a flaw in the tabbed browsing model—if you’re not disciplined about them you can quickly end up lost in a see of tabs. Right now I have 6 Phoenix windows open with a total of 57 tabs between them. This is the result of about a week’s accumulated browsing, leaving me unable to even think about shutting down or rebooting my computer without clearing them all out first. The fact that Mandrake is churning along happily without any noticable slowdown (despite me having several other applications running as well) doesn’t help at all as it gives me even less impetus to tidy everything up.

[... 466 words]

Wrox and glasshaus go under

It looks like there’s a shakedown going on in technical book publishing land. Glasshaus are no more, and (so far unsubstantiated) rumours are flying round that Wrox are going bust / have gone bust as well.

[... 373 words]

Python and micropayments

Fredrik Lundh has started posting his book The Standard Python Library online, in response to O’Reilly’s decision not to publish a second edition of the book. I’d never read it before, but having sampled the first two chapters I’m hooked. It works a bit like a “cookbook”, with a plethora of code samples explained in detail accompanied by tips and tricks relating to the language. The Lazy Import class, which loads a module only when an attribute of the module is called for the first time, is a classic example:

[... 209 words]

More nukes

[PHP|Post|myPHP]-Nuke has to be one of the most-forked open source projects in history! Xaraya appears to be a fork from Post-Nuke, which itself forked from PHP-Nuke several years ago (and I’m pretty sure there are more). They’ve got an interesting set of RFCs on how they intend to build the next big open source content / community management system (nothing about generating pretty URLs yet). While browsing their site I found a link to PHPXref, a powerful looking tool for generating PHP source code documentation. Unsurprisingly for such a lot of text munging, it’s written in Perl ;)

[... 119 words]

More lightweight software: SQLite

The other toy I’ve been playing with recently is SQLite. SQLite is an embeddable SQL database engine written in just under 25,000 lines of (heavily commented) C. Don’t let the size fool you—it’s phenomenally powerful and is released under a no-holds-barred public domain license that practically begs you to include it in your applications, commercial or not.

[... 239 words]

Blosxom rocks

I’ve been hearing a few good things about Blosxom recently, so a few days ago I decided to see what all the fuss was about. It’s a blogging tool, but it’s a very different species from the average system. Firstly, it’s only 282 lines of Perl (of which only 135 are actual code). Secondly, rather than having a web interface of some sort to add entries it runs entirely from the file system. You specify a data directory, then create entries by dropping .txt files in to that directory using your favourite text editor. The first line of each file is the title, the rest of the file is the entry, and the entry’s date is taken from the last-modified time of the file.

[... 392 words]

Surviving Slashdot

Scott Johnson’s Roogle RSS search engine got slashdotted yesterday, and survived the storm unharmed thanks to Scott’s quick thinking server admin Demitrious setting up mod_throttle to help handle the load. Demitrious describes the solution in this post.

Web standards for news sites

Adrian Holovaty’s open email to Staci D. Kramer of Online Journalism Review makes an excellent case for the adoption of web standards by online news sites. It’s written in nice, clear non technical terms and does a good job of explaining the web standards movement in a short space of time. Could definitely be useful for forwarding on to non-technical people (managers for example?) to help spread the word.

Replacing text with images

Douglas Bowman writes about Guiltless Image Use, describing a technique that uses CSS to cause text to vanish from the page, then replaces it with a background-image. I experimented with this technique (see comments attached to that entry) myself last year but ended up using image tags inside h1 elements instead. Doug’s drop cap example shows that the technique can be applied in interesting ways outside of headers.

A plea for pings

Blogs I would read a lot more often if only they pinged weblogs.com when they updated:

[... 124 words]

Thirty five year old cookies

I’m finding myself slightly confused about the Google backlash washing around the blogosphere, which is summarised quite well by Gavin Sheridan. Most of the arguments against using Google unsurprisingly centre around privacy issues, in particular the “35 year cookie”. I was under the impression that cookies could only be set for a maximum of a year, but having checked Netscape’s Cookie Specification and RFC 2965 it appears I was mistaken.

[... 566 words]

Roogle

Scott Johnson has put together a blog search engine with a difference: it indexes RSS feeds rather than crawling the blogs themselves. Roogle is still under heavy development (and Scott is blogging it as he goes) but is shaping up to be a very neat tool. If your blog isn’t already being indexed, you can add it using this form.

WThRemix entrants

The WThRemix contest has posted a list of submitted entries. The contest (to design a new homepage for the W3C) asked entrants to use valid tableless XHTML, CSS and meet WAI accessibility level 1. The entries demonstrate a wide variety of layout and design techniques and are well worth browsing through. The winners will be announced on March 17th.

Spell check in web applications

Sam Ruby has enabled spell checking for the preview comment tool on his blog. I wonder how it works... I’ve lost track of the scripting language Sam uses for Intertwingly (PHP? Python? Perl?) but I know PHP can be compiled with support for the Pspell module.

[... 204 words]

Jeff minter blogs

Wow. Jeff Minter has a blog.

Python power

Sam Ruby’s ultra-simple 3-paned aggregator is a great example of the power of high level scripting languages. Using the wxPython cross-platform GUI toolkit and Mark Pilgrim’s ultra-liberal RSS Parser it provides a full application in a mere 107 lines of (highly readable and maintainable) code.

[... 127 words]

Scott Andrew redesigns

Scott Andrew has been hit by redesign fever as well. His reworking is accompanied by a change in direction:

[... 193 words]