Saturday, November 29, 2008

Common Language Runtime Beginner Series Part 1:-CLR Basics

CLR or Common Language Runtime is a very important part of whole .net Framework and its utter importance is not seen by most of us as it works behind the scenes.This beginner series of my articles will help you to know what actually CLR is in simple terms and what are its basic features.

Remember this is for beginners, or people who are not as much familiar with CLR.

I will try to make this series of articles very simple so that everyone can understand and here and there i will make some simple comparisons so that the fact is understood easily.In simplifying things some facts may sound vague so please pardon me...

  • In earlier days of programming there was no concept of managed code,there was only unmanaged code which means that all the things should be handled by the operating system.
  • The programming languages compiled the programs written in them to the native code specific to the architecture or the CPU.
  • There are many disadvantages of such an approach which we will see one by one in a series of articles.
  • So first of all what is CLR....Actually speaking it can be considered as a small processing unit of its own which when given a Intermediate Language code can produce a native code to be run on that CPU.
  • CLR consists of various parts in which each is a topic of research and discussion and requires an in depth analysis.
  • So the process in which our programs get executed is first of all we have a code in a language it can be VB,C# or C++ now we compile this code using the respective compiler for that language.
  • After this first compilation we receive a IL or Intermediate Language code, now this IL code act as input to the CLR and its Just In Time Compiler chooses the right Model to be executed for compilation for that CPU type.
  • So now the JIT decides according to the CPU type and architecture which mode of compilation it should follow.
  • Now after this decision JIT actually compiles and produces the native code which can be run on that CPU.
  • CLR can be considered as a SandBox environment from which no code can execute outside its given bounds that is the code execution is confined and this is a major advance over the earlier model of program execution.
  • So now you can say that .net can only execute the managed code and there is no need for unmanaged code but this is not true. There are some special cases where  unmanaged code is the best thing till today e.g are device drivers and real time applications where performance is a bottleneck although there are algorithms which will be implemented in future CLR for support of Real Time applications.
  • But .net framework also provides few ways to write unmanaged code which will not use facilities of CLR and execute in an old fashioned way.
  • Both C++ and C# has ways to execute this unmanaged code.
  • When the code is first compiled to an IL we get a .exe or .dll file this is what we call an assembly.
  • Once you ask this assembly to be executed it is loaded into the ApplicationDomain or AppDomain of the CLR.
  • AppDomain of CLR is the region in which a process is running and each assembly can get executed without creating a new process side by side with other assemblies without hampering or affecting their execution.
  • Creating separate processes for execution was a performance intensive task which earlier programming languages used to do.But with CLR this performance lapse is reduced.
  • The other benefit is that this code is compiled only once by the JIT and after that it can be run utilizing full power of the CPU.
  • So the million dollar question is when ultimately the native code is getting generated which is also being generated by other language compilers what's the difference between this native code and the one generated by CLR.
  • So the difference is that CLR places some information within this native code which tells this native code to follow the execution model and remain in bounds confined by the CLR.
  • Earlier unmanaged applications never thought of maximizing the overall throughput,they always used to maximize individual applications throughput but managed code always tries to maximize the overall throughput rather then considering a single process.

So this was the first article of this Series which tells very basic things about the CLR.In future articles we will dig deep into the features provided by the CLR.

Friday, November 28, 2008

Blogger Tips And Tricks:- Opening each link from your new Blogger blog in a new window

If you want your visitors to stay for long on your blog and they should not navigate from your blog even if they are clicking any external links from your blog then this small trick is what you all need.

Opening the links in a new window will allow your visitors to return to your blog once they have read the information in the external link which you provided on your blog.Sometimes readers just simply forget your blogs name while they navigate through and then just don't care to come back again.

So to provide an easy hand to your visitors this trick can be of help.


  1. Just sign in to your blogger and navigate to Layouts Section.
  2. Under layouts just click Edit HTML link.
  3. Remeber to backup your existing template now so that you can rollback if you don't like the changes.

4.Now just search for the </head> section in your blogger template.Remember to edit this template in firefox because it will allow you to search within the template rest all browsers which i have tested only search on the visible content on the page.

