Rickard Andersson

iPhoto face recognition, the verdict

Having used iPhoto 09 for a couple of weeks/months now, my verdict is that it sucks. Unless all you have is high resolution, high contrast photos of people taken perfectly perpendicularly to their face, it just doesn’t work. The same applies for people who sometimes were glasses (me for example). If I import a batch of pictures containing only people that I have already added to the database, I would say it gets it right maybe 25% of the time. And that’s provided that it detected all the faces, which it does maybe 80% of the time.

Isolation mode on VMware ESX servers

Last week at work, we had a network engineer look into some issued we’d been having with one of the switches in the server room. The switch in question was the main LAN switch to which all our servers are connected. Turns out, the switch needed to be rebooted to solve the problem. We didn’t think anything of it apart from the fact that the servers would be off the net for a few minutes.

The morning after we discovered, as we logged in to a few of the servers, that all virtual machines had shut down unexpectedly the night before. My first instinct was that the network engineer must have disconnected the power to the VMware servers for some odd reason and that this was the cause for the disturbance. But after some digging around, we found that none of the ESX servers had rebooted. So why had all the virtual machines shut down?

Turns out, there’s a feature in ESX called isolation mode. When you’ve setup your ESX cluster for HA (High Availability) and an ESX server loses contact with the other ESX servers and with its gateway, the server considers itself to be isolated and the default action when isolated is to shut down all virtual machines! In other words, if you have to disconnect your ESX servers from the network, look into isolation mode first.

I’m still not sure why the default is to shut down the machines. I mean, won’t forcibly shutting down a virtual machine potentially cause more problems than letting it run without a network connection?

CSS sprites are cool

As someone who doesn’t really keep up with what’s going on in the world of web design (as in HTML, CSS etc), I was pleasantly surprised when I ran into an article on CSS sprites. The term sprite will be familiar to those of you who have encountered any kind of graphics programming on old hardware such as Commodore 64 and Amiga. A sprite, according to Wikipedia, is a two-dimensional/three-dimensional image or animation that is integrated into a larger scene.

How does this apply to web design? Well, some clever web designer figured out that you can composite a number of smaller images into one large image and then use CSS to display a particular part of that image. The advantage is that the browser only needs to request one image from the web server even though there appears to be many on the page. This leads to fewer HTTP requests and all-round improved performance. Additionally, it decreases any kind of lag that might be introduced when switching images.

nav_sprites.pngUsing CSS sprites is easy. Just combine a number of images into one and use the offset parameters of the CSS background property to define which part of the image you want to display. I use CSS sprites for the icons in the main navigation of this blog. The composite image is called nav_sprites.png. As you can see, the first sprite in the image is the blog icon (the plus sign). In CSS, I’ve defined this as:

background: url(img/nav_sprites.png) 0 0 no-repeat;

The hover style for that link is defined as:

background: url(img/nav_sprites.png) 0 -28px no-repeat;

In other words, the same image, but the image for the hover style is offset by -28 pixels from the top of nav.png. The next image is offset -56 pixels and so and and so forth. It should be worth mentioning that in addition to setting the offset, you might also need to set a width or height for the element in question to prevent stuff from the adjacent sprites to be displayed.

In my case, I placed all sprites in one “column”, but there’s nothing stopping you from adding multiple columns to the master image. In that case, you need to use the horizontal offset parameter as well (0 in my case).

Personally, I love these kinds of tweaks. CSS sprites are really easy to implement and even though the performance gains might not be huge, I’m a big fan of anything that streamlines the operation of computers and technology in general. There’s been some discussion on where to draw the line when it comes to CSS sprites. One could, in theory, include all images that are used on a website in one big composite image, but I think that’s taking it too far. If the browser needs to download a huge image before it can display any graphics at all on the page, the user experience will suffer. I think a good practice is to group images together. In other words, one composite image for icons, one for general UI elements, one for borders/corners etc. And don’t forget, this only applies to images that you display with the CSS background property, not the <img /> tag.

Happy spriting!

Edit: I forgot something. If you’re a bit lazy and you already have a large number of images that you want to combine into one master image, there are a couple of generators online that will do the job for you. I’ve tried CSS Sprites Generator and it worked great. There’s also this one which appears to have more features, but I have yet to test it myself.

Reset iPhoto ‘09 face recognition database

Edit: Solution in the comments.

I’ve been playing around with the iPhoto ‘09 face detection and face recognition stuff today. Having tried a lot of stuff to get the best results, I now want to “reset” the face recognition database or whatever so that I can start from scratch and teach it properly. Does anyone have any idea how to do this apart from emptying my library and re-importing everything again? There must be a way, right?

The Exchange migration from hell

I work at Lund University. So does approximately 5,500 other people. Each employee has a 250 MB mailbox in a horribly outdated and buggy e-mail system called iPlanet Messaging Server. Work is currently under way to migrate all those mailboxes to Exchange. In the process, the mailbox quota will be increased to 2 GB (!). That’s a potential 11 terabytes of mailboxes. I’m glad I’m not involved in that project :)