Hi There!
I have moved my blog to http://lalitkale.wordpress.com.
Since I did not like the old version of blogger much and found that wordpress is more suitable for me.
Archive for September, 2007
Moved my blog
Posted by lalitkale on September 20, 2007
Posted in Mind Ramblings | Tagged: blogger, wordpress | Leave a Comment »
Code Monkey that’s what we are!
Posted by lalitkale on September 15, 2007
Thanks Jo for this lovely song!!
Code Monkey get up get coffee
Code Monkey go to job
Code Monkey have boring meeting
With boring manager Rob
Rob say Code Monkey very dilligent
But his output stink
His code not “functional” or “elegant”
What do Code Monkey think?
Code Monkey think maybe manager want to write god damned login page himself
Code Monkey not say it out loud
Code Monkey not crazy, just proud
Code Monkey like Fritos
Code Monkey like Tab and Mountain Dew
Code Monkey very simple man
With big warm fuzzy secret heart:
Code Monkey like you
Code Monkey hang around at front desk
Tell you sweater look nice
Code Monkey offer buy you soda
Bring you cup, bring you ice
You say no thank you for the soda cause
Soda make you fat
Anyway you busy with the telephone
No time for chat
Code Monkey have long walk back to cubicle he sit down pretend to work
Code Monkey not thinking so straight
Code Monkey not feeling so great
Code Monkey like Fritos
Code Monkey like Tab and Mountain Dew
Code Monkey very simple man
With big warm fuzzy secret heart:
Code Monkey like you
Code Monkey like you a lot
Code Monkey have every reason
To get out this place
Code Monkey just keep on working
See your soft pretty face
Much rather wake up, eat a coffee cake
Take bath, take nap
This job “fulfilling in creative way”
Such a load of crap
Code Monkey think someday he have everything even pretty girl like you
Code Monkey just waiting for now
Code Monkey say someday, somehow
Code Monkey like Fritos
Code Monkey like Tab and Mountain Dew
Code Monkey very simple man
With big warm fuzzy secret heart:
Code Monkey like you
–Jonathan Coulton
(http://www.jonathancoulton.com)
Oh!! thinking of video!
Your wish is fulfilled ![]()
http://www.youtube.com/watch?v=v4Wy7gRGgeA
You can get mp3 version song for download at following link:
Posted in Technology | 5 Comments »
Object Test Bench (OTB)
Posted by lalitkale on September 13, 2007
Many times in development cycle,we face that for invoking a method in data access layer or business layer we have to run all the project from UI and then debug the method we want.Its just so time consuming if I had many projects under my solution.
There is one quick and easy way to create instances of your project’s objects, invoke methods, and evaluate the results. This way, you shorten the task of coding, debugging and re-coding.
Object Test Bench (OTB) is designed for simple object-level testing.
How-To:
1. Open up your project’s class diagram into class designer.[for this right click on project in solution explorer-> go to properties--> Click on View class diagram]
e.g. Let’s create a demo project called OTB having a single class named “TestClass” which have method called “SayHell()” which accepts the string as a parameter and show the messagebox.
The class diagram for this is as shown

2. In the Class View, right-click the name of the class or struct whose instance you want to create.

3. Click Create Instance to display the public constructors of the class.In the Create Instance dialog box, provide the parameters, and then type the name of the object(instance of your class). The name is not provided by default; you must provide a name.
e.g.: for our OTB project I will name the instance of TestClass as “testClass1″.

4. You can now see the object test bench window and your class instance with various methods as shown below.
e.g.: Now in our demo project,All the methods of “testclass1″ object/instance can be seen as below.

5. You can invoke the desired method of the class instace and debug that method according to various parameters passed to it and observe the results.
To Find more on Object Test Bench:
1. http://msdn2.microsoft.com/en-us/library/s9fwfe71(VS.80).aspx
2. http://msdn2.microsoft.com/en-us/library/k6d9×2fx(VS.80).aspx
Posted in Technology | Leave a Comment »
Use of GhostDoc- Auto commenting tool for C#
Posted by lalitkale on September 12, 2007
Working Smart is the way of new era and it applies to every field of life.
We,as developers are very lazy to comment down our code [personally I feel comments are needed when our code is not self-explanatory].So why not work smart??
GhostDoc comes to rescue us and also provides uniformation to our commenting.
How To:
1. Install GhostDoc Setup as per installation wizard.Please close all instances of visual studio 2005,if it is open.After successful installation,When you will open Visual studio 2005, GhostDoc asks us to assign the shortcut key.We can assign any key that is provided by GhostDoc or go with default combination of [shift] + [ctrl] + D as shown in figure below.

2. After selecting your key combination,Press Assign and GhostDoc will create the configuration for you.So press “create” button on the next screen as shown below.

3. On the next screen of wizard,GhostDoc shows how your GhostDoc is configured in Visual studio 2005.Press “Finish” to complete the configuration process.

4. Now is the interesting part of using GhostDoc as real lifesaver for developer,Just open any of your visual studio project and place your cursor inside any method or event definition.After right clicking you can observe that GhostDoc has appeared in the context menu like shown below:

5. And Now,click on “Document this” menu. BANG! comments for that methods are generated like shown below.You can use the key combination that assigned by you in previous steps.

GhostDoc can be useful for
- Maintaining uniform commenting standard
- Time saver for developers with Maintaining the quality of code.
- With GhostDoc,You can generate the comments for methods,event definitions or properties.
Limitations for GhostDoc:
- GhostDoc will generate useful comments if method names are meaningful.
- GhostDoc does not generate comments for class members or variables or class level comments.
To Find more on GhostDoc:
. http://www.roland-weigelt.de/ghostdoc/
Feel free to get in touch with me for any clarification/suggestion and enjoy Working smart!
Posted in Technology | Tagged: code document, ghostdoc | Leave a Comment »
Fxcop Integration in Visual Studio 2005
Posted by lalitkale on September 4, 2007
I had been searching for this from past few months. I got some solutions over this but following are the best I thought.
1. There is a open source add in available for integration of FxCop in VS 2005 Professional edition.
http://fxcopaddin.tigris.org/
2. It seems to have somewhat maual method but it works:
You can create an external tool to run FxCop and put the output in the Output window. To do this, follow these simple steps:
- Go to Tools -> External Tools
- Click “Add” and fill in the following details
Title: FxCop
Command: C:\Program Files\Microsoft FxCop 1.35\FxCopCmd(.)exe
Arguments: /c /p:”$(SolutionDir)\$(SolutionFileName).fxcop” /consolexsl:”C:\Program Files\Microsoft FxCop 1.35\Xml\VSConsoleOutput.xsl”
Initial Directory: C:\Program Files\Microsoft FxCop 1.35
Check the “Use Output window” checkbox
3. This method is best of the best of all tricks to achive task of Code analysis:
This is almost like the holy grail of static analysis solutions. Everything I have found on the Internet has pretty much said that it wasn’t possible to enable the same type of static analysis that the Visual Studio Team editions have in Visual Studio Professional. In one sense, they are correct. However, it is possible to get 99% of the functionality working.
Disclaimer:
This is neither a supported nor sanctioned solution by Microsoft and involves registry changes as well as additional Microsoft DLLs that are not part of Visual Studio 2005 Professional.
Since I’m not 100% sure on the redistributable concerns of these files, I am not going to make them available as part of this post. I will give step-by-step instructions on how to get this working under the assumption that you already have these files from some other means. All of the files required for this solution are part of Visual Studio Team Edition for Software Developers (and probably part of any of the Team Edition versions).
- Copy the C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\CodeAnalysis folder.
- Copy the C:\Program Files\Microsoft Visual Studio 8\Team Tools\Static Analysis Tools folder.
These folders should be copied to the same locations on your Visual Studio 2005 Professional system. The simplicity of this approach works because the Microsoft.Common.targets file already includes all of the necessary logic to include the Code Analysis targets file if it exists.
Unfortunately, this only gets us half way there. To complete the picture, we need to make some registry changes. The registry changes are what tell Visual Studio to load the Static Analysis Tools package. It is this package that governs the interaction between Visual Studio and the build process.
The easiest way is to copy the following code into Notepad and save it with a .reg extension. Then you can merge the file into the registry.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Packages\{72391CE3-743A-4a55-8927-4217541F6517}]
@=”StanPackage”
“InprocServer32″=”C:\\Program Files\\Microsoft Visual Studio 8\\Team Tools\\Static Analysis Tools\\stanpackage.dll”
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Packages\{72391CE3-743A-4a55-8927-4217541F6517}\SatelliteDll]
@=”"
“DllName”=”StanPackageUI.dll”
“Path”=”C:\\Program Files\\Microsoft Visual Studio 8\\Team Tools\\Static Analysis Tools\\”
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\CLSID\{72391CE3-743A-4a55-8927-4217541F6517}]
@=”StanPackage class”
“InprocServer32″=”C:\\Program Files\\Microsoft Visual Studio 8\\Team Tools\\Static Analysis Tools\\stanpackage.dll”
“ThreadingModel”=”Apartment”
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\CLSID\{960d6d3a-0bd3-4afa-a0a6-31f7f2fe3a8e}]
@=”VCRuleSelectionPage class”
“InprocServer32″=”C:\\Program Files\\Microsoft Visual Studio 8\\Team Tools\\Static Analysis Tools\\stanpackage.dll”
“ThreadingModel”=”Apartment”
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\CLSID\{984ae51a-4b21-44e7-822c-dd5e046893ef}]
@=”VSRuleSelectionPage class”
“InprocServer32″=”C:\\Program Files\\Microsoft Visual Studio 8\\Team Tools\\Static Analysis Tools\\stanpackage.dll”
“ThreadingModel”=”Apartment”
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Services\{dfb40067-f0c3-425f-9936-951a7900a0ac}]
@=”{72391CE3-743A-4a55-8927-4217541F6517}”
“Name”=”SStaticAnalysisService”
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Services\{AEBE2A87-9063-4B11-95C0-14E48CEC4439}]
@=”{72391CE3-743A-4a55-8927-4217541F6517}”
“Name”=”SFxCopLoggerService”
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\EDev]
“StanDir”=”C:\\Program Files\\Microsoft Visual Studio 8\\Team Tools\\Static Analysis Tools\\”
“FxCopDir”=”C:\\Program Files\\Microsoft Visual Studio 8\\Team Tools\\Static Analysis Tools\\FxCop\\”
“CodeAnalysisErrorListViolationLimit”=dword:000000c8
Open Visual Studio (if you had Visual Studio open, you will need to restart it) and you will now have the “Code Analysis” tab in your project properties. The only thing this solution does also provide is the ability to select a message in the error list window and create the supression messages for it.
The next steps…
Now that I have proven to myself (and hopefully to you as well) that this works, I see two follow up steps. The first one is that everyone should start petitioning Microsoft to include this capability in the Visual Studio “Orcas” Professional release. I think it is too important for it to be limited to only the more expensive editions of Visual Studio.
The second step is to recreate the Microsoft DLLs so that we are able to have the same level of integration without worrying about redistribution issues. Hopefully, step one will negate the need for this, but just in case it doesn’t a backup plan is always useful.
References:
1. http://fxcopaddin.tigris.org/
2. http://www.codeproject.com/dotnet/FxCopIntegrateVSNET.asp
3. http://geekswithblogs.net/sdorman/archive/2007/02/18/106630.aspx
Note: This post’s contains are collected by the resources mentioned above and does not belong to me.
Posted in Technology | Leave a Comment »



