Sharing my knowledge

Code generation - An easy way

Recently I read about Text Template Transformation Toolkit (T4), I was really amazed by this because I thought only CodeDOM was the only way to generate code.

Text Template Transformation Toolkit (T4) is template based code generation engine which comes with Visual Studio 2008(It is not a framework feature).

This simple example shows how powerful it is -

if you have a string array and you want to generate a strongly typed enum from this.


1) Open up VS 2008 and Create a project.


XUL - Create cross platform application with ease

You want to create simple GUI cross platform application without knowing the high level programming languages like C++, Java, C#~(using mono)? XUL is that answer.

Yes it is possible using XUL, the prerequisites  for this is, knowledge of a declarative programming language(like HTML or XHTML, XAML etc...) and JavaScript.

XUL is basic building block of the Firefox UI and as we know Firefox works in Windows, Linux and MAC.

Actually XUL is a language which run on the XULRunner(Gecko) runtime from Mozilla.

If you really wants see how Firefox created this UI, go the FireFox installation folder. Normally it will be "C:\Program Files\Mozilla Firefox\". Under that installation root folder, find a folder named "chrome". Firefox has packaged the xul files in a zip format and they have renamed it as ".jar". So look for a file "browser.jar" and rename it to zip. Extract it and have a look at "content\browser\browser.xul". This file holds the UI definition for Firefox.

To learn more about XUL, refer these web sites

1. http://www.mozilla.org/projects/xul/
2. http://www.ibm.com/developerworks/web/library/wa-xul1/

ASP.NET AJAX - Passing JSON object from client to server

  1. Part 1- Calling server side methods from client side

Read the Part 1 of this tutorial if you don't know how to call server side methods directly from client side.

In this post, I will explain how to pass data from client to server in JSON format.

Microsoft AJAX client library has built-in methods which helps in serializing and de-serializing JSON. The methods are defined in "Sys.Serialization.JavaScriptSerializer" class. In server side we have "JavaScriptSerializer"that will help you out to do the JSON serialization and de-serialization.


ASP.NET AJAX - Calling server side methods from client side

ASP.net AJAX has got nice bridging between your server side and client side technologies. Using the ASP.net AJAX you can easily call a method in a page. The restriction here is that, the methods your are trying to call should be static and public.

This feature(calling server side static method) is not enabled by default, so you have to manually enable this and it is very very simple; just set the "EnablePageMethods" property of the "ScriptManager" to true like this


Photosynth - Nothing is impossible

Yesterday one of my colleague showed me one of the coolest tool on web - Photosynth

You can share or relive a vacation destination or explore a distant museum or landmark. With nothing more than a digital camera and some inspiration, you can use Photosynth to transform regular digital photos into a three-dimensional, 360-degree experience. Anybody who sees your synth is put right in your shoes, sharing in your experience, with detail, clarity and scope impossible to achieve in conventional photos or videos.

- photosynth.com


Below is one of the synth I liked most, you have to install a plugin to view this

Note: this plugin doesn't support google chrome :(

Silverlight 2 released

Silverlight 2 is out now with new features like rich set of controls, improved Text Rendering capabilities, rich networking support including calling secured(SSL) services etc...

Moreover Microsoft is partnered with Soyatec to sponsor tools for developing Silverlight applications using cross platform Eclipse development platform. eclipse2SL is first of that kind.

eclipse2SL is an open source tools integrated with the Eclipse development platform that enable Java developers to use the Eclipse platform to create applications that run on the Microsoft Silverlight runtime platform. Specifically, the project will be an Eclipse plug-in that works with the Eclipse Integrated Development Environment (IDE) and Eclipse Rich Client Platform (RCP) to provide both a Silverlight development environment and greater interoperability between Silverlight and Java, to facilitate the integration of Silverlight-based applications into Java-based web sites and services.