Archive for June, 2009

Advanced JavaScript Resources

JavaScript, being so simple to learn & use is one programming language which is not always given its proper due. I think the main reason for this is that most people who tries to undermine the language are greatly fooled by it’s simplicity. Although, it has its fare share of shortcomings but the kind of things it can accomplish is pretty amazing.  If you have any doubts, check Can Your Programming Language Do This? at Joel on Software.

There are raging and never ending debates as to whether JavaScript is even a true programming language or whether it is an object-oriented language at all but that’s beside the point.

IMHO, JavaScript does indeed exhibit object-oriented programming language features. As per Yahoo! Answers, there are two models of object orientation. One is based on classes as the templates from which to create objects (instances of classes), and the other relies on prototypes that are already objects and which can be cloned to create new instances. JavaScript (and others) takes the prototype approach.

In any case, today I am here to guide you towards few sources which should go a long way in giving you a good idea about what JavaScript is and what it isn’t. Statutory warning – most of them are of advanced nature :). So, here you go, look at these sources which might quench your thirst for advance level JavaScript:

JavaScript Execution Context, Closure, Eval and “this” Keyword

Javascript Closures

The Magic Eval

Quirksmode JavaScript Tutorials

Scope in JavaScript

Variable Scope for New Programmers

Code Conventions for the JavaScript Programming Language

The JavaScript Programming Language

Douglas Crockford: JavaScript Doesn’t Suck

JavaScript as a Functional Language

Functional JavaScript – Harnessing the power of the Function Object

Yahoo! User Interface Blog has these excellent resources:

Douglas Crockford, a senior JavaScript Architect at Yahoo! and introducer of JavaScript Object Notation (JSON) to the world, whose  JavaScript: The World’s Most Misunderstood Programming Language is a must read, had a go at clearing the common JavaScript misgivings for you folks out there:

YUI Theater: Douglas Crockford, The JavaScript Programming Language

Video: Douglas Crockford, “An Inconvenient API: The Theory of the Dom”

Video: Douglas Crockford, “Advanced JavaScript”

Learning JavaScript Programming Language through Video Lectures

Cricinfo Fantasy Cricket Tips for Twenty20 Worldcup 2009

As many of you might already know, the T20 World cup is just a day away from kick off as tomorrow, June the 5th, is the day when England lock horns with the Netherlands for the curtain raiser of the Twenty20 world cup 2009. As has been blogged previously by me, Cricinfo, as with every cricket tournament being staged at the international stage, is arranging their Fantasy Cricket competition for the same by the name International 20-20. Today I want to provide few tips for those folks out there striving for participating and doing well in the game. I am not an expert with the fantasy game but I have some experience with their earlier fantasy game with a degree of success like IPL et al. My team named ‘May Flower’, by the codename ‘Velvet Flair’, ranked as high as 7th in the world but I came plumetting down to earth at the closing stages of the IPL. But that’s another story! Let’s get down to bullet points now 🙂 Yep, I love bullet points:

1. Don’t be emotional while building your team i.e. don’t hoard your team with players from the country you support instead approach it a degree with impartiality and pure cricketing point of view.

2. Don’t hoard a team of superstars because then you would invariably have to sacrifice the balance of your team for you will then need to take cheap/non-performing players in your team.

3. Do take batsmen who are likely to come up at the top of the order and hence give you good points in return by scoring runs at the top of the order. Otherwise, you run the risk that your batsmen won’t get to bat in every game.

4. Do take batsmen who might score few e.g. 20/30 but score them in quick-time i.e. having a strike rate close to 200 because that way you would get bonus points. On the contrary, if you take regular/proper/orthodox batsmen in your team,  they might end up scoring at run a ball or lower strike rate in which case you will get negative points.

5. Do try to think deeply about the formation of your side. For instance, one might go for having 3 all-rounders and 2 bowlers instead of having 4 bowlers and 2 all-rounders because in a short game like T20 bowlers are likely to go for runs and in the process will reap you ‘negative’ dividends :). The reverse is also true i.e. your batters might get out for a few runs and your bowlers might get lot of wickets. Hence the point is to form a team according to the kind of personnel you have i.e if you have good bowlers in your side go for 4 bowler strategy whereas if you are planning to take good all-rounders go for 4 all-rounders and 2 bowler strategy.

6. Do give the total substitution scenario a great thought because a tournament so short as this, the entire duration of which being only 15 days, will require you to handle your substitutions judiciously. As you might know, there would be 40 substitutions allowed for the entire length of the tournament. Hence, it is imperative that you regularly substitute players wisely to gain the most points for the day. For instance, one might want to pack his/her team with players from England for the opening day so as to maximize the chance of gaining most points and then substitute some non-performing players from that game with Australian/Indian/Bangladeshi/West Indian/New Zealanders as those teams are scheduled to play on the 6th of June, 2009.

Please have a look at this document to gauze the kind of long term planning that one can make in such a tournament with so many substitutions allowed duriong the course of it. Mind you the substitutions allowed until the start of the game tomorrow is ‘unlimited’. Hence, if you haven’t created a team yet do so right now. Otherwise, you won’t get the ‘unlimited transfer benefit’ after tomorrow. I have also changed the ‘Super Eights’ schedule a bit by guessing who are likely to be in the ‘Super Eights’ and are likely to be placed in which group. Please note that before every game, I have written “In = Player1 (Country1), Out = Player2 (Country2)”. That means, I am planning to substitute Player2 with Player1 before the game.  So you get the idea, right? In the document, I am just trying to give you a sense of planning for the tournament. The antipated ‘Super Eights’ schedule might get screwed up but the point is you need to swap in and out players to get maximum points for a given day.

Happy playing!

Weekly Link Roundup – June 03, 2009

.NET 4 Cancellation Framework

A very interesting addition to .NET 4 is a set of new types that specifically assist with building cancellation-aware applications and libraries. The new types enable rich scenarios for convenient and safe cancellation, and help simplify situations that used to be be difficult and error-prone and non-composable.

LINQ to SQL changes in .NET 4.0

Damien Guard of Microsoft’s Data Programmability has posted a rather long list of the changes to LINQ to SQL. While they are still committed to Entity Framework over the long run, this will do much to alleviate the fear LINQ to SQL will be completely neglected in the mean time.

How to create online survey with Google docs

Today I learnt a new way of creating online survey forms but with Google. Yes, Google documents or Google docs, as is popularly known, lets you create online survey forms easily and intuitively. It also provides some analytics/analysis/summary/detail on the survey result. I must admit I am mighty pleased by the simplicity of the same. The word ‘simplicity’ of course is now synonymous with Google as we all know. Hence, I am posting couple of nice walkthroughs for creating the survey yourself. Have a try:

Introduction to Google Forms
How to Create an Online Survey using Google Documents … for FREE