Friday, September 16, 2011

Windows 8 Developer Preview (part 2)

Finally got to install windows 8 on my Lenovo ThinkPad X220 Tablet. As I was not interested in partitioning my drives, I was looking for an alternate solution. My colleague emailed me one link - http://www.hanselman.com/blog/GuideToInstallingAndBootingWindows8DeveloperPreviewOffAVHDVirtualHardDisk.aspx

In this blog, Scott Hanselman has provided a very good view of how to create a virtual hard drive (vhd) where Windows 8 can be installed on. This VHD does not need Virtual PC or Hyper-V and sits in the file system on primary Windows operating system. I did see some issues following what Scot H. has provided. I will go thru the details below. The blog taught me new things, like DISKPART, which I never knew of before. I did not want to partition the HDD as I want to have the flexibility of moving out of the preview with ease. Scott Hanselman’s blog showed me the solution.

So what I did was to follow the steps mentioned in the blog, but I hit a wall. In Step 2, I had created the VHD file in my C drive. Location was C:\win8vhd\win8.vhd. So, in step 4, I entered the DISKPART command as select vdisk file=c:\win8vhd\win8.vhd This threw an error of “system cannot find the file or path specified”. I spent some time pulling out what ever hair was left on my scalp and trying to figure out how to install Windows 8 on VHD – entered various combinations to the file path in the DISKPART command. went back to good ol’ internet and found a link to “http://technet.microsoft.com/en-us/magazine/dd535816.aspx” provide by one Antonio in the comments for Scott’s blog. Reading thru that, I came across the DISKPART command “list disk”. This command lists all the disks. When I ran it, I saw that my Windows 7 C drive was listed as the 6th drive. So from DISKPART command prompt, I entered F: and hit {Enter} and got to the file location of my Windows 7 C drive. Eureka!! So in my command for Scott’s 4th step, I entered F:\win8vhd\win8.vhd and what I saw brought a big smile on my face. Rest of the installation was very simple and the screens are very friendly to help all understand how to proceed with install. Very few screens and if I remember them – License terms, Network selection, Windows Live ID signup/login, sending info to MS and auto update options screens. That was it. Then it showed me the default UI for Windows 8. Smile

One of the tile was for Desktop and when I clicked on it, it showed me the old desktop UI of Windows (similar to Windows 7). It has Visual Studio 11, Expression Blend  and some games. Next few days, I will spend playing around with Windows 8 and will provide more details on what I see.

Tuesday, September 13, 2011

Windows 8 Preview

Windows 8 Preview is finally here. I noticed it by about 8:15 CST and started to immediately download the 4.83 GB ISO file. You too can download it from here. I plan to load it onto a virtual system running on my tablet (Core i7 with 8GB RAM). I will keep you posted on what I find….I will also provide screenshots and maybe even videos. As of writing this post, I have downloaded about 70% of the 4.83GB file. Hang on for updates.

Monday, October 12, 2009

Unboxing Windows 7 Ultimate “Signature Edition”

I was excited to read all about Windows 7 and how it is better than its predecessor Windows Vista. I have a desktop system (AMD 64 x2 with 8GB RAM) running Vista.
Today I received the Party Pack for Windows 7. I was excited and have captured on video the “ultimate unboxing” :-) using my Vista laptop and a sorta good & loyal Web Cam (lasted me about 4 yrs now :-)).
The pack includes Windows 7 Ultimate “Signature Edition” (32 & 64 bit versions – but only one product key which is stated to work only once for either 32 or 64). By the way, when I heard of “Signature Edition”, I thought it may contain something more than the regular Ultimate edition available. As of now, all I saw was that the cover has Stevie’s signature on it. Need to install it to see if there is anything more to it.
Apart from this, the pack contains:
poster with Windows 7 desktop design
One deck of playing cards with Windows 7 design
One puzzle with Windows 7 design
Couple of streamers, balloons, napkins & Tote bags with Windows 7 design
One table top centerpiece
I guess that is all good, but what really needs to be seen is if Windows 7 really lives up to its hype….of being much better than Vista.
In the next few days, I plan to install it on my desktop and see how it is as compared to Vista. I will post my review of the same soon. Till then, enjoy the video.


