Monday, July 20, 2009

Nandan tyst with Parliament - Must Read

This is the wonderful article with lots of Satire on Indian Politics.. One with mental age greater than 18 and can vote will enjoy it.

From an INFOSCION to a POLITICION - Nandan's Chronicles - 2
Continuing my tryst with capturing the life and times of Nandan Nilekani in his new avatar as a Cabinet Minister, here is what he had penned after his first day in the Parliament. The last entry stopped when the House was just about to begin. Let’s see what happened thereafter….
The House was in pin drop silence. I was brimming with anticipation and excitement!!!! Manmohan had informed me that my introduction was one of the important points of the agenda. I hoped that I will be able to make my speech properly. After so many interviews and conferences, I was nervous today!!!! After the Speaker indicated that the proceedings of the House could begin, Manmohan formally introduced me to the entire House. He mentioned that as the head of the Unique Identification Authority of India, I was responsible to ensure that each and every Indian had a digital smart card as a proof of his existence.
Manmohan spoke about why I was selected and also some references to the various projects executed by me in Infosys were mentioned. The House listened with rapt attention. I was asked to say a few words and I did exactly the same!!! I thanked the Government of India for having given me this opportunity and I assured the House that I would strive to successfully deliver this project. The Speaker then formally inducted me into the House and before the proceedings could move any forward, there was a small commotion on the other side of the hall.
It was Minister of Textiles(Dayanidhi Maran) who had a comment to make before the next point on the agenda. He made a request that I should be attired in a more austere way instead of a flashy suit. It did not go well with the image of a minister who should live to serve the common man and should be less ostentatious in his habits. I stood up to reply. I offered my apologies to the Honourable Minister and assured that I shall be in a more acceptable dress next time. I felt that he was right. We also used to have corporate dress code in Infosys. So it's here as well!!!!
I sat down and felt somebody nudging me. I turned around and to my surprise; it was the former Indian skipper and one of my favourite batsman Mohd. Azharuddin. I remembered that he had recently won the elections. I smiled at him and mentioned to him that I used to like his game very much, shaking his hand. No Rolex, I noticed. Azhar told me that he would “fix” me an appointment with an Italian designer who had designed his dapper Kurta suit. An Italian designer in Milan doing Kurtas!!!!! I made a note of this and reminded myself to give this example to Friedman for his next book,” The World Markets are flattened”.
Since there was no doubt about the “Fixational” capacities of Azhar, I told him to give me the details and I would consider. The proceedings of the House went on with numerous bills being debated and passed as I sat as a passive audience waiting for my project’s turn to come up. After the lunch break, it was the moment for me!!!!
MY PROJECT”S FIRST REVIEW CAME UP FOR PRESENTATION.
I was at sea. My laptop did not have any reserve power. I went to Manmohan and apprised him of the situation. I was sweating. He calmly replied that this would not be a cause of concern. I was flummoxed!!!! The Speaker asked me to explain to the House on what were my plans for the Unique Identity Project. I replied that I have a plan prepared for 30-60-90-120 days’ milestones and I have presentation to make for which I need a power socket, a projector and a screen. I had no idea what was going to happen after this.
The next couple of minutes were a complete jolt for me. I was completely in a tizzy. Let me just summarize what happened. A Joint Cabinet Secretary Committee was set up to judge the feasibility of my request. The Under Secretaries for the Ministries of Power, IT and Broadcasting will prepare a Viability Report after scrutinizing National Security threats to my request. This was because the power socket comes under Power, laptop comes under IT and projector comes under Broadcasting. I have also been told to reconsider my timelines of 30-60-90 days and start thinking in terms of years. Probably, they are right. I did not have the foresight in this matter.
The summary of the issue is that I need to come up with a more inclusive, democratic, comprehensive long term plan for this project to be executed over the next five years. I have also been given a presentation slot 3 months from now (by which the issues related to the power cord etc will also be resolved). I am filled with mixed reactions. I was planning for a quick resolution; the management wants a strategic solution. I come out of the House and text Murthy.
“You won’t believe it but these guys work just like us. I am on a NATIONAL BENCH for the next three months!!!!!!!!”

Thursday, July 16, 2009

Thanks God Xml was made!!!

Xml is one of the most beautiful things in present scenario where numerous different platform, technologies have to interact with each other. Especially when you are working in Microsoft technology in SAP.
The beauty of Xml is highlighted when we have different technology in place, as this is the simplest sure shot way for interoperability.
Let’s take the example of retrieving data from SAP Backed. SAP has come up with the ESOA which exposes the services to the end user in a standard predefined way.
The underlying principle is same as to any web service, Expose the content in form of XML.
.NET being the one of the most advanced framework dealing with the XML files. Lots of the predefined APIs are there to manipulate the Xml file content and reformat it. The only issue is it should work consistently, that’s something that Microsoft is quite bad at. Remember “If Ferrari run Microsoft joke “
Ok, let’s come at two most basic issues that anybody dealing with Xml files has to worry about.

1. Encoding.
2. Unidentified non supported character.
Following are the solution.
1. Encoding: If you are worried about which encoding should be used, then please stick to Base64. It will save you lots of trouble. Especially when you are working in integration two different technologies (SAP and Microsoft). Base 64 is the most commonly used
2. Unsupported character: This issue has led to some of the most painful moments in life of professional (Me). Though following two solutions are best suited.
1. Remove the character from the source. One easy way keep on the character set for the alphabet and numbers (http://msdn.microsoft.com/en-us/library/60ecse8t(VS.80).aspx). Use this only when you don’t need printable character and also the software is meant to work only in Unicode languages, which usually is the case.
2. Another way which is the complete solution and renders al l the character as is, is to encode the content before sending them to Xml files. As I said, use Base 64 encoding which will convert any character into the form of Alphabets and number, which after passed to xml files can be read back to the original form using the Base64 decoding of the content.
So wondering where the code for implementation is, it depends on the languages and technology you use and I want to keep this article generic.
For specific sample in .NET you can mail me.

Sunday, July 12, 2009

Creating Outlook Add-in! A fine line to walk

Have you ever created an Outlook add-ins and feel that it didn't work some time as expected ?

Read through to get the answers.....

The most common issue is so called "Memory Leak " and there is no obvious reason of why it happens.
To make the matter worse, there is no exception or visible effect in Outlook behaviour, its just some or the other property will not work.
Outlook object should to be respected and treated as pointers...
Though there is not 100% guarantee that it will never happen, but you can reduce the occurance to 90% .
Following thumb rules will always help it to reduce the "Memory Leak" to pittiance.

1. Com object which are initialized should be first relieved of by using System.Runtime.InteropServices.Marshal.FinalReleaseComObject
2. Don't forget to assign those component = nothing (in VB.NET)
3. Following code should also follow
GC.Collect()
GC.WaitForPendingFinalizers()

4. Also if you have added any eventhandler, it must be removed on the event once it is called.
eg. the following add handler
AddHandler CType(objContactItem, Microsoft.Office.Interop.Outlook.ContactItem).Write, AddressOf objContactItem_Write
should be removed when inspector close
RemoveHandler CType(objContactItem, Microsoft.Office.Interop.Outlook.ContactItem).Write, AddressOf objContactItem_Write

Following are the detailed article that must help you ....Search for all aritcle with tag OOM.
http://blogs.msdn.com/mstehle/archive/tags/OOM.NET/default.aspx

If you don't find the solution to the problem you can post me or at the following group.
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.outlook.program_addins