Thu, 30 Jan 2003
Auto-generated Python Programmer Weblog updates page online

I've collected all the RSS feeds from the Python Programmer Weblogs wiki page and am now generating an updates page on the hour using a slightly modified version of pyblagg.

My modifications allow me to turn off rss feeds that "go bad" for whatever reason (at the moment I only do it for feeds that don't datestamp their individual items), and they also let me list weblogs that don't have RSS feeds.

Oh, and no, it doesn't handle timezones at all - at the moment it assumes feed times are in UTC ;)

path: /python | permanent link |
"So what's remarkable about these headlines?"

Hurm. I'd done well not posting stuff about U.S. politics for a while, but this one had to be mentioned. Atrios says this is the best weblog entry ever, and I agree. Make sure you read it to the end.

path: /stuff | permanent link |
Wed, 29 Jan 2003
More Mini-ITX

Oddly enough, I can't find anyone who's put a Mini-ITX motherboard in an XBOX case... ;)

path: /stuff | permanent link |
Australian Recording Industry Association doesn't blame pirates!

In a shock move, ARIA has said that they don't blame pirates for dropping music sales (in similar numbers to the U.S.) but rather the other economic factors that everyone else has been pointing to.

from SMH

path: /stuff | permanent link |
Ow, it hurts

I spent the better part of 3 hours last night dancing like an idiot (which is pretty much the only way I know how :) to Underworld live. Damn, they do a fine job of performing live.

path: /stuff | permanent link |
Tue, 28 Jan 2003
No more daily photo, I'm afraid...

The crappy digital camera is simply too good at losing photos, and my frustration level has been reached. I've had six days running of not having any viable photos from anywhere more than 10 meters from the computer. I fully intend to re-start the project once I get a camera that reliably stores and retrieves the images. I'm not a happy photographer :(

path: /stuff | permanent link |
This is just too cool :)

A friend of mine is looking to set up a fanless PC for home entertainment purposes. He's spent a while poking around the 'net before he discovers, the home of enthusiasts of the Mini-ITX form-factor PC motherboards. These puppies are small and typically come with low-heat CPUs so they need no cooling. Because they're so small, they can fit in to all sorts of imaginative cases :)

path: /stuff | permanent link |
Sun, 26 Jan 2003
PyPI now has a browsing feature

