Monthly Archives: December 2003

Death of Flexible Width Designs

It’s over, it’s done. Those of you holding on should wave the white flag as two of the best flexible width sites, Doug Bowman and Dan Cederholm, have thrown in the towel and gone fixed-width without even an entry of explanation, I suppose because the benefits of fixed-width are so obvious no explanation is necessary. Update: Cedorholm’s design is now centered.

Bowman's Stop Design Cederholm's Simple Bits

The assault is coming from all sides:

Dear Mr Antonioni:
I recently screened your classic film, The Red Desert, starring Monica Vitti and Richard Harris. I have a problem with the way you used screen space. My theater’s screen is big and wide. It is capable of handling many actors at the same time. For instance, crowd scenes and battle scenes work well. But in your movie there are only a few actors — and many times they are pictured in one corner of the screen or another, against a stark minimalist background. This is a terrible waste of screen space. For instance, there is one scene where Ms Vitti is filmed on the left side of the screen and there is a white forest behind her. The white forest is not much to look at. Sure, I can look to the left and watch Ms Vitti’s performance, but what do I see when I squint my eyes and look only at the right side of the screen? Not much! I urge you to add extra characters and situations to your movie so every inch of my screen bursts with action at all times.

Sincerely,
Howard Gumpf

Ouch. Now I think the film/web analogy is a bad one, and it breaks down with any sort of critical thought. Zeldman knows this but he’s trying to make a point.

Was it that long ago that flexible-width designs were all the rage? They came in with a bang, and left with a whimper. Is anyone still holding out? Are there any good flexible sites left? The only place I see it anymore in web applications (such as the WordPress administration interface) and in lightly designed e-commerce sites like Amazon.

Calculate Age in MySQL

I just got an email from docs@mysql.com saying the following:

The user comment system in the MySQL manual is not the place to request features. You can do so using our bug-tracking system at http://bugs.mysql.com/. Thanks. (Actually, your comment is not a feature request, but it relates to another comment that is. The example you’re giving is nice, but this is a reference manual, so we have to restrict it to _a few_ useful examples.)

My original comment was:

You bring up some important issues, but dealing with ages really isn’t that hard. For example you could do something like this:

mysql> SELECT DATE_FORMAT(FROM_DAYS(TO_DAYS(NOW())-TO_DAYS(dob)), '%Y')+0 AS age FROM people;

Where ‘dob’ is obviously their date of birth. It’ll also work with pre and post-epoch dates. Please excuse the funky formatting as the
comment stem seems to insist on inserting line breaks into the code block. I ran into this problem while working on some genealogical things over at Mullenweg.com, a family site. I hope this helps!

Looking back, it’s funny that the comment is still around, I wrote it over two years ago. The date and time functions is the MySQL page I use most, so in some sense it was always nice to have my mark on there. For google and posterity I’ve preserved the comment here.

I’m glad they’re cleaning up the comments, as they are really bad in places and have atrocious formatting, especially when compared to say, the PHP manual. However there is a later comment (which is still up) that offers perhaps a better method. From Kirill Novitchenko:

The method posted by Mathew Mullenweg is good, but leap years goof it up on birthdays. (Try it. Use the current date and subtract exactly 5 years ago.)

Hopefully this will be the last ‘find age’ function. There is a simple premise to it:

  1. Subtract the current year from the birth year to get the age.
  2. If the current month and date is less than the birth month and date, subtract 1 from step 1.

Therefore, this should work with everyone who wasn’t born in the future.

SELECT DATE_FORMAT(NOW(), '%Y') - DATE_FORMAT(dob, '%Y') - (DATE_FORMAT(NOW(), '00-%m-%d') < DATE_FORMAT(dob, '00-%m-%d')) AS age

where dob is date of birth.

I’ve never run into any problems with my function but I see nothing wrong with the way this one works, so I may update my code to use it.

Why not just use unix timestamps and avoid all the funkiness? When I first started writing everything I actually did, but then one day I got a call from my lovely sister saying that it was showing everyone’s birthday as January 8th, 1901 (or something like that). I had reached the negative limit of a 32-bit integer, the upper limit being sometime in 2038. Moving all the date functions into the SQL is probably bad from a programming point of view but it works great for the application. Of course I have no clue how it deals with the 10 days Pope Gregory removed from the calendar in 1582. Hopefully that won’t come up. 🙂

Thunderbird 0.4

As you may have heard, Thunderbird 0.4 has been released, and it’s a delight. I’ve been using Thunderbird off and on since I first heard of the project. I snubbed 0.2, as it was quite clunky. 0.3 changed my mind and became my default email client over Outlook Express, and I also set it up for my mom. However it was not so much on Thunderbird’s merits of the time that I switched, because it was still quite rough in many areas, it was simply the least bad of all the IMAP email clients I have tried. (And I’ve tried them all.) However this new 0.4 version is a pleasure to use. The graphics have been completely revamped, which is a much bigger deal than I would have thought and really changes how I view the application. (Literally.) Of course they were pretty patchy before, it didn’t even have a separate icon for mail you had replied to. The other problem I had before was that the program would get hung up on something, I’m not sure what, but when it was nothing would work until I restarted the application, which was annoying to say the least. I haven’t even seen a hint of this problem for about two months now (I’ve been keeping up with the weekly builds).

