Dobkin's Place

Friday, September 15, 2006

Command prompt - Auto complete

There is functionality build in CMD (windows command prompt), which allow to auto complete your folders/files names while you typing, by presing the Tab key.

This functionality should come out of the box with windows XP, without doing any spatial configuration, but for some reason it no always does.
To enable this very helpful functionality, open the registry (run "regedit"), navigate to this path [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor], find those keys and configured them as following
CompletionChar= 9
PathCompletionChar= 9

Enjoy.

Monday, September 04, 2006

Administrate your windows server 2003

At my work I and my team run our web applications in windows 2000, most usable tools for use are: IIS 5.0 and Com+, but we also using performance monitoring and more.
My team leader gave me an assignment to check windows server 2003 for new features and of course verify that all the old functionality remain.

After reading some articles about the matter, and learning about new features of IIS 6.0 and Com+ 1.5, I have realized that Microsoft spent most of their effort in securely and performances. The general idea of the tools is isolate current application from the rest application that running – so if it goes down its wont take any other application with it. For the security matter the idea is run the application with least privileged user, by default.

There is much more to tell about the new features within windows server 2003, and as far as I know the entire previous feature remain.
If you want know more, then there is a book that I really recommending for programing windows server 2003. The book is not all about windows server 2003 and its tools, still there are couples of chapters about IIS6.0 and Com+, which describes all the features of those tools and how to use them, step by step.
There are more chapters about managing those tools via .Net application, which can be helpful for some of use.



Another excellent book about IIS and it's menagment is Microsoft IIS 6 Delta Guide.

Friday, September 01, 2006

Flags Attribute

Introduction:
Some times when you have an Enum, you want to relate each combination of elements as a different value, this functionality can be achieved by represent each element as a multiple by two (1, 2, 4, 8, 16 etc), that way when you connect couple of elements with the binary OR operator ("") each combination get different number.

In case you have such an Enum you cam easily add nice functionality to it, by editing the [Flags] attribute.
Let see in simple example what it does.

[Flags]
public enum Colors
{
Red = 1,
Green = 2,
Blue = 4,
Black = 8,
White = 16,
Purple = 32
}

class MyClass
{
static void Main(string[] args)
{
Colors c = (Colors)17;
Console.WriteLine(
"The Colors are: {0}", c);
}
}

The output of this piece of code would be:
"The Colors are: Red, White"

What this functionality good for?

It can be used as descriptive pattern. A calculated number of the chosen colors can be stored in Database, for instance, and next time when this number would be retrieved, a list of the selected colors names can be display, like shown in the example above.