5.After you find </head>.Just above it enter this exactly the same way it is given below.

<base target=' &quot;_blank&quot;'/>

Here in my blog the html tags will be replaced by their tags and symbols so i have provide the image below on how you should add this so kindly do it the same way.

Remeber this is tested only for new blogger.I have not tested this myself for old blogger.

That's all now save the template and see the changes now your every link will open up in a new window not in the same window in which  your blog was opened.

If you have any doubts then do leave a comment.

Thursday, November 27, 2008

Google Calendar Sync for Windows Server 2003:-Install Google Calendar Sync on your Windows Server 2003 Systems

If you use Microsoft Outlook as a Desktop Client and want to synchronize your Google Calendar then you need to download and install Google Calendar Sync which can be downloaded here.

How to install this on Windows XP and Vista can be found here on this link

But if you are running Windows Server 2003 then this installer will fail and give an error stating that this can only be installed on Windows XP and Windows Vista operating Systems.


  1. So the solution of this problem is just download a tool by microsoft called Application Verifier.
  2. Install this tool and just go to File ->Add Application.
  3. Now add the Google Calendar Sync.exe to this and just fool the installer to think that it is going to install on Windows XP system.
  4. How to do this is explained here in this article remember it shows the workaround for Photoshop CS3 but you have to open the Google calendar Sync file.

Just copy the below as same given in the above article -   

Major Version --- 5

Minor Version---- 1

Build Number ---  2600

Service Pack Major -- 2

Service Pack Minor -- 1

Now just click save and run the Google Calendar Sync.exe

Now it will just work fine.

If you are getting an error saying that daylight timezone have not been updated either install that update from the link provided and if you are unable to download from there download it from the below link for Windows Server 2003


I have not tested it for Windows Server 2008.Anyone who tested this trick please do leave a comment telling that is it working or not in WS2008.

Sunday, November 23, 2008

FeedBurner only showing 25 feeds for Blogger blogs,How to get all my posts feed in feedburner

Blogger's atom.xml file by default contains only 25 latest posts and when we burn this file with feed burner then only these 25 posts are converted to feedburner feeds, so what if i want all my feeds to be burnt by feed burner and to be availiable as feeds to my subscribers.


  1. So the workaround for this common problem is just go to your blogger homepage and do the View Source
  2. In view source you will find an entry saying .....Atom" href= no/posts/default.Lets assume this no to be 12345678 so you will be having it like this.....Atom" href=" also shown in the figure below.



3.Just copy that URL and add to its end ?max-results=100 so now your final URL will look like

4.You can also replace this max-results =100 by 500 or 50 or by any no which blogger provides.

5.Also there is some limit on feedburner feeds size. its something around 500-550 KB's so keep that also in mind before giving a very large no.

6.That's all go to your feedburner account and add this url  and then burn it now you will see that the no of feeds availiable are the one which you specified as the parameter.

Friday, November 21, 2008

Visual Studio is missing default templates

If your Visual Studio either VS2005 or VS2008 is missing some default tempates, or whenever you want to add any new item and click add new item you are surprise to find that either your add new WebForm is missing or any other similar item is missing from the add new item list then your templates defaults are corrupted due to some reasons or latest updates or patches or any other software which you have recently installed.


So the workaround to this problem is:-

  1. Just go to the Visual Studio command prompt.
  2. Close all opened instances of Visual Studio
  3. Run this command devenv/installvstemplates on Visual Studio Command Prompt.
  4. And thats it all your templates will be set to defaults.

Tuesday, November 18, 2008

Want to transfer your post:- From Blogger to Blogger,Blogger to Wordpress,LiveJournal to Blogger,Blogger To Windows Live Spaces all in all almost every blog.

If you want to transfer your posts from one blogging platform to another and are facing problems , then Paul Cooley has a very good application which he calls "Blog2Blog" which can do this for you very easily.

I have myself tested it for my blogger to blogger transfer and it works just fine.

Also in blogger i was unable to find a safe way to transfer all the posts or selected posts to another blogger account.

