//Cloud notes from my desk -Maheshk

"Fortunate are those who take the first steps.” ― Paulo Coelho

WinFX Beta 2 is Released

Today MS released new Version of

(1) Windows Vista Beta 2,

 (2) Longhorn Server Beta 2,

 (3) Office 2007 Beta 2

(4) WinFX Beta 2.

 You can download WinFX Beta 2 here



2006-05-25 Posted by | WinFX | Leave a comment

String to Int and Int to Stri- without using builtin library

Hi all,

            Interestingly this is going to be big post on normal datatype conversion but without using any BUILTIN FUNCTION OR LIBRARIES in .NET.


Yes, When we need to convert int-> string or vice versa…we used to use toString(), Parse, ConvertTo. .etc..functions to do this task. But I had this doubt when I was going through MS Interview questions. Yes, In Microsoft, they’ve asked this type of questions .. to test the basic knowledge of core programming….but I ‘ve taken 4 days(part time) to comeout with solutions for this after discussing with my colleagues( Jayveer & Vaibhav).

I’m sure about it technicallity or the way I’ve coded..but not sure about the possibility of doing the same in any other way. If you know something about hardcore conversion or links pls leave it in comment..


//Issue Topic: DataType conversion in C# ( How compiler/inbuilt function doing the same…? )

// To convert to data type without using any inbuily function provided by the Framework

//Logic : Compiler Level

//Language used : C#

// CODE Written By : Mahesh

// Courtesy : XOR Algorithm / Idea by  :mladenp

// For String reversing…http://weblogs.sqlteam.com/mladenp/archive/2006/03/19/9350.aspx?Pending=true


/////////////////////////// STRING -> INT/////////////////////////////////////////

using System;

namespace Mystring


    class Program


        static void Main(string[] args)


            # region STRING -> INT

            string strInput = "300";

            int intOutput = 0;

            for (int i = 0; i < strInput.Length; i++)


                intOutput = intOutput * 10;

                intOutput = intOutput + strInput[i] – 48;


            Console.WriteLine("Input is string ->300 and ouput is Integer->" + intOutput.ToString()); 


            # endregion

/////////////////////////// INT -> STRING/////////////////////////////////////////

            # region INT -> STRING

            int intIndex = 1;

            int intInput = 23456;

            string strResult = "";

            while (intIndex > 0)


                if (intInput == 0)


                intIndex = intInput % 10;

                intInput = intInput / 10;

                strResult += intIndex;



      //Actual string reverse is happening here

            char[] chr = strResult.ToCharArray();

            int intLen = strResult.Length – 1;

            for (int i = 0; i < intLen; i++, intLen–)


                //using XOR – Refer the XOR Table below

                chr[i] ^= chr[intLen];

                chr[intLen] ^= chr[i];

                chr[i] ^= chr[intLen];


            string strRes = new string(chr);

            Console.WriteLine("Input is Int ->23456 and ouput is String->" + strRes);


        # endregion





//XOR table

//1 1    0

//0 0    1

//1 0    1

//0 1    1


Hope I’ve managed to get the conversion successfully...pls let me know I missed out something or anyother logic to the same..and also feel free to drop ur comment about my expedition on this…



mfcmahesh at hotmail.com

2006-05-23 Posted by | My .NET Expedition - Revealed | Leave a comment

Common Errors in English –

I’m immensely enjoying this link..

Nice collections..worth to click it.


2006-05-23 Posted by | Power Toys - Personal | Leave a comment

CodePlex – new MS community to share

What is CodePlex?

      Microsoft started a new community to share, join or start new projects.and is in beta. Projects like the ATLAS Control Toolkit or Commerce Starter Kit are already included in that section.

     CodePlex is an online software development environment for open and shared source developers to create, host and manage projects throughout the project lifecycle. It has been written from the ground up in C# using .NET 2.0 technology with Team Foundation Server on the back end.

CodePlex is open to the public free of charge.


 I read from someone’s blog about this..it is one more GOTDOTNET site from MS for supporitng Community…let wait and see…what you think about this..will it create buzz..?



2006-05-18 Posted by | .NET General | Leave a comment

Diff between & and && , | and ||

Hi all..

Today I had a confusion in using conditional operator. Normally I used to use ‘&&’ or ‘||’ for checking boolean condition. But when I was going through sample…I stumble to see & everwhere…but functionality wise both are ok.

Then what is the diff between these two operators ( & and && ) , (| and || )..


private void Form1_Load(object sender, EventArgs e)


          int val2=10,val3=20;

          bool val1 = false;

         val1 = (val2 != 0) && (val3 / val2 > 2); // always use && ——- case (i)

         val1 = (val2 != 0) & (val3 / val2 > 2); // dont use & ————case (ii)


case(i) If the value of the first operand of the && operator is false, then there is no need to consider the value of the second operand because the result will be false regardless. Similarly, the || operator will return true if its first operand is true, regardless of the value of the second operand.


(ii) In these, both operands will always be evaluated.  


In conditional evaluation of operands, you will see a small performance increase if you use && and || instead of & and |.  As a rule of thumb, always use && and || where possible.


Happy validating..


2006-05-12 Posted by | .NET General | 1 Comment

Free VS Partner Product DVD

Hi all.
Free DVD and receive over 50 tools, components and languages from Visual Studio Industry Partners. These full, trial and and evaluation products can help save you time and money building applications for Microsoft Windows, mobile devices, the Web, and Web services.
To receive your free resource DVD, please click on the appropriate order button for your location.
Cheers !!

2006-05-08 Posted by | .NET General | Leave a comment