56 subscribers








Software Development
  |  Technology  |  Science Stuff  |  Travel  |  Golf  |  Entertainment  |  Buddhism  |  Finance and Investing  |  Austin  |  India  |  Diet, Health  |  Petitions, Causes  |  

languages, platforms, Object Oriented observations, C#, OOP Patterns

C#, .NET Exception Handling Best Practices | Posted on by Anuj Varma

The Problem Statement
You have just started working on an existing codebase – an n-Tier project – and noticed that the Exception Handling framework wasn’t as well defined as you would expect. Some specific things that bother you include:

Lack of … Continue reading


Of the many things I miss in the Classic Windows View – the Windows Explorer navigation is one of them. In Windows 7, the navigation pane (the leftmost pane), does not have the same folder as the rightmost pane (the … Continue reading


The Problem Statement
Imagine that you have just built a sophisticated application to work against a SQL Server database. You followed a best-practices approach and separated out your presentation, business logic and data access layer. Your application is service oriented – … Continue reading


New interfaces for implementing Publish-Subscribe in .NET | Posted on by Anuj Varma

You know you are a techie at heart if you find yourself getting excited at the introduction of a couple of new interfaces.
.NET 4.0 introduces IObservable (Publisher) and IObserver (Subscriber). These interfaces were long overdue – for a couple of … Continue reading


ODBC 32 bit drivers on Windows 7 | Posted on by Anuj Varma

When I opened the ODBC control panel (on Windows 7) and started enumerating the built-in database drivers, I got a bit of a shock. Not only were the Microsoft Access drivers missing from the list – so were a bunch … Continue reading


Generating Random Numbers C# | Posted on by Anuj Varma

When tasked with generating Random numbers, some folks use a static method such as that shown below:

Code Snippet

static Random rn = new Random();
static int ReturnNextRandom(int maxIndex)
{
  return rn.Next(maxIndex);
}

 
One of the reasons is that they want to keep the same, common instance … Continue reading


 
The Issue : Visual Studio throws the following compile time error on a project that includes UI controls (either WinForms or ASP.NET controls).

The item was specified more than once in the resources parameter. Duplicate items are not supported by … Continue reading


Swapping without a temp variable | Posted on by Anuj Varma

Everyone is familiar with the basic swap – using a temporary variable
static void RegularSwapUsingTempVariable(ref int a, ref int b)
{
int temp = a;
Continue reading


Symptom
File has already been deleted (from source control and from the filesystem). Yet – the file shows up in the Visual Studio solution (with a yellow warning icon next to it). When one tries to compile, one sees the above … Continue reading


Two easy ways to edit pdfs (free of cost) | Posted on by Anuj Varma

I am still not sure why Adobe (the company) does not offer an online editing tool for editing pdfs. Until they offer something like this, one has to rely on 3rd party vendors who have filled in this gap. My … Continue reading