Archive for January, 2005

Head!!!

Monday, January 31st, 2005

Today has not been a good day. I was feeling a little below par yesterday but I’ve been feeling properly crap today. I woke up with a headache this morning which is Not Good TM and have had it on and off all day. I went to bed at about 7pm and woke up again at midnight when Jennie came to bed. I then had what I call a semi-awake mindstorm. These usually happen when I am ill and can’t quite get to bed properly. I don’t know if anyone else has them but when they happen one or two concepts fuse in my head and everything I experience seems to be composed of some combination of them. It is hard to describe but imagine Synæsthesia with concepts as opposed to colours or sounds. This evening mouse buttons, QuickDraw and the LAPACK-style naming conventions of LaTeX founts[1] fused in my head. When Jennie came to bed she sounded like psbr8 (Sabon) and when she was cuddling me it felt like QuickDraw Regions. Last night I had a similar thing when I was talking to Jennie but my voice sounded to me like RISC OS SWI calls (if anyone can remember the SWI to flip screen buffers I would be terrilbly grateful, I was finding it really hard to listen to Jennie because she was talking in a SWI I couldn’t remember).

The upside is that I become terribly creative when I have one and worked out a number of bugs in my CV whilst under. I also derrived some interesting PhD results in my head which I had to write down - proper stupid genius-based-film style stuff. If only I had a steamed up mirror I could write Stokes’ theorem on and exclaim ‘Great Scot! I have it!’.

Talking of CVs, as you may have gathered I’ve been writing my CV today (when my head wasn’t hurting) and have just about got the content I want to put in done. Now I just need to write the LaTeX class to go along with it. I have a deep interest in typesetting and typography generally and I am really picky about how things should appear in print. I just cannot look at a Word document so must use LaTeX (Word seems to justify the text wrongly or something, I can’t put my finger on exactly what is wrong but the spacing seems screwed to me). I also think the CV packages on CTAN are all a bit plain so I am ending up writing my own. Hence CV writing takes on a whole new dimension. OTOH I get to use my favourite heading fount[1] in the whole world, Sabon Bold Italic.

Of course because I went to bed at 7pm I now don’t feel in the least tired but I do feel a little better. Looks like it’s going to be a late night.

[1] Yes, that is how it is spelt.

Mmmm Kelly

Saturday, January 29th, 2005

Now those who know me well might already know I have a thing for Kelly Osbourne. Up until now my other half, , complained about it but the reason is that she looks just like my current love. To prove it I took two photos, one of Kelly and one of dressed similarly. I think you’ll agree the results speak for themselves :).

Two sexy women

Subness

Friday, January 28th, 2005

Another sub day although it was brightened up by seeing in town and having a crafty subway for dinner. Aside from that and a little housekeeping on my machine at work (when emerge -u world lists 400 packages you know you’ve left it too long) nothing much has happened. This weekend I shall mostly be trying to get an application to Microsoft Research in.

Congratulations to for doing spectacularly in her exams too.

Update: Did I mention I was coming down with a cold? :(

svn notes

Thursday, January 27th, 2005

Well that was suprisingly painless. I just tried moving a few things over to svn and I have to say that it really is a lot better than CVS. For a start it actually works :). More specifically it seems to handle renaming, moving, directories and binary files in a far more transparent fashion. I truly can just treat said corner cases like any other file or operation. Since I like to retain access to my code outside the network I did a little bit of Apache ProxyPass magic to allow me to access the web-view from anywhere (although this now requires authentication) and documented it on the Lab wiki (which makes my job as website maintainer so much easier).

Update: Woo! I can also access it via WebDAV (very easy with Nautilus) which is actually quite useful.

Nothing so far

Thursday, January 27th, 2005

Nothing has happened in my life for the past few days so this is going to be a thin update :). I did run accross an interesting post on a mailing list about what needs to be done to make the WiFi support in Linux not suck. As one who had to bugger about with many wifi network cards on Linux I can heartily endorse this list as being similar to my own requirements.

I’ve also vowed to make today the ‘learn about subversion’-day and get around to moving my PhD stuff to the lab’s svn repository. I’m not too worried about preserving the revision info from CVS since a lot of stuff is new and I’m unlikely to be wanting previous versions of the old stuff until I write my thesis. Even then just a copy of the ChangeLogs should be enough. Consequently I’m going to archive a snapshot of the old repository and start working anew on svn. Watch this space for the inevitable svn vs CVS rant that shall be forthcoming :).

