Dreamweaver MX == Evil

I’ve been working for about the past 6 hours converting a large PHP project to be XHTML compliant. It was an arduous process, but the nice syntax highlighting helped and the search and replace function saved me a ton of time. Or so I thought.

One of the routine (or so I thought) changes I made was converting all the onMouseOver and similar attributes to be lowercase. This is required for validation and for the javascript in the behaviours to be executed (in strict mode). The first time I ran everything through the validator there were hundreds of errors, and so for about 3 hours the onmouseover case errors escaped my attention. Finally I came to a point where that was all that was left. Try as I might I couldn’t find the code in question. I searched through all the include files, yet still nothing returned a case sensitive match to what I was seeing in the source. Then I did a case insensitive search through every occurrence, and double checked that everything was lowercase. The file must have been saved dozens of times and uploaded to the server just as many times. I thought the validator must be caching it or something, anything, so I waited and tried again at different intervals. I restarted Apache, I loaded and unloaded the PHP-Accelerator from the php.ini file, with subsequent restarts.

Finally at some point I fired up trusty Homesite to see if maybe I could spot it with that. Much to my surprise, the case of every onmouseover was capitalized just like everything was saying it was. It turns out even though Dreamweaver said it made the search and replace changes, and showed that it made the changes, it hadn’t made the changes at all.

This has been enough for me to give it up entirely. Whatever time I might have saved since it came out using the GUI has been irrecoverably lost.

Power?

The strangest thing just happened: I’m in the case of my desktop taking out the old modem card, because I don’t use it anymore and I have no free PCI slots. Actually, I do have one free PCI slot but whenever I plug anything in it freezes my computer, so I try to avoid it. Anyway, I was swapping out the modem card for a firewire card, but while I was pulling out the modem I heard thunder and the computer started turning on! I immediately reached for the ‘real’ power switch on the power supply but I forgot that this case doesn’ have one, so I unplugged it. The card was half out of the PCI slot when this all started so I was very worried that it would hurt something, but it seems everything is alright. This has been the strangest day.

Aural Bliss

I just got back from the store and I purchased a set of Logitech Z-560 speakers. They’re absolutely amazing, the sound is so crisp and clear, and the bass is incredible. Not to mention the volume, at 400 watts I have to keep it turned down almost all the way to be bearable. The subwoofer is gigantic, and you can hear the difference. The first thing I popped in was En Vogue’ Never Gonna Get It to hear how it sounded with heavy vocal and bass, and also that song has some neat stereo stuff, and is very well produced. The result was everything I imagined it to be; I can’t express how having four channels of sound really makes a difference.

Right now I’m listening to Joshua Redman and Mark Turner on Leap of Faith. In the a cappella intro I could actually hear Turner’’s keys as he played. Since the song is a battle of sorts Turner and Redman are divided into the right and left channels, respectively. Listening to it closer than I really have before, I think Mark Turner really shines the brightest on this song.

xml.house.gov

Via Zeldman, there seems to be an initiative to eventually stucture legislation in XML. Browsing around, I espescially liked the member list of the 107th Congress; it’s beautiful XML styled through an XSL style sheet, the only major quirk I noticed was that the validation DTD was a local path. While this won’t make the content of the stuff coming out of DC any better, it will certainly make it better structured. I wish I had seen more of this kind of thing on my trip.

Interesting Article

Myth America 2002
By WILLIAM SAFIRE
(from this morning’s NYTimes)

LONDON

Here are a handful of myths that cause what’s left of Europe’s left to misperceive U.S. foreign policy:

Myth 1: America is temporarily dominated by self-serving isolationists who reject treaties designed by sensible Lilliputians to tie down the superpower Gulliver.

Reality: In the past decade, the U.S. saved Europe from becoming an economic vassal to Iraq, which was on its way to conquering Kuwait and Saudi Arabia. A few years later, as Europe temporized, we led NATO’s defeat of Serbia’s takeover of the Balkans. Recently, we drove Islamist terrorists, who threaten Europe as much as America, from their training bases in Afghanistan. Is it too much to ask to protect our 250,000 troops defending freedom abroad, along with aid workers and journalists, from a treaty enabling publicity-hungry prosecutors to harass them?

