AJAX (by )

Eeeeeaaarrrggghhhhh....

People seem to have found a new way to make Web pages that aren't very usable for the blind.

AJAX is its name, and it's causing a lot of excitement about creating "rich user experiences".

I automatically cringe when I hear that. The Web works because HTML doesn't really define the "user experience", it defines the structure of a document with headings and text and links and stuff. You can layer on a "user experience" with some optional, ignorable, CSS. This means that screen readers can ignore the "user experience" designed by people who assume everyone can see a two-dimensional display surface, and examine the actual structure of the page.

Garbage collection (by )

One of the interesting little problems in converting a CPU, some RAM, and a bunch of I/O devices into a useful system is memory management.

Your everyday PC with 512MB of RAM contains about 512 million little memory cells, each of which contains an eight-digit binary number. This is where all running applications, and all the information they are dealing with, must be stored; programs, text, images, and whatnot are all encoded as sequences of these eight-digit numbers (known as bytes) and stuffed into memory.

The problem is - where to put everything? After all, when you double click on a program, the computer looks at the size of the program on disk, and needs that many bytes of memory to load the program into. How does it know which bits are free and which are in use? Different computers have different amounts of memory, and may be running any combination of apps already, so there's no way to reserve a given bit of memory for a particular program; the system has to keep track of what's in use and what isn't in real time. And when you load your app, it will start asking for bits of memory to keep track of the windows it has open, to store your document in, and so on.

Now, the first problem to be solved is how to keep track of which bits of memory are in use and which aren't, in such a way that the computer can efficiently find a block of free memory of a specified size - that problem is harder than it may seem, especially when you consider that multiple threads of execution will be requesting memory at once. But that's not the problem I was pondering as I sat on the train today.

My problem is how to figure out when a block of memory isn't used any more, so that it can be handed back to the system that keeps track of free blocks and reused.

SpotMeta (by )

My friend Ben Summers has been busy developing SpotMeta, which is a nifty tool for Mac OS X (Tiger).

The hole that SpotMeta fills is a basic omission in how Apple have implemented Spotlight, their system for indexing files for rapid searching.

Spotlight works by being notified whenever a file is modified. It then looks at the file type and invokes an appropriate "importer plugin" for that file type, which extracts relevant searchable information from the file. For example, the PDF importer extracts the page count and page size from the file. The result of the importer is a bunch of key=value pairs, plus a summary of the plain text content. Spotlight merges this with basic information from the filesystem - file size, last modified timestamp, creation timestamp, file name, that sort of thing - and indexes the result.

You can either do a quick search for any given string, which will be looked for in the indexed content as well as in all the indexed key=value pairs, or you can set up a structured search query - telling the system to find files with a modified date in the last week and whose content contains a certain phrase, for example.

However, this is rather limited in some ways. For a start, only one importer is applied to a given file. That's a problem, since many file formats have support for optional extra application-specific information within them. A PNG file, for example, might have an importer that extracts the standard comments field inside a PNG, but a scientific visualisation application that extends PNG files with extra information about the units of the axes will either need to write a whole new importer that provides the standard PNG fields as well as their own - or just live with their users not being able to find images that show a time axis with an accuracy better than 3ms.

On the other hand, Tiger's file system allows you to store arbitrary key-value pairs for any file - "extended attributes", in computing parlance. Yet Spotlight doesn't bother indexing these attributes, and it's not easy for a normal user to view or edit them.

SpotMeta does three things that, together, rather neatly solve these problems.

  1. It provides a nice user interface to edit extended attributes. A metadata schema editor is included, which lets you define your own keys - you might have a choice field with a given list of options, a multi-choice field with a specified list of checkboxes, and plain text, date, or numeric fields, as well as a few other options. Then you can use the Finder context menu or a keyboard shortcut (from within the finder or an application) to edit the attributes of the selected file, according to your definitions.
  2. It provides a framework for extending the Spotlight importing process. Basically, it allows other importers to run as well as the "native" importer for a file, and merges their results with what the native importer proides. So the author of the PNG-based sci vis package could write an importer that just reports on their extensions to PNG files, and have it run as well as the native PNG importer.
  3. It provides an extension importer that reads the user-defined extended attributes and indexes them, so they can be searched for with Spotlight.

The net result is that you can define (and subsequently refine as you wish) a tagging system for your files - I already organise my directory structure by client and project, so tag my files with the project lifecycle stage they relate to (legal, requirements, specification, implementation, documentation, ...) and whether they still require action. Then you can search for files based on your requirements - I can find all legal documents I've not dealt with, and what's more, I can create a 'smart folder' that will always show the result of the search (changing in real time as I alter my files).

Neat stuff!

Religion (by )

A friend visited over the weekend, and we got chatting about religion, which got me bringing out my copy of the Tao Te Ching.

I liked the philosophy of the Tao Te Ching; my translation tried to preserve the translator's interpretation of the meaning of the text into modern English, which makes it pretty approachable; I know that I'm going to be missing some of the 'original meaning', but I won't get that unless I learn ancient Chinese, so so be it. But either way, it was pretty close to the philosophy of life I'd developed myself.

And yet, I can see how people can turn it into a religion. The Tao Te Ching, as I read it, is about the fact that the universe is a large complex system full of interrelationships and feedback loops and so on; that attempts to take control of it aggressively will tend to lead to failure, since it is not something you can master, and that success is to be had in seeing yourself as a part of this complex system (ecosystem, economy, society, ...) and striking a balance between letting it carry you around in its eddies and gently guiding yourself in the way you want, while accepting that your guidance is merely guidance and not absolute control, and that the gentler your guidance is the more effective it is likely to be - and the less extreme the side effects.

However, somebody with a different mindset could read the text and see "the Tao" as meaning "an omnipresent sentient God". My interpretation of "the Tao" is something more akin to "chaos theory".

My visiting friend had heard from somewhere that Taoism was a 'bit scary', and I confessed that despite having avidly enjoyed the Tao Te Ching, I really had no idea how "modern Taoism" worked as a religion, so I did a bit of research.

Rotten.com's writeup on Taoism seems quite good - as I had suspected, some folks had gone and converted a philosophy into a religion. Sigh. There are Taoist temples?

A state may be ruled by (measures of) correction; weapons of war may be used with crafty dexterity; (but) the kingdom is made one's own (only) by freedom from action and purpose. How do I know that it is so? By these facts:--In the kingdom the multiplication of prohibitive enactments increases the poverty of the people; the more implements to add to their profit that the people have, the greater disorder is there in the state and clan; the more acts of crafty dexterity that men possess, the more do strange contrivances appear; the more display there is of legislation, the more thieves and robbers there are.

The Tao Te Ching, verse 57

Amen, brother!

Nostalgia (by )

This morning, I went downstairs. It was chilly, and the light outside was slightly grey. I lit the fire.

This brought about intense nostalgia!

My mother's house was mainly heated by fireplaces, so this is the kind of thing I would have been doing on non-school days during late autumn and winter when I was a kid. And for some reason, I've always liked this time of year more than the summer. It's a time for staying indoors, looking out into the twilight, as I worked on exciting projects, alone or with my friend Lorenz.

It also reminds me of a time when computer games were more fun. Indeed, I was struck by a strong desire to play StarGoose.

Looks like I'll have to resurrect my 486 and install DOS, though...

WordPress Themes

Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales
Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales