Saturday, June 30, 2007

Pinball machines

Yesterday evening I went with my brother to pick up a pinball machine he had bought. He already has one in his home: a worn down 1975 Bally Kick Off machine.

It's still fun to play at times, but it could use some restoration. So... my brother decided to buy a second machine. After some searching on the second hand sales sites he finally bought a 1990 Williams Funhouse.
It's a pretty well known machine, since it's very colorful and has a moving head in it.

While talking to the seller I once again realized that pinball is really dying. Twenty years ago we'd have at least four or five arcades nearby where we lived. And each arcade would have at least somewhere between 10 and 15 pinball machines.
The biggest arcade had at least 50 of them. That was so much fun. More fun than all the other video games they had, even though those drew the bigger crowds.

But with video games moving into the living room, the arcades were not making enough money anymore. So these days most of them have closed down. And the ones that are still there, have switched to only having slot machines.

Which isn't exactly the same thing as a pinball. Especially not when you try to nudge them a bit, which is really frowned upon by the arcade owners.

So with no arcades to host the machines, vendors shut down one after the other. Today there is only one big vendor left: Stern. They're a relatively new company, so not a survivor from the old days. But still, Stern makes pretty well designed pinball machines based around things like movies. They lack some of the character and originality of the older machines, but they're real pinballs and as long as Stern is the only company still making pinball machines I won't be complaining too much.

But there are also a lot of pinball aficionados our there, keeping the hobby alive. They buy old machines, restore them with a lot of skill, time and dedication and then send or sell them off to someone else - hoping they too will pick up the love for pinball. In this case the receiver was my brother, who doesn't need to pick up the love. He likes pinballs almost as much as I do. But he does have to little kids (ages 5 and 7) that still need to learn to appreciate it.

One thing I didn't really realize until yesterday was how heavy pinball machines are. They actually need to be quite heavy to withstand all the kicking, shoving and nudging that used to go on at arcades. But nudging a 140 kilo machine isn't exactly the same as trying to lift it into a car. My arms are still hurting....

Tuesday, June 26, 2007

It's all about the data, not about the code

As I've probably told before, I administer (and contribute to) a few photo blogs. Since I wrote the software for the blogs a few years ago, actually most of the time I spend on it is small tweaks to the code. Adding a feature here and there. Nothing big, but enough to keep the editors happy and myself busy.

But recently I noticed that I've been putting of adding one of the requested features. And I wondered why. The feature in itself isn't very spectacular. The blogs work with a scheduled system, where all editors can see everyone else's posts. Since this is the holiday season, editors are sometimes planning their posts weeks ahead of time. And this can get confusing to the editors because it sometimes isn't very clear anymore where we are today. And something that also slightly bothered me is that some of our editors like to read posts from the administrative interface before they appear on the site. We even get answers to some of our "guess what" photo's before they're available on the public site.

It is time to do something about this. Like I said, it is pretty simple: don't allow the editors to see each others future posts in the administrative interface. So they should still see each others "old" posts, which is a great way to quickly find something you want to link to. But into the future, they should only be able to see their own posts.

The heart of the administrative interface is a table with a row for each post. It's very basic and the code is like:

    for each post
write post to grid
Any half-decent programmer will know how to add the feature:
    for each post
if (postdate <= now || currentUser == author)
write post to grid
But this is where it becomes problematic. The editors can sometimes also post on behalf of other (guest) authors. And of course, they should be able to see the posts that they created on behalf of guest authors. So the condition should be more like:
    for each post
if (postdate <= now || currentUser == editor)
write post to grid
In here we added the concept of an editor: the person who created the post in the system. And this is not necessarily the same as the author: the person who created the content of the post.

This would indeed very easily implement the feature. One additional if statement and I'm done.

There is only one problem with it: I don't keep track of the editor of the post!

The information was never needed, so it has never been recorded. That means that I have about a year and a half of posts for which I don't know who the editor is. Which means that I have to figure out a way to either manually gather that data now (something I don't look forward to), add an exception for the cases where the data isn't available (resulting in uglier code) or somehow programmatically extract the information from the data that we already have. That last option sounds like the least manual work (both now and in later maintenance). But it means that I'll have to write code that touches all 500+ posts we have in the system.

When I realized this, I finally knew why I'd been putting off adding this feature. I don't have any problem modifying the code, even when I hardly use version control and backups of it. Why? Well, simply because I know that if I break it I can just as easily fix it again. That's the benefit of a one man software project. I wrote the code, so I know how everything works. But I am reluctant to touch the data. Why? Well I didn't write most of the data, so I have no idea how to restore it if I "break" something in that area.

This realization reminds me of something I always say to fellow developers: "it's all about the data, not about the code". The code can be re-written without any problem. All it takes is time and a developer. It doesn't even need to be the original developer, because a good set of data allows for lots of reverse engineering. But the data is often gathered from many sources. And if it's lost, it's lost. It will take much more work to find all those sources of data again, if it's possible at all.

