Custom Error Pages

Thanks to some simple Smarty capture and comparisons, it’s possible to have custom error pages in Blogsome. Read about how to do it at : About How to customize a 404 error page in your free Wordpress blog November 2006 - WebTips See it in action at /404/

Independent Front Suspension

See it again at Toxic Junction. I seriously think it’s being done by pulling on the straps. Looks good anyway.

Lag is bad...in any context

It’s not just bad for gamers. Computers must be real-time in their feedback. Lightroom is pretty cool, but it is getting a little laggy for me at times. This is not cool, but becomes downright dangerous under some conditions. For instance, if I double-click a Shoot title, to edit it, and begin typing, sometimes the double-click doesn’t take, and I’m not editing the title. Instead, my keypresses are passed on to the application to handle. Often, this isn’t too much of a problem - the text will just be entered into the active text entry section, or ignored. But Lightroom uses some keyboard shortcuts without the Command key, for things like rating, or viewing in particular modes. This is bad, as it builds a queue of actions, and these happen, often causing the lag to become worse, as they are sometimes complex series. Luckily, I realised early, and was able to use the Undo feature to recover. And, while I’m at it, Firefox’s handling of most Instant Preview type code is bad too - it lags between text entry and catchup. Not cool at all. IE can handle it much better. Can’t believe I said that!

Adobe Lightroom

Well, I’ve moved over to Adobe Lightroom. It’s still a beta, and it’s free in a couple of ways for me - the first is that it was a no-cost download. The second, more important missing cost is that I gave it a set of my photos that are hard-linked to the originals, so there is no extra disk space usage. It uses a slightly different schemata than iPhoto - photos are stored in “Shoots” rather than being date sorted, but it still looks rather good. It seems a bit faster than iPhoto, but not as snappy as I’d like it to be. Maybe I just need more RAM.

CLI-fu

LMAO! (from xkcd.com)

Welcome back, python

It’s been too long since I last coded in python. I’ve been doing a fair bit of AppleScript, and JavaScript over recent months, but tonight I had cause to do some scripting in python. And, how I’ve missed it. I still keep wanting to write if (something) then, but I’m getting over it. I’ve been doing some stuff to organise digital photos, as indicated in the previous post. What I’ve come up with so far is some code that grabs the EXIF data from the file, and if it’s a photo (and larger than 640, to remove thumbnails from the process), move/copy/link it to a particular location. This location is $base_dir/year/month/day/, where $base_dir is a definable constant, and year/month/day is grepped from the EXIF data. I’ve come up with two simple methods of getting the EXIF data - one is to use the EXIF.py module (not installed by default), the other uses jhead. The jhead one is much faster, but I wonder whether I can hand-code one that is even faster, since I only need three bits of data (date, xSize and ySize). [Some time passes…] A grep is marginally faster, but is only easy to do when you know the structure of the data you are looking for. A Date/Time is easy:

    grep '[12][0-9][0-9][0-9]:[01][0-9]:[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9]' -m1 -o -a filename.JPG

But getting the same for a resolution (which could just be any value that is a multiple of 8, or even any other number if the image had been edited!), is a bit tricky. Regardless, jhead is much, much faster than EXIF.py, by several orders of magnitude. So I’ll use that. Anyway, the cool bits of my code are:

    date_string = os.popen('jhead ' + filename + ' | grep Date/Time').read().split(' : ')[1].strip()
    
    resolution = os.popen('jhead ' + filename + ' | grep Resolution').read().split(' : ')[1].strip().split(' x ')
    
    if resolution[0] < 640 and resolution[1] < 640: 
        return None # Low-res, must be a thumbnail.
    
    date_dir = os.path.join(base_dir, date_string.split(' ')[0].replace(':','/'))
    

I’m fairly happy with these bits of code, and of course there are more things being added. I do have it working that it grabs the data, and creates links in the chosen directory. I’ve decided to use links until I’ve finished getting all of the album data from iPhoto, since then I don’t have to worry about disk space (hard links don’t take up any room, they are just another reference to the file). Jaq wanted to know if there was a UI for my system - I think there will be. Initially, it will just be using the Finder (and perhaps some Folder Action Scripts to move the files to the right locations), and Spotlight to index the files, but I may move to a proper UI. I think I’ll still use Spotlight as the data store - that way it doesn’t rely on an external database, and if the data is fixed, it updates in my system automatically. Unlike iTunes. This is really heading back to the way it could be done in BeOS. I could have just had this system, and a series of Queries, and it would have all been beer and skittles. The next step will be to look at Albums. At this stage I’m thinking of using hard links for albums, but the thing that worries me about that is the Macintosh’s habit of not rewriting to a file, but saving a new copy, and then overwriting that. Perhaps soft links will be better for Albums. Again, that will rely on the OS doing the maintenance, not my application. Of course, the problem might be with Spotlight not really indexing files that well. I’ve run mdimport, and only one file seems to really be appearing. The others appear as ‘ghost’ files, that AFAIK are aliases. Or so it appears to the system.

Barber’s Adagio For StringsWilliam OrbitOpen Space ★★★★

iPhoto out the window, soon

I’ve borrowed a digital SLR from my work, and taken a couple of hundred photos with it already. I really like being able to choose my shutter speed, although the light was too low for me to get the speeds I needed tonight at touch. Anyway, it’s really brought home to me how slow iPhoto is. I just don’t think I’ll be able to use it any more. I might continue to use the file structure, or at least part of it. Or perhaps I’ll just save images into folders that are the equivalent of my iPhoto albums, and then use spotlight indexing to find photos. It doesn’t seem to do that good a job of working from EXIF data, perhaps I’ll need to write a spotlight extension, that grabs that data and stores it in the index.

Google Start Page

You can now have Google Start Pages for Hosted domains. I’ve found one bug - my calendar on my start page doesn’t reflect the entries that are in it. And I can’t find where to report this bug…the link that should work gives me an error saying that page isn’t within the pages for hosted domains, or something. It will be cool to be able to have calendar, inbox and ToDo items on the one page, though.

Medieval II: Total War

I’ve started playing this game, but have hit some hardware or software issues. I keep getting system crashes, and Windows crash reporter isn’t much help. I think it’s my graphics driver, and I’m downloading an update. In the meantime it seems to have killed my Direct X installation too, so I’ve updated that. Since I installed, I haven’t been able to run WoW either, so I hope that’s just a temporary thing since the last crash, not a fuckup of the Direct X installation. Update: It gets better. Checkout this error when I try to run AOE III demo: Apparently, my GeForce has no memory.

New Gmail Hosted features

I noticed a few new features in the Dashboard for Gmail for Hosted Domains. Domain alias - it’s now possible to have multiple domains using the same mailboxes. That is, you could have company.com, and company.net, and have users only have ot have one account - all mail delivered to username@company.net can be forwarded to username@company.com, and each user you set up on company.com has the .org address too. Much neater than having a heap of forwarding addresses. Better sign-in URLs - to access hosted Gmail, I had set up a redirect from http://mail.schinckel.net to http://mail.google.com/hosted/schinckel.net/, but it’s now possible to have a proper CNAME record. This works for mail, and calendar. I’ll have to set this up, as soon as I can get to my domain registrar (it’s blocked at work). Cool. Two features I like a lot.