Why syndication feed readers (and web browsers) should fail gracefully

There are two schools about dealing with errors in pseudo-XML formatslike syndication feeds and XHTML : strictfailure (the Firefox model, where the user gets a big BZZT dialog)and graceful failure (the Universal Feed Parser model, where you try toget as much as possible out of things). Which school is better is oneof those frequently argued things on the Internet.

(Yes, yes, theoretically both syndication feeds and 'XHTML' are real XMLand there is only one valid failure mode. This


How Amanda uses what restore program to use, a correction

In AmandaRestorePrograms I wrote, about what to do if Amandadidn't recognize properly recognize which sort of dump program it had used to back up a filesystem:

  • put a ' restore ' program (either a cover script or just a symlinkto ufsrestore ) somewhere in our $PATH when we do Amanda restores.

Allow me to correct myself: this doesn't actually work as I wroteit. (When I wrote the original article, we hadn't had to actually testthis; we have since then.


What sort of user interfaces the web is good for

Here is a corollary to what standard interfaces are good for , in the form of a thesis:

The web excels at standardized interfaces, but requires increasinglyheroic amounts of work for excellent customized ones (once you wantto step out of what the browser gives you). This implies that webapplications are a natural fit for occasional usage things, where anyawkwardness of the web interface is overcome by the advantage of nothaving to learn yet another custom interface that you use for tenminutes once every month, or for things


How I split up my workstation's disk space

There's a lot of different ways to partition disks and split outfilesystems. Mine isn't necessarily the best one, it's just whatI use, partly because I am cautious and conservative.

My workstation has two disks, partitioned identically and generallymirrored. I split the filesystems up like so:

  • /boot is a separate and non-mirrored filesystem. I have a /boot2 on the second disk which I synchronize by hand every so often (usuallynot, to be honest, which is

How to help programmers (part 1): the os.listdir() problem

How to help (Unix) programmers: silently omit data under certaincircumstances. From the Python 3000 release notes :

Note that when os.listdir() returns a list of strings, filenamesthat cannot be decoded properly are omitted rather than raising UnicodeError .

(Background: in Python 3k, os.listdir() is normally called with adirectory name that is a str Unicode object.)

Yes, os.listdir() had problems , butthis is not a solution; this is making


One of Python's problems with packages

One of the problems with Python's current approach to CPAN-like packagesis, to put it in a particularly blunt way, that it hasn't quite sunk inthat not everyone has root.

(I am aware that Python doesn't have an approach to packages as such;it's all done by distutils et al, although distutils is part of thestandard library. That's part of the overall problem.)

Oh, sure, you can use distutils to install packages in places besides


On line endings and honesty

Dear software, I have a small and simple request, from a working systemadministrator:

Please stop pretending that \r\n and \n are the same thing.

That is, please stop pretending that MS-DOS line endings and Unix lineendings are the same thing, because they are not. Pretending that theyare is one of those collective hallucinations that only work if absolutely everyone is playing along. Sooner or later(usually sooner) you will run into a program that does not play along,and things


A little gotcha when implementing shell read

Reading a line from standard input, as the shell's read builtin does,certainly seems like it should be easy to implement or reimplement (ifone's shell is sufficiently primitive). However, it turns out that thereis a subtle problem that forces a pretty inefficient implementation, andmakes it basically impossible to duplicate read with any common Unixprogram.

I can neatly illustrate the problem with a little script:

(echo a; echo b) |   (echo `sed 1q`; echo `sed

The rewriting problem on ZFS and other 'log structured' filesystems

When they are planning how to organize their IO , programs (and designers) normally assume thatrewriting (overwriting) an existing, already written file is the fastestsort of write operation possible and will not change the existing filelayout (for example, if it has been created to be sequential). Thisis because all of the data blocks have already been allocated and allof the metadata has been set up; if you write in block-aligned units,pretty much all the operating system has to do is shovel


Mapping IP addresses to ASNs

Prompted by my old SpamByASN entry, I was recently asked how you woulddo IP to ASN lookups, and ideally ASN to IP lookups too. Since the fullanswer is complicated, I will do the simple and useful one first.

Assuming that nothing funny is going on, each IP address has exactlyone ASN that ultimately announces it. The easiest way to find out thismapping for a given IP address is to use the asn and aspath reverseDNS lookup zones that routeviews.org provides; these return TXT records with