September 2004 Blog Posts

Amazon Associate DHTML Image Tooltips

I love the Amazon Associate program. I'm a member and I even buy stuff from myself to get a kickback. It's also a good place to send people when you want to show them books, music, movies, etc., that you're talking about. Sort of like a database of "stuff."

One of the beauties of the way Amazon set their stuff up is that everything is standardized - link formats, image naming, etc. Everything. Which means, of course, that people outside Amazon can interface with their stuff pretty easily. Good for them, good for us.

I integrated Associate links into my blogging program (pMachine) so I only have to enter the ASIN for an item and it builds the link for me. I wanted to take that one step further, though, so I present to you: Amazon Affiliate DHTML Image Tooltips!

The idea is this: Hover your cursor over any Amazon Associate link to a product and get a picture of the item right there in the tooltip. How sweet is that?

It doesn't even require any change to your page structure, which is what I really dig. Just add a straight-up Amazon Associate link to your page like you usually do:

<a href="http://www.amazon.com/exec/obidos/ASIN/1234567890/myaffiliateid">A Cool Product</a>

Then add a reference to the script at the head of the page:

<script type="text/javascript" src="dhtmltooltip.js"></script>

The script will automatically rewrite all of the Amazon Associate links in the page (that are in the correct format, as noted above) on the fly for you with the correct events and everything.

