EvServer, Introduction: The tale of a forgotten feature

Marek Majkowski wrote “Long long time ago there was a WSGI spec. This document described a lot of interesting stuff. Between other very important paragraphs you could find a hidden gem: [...] applications will usually return an iterator (often a generator-iterator) that produces the output in a block-by-block fashion. These blocks may be broken to coincide with mulitpart boundaries (for "server push"), or just before time-consuming tasks (such as reading another block of an on-disk file). [...] It means that all WSGI conforming servers should be able to send multipart http responses. WSGI clock application theoretically could be written like that: def clock_demo(environ, start_response): start_response("200 OK", [('Content-type','text/plain')]) for i in range(100): yield "%sn" % (datetime.datetime.now(),) time.sleep(1) The problem is that way of programming just doesn't work well. It's not scalable, requires a lot of threads and can eat a lot of resources. That's why the feature has been forgotten. Until May 2008, when Christopher Stawarz reminded us this feature and proposed an enhancement to it. He suggested, that instead of blocking, like time.sleep(1), inside the code WSGI application should return a file descriptor to server. When an event happens on this descriptor, the WSGI app will be continued. Here's equivalent of the previous code, but using the extension. With appropriate server this could be scalable and work as expected: def clock_demo(environ, start_response): start_response("200 OK", [('Content-type','text/plain')]) sd = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) try: for i in range(100): yield environ['x-wsgiorg.fdevent.readable'](sd, 1.0) yield "%sn" % (datetime.datetime.now(),) except GeneratorExit: pass sd.close() So I created a server that supports it: EvServer the Asynchronous Python WSGI Server ”

Firefox tabs are finally usable

Michael Bridgen wrote “If you use Firefox, go and install the Ctrl-Tab add-on. Tabs are great for reducing clutter, but they fail to make life much easier because the tab navigation doesn’t support the common patterns of use. For example, I end up opening the same page in multiple tabs because it is quicker to do that than…”

Adding distributed version control to TiddlyWiki

Tony Garnock-Jones wrote “After my talk on Javascript DVCS at the Osmosoft Open Source Show’n’tell, I went to visit Osmosoft, the developers of TiddlyWiki, to talk about giving TiddlyWiki some DVCS-like abilities. Martin Budden and I sat down and built a couple of prototypes: one where each tiddler is versioned every time it is edited, and one where…”

diff3, merging, and distributed version control

Tony Garnock-Jones wrote “Yesterday I presented my work on Javascript diff, diff3, merging and version control at the Osmosoft Open Source Show ‘n Tell. (Previous posts about this stuff: here and here.) The slides for the talk are here. They’re a work-in-progress – as I think of things, I’ll continue to update them. To summarise: I’ve used the…”

Diff for Javascript, revisited

Tony Garnock-Jones wrote “Last weekend I finally revisited the diff-in-javascript code I'd written a couple of years back, adding (very simple) patch-like and diff3-like functionality. On the way, not only did I discover Khanna, Kunal and Pierce's excellent paper "A Formal Investigation of Diff3", but I found revctrl.org, the revision-control wiki, which I'm just starting to get my teeth into. I'm looking forward to learning more about merge algorithms. The code I wrote last weekend is available: just download diff.js. The tools included: * [cci no_cc="true"]Diff.diff_comm[/cci] - works like a simple Unix comm(1) * [cci no_cc="true"]Diff.diff_patch[/cci] - works like a simple Unix diff(1) * [cci no_cc="true"]Diff.patch[/cci] - works like a (very) simple Unix patch(1) (it's not a patch on Wall's patch) * [cci no_cc="true"]Diff.diff3_merge[/cci] - works like a couple of the variations on GNU's diff3(1) Read on for some examples showing the library in action.”

XML CDATA and escaping

Tony Garnock-Jones wrote “XML’s syntax for CDATA looks like this: <![CDATA[some text]]> Tag syntax within a CDATA section is suspended, so this is well-formed XML: <![CDATA[some <more> text]]> even though it looks like the “<more>” tag is unclosed. There’s only one thing you can’t say in a CDATA section: “]]>”. But there’s a trick to save us, even…”

Why does everything on the web require registration?

Michael Bridgen wrote “Some sites or services, quite reasonably, need to know who I am (and that I really am that person, to some acceptable level of verifiability). It’s usually because they hold data on my behalf, and neither me nor they want anyone else getting at that data. But why does InfoQ require me to register to…”

Only two things are infinite

Tom Berger wrote “YAHOO has announced that it will soon be offering unlimited storage to users of its free web-mail product. What does it really mean, and what can we learn from this about the marriage between engineering and marketing.”

Improved unobtrusive linked select boxes

Michael Bridgen wrote “Here's a problem that crops up regularly in Web interfaces: having a dropdown whose available options depend on another dropdown.”

Web Development with Python

Tom Berger wrote “For a new web project we're working on, we wanted to use a dynamic environment. We've resolved to use Python, a language we feel very comfortable with, and I went to test several pythonic web components, in particular the stuff that gets bundled with TurboGears and web.py.”

DLAs, mashups and canapes

Mike Rowlands wrote “TV Chefs and blogs have had it — networking evenings and portals are back Last Thursday I went to and event titled Digital Lifestyle Aggregators at the ever so posh BT Centre and learnt three things about this latest web 2.0 trend Digital Content Aggregation is when you present a load of different content sources…”

Managing CSS: part 1, Factoring

Michael Bridgen wrote “In these days of semantic markup, liquid three column layouts and image replacement it’s quite evident that using CSS is just not as simple as it promises to be. There’s not only the flow and box models to internalise, but the numerous quirks in how browsers implement them, and the constraints imposed by accessibility guidelines,…”