Tuesday, December 05, 2006

RegistrySecurity class

Recently, i was going through System.Security.AccessControl namespace and i came across DirectorySecurity class, FileSecurity class and RegsitrySecurity class.

I was really impressed by the RegistrySecurity class. it represents the Represents the Windows access control security for a registry key.A RegistrySecurity object specifies access rights for a registry key, and also specifies how access attempts are audited. Access rights to the registry key are expressed as rules, with each access rule represented by a RegistryAccessRule object. Each auditing rule is represented by a RegistryAuditRule object.

This mirrors the underlying Windows security system, in which each securable object has at most one discretionary access control list (DACL) that controls access to the secured object, and at most one system access control list (SACL) that specifies which access attempts are audited. The DACL and SACL are ordered lists of access control entries (ACE) that specify access and auditing for users and groups. A RegistryAccessRule or RegistryAuditRule object might represent more than one ACE.

Monday, October 30, 2006

How cool is that

Heineken is refreshing its supply chain to ensure its beer doesn't reach parts it shouldn't.

Heineken is to trial a tracking system which will tell it exactly where its beer shipments are, even in the middle of the Atlantic. The brewer has deployed the solution to track ten containers full of beer travelling from the UK and the Netherlands to its distribution centre in the US. The project, which it calls "The Beer Living Lab", uses triangulation techniques of both satellites and cellular base stations to locate exactly where the cargo is. The SOA-based architecture will also allow the creation of distributed data sources, rather than Heineken having to run a large central database.

Tuesday, October 03, 2006

Dynamically calling an unmanaged dll from .NET (C#)

I like to keep collecting small snippets of code in my blog, which i know will be useful later on.
Below is the code snippet for "Dynamically calling an unmanaged dll from .NET (C#)" from Jonathans blog on MSDN blogs:

To start and to refresh our memories, let's create a very basic C++ dll that does very little..... your code should resemble the following (check out my previous post for more info on this):

Header file

extern "C" __declspec(dllexport) int MultiplyByTen(int numberToMultiply);

Source code file

#include "DynamicDLLToCall.h"

int MultiplyByTen(int numberToMultiply)
int returnValue = numberToMultiply * 10;
return returnValue;

As you can probably infer from the function name, an int is passed into this function and it will return the number passed in multiplied by ten. Told you it would be simple.

Now comes the more interesting part, actually calling this dll dynamically from your C# source code. There are two Win32 functions that are going to help us do this:

1) LoadLibrary - returns a handle to the dll in question
2) GetProcAddress - obtain the address of an exported function within the previously loaded dll

The rest is rather simple. We use LoadLibrary and GetProcAddress to get the address of the function within the dll we want to call, and then we use the GetDelegateForFunctionPointer static method within the Marshal class to assign this address to a C# delegate that we define. Take a look at the following C# code:

static class NativeMethods
public static extern IntPtr LoadLibrary(string dllToLoad);

public static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName);

class Program
private delegate int MultiplyByTen(int numberToMultiply);

static void Main(string[] args)
IntPtr pDll = NativeMethods.LoadLibrary(@"PathToYourDll.DLL");
//oh dear, error handling here
//if (pDll == IntPtr.Zero)

IntPtr pAddressOfFunctionToCall = NativeMethods.GetProcAddress(pDll, "MultiplyByTen");
//oh dear, error handling here
//if(pAddressOfFunctionToCall == IntPtr.Zero)

