Simon Willison’s Weblog

Subscribe
Atom feed

Entries

Filters: Sorted by date

Advanced Python network programming

Understanding Network I/O, Part 2 by George Belotsky (via The Farm) is the best tutorial on the subject of network programming I’ve seen yet. It provides a detailed explanation of simple threaded network clients, thread pools using the Queue module and asynchronous I/O using both Twisted and Python’s asyncore library—then discusses the strengths and weaknesses of each approach.

[... 93 words]

End user license agreements hit a new low

So apparently there’s an unpleasant worm going around AOL Instant Messenger at the moment. Only it’s not a worm—it’s a semi-legitimate piece of adware which asks you for permission to “modify the instant messenger software, deliver additional content such as advertisements and promotional messages” and announces that “In addition, the software will interoperate with your current instant messaging client so as to permit the automatic sending of advertising messages originating from your computer to your contact or ’buddy’ list regarding content offered by PSD Tools or its suppliers.”

[... 126 words]

Hacking the political system

Danny O’Brien has a fascinating post up about the nature of hacking and how to game entrenched political systems. It’s all worth reading, but the part about how Fax Your MP was created as a deliberate political hack in particular caught my attention. I’ve long been a fan of Fax Your MP and it’s really interesting to see some of the ideas behind the system explained:

[... 380 words]

Automatic line ending conversions in IE

I’ve just updated my SitePoint blog with a tale of Javascript debugging woe. To cut a long story short, Internet Explorer for both Mac and Windows automatically converts sane line endings in to the platform specific alternatives whenever you assign a Javascript string to the value attribute of a text area. It’s the kind of quirk that can take up a whole morning’s worth of debugging.

RSS vs Atom, condensed

Jeremy Zawodny:

[... 63 words]

Code generation vs data driven programming

Via Ned Batchelder, this interview with pragmatic Dave Thomas on code generation closely reflects my own nascent thoughts on the issue:

[... 369 words]

width = str(len(str(len(lines))))

The above monstrosity came up today while writing a function to add zero padded line numbers to a chunk of text:

[... 78 words]

The dangers of PageRank

A well documented side effect of the weblog format is that it brings Google PageRank in almost absurd quantities. I’m now the 5th result for simon on Google, and I’ve been the top result for simon willison almost since the day I launched. High rankings however are not always a good thing, especially when combined with a comment system. A growing number of bloggers have found themselves at the top position for terms of little or no relevance to the rest of their sites, which in turn can attract truly surreal comments from visitors from search engines who may never have encountered a blog before.

[... 469 words]

Hot Links

The thing I love about RSS, and by extension web services, is that they allow people to take publically available data and combine it in ways never thought of by the originator of the feed. The internet is awash with examples of this, from useful services such as Feedster to useless amusements like I despise you and your so-called taste, the most insulting extension of the Amazon API I’ve seen to date.

[... 249 words]

Command line Futurama quotes

Today’s command line amusement:

[... 14 words]

The return of the Spong Monkeys

Via Eric Meyer, at least I’m not the only one selling out. Joel Veitch’s infamous Spong Monkeys can now be seen in two TV ads for Quiznos sandwhiches: We love the subs and Take a buck off (Quicktime movies). It’s nice to see such awesome and uniquely British talent recognised at a global level.

I’ve sold out!

What can I say—the lure of the mighty dollar proved too much. I’ve just made my first post to my new client-side scripting blog over at SitePoint, as a paid columnist.

[... 244 words]

No more usernames in URLs

This one could get very interesting. Microsoft have announced that an upcoming update to Internet Explorer will remove the ability to include usernames in URLs completely. This is in response to the growing problem of so called “phishing” scams, which use trick URLs to con important information such as passwords and credit card details out of unsuspecting browser users.

[... 730 words]

Cold War check point

Nollind Whachell in a discussion on Asterisk*.

[... 83 words]

Iterating over a sequence in reverse

At work today we stumbled across a situation where we needed to display a list of items in reverse order. The decision to show them in reverse is made in the presentation layer, so altering the code that generates the list in the application logic layer would add coupling between the layers that we would rather avoid. Python’s reverse() function acts on a data structure in place, which we would rather avoid as well. Then we realised that Python’s generators could be used to create a proxy around the sequence allowing us to cycle through it in reverse without altering the sequence itself. Here’s the code:

