Wednesday, July 04, 2007 #

List of files checked out - Team System

Discovered this useful script today

Open Visual Studio 2005 command prompt and enter the script below to get all files checked out by all users

tf status /s:teamserver /u:*

To do more check out the tf status documentation

Posted On Wednesday, July 04, 2007 5:03 AM | Feedback (0)

Sunday, December 18, 2005 #

Overflowing with unread messages? Try SNARF

Check out this research tool from Microsoft if you use MS Outlook

Posted On Sunday, December 18, 2005 2:22 PM | Feedback (0)

Pandora

Pandora is a very cool music discovery service that helps you find the music you'll love.

Posted On Sunday, December 18, 2005 2:19 PM | Feedback (0)

Thursday, November 17, 2005 #

Visual Studio Add-Ins

James Avery who had earliar written about Ten Must-Have Tools Every Developer Should Download Now has now published an article about Visual Studio Add-Ins Every Developer Should Download Now.

There are all free to use!

Posted On Thursday, November 17, 2005 10:20 PM | Feedback (0)

Wednesday, November 09, 2005 #

Content Management Server 2002 Service Pack 2 (SP2)

Microsoft Content Management Server 2002 Service Pack 2 is now available to download from here.

http://www.microsoft.com/downloads/details.aspx?FamilyID=3de1e8f0-d660-4a2b-8b14-0fce961e56fb&DisplayLang=en

SP2 provides:

Support for ASP.NET 2.0 (.NET Framework 2.0)
Support for Visual Studio 2005
Support for SQL 2005
Support for running on 64-bit machines in 32-bit emulation mode

Posted On Wednesday, November 09, 2005 7:30 AM | Feedback (0)

Tuesday, November 01, 2005 #

VS 2005 and Hello World Generics

Installed VS 2005 last night. It went pretty smooth. If you have something like Microsoft Anti Spyware installed, you might want to turn it off during the install. ie if you are not going to be in front of the computer during the process. It pops up a few times asking you to allow/block certain processes. A single reboot at the end and I was ready to write my first program:

using System;

namespace AnswerToEverything
{

    public class Universe<T>
    {
        public void Show(T t)
        {
            Console.WriteLine(t);
        }
    }  
 
    class Program
    {
        static void Main()
        {
            Universe<string> hello = new Universe<string>();
            hello.Show("Hello World");

            Universe<int> answer = new Universe<int>();
            answer.Show(42);

            Console.ReadLine();

        }
    }
}

Posted On Tuesday, November 01, 2005 5:52 AM | Feedback (1)

Notepad or not

I'm currently evaluating different source code editors trying to find the one most suitable for me as a notepad replacement. Some of the features I'm looking for are:

Something that loads as quickly as notepad
Regular Expression Find
Syntax Highlighting
Find in Files/Folders/Subfolders
Explorer Bar
Multi-tab
Compare 2 files
Column Mode Select
Free preferably!!!, but not necessary

Here are a few I've dug out.


Crimson Editor

Textpad

JEdit

Ultraedit

Editpad

PSPad

Notepad2

Notepad++

Any other recommendations? What do people think is the best out there?

Posted On Tuesday, November 01, 2005 5:41 AM | Feedback (3)

Tuesday, October 25, 2005 #

PDC 2005 Sessions Online

The PDC05 Sessions are online for 6 months here

Posted On Tuesday, October 25, 2005 2:07 PM | Feedback (1)

Monday, October 17, 2005 #

UK Ready Launch 2005

Another good reason to attend the UK Launch event.

Posted On Monday, October 17, 2005 1:37 PM | Feedback (0)

Sunday, October 16, 2005 #

Developer Developer Developer

See you there.

Posted On Sunday, October 16, 2005 9:40 PM | Feedback (0)

Thursday, October 06, 2005 #

Singleton Pattern

The Singleton Pattern ensures a class has only one instance, and provides a global point of access to it. There are many objects we only need one of: thread pools, caches, objects that handle common settings, objects used for logging, objects that act as device drivers etc. In this case we take a class and let it manage a single instance of itself. We then prevent any other class from creating a new instance on its own and we provide a global access point to the instance.

Here is a simple example of the Single Pattern. A class that always provides a single connection to a database.

using System;
using System.Data.SqlClient;

namespace Vivek.Generic
{
public class SingletonConnection
{

#region -- private variables --
private volatile static SingletonConnection uniqueInstance;
private static object syncRoot = new Object();
private static string strConnectionString;
private SqlConnection sqlConnection;
#endregion

#region -- public properties --
public static string ConnectionString
{
get { return strConnectionString; }
set { strConnectionString = value; }
}
public SqlConnection SqlConnection
{
get { return sqlConnection; }
}
#endregion

#region -- private constructor --
private SingletonConnection()
{
sqlConnection = new SqlConnection(strConnectionString);
}
#endregion

#region -- Get Single Instance --
public static SingletonConnection GetInstance()
{
if(uniqueInstance == null)
{
lock (syncRoot)
{
if(uniqueInstance == null)
{
uniqueInstance = new SingletonConnection();
}
}
}
return uniqueInstance;
}
#endregion

}
}


Note:

To deal with multithreading we use the volatile and lock keywords.

The volatile modifier is used for a field that is accessed by multiple threads. Using the volatile modifier ensures that one thread retrieves the most up-to-date value written by another thread.

lock ensures that one thread does not enter a critical section while another thread is in the critical section of code. If another thread attempts to enter a locked code, it will wait (block) until the object is released.



And our class can be used like this...

...
SingletonConnection.ConnectionString = "Data Source=Vivek;Initial Catalog=Northwind;Integrated Security=SSPI;";
SingletonConnection singleConnection = SingletonConnection.GetInstance();
SqlConnection sqlConn = singleConnection.SqlConnection;
...

Posted On Thursday, October 06, 2005 3:46 PM | Feedback (4)

.NET Command Prompt Everytime

A useful tip posted by Steven Swafford

Just copy and paste the following into your text editor and save as a .reg file. Double click the file and now you have access to the VS.NET tools from any command window.

Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor]"AutoRun"="\"%VS71COMNTOOLS%vsvars32.bat\""

Posted On Thursday, October 06, 2005 3:42 PM | Feedback (0)

Review your code using MSIL Disassembler

Ildasm.exe can be a useful tool to review your assembly. It is located in the \Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\bin folder. Here are a couple of things you can do with it.

1) Search for hard-coded strings in your code:

Ildasm.exe yourcomponent.dll /text findstr ldstr

2) Identify locations that might have boxing overhead:

Ildasm.exe yourcomponent.dll /text findstr box
Ildasm.exe yourcomponent.dll /text findstr unbox

Posted On Thursday, October 06, 2005 3:40 PM | Feedback (0)