The Economy is Literally Solid-State H2O

October 30, 2008

Two artists on Wednesday installed a 1,500-pound ice sculpture that spelled the word “Economy” in Manhattan’s financial district.

The “Main Street Meltdown” was to remain in Foley Square until it melted — about 24 hours. By Wednesday evening, the E and the C had already thawed and vanished.

Artists say an ice sculpture is a literal representation of the nation’s financial crisis.

Grammar nazis, however, say that that’s an entirely incorrect usage of the word “literal.”


Target: Best Video Game Retailer Evar???

October 27, 2008

I just had a great customer service experience at Target. Yesterday I bought the new Guitar Hero game, which includes mic and drums like Rock Band. But there was a certain very annoying problem with the drum pads. I didn’t want to pack everything back up in the box, and I wasn’t even sure if they’d have any more in stock. So I just took the drum pads and the receipt.

Not only was Target open at 8:45am; not only did they have another Guitar Hero in stock; not only did they allow me to exchange it without repacking the whole game; but they gave me the drum set from the last copy in stock. (Let me remind you that most Gamestops haven’t even gotten a single copy in stock other than preorders.) Target didn’t even make me wait for them to enter the return in their system – they just gave me the drum set and sent me on my way. Amazing!

Target’s also the best place to find hard-to-find popular items in stock. That’s where I got my Wii, and it’s the place that I most frequently saw Mario Kart in stock when it was extra-rare. So, in summary, Target’s a great place to shop for games, and I highly recommend it!

Blogged with the Flock Browser

YUI Calendar Changes Dates

October 21, 2008

My Ajax app has a persistent date it keeps track of, to compare other dates against. But I ran into a problem where the date was somehow being changed – from 12am on a certain day to 12pm. I looked through my code, and I wasn’t even changing it anywhere.

Finally, I noticed I was passing the date into a YUI Calendar object, to specify what was the minimum allowable selectable date. JavaScript Date objects are mutable, so I realized it was possible YUI was changing the hour value on the date. Sure enough, when I changed the code to pass YUI a copy of the Date instead, the date’s hour was no longer changed.

I’m still not entirely sure why YUI would need to change the Date, or if it’s even good design for it to do so instead of creating a copy of the Date object. Nonetheless, lesson learned: if you want to make sure an object you’re passing somewhere is unchanged, make a copy before you pass it. This smacks of a general OO principle, but for some reason I haven’t run across this problem in the Java world before.


News Flash: IE getElementById Invaded By Form Field Names!

October 17, 2008

If document.getElementById() isn’t returning the results in IE that you expect, checkand see if you have any form fields with that name. It seems like IE returns them from getElementById() – even if you manually give them an ID different from the name, that doesn’t conflict! Your only hope seems to be renaming the element you need to select, so that it doesn’t have the same name as any of your form fields.


IE6 setAttribute “onclick” not working

October 16, 2008

OK, I don’t have time to fully test this one, but when I dynamically create DOM nodes in a YUI panel, and then create an anchor tag and add an onclick handler to it (no HREF) by using setAttribute, IE6 doesn’t register the click event. It seems that I need to use another event attaching method, like YUI Event addListener() – that works fine in both IE and FF.


IE6 :hover Support

October 16, 2008

IE6 does not support :hover pseudo-classes on non-anchor elements. Ugh.

There are a few fixes out there. This one uses prototype. I was able to translate it to use YUI Event and Dom pretty easily. Wish I had an open-source agreement with my employer so I could show it here.


Don’t Waste Your Life on Your iPhone

October 16, 2008

John Piper is one of my favorite pastors and authors, but one who’s known for not trying to be particularly polite. He wrote a book called Don’t Waste Your Life, talking about God’s purpose for your life, and how so many things can distract us from it. One of the examples he frequently cites is computers and technology.

Today, on Piper’s blog RSS feed, I saw the following headline:

Don’t Waste Your Life on Your iPhone

Immediately I got convicted. Is my latest technology interest really keeping me from God’s purpose for my life? Am I wasting my life on Steve Jobs’ latest gadget?

Then I read the post:

The full text of Don’t Waste Your Life is now available online for free in a format optimized for the iPhone.

Oh. Right. I guess Piper wasn’t calling me out after all. Maybe it was just the Holy Spirit.


YUI Editor Does Not Hide Properly

October 9, 2008

I tried to use a YUI Rich Text Editor inside a YUI Panel that starts out hidden. However, some of the time, the place that the YUI Editor occupies was covered with a white square, even when the panel was hidden.

This example by Dav Glass provides the solution. IE6 does not properly handle visibility:hidden for iframes. The solution is to position the iframe offscreen when it’s hidden, and restore it when it’s shown again.


IE “Expected identifier, string or number”

October 9, 2008

After getting a script to work in Firefox, I tried it out in IE, but got the error ”Expected identifier, string or number.” Turns out Firefox is OK with you putting a comma after the final element in a list, but IE is not.


Multiple YUI Modal Panels

October 9, 2008

Creating a page with several different modal YUI panels (popup “windows”). Some of the modals were showing up behind the overlay that shades and disables the rest of the page.

When I looked at the DOM, it turns out that I didn’t properly close some tags, so some of the modals were actually inside the other modals. Any time a YUI panel isn’t a child of the body element, that can cause problems with modality. Fixing the closing tags fixed it.


Follow

Get every new post delivered to your Inbox.

Join 523 other followers