Myth 2: (flip side of first myth) We’re interventionist bullies, with no regard for the sovereignty of countries whose threatening leaders are better dealt with diplomatically.

Reality: Saddam Hussein has been jerking around the United Nations for seven years, ignoring his surrender agreement and buying off French and Russian defenders while building a nuclear and germ-warfare capability for delivery by North Korean missiles or, more likely, through terrorist cutouts. Sanctions, dumb and smart, have dismally failed; the danger of nuclear blackmail grows to head-in-the-sand Parisians and Berliners as well as vulnerable New Yorkers. Brits and Turks may reluctantly help us, but European handwringers and Arab monarchs want a free ride.

Myth 3: The Bush administration, with its disdain for treaties, does not understand the nuances of dealing with nuclear-armed Russia, which must never be allowed to feel humiliated.

Continue reading Interesting Article

Growing

You may (or may not) have noticed some new widgets on the site. First, I’m working on the JazzQuotes system. Right now all it does is echo a random quote, but eventually as the database becomes more inclusive it’ll have more features, including being able to browse by author (jazzer) and the ability to submit your own favorite quote. Also there is work being done on the toy section of the site, and I’m coding out a little script that will show what I’m listening to on my computer right now.

Keyboard Compare Applet for Dvorak and Qwerty Keyboards

I’ve found a very cool site: Keyboard Compare Applet for Dvorak and Qwerty Keyboards. The Dvorak layout places the keys you most under the fingers best suited to use them.

Plugging the top 500 words from the english language into the applet came up with some interesting results: your fingers would have moved 72.09 meters if you used QWERTY, but only 42.44 meters with Dvorak. See the site for more details. If anyone is interested in switching and want’s some computer help feel free to contact me.

Birthday mess

On the front page of Mullenweg.com I’ve been using a query that grabs all the birthdays for that month and displays their information, ordered by the day of the month. Here is the query I’ve been using:
SELECT id, first, middle, last, private, dod, DATE_FORMAT(dob, '%M %e, %Y') as nicedob, DATE_FORMAT(dob, '%M, %Y') as mob, DATE_FORMAT(FROM_DAYS(TO_DAYS(NOW())-TO_DAYS(dob)), '%Y')+0 AS age, DATE_FORMAT(dob, '%M %e') as day, DATE_FORMAT(NOW(), '%M %e') as today FROM people WHERE MONTH(NOW()) = MONTH(dob) ORDER BY DATE_FORMAT(dob,'%d')

This has a couple of problems: first, it has a bunch of junk in there that I’m not using anymore and/or should be done in the PHP, not the SQL. More fundementally is the problem that it reports birthdays incorrectly! My sister Charleen pointed out that the front page had the date of her birthday, July 21st, right, but it was going to be her 28th birthday and not her 27th. The problem was the code was calculating how old she is today and then reporting that. The column is even being called ‘age’ because I took the code from another part of the site where I was calculating age. Obviously some changes were needed. I started by removing the stuff I don’t use anymore, and making it a little tighter:
SELECT id, first, middle, last, dod, DATE_FORMAT(dob, '%M %e, %Y') as nicedob, YEAR(FROM_DAYS(TO_DAYS(NOW())-TO_DAYS(dob))) AS birthday FROM people WHERE MONTH(NOW()) = MONTH(dob) ORDER BY DATE_FORMAT(dob,'%d');

Now we have a much more managable chunk of SQL, but still nothing to fix the problem. After much deliberation, and thinking about ways to implement a conditional statement to check whether the day had passed yet and then add a year to the ‘birthday’ column if required, but after a while I just realized that the simplest and most accurate solution would be to just subtract the year of birth from this year. This has no issues since the year never changes in the middle of a month. Here’s the final product:
SELECT id, first, middle, last, dod, DATE_FORMAT(dob, '%M %e, %Y') as nicedob, YEAR(NOW())-YEAR(dob) AS birthday FROM people WHERE MONTH(NOW()) = MONTH(dob) ORDER BY DAYOFMONTH(dob);
Ahhh that feels good :).

MIB II

I saw MIB II on the IMAX screen yesterday, and it was impressive. I don’t think the movie was quite as good as the first one, if anything it seemed to be a bit of a spoof on the first one. It was quite funny at times, it’s just the plot struggled sometimes. But the screen was amazing, and the company, as always, was great.