[... 242 words]

Solving comment spam

There are two main schools of thought concerning comment spam: the optimists and the defeatists. Optimists believe that comment spam can be beaten with technology; defeatists (maybe I should call them pessimists) believe that comments are as doomed as email and we’re all going to hell in a hand basket.

[... 967 words]

Simple tricks for more usable forms

My second article for SitePoint has been published: Simple tricks for more usable forms. It examines a whole bunch of CSS and Javascript tricks for improving the usability of web based forms without impairing their accessibility to clients that don’t support those technologies. The article has already had some useful feedback on the forums, including the valuable observation that auto-selecting the contents of a form field when it receives the focus can have a negative effect on the usability of Unix browsers, where mouse buttons are frequently used for coping and pasting.

Defending web applications against dictionary attacks

Over at Reflective Surface, Ronaldo M. Ferraz discusses the usability of an authentication system that locks down an account for a certain period of time after three failed login attempts. Ronaldo sees this as a trade off between usability and security, but I see it more as an added security issue in that it allows malicious third parties to lock other user’s accounts armed only with their username.

[... 398 words]

Moveable Type now kills PageRank on comment links

This is pretty cool: Moveable Type 2.661 is out and includes a whole bunch of comment spam fighting features, including one inspired by my own anti-spam measure of disabling PageRank on links from comments by sending them through a redirect. This is great news for me as the redirect acts as a deterrent, and deterrents are only worthwhile if people know about them in the first place. With the most popular blogging system (at least amongst comment spammers) now featuring the same deterrent hopefully SEO spammers will start to get the message.

This could be the most ludicrous tech patent yet

Patent 6,671,714:

[... 148 words]

Advice worth repeating

Tim Bray’s Laws of Explanation:

[... 55 words]

You mean there IS an IE team?

Robert Scoble went to lunch with the head of the Internet Explorer team—yes, they still exist, despite having released nothing but security patches for over two years.

[... 220 words]

Doing more with the iSight

The iSight came close to being the biggest disappointments of my new Mac experience. It looks gorgeous and appears to integrate seamlessly with iChat AV, although as I don’t currently have any contacts with an iSight I haven’t been able to try video conferencing yet. The dissapointment is that there was no clear way of using it to capture video directly—a feature that I reasonably expected from iMovie. Apple’s knowledge base knocks the point home pretty clearly:

[... 206 words]

Backseat driving

Just one of the many gems to be found in Greg Knauss’ Devil’s Dictionary.

[... 46 words]

Mac-tastic

Sorry for the radio silence; I’ve been playing with my new Mac. It’s been an almost entirely positive experience—it’s certainly the most enjoyable computer I’ve ever owned. I’ve also only crashed an application once so far—bizarrely it was the Terminal while accidentally pasting in a whole bunch of junk. Other than that the system stability and performance is excellent—and it’s only running on 256 MB of RAM while I try and find one of those tiny screwdrivers to install the upgrade.

[... 801 words]

A hacker’s introduction to OS X

What is Max OS X by Amit Singh is hands down the best introduction to that operating system I’ve ever come across. It’s aimed at a technical audience, does a very good job of keeping a fair balance balanced when comparing OS X with other operating systems and has taught me a whole bunch of interesting things about the system.

[... 294 words]

PaWS 2004

Here’s an interesting topic for a conference: PHP and Web Standards, to be held in Manchester from February 20th to the 24th. I’ve devoted a lot of time and energy to combining the two for this blog—it’s a shame I’ll be out of the country when the conference rolls around. I should be able to make it to SXSW this year though.

Decentralised social networking

I know I’m late to the party, but my recent experiments with LinkedIn and Friendster have got me all interested in the potential of software that bulids on top of people’s own social networks. There’s just one thing that’s been bugging me, best explained by this quote from Om Malik:

[... 258 words]

Targets for 2004

Looking back on 2003, one thing really stuck out for me: I didn’t learn a new programming language. The Pragmatic Programmers recommend learning at least one new language every year, and I’ve heard similar advice from other notable authorities; Ruby’s Matz made a similar point in an article published just the other day.

[... 208 words]

Object relational mappings are over-rated...

... At least according to Tim Bray:

[... 375 words]