Archive for June, 2010

Unity Container

Today, I got tasks which relate to lots of classes which are designed using many modern design patterns. While trying to understand the codes of the team project, I saw “container” appearing almost everywhen the code creates an instance object. I didn’t get or guess the idea behind those design… I got home in a very frustrating mind about the “container”!

Got home, I started to search about the unity container. Not so bad, finally I have understood it. And here now I sit back and write these lines to tell you about this pattern. I wonder why people trying to talk about it so mysteriously! When you got what they are trying to say, you see it very simple. Here is how I got the idea from Unity – Dependency Injection and Inversion of Control Container.

The context is that you have written a program using a bundle of classes. Problems occur when you wanna update your classes or even worse when you wanna change/replace some of your classes. In that case, it would be so nice if you would change/update/replace easily by updating just dozen of lines of code! Unity Container is what you need right then!

Using Unity Container, you create the object/instance of your class using a container. The class you use is an interface only. The concrete class is loaded from configuration file by the container. You can also load your class at run-time if you want to. So, later on, whenever you wanna update/change the concrete class, just go for the configuration file!

Moreover, when initing an instance, you may have arguments for its constructor which are again objects of other classes. The nice thing here is that the container will take care about loading those stuff for you as long as you register them (in the configuration of course)!

And more, you can have a property whose type is a class. You can have it loaded by the container too (using property [Dependent]).

Yeah, that’s what I feel great about Unity Container. Without understanding it, the codes are nightmare to me! Got it now and the codes are just… puppies ^_^


Where is the location of downloaded "Windows Update" files?

Source: Where Do Windows Update Files Get Stored – TechSpot OpenBoards

It’s in here: C:\Windows\SoftwareDistribution\Download.


How to change default desktop folder location on Windows 7

See it here How to change default desktop folder location on Windows Vista – Super User

In brief steps:

  1. Open user folder (C:\Users\<user name>).
  2. Open Properties page for ‘Desktop’ folder.
  3. Choose tab Location.
  4. Enter the new location for your Desktop, called NewLocaiton.
    (your Desktop folder now no longer resides inside the user folder, it lies in the path NewLocaiton you’ve entered)
  5. Done.

Hope that helps!

Make Outlook group mail into converstion the same way in Gmai



  1. Create a new Search Folder, e.g. named as Gbox, and choose Inbox, Outbox, Sent Items, Draft.
  2. Open Gbox
  3. Customize the view: add column Conversation, then group by Conversation.
    Do not select any fields for sorting.
  4. Done


How to change username which also changes the user data folder in Windows 7 ?

See it here How to rename or move a User Profile folder?

[WARNING: Changing the Windows user’s folder may stop your current application from working properly!!!]


  1. Log in as another administrator user other than the one need to rename.
  2. Go to C:\Users\<Your current user name>, rename it to the new name.
  3. Start – Right click “My Computer” – Manage – User and Group.
  4. Select you username and change it to the new name.
  5. Open registry (Start – Run – regedit)
  6. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
  7. Go to the SID which has the “ProfileImagePath” value as your current user name.
  8. Change it to the new name.
  9. Done

(Be sure to back up your registry first)