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 like [...]
Filed under: Uncategorized | Leave a Comment
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 [...]
Filed under: Uncategorized | Leave a Comment
Object Graph Retrival DSL ..
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 , for [...]
Filed under: Uncategorized | Leave a Comment
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;
}
});
The above code plugs in a custom selector for matching all the elements which [...]
Filed under: Uncategorized | Leave a Comment
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 object [...]
Filed under: Uncategorized | 1 Comment
Tags: jquery
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 ( http://www.imeem.com/dazhini/music/3IS9giaS/coldplay_yes_chinese_sleep_chant/
Tabla , Citizen of the Planet – Flavors of entanglement Alanis Morissette
( http://www.youtube.com/watch?v=TmnLBPENNys)
Tabla Again [...]
Filed under: Uncategorized | Leave a Comment
Java 5.0 vs C# 3.0 Shootout
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 [...]
Filed under: Uncategorized | Leave a Comment
NHibernate Mapping an Enum
Option 1 : Subclass Enummapping class
But that forces us to create several meaningless little classes just for the sake of mapping and if its always the string name of the enum why go through all that ?
Option 2 : Create a Generic Enum mapping usertype ..which might look like …
public class EnumMappingType : IEnhancedUserType [...]
Filed under: Uncategorized | 2 Comments
This is a cookbook for creating Python extensions in C/C++ under Windows with SWIG, distutils and gcc (MinGW version).
I am using to the following versions
1 . SWIG Version 1.3.24
2 . Python 2.3.4
3.mingw 3.0.0
1. Get and install MinGW gcc
Download the compiler from http://www.mingw.org. This GCC compiler runs under Windows and compiled programs do not require support [...]
Filed under: Uncategorized | 1 Comment
I finally managed to get a 0.1 release out of the door for my breakable toy itunes-importer .
This is a windows only release , I still have to iron out few kinks for the Mac version .
You can choose the providers which get queried and can edit ( or paste your own) [...]
Filed under: Uncategorized | Leave a Comment