But with this tool you can achieve the same easily.

You can download the tool from here:-

Instructions for using the tool

  • Just Click the setup.exe and install the application.
  • Once installed it will open up an interface like this

  • In select source select the blogging platform from which you want to import the posts.
  • Enter your username and password source-URL ex.
  • Then for the source-API-URL especially in blogger if you are using old blogger then the defaults which will be coming will work.
  • But if you are on new blogger then you have to open your blog on the home page and do the view source.
  • In view source you can locate and entry which says "" and there will be a link after that as shown below.

  • Just copy and paste that link to the source-API-URL and this is it your source is set up.
  • Remember that this trick is for new blogger only.
  • Once completed with all the above things just press fetch.

  • After fetching is completed just repeat the same steps for your destination blog also.
  • Once you are done with your destination blog then just click publish.
  • And thats all you will see all the posts being published to your new blog.

Thanks! for this great tool by "Paul Cooley"

Monday, November 17, 2008

C#----When to use As Keyword in C#

  1. As keyword is a hidden treasure in C# which most of us don't use in our day today programming.
  2. As keyword is used for the comparison of compatible types
  3. Its general syntax is expression as type where expression is also a reference type and type is also a reference type.
  4. Whenever there is nothing in the object instead of complaining to user or throwing an exception it just returns "null" thus it doesn't throw an exception.
  5. So when to use as keyword and when to use cast expression is a very important question indeed.
  6. Both have their individual significance.
  7. Whenever you do not want to raise any exception and you have already handled the returned null value condition then it  is wiser to use "As" keyword.
  8. But when you want that whenever the object is null an exception should be raised and you are using exception handling then you always must use the same familier cast expressions.

Given below is a small code snippet to demonstrate that:-

using System;
namespace Ramp.Test
    class Program
        static void Main(string[] args)
            var myObject = new object[3];
            myObject[0] = new Student();
            myObject[1] = new Teacher();
            myObject[2] = "I love C#";

            foreach (object obj in myObject)
                string s = obj as string;
                if (s != null)
                    Console.WriteLine("It is a string");
                    Console.WriteLine("Its not a string");


    public class Student


    public class Teacher




Its not a string 
Its not a string 
Its a string

Wednesday, November 12, 2008

Outlook 2007 Signatures:- Using custon HTML and styles in Signatures in Outlook 2007

Outlook 2007 does not give the facility to put the custom HTML and styling in Signatures under the signatures box.

As you can see that by default when you edit your signatures you only have Delete New Save Rename Options.

And also a few options to insert image and some hyperlink but no support for any kind of custom editing of HTML and styles.

So what to do if you want to enter some custom HTML and do some styling to your signatures while using Outlook 2007.

Here is the workaround.


Just Navigate to your "C:\Documents and Settings\(your_username)\Application Data\Microsoft\Signatures".

Here Search for the htm file which will generally be starting with you Name.

Open this file in Notepad , Notepad++ and add whatever custom content you want to add.

Click Save and you are done.

Open your Outlook Signatures Box to see that changes made by you are reflected or not.

Send a mail to your another account to check whether your custom signatures are working or not.

Sunday, November 09, 2008

Adding LinkedIn Button To Blogger or Wordpress or any other Blog

Today i was trying to add a "LinkedIn" to my linked in profile button on Blogger.But it was not so easy.

You can directly embed the HTML and get the linked in image link if you want but for me it didn't workde.Then i came to know that the linked in people themselves provide custom buttons that you can add anywhere either to your blog or your websites.

But these custom button service is rather hidden ie not visible at the first sight.So i thought that it would be helpful if i share this post with you all.

Below i have given detailed description with images on how to add this linked in button to your blog.


  1. Just go to