(It will also do text tooltips - it's a modification to the Dynamic Drive "Cool Tooltip" script.)

It all ends up looking like this:
Screenshot of Amazon Associate DHTML tooltip

The download includes:
  • dhtmltooltip.js - The actual script that performs the DHTML and link rewrites. Information on usage is included in the header of the script.
  • test.html - A test page illustrating the script usage (both Amazon Associate and text tooltips).


Note: Since the original release of this DHTML tooltip script, Amazon has released their own "link-enhancer" script that performs a similar functionality but in a more robust fashion, adding product description information and so forth to the tooltip. This DHTML tooltip script has been updated to work in conjunction with that, not modifying links that the Amazon script has already modified. As such, previous users of this script can easily add the use of the Amazon script to their site without worrying about clashing tooltips appearing. Amazon modified links appear correctly; those not modified by Amazon or explicitly using this DHTML tooltip script will continue to function as usual.

I've tested it in IE 6.0 and Firefox 1.0, which I think covers most of the people who show up to my site. I'm sure it'll work with most any up-level browser, though if someone finds it doesn't work on a particular browser, tell me how to fix it and I will.

Like it? Want it? Here you go!

Download Amazon Associate DHTML Image Tooltips Script 2.1 (.zip file)

Version History:
2.1: Added support to allow co-existing with Amazon "link-enhancer" script. The DHTMLToolTip will not be added to links that have been "enhanced" by the Amazon script.
2.0:
  • Converted to "object oriented" JavaScript to avoid name clashes.
  • Fixed minor bug with positioning in newer browsers.
  • Safely attaching to all events (thanks to Phil Haack for this).
  • Updated so script is placed in HEAD of document.
    1.0: First release.
  • Web Setup Fails When Used With Loopback Adapter

    I sent this to Scott Hanselman like three months ago and didn't mention it here, but I ran into this again today (with the same set of users that originally had the problem - surprise, surprise) so I figured it was worthy of repetition.

    If you have the Microsoft Loopback Adapter running on a machine where you try to execute a web setup project generated from Visual Studio .NET (an MSI file), you'll get the following error:

    The specified path 'http://MACHINENAME/http://MACHINENAME/InstallFolder' is unavailable. The Internet Information Server might not be running or the path exists and is redirected to another machine. Please check the status of this virtual directory in the Internet Services Manager.

    The problem, as you can see from the message above, is the Loopback Adapter doing its job - looping back on itself. That messes up the installation path, though, and the MSI pukes.

    To fix the issue, disable the Loopback Adapter, run the installer, then when the install is finished you can re-enable the Loopback Adapter.

    Always Check Your Facts

    It's nearing election time again, and the amount of spam coming in to me with political messages is increasing noticeably as election day nears, so I figured it's time once again to offer up a public service announcement to all the souls out there who feel the need to send me messages on various topics:

    Always check your facts.

    I think this is a good rule of thumb for anyone sending anyone else a message on basically any topic, but it's particularly important when trying to communicate concern to others regarding political issues - nothing is worse than misinformation.

    The best place to start, especially if the message you're passing along is a letter you received from someone else in a chain-letter format, is Snopes, the Urban Legends Reference Site. This site dedicates itself to debunking urban legends of all forms, including the chain letters that make their way around the Internet. More than likely the letter you're sending out is already on Snopes and has been checked out. The beauty of Snopes is that they list the various letters, tell you whether they're true, then point you to official reference sites so you can check the facts yourself.

    If it turns out that the email you want to send is actually true and it's something you feel I should be concerned about, send away. (That said, you might want to take a couple of seconds to clean up the 100+ lines of forwarding headers on the mail so I don't have to scroll down, down, down, down to get to the four-line message itself.)

    Thanks for your effort, I really do appreciate it. See you at the polls!

    New Senseo Dealer

    It seems that Fred Meyer has finally started carrying Senseo coffee pods (which, apparently, are coffee pads in other countries, but the US somehow got different terminology), which I am happy about. Now I won't have to make my own, which looks like a tough prospect at best, nor will I have to drive to hell and back to stock up.

    Lots Of Birthdays, Just Not Mine

    Friday night I busted home and went to dinner at a Chinese place with Jenn and some of her coworkers. I generally like her friends, but I don't really know them, so it's hard to get too excited about going out with them.

    We went to a place that serves Chinese "family style" - everyone at the table orders one big plate of something, sticks it on the lazy susan in the middle of the table, and shares.

    In the immortal words of Joey Tribiani, "Joey doesn't share food."

    I hate family style Chinese - almost as much as I hate Szechuan (I'm a Cantonese fan - more deep fried is better) - so I wasn't too pleased to discover this, but it all ended up all right. I had some lemon chicken and Jenn had sweet and sour chicken, and we got an order of fried prawns ($1 each! expensive!) and some pork fried rice.

    Saturday was the day to have your birthday party, or at least it was according to the people I know.

    Saturday afternoon the extended family gathered in Sandy, OR for my grandfather's 80th birthday. People I'd only ever seen like twice in my life were there (and they all expected me to remember their names and relation to me since the last time I'd seen them, 24 years ago or whatever). It was fun to see everyone, but it slowly turned into a school dance situation where each of the "families" (or "cliques") would gather in a given location and talk amongst themselves rather than mingle. Which was OK by me, since I get along just fine with my parents.

    After that, I went home for a quick nap in preparation for the next party, which started about 7:00p.

    The next one was for my friend Jason, who I've known since college and who always has a great party. This was no exception, though I'm sorry to say that, due to both Jenn and I being a little tired (and some substantial intoxication on the part of yours truly) we had to leave a little earlier than originally planned on.

    Two and a half hours in the bathroom at home and I was doing much better. (Let it be known that this is the only time I've ever puked from alcohol - this is not a regular occurrence. And it really, really sucked, so I don't plan on doing that again any time soon.)

    That said, the party, as always, was a great time and I look forward to their Halloween party.

    Sunday I had planned on getting together with an old friend who I've been trying to get ahold of since before last Christmas. I like the guy - we were like brothers in high school - but over time our schedules have become conflicted and we just don't see each other much anymore. I'll shoot an email or a phone call his way every so often to see if he's freed up any (his time seems to be much more constrained than my own) and if I get a reply, it's usually that he's still busy.

    Anyway, I got ahold of him via instant messenger on Friday before coming home and he said he'd call me Sunday morning so we could get together, he could see my house, and we could catch up. He even went so far as having me email my phone number to him so he wouldn't forget to call me.

    He never called.

    So now I'm feeling like the jilted, abused lover in a bad relationship and I've come to the conclusion that I'm tired of being the only one to put out any effort in getting together. You know what? Fuck it. If he wants to get together, he can make the effort now. I'm not gonna take this shit anymore.

    Sunday we ended up doing errands and such, which did need to be done. Ugh.

    And that's the weekend in a nutshell.

    Can't SendTo

    I stayed late after work last night to try and get some help with my SendTo menu project. Talked to a guy smarter than me at C++ and, while he gave me some ideas as to what I should test, the problem still isn't solved, so I still can't tack the SendTo menu into the Visual Studio .NET solution explorer.

    Interfacing with the Windows shell shouldn't be this hard. I mean, I'm a smart guy. I'm no Raymond Chen, but I'm a smart guy nonetheless. I just don't think it should be this difficult. In a day and age where the rough stuff is abstracted away by managed code and garbage collection, someone much smarter than me should have already figured this out and fixed it by now.

    I guess I'll keep trying. Seriously, though, if anyone knows of someone who understands shell programming in C++ (and, hopefully, also knows managed extensions for C++) and would like to fix this thing for a little piece of fame (no fortune, sorry... maybe a six-pack of your favorite beverage?), let me know. You'll be helping the world as we know it.

    Bargain Weekend

    I've had quite a weekend, all on the cheap.

    First, I looked all over town for some cord winders to help manage some of the cables for the controllers on the PS2. I have some, but one broke and I need to replace it - the cords on this thing are unruly. I looked high and low and was about to pay $5 each for them at cableorganizer.com when I found them two for $2.50 at the APC Factory Outlet. I bought four pairs so I won't have to go looking again for a while. I hope. Cost: $15 ($10 for the winders, $5 for shipping).

    Then I went out looking for a new pair of slippers. I come home every day, put on my slippers, then wear the bastards all over - out to get the mail, watering the lawn, barbecuing... it's almost like I just need a floppy, comfortable pair of shoes. What it ends up meaning is that whatever slippers I get, I need them to have a nice, durable sole but still be cushy inside.

    Anyway, I've worn out the insides of the slippers I bought last year and the interior comes out in hanks when you pull your foot out. Unfortunately, slippers are a seasonal item and don't normally come out in stores until late fall/early winter. It happened that Fred Meyer had them in stock, though, and I got some pretty rugged slippers for the bargain price of $16.

    Finally, Sunday (today) was the Corillian Engineering department picnic at the Oregon Zoo. A great lunch, free all-day pass to the zoo, passes to the new HimalAmazon motion simulator ride (hella fun), and passes to a behind the scenes tour of the Alaska Tundra exhibit where we got to see how they take care of the grizzly bears, musk oxen, and wolves. Fun!

    I love looking at the animals at the zoo. My favorites are the polar bears and the giraffes (well, they're all my favorites, but I really like those two). Here's the polar bear, hanging out. (Also available in a 1024 x 768 wallpaper size, if you really like it.)

    Polar Bear at the Oregon Zoo (Click for wallpaper)

    Here's a giraffe, heading over to get some food:

    Giraffe, going for some grub

    I remember when you used to be able to feed the giraffes at the zoo and ride elephants. They don't let you do that anymore. I can see maybe not riding elephants, but come on - I wanna feed giraffes!

    Something I hadn't seen before - a giraffe bending over to get some food off the ground. Quite the contortions it has to do to get down there:

    Giraffe bending down to get food off the ground

    Wait a sec... let's investigate that a little closer, shall we?

    Giraffe nuts!

    That's what I thought.

    So now I have a new mission next time I'm at the zoo: take a picture of the nuts on every animal I visit. Heh.

    Oh, but to tie that all back into the "bargain weekend" theme: It cost me $3.50 to ride the light rail from Hillsboro out to the Zoo and back; and $2.50 for a zoo key (a plastic key that you can put into electronic boxes around the zoo that tell you things about the animals - Jenn and I have a bunch of different ones and get a new one each time we go). Total: $6.

    Thus, for all the cool stuff I got and the fun I had this weekend, it only ended up costing a total of $37, which is a pretty cheap weekend if you really think about it. I'm stoked.

    Thieves

    I got in to work this morning and noticed that overnight someone fucking stole the South Park Timmy doll from my desk.

    I guess up until now I assumed that people around here had a little common fucking courtesy and respect and wouldn't touch shit on other peoples' desks. Now I know that's not the case.

    I'm pissed.

    Does this mean I have to put up a surveillance camera on my cubicle when I leave at night? Jeez. One would hope it wouldn't come down to that. Do I have to take all my stuff off my desk so it doesn't get stolen? What the fuck?!

    Jenn's Birthday and Mr. T

    It's Jenn's birthday today, so happy birthday to her. Woohoo!

    Mr. T - In your pocket!While crusing around the net on my usual rounds, I saw this bad boy. Mr. T in your pocket. It's just crazy enough that I may well have to buy it.

    (I haven't got it yet, but I'm seriously considering.)

    I mean, how can you pass up on the random "I pity the fool!" in the middle of a serious business meeting? Is that not the ultimate icebreaker?

    You, Too, Can Learn 'Reverse'

    This was seen in the parking lot this morning. Apparently this is not uncommon for this particular vehicle:

    I can't figure out reverse

    This person is why many parking lots have signs that say "head-in parking only." Some folks still haven't taken that class on how to park, the advanced stage of which is "how to use reverse in combination with mirrors to ensure you're actually in a parking spot." This is no exception.

    I am ashamed to work at a company where people believe this is okay.

    Silent All These Years

    I've been quiet around here for about a week, but that's just because I've been busy doing stuff I don't remember too well. Don't worry, I'm not neglecting the site.

    I went to a Winter Hawks game this past Friday and, following that, a meet-and-greet with the team. We won, which is really good and I hope is a sign of things to come. I was impressed by a couple of the new guys on the team.

    I don't remember what I did Saturday. I know I worked on painting my upstairs bathroom (which ended up getting finished Sunday, minus some small touch-ups that need to be done). I'm sure it'll come to me later. I know I should have written it down.

    Sunday I was pretty much free so I called a friend of mine I hadn't talked to for a while to try to get together with him... but I just got the voicemail. Instead, I bought Jenn a copy of Burnout 3 for her birthday and we played that.

    I also picked up a copy of the Saturday Night Live: Best of Christopher Walken disc. I'm a huge Christopher Walken fan... but somehow I remember these skits being funnier than they were. Maybe they didn't choose an appropriate "best of," or maybe their idea of "best" differs from mine.

    Yesterday I got the stitches taken out of my side where I had a mole removed a couple of weeks ago. Everything is healing up fine and the mole wasn't cancer, which is good (though I never thought it was... I have a theory this particular doctor, while smart, is trying to make a buck by hypothesizing about cancerous moles).

    My next couple of weekends look to be pretty booked up. There's a company picnic coming up this weekend (here's hoping for good weather), then next weekend there are two birthday parties to go to - my grandfather's 80th and a friend's 30th. Plus the usual housework crap that always waits until the weekend.

    I've got some lawn patches that I may have to deal with soon. I'm thinking it'll involve getting a bag of top soil, cutting "holes" in the lawn, and patching over the fresh top soil. The soil around my house sucks - beneath the sod they laid down when the lawn was put in is a layer of clay, then gravel. Lame. Makes it hard to keep stuff going, let me tell you. We've also got to get some sort of ground cover (barkdust, gravel, etc.) in because the weeds are taking over. We do our best to keep on top of them, Jenn and I, but it's an uphill battle.

    You Can't Just Stop

    I don't know what it was with today. Things just pissed me off. I got my allergy shots and had a reaction (not bad, but enough to be annoying); I got a filling and shelled out the dough for that; on the way to my filling I ran into terrible traffic; and on the way back from my filling I got stuck in the world's worst traffic ever. Like, to the point I almost got out of the car and walked.

    Of course, it's been a while since I've run into a Traffic Asshole, so today was the perfect day for that. Sadly, I didn't have my camera, but the Asshole (white pickup, license BHT 101) decided he was well above the law.

    I let it go when I exited the freeway to get onto a just-as-backed-up side street and he jetted out from behind me to sit in the lane next to me, just in front of my bumper, and signal his way into my lane. I figured I'd be nice - which, in traffic, is against every fiber in my being - and let the guy in.

    He did it the once, and I let it go. Then we got to a left-hand light that turned onto a one-way street - the right lane turned right, the left lane turned left. He decided he was going to turn into the left lane, but he wanted to turn right.

    Rather than accepting he was hosed, he stopped in the middle of the fucking lane and wouldn't let anyone by.

    Let's see a diagram of that.

    Don't stop in the Goddamn lane

    For all you out-of-state people or folks that think this is OK: It's not fucking OK. If it's busy traffic and you accidentally turn into the wrong lane, suck it up and deal with it. Accept the consequences of your stupid actions and just go.

    Oh, and if the guy behind you lays on the horn because you've stopped in the middle of the fucking road, you have absolutely zero right to be pissed off. You're the one fucking up. Accept it, apologize, and drive your Goddamn car. You are, singlehandedly, the reason we have traffic.

    Nail Clippings

    Add one to my [long] list of pet peeves:

    I cannot stand it when people clip their nails at work.

    I'll accept it if you have to fix a hangnail or something, but if you feel the need to deal with your nails at your desk, step back and take a long toke off the reality reefer: No one wants to hear your stupid nails being clipped, nor do they want to step in/sit in/touch the clippings that are no doubt flying all over your cubicle.

    We have restrooms for personal grooming. Better still, try dealing with things like that at home. That clip-clip-clip sound coming over the wall is worse than scraping on a chalkboard. Do something about it.

    Patriotic Art

    I decided this morning that I cannot stand patriotic art.

    There's some sort of local event going on to honor the memories of the people who died in the 9/11 attacks (which I think is fine). Part of that event has a sort of gallery of objects created in memory of these people. The majority of this is what I would call "patriotic art."

    Patriotic art, at least in the US, is probably the most contrived form of attempted emotional manipulation ever. You've all seen this in one form or another in your lives. For US people, patriotic art looks like this:

    Take an airbrush - it's always airbrushed - and draw a bald eagle. Throw a waving US flag in there somewhere - maybe the eagle is carrying it, maybe it's behind the eagle, maybe it's just blowing in the wind. Doesn't matter - just put a flag in there. Now put one or more soldiers/firefighters/police officers in the picture in a position that looks like they're overcoming impossible odds. If you choose soldiers, you have your choice of wars: Revolutionary, WWII, Vietnam, or Desert Storm. Make sure any soldiers you have in the picture are carrying rifles. Now throw some blue sky and the optional "POW/MIA" flag in there and you have patriotic art.

    You can see this crap, larger than life, printed on t-shirts, motor vehicles, or inspirational posters.

    I'm as patriotic as the next guy. I feel bad when tragedy strikes and I'm proud when the citizens of our country rise up together to overcome difficult times. But I can not - nay, will not - stand for this ridiculous form of art anymore. It's not an homage, it's a disgrace. I don't care if you successfully completed the free art test from the correspondence school. This is crap.

    Meetings, Meetings Everywhere

    I have this feeling that I'm not going to get anything done today. I have meetings booked solid on my calendar from 9:00a until noon, then they start again at 1:00p. I might be able to work for a couple of hours this afternoon. Maybe.

    Plus, today should be the last day of this way-too-long project I've been working on. I'm anxious to get off of it because the next project I'm going to be on looks like I'll get some really good stuff done. (Rather than working on a hacked-together prototype, I actually get to put effort in to make production code - a much more satisfying endeavor.)

    VisualMake 3.0

    I got a copy of VisualMake 3.0 from the Xtras.Net Developer Network (which is cool - you should join) and played around with it.

    Hmmm.

    Right now I use NAnt to automate my build processes. It's a pretty flexible tool, and while it does require you script (rather than having some GUI to drag and drop tasks or organize the thing - hey, there's a cool product idea... a real GUI editor for NAnt scripts, but something easier - and cheaper - than NAntpad), it's also pretty accommodating and flexible.

    I was hoping VisualMake might be a good, GUI alternative. If not for corporate/work projects, at least for my home stuff.

    No dice.

    I posted a review on it at Xtras.Net, but the long and the short of it is that VisualMake would be great for some straightforward builds, but it doesn't seem to know Visual C++ projects (.vcproj), nor does it know setup projects (.vdproj). It also can't open web projects via a URL, so you have to manually find those and add them.

    In VisualMake's defense, NAnt doesn't do web projects, either, so it's not like it's missing functionality; I just figure when you're graphically adding a solution (drag and drop) that includes web projects, a good GUI should automatically add them for you... at a minimum, it should determine if the project is on your local machine and start looking in the IIS metabase for the physical location. VisualMake doesn't do that.

    It does have some nice features, and I think for large Windows or console applications, this would be cool. Solutions that have a lot of dependencies and all generate .DLL files. I, unfortunately for VisualMake, don't work in that world. All of my solutions have one or more web projects, a setup project... none of which works well with VisualMake.

    Guess I'll be sticking with NAnt.

    Prototype Quoting

    Looks like I'm getting quoted over at Hanselman's site. Go check out this article on the Laws of Prototypes at Tim Weaver's site and tell me I'm wrong when I say the guy hit the nail on the head. I couldn't have said it better myself.