Tagged: Code

A useful tip if you love both YouTube and markup validation

Not valid!YouTube is worlds apart from the likes of MySpace (*shudder*) when it comes to good code, but like most massively influential sites, they don’t really seem to care that much if their code validates, and even less if the code they provide webmasters for embedding content in their own sites does.

Frankly, I usually don’t care that much about validation either. I worked in this field for too many years when no validators even existed, and I’ve always taken the pragmatic approach: make it look and work the same, more or less, in all reasonably recent versions of Internet Explorer and Netscape (with Firefox and Safari having replaced Netscape over the past few years), and be done with it. Read more »

A configuration-based solution to the translucent menu bar in Leopard

I had forgotten I’d even found and tried this until I looked up at my menu bar today after changing my desktop image and noticed it was opaque. I can’t find the site where I originally got the code, but I’ve found another blog that mentions it. The code to execute at the command line is:

sudo defaults write /System/Library/LaunchDaemons/com.apple.WindowServer 'EnvironmentVariables' -dict 'CI_NO_BACKGROUND_IMAGE' 0.63 Read more »

Yes, Virginia, there really is a difference between null and false

Fairly often, it’s necessary in PHP programming to write your code around the fact that, most of the time, PHP does not distinguish between null, false and 0, although there is, nonetheless, a distinction between all three.

Today I ran into one of the few instances where I was expecting PHP to treat them as equivalent, but it did not. Read more »

Wow, I’m a reference in an O’Reilly code sample!

That’s not Bill O’Reilly, thank you very much, but O’Reilly, the much-lauded publisher of technology reference books.

Doing a bit of narcissistic “googling,” I discovered that my site appears in the sample code in an article O’Reilly published on their xml.com website on the topic of hacking iTunes. Cool!

On a less random (and ultimately more satisfying note), I also discovered that my Coltrane thesis was cited in an academic book called Cognitive Science, Literature, and the Arts: A Guide for Humanists. Wow!

The Case of the Missing Nav Bar

I will admit, sometimes the problems I encounter in Internet Explorer are simply due to slight differences in browsers’ implementation of HTML or CSS or whatever, and I’m just not properly accounting for the way IE does certain things. Other times, it’s true, they’re due to a flat-out bug in my code that Safari and/or Firefox (usually “and”) will just graciously accept, whereas IE will not. (The cases where IE catches errors that Safari and Firefox permit, however, are rare compared to the vast, cluttered landscape of bad code that IE welcomes with open arms but that Safari and Firefox rightly reject.)

And then there are the cases such as the one I encountered today. There’s no way around it. I can’t find a nicer way to put it, IE is just plain fucked up.

Read more »