An introduction to MongoDB
10 years ago we have had no social network service in such a scale we used to see these days. Facebook, for instance, has got more than 600 million active users who modify their personal profiles, exchange messages, play games and the like every single day. Consider the total committed transactions per second caused […]Continue Reading →
Developing an ASP.NET ColorPicker Server Control using jQuery
As the title implies, today’s post is dedicated to developing a custom ASP.NET server control that lets the user pick up a given color from a predefined color set. Please note that I’m not going to mimic Adobe Photoshop’s color picker, since it’s what jPicker and colorPicker do.
I just wanted a simple, […]Continue Reading →
SQL Server Savepoints
There are some conditions when you need to rollback an implicit or explicit transaction to a given point inside the transaction. There are two ways to address such a need:
1. You can use the T-SQL to address such a problem:
2. Use the SqlTransaction’s Save method within your code. Please note that this method […]Continue Reading →
There are some cases when you need to pass an empty EventArgs to an event handler. I’ve been seeing the following code (which makes me really sick) lately over and over again:
Take a look at MSDN and you’ll see there’s a static read only field named Empty in the EventArgs class […]Continue Reading →
How to suppress the flicker issue in .NET’s ListView?
I’ve been recently asked to explain how to suppress the flicker issue in C#’s ListView. As far as you know if you try to modify the list contents, the background of the control will be redrawn – which is the source of the flickering problem.
To stop this, you need to subclass […]Continue Reading →
The C# counterpart of MFC’s CWaitCursor
For those who are not familiar with MFC, the CWaitCursor class provides a way to show a wait cursor, which is usually displayed as an hourglass, while you’re doing a lengthy operation. There are plenty of ways to modify the pointing device’s cursor under C#, however, the one I’m going to bring up […]
How to open/close a CD tray programatically using C#?
I was recently asked to present how to open/close a CD tray programatically using C#. The Media Control Interface (MCI) is the way to go. According to MSDN, the Media Control Interface (MCI) provides standard commands for playing multimedia devices and recording multimedia resource files. These commands are a generic interface to nearly every kind […]Continue Reading →
Shallow Copy vs Deep Copy
There are two ways to copy an object: Shallow and Deep.
A shallow copy of an object copies all the member variables bit by bit if the member field is a value type. For reference types, the reference is copied but the referred object is not. This means that both the original objects and its […]Continue Reading →
GetHashCode – Does it return unique values for different inputs?
The Object class of the .NET framework has got a virtual method, say, GetHashCode that other classes could override to provide a custom implementation. This function is suitable for use in hashing algorithms like a hash table. The return value [of the default implementation] is and has never been meant to be used as a […]Continue Reading →
Circle up with me on Google+