Posts

Prevent user input for Number / Chars / etc

  Today, I’ve come across of a requirement within a windows application to suppress the user input and allow only integers for a text box. Currently am working with .net framework 4.0 and I use C# as programming language. Before I search the web for any code samples, MSDN is my primary source for understanding the control behavior as well as the different events that are associated. In most cases MSDN would have proper help text and meaningful examples. For my requirement, eliminate user input if it is other than integer, I found a link from MSDN. The given example is inappropriate for eliminating the key input. The given example doesn’t work for you, if your interest is to prevent the user to input anything other than the numbers. I’ve tried and came up with a simple workout for preventing the user to input other than numbers. Here is my code, please comment and revise if it can be more simplified. Step 1: We need a small reusable function as mentioned below. bool IsDigitInput( ...

SVN Repository Migration

Our current employer decided to have the code base as VisualSVN. So we stated a demo server and then after successful trail started a staging server for our project. For the entire March month it worked well, and we decided to have another VisualSVN server as production.  During the last week we have decided to migrate our staging SVN source to production box, but now the problem is about history or revision of the full one month. After binging and googling , I’ve found many alternatives. Most of all, I’ve realized one simple solution and migrated the entire code base from staging to production as simple as cake biting. Problem : Source SVN is at 10.4.5.68 and the repositories are installed at D:\ Target SVN is at 119.18.112.63 and the repositories are installed at E:\ Solution: Step 1: Copy all the project folders from 5.68\d$\repository\<<projectRepositories>> to 112.63\e$\repository\ Step 2: Copy the auth files from 5.68 to 112.63, this would copy all the u...

Why exceptions are expensive

  Many a times, i get to read from lots of places as, “.. don’t use generic exceptions, as they are very expensive .. instead use specific exceptions like devidebyzero .. blah .. blah ..” According to the MSDN Article from this link , it clearly states to use specific exception, but doesn’t give you as why to use specific exception. You can read my comment beneath the article . If you don’t see that, here it is. When you use the catch and cast that as generic exception, it then compares with the following set of exceptions. Which is definitely an unwanted comparison or type conversion with the exact exception that is caught and caused by the code.. Microsoft.Build.BuildEngine..::.InternalLoggerException Microsoft.Build.BuildEngine..::.InvalidProjectFileException Microsoft.Build.BuildEngine..::.InvalidToolsetDefinitionException Microsoft.Build.BuildEngine..::.RemoteErrorException Microsoft.Build.Framework..::.LoggerException Microsoft.JScript..::.CmdLineException Microsoft.JScri...

EntLib 5.0 & Unity 2.0 Release Dates

Image
Am a big favorite of EntLib. I started using this from v1.1 during June 2005. The good thing from the latest version is that they are not adding any more blocks, on top of it they are removing some unwanted code. They are targeting to release this by 14th of April after 2days of VS2010.

Bill Gates started a website

Image
Microsoft’s co-founder, Bill Gates started a new website about his leanings and thoughts that are cooking in his mind. It is really good to know such transparent information from a person like him. Every January, he writes a news letter to all the employees of Microsoft and shares his ideas to them. This year is some thing different. Why only the Microsofties know about him, not the world. From this thought is raised a new concept of sharing via web. Did you see this web, the Gates Notes . It has various sections like, Thinking, Learning, Travel, blah.. blah .. Why don’t you go there and start exploring more about him. BTW don’t forget to convey this to your friends..

Bill Gates started a website

Microsoft’s co-founder, Bill Gates started a new website about his leanings and thoughts that are cooking in his mind. It is really good to know such transparent information from a person like him. Every January, he writes a news letter to all the employees of Microsoft and shares his ideas to them. This year is some thing different. Why only the Microsofties know about him, not the world. From this thought is raised a new concept of sharing via web. Did you see this web, the Gates Notes . It has various sections like, Thinking, Learning, Travel, blah.. blah .. Why don’t you go there and start exploring more about him. BTW don’t forget to convey this to your friends..

MSDN Code Gallery Tags

Image
This link gives you a beautiful access to the code snippets available from MSDN Code Gallery. The way it is designed is great.