Thanks to amk, PyPI now has a browsing feature. This has been developed along the lines of the Flamenco Search Interface Project (hey, look, another of Ping's projects ;)

The rapidly expanding size and complexity of information collections necessitates new interfaces for exploring, searching, and understanding their contents. The Flamenco project investigates how to effectively incorporate large, faceted category hierarchies into information access user interfaces.

The result is really quite usable. I'll look into the formatting of the categories some time later maybe. Hopefully I can just do some CSS magic to format the category "boxes".

Oh, and remember that if you're interested in any of the PyPI code, you can just grab if from the project page.

path: /python | permanent link |
Fri, 24 Jan 2003
Roundup 0.5.5 is out

Another maintenance release of Roundup, my issue tracking software, is out. Still plugging away at the 0.6 codebase, but slowly - at the moment I'm focused on work and a little bit of PyPI.

On the PyPI subject, I got the trove classifier editing part of the form going on the train this morning. I spent the last bit of the trip in the city loop (Melbourne's underground train line that just loops around the CBD) implementing a "latest changes" view and then an RSS feed. All of this is now installed on the test server.

path: /python | permanent link |
Autotracing some daily photos

Autotrace is a very cool program that, with some tweaking, can produce some very interesting imagery from regular bitmap images (eg. JPEGs). The output is a vector-based image (I've output to PDF) - that means that it's croppable, scalable and printable without a loss of quality. I've collected some of the images from my daily photo collection and autotraced them here.

I've found that the saturated images that the crappy digital camera produces actually work quite well with the tracing. I think that for a while I'm going to actively look for shots that would translate well. Assuming the crappy camera doesn't eat the images before I can download them, that is ;)

The results (PDF and a PNG screengrab from kghostview) are over here...

thanks acb for the pointer.

path: /stuff | permanent link |
Thu, 23 Jan 2003
PyPI working on creosote!

Well, the final big hurdle in the PyPI project was to get the server-side software running on the server, "creosote".

Today, with huge thanks to Thomas Wouters, I finally got the pypi sandbox, apache config and all the rest all working. I won't tell you the URL yet because I'd like to coordinate the annoucement of the "real" server with the second alpha of Python 2.3. Fortunately the users who have already installed the register command will still be able to submit to the index even after the move, and I'll be able to tell them in a reasonable manner. I've made sure the command handles HTTP responses other than 200 sanely. This means when I make the move I can just have the server respond with a 302 "go over here instead", and if we need to do maintenance, I can have the server respond with 503 "down for maintenance, come back later".

Thanks to plugs from all over, it's getting much more popular, and I'm going to be working on the Trove browser as a priority now.

Thanks to everyone who's submitted their package info to the index so far!

path: /python | permanent link |
Tue, 21 Jan 2003
Really, really cheap camera

I've discovered that the camera will occasionally lock up, requiring a "hard reset" (which involves opening the battery compartment briefly). It also won't work plugged into my Linux machines, so I have to risk that any photos taken during the day will actually survive into the evening when I can dump them onto Rachel's Windows PC.

Ah, suffering for my art ;)

path: /stuff | permanent link |
Sun, 19 Jan 2003
We've got a new toy

OK, it's actually Rachel's, but...

We now own the cheapest digital camera on the market - a $50 (Aussie, that is) flourescent yellow single-chip effort. It's see-through, but you'll just have to trust me on this because it's not very good at taking pictures of itself :)

I'm going to try to take a photo every day with it. I used to take a lot of photos - I have a box full of prints from the days when I first got my SLR. I'm a little slack though, and if it isn't easy to get photos printed, I won't bother. I moved away from convenient developers, and now don't take nearly as many photos as I used to.

The digital camera though, well... It takes photos in an instant (really, they're such low resolution it's actually instantaneous and the whole 20 shot memory can be taken as fast as you can press the button ;)

The quality is ... well, it's apalling. I took a test shot, standing over the decking at home. The results clearly show that the lens is atrocious and the colour/contrast range is pitiful.

But I don't care. I took part in NaNoWriMo a couple of years ago - I knew that if there wasn't the specific goal in place, I wouldn't actually ever write a novel. But now I have. It's not good, but I'm glad I did.

Now I'm going to attempt to take a photo with the crappy digital camera every day, and my goal is to post it on the web for whoever cares (probably just me ;) to see. The new "daily photo" link on the right will take you to the page.

path: /stuff | permanent link |
Sat, 18 Jan 2003
Gah, not again

Again I'm bitten by Python's sockets not timing out. Last time it was in an SMS gateway, and things got complicated very quickly. This time it's the POP server polling in Roundup. Unlike last time, I'll be able to just use an alarm signal to interrupt the process.

path: /python | permanent link |
Updated weblog software...

I've updated my log to use the "0+5i_rev2" version of pyblosxom. In the process, I also got rid of the table layout for the main log display. I hope it's still readable! :)

But I have to ask, what's with that version tag?!? I'm pretty sure PyPI will be able to sort "0+5i_rev1" and "0+5i_rev2" correctly, but ... what's next? :)

path: /stuff | permanent link |
Fri, 17 Jan 2003
Locking files (or not) the win98 way, part 3...

James Kew was kind enough to try out the revised portalocker code on both win98 and winnt. The code itself had an error due to my cut-n-paste. Unfortunately, it also still doesn't work so he's going to try a hybrid of the "old" code and the Seila King code.

Fingers crossed...

path: /python | permanent link |
SpamBayes finally out!

Anthony has packaged up a pre-release bundle of the first version of the SpamBayes project.

SpamBayes will attempt to classify incoming email messages as 'spam', 'ham' (good, non-spam email) or 'unsure'. This means you can have spam or unsure messages automatically filed away in a different mail folder, where it won't interrupt your email reading.


path: /python | permanent link |
The future of PyPI...

Well, people have started actively noticing my PyPI efforts. And commenting, in generally positive ways. No killer bugs yet.

Some people (hi, Hans, Uche, Jarno and Garth) have started talking about the possibilities of building a Python CPAN-alike. Just thought I'd let people know where I stand on the issue :)

My aim with the initial version of PyPI was to simply get the thing moving. As mentioned in the PEP, I deliberately limited the scope of work to something that I felt I could reasonably achieve with the time available and have accepted by the community.

Once Python 2.3 is out, and the world starts using the repository, then I hope that others will integrate PyPI into their pypan or similar projects.

I'm also hoping that people will volunteer to write things like the trove "discovery" display that'll let people drill down through the classifiers to find stuff they're interested in...

The project code is on sourceforge and I welcome contributors :)