Update: Sometimes I wonder how the Radio Times decides what are the most important bits from a particular episode of Neighbours. Here is the summary for a forthcoming episode:

A grieving Izzy seeks comfort by going to a disco. Carmella sees Connor in a new light. Lyn wants Lou to wear a green hat.

I’m sure I must be missing something significant in the last sentence.

Eh-oh

Tuesday, January 25th, 2005

Good to know that Google video search has such good source material.

pr0n

Tuesday, January 25th, 2005

Perhaps it is worth getting a Mac Mini afterall:

Gentoo pr0n

DM hacking and eye-candy

Tuesday, January 25th, 2005

This week, amongst other things, I’ve been motivating myself for the next big thing in Desktop Manager. I feel as if the 0.5 code-base has gone as far as it can in innovation and has now become pretty stagnant and hard to maintain. I’ve been taking a GNOME-like approach and deciding on the core feature set I want whilst still making the framework general enough for 3rd parties to add whatever specific feature they want without bloating the app.

In the course of doing this I decided to remove the Desktop pager and try a more Virtue Desktops-like approach. Read on for more details, screen shots and general wibbling about hacking OS X.

Firstly I have been splitting DM into a general backend which can be used by multiple applications, WorkspaceKit, and a frontend which uses said backend. WorkspaceKit encapsulates and hides away behind a Cocoa-like API all of the devious hacks I have done to expose virtual desktop-like functionality of OS X apps. Hopefully this will allow 3rd parties to easily extend DM or write their own app to scratch any particular itch they may have.

Secondly, as I said, I am rationalising and innovating the interface. It started with a mockup I did of where I wanted the pager to go. Think of it as Exposé for virtual desktops. I wanted to be able to press a hotkey or move to a hot-corner of the screen and have my desktop zoom out to present me with a view of all of my desktops. The windows should continue updating too so that the preview would be the desktop at that moment in time rather than when last viewed. I could then select which desktop I wanted wither by pointing to it or selecting it with the arrow keys. The selected desktop would then zoom to fill the screen and the other ones would fade away. One might be able to drag windows between desktops (as in another mockup).

Last night I started implementing the required magic in WorkspaceKit. When I finally went to bed I could smoothly animate from a full and busy desktop to a funky minimised version. This is just as smooth as Exposé when it works and is sufficiently general to allow me to start implementing the pager. How this happened is pretty sick.

OS X uses a window model whereby each window is a rectangular ARGB bitmap and they are composited onto the screen by the WindowServer taking into account various per-window overall alpha and affine transformation information. The API to communicate with the WindowServer is undocumented but may be reverse engineered (as I did for DM) and used with a little care. Each function is prefixed by ‘CGS’ which I think stands for ‘CoreGraphics Services’. Communication is done via communication ‘channels’ (actually mach ports I think) which are usually one per process. There is a degree of security in that channels may only modify windows which were created (and thus ‘owned’) by the process’ connection. The problem with that is that DM needs to manipulate all windows on screen, especially when one is trying to do funky Exposé-style operations.

Fortunately it turns out there is another application which needs control over all windows, the Dock. It is the Dock which contains the code which actually implements Exposé. Consequently the WindowServer has a concept of a ‘universal owner’ or one particular connection which has super-user like access to all windows. This is allocated to the first app that requests it (usually the Dock) and there can only be one of them. This means that even if DM somehow got hold of the connection, various bits of the Dock wouldn’t work (like minimisation of windows) and Exposé would be finished. To get around this, DM injects a little server thread into the Dock which exposes various bits of the CGS API via a simple RPC-mechanism built atop of Apple’s ‘AppleEvent’ system. This allows all of the logic of DM to be in the main application but all of the dirty work to actually be done from the Dock’s own process! Although this is really hacky it works well.

The problem is that animations require low-latencies and synchonous operation, neither being served well by the RPC way of doing things. Hence this new approach puts a bit more logic in the Dock. The code injected by WorkspaceKit now contains a little animation engine which can run a set of animations concurrently, smoothly interpolating between a set of key transformations applied to a set of windows. I think this is pretty much general enough to allow for some very nice effects. The logic required to find the windows and transformations required to achieve the pager effect I am looking for can now be left in the main DM application where it belongs. I also took the opportunity to add some versioning information to the Dock code so that applications can ensure they are expecting the same API from the extension.