MultiplyByTen multiplyByTen = (MultiplyByTen)Marshal.GetDelegateForFunctionPointer(

int theResult = multiplyByTen(10);

The only item worthy of note is the UnmanagedFunctionPointer attribute, which was introduced to version 2.0 of the .NET framework,

Monday, October 02, 2006

Using Settings in C#

The .NET Framework 2.0 allows to create and access values that are persisted between application execution sessions. These values are called settings. We can use settings by accessing the Properties namespace.

There are two types of settings:
Application Settings
User Settings

Settings have four properties:

Name: The Name property of settings is the name that is used to access the value of the setting at run time.
Type: The Type of the setting is the .NET Framework type that the setting represents. A setting can be of any type. For example, a setting that holds a user preference of color would be a System.Color type.
Scope: The Scope property represents how a setting can be accessed at run time. There are two possible values for the Scope property: Application and User. These will be discussed more in this section.
Value: The Value property represents the value returned when the setting is accessed. The value will be of the type represented by the Type property.

Creating a New Setting at Design Time
You can create a new setting at design time by using the Settings designer. The Settings designer is a familiar grid-style interface that allows you to create new settings and specify properties for those settings. You must specify Name, Type, Scope, and Value for each new setting. Once a setting is created, it can be assessed in code using the mechanisms described later in this article.

To Create a New Setting at Design Time

In Solution Explorer, expand the Properties node of your project.
In Solution Explorer, double-click the .settings file in which you want to add a new setting. The default name for this file is Settings.settings.
In the Settings designer, set the Name, Type, Scope, and Value for your setting. Each row represents a single setting.

Changing the Value of an Existing Setting at Design Time
You can also use the Settings designer to change the value of a pre-existing setting at design time, as described in the following steps:

To Change the Value of an Existing Setting at Design Time

In Solution Explorer, expand the Properties node of your project.
In Solution Explorer, double-click the .settings file in which you want to add a new setting. The default name for this file is Settings.settings.
In the Settings designer, find the setting you want to change and type the new value in the Value column.

Changing the Value of a Setting Between Application Sessions
At times, you might want to change the value of a setting between application sessions after the application has been compiled and deployed. For example, you might want to change a connection string to point to the correct database location. Since design-time tools are not available after the application has been compiled and deployed, you must change the setting value manually in the file.

To Change the Value of a Setting Between Application Sessions

Using Microsoft Notepad or some other text or XML editor, open the .exe.config file associated with your application.
Locate the entry for the setting you want to change. It should look similar to the following example:

This is the setting value

Type a new value for your setting and save the file.
Using Settings at Run Time
Settings are available to the application through code at run time. You can access the value of settings with application scope on a read-only basis, and you can read and write the values of user-scope settings. Settings are available in C# through the Properties namespace.

Reading Settings at Run Time
You can read both application-scope and user-scope settings at run time with the Properties namespace. The Properties namespace exposes all of the default settings for the project by using the Properties.Settings.Default object. When writing code that uses settings, all settings appear in IntelliSense and are strongly typed. Thus, if you have a setting that is of type System.Drawing.Color, for example, you can use it without having to cast it first, as shown in the following example:

this.BackColor = Properties.Settings.Default.myColor;

Saving User Settings at Run Time

Application-scope settings are read only, and can only be changed at design time or by altering the .exe.config file in between application sessions. User-scope settings, however, can be written at run time, just as you would change any property value. The new value persists for the duration of the application session. You can persist changes to user settings between application sessions by calling the Settings.Save method. These settings are saved in the User.config file.

To Write and Persist User Settings at Run Time
Access the user setting and assign it a new value, as shown in the following example:
Properties.Settings.Default.myColor = Color.AliceBlue;

If you want to persist changes to user settings between application sessions, call the Save method, as shown in the following code:

Wednesday, September 20, 2006

Scotland Trip (15/09/2006 - 18/09/2006)

Before I forget let me capture the events and moments:

15: Edinburgh castle,
Hollyrood House, Edinburgh chapel
Authentic Fish and Chips.
16: Old town visit, dads office search, Royal botanical garden, Rosilln village and
chapel(The DaVinci Code Chapel), Authentic scottish beers and excellent food,
nightclub with champs.
17: Muselborough village and beach, John Muir Walk, Dad old house search,
Portobello beach, BenBradley, Champs discussion, Lots of beer.
18: Champs shopping. Mum shopping. Dad calling,I drinking.

Thursday, August 31, 2006

1 year since we finished our Masters Degree

Well its been exactly a year when we finished our dissertation and thus our Master's degree. I just cant believe that time has gone by so fast. I still clearly remember we all working like mad to meet the deadline. Jamie was the first one to finish his dissertation in the whole of the uni i reckon. Ben was struggling to finish his dissertation as well. I remember in the start of august, he was already considering toher options. Writing the actual dissertation (the report) was actually the hardest part for me. Champs and BaoYuan had finished their dissertation early and left Hull. ioulieta was as usual so stressed!!!! We have come a long way from that. Ankur and Rob Miles were cool as it goes with their personality. Ankur i reckon spent equal time in lab and in "Fuel" in July. I partied a lot during July to Aug mid and watched loads of wimbledon. But yeah finally we all got there. Congrats people.

And best of luck for years to come.

Saturday, August 19, 2006

Earn or Learn

Though its a saturday, but i had to go to work due to the huge amount of work left to be done with the deadline approaching.

I was chatting to a friend of mine and he said what am i doing in office on saturday .When people get a job, most of them as far as i know enjoy their work for a few weeks and then it becomes routine job for them. The main purpose of job then is to earn a living and be satisfied.

However as i just finished work i was thinking of the difference between the words "Earn" and "Learn". If any of you did not notice what i mean,
Learn = L + earn.
I also need money, i also want to be really rich but......and yes there is a but here.
Since finishing my Masters Degree last year i have been working as a software developer.I see my work as a learning experience through which i earn, and i dont see it as an income source, where i might learn a bit. i am learning every second of my job. i am exploring new ideas and this gives me immense satisfaction.

I thoroughly enjoy my experience of work. What can be better than getting paid for something you like to do for most of the time of your day.

Learn = "Earn through what you love to do"
= Loving the work you are doing + earning.

Another thing which i would love to od and get paid for is travelling. Right now iwant to concentrate on my career as a software developer. However in the future it would be nice if somebody paid me to travel all around the world:).

Even better, a job as a professional software developer where i get to travel a lot and meet new people, see new places. That would be a dream come true job.

Wednesday, August 16, 2006


This picture above shows that I am Web2.0 enabled too....

Tuesday, August 15, 2006

Passed my driving test

I have passed my practical driving test. Today was my test at the DVLA croydon centre.

Today 15th of August is India's Independence Day. I am missing the Parade in delhi, which iused ot watch on TV.

Came across this quote on TFS team blog:

“Imagination is more important than knowledge. For knowledge is limited to all we now know and understand, while imagination embraces the entire world, and all there ever will be to know and understand.” - Albert Einstein

Monday, August 14, 2006

IBM PC turns 25. Incredible history on the way

I know, i am a bit late in posting it..but anyway something to be proud of..

It was a match made in computer heaven.
The May-December marriage of a young company called Microsoft and business powerhouse IBM would change the landscape of offices and homes across the globe.
August 12 (today) is the 25th anniversary of the IBM personal computer launch, a pairing of MS and DOS, Microsoft and the disk operating system.
"MS-DOS moved computer access from a community measured in thousands to one measured in millions
"It was a key transition from the hobbyist and 'geek' environment to business applications".