It just does IMAP so well. Having all my email and folders on the server makes it easy to try different email clients and not worry about importing, exporting, or keeping my data in sync. A few minutes ago, just to make sure I wasn’t remembering things wrong, I opened up Outlook Express again to give it another go. That’ll probably be the last time I ever do. Moving IMAP messages to different folders in Outlook Express opens a dialog box that actually precludes you from doing anything else in the application, so if you’re moving a message with a large attachment or several messages you have to wait for everything to finish before you can do anything else. For someone who lives in their email client, that is simply unacceptable. Thunderbird does all that in the background, and it’s so fast with most things that the “IMAP lag” is gone.

It’s not perfect, there are a few things I hope the Thunderbird team addresses in future releases. First is the spell check, which rocks but always wants to spell check the name of the person I’m replying to in an email. Second when I forward a message inline it includes all the headers, which can often be twenty or thirty lines, most of it junk that isn’t important. Just give me from, to, subject, and when it was sent, and I’ll be happy.

Thunderbird understands that on some IMAP servers, including mine, some folders contain mail messages and some just contain other folders. Outlook Express would try to select these “holding” folders and return an error, where Thunderbird shows them in italics so they’re visually set apart from the folders that hold actual mail. Thunderbird is also supposed to have some great spam handling, but since I handle all that on the server side I can’t speak to that personally.

Bottom line: try it out. You have nothing to lose and you might just find that perfect email application you’ve been searching for. The best thing about it is I know that right now another version is in the works, and in a few months they’ll be a 0.5 I can rave about. Or I could wait until 2006 for a new version of OE to come out with Longhorn. Right.

Style Updates

For better or worse, there have been a number of stylesheet updates around here, so you may notice things looking slightly different. First off are the shadows behind the main content box, for whose sake non-semantic elements were added to this page for the first time ever. How quick we are to sell out!

Speaking of selling out, text advertisements may appear at the top every now and then. Yes they suck but it’s the holidays and extra cash is always nice.

I moved the background image for the post titles from the anchor element to the h2 element to prevent the blinking when you rolled over the titles in IE on Windows. My Mother will be sorely disappointed as she thought that was a rather cool effect I had done intentionally. I wish!

Tantek and Eric informed me that my site was completely borked in respectively Mac IE 5 and Safari. This site is an experiment, so I make no guarantees as to browser compabilitiy but I try to be good about testing things on browsers available to me. Last night I used Greg’s Powerbook to see what was going on. It seems Safari was having trouble with some commented out content (the ads that are temporarily disabled) so I moved that from HTML comments to PHP comments. Commenting things out server-side is actually a much better practice because it keeps the source code maintainability for you the author but hides the comments from any visitors. There is also a savings in bandwidth, but in many cases that will be minimal. So as a best practice go from:

<-- Three extra divs added because prima the donna designer just HAD to have his shadows. And my idiot boss agrees with him. -->

to:

<?php /* :-- Three extra divs added because the prima donna designer just HAD to have his shadows. And my idiot boss agrees with him. And they'll never see this comment. MUHAHAHA! */ ?>

As for Mac IE, I wasn’t sure where to begin. It doesn’t handle the float on the menu list items well so instead of a nice tabby menu you have a series of giant honking bars in the header. I could go to display: inline for the navigation list items and work with the horizontal menu from there, but I’ve always prefered having the list items floated and the anchors as blocks, which you can’t do when the containing list element is inline. If I remember correctly Eric helped me around this problem before on the WordPress site (thank you!) by giving the items a fixed width, but I don’t have the space to burn here like I did on that menu.

Checking over my stats, Mac IE users make up approximately 2.1% of my viewing audience over the life of this site, and closer to 0.9% over the last month. Uowever is this low and declining number because other browsers are now in vogue on the Mac and IE hasn’t been updated recently to quench Mac users’ insatiable desire for upgrades? Or is it because my site looks so bad in their browser? The world may never know.

So the moral of the story is: the web is a jungle and watch your comments when on Safari.

Dotson Gig Tonight

Well the last gig got canned due to torrential rain, and now this Monday I’m feeling a bit under the weather. That’s life! Here are the details again, try to make it out if you can:

Tonight at 7:30 PM I’ll be performing with the Dennis Dotson big band on lead alto. Our entire program is going to be exclusively music from the highly talented composer and pianist Joe LoCascio, who will also be playing with us. It is the first night of what they’re calling JazzFest 2003 and there are more details, including directions and a map, at JazzHouston. They say they’re charging for tickets but I don’t think they have in the past so I’m not sure about that. I’ve been looking forward to this gig and I think it’s going to be great, so if you’d like to hear some exciting jazz tonight, try to check it out.

By the way, welcome to December. It’s by far my favorite month of the year and I’m going to savor every minute of it. December is the month I look forward to when trudging through all the other months. Lot’s of exciting things planned this month, from HPUG to WordPress to even something with the elusive Mike. And that’s just the volunteer stuff.

Update: Thanks to all who came out. Having people you love in the audience makes performing a whole difference experience. 🙂