The upshot is that I’m ready to start adding some serious eye-candy to DM. I also really like the Exposé model and am very excited about applying it to virtual desktops.

Desktop Search

Monday, January 24th, 2005

I’ve been doing a bit of research into the current slew of desktop search tools. As far as I can see the only ones likely to affect me are Beagle for Linux and Spotlight for OS X. Of the two I’ve only been able to directly try Beagle but I’ve been reading up on the developer documentation for Spotlight.

Both systems appear to broadly do the same thing. The OS kernel has some hook to notify userspace when a file changes or is created. Some appropriate dæmon extracts and adds to a database a set of indexing terms from the file using a set of file-type specific plugins. There is then a set of client programs which can query the database. Under Linux the file-notification is via inotify and under OS X it is some similar notification system built into Darwin. Conceptually, therefore, both systems are similar and one would expect them to works similarly. I’ve been playing with Beagle on and off and I have to say that it works pretty well. The best thing, at the moment, is the fact that it indexes my personal email in a GMail-like fashion. It also indexes visited web-pages via a firefox extension[1] which is nice to be able to find a web page you visited a couple of days ago about something you want to read again. So the concept is pretty good and it works well (it is fsck-ing fast and updates as more information becomes available in front of your eyes).

Lets talk about the implementation now. I suspect that Spotlight is a classic C-based userspace dæmon and client solution. From the docs available it appears the one process controls the database and sends notifications to interested clients using the standard OS X noficiation mechanism. Under-the-hood, meta data is stored and searched via a FS-based meta-data database (like BeOS, probably because Apple hired the BeFS author). Meta-data consists as a set of keyword, data pairs (e.g. [type, Text], [creator, Bob], [keywords, [cool software, bananas, bending]], [size, 10k], etc) and one can query the database with SQL-type operations (e.g. SELECT * FROM files WHERE size > 10K AND type == Movie AND keywords CONTAINS mac). Beagle appears to be more holistic in that the meta-data isn’t categorised as much and not, as far as I can tell, stored directly on the file-system). It appears that the search method is basically ‘extract keywords from query and look for files with that keyword’ which means one can’t create such a targetted search as one can with Spotlight but it fits better onto a system where you can’t guarantee the underlying file system (for example, one wouldn’t want to try running a Spotlight-style system over NFS :)).

From the user’s PoV both work pretty much the same. If nothing else they both provide a nice ’slocate-style’ file search feature with live-updates. The Spotlight implementation also leverages OS X’s standard Bundle support to nicely package meta-data plugins so one can simply drop a file in an appropriate directory and suddenly your search capabilities are extended without any re-starts. Beagle appears to use a similar plugin system with .NET DLLs (it is written in C#). Both have their advantages and disadvantages but Spotlight seems nicer for 3rd parties.

In any case I’ve become somewhat of a desktop search junkie although this has lead to a corresponding lowering in my home directory’s organisation :).


Beagle Screenshot

[1] Not SSL-sites unless you ask it.

Laughing at accents

Sunday, January 23rd, 2005

I recommend listening to LUGradio just so you can hear a brummie accent evangelising Linux (and laughing at the fact ‘Gentoo’ rhymes with ‘poo’). The funked up Free Software song is well worth a listen too :).

In other news we had the equivalent of a LAN party last night (the difference being ‘bring your own game console’ rather than ‘bring your own PC’). It was pretty cool but I started to flag at about 3am (not as yound as I used to be).

Update: I almost forgot. Thanks to for pointing me to Virtue Desktops. It is a virtual desktop manager for OS X pretty much based exactly on the method I invented for Desktop Manager (using some of the same code and images in some cases) and is a prime example of how free software can lead to innovation. They’ve taken the basic engine of DM and run with it in some interesting new directions. It is a bit more memory heavy than DM (Activity Monitor showed 40Mb mem usage(!)) and doesn’t feel as much like a part of OS X as DM does IMHO but it has some very interesting parts (like the different approach to the pager they have). I’ve sent some email to the authors and I hope we can work together to make sure people can easily switch between whichever virtual desktop provider they wish. It has already given me some good ideas for DM (some of the ‘hidden’ features were not a million miles away from their pager but not quite as cool).