Several popular home computers existed before the 1981 IBM PC launch. But the regimented business world considered Apple, Commodore, and Radio Shack's Tandy products "toys."
The IBM stamp of approval on a personal computer changed that mentality for good.
"Almost overnight, with IBM introducing the PC, it became OK to use it for real business applications," said Tycho Howle, CEO of nuBridges in Atlanta, a provider of business-to-business services.
Howle remembers with fondness his first desktop PC."In 1981 I had an IBM PC, two-floppy system," Howle said."To give young people these days a comparison: It would take 10 of those floppy disks to be able to hold the music that is on one MP3 song," he said.
A floppy disk is a thin, plastic disk that was coated with a magnetic substance used to store data. Earliest disks were 8 inches wide, more efficient disks shrunk to 5 1/4 inches, then 3 1/2 inches. Unlike a CDs or DVDs of today, the disks were floppy, or flexible.
IBM, the 800 pound gorilla of the business world at the time, flooded trade papers and television with promises that this new device would provide "smoother scheduling, better planning, and greater productivity."
Early '80s status symbol, the first available PCs cost between $1,600 and $6,000. Little about this early version was user, but that has changed considerably over time and they are much cheaper now.

Long live the PC........

Windows Live Writer

I just came to know from MSDN blogs that "Windows Live Writer" Beta is available from today 14th August. Windows Live Writer is a desktop application that makes it easier to compose compelling blog posts using Windows Live Spaces or your current blog service.
Teh cool feaure about writer is you can now author your post and know exactly what it will look like before you publish it.Writer makes inserting, customizing, and uploading photos to your blog a snap. You can insert a photo into your post by browsing image thumbnails through the “Insert Picture” dialog or by copying and pasting from a web page.

Thursday, August 10, 2006

Croydon Life

Police looking for human remains are preparing to begin a finger-tip search of the former home of a convicted paedophile in south London - croydon.
Detectives began an investigation after receiving an anonymous letter last year which claimed human remains linked to events 35 years ago were buried there.

Now that is scary..

Wednesday, August 09, 2006

Blogging from PDA

Police looking for human remains are preparing to begin a finger-tip search of the former home of a convicted paedophile in south London.
Detectives began an investigation after receiving an anonymous letter last year which claimed human remains linked to events 35 years ago were buried there.

Monday, May 22, 2006

Friend Assemblies

I havent been able to blog, because the internet connection at my place is screwed up. The BT line has been disconnected. And i am not allowed to access blogspot at my workplace.
Recently i worked with friend assemblies in .NET framework 2.0. In some cases we need to limit the use of some classes to the assemblies in wihch they are defined. The "internal" keyword in C# allows us to do that. It hides the specification of these classes even when you refer these assemblies in a project.
But in some cases we might need to use these classes in some other assemblies. But on the other hand we do not want to declare these classes as public. here comes the sweet part of the .NET framework. We can use the "InternalsVisibleToAttribute" to specify as to which assemblies can use the internal classes.

The usage would be something like:


This attribute when applied to an assembly indicates that all internal types in that assembly would be visible to another assembly, whose name is specified in the attribute constructor.

Monday, May 15, 2006


Today i came across Google Page Creator.

It is a free online tool that makes it easy for anyone to create and publish web pages in just minutes.

- No technical knowledge required.
Build high-quality web pages without having to learn HTML or use complex software.
- What you see is what you'll get.
Edit your pages right in your browser, seeing exactly how your finished product will look every step along the way.
- Don't worry about hosting.
The web pages will live on your own site at http://yourgmailusername.googlepages.com

And the best part is that you can use the "Edit HTML" link to view the HTML code behind your page and even tweak it futher

Check out my Googlepages.

Sunday, May 14, 2006

.NET vs Java World on Google Trends

Recently, I came across Google Trends. I have been playing with it for a while analysing the various trends.

It just popped in my mind, "why not try google trends to see as to what it reveals for .NET and Java".
The result was bit of a surpirse to me because i thought was .NET was much closer to Java in terms of usage for especially enterprise software development.

Thursday, May 11, 2006

25 Things I Learned on Google Trends

i came acroos an entry on Micro Persuasion (Steve Rubel's) blog.

To give you a sense of its tremendous power for tapping into the world psyche, here are 25 things I learned on Google Trends.

1) Almost all of the ten biggest US markets for MySpace are on the West Coast

2) There's more interest in Bluetooth than in Wifi

3) PR is starting to come close to catching advertising. AdAge still bests PR Week

4) David Hasselhoff's popularity in Germany is declining

5) Jerry Lewis's popularity in France is rising

6) Blackberry is widening its lead over the Treo

7) Zacharias Moussaoui finally beat OJ Simpson in searches

8) Hockey is starting to surpass baseball in popularity, but they fall way behind football (no matter which way it is defined)

9) New York still tops LA!

10) The Kryptonite Lock got more PR from the blog blow-up than any other event during the past two years

11) TV is kicking the movies butt

12) Dogs are by far killing all other pets while cats and fish battle for second place

13) Democrats vs. Republicans? Yup, they're neck and neck and on my screen red and blue!

14) YouTube is huge in the Philippines. Call it the Mike Abundo effect.

15) Blogs have caught up to newspapers. Boing Boing and Gizmodo are close to catching the WSJ

16) The beach is more popular than the mountains