BTW, no matter what people say about Vista, I have been using it for development in Visual Studio apart from browsing and games and I have not yet faced the problems reported by many. Frankly, I guess it all depends on how well a user knows how to tweak it :-) which I agree should have been made more easily available to the end users.
Technorati Tags: ,,
LiveJournal Tags: ,

Tuesday, February 3, 2009

Internet Explorer 8 (Release Candidate 1)

Microsoft has released RC 1 for IE 8. You can find it here. I had installed IE 8 Beta on my Windows XP box and played around with it. I was having multiple issues  - one being that it was pretty slow and other being that many sites were not compatible with IE 8. But major was that it used to crash often.

Some of the features of IE 8 which I like are WebSlices, InPrivate Browsing, Accelerators, Compatibility View, Caret Browsing and Tab Grouping. One other feature is adding headers within the Sites, based on which automatically the Compatibility View is triggered and the site which normally would not have been viewable properly in IE 8 is displayed within IE 8. The Compatibility view emulates IE 7 for those pages which have the following added header:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
WebSite Admins can set full site to be IE7 compatible for IE8 viewing by adding new header with name="X-UA-Compatible" and value="IE=EmulateIE7".

All these features have been maintained with the release of RC1. Areas where I could immediately see the difference were the speed and stability which is way better than on Beta 1. This was anticipated as RC1 is usually much better in many aspects than Beta 1.

Head on to Microsoft and download Internet Explorer 8 (Release Candidate 1)

Technorati Tags:
del.icio.us Tags:

Saturday, January 3, 2009

BizTalk 2009

I have just got to download the public beta evaluation version of BizTalk 2009. Some of the improvements in BizTalk 2009 are

  • Simplify Interoperability
    • Support for .NET Framework 3.5 SP1 and Visual Studio 2008 SP1 - take advantages of the latest developer tools.
    • Support for Windows Server 2008 and SQL Server 2008 – full support of Hyper-V, and increased performance and scale.
  • Extend To The Edge
    • EDI - enhanced out of the box support for the most commonly used EDI schema and trading partner management tools.
    • Simplify development of mobile applications that expose relevant, real-time business information (RFID Mobile).
  • Enhance Productivity
    • ALM – new support is provided for Team Foundation Server (TFS), allowing development teams to leverage the integrated source control, bug tracking, support for team development, Project Server integration and support for automating builds via MSBuild.
    • Enhanced Developer Productivity – improved underlying project system enhances debugging support for artifacts, pipeline components and orchestrations, and enables support for unit testing.

I will be playing around with this version in the next few days and will keep updating you about my experience. Feel free to share your experience on the same.

Thursday, July 3, 2008

Disposable Pattern in Microsoft .Net

Very often, I come across IT professionals who ask the same question again and again - how to effectively manage resources in .Net applications. All are very well aware of the .Net Garbage Collection mechanism. However, very few have heard or implemented the "Disposable Pattern" for managing memory.

.Net effectively manages memory for you. You do not need to worry about the Memory Leaks of yesteryears with .Net. This is accomplished by the .Net Garbage Collection mechanism. The Garbage Collector (GC) keeps a watch at the Memory heap for objects and once space is full, and more space is needed for new objects, the GC will jump into action. Its primary work is to go thru all the objects to find objects that can be removed form memory. We can have a deep discussion about how it works (reference-tracing) in detail, at a later time. For now, all you need to understand is that the GC will remove unrequired/unused objects from memory.