path: /python | permanent link |
Locking files (or not) the win98 way, part 2...

Oliver Rutherfurd sent me an email saying that he got portalocker working on win98 using the following nt-specific code:

if == 'nt':
    def lock(file, flags):
        hfile = win32file._get_osfhandle(file.fileno())
        #win32file.LockFileEx(hfile, flags, 0, 0xffff0000, __overlapped)
        win32file.LockFileEx(hfile, 0, 0, 0xffff0000,0)

    def unlock(file):
        hfile = win32file._get_osfhandle(file.fileno())
        #win32file.UnlockFileEx(hfile, 0, 0xffff0000, __overlapped)
        win32file.UnlockFileEx(hfile, 0, 0, 0xffff0000,0)

The commented-out bits are the original code. When I last looked into this, people were saying that win98 doesn't even have the LockFileEx or UnLockFileEx methods, but that I'd have to use the non-Ex versions. It looks like the reality is just that last __overlapped argument. Huh.

Well, I've put out a call to win98 and winnt users to try out the altered code and hopefully it'll work on both and I can get Roundup 0.5.5 out. To test the code on your system, just run it twice. The second invocation should wait (indefinitely) until you hit enter in the first.

path: /python | permanent link |
Thu, 16 Jan 2003
Lightbulb jokes galore

Courtesy Ted Barlow and friends. Ted's reason:

I'm anticipating a tough week. But rather than shutting down entirely, I'm just going to change format. This week, all week, I'm posting nothing but original politically-themed "How many 'x' does it take to change a lightbulb?" jokes. Stay tuned.

And I have to say... wow... many contributions from visitors leaving comments too. My faves from Andrew Northrup:

Q: How many North Korean nuclear devices does it take to screw in a light bulb?
A: Saddam Hussein.
(The preceeding joke has been brought to you by George W. Bush.)

.. and Tbogg:

Q: How many Republicans does it take to change a lightbulb?
A: Five. The same amount it took to select a dimbulb.
path: /stuff | permanent link |
Wed, 15 Jan 2003
Locking files (or not) the win98 way...

My issue tracking software is multi- platform - I wrote it in pure Python, so theoretically it runs anywhere that Python is installed. Unfortunately, it's multi-user software, so must lock its database while one user is making changes - otherwise another user could make changes at the same time and BOOM there goes your issue database.

So far my users have been mostly Unix, Windows (NT variant) or MacOS X users, and they've been served well. Unfortunately, I've just had my first Windows 98 user try to use it, and the locking doesn't work there. I've borrowed the portalocker code from the Python Cookbook.

Here's latest in the "less useful" thread from the conversation on python-list from Steve Holden:

Cliff Wells wrote:
> Richard Jones wrote:
> > If anyone knows how to lock a file on win98, I'd really appreciate a hint.
> Win98 only supports locking entire computers, not files 
> Assuming 98 doesn't support locking files (which I believe to be true,
> but am willing to be corrected on), what I would probably do in this
> case is create a "lock server" using a network socket and have
> applications acquire a lock from it.  I expect you could even make the
> API mirror the portalock API (which I've never used and so can't comment
> on) and use it as a drop-in replacement.
> Even if 98 supported file locking, I expect this approach would be
> superior.

Clearly something quite advanced is required here. I spoke to the Microsoft
help desk.

After a three-hour session in which I educated them about the benefits of
Python and the features and facilities offered by the language, they came up
with the following suggestion: "Make use of the Microsoft Office locking
algorithm by creating a COM object encapsulation an instance of Word and
have it open a  document. If the document is already open then Word wil
report an error that your program can use to determine the lock is currently

Brilliant: shows that all that money I spend on Microsoft support isn't
wasted. I tried it, but unfortunately the COM implementation in Word doesn't
report the error correctly. Microsoft have recorded this as a bug, and will
get back to me if ever anybody fixes it.

tongue-in-cheek-ly y'rs  - steve

The other side of the thread actually looks looks for a solution closer to the current one. It would involve detecting we're on Windows 98 and using the msvcrt module. Using that as a hint, I found another thread on the python-win32 mailing list. That thread winds up with Sheila King finding her solution:

