Showing posts from July, 2011

Aberdeen Pavilion

The Aberdeen Pavilion at mid-day, Landsdowne Park, Ottawa.

© 2011 Darren DeRidder.

jQuery, Data-link, Knockout.JS and Microsoft

In may 2010 Microsoft contributed the template and datalink plugins to jQuery. The announcement was made on Scott Guthrie's blog:

On October 4 Scott G, Boris Moore and John Resig all announced these as official jQuery plugins.

One of the comments in Scott's post suggested that his team should be working with Steve Sanderson as well.  Sanderson is the guy behind the Knockout.js templating and data-binding library.…

Marina at Dusk

Sunset over the Nepean Sailing Club, Lac Duschenes, Ottawa

© 2011 Darren De Ridder

Selenium IDE Sideflow Update 1

Once again, for your development pleasure, ladies and gentlemen, the famous Sideflow plugin for Selenium IDE!  Goto and while loops performed in Selenium, before your very eyes.

Some people were having a bit of trouble getting started, so I've updated the demo test for Sideflow (Selenium IDE flow control extension) to use the latest Selenese commands.

What's changed: no more direct access to 'storedVars'.  No more 'getEval'... uses 'runScript' instead.  Need to do some weird casting to perform counter increments.

The github repo is over here.  Everybody git on board the github train!

PS. You can find the original post here.

Spinnaker Set

We pulled off a perfect spinnaker set with a crew of first-time sailors, Canada Day long weekend. The weather couldn't have been more perfect!

Flying the spinnaker is challenging, and doing it with a crew of brand new sailors was interesting.  There's a real art to skippering a boat and helping the crew learn the ropes.  It's definitely taught me a lot about patience and leadership.

A simple introduction to TDD with Expresso in NodeJS

In the last post we made a super simple NodeJS module called hello.js and used it in app.js. We can make it better, and test it with Expresso.

First we can add to the awesomeness of hello.js by adding a farewell function, so it can say both "hello" and "goodbye".

// hello.js var greeting="Hello World!"; var farewell="Goodbye Cruel World!"; var greet = function(){     return greeting; }; var leave = function() {     return farewell; }; exports.greet = greet; exports.leave = leave;
So now our module can say hello, and bid farewell.  It exports the "greet" and "leave" functions, which we can use from app.js like so:

// app.js var hello=require('./lib/hello.js'); console.log(hello.greet()); console.log(hello.leave());
Notice that I moved hello.js into a new directory called "lib", which is why the require statement now says "require('./lib/hello.js')".

Now suppose we want to test this module u…

A simple intro to NodeJS modules

In preparation for an upcoming workshop at Shad Valley on NodeJS, I tried to come up with some simple examples of the CommonJS module system in NodeJS.  Felix Geisendörfer has a similar "hello world" example in his Node.js Beginner Guide.  I've put the main concepts into a short tutorial. We start with one line of Javascript, and turn it into a working NodeJS module.

Assuming you have node installed, you can run "node" from the command line to get the REPL (ie. node shell).

$ node > console.log("Hello World!"); Hello World!
Wonderful. How about putting this in a file?
// hello.js console.log("Hello World!")
Then run:
$ node hello.js Hello World!
Also wonderful. Then, how about making an application that includes hello.js? Let's call it app.js. Here are the two files:

// app.js require('./hello.js');
// hello.js console.log("Hello World!");
Now we can run it like this.
$ node app.js Hello World!
Again wonderful. We…