2.Sign into your profile

    3.Goto public profile and click the edit button next to your public profile
                      4.Click on promote your profile add custom buttons link

                          5. Now you can see a lot of buttons and their respective code which you can directly paste into your blog.

                          Thursday, November 06, 2008

                          JQuery with and Visual Studio 2008 intellisense

                          Here is a small post on Jquery which is a far better alternative to Aspnet Ajax.Its a small JavaScript library with immense power and most widely used these days.A few months ago Microsoft announced that they will be shipping JQuery with Next Release of their Visual Studio i.e Visual Studio 2010.

                          Visual Studio 2010 and .net framework 4.0 Community Technology Preview are already available  for download from


                          I am not sure about the intellisense support for JQuery and JavaScript in this new version but as Microsoft Promised they will surely ship it in their final release.

                          As for now with Visual Studio 2008 full intellisense for JQuery is achieved using a .vsdoc.js file.


                          Steps to follow to get full intellisense

                          1. Install this Hotfix which will fix many issues for Visual Studio Team Systems 2008 and also enable and enhance you script intellisense if somehow it is disabled or its not coming with many other fixes.

                            Download Link :-

                          2. Jeff King has a very good post describing the second step here.


                          Here a hack is applied so there two files are given one is "jquery-1.2.6.js" another is "jquery-1.2.6-vsdoc.js".So the first file is the actual Jquery file which should be downloaded on the clients browser along with the markup whereas second file should only be available while using intellisense inside the Visual Studio 2008.The markup comments shown above are achieving the same thing.

                          A very simple Visual Studio Solution is attached at the end of this post for you to see the architecture of how to include jquery files and how to do very basic things using Jquery in an aspx page having basic markup as HTML.

                          After following these steps you are now ready to start Jquery development in

                          Download Source Code Here :-


                          Monday, November 03, 2008

                          Configuring Windows Live Writer for Community Server Blogs

                          RJ Dudley has done a very good post on how to Configure Windows Live Writer for Community Server Blogs.

                          If you want to blog on community server then this post might be of great help


                          Sunday, November 02, 2008

                          Opening Sharepoint Sites in Firefox:-Firefox always asks for credentials

                          If you are working on Sharepoint and your sharepoint sites always asks for credentials in Firefox then there are two workarounds which you can do.There can be others but the below mentioned two workarounds are most efficient.

                          1.Using IE Tabs plugin in Mozilla Firefox

                          You can download IE Tabs plugin from here

                          This plugin will simulate the behaviour of Internet Explorer Tabs inside Mozilla Firefox.And if your sharepoint site is correctly configured to run in IE then after opening it with IE Tab it will work fine in Mozilla Firefox also.


                          2.Change the network.automatic-ntlm-auth.trusted-uris entry in the about:config in Firefox

                          Just go to the address bar in firefox and type about:config.Now a configuration file will be opened for you, now here search for the entry named as "network.automatic-ntlm-auth.trusted-uris"

                          Double click this entry and enter the name of your webserver or the server for which you want firefox to inherit the ntlm credentials.

                          If you are working locally and have configured your Sharepoint Server also locally then generally adding localhost,Your computer name will do.You can enter comma separated lists for all the sites for which you want firefox to inherit automatic NTLM credentials.

                          After this step just press ok and refresh your page you will find that now your sharepoint sites can run equally well in firefox also.


                          If you are facing the same problems in IE 7 then you can read this article to fix the problems


                          Saturday, November 01, 2008

                          Definition of Success

                          1. Success can be in two sense one is in which a person thinks he is successfull and other is in which his surrounding think him to be successful.
                          2. As far as the first one is concerned a person can think himself successfull whenever he thinks he has reached his desired level of satisfaction from his life.
                          3. Your stimulus or surrounding thinks you successful only when you have crossed a pre-defined limit kept by the stimulus,surroundings or your society.
                          4. Zenith of success is achieved only when you and your surroundings both think you to be successful

                          Live Activity Feed,Tag Cloud For your Blog on Blogger

                          If you always wanted to have a live activity feed for your blog on blogger then you must check out cool widgets from WowZio


                          Just Say Create my widget now.

                          On the creation page enter your feed url or simply your blog url.It will automatically get posts from your Blog and then just click create my widgets.

                          It will create many widgets for you but my favourite are Live Activity Feed and Tag Cloud.


                          I am using same widgets in my Blogger blog also.

                          The integration is very easy there is a link called add to blogger whenever you choose a widget.