Archive for April, 2010

Weighted Random Number

Monday, April 26th, 2010

If you are new to JavaScript, the method to get a random number may be difficult to grasp. The built-in function Math.random() does not accept any arguments, and it returns a decimal between 0 (inclusive) and 1 (exclusive). Most often, we want a whole number, maybe to be used for accessing a random element in an array. Consequently, random generators usually have to be custom coded. But what if we want to get a more weighted distribution of random numbers? Say of a random number between 1-5 we want 1 to show more often than 5? Even if you are not new to JavaScript, determining the math to add a weight to a random result can be quite tricky.

(more…)

IE6 – The Kryptonite of Developers

Friday, April 23rd, 2010

The credit for this pic goes entirely to SmashingMagazine, but I couldn’t resist having this picture posted on the blog, especially a few days after the Big Bang Theory post. Credit also to @notmessenger for showing it to Club AJAX.

Adobe Gives Up

Wednesday, April 21st, 2010

According to ComputerWorld, Apple has made even further moves to prevent Flash from appearing on the iPhone or iPad:

Apple changed the language of its newest iPhone software developers kit (SDK) license to ban developers from using cross-platform compilers, tools that let them write in one framework, say JavaScript or .Net, and then recompile it in native code for another platform, like the iPhone.

(more…)

Fixing the JavaScript Console

Monday, April 19th, 2010


Firebug, the massively successful Firefox addon is an awesome development tool, but it’s not perfect. Carelessness in using it can lead to irritating and even embarrasing errors. And the console built into Internet Explorer 8? It’s great that web developers finally have something to help us develop on IE, but it is still pretty lame. When you consider working with both of them both together, you have even more problems. In general, it’s very undesirable to have debugging code cause bugs. Fortunately, there’s a very simple way of virtually eliminating these debugging errors.

(more…)

Big Bang Theory – Best Line of the Year

Thursday, April 15th, 2010

On Monday night’s Big Bang Theory, Sheldon’s nemesis Wil Wheaton returns and their respective teams engage in a bowling match. Upon hearing that Wheaton will be on the other team (as pictured left), Sheldon stands up, faces him and says:

Wil Wheaton…


The Green Goblin to my Spider-man.


The Pope Paul V to my Galileo.


The Internet Explorer to my Firefox.


And there ya go. You were wondering what that picture was doing on the Club AJAX blog, weren’t you?

New Club AJAX Video Series

Tuesday, April 13th, 2010

Last Tuesday’s meeting was a big success. Dion Hinchcliffe was fact filled, enlightening and entertaining as always. After the meeting I personally felt the urge to go back to my company and tell them all the business opportunities that are currently available. We are very proud and very lucky to have had him speak at our group!

If you missed it, do not fear. His presentation is available here (the main one – the other has not been made public). But even better – the video is posted here.

Of course, Club AJAX has posted plenty of videos before, but starting with this one they are now hosted and edited by BetterVideo™. No longer are they stationary camera shots. They are now professional edited and slickly produced! Going by the standards of YUI Theater, the new BetterVideo-produced Club AJAX videos exceed them in quality! Of course the video already had great content thanks to Dion, but now our videos are and will be that much more watchable.

Enjoy!

JavaScript: Private Variables are Evil

Tuesday, April 6th, 2010

One of the more exciting discoveries in JavaScript programming was in 2001 when Douglas Crockford found the ability to create private variables in JavaScript. Granted, this was exciting, and as with any new toy, everybody started using them. Since then, you can’t find a book, tutorial or blog that doesn’t have some kind of “How to!!” showing how to do it. But, despite the excitement, private variables should be used in moderation at best.

(more…)

The iPad – A New Future in Business Begins…

Saturday, April 3rd, 2010

The prediction of the iPad has been around at least since the days of Star Trek. As Captain Kirk explored the final frontier solving intergalactic problems, he ever so effortlessly completed his paperwork. But it’s the future, where there is no paperwork. The yeoman hands Captain Kirk an electronic slate, complete with electronic pen at the top. Kirk signs the log almost subconsciously so he can get back to torpedoing Klingons into space dust.

The iPad - A New Future in Business Begins...

(more…)

NEWS FLASH: No Flash on the iPad!

Friday, April 2nd, 2010

So the iPad hits the stores tomorrow and horror or horrors – it doesn’t support Flash. As an AJAX developer, I’m actually rather happy about this, and from an entertainment point of view, am enjoying the over-the-top barbs that Steve Jobs has thrown at Adobe (not to mention Google). But in all of the uproar over there not being Flash on the iPhone or iPad… has anyone even noticed that there is no Silverlight or JavaFX, not to mention Java? Where’s the love! Not that there hasn’t been enough opinions on why there’s no plugins on the iPhone or iPad, but I do have a few thoughts on the subject.

(more…)

Turns out JavaScript Really is a Toy

Thursday, April 1st, 2010

Bob and I have been studying JavaScript for years, we’ve started this website and user group, and we’ve even gone to conferences to evangelize the language. However, after doing the research for my RIA post, I’ve come to the realization…

JavaScript really is a toy.

(more…)