The eclectic musings of a bitter software engineer.

Archived Posts

Displaying posts 11 - 20 of 566

blink tag compatibility script

Tuesday April 01, 2008 @ 10:38 AM (PDT)

Update: Yeah, April Fools. For the sake of my own sanity, I’ve removed the actual blink tags from the post now that the fun has worn off. Please don’t actually use this code or I’ll hunt you down and throw angry kittens at your face.

While working on a new feature for Yahoo! Search today, I ran across an interesting problem. It seems that some A-grade browsers have a serious bug: they don’t support the HTML <blink> tag, which has been part of a w3c spec since 1999.

Since I absolutely wouldn’t have been able to implement this awesome new feature without the <blink> tag, I went ahead and wrote a JavaScript compatibility shim to add support for it to buggy browsers:

/**
 * blinktag.js v1.0.0 (2008-04-01)
 *
 * Compatibility shim to implement the <blink> element in browsers that don't
 * properly support the w3c spec (for spec details, see
 * http://www.w3.org/Style/HTML40-plus-blink.dtd).
 *
 * For a demo and usage examples, see
 * http://wonko.com/post/blink_tag_compatibility_script
 *
 * Copyright (c) 2008 by Ryan Grove <ryan@wonko.com>.
 * All rights reserved.
 */

setInterval(function () {
    var i, s, tags = document.getElementsByTagName('blink');

    for (i = 0; i < tags.length; ++i) {
        s = tags[i].style;
        s.visibility = s.visibility == 'hidden' ? 'visible' : 'hidden';
    }
}, 1000);

Feel free to use this script in your own projects until Microsoft and Apple fix this bug.

CrashPlan status report: still awesome

Monday March 31, 2008 @ 09:32 PM (PDT)

Early last year I wrote a positive review of the online backup tool Mozy. Like a fool, I neglected to test its restore functionality, and a few months later when I suffered a hard drive crash and tried to restore 20+ gigs of data from my Mozy backup, I learned that Mozy can’t restore for shit.

After extensive testing of both backup and restore functionality, I decided to switch to CrashPlan for my online backups. Back in September, after having used it for several months, I gave CrashPlan a glowing review.

So, seven months later, would I still recommend CrashPlan? Yes. Hell yes.

CrashPlan has backed up my data quietly, reliably, and without fail. It hasn’t ever crashed or frozen and it doesn’t hog my system resources. Most of the time I don’t even remember it’s there. But most importantly, CrashPlan has saved my ass several times, and each time it’s worked so well that it almost makes me want to do stupid shit more often just so I can experience the pleasure of having my ass saved again. It works that well.

When I migrated from a PC to a Mac last year, I copied all my important data off the PC’s hard drive, then wiped it clean. At least, I thought I had copied all my important data. Naturally, as soon as I finished nuking the drive, I realized I had only copied one of my two partitions. A few clicks later, CrashPlan was happily restoring the lost files to my new Mac from the PC’s most recent backup. I didn’t lose a thing.

That’s been the story every time I’ve needed to restore something. Whether it’s a single file of just a few kilobytes or a whole directory containing several gigabytes, CrashPlan begins restoring the files instantly and only seems to be limited by the download speed of my Internet connection. Mozy’s painful, slow, unreliable restore process is nothing but a distant nightmare now.

CrashPlan and Mozy both make lots of big promises about how safe and secure your data will be and how easy it’ll be to restore in the event of a disaster; the difference is that CrashPlan actually keeps its word.

Thoth 0.1.2 released

Saturday March 22, 2008 @ 06:08 PM (PDT)

Thoth 0.1.2 has been released. The only changes are Ramaze 0.3.9.1 compatibility and a new MinifyController that minifies Thoth’s CSS and JavaScript on the fly.

The minification is handled by two new Ruby libraries: CSSMin, which is a port of the YUI Compressor’s CSS minification routines to Ruby; and JSMin, a Ruby port of Douglas Crockford’s JSMin.

Feel free to use these libraries in your own projects. They’re available as individual gems for your convenience (named “cssmin” and “jsmin”, naturally).

More on the Safari 3.1 keypress change

Friday March 21, 2008 @ 02:22 PM (PDT)

I was (clearly) still a little frustrated when I posted about the Safari 3.1 keypress change the other day, and in my frustration I posted a rant when a reasoned discussion would have been more productive. As my coworker Julien said to me later that day, “Nobody died!”

