Does IE precompile Javascript?

What's the difference between these two pieces of code:

dojo.addOnLoad(function() {
    dojo.connect(dijit.byId('mainTabContainer').tablist,
       'onButtonClick', tabClick);
});

and:

dojo.addOnLoad(function() {
    var container = dijit.byId("mainTabContainer");
    dojo.connect(container.tablist, 'onButtonClick', tabClick);
});

Nothing I hear you say? Well, I'd guess that as well. After all, the second simply sets a variable that is then used in the following line exactly as it was in the previous piece of code. Yet Internet Explorer (at least version 7 and 8) doesn't agree. It will fail on the second example.

Now my guess is that it is trying to do a pre-compile, and evaluating the first line at parsing, instead of when the function actually runs (which is after the onLoad event triggers). It certainly thinks that the variable container does not contain an attribute called tablist in the second version, but has no trouble finding it in the first. Now all I can say is WTF!?!

Every other browser treats both pieces of code as identical, yet IE consistently fails.

Freedom to work anywhere

In the modern world you may often see busy people sitting in a cafe or airport lounge checking email or updating their Facebook or Twitter status. Just how far the world has come is of no surprise to those of us who are old hands in the work from anywhere stakes. In the days of MySQL AB (now a part of Sun Microsystems, a wholly owned subsidiary of Oracle Corporation) around 70% of the workforce worked from home. In fact, the title of this piece, Freedom to work anywhere, is a direct steal from a MySQL jobs campaign, and I have several MySQL T-shirts with the slogan on it.

Is it important? You betcha it is. With a solid technology base you can easily have a highly motivated (and highly mobile) workforce that will give you far more in output than you have a right to expect, and at a cost that is dramatically lower than the traditional work environment.

Think about it. What is the cost of office space, a desk, chair, air conditioning, lighting, staff amenities, etc, compared to the cost of an internet connection?

With technologies like OpenVPN, IRC, Skype, Asterisk, and of course all of the Mozilla suite of web tools, you can have a distributed and productive work force that can react quickly to demanding schedules and rapid changes in priorities. Your main web server decides to act up during the night? No problem, chances are your head web dev is online anyway or is in a timezone conducive to tackling the problem.

This technology lowers the barrier of entry for startups, allowing them to compete in a global market from day one without having to build the bricks-and-mortar structures of the past before you can attract staff. I notice that an old colleague of mine has taken this to heart, with whatever he is up to at Empire Avenue. Might be worth keeping an eye on these guys.

You really have to wonder about those companies that don't embrace the Work From Anywhere meme, and are stuck in the mindset that predates the modern communication era. (I was going to say it is 20th century thinking, but my first stint of telecommuting was in the 1980's).

I have done my daily work from a variety of places, and solved problems remotely from Lake Tahoe, heaps of coffee shops, and even more recently at 100km/hr down the Western Hwy (no, I wasn't driving). My employer is happy, and so am I.

Book Review: RED SEAS UNDER RED SKIES - Scott Lynch

Title: RED SEAS UNDER RED SKIES
Publisher: Gollancz
Author: Scott Lynch
Edition released: 2007
ISBN: 978-0-575-07925-0
586 pages
Reviewed by: Adam Donnison

RED SEAS UNDER RED SKIES is book two of the GENTLEMAN BASTARD SEQUENCE, following on from THE LIES OF LOCKE LAMORA.

Locke Lamora is a con-man and thief, the consummate Gentleman Bastard. Teaming up with Jean Tannen again for the ultimate con, against the ultimate gambling house, the Sinspire. Jean is the brawn to Locke's brains, and together they get themselves into (and quite often out of) all manner of trouble.

The set up is coming along quite nicely when Locke and Jean are sidetracked, and forced into piracy with a unique and deadly threat. When you don't know how to sail, nor the difference between a binnacle and a barnacle, you know that things are going to get hairy.

In this almost madcap escapade, Scott Lynch has created a rather fun world where Locke and Jean run rampant. The twists and turns, while sometimes comedic, are always entertaining and there were only one or two places where the pace slowed. All in all a great read and this reviewer will be on the lookout for future Gentleman Bastard Sequence titles.

Vale Gryphon - Goodbye old friend

I had to have my dog, Gryphon, put down tonight. I've mentioned him before in this blog - forgive me if I don't feel like grabbing the URL for you, I'm sure if you are interested you can find it yourself.

Gryphon was a 12 1/2 year old German Shepherd Dog. He was also the most lovable and yet most annoying pet I've had so far. There is nothing like having a full body cuddle with 45kg of dog to make you feel the world is worth living. Well, I had one last cuddle with poor Gryph as the needle went in and he went to sleep, never to wake.

There are no words for how wretched I feel at the moment. I wrestled with the timing of his end, but in the end it was clear that if he couldn't walk two steps without assistance, and the side-effects of the medication were now becoming an issue in their own right, the time was here. As mentioned before, I did not hesitate, no matter how hard it was for me. He didn't deserve to suffer and so I acted.

I'm probably being a bit blunt for some of you who don't like to be confronted with the reality of life, but there is no getting around the facts. Gryphon had a great life and contributed to me having a great life. Such devotion and mutual joy requires reciprocal dedication and strength of resolve when the hard decisions must be made.

So now I need to have a drink or two in Gryphon's honour, and I hope some of you out there will join me.

End Game

My dog, Gryphon, is dying. I guess we all are, but he is a lot closer than I am. It is a hard thing to watch though, and difficult to know when to intervene. Currently he is happy in himself, still wants to play, is eating like a horse, but his back end just doesn't work much any more, and the medication required to keep it in some sort of order has its own problems - so it is a delicate balancing act that is getting harder as time goes by.

One of the worst things is that he has effectively lost control of his bowels. And in a German Shepherd Dog that means a lot of clean up required. I don't sleep a lot these days as I usually have one and sometimes more than one cleanup required overnight. He has only fallen in his own faeces a few times, so he still has some control once he realises it is happening, but even so it is a management problem.

In some respects I wish he'd have gone like my last German Shepherd. Daicos (my father was a Collingwood fan and he named him) one morning whimpered when getting up and went outside to sleep on the concrete - even though it was sub zero temperatures. We got him to the vet who diagnosed haemangiosarcoma, and he was admitted to the vet hospital. He died before the next sunrise. It was a shock, but in hindsight was probably far better than the lingering death the poor Gryph is suffering.

When do you say enough is enough? How do you determine when it his quality of life has reached the point that death is the better choice? It is an awesome responsibility, but one I cannot fail in. If I leave him to suffer unnecessarily because of some twisted self interest, then I have failed in my duty as his pack leader. If I jump too soon then I have condemned him to die before his time. He has been a good friend and companion and I cannot make a mistake if I am to live with the decision.

We have come up with the "couch index". Gryphon loves his couches. He moves from couch to couch throughout the day, picking the one that gives him the best view, warmth or closeness to the rest of the family, depending on his want. Yes, he is spoiled. Don't bother complaining, I don't care what you think. Anyway, we have decided that when he can no longer get onto his couches, even with steps in front, then his quality of life will have hit rock bottom and I have to make a hard decision. With my previous Lhasa Apso, it was the "chicken index", when he would refuse a chicken dinner - we knew it was time. And it was, and I was happy that I'd made the right decision at the right time. I'm not sure it is going to be anywhere near as clear cut with poor Gryph, but while he wants to be around I will try and make his life as comfortable as possible, and as soon as he wants out, I will not hesitate. I will be gutted, but I will not hesitate.

:: Next >>