Now that I've talked about it this much, I'll probably bite the bullet and add the feature anyway. I'll even do it the right way: by modifying/augmenting the existing data to include information about the editor in addition to the author field we already have. But I'll be sure to first do this in a development environment. And even when I know it works, I'll make some extra backups before applying it to the live environment. It might be a lot of work that is most likely not needed. But I'd rather do the extra work than run the risk of corrupting some of our precious data.

Saturday, June 23, 2007

The Mac startup sound

I switched on my Mac this morning. While it booted I walked to the kitchen to grab some coffee and I heard myself singing:

  • It's been seven hours and fifteen days
In case you don't recognize it, that is the opening line of "Nothing compares to you" by Sinead O'Connor.

Now it's not unusual for me to sing small fragments of songs. But I always wonder what triggers a certain song. Especially one that is as old as this one.

It didn't take long to figure it out in this case. The song was triggered by the sound that the Mac makes when you switch it on. It sounds remarkably similar to the start of the song.
Has anyone else noticed this? All I could find in a quick scan, was a comment in this post.

And is it a coincidence? Or is this part of the tribute that the Mac engineers pay to their creation? It sounds like the thing any Mac-head would say to his/her machine: "nothing compares to you".

Flashback to regex'es

Sorry for the lack of updates in the past week. Normally I'd blame work, but in this case it wasn't unusually busy there. Actually my lack of updates has been caused by the amount of feedback I've gotten on one of my earlier posts.

The post is about optimizing regular expressions, one of the last black arts of programming. And this black art is mostly lost on me. Luckily one of our readers seems very fluent with regex'es and has been extremely helpful. Unfortunately I haven't yet gotten all the kinks out yet while integrating it into the project, but his suggestions seem to improve performance immensely.

If you want to know more, follow the link above and see how it plays out. If you don't care about regular expressions; I am busy writing a next regular post. It should be up later today or early tomorrow.

Sunday, June 17, 2007

Help! My mediacenter is dying!

Yesterday I told you about the positive impact our mediacenter has had on the way we watch TV. Unfortunately it hasn't all been positive.

From day one our mediacenter has been having hardware problems.

  • Motherboard replacement.
    Within two months of buying the mediacenter, its motherboard had to be replaced. And this is an A brand, mind you. Apparently that doesn't say anything about quality anymore. The service center was pretty close by, though.
  • Single tuner or twin tuner.
    We went for the mediacenter with two tuners in it. But unfortunately about half of the time, only one of the tuners seems to work. It's annoying, but apparently not annoying enough to send the machine back to the repair shop.
  • Hibernate or always awake.
    One the things that is really important is that your mediacenter should "go to sleep" when it's not doing something and then "wake up" when it needs to record a show. And at times that actually worked reliable for us.
    But most of the time, our mediacenter is much like a 15 year old kid: it wakes up when it feels like, stays awake as long as it likes and refuses to go to sleep when you tell it to.
  • What's that noise?
    We went for the more expensive VCR form factor mediacenter, because it was supposedly less noisy. And I guess a standard desktop PC would indeed make more noise that our mediacenter. But I still find the amount of noise it makes too much. It could really do with some less power-hungry parts, so at least some of the fans can be removed.
  • Wireless keyboard range
    The range that I can use the wireless keyboard at is ridiculous. I basically have to sit on the floor right in front of the mediacenter to get it to work. And even then it is intermittent. I would much rather have a reliable wired keyboard, but apparently am to lazy to get one that looks nice enough in my living room.
Ok, so much for the hardware problems. There also plenty of software problems. Our mediacenter came with Windows XP Mediacenter Edition. That is a whole Windows version dedicated to supporting mediacenter functionality. So it can't be bad, can it? Wel....
  • Installation assumes you have a monitor attached
    I bought a mediacenter to hook it up to my TV. Then why does the installation assume that I'm on a high-resolution monitor? Entering that 20 digit license code really is no fun when you can't read half of what's on the screen.
  • Windows Mediacenter is an application, not a special version of Windows
    When I saw Window Mediacenter Edition, I expected the whole Windows OS to center around the mediacenter functionality. Well, I was wrong. Mediacenter is nothing more than an application on top of regular Windows. And unfortunately that's how it feels. When I start (or wake up) my mediacenter, I firsts see the PCs POST screen, then I see Windows booting and finally I see the Mediacenter application starting. Imagine your TIVO doing something like that.
  • PDC? What's that?
    In Europe we have something called program delivery control, which sends some extra signals with the program when they start and end. The result is that you never miss the end of a program that is running late. Admittedly this is available for a limited number of channels, but for those that have it this is a great feature. Unfortunately Windows Mediacenter doesn't support this feature whatsoever.
  • Teletext support is laughable
    Again in Europe many TV channels carry teletext pages with useful information. Windows Mediacenter can display these fine, but why -on a PC with plenty of memory- do I still have to wait for it to cycle through the pages? Have the developers never heard of caching the pages? More and more TVs do this, but Windows Mediacenter... doesn't.
  • Why isn't there a web interface to the EPG?
    Programming recordings through the EPG on your TV screen is a real improvement to old-style, time-based VCR programming. But this is one are where a higher resolution screen helps a lot. So why isn't there a standard web-interface to the EPG data on my mediacenter. There's a great third-party program to do this, but why doesn't this work out of the box? Microsoft's own (add-on) solution is worse then the third party one and doesn't even work outside of the US.
  • Why isn't the EPG data up to date?
    The quality of the data in the EPG used to be really bad. For some channels we used to miss about 50% of the programs, because the data wasn't in the EPG. This has improved considerably since last year, but it still happens sometimes.
  • Failing recordings
    The mediacenter either doesn't start recording a show that it is scheduled to record. Or it records a few minutes, then stops, then starts again, then stops... you get the picture. The result is shows that I really can't watch.
    So I lied yesterday: I have missed quite some episodes of CSI lately. This is the biggest issue for us at the moment. All the other software issues are annoyances, but this one is making me think of unplugging my mediacenter. Or at least of re-installing it completely. I'd happily sacrifice the 40+ hours of recordings that are still on the hard disk to get it to function properly again.
