Thanks, Bill… this is just how I wanted to spend my Saturday

Bill, I really don’t have time for this.

Internet Explorer 6 is incapable of properly rendering CSS applied to a <div> tag when the only child element in the <div> is a table. It sticks arbitrary margins in the document below the table. Here’s an example from a site I’m working on (colors removed to [sort of] protect anonymity). This is how it should look, as rendered by Safari:

Safari screenshot

The concern is the content in the dark title bar. The bar itself is a <div> and the two buttons plus the month/year text is contained in a table. Here’s how it looks in Internet Explorer 6 (note the gap below the header bar):

Internet Explorer screenshot 1

OK. So let’s see, maybe there’s a semi-logical CSS workaround. I already have margin: 0 defined for the class the <div> uses. So I added it to any tables contained within that class as well. No luck. Then I did something really off the wall and added a display: inline property for tables contained in that class. It still didn’t work. So then, appropos of nothing, I added a &nbsp; just so there would be something in the <div> besides the table. And here’s the kicker… I actually added it before the table (retaining the display: inline property of the table:

Internet Explorer screenshot 2

Once again, it’s good that the windows in my office don’t open, or there would be one less PC in this building right now.

Of course the &nbsp; solution is not satisfactory to me. The search goes on. Because, you know Bill, I really have nothing better to do when I’m working on a Saturday morning.

At this point another alternative occurs to me: it’s possible to use the CSS float property to position the buttons and eliminate the table altogether. That fixes the problem in Internet Explorer, but…

Steve, I’ve got a few words for you as well! Look what happens in Safari when I remove the table in the header:

Safari Screenshot 2

Sure, that makes perfect sense. Especially since I have a width="100%" attribute right there in the calendar table. Oh, and did I mention that the width of the panel body is explicitly defined in pixels in the CSS? How is it, how can it be possible, that removing a table from a separate (albeit adjacent) <div> could affect the width of this table?

Now where’s my glass cutter? I think there are one too many PCs and one too many Macs in this office.

After a bit more head scratching, I’ve discovered that the cause of the Safari issue is that I neglected to remove the aforementioned display: inline property I added to my CSS in the midst of the numerous futile experiments I undertook to resolve the initial IE problem. Steve, you’re off the hook.

So, in the end, it turns out that the solution to my problem is to abandon the old-school table-based method of layout and go strictly CSS. I’m sure that’s precisely what Bill wants me to do.

Welcome to the new room34.com!

The new WordPress 2.1-based version of room34.com is here! I’ve been tinkering with this for about a month now so I’m very excited to finally have it online. And I think WordPress has really taken a major leap forward with version 2. (My loyal reader may recall that I had previously moved to an earlier version of WordPress, only to abandon it a short time later. Frankly, looking back I’m just amazed that I actually used it for 8 months; it seems like it was much less than that, but maybe that’s just because I’m thinking about how I only had Drupal running for about three days.)

There are still a few things left to do: some pages have missing content or broken links; I’m still working on a top navigation bar with dropdown menus (for now the navigation is buried below the fold in the right sidebar… look for Points of Interest and the various links that follow); and there are a plethora of WordPress plug-ins I’m eager to implement.

I’m also moving the photo albums of the kids over into Gallery 2. There’s a lot of work left to do on that, so I apologize to family and friends who are looking for photos. They’ll be back online soon, I promise! (I mean, “I hope!”)

And finally… in the time that I’ve been working on this, I’ve written a few other new blog entries (six, to be precise), which I never bothered to post on the old site. But they’re here, below, so read on!

Now this is funny!

According to this article, the first security exploit has been found in Windows Vista.

While that’s not entirely surprising in itself (after all, the OS has been commercially available for over 3 full days now), the nature of the flaw is both amusing and somewhat shocking.

Vista adds new speech recognition features, allowing the user to issue commands to the computer by speaking. At least, I’m assuming this is new. Mac OS has had speech recognition for at least a decade, but it used to require extensively “training” the computer to recognize your voice. I’m guessing that the new speech recognition software doesn’t require that kind of training, sort of like how pizza places now have speech recognition software that answers the phone and takes your order.

So, on to the exploit: if speech recognition is on, and the computer’s speakers and microphone are both on, it would then be possible to visit a website that autoplays an MP3 of a voice issuing commands to make the computer do all sorts of nasty things (like erasing files off the hard drive)!

The Monty Hall Problem

This is an old story, but a coworker and I were just discussing “The Monty Hall Problem,” which comes down to the common scenario from the old game show “Let’s Make a Deal”: If you have three doors, with a car behind one of them, and dud prizes behind the other two, once you’ve made your selection and the host reveals a dud prize behind one of the other doors, does it make sense for you to switch doors or stick with the one you’ve picked?

The simple intuitive answer is that it makes no difference, now that there’s a 50/50 shot at opening the right door. But it seems that 2/3 of the time it’s better to switch! We pondered this for a while and I guessed that it may have something to do with the fact that the host knows which door the car is really behind.

Apparently that’s correct. (Since this link points to an ancient [in Internet time] web page that may or may not endure, although it’s made it this long, I’ll provide a summary here.)

Let’s Make a Deal Roulette Wheel

This roulette wheel is the key. The inner circle is the door the car is behind, the middle circle is the door the contestant picks, and the outer circle is the door(s) Monty Hall can open after the contestant picks. The red spaces indicate that the contestant should switch, and the blue that they should not. 2/3 of the time it’s better to switch, because Monty Hall has basically been forced to reveal that the car is behind the door the contestant did not pick.

In other words, the contestant picks the right door the first time 1/3 of the time. This is pretty straightforward. That means that 2/3 of the time they did not pick the right door the first time, also straightforward. Therefore, since 2/3 of the time the car is not behind the door they picked, and Monty Hall will never open the door the car is behind, then 2/3 of the time the car is behind the door that neither the contestant nor Monty Hall picked, so the contestant doubles their chance of winning by switching.