Thursday, January 18, 2007

Everyone who writes code - Answers

Question:Describe the difference between a Thread and a Process?

Answer:
A program in execution is known as a process.
A process may have a single thread.
A process may have multiple threads. Threads are spawned from a process.
===========================================================
Question:What is a Windows Service and how does its lifecycle differ from a "standard" EXE?

Answer:
The "standard EXE" exits from memory when it is closed.
The Windows Service only exits from memory when the service is stopped.

==============================================================

Question:What is the maximum amount of memory any single process on Windows can address? Is this different than the maximum virtual memory for the system? How would this affect a system design?

Answer:
========================================================
Question:What is the difference between an EXE and a DLL?

Answer:
A DLL is a dynamic link library. When a process loads a DLL, the DLL is loaded into the memory once. When another process makes a call to the same DLL, the DLL is not loaded into memory again.

A EXE is always loaded into memory. Each instance of the EXE is a process. It has its own address space.
============================================================
Question:What is strong-typing versus weak-typing? Which is preferred? Why?

Answer:
When the type of an object is known, then this strongly typed.
example,
Dim i as Integer

When the type of an object is known, then this is weakly typed.
example,
Dim obj as Object

For performance reasons, strong typing is preferred.

But in certain cases, late binding is required, therefore weak typing is necessary
=========================================================

Question:Name at least 3 component containers that ship now with the Windows Server Family.

Answer:
===============================================
Question:What is a PID? How is it useful when troubleshooting a system?
Answer:
PID is Process identification number. This would help to identify the process which causes the problem
=======================================================
Question:How many processes can listen on a single TCP/IP port?
Answer:
===================================================
Question:What is the GAC? What problem does it solve?
Answer:GAC is the Global Assembly Cache. If a number of applications use the same DLL, the DLLs can be installed in the GAC and the applications can use the same DLL. This helps in deplyment issues related with enterprise applications using the same DLL

Singleton design pattern

I have a interest in design patterns. Would be posting several useful links on design patterns . Starting off with the simplest design pattern.

http://msdn2.microsoft.com/en-us/library/ms998426.aspx is a MSDN link on the Singleton Design pattern. This is a very simple design pattern.

This article has an implementation with C#.It uses the lock keyword for mutual exclusion.

What is lock?

The lock keyword marks a statement block as a critical section by obtaining the mutual-exclusion lock for a given object, executing a statement, and then releasing the lock. This statement takes the following form:

Object thisLock = new Object();
lock (thisLock)
{
// Critical code section
}

==============================================================

http://en.wikipedia.org/wiki/Singleton_pattern is the wikipedia link on the Singleton design pattern.

Monday, January 15, 2007

SQL Server Database Publishing wizard

Microsoft has launched a RC1 Database Publishing wizard. This is pretty neat utility.
We can script the database objects ( tables , SPS,UDFs and others ) and also the DATA of the database. The DATA part of the scripting was particularly new.
http://www.codeplex.com/sqlhost/Wiki/View.aspx?title=Database%20Publishing%20Wizard
has the free download.

Tuesday, January 02, 2007

ASPNet account and SQL Server

If you use Integrated Security = True in the DB connection string for a website, make sure that the machine's ASPNET account( machine name\aspnet account ) has access to the database.

Very simple information but effective at times.
Adda is the Bengali for discussion.Bengali is a language like English.