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

Debugging Multithreaded C# Applications

You need:

Debug -> Windows -> Threads.

Note that the Threads Debug window is not available in Visual Studio Express Edition.

Does Python have any place in the .NET programming maelstrom?

Good for prototyping on paper; reasoning things out - especially very complex or mathematical algorithms - good short and clear syntax. Best language for algorithm expression. But for mainstream development, stick to C# (or C++ for specific purposes).

System.Threading.ManualResetEvents

Implement blocking waits

Used to notify one or more threads that an event has occurred.

WaitOne(timespan) - blocks current thread until it receives a signal within the timeout interval.

Resharper and Visual Studio Shortcuts

Find Usages

What's the FASTEST way to do "Find Usages" in Visual Studio?

Shift F12 (Resharper)
Cntrl-K Cntrl-R (Visual Studio shortcut)

MSVC shortcut is quicker. You can type: Cntrl K and Cntrl R, or just Cntrl-K-R (3 keypresses).

Go to next member

Alt-UP, Alt-DOWN (Resharper)

Find Type 

Cntrl-T (Resharper)

Find File or Folder  

Cntrl-Shift-T (Resharper)

Duplicate a Line

Cntrl-D

Tuesday 19 March 2013

IIS 7s Managed Module Architecture

IIS 7 (and above) has its functionality divided into managed modules (a.k.a. assemblies). The assembly can contain .NET code or Win32 code ("native code"). Functionality can be extended by creating custom managed modules.

The Future of ISAPI in IIS version 7.0 and Above

ASP.NET applications now run completely in IIS 7.0 without using ISAPI extensions that run in an "ISAPI process" - although this is still supported when running a web application  in "Classic Mode" (rather than "integrated pipeline" mode). "Classic Mode" can be used for compatibility with older applications.

Good Books to learn Microsoft Web Technology

"ASP in a Nutshell" (published in 2000 by O'Reilly) is a good introduction to the "pre-.NET" web programming era. Certainly it is worth reading just to know the concepts that led to more fancy ASP.NET and all the other technologies that followed.

"Professional IIS 7.0" (published in 2008 by Wrox) is an awesome introduction to the new features in IIS 7.0 and what sets this ground-up rewrite apart from previous versions of Microsoft's flagship web server product.

Building Better IIS Servers using ISAPI Filters

What are they used for?

ISAPI Filters are simply DLLs (ISAPI stands for Internet Server API - Microsoft's answer to CGI applications).

How are they written?

ISAPI Filters are used to modify and expand the functionality of IIS. Both ISAPI filters and extensions are developed in C++.

How do they work?

Suppose you have an HTTP transaction between the browser and IIS. Several events may be generated in this process. Some of the these events may be subscribed to by "filters". Filters will be applied in the order of priority. If the event relates to the filter, IIS knows that it has to invoke the HttpFilterProc entry point. The filter can then do some custom processing.

Notable Examples

ASP technology is implemented as an ISAPI filter (DLL that gets loaded up into the same memory space as IIS).

Related Tangent: What EXACTLY do we mean by CGI? CGI stands for Common Gateway Interface. It's a method for for web server software to delegate generation of web content to executable files. A variation called FastCGI is implemented by a number of web servers such as Apache, Cherokee and IIS.

Saturday 16 March 2013

BITS, BFE and other "Standard" Windows Services

BITS is a Windows service, that stands for Background Intelligent Transfer Service. This helps to transfer files in the background using idle network bandwidth. It is used by Windows update and Internet Explorer.

BFE is the Base Filtering Engine which manages firewall and IPsec (Internet Protocol security) policies. Stopping or disabling the BFE service will significantly reduce system security.

Related Tangent: What is IPsec? It's a suite of protocols for authenticating and encrypting information at the IP packet level. Developed in conjunction with IPv6. Its major application is in Virtual Private Networks.

IIS_WPG Group

The IIS_WPG user group is new in IIS 6.0. This provides the minimum set of privileges and permissions needed to start a worker process on a web server.

If a worker process is not in the IIS_WPG group, or have the equivalent permissions, that process will not start.

Tuesday 12 March 2013

NTFS Debunked

It's been a while since Windows Joe talked about NTFS. Today, "Win-Joe" debunks the complex jargon surrounding this file system technology.

The NTFS technology was preceded by a system called FAT (File Allocation Table).

You need this to understand output from CHKDSK (outputs file system integrity status).

USN JOURNAL

Update Sequence Number Journal.  Records changes on NTFS volumes.

The above must be explained. NTFS is a journaling file system which means changes are recorded in a journal (typically a circular log in a dedicated area of the file system).

Sunday 10 March 2013

Chemical Processes as Analogies for Software Design

We analyse two physical/chemical processes as useful idiomatic templates for programming.

Decanting
Filtration e.g. filter paper -> semi-permeable membrane placed perpendicular to liquid or air flow.  Tea bags are also filters.