After seeing my rant, John Resig posted a more in-depth discussion of the change and the reasons behind it. I don’t disagree with his conclusions. The reasons for the change are good, and it was something that needed to happen. I only have two complaints:

  1. The WebKit team should have communicated the change to web developers before Safari 3.1 was released. A blog post on the WebKit blog would have sufficed. The only pre-release notification I’ve been able to find about the change was a single email to the webkit-dev mailing list, a list that few web developers subscribe to since it focuses on internal WebKit development rather than on web development with WebKit.
  2. Even though the new behavior is more “correct”, it fragments the already-fragmented world of DOM keyboard events even further. In one camp you have IE and Safari 3.1, which now behave similarly but still have minor differences. In the other you have Firefox, Opera, and Safari 3.0.

The cross-browser inconsistencies are frustrating, but they’re nothing new, and they can be dealt with. The communication issue is the one that bothers me the most. It’s the reason I was so annoyed when I saw my code break in Safari 3.1. The fact is, I love Safari, almost to an unhealthy degree; it’s been my browser of choice for a few months now and I’ve come to expect the best from it. Seeing an incompatible change like this slip into a major release with no warning was a bit like having the first argument in a new relationship: it came out of nowhere and left me feeling like the world was ending when, in hindsight, it wasn’t really such a big deal.

To sum up: changes that break backwards-compatibility are okay when there’s a good reason, but give us some warning next time. I still love you, Safari.

Safari 3.1 breaks keypress events

Wednesday March 19, 2008 @ 10:23 AM (PDT)

In Safari 3.1, which was released yesterday, the keypress event is no longer fired for non-character keypresses other than enter.

I was sure this was just a bug, but it turns out the change was intentional, and was made in order to imitate the behavior of Internet Explorer.

In other words, the WebKit team looked at their keypress implementation, which had some quirks but at least worked more or less the same as in Firefox and Opera, and they said, “Hey, you know what this needs? More suck!” and changed it to work like IE instead, thereby causing even more confusion in the already-muddled clusterfuck of DOM keyboard events.

If you’re developing a web browser, here’s a helpful tip: when faced with the question of whether you should imitate the behavior of Internet Explorer or [insert other browser name], always imitate the other browser. I don’t care if the other browser is Mosaic 1.0; odds are it’s a safer choice than IE.

Thoth 0.1.1 released

Monday March 17, 2008 @ 11:01 AM (PDT)

Thoth has officially been released! You can install it with:

sudo gem install thoth

Once Thoth and its dependencies have been installed, create a new home directory for your Thoth blog:

thoth --create myblog
cd myblog

Edit thoth.conf to your liking, then start Thoth:

thoth

Take a look at your new Thoth blog at http://localhost:7000/ (or whatever port you configured). Once you’ve got everything working and are ready to run Thoth in production, you’ll probably want to start it as a daemon:

thoth -d start

Easy as pie, huh?

Riposte is now Thoth

Wednesday March 12, 2008 @ 11:38 AM (PDT)

It turns out the name Riposte is already trademarked and in use by these folks. Since their lawyers sent me a polite letter asking that I stop using the name, the blog software formerly known as Riposte will henceforth be known as Thoth.

Are you awesome? Yahoo! Search wants you.

Thursday March 06, 2008 @ 05:23 PM (PST)

If you’re an awesome web developer or QA engineer and want to work on awesome things with me and lots of other awesome people at Yahoo! Search, send me your résumé.

ilovewonko.com

Tuesday March 04, 2008 @ 11:36 PM (PST)

I’m not in any way affiliated with ilovewonko.com, but I almost wish I were.

It’s a sly parody; a haunting caricature of a stereotypically lonely, tortured soul seeking solace in poetry (“No one lives forever, if only it were so / But people never see when my tears begin to flow.”), fiction (“Her magic against a warrior of his caliber was like swatting a swarm of scarab beetles with a rolled newspaper.”), music (“I’d like to dedicate this song to my ex-boyfriend…”), and Comic Sans MS.

On second thought, maybe it’s not a sly parody at all. Maybe it’s just a pathetic disaster that makes me wish I had thought to buy that domain first in order to prevent things like this from happening.

IE8 might not suck after all

Monday March 03, 2008 @ 06:44 PM (PST)

Microsoft has changed their stance and now says that Internet Explorer 8 will render pages in standards mode by default, and developers can use the previously announced X-UA-Compatible header to enable the IE7 compatibility mode. Previously it was the other way around, which was just retarded.

This is the best news I’ve heard all day.

Copyright © 2002-2008 Ryan Grove. All rights reserved.
Powered by Thoth.