I guess a lot of our problems have to do with the fact that we are early adopters. Mediacenter adoption has even now not taken off in full, so we should expect to find some "children's diseases" (that's a Dutch expression) in there. But on the other hand... if I buy something that looks like a VCR, I expect it to work somewhat like a VCR. I wasn't buying a beta version of some new application, at least that's not what it looks like. If something looks like a consumer electronics device, I expect it to work like one.

So that's the current story. As you can see it is really two-sided. On the one hand, having a mediacenter has really changed the way I watch TV. On the other hand our mediacenter has been a pretty constant source of frustration too. Let's just hope Microsoft cleans up its act in a next version of the Mediacenter software (the Vista version only seems to be somewhat better). Or let's hope that Apple adds a receiver to its Apple TV or the Mac Mini. I really hope for the latter, because a few more Macs would add some more technological styling to my living room. :-)

Saturday, June 16, 2007

Fifteen months of mediacenter and counting

We bought a dedicated VCR form-factor mediacenter 15 months ago.

It was definitely a lot more expensive than a normal desktop PC, but we decided to bite the bullet and see whether having a mediacenter was the complete paradigm shift that friends told us about. So far the experience has been like a two-headed beast. Or maybe I should say, our mediacenter PC has been behaving like a two-headed beast.

Our friends were right about it being a paradigm shift. As Americans have known since the introduction of the TIVO, once you get a PVR your whole TV watching experience changes. Since there's so much that changes, I'll make a list of it:

  • I never surf channels anymore.
    I do surf the electronic program guide (EPG) a lot in return though, searching for programs that I'd like to record. But somehow that feels like less of a waste of time. :-)
  • I record entire series, instead of just watching an episode.
    Can you imagine never missing an episode of CSI again? I can.
  • I hardly ever watch live TV anymore.
    When I feel like watching something, I just browse through the list of recordings. With on average about 30+ hours of recorded TV on the mediacenter, there's always something that I'd like to see. So the only things I watch live now are news and sports events.
  • Commercials? What are those?
    As soon as a commercial block starts, it's next-next-next-next.... then back a few seconds and I'm done. I can actually tell whether the show aired at prime time by the number of times I have to press next. And I seriously haven't watched more than 5% of the commercials I used to watch. Admitted, I might miss some very funny commercials. But then I'll see those on YouTube, instead of them interrupting my shows.
  • The quality of TV programs doesn't suck.
    I found out that there's actually a lot of good and fun programs on TV. Just not when I want to watch them. Or actually... they're now always there when I want to watch them.
  • It's the content that matters, not the channel.
    I really watch a lot of shows now on channels that I never used to watch. Then again, I watch shows now without having any idea of the channel I'm watching. Remember: I'm not surfing channels, I'm selecting a show by name from the list of recordings.
As you can probably tell, I like the mediacenter experience a lot. In fact, within months of buying it I was really certain that I would never go without having a mediacenter again. So what's up with the two-headed monster then, you're wondering? Well, that'll have to wait until tomorrow.

Wednesday, June 13, 2007

Leopards finder looks like a zoomable interface

Jef Raskin was a man with a vision. Many of the things he thought up, are still being implemented today two years after he died. That in itself doesn't make him a visionary. But the fact that these implementations are still considered revolutionary does.

Today I watched parts of Steve Jobs keynote at WWDC. What surprised me is how close the new finder interface is getting to the concept of the zooming user interface. The list of items in a can now be shown as a cover flow, which is really the same as the album cover flow in iTunes. And surprisingly (to me at least) it seems to work equally well when browsing documents and applications as it does when browsing album covers.


At first glance this looks functionally similar to the thumbnails mode of Windows explorer, with just a nicer rendering. But that superficial similarity goes away when you see that all the "covers" are live. This means that video files have a small HUD that allows you to play them. And while they're playing you can still scroll through the documents. And video is not the only thing, you can also flick through PDFs, browse through Excel pages, etc. All without ever leaving finder - without ever switching "modes".

Once you've found the document you like, a single press of the space bar zooms in on the document opening it in the Preview applet. And another key press closes it again and takes you back to finder. From preview it is just one more action to open the document it in its native application.

So everything is just a single key press away. And it all works seamlessly and -as I said at the start- reminded me of Raskin's zoomin interface.