Archive for the ‘Uncategorized’ Category

This is what happens when you are reading a great functional programming book , looking at imperative code makes you cry . Here is what I did to console myself out of my grief today ( whatever makes you happy right ? ) The code below wraps google collections , in a thin java DSL […]

In C# 3.0 a lambda expression can be converted into either an expression tree or a delegate ..former of which lets you treat code as data ..this mechanism is source of all the coolness behind linq to sql . But this is doesnt have to be limited to frameworks, You can take advantage of this […]

Often in a query based api’s ( for example  REST based apis )  there is a need for providing a capability for the client to specify the field and depth  while retrieving an object graph .. For example, Windows Live contact Api let you specify Field and Depth Filtering via the query param Filter , […]

A line on code speaks for 1000 lines of  explanation 🙂 .. so here it is jQuery.extend(jQuery.expr[‘:’], { classStartsWith: function(a, i, m){ var classes = $(a).attr(“className”).split(” “) var found = false; for (var i = 0; i < classes.length; i++) { if (classes[i].startsWith(m[3])) { found = true; break; } } return found; } }); [/sourcecode] […]

Client side javascript validation often ends up being  ugly and really boring ..while on the serverside validations usually tend to be more domain related ,something like “order.Qty > 0” on the serverside endsup looking something ugly like “document.get(…….).val()….” I ended up writing a jquery plugin which reads the form inputs and converts it into an […]

I happened to catch up on my “mainstream” listening this week .. so I picked 3 albums and all three of them had *traditional* indian instruments in them.. Sitar , Yes – Viva La Vida , Coldplay ( Tabla , Citizen of the Planet – Flavors of entanglement Alanis Morissette ( Tabla Again […]

Just a fun comparision between C# and Java ..I am obiviously not comparing stuff like LINQ, Lambda expressions which dont have java equivalents Round 1.0 – GENERICS No Type Erasure in C # , new T() anyone ?? Value types like int or Enumeration can be be used as type parameter so MyClass<int> is perfectly […]