Talking ’bout my generation (by )

Since, as I mentioned before, the generator has 16A IEC 60309 weatherproof power outlets:

...I had to order special bits to make a nice lead for it. Well, they arrived today (along with a 20 litre petrol can), so I've made my nice lead:

Doesn't that look like it was bought in a shop rather than home-made? Nice arctic-grade PVC cable, since it'll need to run outside (we're not running the genset indoors!)

Well, that's the prototype of it. I have the same length of cable again plus a second set of sockets. I need to get a junction box to run the second set off, since we will need backup power on both floors of the house.

Since it took forever to get the nice white grommet on the cable where it goes into the twin socket, rather than redo it, I'll just cut the wire a metre back from the sockets to put the junction box on, making this just a little spur in a long cable.

And if there are any problems with power factors, I'll put appropriate reactive components in the junction box (plus test points so I can use my dual-trace scope to get voltage and current traces), too.

Costco (by )

Ah, the benefits of having a limited company!

We're now members of CostCo, a wholesaler of general retaillable things. Which means we can go to their nice warehouse, flash our membership cards, and load up on bulk packs of all sorts of stuff, generally quite cheap (although some of their stuff is more expensive than on the high street; it pays to check carefully).

This, however, is great for stocking up on food for Christmas, printer paper, and so on...

And handily, they sell generators. Since we're a bit worried about power cuts here interrupting my ability to work, we've picked up a generator capable of running the PCs and freezers for a few hours before needing refuelling.

I've had to order a special plug, though - it has a 16A weatherproof socket on it:

...so I'm making up a custom extension cable starting with one of those and ending up with two different sets of 13A outlets, so we can run the computers (upstairs) and the freezers/ADSL router (downstairs)

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!

WordPress Themes

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