AddThis javascript error: addthis_efrom is not defined

Tuesday, May 19th, 2009

So all of a sudden, the AddThis button starts giving a mysterious javascript error on all of our CFS Website Service sites. It went from working perfectly to throwing an error, without any change to any of our code. When I would mouseover the AddThis button, firebug would display the following error: “addthis_efrom is not defined”. So I poked into the AddThis javascript code and found the particular line that was giving the problem:

s += efr("at_from",
          w.lang(al,8),
          _117,
          0,
          (addthis_do_ab||window.dbg?addthis_efrom:"")
         );

If firebug is telling me that addthis_efrom is not defined, then that must mean that window.dbg is defined. There are no other references to addthis_efrom and only one other similar reference to window.dbg in the AddThis code. I assume it’s something they use for debugging and then remove when they push their code live. There’s no definition for window.dbg anywhere in the AddThis code — that I can find. From the looks of the code and the fact that addthis_efrom variable isn’t defined, it appears that they’re no expecting window.dbg to be defined in the live environment.

I start looking through our javascript code — a convaluted pot that has had many fingers in it over the years — and find the culprit. A single line in one of our javascript files:

dbg = function() { return false; }

At some point, someone on our end created a function called dbg. Just so happens that at AddThis used that same variable name. Great. Tons of hassle and wasted time for such a trivial issue. I’m actually quite surprised that AddThis wouldn’t implement at least some manner of namespacing their variables, just to ensure that this kind of issue wouldn’t arise. Aside from maybe that variable name “debug”, I wouldn’t be surprised to find that a lot of people out there are using “dbg”. All that the developers at AddThis needed to do in order to avoid this hassle, would have been to either wrap their dbg variable in an object, to act as a pseudo-namespace, or even something as simple as prefacing their variables, something like: addthis_dbg or even at_dbg. Then again, maybe there is some reason that they chose to use dbg that I’m just unaware of. If nothing else, I’ll give them the benefit of the doubt…

I guess you could flip the coin and say that the onus is on us to namespace our own variables. That just doesn’t sit well with me. AddThis wants us to use their button, so they should be concerned with ensuring that their code won’t conflict with ours in anyway. No one is going to use a third party solution if it breaks their existing code base. At the end of the day, all of our debugging code that uses the dbg() function has to be changed in order to accomodate the AddThis button. Which isn’t much more than stress and hassle for us and our clients.

Digg Costs A lot To Run

Friday, December 19th, 2008

Over at Valleywag.com there’s a link to an interesting Business Week story about Digg’s financial black hole that’s only getting bigger and bigger as the company grows.

Digg’s burn rate is frightening, evening for a company that has received $28.7 million in secured funding. According to Businessweek.com, “Last year the company lost $2.8 million on $4.8 million in revenue, according to Digg financial statements reviewed by BusinessWeek. In the first three quarters of 2008, Digg lost $4 million on $6.4 million in revenue.” That’s a lot of money for a product that could theoretically be maintained by four of five employees and an army of servers or Amazon EC2!

The valuations for Digg, Facebook and many of the other “hot” Web 2.0 properties are a by product of a period of madness. A period of time were anything that required funding was possible and getting access to that funding was a fairly easy process.

A student right out of school with no savings could get a 100% mortgage for a house. A husband and wife with a terrible credit rating could refinance their mortgage and secured debts with a simple phone call. A teenager a concept could could present a pitch to a VC firm equipped with seemingly endless amounts of money and walk away with millions in investment. It was a time where Wall Street and America got drunk together according to President Bush a few months back. That time is gone and the leaders of the Web 2.0 revolution who keep talking about inventing a new business model are going to have to very quickly have to read up on the old business model – making money!

As the recession in the US deepens there will be many web companies closing their doors and turning off their servers and the companies who’ve had ludicrous valuations (and enough funding to keep the doors open for a few years) will inevitably tumble back to reality. After all, investors can only let their money burn for so long before profitabilty usurps nurturing as their number one concern.

Blackberry Typhoon Leaked Shots (We Even Beat The Boy Genius To This One!)