filename = r'e:\apache\cgi-bin\pylinks\datalog.txt'

import win32con
import win32file
import pywintypes
from time import strftime, localtime, time

f = open(filename, 'a+')
fd = win32file._get_osfhandle(f.fileno())
win32file.LockFile(fd, 0, 0, 0xffff0000,0)
timestamp = strftime("%m/%d/%Y %H:%M:%S\n", localtime(time()))
win32file.UnlockFile(fd, 0, 0, 0xffff0000,0)

So now I need to find a win98 Roundup user who is willing to try the code out :)

path: /python | permanent link |
Mon, 13 Jan 2003
The Object Oriented Madman has arrived...

Slune is the first Python-based release of "OOmadness". It incorporates several technologies which are Python-friendly:

There's a couple of other really interesting projects on their site. Lots of fun to be had :)

path: /python | permanent link |
Sun, 12 Jan 2003
Minimal Python

The Minimal Python project looks mighty interesting. There doesn't appear to be a website for the effort yet. The basic outline of the project was given in the announcement:

We announce a mailinglist dedicated to developing
a "Minimal Python" version.  Minimal means that
we want to have a very small C-core and as much
as possible (re)implemented in python itself.  This
includes (parts of) the VM-Code.

Building on the expected gains in flexibility
we also hope to use distribution techniques such 
as PEP302 to ship only a minimal set of modules 
and load needed modules on demand.

As Armin Rigo of PSYCO fame takes part in the effort,
we are confident that MinimalPython will eventually
run faster than today's CPython.

And because Christian Tismer takes part, we are
confident that we will find a radical enough
approach which also fits Stackless :-)

We are very interested in learning about and
integrating prior art.  And in hearing any
doubtful or reinforcing opinions.  Expertise
is welcomed in all areas.

The project certainly sounds like a lot of fun, and I'm definitely going to try to keep up to date with their progress...

path: /python | permanent link |
Summer + garden = brown