17) Wikipedia is huge in Eastern Europe and it started to lead Britannica, Encarta and Webster's in 2004

18) Digg is still way behind CNET but it caught up to Slashdot. MySpace speed ahead of AOL last year

19) Interest in blogs and RSS is much higher than in podcasting and wikis

20) Flickr is the king of tagging, followed by del.icio.us and furl

21) Web 2.0 is huge in Korea - even bigger than in San Francisco

22) Elvis and The Beatles are in a dead heat

23) Word is more popular than any other Office app. Outlook and Excel are in a tie, followed by Powerpoint.

24) Bill Gates is slaughtering Steve Jobs in searches

25) Google is bigger than God?

Monday, May 08, 2006

Visual Studio Add-Ins Every Developer Should Download Now

While going through previous MSDN magazines, I came across a list of must-have tools for a developer using Visual Studio.

Ten Essential Tools

Sunday, May 07, 2006

It would be a day to remember for lots of people.

Spurs & Arsenal face Euro destiny - It is probably the biggest game of Martin Jol's managerial career. Manager Arsene Wenger believes West Ham could do Arsenal a favour

The final salute - Arsenal will end 93 years at Highbury with a closing ceremony after todays game against Wigan Athletic. if you don't have a ticket for the game you can watch a live stream of the post-match celebrations on Arsenal TV Online.

Alonso beats Schumi to Euro pole - World champion Fernando Alonso won a battle with Michael Schumacher for pole position at the European Grand Prix. But Schumacher is anticipating an exciting race in front of his home fans. Best of luck schumi.

Saturday, May 06, 2006

Pattern for resolving Association classes many - many relationship

On Thursday, i had one of the most satisfying coding expereinces since i started working. Not many people have heard of IAA , but i tell you it is becoming the de-facto standard for Architecting the Insurance Applications.
My designer gave me the class diagram and sequence diagram for implementing a particular part of Payment use case. There was a situation where we had a many to many assosciation relationship between two classes Payment and PaymentDue. These two classes are derived from an abstract base class called FinancialTransaction.
Now we had to establish the relationship between each payment made again a particular paymentdue. Thus a paymentdue can have multiple payments associated with it and also a payment can have multiple payments associated with it in case of Direct Debit transactions. So in orderto uniquely identify each payments association with a paymentdue, i created a link entity called financial transaction relationship and represented it as a class with attributes as amount and settlement date. In financial transaction class i had two lists as attributes of type financial transaction relationship called relatedTpFinancialTransaction and relatedFrom FinancialTransaction. Thus i was able to attach each unique payment against its corresponding paymentdue and vice versa.

Tuesday, May 02, 2006

(Mis)Uses of Technology

Recently came across an article on Techdirt regading the (Mis)Uses of Technology. The following scenario came to my mind, which has been recreated from that article.

Someone asked me how I could possibly read the screen on the mobile device I was using. It never really seemed that difficult, but apparently I (and many others) are doing quite a bit of damage to our eyes. At least that's what a new article is claiming, saying that the nation's obsession with reading things on mobile devices is generating new levels of eye strain, going beyond the typical eye strain found by people who are simply staring at a computer screen all day. To blame, of course, is the tiny text combined with the quality of the screens. Apparently, doctors are finding that people are coming in and asking for prescription glasses just for the sake of reading email on their Blackberry devices.

This isn't the first time, of course, that mobile devices have been called out for creating potential health problems. We've already heard too many stories about texter's thumb,

But even considering all these, i just love reading mails, appointments,calenders and other documents on my device. It is jsut so convenient to browse and read while on the move. There are times when conveniene matters most. Please note that i am not denying the fact that convenience should come at the cost of health, but there is a thin line and we need to maintain that line. I would like to know as to what do you feel about it. Let me know your views.

Sunday, April 30, 2006

When Your Need Is Speed

Came across a recent article form MSDN magazine (The Performance Benefits of NGen.). I have been really intersted in these CLR nitty gritty's, and Ngen is one of my favourite discussions with my CLR crazy freinds.

Typically the methods in managed executables are JIT (Just in time) compiled.The machine code generated by the JIT compiler is thrown away once the process running that executable exits; therefore, the method must be recompiled when the application is run again. Moreover, the generated code is tied to the process that created it and cannot be shared between processes that are running the same application. This can be a performance drawback.

But When Your Need Is Speed Ngen can be the answer.NGen refers to the process of precompiling Microsoft intermediate language (MSIL) executables into machine code prior to execution time. This results in two primary performance benefits. First, it reduces application startup time by avoiding the need to compile code at run time. Second, it improves memory usage by allowing for code pages to be shared across multiple processes.

Mind you, ngen is not jsut another traditional static back-end compilation tool.Unlike statically compiled binaries, NGen images are tied to the machine where they are created and hence cannot be deployed. Instead, the application's installer needs to issue commands to create native images for the specific assemblies on the client machine at setup time. Also unlike traditional binaries, NGen images merely form a cache-managed applications will continue to run correctly even if all the NGen images are deleted. Of course, there will be a performance hit if that happens, but there will be no correctness issues.

NGen typically improves the warm startup time of applications, and sometimes the cold startup time as well. Cold startup time is primarily dominated by the number of pages that need to be fetched from disk. The improvement in cold startup time while using NGen can be attributed largely to the fact that pages of MSIL that need to be touched during compilation no longer need to be accessed at execution time.

