Sunday, 14 April 2013

The Castle Project

Castle is an umbrella for various open source projects in .NET, the most recognised one being Windsor. It's an IOC container. It also includes nVelocity, a .NET fork of the Velocity template engine.

Tuesday, 9 April 2013

System.dll versus mscorlib.dll

The difference - mscorlib is tightly bound to the CLR whereas System.dll is not. The CLR and mscorlib must be versioned together.

You've got your basic data structures (such as Dictionaries) and threading constructs defined within mscorlib. It's an integral part of the CLR.

Getting Timings in C#: System.Diagnostics.Stopwatch

Use System.Diagnostics.Stopwatch to measure run times.

You can create a Stopwatch amazingly using the StartNew static method that actually returns a Stopwatch object. This also sets the elapsed time property to zero.

When you want to stop the Stopwatch, all you do is call Stop, which tells the Stopwatch to stop measuring elapsed time.

You can get the elapsed time by calling Elapsed which returns a TimeSpan object or ElapsedMilliseconds which returns the milliseconds elapsed as a long data type (which is just "syntactic sugar" for a System.Int64).

Wednesday, 27 March 2013

What is a CLSID?

A CLSID is a globally unique identifier that identifies a COM class object.

Thursday, 21 March 2013

Advanced Resharper

Find implementation of an interface

Cntrl-E-H

ints, shorts and so forth

Saving Space

int - 32 bit
short - 16 bit
ushort - 16 bit unsigned short

Restart a Computer in Remote Desktop

shutdown -r -t 0 -f

-t time to wait
-f force
-r restart