However, one thing to keep in mind is that GC will remove only "managed/.Net" objects from memory. Yes you are correct, the Memory Leaks of yesteryears have not been fully eliminated. The main reason is the use of "unmanaged/non.Net" objects. GC will not release the non .Net resources. It is here that we need to understand the Disposable Pattern. Remember, setting an object to null (C#) or Nothing (VB.Net) does not actually release the resources associated with the object in .Net.

I have been trying to get some good information about Disposable Pattern for my C# project. Scouting the Internet for this information is difficult due to the few sites which provide details about this pattern.

The pattern involves implementing the IDisposable interface's Dispose() method along with the class destructor. The class destructor is automatically called by the GC when it tries to finalize objects to be released.  Users cannot call the destructor directly. On the other hand, the Dispose() method is not called by GC but can be called by the users. In the Disposable Pattern, we need to release all resources used by our class in both these methods. Why from both?- you may ask.

The answer is simple: typically, when a class is no longer needed, it is always advisable to release, immediately, all resources associated with that object.  The user has control of when to release objects only when the class implements IDisposable interface's Dispose method. So, if this method is implemented, users using this class can then call the Dispose() method once they know that they no longer need this class object. On the other hand, if the user fails to call the Dispose() method, the GC will kick in to call the finalize destructor in any case. So, even if the user fails to release memory once the object is no longer required, we are still safe as GC will do the work, albeit later. Hence both.

The following code snippet shows how the Disposable Pattern is implemented in C#.

   1: using System;


   2:  


   3: namespace DisposablePatternNamespace


   4: {


   5:     class DisposablePatternClass : IDisposable


   6:     {


   7:         Boolean HasBeenDisposed = false;


   8:  


   9:         DisposablePatternClass()


  10:         {


  11:             //Constructor - Do what you want here;


  12:         }


  13:  


  14:         #region "Disposable Pattern Specific"


  15:         ~DisposablePatternClass()


  16:         {


  17:             //Destructor


  18:             //No need to change this code


  19:             //This is where you will implement Finalize code


  20:             ReleaseResources(false);


  21:         }


  22:  


  23:         //Dispose method to be called by user.


  24:         public void Dispose()


  25:         {


  26:             //No need to change this code


  27:             ReleaseResources(true);


  28:             //After call to ReleaseResources, no need for finalize.


  29:             GC.SuppressFinalize(this);


  30:         }


  31:  


  32:         void ReleaseResources(Boolean IsCalledFromDispose)


  33:         {


  34:             //Try to release resources only if they have not been previously released.


  35:             if (HasBeenDisposed == false)


  36:             {


  37:                 if (IsCalledFromDispose == true)


  38:                 {


  39:                     //TODO: Code to release managed resources


  40:                     //GC will automatically release Managed resources calling Destructor, 


  41:                     //but Dispose() will not.


  42:                 }


  43:                 //TODO: Code to release unmanaged resources


  44:                 //TODO: set large fields to null


  45:             }


  46:             HasBeenDisposed = true;


  47:         }


  48:         #endregion


  49:     }


  50: }




One may ask why to release Managed Resources as they will be released by GC automatically. A valid question. However, we must keep in mind one thing, if the managed component which we are using in our code, has a Dispose() method, the developer of that component must have placed it there for particularly releasing resources. The component developer is well aware of the resources which are used and needs to be released. Hence, it is always a very good idea to call the Dispose() method of objects we use, if they exist.


You can port the code to VB.Net very easily by just changing the destructor to Protected Overrides Sub Finalize().


I have created Visual Studio Item Templates for use with VS 2005 and 2008 for both VB.Net and C# for this pattern. Feel free to download the same and use it in your projects.



Download Item Templates for Visual Studio



Once downloaded, copy them to the following folder

(C# Item Template ZIP file in C# folder and VB ZIP file in VB folder)

Windows Vista:

C:\Users\UserID\Documents\Visual Studio 2008\Templates\ItemTemplates\Visual C#

C:\Users\UserID\Documents\Visual Studio 2008\Templates\ItemTemplates\Visual Basic


Windows XP:

C:\Documents and Settings\UserID\My Documents\Visual Studio 2008\Templates\ItemTemplates\Visual C#

C:\Documents and Settings\UserID\My Documents\Visual Studio 2008\Templates\ItemTemplates\Visual Basic


The folder location is same for Visual Studio 2005, except that the Visual Studio folder is named "Visual Studio 2005".


For more information on this topic, do refer to Microsoft MSDN site http://msdn2.microsoft.com/en-us/library/fs2xkftw.aspx


 




Welcome

Welcome to this blog. Here I will be providing my views on IT. I myself am a software professional having more than 10 years of experience in the development field. My experience is in BizTalk, Microsoft CRM, C#, VB.Net, SQL, Oracle, ASP.Net, VB, ASP and C/C++.

I will post tips, source code, utilities and everything else I can.

I hope readers of this blog will enjoy the varied IT based posts. I welcome every reader's comments and will make every effort to answer each and every question same day. Feel free to comment whether you do not agree or agree to my views. We can have a healthy discussion. You can also chat with me using the "Chat with me" Meebo box on the left side on this page.

Welcome once again and enjoy reading and commenting.