Wednesday, December 10th, 2008

Blackberry Typhoon Head On

Check it out, the first pics of the Blackberry Typhoon! It’s RIM’s next gen device they’re hoping will, along with their currently released Bold and Storm, continue to keep ahead of a surging Apple and a certain piece of of antiquated technology called the “iPhone” in the piping hot smartphone market.

So, hot on the heels of the release of the Storm is the next step up – a juggernaut of technology that can only be described as a “Typhoon.”

Our source tells us that the Typhoon comes with the following features:

- A “print to” message option for archiving of conversations
- Monochromatic LCD screen with support for up to 20 characters (What?! 20 characters, amazing!)
- The triumphant return of two way paging (Q Tip and A Tribe Called Quest must be stoked!)
- Bulk! So that it can be used as a paper weight and so that the user always knows that the Typhoon is in his/her pocket
- Speaking of pockets, did you see that the Typhoon fits in a pocket?!
- A beautiful shade of green (I know it’s only a test model but I really hope RIM keeps this colour on the final version. I’m so over leather, chrome and shiny plastic)
- An alphanumeric keyboard
- Push technology on the Typhoon actually builds your biceps
- Handy On/Off button
- Literally fits in the palm of your hand. The most ergonomic Blackberry yet!

I’ve been told that this beast of a phone will be released on GSM carriers around spring of 2009! Looks like I finally have a replacement for my Blackberry Curve.

Hit the jump for more pics!

(more…)

New Ask.com commercials… creepy.

Wednesday, December 3rd, 2008

What the hell?

Still In Love With Nike Trash Talk

Tuesday, October 28th, 2008

Nike Trash Talk

I’ve been waiting a good while for my current pair of basketball shoes to give out. They’re just about at that point which means I can finally get around to purchasing a pair of these awesome Nike Trash Talk basketball shoes.

Working with Steve Nash, Nike has ingeniously come up with an “environmentally friendly” shoe that features an upper made of pieces of leather and synthetic leather collected from the factory floor, a mid-sole that uses factory scrap foam and an outer-sole that uses a less toxic upper and ground material from outer-sole manufacturing waste.

And to top it all off, these bad boys are only $100. Sold.

iTunes Genius

Thursday, September 11th, 2008

itunes Genius

Imagine a world when, with the press of a button, you are presented the perfect playlist of music that all just flows together.

Oh. Apple already did this? Cool, does it actually work?

Apple’s new iTunes 8 presents a slew of new features including the ability to generate playlists of music that goes together. The website makes it sound so easy:

  1. Select a song
  2. Press the Genius button
  3. A list is generated

Apple wasn’t lying, this is the way it works… but you will need to do some work before you can just “press the Genius button and pow its there”.

I have over 4,000 songs in the iTunes playlist so trust me when I say this process took a while. When you press the Genius button for the first time it asks you to log into the iTunes store. After logging in you are asked to agree to some terms of use. after you sign your life away you get to wait while your playlist is uploaded to iTunes, then while they generate your matches and you download them. It was painful sitting there watching the progress bar inch along at a snails pace. Maybe it was slow because I did this a few hours after iTunes 8 came out. Anyone else find the service slow?

Once you have the Genius list generated the system works just as advertised. Press the button and volia. One thing I do not like is the new side bar that comes with Genius… but this is totally optional so I have nothing to complain about.

Something worth noting is that all the new iPods that support Genius require you to generate the Genius list in iTunes before the feature becomes available. Not a big deal, I was just slightly disappointed with all the waiting. Clearly I’m impatient.

Anyone else find soemthing they really like about the Genius or any other new feature in iTunes 8? The visualizations are pretty sweet.

Congrats Justin Samuel

Tuesday, July 1st, 2008

Our resident server expert Justin Samuel has been Slashdotted!

Justin has just released the findings from a top secret research project he’s been involved with for the past year with a team of dedicated Nerds at The University of Arizona. Their findings have uncovered some flaws in the current Linux/Unix package distribution method which could lead to a compromised server or even worse.

Check out the paper here.