Rachel and I bought our house in April 2002. One of the reasons we bought it was for its large grounds (not huge, but for our budget it's large). It has an existing well-developed garden that we quite liked too. Not too much lawn, and no really offensive plants. Generally low maintenance.

A couple of months in we noticed the ivy and jasmine doing their best kudzu impressions. Some of the more "recent" plants weren't doing so well (it has become obvious that some were planted just before the sale, and in not very intelligent places). A few months in, our neighbours renovated their house and garden. This included removing a large tree that was shading our fernery, and removing the ivy from their side of the fence.

Prior to owning a house, we'd both either a) lived in a house where one or more parents looked after the garden, and usually quite well, or b) lived in a rental property where either the owner didn't care about the garden or they cared enough about it to look after it themselves. In the half year that we've had to come to terms with the garden here, we've learnt a lot about what a garden needs, and in particular what we need to do to the garden to make it work better.

Now we've got a fernery that needs moving, a pile of ivy and jasmine to get rid of (half of which is dead and hanging loosly from the fence), several bushes that have gotten a bit too enthusiastic that we have to chop back and ... well, the latest hit us today. It's been really and dry here (most of Australia is officially in drought) and we were making real moves to help our the ferns. Off we go to the plant nursery (for the first time, I might add) to buy the ingredients of the new fernery bed. When we arrive home, we notice that the daisy beds at the front of the house are black. Not brown, but dead black. A day ago, they seemed fine (or we would have noticed, I'm sure). Looks like we have a whole lot more to learn about owning a garden...

path: /stuff | permanent link |
Sat, 11 Jan 2003
Anthony's rants, now for all to share :)

Anthony's finally got his weblog online. Lots of ranty goodness there. Of course, this means I don't get my handy list of rant URLs direct via goofey anymore, which is sad :)

path: /stuff | permanent link |
Eurogamer list of top 50 games for 2002 is up

Ico screenshot The Eurogamer staff have listed their picks for top games on any platform for 2002. Their top 50 includes commentary on why they've chosen the particular game, or in some cases why a game hasn't rated higher.

I can't really comment on any platform other than PS2 - but comments from site (eg. the comments for the top 10) indicate that the gaming community support the bulk of the decisions. In the end, Ico came out number one, surprising very few. In the words of the Eurogamer staff:

Actually, it was weird, of all the games in the top 50, ICO at No.1 prompted the least argument among the staff.

The 50 are here, split into reasonable chunks: 50-31, 30-11 and 10-1.

Other users have noted that the top 10 games lists 7 PS2 games, and not one PC game. It might not be the most powerful platform, but the games are still the best...

path: /games | permanent link |
Thu, 09 Jan 2003
Roundup 0.5.4 is out

Another maintenance release of Roundup, my issue tracking software, is out. Phew. I've got a backlog of feature requests - and thankfully I've also got users who are willing to contribute code for them.

path: /python | permanent link |
Zope3, the beginning

Yesterday was a big Zope3 day for me.

path: /python | permanent link |
Tue, 07 Jan 2003
Apple's new "Safari" browser uses KDE components

Apple's finally releasing their own web browser. I always thought it strange that they didn't provide at least a basic non-IE browser... but I guess there's a lot of factors involved.

The fun part for me is this - extending my "why Open Source rules" post on Sunday:

For its Web page rendering engine, Safari draws on software from the Konqueror open source project. Weighing in at less than one tenth the size of another open source renderer, Konqueror helps Safari stay lean and responsive. And of course, being a good open source citizen, Apple shares its enhancements with the Konqueror open source community.

So OSX gets a kickin' web browser, and we KDE users get more people poring over and improving the Konqueror code. That's cool. See some of the email on the subject, from the sources:


path: /stuff | permanent link |
Sun, 05 Jan 2003
This is why Open Source rules...

I got a message on the roundup-users mailing list:

I've been studying the source code for the
file and was wondering....

why is there under the set() and create() methods, both,
a fireAuditors and a fireReactors invocation, but there
is no such invocation in the retire() function?

Seems inconsistent based on the rest of the code.

And indeed it's inconsistent - it's a bug. One that I probably wouldn't have noticed because I don't trigger that behaviour in any of my applications (and sadly I didn't have a unit test for it, but will now :) Yet one of the users of Roundup happened to look through the code and noticed the error. That rocks...

path: /python | permanent link |
PEP code checked in...

Thanks to amk the PEP 301 code for Python 2.3 is checked in! (the test server has been running here for a while now)

Yay, and I've got the bits working - except for having the cgi-bin write back to the database. Needs sysadmin clues there. I got some valuable user feedback (read: bug report) too, which helps immensely.

I need to work on the look for it too...

path: /python | permanent link |
Thu, 02 Jan 2003
On text data formats

Jarno Virtanen presents a couple of links on text data formats. The first, a rant about the evils of XML frequently goes off the tracks of reasonable discussion, but the main point:

SGML is a good idea when the markup overhead is less than 2%. Even attributes is a good idea when the textual element contents is the "real meat" of the document and attributes only aid processing, so that the printed version of a fully marked-up document has the same characters as the document sans tags. Explicit end-tags is a good idea when the distance between start- and end-tag is more than the 20-line terminal the document is typed on. Minimization is a good idea in an already sparsely tagged document, both because tags are hard to keep track of and because clusters of tags are so intrusive. Character entities is a good idea when your entire character set is EBCDIC or ASCII. Validating the input prior to processing is a good idea when processing would take minutes, if not hours, and consume costly resources, only to abend.
When the markup overhead exceeds 200%, when attributes values and element contents compete for the information, when the distance between 99% of the "tags" is /zero/, when the character set is Unicode, and when validation takes more time than processing, not to mention the sorry fact that information longevity is more /threatened/ by XML than by any other data representation in the history of computing, then SGML has gone from good kid, via bad teenager, to malfunctioning, evil adult as XML.
A brief summary, then: Remove the syntactic mess that is attributes. (You will then find that you do not need them at all.) Enclose the /element/ in matching delimiters, not the tag. These simple things makes people think differently about how they use the language. Contrary to the foolish notion that syntax is immaterial, people optimize the way they express themselves, and so express themselves differently with different syntaxes. Next, introduce macros that look exactly like elements, but that are expanded in place between the reader and the "object model". Then, remove the obnoxious character entities and escape special characters with a single character, like \, and name other entities with letters following the same character. If you need a rich set of publishing symbols, discover Unicode.

Jarno's second link is to A proposal: Universal Text Data format (UTD) which has a lot in common with the above rant.

path: /stuff | permanent link |