Improvements in warm startup time come from reusing pages of the NGen images that were brought in when the application had been running earlier. This is especially beneficial to large client-side UI applications where startup time is critical to the user experience.

NGen also improves the overall memory usage of the system by allowing different processes that use the same assembly to share the corresponding NGen image among them. This can be very useful in both client and server scenarios in which the total memory footprint must be minimized.

Wednesday, April 26, 2006

Cool Designer event in London

For all of my design programming friends Ben, Ioulieta, Chang and all others who are currently working on designing. This is a really good one. Check it out

  • Cool Designer event in London
  • Monday, April 24, 2006

    Team Foundation Server continued...

    Team Foundation Server:

    As promised my research into Team Foundation Server has continued and here I am with some information (censored. I had to remove the part I prepared as part of my report to my Manager)

    A Microsoft official at the VSLive! Conference said Visual Studio 2005 Team Foundation Server represents a shift from a developer-centric focus in building software to a collaborative one. As much as I have read and explored about it, this seems to be correct.

    Team Foundation Server works with the company’s Visual Studio 2005 Team System platform to enable collaboration between multiple roles -- such as project managers, architects and developers -- in the development process.
    One of the things I was concerned about was the Team Foundation Internationalization.
    The text below I got from Aldo Donetti Blog
    Most of you know that Visual Studio is currently localized into 9 languages (English, Japanese, Korean, Simplified and Traditional Chinese, French, German, Spanish, Italian). Team Foundation will be localized in the same languages, but it has not been designed to be multilingual in its first release, therefore system administrators will have to select one language for the server.

    In a distributed/multilingual organization it might not be uncommon to have users installing Visual Studio in their favourite language. Most of the User Interface is stored on the client, but not all of it. A number of error messages come from the server and will show up in the language of the Team Foundation Server installed. Or else, in case of server exceptions, the call stack is provided by the .NET Framework in whatever language it was installed on the server and this would be pushed to the client, though we always wrap exceptions in a user friendly way. It’s easy to understand why a fully localized experience will be achieved only if both the Team Foundation server language and the Visual Studio client language match.

    Setting up your server to support international data

    Most of the international issues you might have to deal with can be avoided by properly installing and configuring SQL Server on the Team Foundation server. Because some of these changes are hard to undo, you should plan the usage scenarios of your Team Foundation server in advance.

    You should at least take into consideration the natural language your teams will be using and set the collation accordingly, because it will obviously affect sorting. Based on the language you plan to use, you might also want to appropriately set switches to allow Case, Accent, Kana and Width sensitiveness (see screenshots below). We highly recommend using a case insensitive collation. Also, should you wish to extensively use Extended Unicode characters (Surrogates), we recommend using one of the “_90” collations. Please see the SQL Reference manual to understand what option is best for you.

    Sunday, April 23, 2006

    Hu understands the thoughts of chairman Bill

    You got ot read this. I got this from google news feed (The Observer). This is hillarious.

    John Naughton
    Sunday April 23, 2006
    The Observer

    When President Hu Jintao of China arrived in the US last Wednesday, his first appointment was dinner with Bill Gates, co-founder and chairman of Microsoft, at Gates's mansion (aka San Simeon North) on the shores of Lake Washington. They dined on smoked guinea fowl, which had been shot at by the US Vice-President, Dick Cheney. (He missed, and hit one of his friends instead; the guinea fowl was later killed by humane means.) The pair were joined by Steve Ballmer, CEO of Microsoft, the Chinese ambassador to the US, a number of the President's aides and the deputy assistant head of protocol at the White House. Owing to an unpatched security hole in Gates's Windows-powered home-monitoring system, the meeting of the two Great Leaders was bugged and a transcript of their conversation has been obtained by The Observer ...
    Gates: You Hu?

    Hu: I am the President of China.

    Gates: Cool. I'm the Chairman of Microsoft. (Hu bows.)

    Hu: Because you, Mr Bill Gates, are a friend of China, I am a friend of Microsoft.

    Gates: Wow! That's really cool. We're very interested in China, you know. Big market. Smart people.

    Hu: We are pleased that many great US companies are coming to China - for example Google.

    Ballmer: (Heatedly) Those sons of bitches. They stole one of our top Chinese execs ...

    Gates: Cool it, Steve. Hu doesn't know about that.

    Hu: We also have Yahoo in China. They are very co-operative in rooting out undesirable elements.

    Ballmer: (Mutters.) Maybe they could help root out Google ...

    Hu: We like Google very much. They are most understanding of our needs. Chinese people do not want to know about freedom and democracy. They just want to know where to buy BMW cars and plasma TVs and such things.

    Gates: Now that you're here, Hu, I gotta problem I'd like to share with you.

    Hu: I will be honoured to help you, Mr Bill Gates. What is your problem? Or, as your Harvard Business School says, should I call it an 'opportoonity'?

    Gates: Eh? Oh, I see. Well it sure looks like a problem to me. You see you have a lot of PCs in China ...

    Hu: (Proudly) Yes, we have already 500 million PCs...

    Gates: ... and they're mostly running Windows XP.

    Hu: (Beaming). Certainly. The latest version with Service Pack 2 installed. We are becoming a most leading-edge economy. Also they have Office Productivity Suite including PowerPoint. It is a most excellent situation. What is your problem, Mr Bill?

    Gates: The problem is that, as far as we can see - and Steve here has looked at the figures - we only sold 153 Windows XP and 25 Office licences in the whole of China last year. Those damn PCs are all running bootleg - pirated - software and we haven't made a dime in licence fees on any of them. This is not good, Hu, not good at all ...

    Ballmer: Too damn right ... And it all happens because your factories are shipping cheap PCs with blank hard drives and no pre-installed operating system. Then those lousy schmucks install ripped-off versions of our software on them.

    (At this point, a Chinese official whispers in the President's ear. After a few moments, Hu turns back to Gates.)

    Hu: (Gravely). I see why you are distressed, Mr Bill. And because China wishes to be friends with Microsoft, your distress also distresses me. But my officials tell me that we have solved the problem.

    Gates: Cool. How?

    Hu: Chinese factories will no longer turn out these - how you say? - naked PCs. All will come with operating system pre-installed.

    Gates: Great stuff! Which version? Windows 2000 or XP? And don't forget Vista - we'll be shipping that soon.

    Hu: No. Red Flag Linux. Made in China.

    (At this point, Ballmer screams, picks up a chair and hurls it at the $250,000 video-wall in Gates's dining room, shattering screens and shorting the lights.)

    Gates: That's the dumbest idea I've ever heard, Hu.

    Hu: I do not understand, Mr Bill. First you tell me that you don't like these PCs with no operating system, and then you say you don't like them with operating system. I am confused.

    Gates: The thing is, Hu, that Linux system is bad news.

    Ballmer: You said it, buddy. Spawn of the devil.

    Hu: What is wrong with it?

    Gates: Well, for starters, it's a system put together by a bunch of hippies.

    Ballmer: It's like, totally un-American.

    Hu: Does that mean it doesn't work?

    Gates: No, it works fine. Better than that goddam pre-release version of Vista, in fact.

    Hu: So why do you dislike it so much, Mr Bill?

    Gates: Well, those damn hippies just give it away.

    Ballmer: It's basically, well, communistic.

    Hu: (Shocked) Ah, now I see. We are totally opposed to communism too, Mr Bill. How much will you charge for 500 million Vista licences?

    Saturday, April 22, 2006

    Talking about Software Engineers are #1

    One of my current best sites for career and jobs is the JobSyntax site. It is a new company started by our very own Zoƫ Goldring and Gretchen Ledgard.

    Here is a quote below from their latest blog entry. Really informative

  • Software Engineers are #1
  • Wednesday, April 19, 2006

    Team Foundation Server

    the project i am working at my job is planning to shift to Team Foundation Server. Thus i am looking for the most common questions related to it.
    Here are a couple of them.

    Is it a good idea to use the same machine as "build machine" and "team foundation server"?

    It is not a good idea to make Team Foundation Server machine as build machine for real life deployment (ok for demos/trials etc). The main reason is for debugging build failures etc, many people in org may need access to build machine and that could pose a security threat to the server.

    Where all do I need to install the fxcop tool (that came with the VSTS for developer DVD) to enable static analysis in Team Build?

    Only build machine.

    Over the next few weeks i will collect some more questions and post them on my blog, so as to createa sort of repository for common questions related to Team Foundation Server.

    Monday, April 10, 2006

    Software as a Service

    I believe that Software as a Service (SaaS) is the future of the ever expanding software industry. The Software as a Service (SaaS) model differs fundamentally from traditional enterprise application delivery. To successfully provide SaaS to end users, software companies must evaluate nearly every facet of their business: pricing, billing, sales compensation, revenue recognition, code, infrastructure, end user support, and more.
    The end users are demanding it and competitors are already providing it, but how do software companies overcome the model, code, and operational issues preventing them from bringing SaaS to market?
    One succesfull example is IBM. IBM's Software as Services Showcase provides an online directory that allows customers to search for IBM Business Partner solutions that are available to them as a service. The Showcase includes solutions that span a range of industries, such as retail and insurance, and solution areas, such as compliance and human resources.

    Sunday, April 09, 2006

    Rotor 2.0

    As part of my University Masters degree, i used Shared Source CLI aka Rotor. I was so fascinated by it, that it has become my favourite area to explore whenever i have time from my busy work schedule. Take a look at the fetures highlighted below.

    The Shared Source CLI archive contains the following technologies in source code form:
    An implementation of the runtime for the Common Language Infrastructure (ECMA-335).
    Compilers that work with the Shared Source CLI for C# (ECMA-334) and JScript.
    Development tools for working with the Shared Source CLI such as assembler/disassemblers (ilasm, ildasm), a debugger (cordbg), metadata introspection (metainfo), and other utilities.
    The Platform Adaptation Layer (PAL) used to port the Shared Source CLI from Windows XP to other platforms.
    Build environment tools (nmake, build, and others).
    Test suites used to verify the implementation.
    A rich set of sample code and tools for working with the Shared Source CLI.

    Now, Rotor 2.0 is out there and is available for download here!(http://www.microsoft.com/downloads/details.aspx?FamilyId=8C09FD61-3F26-4555-AE17-3121B4F51D4D&displaylang=en)
    Now, when we are writing your CLR 2.0 application, and want to debug into the BCL, we can.

    New in this Release

    Full support for Generics.
    New C# 2.0 features like Anonymous Methods, Anonymous Delegates and Generics
    BCL additions.
    Lightweight Code Generation (LCG).
    Stub-based dispatch.
    Numerous bug fixes.

    Sunday, March 26, 2006

    cost benefit analysis of the Composite UI application Block

    Composite UI application block provides common infrastructure components and a programming model for smart client applications that are composed out of views and business logic that might come from different teams or need to evolve independently. It has been architected considering many a convergence of many patterns observed in large successful customer applications and where the platform and tools are going in the future in this space.
    The benefits of using Composite UI application block can be immense, especially considering the infrastructure of it.
    It contains:
    • WorkItems: a programming abstraction to simplify encapsulating use cases into 'contexts' that have shared state and orchestrating logic and nested recursively
    • Plug-in infrastructure: providers for enumerating available modules and loading them into the environment, and orchestration of the application bootstrap
    • Shared shell abstractions: a set of interfaces that allow logic to 'share a shell' and to facilitate separation of concerns between UI-intensive shell development and business logic development
    o Workspaces - a set of interfaces that specify how to show controls in an a given area or style - such as portal, tabbed, MDI windows, etc
    o UI Extension sites - named 'slots' in a shell where controls are to be added such as menus or status bar panes
    o Commands - a common way of hooking up multiple UI events to a specific callback inside the application
    • Composition infrastructure that helps objects find each other and communicate - such as the ability to share state, auto-wire-up of pub-sub of events
    • A service locator/lifetime container/dependency injection++ foundation
    o Built on ObjectBuilder - which allows extending the architecture specifying what it means to 'contextualize' an object.
    • A reflective architecture that can be explored to see the current state of the application, and a visualization architecture that allows architects and troubleshooters have views that exploit this reflective nature and can show you the internals of the application structure and how it's running while it's live

    Moreover the application block is designed to support the development of smart client line-of-business applications such as the ones found in the following scenarios:
    • Online transaction processing (OLTP) front-ends, in areas such as stock distribution centres or data entry applications
    • Rich client portals to back-end services, such as portals to government services or bank teller applications

    • UI intensive information-worker standalone applications, such as those used by call centre staff, IT support desks, or stock traders

    The good thing is that all these benefits from the Composite UI application block can be had for free of cost as this is a freely available tool on the Microsoft patterns and practices website. Support is available in terms of forums and user groups who actively contribute and thus highlighting the advantages of using this block as well as troubleshooting guidelines.

    Saturday, March 25, 2006

    Deployment Procedure

    This document describes the deployment procedures for the Project i am currently working on.

    Creating a Deployment Project Plan comprises of:
    • Creating a project plan outline.
    • Deciding the appropriate timeline for the deployment.
    • Planning the deployment, as defined in the general MOF guidelines.
    • Determining resources.
    • Gathering information about the current environment.
    • Determining technical considerations and dependencies.

    All the above mentioned factors have been considered and reviewed before considering deployment on the development and test servers.

    There are currently 2 alternatives to deploy components:

    a) Copy the components to the broker sever proxies bin directory (or root) the components will be loaded and registered with the available brokers using the standard Fusion (CLR Loader) policy. This means that the components will be locked for the duration the process is running
    b) Copy the components to the path configured as the “Business Component Path” components loaded from this location are shadow copied so they can be replaced, additional the broker server proxy watches for changes to these files and reloads when a new version of the component is deployed to this location.

    [NOTE: Do not use option (b) at the current time as there issues which we are currently resolving with this mechanism]

    Deployment Process

    The deployment process is from the development machines to the test servers is carried out in three steps as mentioned below.
    4.1 Deploying the build on local machine and verifying the work

    A local instance of Service broker has been installed with the help of Framework team on every development PC.
    The main steps involved in deploying the build on the local development Pc are:
    • Configuring the ‘Mondial.Common.BrokerServiceHost.exe.config’ file for Service broker, Service Gateway and Data Access Service access.
    • Configuring the client Config file for accessing the Service Broker on the appropriate server using the appropriate transport protocol.
    • Deploying the relevant BPC’s and all other dependent DLL’s.
    • Restarting the Windows Service:
    Service Broker (Broker) and
    Service Broker (Server) for new server registration files.

    Note: If we need to re-deploy the BPCs then, you should stop the services and then copy the BPCs and then re-start the services.

    Deploying the build on development server and verifying the work

    After successful deployment of work on development machine, the solution is deployed on the development server. All the steps mentioned above for local machine deployment have to be followed in addition to the setting up of the environment for prime entity access.

    MQ services have to be setup on the development server. A queue manager has to be created. The current queue manager on development server is: PHX.PHXSG.UAT.QM02
    Additionally the local reply queue and clustered request queue has to be configured.

    Deploying the Service Broker on test server

    Deployment of Service Broker on Test Server is carried out by the Framework team. Only the Broker host is supported on test serer and there are different test servers, different components respectively

    Deploying the build on test server and verifying the work

    After successful deployment of work on development server, the solution is deployed on the test server. All the steps mentioned above for local machine deployment have to be followed in addition to the setting up of the environment for prime entity access.
    For each deployment a MSI (UI installer with Build number) will be handed to test for installation of the client user interface. Test team will use different database for testing.
    The MSI contains:

    • All application files, in compressed mode.
    • All options available through the installation process, when using either a graphical user interface or automatic unattended mode.
    • Location of application files.
    • User environment settings, such as Start-menu entries and desktop shortcuts and icons.
    • Uninstall information.
    • Registration requirements, if necessary.
    • Other configuration settings required to successfully install and register the application.

    Deployment is considered successful only if the client application works as desired on the test servers.

    Thursday, February 23, 2006

    Windows Vista News

    It's just released and its official.
    Microsoft Corp. is giving businesses a preview of Vista, the next version of its flagship Windows operating system. Microsoft now says Vista is now "feature complete," with the release of Vista Build 5308,meaning that all of the fundamental capabilities that Vista will eventually offer are now baked in. Development efforts aren't slowing-the user experience will continue to evolve, bugs will get fixed, performance and compatibility will improve-but the basic shape of the operating system has been solidified, and from here on out we expect to see mostly fine-tuning rather than wholesale changes.

    Earlier this year, the Windows SDK team started working on the "Windows Vista Developer Story". This massive 500+ page document provides real content to developers looking to get started writing Windows Vista applications using the new Windows SDK.They have named the document as:

    "Making Your Application a Windows Vista Application: The Top Ten Things to Do".

    From the developer pint of view, the main features that i am looknig forward to are:
    Search, Organize and Visualize in Windows Vista
    Security for Applications in Windows Vista,
    Windows Communication Foundation ("Indigo")
    Windows Presentation Foundation ("Avalon")

    Saturday, February 18, 2006

    5 careers: Big demand, big pay

    Recently i came across an article on CNN Money, which mentioned five top jobs in demand at the moment. It says that if you're in one of the jobs listed here, you may be able to negotiate a sweet pay hike for yourself when changing employers. It sounded ineresting and going through the article i found that .NET jobs is among one of the five mentioned.

    The List is as follows:

    Accounting (CPA designation)
    Sales and marketing (healthcare and biomedical fields)
    Legal (Intellectual property attorneys specializing in patent law and the legal secretaries)
    Technology (.NET Developers)
    Manufacturing and engineering (quality and process engineers)

    It feels good to see that my main stream (.NET Enterprise Software Development) is one of the most in demand jobs. I hope i improve my skills even further and cash in on this boom.

    For the full article check it out here

    Saturday, February 11, 2006

    Deployment Process for .NET applications

    Long time i havent blogged. Actually i had been really busy with my past wednesday deadline and after that my health was not keeping up.

    My dissertation project involved a windows service, an ASP.NET web application and SQL Server 2000 Database. I had to create a single setup which would install my windows service, my ASP.NET web site and SQL Server 2000 database on to the server machine. It is pretty straightforward to create seperate setups for windows service and ASP.NET web app. But a single setup handling all the stuff is a bit tricky issue.
    After more than two days of research and fiddling around with different setup projects and merge modules, i found out that i had to create a custom installer class and provide the output of it to my setup project. It was a great learnnig expereince.

    Now while i am working as a .NET Developer in the company, i also handle the deployment of the software and creating the installers so that the managers can install it on thier machine and analyse as to what is the current project stage.

    Recently i have been assigned a new task to smoothen the deplyment process and come up with astrategy and a process to carry out effective and hassle free deployment process for over 500 machines some of which are running on Windows 2000, some on Windows XP and a few on Windows Server 2003 and deploying those applications efficiently and reliably throughout the company environment.

    As i research more about the best ways to handle all the dependencies realted to depolyment and frame up an effective solution for the deployment process, i will be posting and sharing my expereinces with all of you here on this blog.

    Monday, January 23, 2006

    Consideration of Time Zone in new Logging Application block

    While working on a project around 3 months back, it was once a requirement for me to correlate logging timestamps across timezones and to deal appropriately with the transition in and out of daylight savings time.

    I just came to know from Tom Hollanders blog that the new Logging Application block of the Enterprise Library changes the LogEntry.TimeStamp property from being a local time to a UTC (aka GMT) time, which i think is great.
    Check it out in the new Enterprise Library 2006 for .NET Framework 2.0.

    Essence Pattern

    My Blog readers would know that for past 4 months I have been working as a professional Software Developer.
    Recently we came across a tricky situation. Let me explain the scenario first.

    We make use of IBM’s Insurance Application Architecture (IAA). Not many people have heard of IAA. Briefly, IBM Insurance Application Architecture includes a business model; a design model of components, interfaces and messages; a generic design framework for product definition and agreement administration; and design models for the creation of data warehouses. Integrates with legacy systems from different platforms to leverage your previous investments and is compatible with widely-used design tools and methodologies, supporting open standards-based technologies.
    In our project, the Business Process Components make call to business components which are part of the IAA solution.
    The parameters required on individual BPC/BC are passed in main calling BPC operation. This results in the calling BPC operation becoming too parameter specific.
    Design Requirement:
    Cannot View one BPC operation requirement from another.
    Need to populate required parameters independently.

    In simple terms, we cannot change the IAA method signature, so we need to pass in the parameters in some other way.
    Here in comes the Essence Pattern: The Required parameters at various component levels need to be pushed as attributes on calling BPC. i.e. using Essence Pattern.

    Essentially the Essence Pattern provides a way to enforce users of an object to enter valid properties for that object. We can use for our purpose by tweaking it a bit and verifying that only the appropriate parameters are passed to the Business Components and the other parameters are pushed as attributes.

    There are some advantages and disadvantages to be had from this:
    1) Main BPC operation will not be parameter specific
    2) Can expose multiple output parameters
    1) Client Creation of object out of design control
    2) Cannot Enforce Compulsory/Optional attributes on class
    3) Also order of attribute execution

    In the present scenario it solves our purpose and provides an elegant solution. This was my first design pattern implementation at the company. I have done quite a few for my personal projects, but never before at the company level. And tell you what I enjoyed every bit of it.

    For your reference:
    Essence Pattern Paper:

    Essence Pattern C# Implementation: