<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>New Things I Learned</title>
        <link>http://geekswithblogs.net/NewThingsILearned/Default.aspx</link>
        <description> </description>
        <language>en-US</language>
        <copyright>Muljadi Budiman</copyright>
        <managingEditor>muljadibudiman@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>New Things I Learned</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/NewThingsILearned/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Kansas City Developer Conference</title>
            <category>Android</category>
            <category>KCDC</category>
            <link>http://geekswithblogs.net/NewThingsILearned/archive/2013/05/06/kansas-city-developer-conference.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/NewThingsILearned/archive/2013/05/06/kansas-city-developer-conference.aspx'&gt;http://geekswithblogs.net/NewThingsILearned/archive/2013/05/06/kansas-city-developer-conference.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;This past Thursday through Saturday, the &lt;a href="http://kcdc.info/"&gt;Kansas City Developer Conference&lt;/a&gt; happened.  It was an awesome event - attendees, speakers, and vendors all totalled over 800 people.  Learning and fun was had by all.&lt;/p&gt;&lt;p&gt;I got to meet great people and attended excellent sessions all around; I enjoyed the &lt;a href="http://kcdc.info/sessions/30"&gt;Reactive Extensions&lt;/a&gt; session by &lt;a href="http://kcdc.info/speakers/1073"&gt;Aaron Hoffman&lt;/a&gt;; it was a complicated subject and it is very tight to fit it in 50 minutes, but it was interesting still nonetheless.  A quick shoutout to people I meet: &lt;a href="https://twitter.com/leebrandt"&gt;Lee Brandt&lt;/a&gt;, &lt;a href="https://twitter.com/boontlee"&gt;Boon Lee&lt;/a&gt;, &lt;a href="https://twitter.com/jonathanfmills"&gt;Jonathan Mills&lt;/a&gt; (thanks for giving me the opportunity to be there), &lt;a href="https://twitter.com/RbKeefer"&gt;Rob Keefer&lt;/a&gt;, &lt;a href="https://twitter.com/srogalsky"&gt;Steve Rogalsky&lt;/a&gt;, &lt;a href="https://twitter.com/BrianSchroer"&gt;Brian Schroer&lt;/a&gt;, and my driving partner &lt;a href="https://twitter.com/jessephelps"&gt;Jesse Phelps&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;I did the &lt;a href="http://kcdc.info/sessions/2104"&gt;Introduction to Android Software Development&lt;/a&gt;, a 2 hour session and got one of the audience to participate (thanks &lt;a href="https://twitter.com/codeWithoutFear"&gt;@codeWithoutFear&lt;/a&gt;).  There were plenty of engagement from the audience, half Java developers, half .NET developers and hopefully my session was useful to them.  The materials can be downloaded from &lt;a href="https://sites.google.com/site/newthingsilearned/zipfiles/Android%20Software%20Development.zip?attredirects=0&amp;amp;d=1"&gt;here&lt;/a&gt;.  &lt;/p&gt;&lt;p&gt;In the end, I wanted to say thanks to the KCDC organizers and hope that my contribution was beneficial to them.  I got to meet and talk with really smart people; learned a lot from my time there and also have some fun among developers in general.  Hopefully I can be involved next year; and also look forward to this year's &lt;a href="http://www.stldodn.com/2013/"&gt;St. Louis Day of .NET&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/NewThingsILearned/aggbug/152877.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Muljadi Budiman</dc:creator>
            <guid>http://geekswithblogs.net/NewThingsILearned/archive/2013/05/06/kansas-city-developer-conference.aspx</guid>
            <pubDate>Mon, 06 May 2013 21:07:12 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/NewThingsILearned/comments/152877.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/NewThingsILearned/archive/2013/05/06/kansas-city-developer-conference.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/NewThingsILearned/comments/commentRss/152877.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/NewThingsILearned/services/trackbacks/152877.aspx</trackback:ping>
        </item>
        <item>
            <title>St. Louis Day of .NET 2011 - Sessions Materials</title>
            <category>.NET</category>
            <link>http://geekswithblogs.net/NewThingsILearned/archive/2011/09/06/st.-louis-day-of-.net-2011---sessions-materials.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/NewThingsILearned/archive/2011/09/06/st.-louis-day-of-.net-2011---sessions-materials.aspx'&gt;http://geekswithblogs.net/NewThingsILearned/archive/2011/09/06/st.-louis-day-of-.net-2011---sessions-materials.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I have to say that it has been awhile (just over a year actually) since I've updated my blog.  I feel embarassed.  On the other hand, I have been quite busy - so it's not like I don't do it because I am lazy (well I am somewhat lazy), but it's because time is somewhat a scarce resource.  But... I will try to see if I can muster up some moments to be active with my blog.&lt;/p&gt;
&lt;p&gt;With that said, last month (August 5th and 6th) St. Louis held the 4th annual conference of the &lt;a href="http://www.stlouisdayofdotnet.com/2011"&gt;St. Louis Day of .NET&lt;/a&gt;.  It was a rousing success - over 800 people came, and great fun was had by all.  Kudos to the organizers for holding the event; I contributed by presenting 3 sessions, which I will detail below.  I promised to put the session materials up ASAP, but other things got in the way and some procrastination ended up with me doing it only now (a month after the event).  My apologies to those that are looking for the materials...&lt;/p&gt;
&lt;p&gt;I have been interested in mobile development - have ventured into &lt;a href="http://msdn.microsoft.com/en-us/library/ff402535(v=vs.92).aspx"&gt;Windows Phone 7 development&lt;/a&gt;, since it is just a short hop away from my regular work dealing with WPF and XAML in general.  On the other hand, I always felt that I needed to get out of my comfort zone and try to look at other platforms as well.  So I actually started tinkering with &lt;a href="http://en.wikipedia.org/wiki/IOS"&gt;iOS &lt;/a&gt;sometime last year - spent my hard-earned income to buy myself a MacBook Pro.  My background in C / C++ development tremendously helped with learning &lt;a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html"&gt;Objective-C&lt;/a&gt;, but it was still a steep learning curve.&lt;/p&gt;
&lt;p&gt;For this year's St. Louis Day of .NET, I decided to share my newfound knowledge and did 2 sessions that are NOT .NET related - I did a session titled '&lt;a href="https://sites.google.com/site/newthingsilearned/zipfiles/LookingatObjective-Cas.NETDeveloper.zip?attredirects=0&amp;amp;d=1"&gt;Looking at Objective-C&lt;/a&gt;' - and try to introduce fellow .NET developers to this language, which can look strange indeed.  The material posted contain the PowerPoint presentation, so it is useful to read / page through for those that do not have a Mac PC.  It also has the simple project that I did within the session, but the worth of the session (IMHO) is in exposing what Objective-C looked like to other developers (which primarily are .NET developers).&lt;/p&gt;
&lt;p&gt;I also did another session on '&lt;a href="https://sites.google.com/site/newthingsilearned/zipfiles/IntroductiontoiOSDevelopment.zip?attredirects=0&amp;amp;d=1"&gt;Introduction to iOS Development&lt;/a&gt;' - providing a code walkthrough on creating a simple consumer-based application that can take pictures, record video and play some music.  Unlike the Objective-C session, the material posted are mostly code; there is no PowerPoint in it.  Although the code files can be read with Notepad (or your favorite editor / text viewer), you need &lt;a href="http://developer.apple.com/xcode/"&gt;Xcode&lt;/a&gt; and a Mac PC to compile the code.  Since the code will try to take pictures / video, you also need to deploy the resulting code onto a device since the &lt;a href="http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/iphone_development/125-Using_iOS_Simulator/ios_simulator_application.html"&gt;iOS simulator&lt;/a&gt; doesn't support cameras.&lt;/p&gt;
&lt;p&gt;Not to forget my roots - I did a C# focused session in '&lt;a href="https://sites.google.com/site/newthingsilearned/zipfiles/TestYourPracticalCKnowledge.zip?attredirects=0&amp;amp;d=1"&gt;Test Your Practical C# Knowledge&lt;/a&gt;'; I made the session as a multiple-choice Jeopardy-style session complete with first and second round questions.  Unfortunately I could not muster 3 brave enough participants that is needed to go up front and involve themselves.  So we made it as a quiz / learning session, it was a free-for-all the attendees in the room.  Some of the code described is not quite practical, but I thought it was great to see how developers walk through the code in their mind. &lt;/p&gt;
&lt;p&gt;The &lt;a href="https://sites.google.com/site/newthingsilearned/zipfiles/TestYourPracticalCKnowledge.zip?attredirects=0&amp;amp;d=1"&gt;first link&lt;/a&gt; contains only the project and code files (to proof / verify the question), and I also used images to display the question - because of the size, the images are broken up into &lt;a href="https://sites.google.com/site/newthingsilearned/zipfiles/Pictures-FirstRound.zip?attredirects=0&amp;amp;d=1"&gt;first round questions&lt;/a&gt; and &lt;a href="https://sites.google.com/site/newthingsilearned/zipfiles/Pictures-SecondRound.zip?attredirects=0&amp;amp;d=1"&gt;second round questions&lt;/a&gt;.  I get to learn a couple of new tidbits on C# along the way, and the session seem to involve the attendees so they were actively searching for the answer as well.&lt;/p&gt;
&lt;p&gt;In the end, the goal of me doing these sessions are to help myself with ensuring I am familiar with the materials I should be familiar with, and also helping others know / learn more about technologies in general.  On a personal note, I really liked the Objective-C session because learning that language was very eye-opening for me; I know it's mostly syntax differences, I am just surprised they took that particular syntax.  Hopefully these materials can be of use to others...&lt;/p&gt; &lt;img src="http://geekswithblogs.net/NewThingsILearned/aggbug/146778.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Muljadi Budiman</dc:creator>
            <guid>http://geekswithblogs.net/NewThingsILearned/archive/2011/09/06/st.-louis-day-of-.net-2011---sessions-materials.aspx</guid>
            <pubDate>Tue, 06 Sep 2011 16:10:10 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/NewThingsILearned/comments/146778.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/NewThingsILearned/archive/2011/09/06/st.-louis-day-of-.net-2011---sessions-materials.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/NewThingsILearned/comments/commentRss/146778.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/NewThingsILearned/services/trackbacks/146778.aspx</trackback:ping>
        </item>
        <item>
            <title>Materials for the St. Louis Day of .NET 2010 presentations - part two</title>
            <category>.NET</category>
            <link>http://geekswithblogs.net/NewThingsILearned/archive/2010/08/21/materials-for-the-st.-louis-day-of-.net-2010-presentations-again.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/NewThingsILearned/archive/2010/08/21/materials-for-the-st.-louis-day-of-.net-2010-presentations-again.aspx'&gt;http://geekswithblogs.net/NewThingsILearned/archive/2010/08/21/materials-for-the-st.-louis-day-of-.net-2010-presentations-again.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Finished my session on Asynchronous Adventures in Silverlight an hour ago, and I'm putting up the presentation files.&lt;/p&gt;
&lt;p&gt;The session is Asynchronous Adventures in Silverlight. Since there are enough sessions about developing XAML, WPF and Silverlight, I've decided to do a session that emphasized the asynchronous nature of most operations that is the default mode of operations in Silverlight.  The session talks about the asynchronous pattern used and how widespread it is, discuss about some pitfalls, advantages and disadvantages. The files can be downloaded &lt;a href="https://sites.google.com/site/newthingsilearned/geekswithblogs-net/AsynchronousDevelopmentinSilverlight.zip?attredirects=0&amp;amp;d=1"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I hope this can be of use to others.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/NewThingsILearned/aggbug/141425.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Muljadi Budiman</dc:creator>
            <guid>http://geekswithblogs.net/NewThingsILearned/archive/2010/08/21/materials-for-the-st.-louis-day-of-.net-2010-presentations-again.aspx</guid>
            <pubDate>Sat, 21 Aug 2010 17:37:53 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/NewThingsILearned/comments/141425.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/NewThingsILearned/archive/2010/08/21/materials-for-the-st.-louis-day-of-.net-2010-presentations-again.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/NewThingsILearned/comments/commentRss/141425.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/NewThingsILearned/services/trackbacks/141425.aspx</trackback:ping>
        </item>
        <item>
            <title>Materials for the St. Louis Day of .NET 2010 presentations - part one</title>
            <category>WPF</category>
            <category>.NET</category>
            <link>http://geekswithblogs.net/NewThingsILearned/archive/2010/08/19/materials-for-the-st.-louis-day-of-.net-2010-presentations.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/NewThingsILearned/archive/2010/08/19/materials-for-the-st.-louis-day-of-.net-2010-presentations.aspx'&gt;http://geekswithblogs.net/NewThingsILearned/archive/2010/08/19/materials-for-the-st.-louis-day-of-.net-2010-presentations.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I'm going to be giving a presentation for the St. Louis Day of .NET 2010 - TODAY!&lt;/p&gt;
&lt;p&gt;Worked out my materials for the first 2 sessions, for those that are interested, they can download the materials:&lt;/p&gt;
&lt;p&gt;The first session is: JumpStart: &lt;a href="http://msdn.microsoft.com/en-us/netframework/aa663328.aspx"&gt;Workflow 4&lt;/a&gt;.  The session describes the core features and technology involved in developing and managing your Activity enriched application workflows using Windows Workflow Foundation 4.0.  The files can be downloaded &lt;a href="https://sites.google.com/site/newthingsilearned/geekswithblogs-net/IntroToWorkflow4.zip?attredirects=0&amp;amp;d=1"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The second session is Introduction to &lt;a href="http://msdn.microsoft.com/en-us/library/ms747437.aspx"&gt;3D in WPF&lt;/a&gt;.  This is an introductory session to show some of the 3D graphics capabilities in WPF. Participants will be introduced to the concepts of triangular polygon, GeometryModel3D, Viewports and the camera system. Some animation will be introduced along with some samples for how to draw texts on 3D surfaces.  The files can be downloaded &lt;a href="https://sites.google.com/site/newthingsilearned/geekswithblogs-net/Learn3DWPF.zip?attredirects=0&amp;amp;d=1"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I still have one more session materials to upload, thus the 'part one' in the title &lt;img alt="" src="http://geekswithblogs.net/Providers/BlogEntryEditor/FCKeditor/editor/images/smiley/msn/regular_smile.gif" /&gt;.  Hopefully people find this informative.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/NewThingsILearned/aggbug/141410.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Muljadi Budiman</dc:creator>
            <guid>http://geekswithblogs.net/NewThingsILearned/archive/2010/08/19/materials-for-the-st.-louis-day-of-.net-2010-presentations.aspx</guid>
            <pubDate>Fri, 20 Aug 2010 11:51:16 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/NewThingsILearned/comments/141410.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/NewThingsILearned/archive/2010/08/19/materials-for-the-st.-louis-day-of-.net-2010-presentations.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/NewThingsILearned/comments/commentRss/141410.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/NewThingsILearned/services/trackbacks/141410.aspx</trackback:ping>
        </item>
        <item>
            <title>protected abstract override Foo(); &amp;ndash; er... what?</title>
            <link>http://geekswithblogs.net/NewThingsILearned/archive/2010/05/04/protected-abstract-override-foo-ndash-er.-what.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/NewThingsILearned/archive/2010/05/04/protected-abstract-override-foo-ndash-er.-what.aspx'&gt;http://geekswithblogs.net/NewThingsILearned/archive/2010/05/04/protected-abstract-override-foo-ndash-er.-what.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;A couple of weeks back, a co-worker was pondering a situation he was facing.  He was looking at the following class hierarchy:&lt;/p&gt;  &lt;table cellspacing="1" cellpadding="1" width="600" border="1"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="600"&gt;         &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;abstract class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;OriginalBase
&lt;/span&gt;{
   &lt;span style="color: blue"&gt;protected virtual void &lt;/span&gt;Test()
   {
   }
}

&lt;span style="color: blue"&gt;abstract class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SecondaryBase &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;OriginalBase
&lt;/span&gt;{
}

&lt;span style="color: blue"&gt;class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;FirstConcrete &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;SecondaryBase
&lt;/span&gt;{
}

&lt;span style="color: blue"&gt;class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SecondConcrete &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;SecondaryBase
&lt;/span&gt;{
}&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;Basically, the first 2 classes are &lt;a href="http://msdn.microsoft.com/en-us/library/sf985hc5.aspx"&gt;abstract&lt;/a&gt; classes, but the &lt;font face="Courier New" color="#2b91af" size="2"&gt;OriginalBase&lt;/font&gt; class has Test implemented as a &lt;a href="http://msdn.microsoft.com/en-us/library/9fkccyh4.aspx"&gt;virtual&lt;/a&gt; method.  What he needed was to force concrete class implementations to provide a proper body for the Test method, but he can’t do mark the method as abstract since it is already implemented in the &lt;font face="Courier New" color="#2b91af" size="2"&gt;OriginalBase&lt;/font&gt; class.&lt;/p&gt;

&lt;p&gt;One way to solve this is to hide the original implementation and then force further derived classes to properly implemented another method that will replace it.  The code will look like the following:&lt;/p&gt;

&lt;table cellspacing="1" cellpadding="1" width="600" border="1"&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" width="600"&gt;
        &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;abstract class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;OriginalBase
&lt;/span&gt;{
   &lt;span style="color: blue"&gt;protected virtual void &lt;/span&gt;Test()
   {
   }
}

&lt;span style="color: blue"&gt;abstract class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SecondaryBase &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;OriginalBase
&lt;/span&gt;{
   &lt;span style="color: blue"&gt;protected sealed override void &lt;/span&gt;Test()
   {
      Test2();
   }

   &lt;span style="color: blue"&gt;protected abstract void &lt;/span&gt;Test2();
}

&lt;span style="color: blue"&gt;class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;FirstConcrete &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;SecondaryBase
&lt;/span&gt;{
   &lt;span style="color: green"&gt;// Have to override Test2 here
&lt;/span&gt;}

&lt;span style="color: blue"&gt;class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SecondConcrete &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;SecondaryBase
&lt;/span&gt;{
   &lt;span style="color: green"&gt;// Have to override Test2 here
&lt;/span&gt;}&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;With the above code, &lt;font face="Courier New" color="#2b91af" size="2"&gt;SecondaryBase&lt;/font&gt; class will &lt;a href="http://msdn.microsoft.com/en-us/library/88c54tsw.aspx"&gt;seal&lt;/a&gt; the &lt;font face="Courier New" size="2"&gt;Test&lt;/font&gt; method so it can no longer be overridden.  Then it also made an abstract method &lt;font face="Courier New" size="2"&gt;Test2&lt;/font&gt; available, which will force the concrete classes to override and provide the proper implementation.  Calling &lt;font face="Courier New" size="2"&gt;Test&lt;/font&gt; will properly call the proper &lt;font face="Courier New" size="2"&gt;Test2&lt;/font&gt; implementation in each respective concrete classes.&lt;/p&gt;

&lt;p&gt;I was wondering if there’s a way to tell the compiler to treat the &lt;font face="Courier New" size="2"&gt;Test&lt;/font&gt; method in &lt;font face="Courier New" color="#2b91af" size="2"&gt;SecondaryBase&lt;/font&gt; as abstract, and apparently you can, by combining the abstract and &lt;a href="http://msdn.microsoft.com/en-us/library/ebca9ah3.aspx"&gt;override&lt;/a&gt; keywords.  The code looks like the following:&lt;/p&gt;

&lt;table cellspacing="1" cellpadding="1" width="600" border="1"&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" width="600"&gt;
        &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;abstract class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;OriginalBase
&lt;/span&gt;{
   &lt;span style="color: blue"&gt;protected virtual void &lt;/span&gt;Test()
   {
   }
}

&lt;span style="color: blue"&gt;abstract class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SecondaryBase &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;OriginalBase
&lt;/span&gt;{
   &lt;span style="color: blue"&gt;protected abstract override void &lt;/span&gt;Test();
}

&lt;span style="color: blue"&gt;class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;FirstConcrete &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;SecondaryBase
&lt;/span&gt;{
   &lt;span style="color: green"&gt;// Have to override Test here
&lt;/span&gt;}

&lt;span style="color: blue"&gt;class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SecondConcrete &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;SecondaryBase
&lt;/span&gt;{
   &lt;span style="color: green"&gt;// Have to override Test here
&lt;/span&gt;}&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;The method signature makes it look a bit funky, because most people will treat the override keyword to mean you then need to provide the implementation as well, but the effect is exactly as we desired.  The concepts are still valid: you’re overriding the Test method from its original implementation in the &lt;font face="Courier New" color="#2b91af" size="2"&gt;OriginalBase&lt;/font&gt; class, but you don’t want to implement it, rather you want to classes that derive from &lt;font face="Courier New" color="#2b91af" size="2"&gt;SecondaryBase&lt;/font&gt; to provide the proper implementation, so you also make it as an abstract method.&lt;/p&gt;

&lt;p&gt;I don’t think I’ve ever seen this before in the wild, so it was pretty neat to find that the compiler does support this case.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/NewThingsILearned/aggbug/139668.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Muljadi Budiman</dc:creator>
            <guid>http://geekswithblogs.net/NewThingsILearned/archive/2010/05/04/protected-abstract-override-foo-ndash-er.-what.aspx</guid>
            <pubDate>Tue, 04 May 2010 18:25:37 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/NewThingsILearned/comments/139668.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/NewThingsILearned/archive/2010/05/04/protected-abstract-override-foo-ndash-er.-what.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/NewThingsILearned/comments/commentRss/139668.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/NewThingsILearned/services/trackbacks/139668.aspx</trackback:ping>
        </item>
        <item>
            <title>A quick hello to the Western Kentucky .NET User Group</title>
            <category>.NET</category>
            <link>http://geekswithblogs.net/NewThingsILearned/archive/2010/04/20/a-quick-hello-to-the-western-kentucky-.net-user-group.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/NewThingsILearned/archive/2010/04/20/a-quick-hello-to-the-western-kentucky-.net-user-group.aspx'&gt;http://geekswithblogs.net/NewThingsILearned/archive/2010/04/20/a-quick-hello-to-the-western-kentucky-.net-user-group.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;A few days back, I got a chance to speak at the &lt;a href="http://wkdnug.org"&gt;Western Kentucky .NET User Group&lt;/a&gt; meeting in &lt;a href="http://maps.google.com/maps?f=q&amp;amp;source=s_q&amp;amp;hl=en&amp;amp;geocode=&amp;amp;q=murray,+ky&amp;amp;sll=37.0625,-95.677068&amp;amp;sspn=55.937499,114.169922&amp;amp;ie=UTF8&amp;amp;hq=&amp;amp;hnear=Murray,+Calloway,+Kentucky&amp;amp;z=13"&gt;Murray, Kentucky&lt;/a&gt;.  The opportunity came up because the original speaker, &lt;a href="http://jeffblankenburg.com"&gt;Jeff Blankenburg&lt;/a&gt;, had another obligation and was thus unable to come to this meeting.  I volunteered to deliver his presentation, which is an overview of &lt;a href="http://live.visitmix.com/"&gt;MIX10&lt;/a&gt; conference.&lt;/p&gt;  &lt;p&gt;It was a great experience for me; got to drive around and do a little bit of sight-seeing – can’t say I’ve ever been to Kentucky before, so first trip ever there.  I got to meet the user group’s current lead, &lt;a href="http://wkdnug.org/contacts.html"&gt;Tom Turner&lt;/a&gt; and got to chat and discuss about all kinds of stuff with the other members.  Cheers to &lt;a href="http://twitter.com/mattgawarecki"&gt;Matt Gawarecki&lt;/a&gt; and &lt;a href="http://twitter.com/brandonsharp"&gt;Brandon Sharp&lt;/a&gt;!&lt;/p&gt;  &lt;p&gt;The presentation itself mostly covers new features in &lt;a href="http://www.microsoft.com/visualstudio"&gt;Visual Studio 2010&lt;/a&gt;, which was recently released on April 12 – got to demonstrate Historical Debugging in IntelliTrace, Parallel Stacks, View Call Hierarchy and show some Extensions.  We also covered some of the new functionalities in Silverlight 4 (using webcams, drag &amp;amp; drop support among others) and I got to show off &lt;a href="http://weblogs.asp.net/scottgu"&gt;Scott Guthrie&lt;/a&gt;’s &lt;a href="http://weblogs.asp.net/scottgu/archive/2010/03/18/building-a-windows-phone-7-twitter-application-using-silverlight.aspx?utm_source=twitterfeed&amp;amp;utm_medium=twitter"&gt;Windows Phone 7 Twitter app&lt;/a&gt;.  Altogether, it was quite a bit to cover in 70 minutes or so, but I think everyone enjoyed it.&lt;/p&gt;  &lt;p&gt;Jeff provided me with the &lt;a href="https://sites.google.com/site/newthingsilearned/geekswithblogs-net/MIX2010OVERVIEW.pptx?attredirects=0&amp;amp;d=1"&gt;presentation slides&lt;/a&gt; (which I modify a bit) and &lt;a href="https://sites.google.com/site/newthingsilearned/geekswithblogs-net/Demos.zip?attredirects=0&amp;amp;d=1"&gt;demo applications&lt;/a&gt;; so I’m putting it up here for those that may be interested in downloading them.  Please keep in mind that all the demos were made with VS2010 RC, so there may be slight tweaks to get it to work on the RTM version.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/NewThingsILearned/aggbug/139391.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Muljadi Budiman</dc:creator>
            <guid>http://geekswithblogs.net/NewThingsILearned/archive/2010/04/20/a-quick-hello-to-the-western-kentucky-.net-user-group.aspx</guid>
            <pubDate>Tue, 20 Apr 2010 19:58:24 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/NewThingsILearned/comments/139391.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/NewThingsILearned/archive/2010/04/20/a-quick-hello-to-the-western-kentucky-.net-user-group.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/NewThingsILearned/comments/commentRss/139391.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/NewThingsILearned/services/trackbacks/139391.aspx</trackback:ping>
        </item>
        <item>
            <title>Make KeyedCollection&amp;lt;TKey, TItem&amp;gt; to work properly with WPF data binding</title>
            <link>http://geekswithblogs.net/NewThingsILearned/archive/2010/01/12/make-keyedcollectionlttkey-titemgt-to-work-properly-with-wpf-data-binding.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/NewThingsILearned/archive/2010/01/12/make-keyedcollectionlttkey-titemgt-to-work-properly-with-wpf-data-binding.aspx'&gt;http://geekswithblogs.net/NewThingsILearned/archive/2010/01/12/make-keyedcollectionlttkey-titemgt-to-work-properly-with-wpf-data-binding.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;In my &lt;a href="http://geekswithblogs.net/NewThingsILearned/archive/2010/01/07/using-keyedcollectionlttkey-titemgt.aspx"&gt;previous post&lt;/a&gt;, I went through creating the KeyedCollectionEx class which allows easier consumption of the &lt;a href="http://msdn.microsoft.com/en-us/library/ms132438.aspx"&gt;KeyedCollection&lt;/a&gt; class (no need to derive anymore, just provide a &lt;a href="http://msdn.microsoft.com/en-us/library/ms173171(VS.80).aspx"&gt;delegate&lt;/a&gt;).  One of the problem I encountered was that when using it as an &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol.itemssource.aspx"&gt;ItemsSource&lt;/a&gt; in WPF, any changes to the collection will not be shown in the UI.  This is because the class doesn’t implement &lt;a href="http://msdn.microsoft.com/en-us/library/system.collections.specialized.inotifycollectionchanged.aspx"&gt;INotifyCollectionChanged&lt;/a&gt; interface.  So, let’s add that.&lt;/p&gt;  &lt;p&gt;The implementation is fairly straightforward; the class itself has all of the methods that will actually change the collection (&lt;a href="http://msdn.microsoft.com/en-us/library/ms132463.aspx"&gt;SetItem&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/ms132456.aspx"&gt;InsertItem&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/ms132450.aspx"&gt;ClearItems&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/ms132461.aspx"&gt;RemoveItem&lt;/a&gt;) to be &lt;a href="http://msdn.microsoft.com/en-us/library/9fkccyh4(VS.80).aspx"&gt;virtual&lt;/a&gt; so we just need to &lt;a href="http://msdn.microsoft.com/en-us/library/ebca9ah3(VS.80).aspx"&gt;override&lt;/a&gt; it.  With the implementation, the code looks like the following (only listing the INotifyCollectionChanged implementation, see previous post for the constructor &amp;amp; delegate implementation):&lt;/p&gt;  &lt;table cellspacing="1" cellpadding="1" width="600" border="1"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="600"&gt;         &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;KeyedCollectionEx&lt;/span&gt;&amp;lt;TKey, TItem&amp;gt; : &lt;span style="color: #2b91af"&gt;KeyedCollection&lt;/span&gt;&amp;lt;TKey, TItem&amp;gt;, &lt;span style="color: #2b91af"&gt;INotifyCollectionChanged
&lt;/span&gt;{
   &lt;span style="color: green"&gt;// Overrides a lot of methods that can cause collection change
   &lt;/span&gt;&lt;span style="color: blue"&gt;protected override void &lt;/span&gt;SetItem(&lt;span style="color: blue"&gt;int &lt;/span&gt;index, TItem item)
   {
      &lt;span style="color: blue"&gt;base&lt;/span&gt;.SetItem(index, item);
      OnCollectionChanged(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedEventArgs&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedAction&lt;/span&gt;.Replace, item, index)); 
   }

   &lt;span style="color: blue"&gt;protected override void &lt;/span&gt;InsertItem(&lt;span style="color: blue"&gt;int &lt;/span&gt;index, TItem item)
   {
      &lt;span style="color: blue"&gt;base&lt;/span&gt;.InsertItem(index, item);
      OnCollectionChanged(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedEventArgs&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedAction&lt;/span&gt;.Add, item, index)); 
   }

   &lt;span style="color: blue"&gt;protected override void &lt;/span&gt;ClearItems()
   {
      &lt;span style="color: blue"&gt;base&lt;/span&gt;.ClearItems();
      OnCollectionChanged(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedEventArgs&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedAction&lt;/span&gt;.Reset));
   }

   &lt;span style="color: blue"&gt;protected override void &lt;/span&gt;RemoveItem(&lt;span style="color: blue"&gt;int &lt;/span&gt;index)
   {
      TItem item = &lt;span style="color: blue"&gt;this&lt;/span&gt;[index];
      &lt;span style="color: blue"&gt;base&lt;/span&gt;.RemoveItem(index);
      OnCollectionChanged(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedEventArgs&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedAction&lt;/span&gt;.Remove, item));
   }

   &lt;span style="color: blue"&gt;protected virtual void &lt;/span&gt;OnCollectionChanged(&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedEventArgs &lt;/span&gt;e)
   {
      &lt;span style="color: blue"&gt;if &lt;/span&gt;(CollectionChanged != &lt;span style="color: blue"&gt;null&lt;/span&gt;)
         CollectionChanged(&lt;span style="color: blue"&gt;this&lt;/span&gt;, e);
   }

   &lt;span style="color: blue"&gt;#region &lt;/span&gt;INotifyCollectionChanged Members

   &lt;span style="color: blue"&gt;public event &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedEventHandler &lt;/span&gt;CollectionChanged;

   &lt;span style="color: blue"&gt;#endregion&lt;/span&gt;&lt;span style="color: green"&gt;
&lt;/span&gt;}&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;With the above code, now using this collection as an ItemsSource will cause WPF UIElements to show newly added / removed entities properly.  However, as detailed in my &lt;a href="http://geekswithblogs.net/NewThingsILearned/archive/2008/01/16/listcollectionviewcollectionview-doesnt-support-notifycollectionchanged-with-multiple-items.aspx"&gt;other post&lt;/a&gt; way back, if the collection is used a lot and does get bound as ItemSource to a lot of UIElements, adding / removing multiple items can hamper performance.&lt;/p&gt;

&lt;p&gt;To alleviate that issue I’m adding a public method called AddRange (mimicking the &lt;a href="http://msdn.microsoft.com/en-us/library/z883w3dc.aspx"&gt;AddRange&lt;/a&gt; method of &lt;a href="http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx"&gt;List&amp;lt;T&amp;gt;&lt;/a&gt;).  I need a boolean variable (which I named &lt;font face="Courier New" size="2"&gt;_deferNotifyCollectionChanged&lt;/font&gt;) to indicate if the class should raise the event or not – if I don’t do that each call to &lt;a href="http://msdn.microsoft.com/en-us/library/ms132404.aspx"&gt;Add&lt;/a&gt; will result in a &lt;a href="http://msdn.microsoft.com/en-us/library/system.collections.specialized.inotifycollectionchanged.collectionchanged.aspx"&gt;CollectionChanged&lt;/a&gt; event being raised.  The code will then look like as follows:&lt;/p&gt;

&lt;table cellspacing="1" cellpadding="1" width="600" border="1"&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" width="600"&gt;
        &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;private bool &lt;/span&gt;_deferNotifyCollectionChanged = &lt;span style="color: blue"&gt;false&lt;/span&gt;;
&lt;span style="color: blue"&gt;public void &lt;/span&gt;AddRange(&lt;span style="color: #2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;TItem&amp;gt; items)
{
   _deferNotifyCollectionChanged = &lt;span style="color: blue"&gt;true&lt;/span&gt;;
   &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;item &lt;span style="color: blue"&gt;in &lt;/span&gt;items)
      Add(item);
   _deferNotifyCollectionChanged = &lt;span style="color: blue"&gt;false&lt;/span&gt;;
   OnCollectionChanged(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedEventArgs&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedAction&lt;/span&gt;.Add, &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;TItem&amp;gt;(items)));
}

&lt;span style="color: blue"&gt;protected virtual void &lt;/span&gt;OnCollectionChanged(&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedEventArgs &lt;/span&gt;e)
{
   &lt;span style="color: blue"&gt;if &lt;/span&gt;(_deferNotifyCollectionChanged)
      &lt;span style="color: blue"&gt;return&lt;/span&gt;;

   &lt;span style="color: blue"&gt;if &lt;/span&gt;(CollectionChanged != &lt;span style="color: blue"&gt;null&lt;/span&gt;)
      CollectionChanged(&lt;span style="color: blue"&gt;this&lt;/span&gt;, e);
}&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;There’s a problem with this though; if you call this method a &lt;a href="http://msdn.microsoft.com/en-us/library/system.notsupportedexception.aspx"&gt;NotSupportedException&lt;/a&gt; exception will be thrown; the message says ‘Range actions are not supported’.  Essentially the UIElements doesn’t support change notification where multiple items are changed.  As such we have to provide a workaround for this; either using the approach detailed in my &lt;a href="http://geekswithblogs.net/NewThingsILearned/archive/2008/01/16/listcollectionviewcollectionview-doesnt-support-notifycollectionchanged-with-multiple-items.aspx"&gt;other post&lt;/a&gt;, or by changing the AddRange method to the following:&lt;/p&gt;

&lt;table cellspacing="1" cellpadding="1" width="600" border="1"&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" width="600"&gt;
        &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public void &lt;/span&gt;AddRange(&lt;span style="color: #2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;TItem&amp;gt; items)
{
   _deferNotifyCollectionChanged = &lt;span style="color: blue"&gt;true&lt;/span&gt;;
   &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;item &lt;span style="color: blue"&gt;in &lt;/span&gt;items)
      Add(item);
   _deferNotifyCollectionChanged = &lt;span style="color: blue"&gt;false&lt;/span&gt;;

   OnCollectionChanged(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedEventArgs&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedAction&lt;/span&gt;.Reset));
}&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;The code above is simpler than the other post (well, I’m learning new tips and tricks over the years and months).  Instead of specifying what has been added, the &lt;a href="http://msdn.microsoft.com/en-us/library/system.collections.specialized.notifycollectionchangedaction.aspx"&gt;NotifyCollectionChangedAction&lt;/a&gt; used is Reset, which signals the CollectionChanged event subscribers that the collection has changed tremendously so it should re-read the whole collection.  Please use with care; if you have a list which have 10000 items and you’re only adding a small amount to that list, a Reset will be much more expensive than notifying individual addition.&lt;/p&gt;

&lt;p&gt;Below is pasted the full source of the class.  Since the behavior has changed, I’m also renaming the class to ObservableKeyedCollection, which sounds better than adding an Ex to an existing class name.  I hope this can be of use to others.&lt;/p&gt;

&lt;table cellspacing="1" cellpadding="1" width="600" border="1"&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" width="600"&gt;
        &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ObservableKeyedCollection&lt;/span&gt;&amp;lt;TKey, TItem&amp;gt; : &lt;span style="color: #2b91af"&gt;KeyedCollection&lt;/span&gt;&amp;lt;TKey, TItem&amp;gt;, &lt;span style="color: #2b91af"&gt;INotifyCollectionChanged
&lt;/span&gt;{
   &lt;span style="color: blue"&gt;private &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Func&lt;/span&gt;&amp;lt;TItem, TKey&amp;gt; _getKeyForItemDelegate;

   &lt;span style="color: green"&gt;// Constructor now requires a delegate to get the key from the item
   &lt;/span&gt;&lt;span style="color: blue"&gt;public &lt;/span&gt;ObservableKeyedCollection(&lt;span style="color: #2b91af"&gt;Func&lt;/span&gt;&amp;lt;TItem, TKey&amp;gt; getKeyForItemDelegate) : &lt;span style="color: blue"&gt;base&lt;/span&gt;()
   {
      &lt;span style="color: blue"&gt;if &lt;/span&gt;(getKeyForItemDelegate == &lt;span style="color: blue"&gt;null&lt;/span&gt;)
         &lt;span style="color: blue"&gt;throw new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ArgumentNullException&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Delegate passed can't be null!"&lt;/span&gt;);

      _getKeyForItemDelegate = getKeyForItemDelegate;
   }

   &lt;span style="color: blue"&gt;protected override &lt;/span&gt;TKey GetKeyForItem(TItem item)
   {
      &lt;span style="color: blue"&gt;return &lt;/span&gt;_getKeyForItemDelegate(item);
   }

   &lt;span style="color: green"&gt;// Overrides a lot of methods that can cause collection change
   &lt;/span&gt;&lt;span style="color: blue"&gt;protected override void &lt;/span&gt;SetItem(&lt;span style="color: blue"&gt;int &lt;/span&gt;index, TItem item)
   {
      &lt;span style="color: blue"&gt;base&lt;/span&gt;.SetItem(index, item);
      OnCollectionChanged(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedEventArgs&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedAction&lt;/span&gt;.Replace, item, index)); 
   }

   &lt;span style="color: blue"&gt;protected override void &lt;/span&gt;InsertItem(&lt;span style="color: blue"&gt;int &lt;/span&gt;index, TItem item)
   {
      &lt;span style="color: blue"&gt;base&lt;/span&gt;.InsertItem(index, item);
      OnCollectionChanged(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedEventArgs&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedAction&lt;/span&gt;.Add, item, index)); 
   }

   &lt;span style="color: blue"&gt;protected override void &lt;/span&gt;ClearItems()
   {
      &lt;span style="color: blue"&gt;base&lt;/span&gt;.ClearItems();
      OnCollectionChanged(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedEventArgs&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedAction&lt;/span&gt;.Reset));
   }

   &lt;span style="color: blue"&gt;protected override void &lt;/span&gt;RemoveItem(&lt;span style="color: blue"&gt;int &lt;/span&gt;index)
   {
      TItem item = &lt;span style="color: blue"&gt;this&lt;/span&gt;[index];
      &lt;span style="color: blue"&gt;base&lt;/span&gt;.RemoveItem(index);
      OnCollectionChanged(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedEventArgs&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedAction&lt;/span&gt;.Remove, item));
   }

   &lt;span style="color: blue"&gt;private bool &lt;/span&gt;_deferNotifyCollectionChanged = &lt;span style="color: blue"&gt;false&lt;/span&gt;;
   &lt;span style="color: blue"&gt;public void &lt;/span&gt;AddRange(&lt;span style="color: #2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;TItem&amp;gt; items)
   {
      _deferNotifyCollectionChanged = &lt;span style="color: blue"&gt;true&lt;/span&gt;;
      &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;item &lt;span style="color: blue"&gt;in &lt;/span&gt;items)
         Add(item);
      _deferNotifyCollectionChanged = &lt;span style="color: blue"&gt;false&lt;/span&gt;;

      OnCollectionChanged(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedEventArgs&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedAction&lt;/span&gt;.Reset));
   }

   &lt;span style="color: blue"&gt;protected virtual void &lt;/span&gt;OnCollectionChanged(&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedEventArgs &lt;/span&gt;e)
   {
      &lt;span style="color: blue"&gt;if &lt;/span&gt;(_deferNotifyCollectionChanged)
         &lt;span style="color: blue"&gt;return&lt;/span&gt;;

      &lt;span style="color: blue"&gt;if &lt;/span&gt;(CollectionChanged != &lt;span style="color: blue"&gt;null&lt;/span&gt;)
         CollectionChanged(&lt;span style="color: blue"&gt;this&lt;/span&gt;, e);
   }

   &lt;span style="color: blue"&gt;#region &lt;/span&gt;INotifyCollectionChanged Members

   &lt;span style="color: blue"&gt;public event &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NotifyCollectionChangedEventHandler &lt;/span&gt;CollectionChanged;

   &lt;span style="color: blue"&gt;#endregion
&lt;/span&gt;}&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt; &lt;img src="http://geekswithblogs.net/NewThingsILearned/aggbug/137450.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Muljadi Budiman</dc:creator>
            <guid>http://geekswithblogs.net/NewThingsILearned/archive/2010/01/12/make-keyedcollectionlttkey-titemgt-to-work-properly-with-wpf-data-binding.aspx</guid>
            <pubDate>Tue, 12 Jan 2010 15:42:24 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/NewThingsILearned/comments/137450.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/NewThingsILearned/archive/2010/01/12/make-keyedcollectionlttkey-titemgt-to-work-properly-with-wpf-data-binding.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/NewThingsILearned/comments/commentRss/137450.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/NewThingsILearned/services/trackbacks/137450.aspx</trackback:ping>
        </item>
        <item>
            <title>Using KeyedCollection&amp;lt;TKey, TItem&amp;gt;</title>
            <link>http://geekswithblogs.net/NewThingsILearned/archive/2010/01/07/using-keyedcollectionlttkey-titemgt.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/NewThingsILearned/archive/2010/01/07/using-keyedcollectionlttkey-titemgt.aspx'&gt;http://geekswithblogs.net/NewThingsILearned/archive/2010/01/07/using-keyedcollectionlttkey-titemgt.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;A little over 2 years ago, I saw my peer’s code that uses the &lt;a href="http://msdn.microsoft.com/en-us/library/ms132438.aspx"&gt;KeyedCollection&amp;lt;TKey, TItem&amp;gt;&lt;/a&gt; class.  I never seen it before, and it is actually a pretty nice class.  It is essentially a dictionary class, but with the stipulation that the key for each item added to the dictionary can be retrieved from the item itself.  &lt;/p&gt;  &lt;p&gt;With a &lt;a href="http://msdn.microsoft.com/en-us/library/xfhwa508.aspx"&gt;Dictionary&lt;/a&gt;, every time we wanted to add a new item into it, we have to call its &lt;a href="http://msdn.microsoft.com/en-us/library/k7z0zy8k.aspx"&gt;Add&lt;/a&gt; method, which accepts 2 parameters, the key for the item and the item itself.  In most cases, the key already is in the item, so we’re just reduplicating it.  This KeyedCollection class provides a shortcut since we can just provide it a method so it can get the key for each item added automatically.&lt;/p&gt;  &lt;p&gt;The following code show how Dictionary and KeyedCollection can be used:&lt;/p&gt;  &lt;table cellspacing="1" cellpadding="1" width="600" border="1"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="600"&gt;         &lt;pre class="code"&gt;&lt;span style="color: green"&gt;// Class to contain data stuff
&lt;/span&gt;&lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MyData
&lt;/span&gt;{
   &lt;span style="color: blue"&gt;public int &lt;/span&gt;Id { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }
   &lt;span style="color: blue"&gt;public string &lt;/span&gt;Data { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }
 }

&lt;span style="color: green"&gt;// KeyedCollection is an abstract class, so have to derive
&lt;/span&gt;&lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MyDataKeyedCollection &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;KeyedCollection&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;int&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;MyData&lt;/span&gt;&amp;gt;
{
   &lt;span style="color: blue"&gt;protected override int &lt;/span&gt;GetKeyForItem(&lt;span style="color: #2b91af"&gt;MyData &lt;/span&gt;item)
   {
      &lt;span style="color: blue"&gt;return &lt;/span&gt;item.Id;
   }
}

&lt;span style="color: blue"&gt;private void &lt;/span&gt;Test()
{
   &lt;span style="color: #2b91af"&gt;MyData &lt;/span&gt;temp, md = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MyData&lt;/span&gt;() { Id = 1, Data = &lt;span style="color: #a31515"&gt;"Test" &lt;/span&gt;};
   
   &lt;span style="color: green"&gt;// Using a Dictionary
   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;int&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;MyData&lt;/span&gt;&amp;gt; dict = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;int&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;MyData&lt;/span&gt;&amp;gt;();
   dict.Add(md.Id, md);  &lt;span style="color: green"&gt;// Add to dictionary
   &lt;/span&gt;temp = dict[1];       &lt;span style="color: green"&gt;// Retrieve

   // Using KeyedCollection
   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;KeyedCollection&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;int&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;MyData&lt;/span&gt;&amp;gt; keyd = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MyDataKeyedCollection&lt;/span&gt;();
   keyd.Add(md);         &lt;span style="color: green"&gt;// Add to KeyedCollection
   &lt;/span&gt;temp = keyd[1];       &lt;span style="color: green"&gt;// Retrieve
&lt;/span&gt;}&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;As you can see, usage is very, very similar to a Dictionary, with the only difference that the &lt;a href="http://msdn.microsoft.com/en-us/library/ms132404.aspx"&gt;Add&lt;/a&gt; method only accepts 1 parameter.  Retrieval is exactly the same.  However, since KeyedCollection is an abstract class, you cannot use it directly; you have to derive from it and use your derived class – that’s why I created the MyDataKeyedCollection class.  This MyDataKeyedCollection class has to override the &lt;a href="http://msdn.microsoft.com/en-us/library/ms132454.aspx"&gt;GetKeyForItem&lt;/a&gt; method (which is declared as an abstract method in the base class) so you can retrieve the key for the given item.  For me this is somewhat of a deal breaker – I have to always derive from it – there’s no way to use it easily, like a typical collection class.&lt;/p&gt;

&lt;p&gt;So my next step is to try to make it easier to consume… thus I created my KeyedCollectionEx class.&lt;/p&gt;

&lt;table cellspacing="1" cellpadding="1" width="600" border="1"&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" width="600"&gt;
        &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;KeyedCollectionEx&lt;/span&gt;&amp;lt;TKey, TItem&amp;gt; : &lt;span style="color: #2b91af"&gt;KeyedCollection&lt;/span&gt;&amp;lt;TKey, TItem&amp;gt;
{
   &lt;span style="color: blue"&gt;private &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Func&lt;/span&gt;&amp;lt;TItem, TKey&amp;gt; _getKeyForItemDelegate;
   &lt;span style="color: blue"&gt;public &lt;/span&gt;KeyedCollectionEx(&lt;span style="color: #2b91af"&gt;Func&lt;/span&gt;&amp;lt;TItem, TKey&amp;gt; getKeyForItemDelegate) : &lt;span style="color: blue"&gt;base&lt;/span&gt;()
   {
      &lt;span style="color: blue"&gt;if &lt;/span&gt;(getKeyForItemDelegate == &lt;span style="color: blue"&gt;null&lt;/span&gt;)
         &lt;span style="color: blue"&gt;throw new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ArgumentNullException&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Delegate passed can't be null!"&lt;/span&gt;);

      _getKeyForItemDelegate = getKeyForItemDelegate;
   }

   &lt;span style="color: blue"&gt;protected override &lt;/span&gt;TKey GetKeyForItem(TItem item)
   {
      &lt;span style="color: blue"&gt;return &lt;/span&gt;_getKeyForItemDelegate(item);
   }
}&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;The constructor now requires a delegate that will get the TKey for the given TItem – I’m using the &lt;a href="http://msdn.microsoft.com/en-us/library/bb549151.aspx"&gt;Func&lt;/a&gt; delegate which is in .NET 3.0, so if you’re using .NET 2.0, you need to create your own delegate signature.  With this, my test method becomes as follows: &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;table cellspacing="1" cellpadding="1" width="600" border="1"&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" width="600"&gt;
        &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;private void &lt;/span&gt;Test2()
{
   &lt;span style="color: #2b91af"&gt;MyData &lt;/span&gt;temp, md = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MyData&lt;/span&gt;() { Id = 1, Data = &lt;span style="color: #a31515"&gt;"Test" &lt;/span&gt;};

   &lt;span style="color: green"&gt;// Using KeyedCollectionEx with anonymous delegate
   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;KeyedCollection&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;int&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;MyData&lt;/span&gt;&amp;gt; keyd = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;KeyedCollectionEx&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;int&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;MyData&lt;/span&gt;&amp;gt;(&lt;span style="color: blue"&gt;delegate&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;MyData &lt;/span&gt;myData) { &lt;span style="color: blue"&gt;return &lt;/span&gt;myData.Id; });
   keyd.Add(md);         &lt;span style="color: green"&gt;// Add to KeyedCollection
   &lt;/span&gt;temp = keyd[1];       &lt;span style="color: green"&gt;// Retrieve

   // Using KeyedCollectionEx with lambda expression
   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;KeyedCollection&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;int&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;MyData&lt;/span&gt;&amp;gt; keyd2 = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;KeyedCollectionEx&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;int&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;MyData&lt;/span&gt;&amp;gt;(myData =&amp;gt; myData.Id);
   keyd2.Add(md);         &lt;span style="color: green"&gt;// Add to KeyedCollection
   &lt;/span&gt;temp = keyd2[1];       &lt;span style="color: green"&gt;// Retrieve
&lt;/span&gt;}&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;I demonstrated how to use it with &lt;a href="http://msdn.microsoft.com/en-us/library/0yw3tz5k(VS.80).aspx"&gt;anonymous methods&lt;/a&gt; (so I don’t have to create a method for it), and also how to use it with a &lt;a href="http://msdn.microsoft.com/en-us/library/bb397687.aspx"&gt;lambda expression&lt;/a&gt;.  Much simpler, IMHO – no need to create a derived class.  However, I would like this to work with WPF’s &lt;a href="http://msdn.microsoft.com/en-us/library/ms752347.aspx"&gt;data binding&lt;/a&gt; – so I’d like further enhance my KeyedCollectionEx class so it can notify WPF when items are being added or removed from it – that’ll be my next post.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/NewThingsILearned/aggbug/137387.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Muljadi Budiman</dc:creator>
            <guid>http://geekswithblogs.net/NewThingsILearned/archive/2010/01/07/using-keyedcollectionlttkey-titemgt.aspx</guid>
            <pubDate>Thu, 07 Jan 2010 22:42:31 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/NewThingsILearned/comments/137387.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/NewThingsILearned/archive/2010/01/07/using-keyedcollectionlttkey-titemgt.aspx#feedback</comments>
            <slash:comments>10</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/NewThingsILearned/comments/commentRss/137387.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/NewThingsILearned/services/trackbacks/137387.aspx</trackback:ping>
        </item>
        <item>
            <title>Connect to VMWare virtual machines using Remote Desktop</title>
            <category>Windows</category>
            <link>http://geekswithblogs.net/NewThingsILearned/archive/2009/11/13/connect-to-vmware-virtual-machines-using-remote-desktop.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/NewThingsILearned/archive/2009/11/13/connect-to-vmware-virtual-machines-using-remote-desktop.aspx'&gt;http://geekswithblogs.net/NewThingsILearned/archive/2009/11/13/connect-to-vmware-virtual-machines-using-remote-desktop.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Had a short training on &lt;a href="http://www.vmware.com/"&gt;VMWare&lt;/a&gt; on Tuesday, the software development department finally got the official permission (read: get a license) to use &lt;a href="http://www.vmware.com/products/workstation/"&gt;VMWare Workstation&lt;/a&gt;.  I’m no stranger to &lt;a href="http://en.wikipedia.org/wiki/Virtual_machine"&gt;Virtual Machines&lt;/a&gt; (VMs) – started playing with &lt;a href="http://www.microsoft.com/windows/virtual-pc/"&gt;Virtual PC&lt;/a&gt; 2005 a fwe years back and I understood the general concepts of hardware virtualization.  The biggest problem I have with VMs in general is the slowness; I’d rather develop directly on my PC, which is faster.  Can’t say I’ve delved deep into it, but I know enough to utilize it and be dangerous &lt;img src="/Providers/BlogEntryEditor/FCKeditor/editor/images/smiley/msn/regular_smile.gif" /&gt;.&lt;/p&gt;  &lt;p&gt;Regardless, virtual machines provide a way to simulate multiple computers and I’ve done 3-tier software testing (client to app server using WCF and app server to SQL 2005 backend) to verify our framework can support both 2-tier (client –&amp;gt; DB) and 3-tier deployments.  Rarely used it for development, again due to speed.&lt;/p&gt;  &lt;p&gt;Fast forward to the current time, I’d like to be able to do some coding on &lt;a href="http://www.microsoft.com/windows/windows-7/"&gt;Windows 7&lt;/a&gt;; unfortunately Windows 7 is not quite sanctioned yet to be deployed, and it’s a pain to have to dual-boot.  I do have Windows 7 at home, but got way too many experimental stuff on it &lt;img src="/Providers/BlogEntryEditor/FCKeditor/editor/images/smiley/msn/regular_smile.gif" /&gt;.  So, I’m setting up a Windows 7 VM so I can do some coding on it.&lt;/p&gt;  &lt;p&gt;Now, nothing wrong with running the VM within VMWare, but I always find that it is a bit sluggish unless I go to full screen mode.  If I do so, it’s a bit of a pain to go back and forth between the host and the VM, and it also means that I have to do it at the host.  Ideally, I’d like to &lt;a href="http://www.microsoft.com/windowsXp/using/mobility/getstarted/Remoteintro.mspx"&gt;remote desktop&lt;/a&gt; into it (for whatever reason, I also feel remoting into a VM session makes for a snappier UI response).&lt;/p&gt;  &lt;p&gt;However, this is not immediately possible to do without some setup; out of the box VMWare provides &lt;a href="http://en.wikipedia.org/wiki/Virtual_Network_Computing"&gt;VNC&lt;/a&gt; connectivity, so you can use that but I am spoiled by remote desktop – it is just way nicer than VNC.  Of course one of the advantages of VNC is that if someone connects to it, the original don’t lose the view of the PC, so different tools for a different job.&lt;/p&gt;  &lt;p&gt;In any case, I’d like to be able to remote desktop into my VMs – there are 2 ways to set this up, one is faster but it is considered as ‘nice’ and may cause problems with typical corporate network setups.  Let’s look at the first approach:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://gwb.blob.core.windows.net/newthingsilearned/WindowsLiveWriter/ConnecttoVMWarevirtualmachinesusingRemot_DAB4/image_4.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="554" alt="image" src="http://gwb.blob.core.windows.net/newthingsilearned/WindowsLiveWriter/ConnecttoVMWarevirtualmachinesusingRemot_DAB4/image_thumb_1.png" width="653" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The first approach is to set up the VM setting to have it’s network adapter be a Bridged connection.  This basically sets the VM to use the host’s network card as if it were its own network card.  This also means that the VM will get an IP based on the host network’s settings (usually DHCP-based).  Essentially it brings the network connectivity of the VM to be at the same level as the host.  Now, in a corporate environment (usually domain-based), this may not be allowed, or you may have trouble with accessing the network at all if your VM is not added to the domain.  On a local (home) network, it also means it can communicate with other computers on the same network (good), but if it gets infected with a worm / virus it can also spread to the other computers (bad).&lt;/p&gt;  &lt;p&gt;Depending on your environment, bridging may be fine and if you can do that then by setting it to Bridged mode you can then remote desktop to the VM (you have to remember to turn it on within the VM).&lt;/p&gt;  &lt;p&gt;However, in my current situation, setting a VM network in bridged mode is not condoned and we have to set it to NAT setup.  Each VM that you spun will then get a typical internal IP address (192.168.XXX.XXX); but that means you cannot get to it from the outside.  So what to do?  The answer was provided in &lt;a href="http://communities.vmware.com/thread/106700"&gt;this post&lt;/a&gt; by &lt;a href="http://communities.vmware.com/people/rsa911"&gt;rsa911&lt;/a&gt;– I’m just providing the nice UI snapshots (and also as a reminder for me on how I got it to work in the future).&lt;/p&gt;  &lt;p&gt;In NAT mode, each VM is given an internal IP address and VMWare essentially becomes the bridge between the host and the VMs that runs in it.  Fortunately, you can do &lt;a href="http://en.wikipedia.org/wiki/Port_forwarding"&gt;port forwarding&lt;/a&gt; to these internal IP address.  As detailed &lt;a href="http://en.wikipedia.org/wiki/Remote_Desktop_Protocol"&gt;here&lt;/a&gt;, Remote Desktop uses port 3389 to listen to incoming RDP requests.  So what we need to do is forward an unused port to each VM’s port 3389 and we should be able to remote into them.  Let’s see how that’s done.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://gwb.blob.core.windows.net/newthingsilearned/WindowsLiveWriter/ConnecttoVMWarevirtualmachinesusingRemot_DAB4/image_8.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="690" alt="image" src="http://gwb.blob.core.windows.net/newthingsilearned/WindowsLiveWriter/ConnecttoVMWarevirtualmachinesusingRemot_DAB4/image_thumb_3.png" width="621" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;To do port forwarding, we need to access the Virtual Network Editor from VMWare Workstation (under the Edit Menu –&amp;gt; Virtual Network Editor).  The dialog above should show up – select the network adapter that is set to NAT.  Then click on the ‘NAT Settings…’ button, the following dialog will show up:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://gwb.blob.core.windows.net/newthingsilearned/WindowsLiveWriter/ConnecttoVMWarevirtualmachinesusingRemot_DAB4/image_10.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="477" alt="image" src="http://gwb.blob.core.windows.net/newthingsilearned/WindowsLiveWriter/ConnecttoVMWarevirtualmachinesusingRemot_DAB4/image_thumb_4.png" width="499" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Click on the ‘Add’ button, and a dialog to map incoming port shows up; the dialog below is filled with the following information:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Listen to port 9997&lt;/li&gt;    &lt;li&gt;Any TCP communication to that port, forward it to the VM with IP of 192.168.118.130 on port 3389 (default RDP port)&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://gwb.blob.core.windows.net/newthingsilearned/WindowsLiveWriter/ConnecttoVMWarevirtualmachinesusingRemot_DAB4/image_12.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="225" alt="image" src="http://gwb.blob.core.windows.net/newthingsilearned/WindowsLiveWriter/ConnecttoVMWarevirtualmachinesusingRemot_DAB4/image_thumb_5.png" width="360" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;   &lt;/p&gt;&lt;p&gt;&lt;/p&gt;    &lt;p&gt;Tweak it to satisfy your setup – the host port just needs to be an unused port (in this example I use 9997), the VM port needs to be 3389 (unless you’ve changed it) and the VM IP address needs to be the IP address assigned to the VM you’re running (in &lt;a href="http://en.wikipedia.org/wiki/Command_Prompt"&gt;Command Prompt&lt;/a&gt; run &lt;a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ipconfig.mspx?mfr=true"&gt;ipconfig&lt;/a&gt; to easily see this); this is what my output looks like:&lt;/p&gt;    &lt;p&gt;&lt;a href="http://gwb.blob.core.windows.net/newthingsilearned/WindowsLiveWriter/ConnecttoVMWarevirtualmachinesusingRemot_DAB4/image_14.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="228" alt="image" src="http://gwb.blob.core.windows.net/newthingsilearned/WindowsLiveWriter/ConnecttoVMWarevirtualmachinesusingRemot_DAB4/image_thumb_6.png" width="684" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;   &lt;p&gt;When done, click OK and the NAT Settings dialog will show up your port forward:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://gwb.blob.core.windows.net/newthingsilearned/WindowsLiveWriter/ConnecttoVMWarevirtualmachinesusingRemot_DAB4/image_16.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="263" alt="image" src="http://gwb.blob.core.windows.net/newthingsilearned/WindowsLiveWriter/ConnecttoVMWarevirtualmachinesusingRemot_DAB4/image_thumb_7.png" width="496" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So now I’ve set up VMWare so any incoming request to port 9997 will be forwarded to port 3389 on the VM that has IP of 192.168.118.130.  Remember that for Remote Desktop to work, you still need to make sure your VM has RDP enabled and you have users with passwords added as Remote Users.&lt;/p&gt;  &lt;p&gt;The question is then how do you issue the remote desktop request?  Well, you use the host’s IP (or machine name) as the target, but you provide the port number as well:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://gwb.blob.core.windows.net/newthingsilearned/WindowsLiveWriter/ConnecttoVMWarevirtualmachinesusingRemot_DAB4/image_18.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="246" alt="image" src="http://gwb.blob.core.windows.net/newthingsilearned/WindowsLiveWriter/ConnecttoVMWarevirtualmachinesusingRemot_DAB4/image_thumb_8.png" width="414" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The VMWare is hosted in my laptop (mbudimane6500) and I’m providing the port RDP should use (9997).  Remember that in a domain environment it’ll try to login as a domain user (DOMAIN_NAME\username format), so if your VM machine is not part of a domain you have to change the username to use to log in.&lt;/p&gt;  &lt;p&gt;If you’ve done everything as mentioned above, now you can remote desktop into your VM machines in a NAT environment &lt;img src="/Providers/BlogEntryEditor/FCKeditor/editor/images/smiley/msn/regular_smile.gif" /&gt;.  Remember also that you have to &lt;u&gt;do the port forward for every VM&lt;/u&gt; that you wanted to remote into – each one will have a different IP address and each one will need to have a different port number.  Hope this helps others.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/NewThingsILearned/aggbug/136289.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Muljadi Budiman</dc:creator>
            <guid>http://geekswithblogs.net/NewThingsILearned/archive/2009/11/13/connect-to-vmware-virtual-machines-using-remote-desktop.aspx</guid>
            <pubDate>Fri, 13 Nov 2009 20:42:41 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/NewThingsILearned/comments/136289.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/NewThingsILearned/archive/2009/11/13/connect-to-vmware-virtual-machines-using-remote-desktop.aspx#feedback</comments>
            <slash:comments>32</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/NewThingsILearned/comments/commentRss/136289.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/NewThingsILearned/services/trackbacks/136289.aspx</trackback:ping>
        </item>
        <item>
            <title>Make SQLExpress DB accessible from other computers</title>
            <link>http://geekswithblogs.net/NewThingsILearned/archive/2009/11/11/make-sqlexpress-db-accessible-from-other-computers.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/NewThingsILearned/archive/2009/11/11/make-sqlexpress-db-accessible-from-other-computers.aspx'&gt;http://geekswithblogs.net/NewThingsILearned/archive/2009/11/11/make-sqlexpress-db-accessible-from-other-computers.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;When I started using &lt;a href="http://www.microsoft.com/Sqlserver/2005/en/us/express.aspx"&gt;SQLExpress 2005&lt;/a&gt;, everything works on my development machine – however when I wanted to access the database from another machine (trying to access the sqlexpress database remotely) I was not successful.  I discovered the solution way back then, also through &lt;a href="http://www.google.com/search?hl=en&amp;amp;source=hp&amp;amp;q=connect+to+sqlexpress&amp;amp;aq=f&amp;amp;oq=&amp;amp;aqi=g-s1g-sx1g1g-sx6"&gt;Google searches&lt;/a&gt;, which still yield a &lt;a href="http://blogs.msdn.com/sqlexpress/archive/2004/07/23/192044.aspx"&gt;valid result&lt;/a&gt;.  However, every now and then my peers would ask me this same question again.&lt;/p&gt;  &lt;p&gt;Thus I’m creating this blog so I can forward them to this page (instead of talking about it); it’ll also remind me of how to do it if my memory starts to fail me.&lt;/p&gt;  &lt;p&gt;By default, SQLExpress installations does not allow remote connections, so we need to change that first.  To change it, you have to run the &lt;a href="http://technet.microsoft.com/en-us/library/ms173748(SQL.90).aspx"&gt;SQL Server Surface Area Configuration&lt;/a&gt; tool – as the name vaguely implied, this tool will allow you to configure SQL Server’s Surface (what gets exposed).  This tool is installed with your SQL installation (express or not); it should be located in the Microsoft SQL Server 2005 / 2008 program group, under the Configuration Tools subgroup.&lt;/p&gt;  &lt;p&gt;When you run this, the following dialog appears:&lt;/p&gt;  &lt;p&gt; &lt;img title="sac01" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="593" alt="sac01" src="http://gwb.blob.core.windows.net/newthingsilearned/WindowsLiveWriter/MakeSQLExpressDBaccessiblefromothercompu_D208/sac01_2.png" width="659" border="0" /&gt;&lt;/p&gt;  &lt;p&gt;Select the ‘Surface Area Configuration for Services and Connections’ (as circled above).  The next dialog should appear:&lt;/p&gt;  &lt;p&gt;&lt;img title="sac02" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="514" alt="sac02" src="http://gwb.blob.core.windows.net/newthingsilearned/WindowsLiveWriter/MakeSQLExpressDBaccessiblefromothercompu_D208/sac02_1.png" width="668" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;Select the Remote Connections node on the tree view (as circled above); the dialog changes to the following:&lt;/p&gt;  &lt;p&gt;&lt;img title="sac03" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="515" alt="sac03" src="http://gwb.blob.core.windows.net/newthingsilearned/WindowsLiveWriter/MakeSQLExpressDBaccessiblefromothercompu_D208/sac03_1.png" width="671" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;As you can see, SQL Express by default does not allow remote connections (the text above it also enforces that); so we’d like to change that – select the ‘Local and remote connections’ radio button, depending on your needs you choose to use TCP/IP or &lt;a href="http://technet.microsoft.com/en-us/library/cc958776.aspx"&gt;named pipes&lt;/a&gt; or both, then click the ‘Apply’ button – an alert should show up telling you that the settings will not take effect until the database engine is restarted, we’ll do this last.&lt;/p&gt;  &lt;p&gt;We’re not finished yet; what happens right now is that the system is set up to allow remote connections.  However, there’s another piece of service that needs to be up before we can connect to it remotely.  That service is the &lt;a href="http://msdn.microsoft.com/en-us/library/ms181087.aspx"&gt;SQL Server Browser&lt;/a&gt; service.  Select the SQL Server Browser node on the left tree view, and the dialog will change to show the following:&lt;/p&gt;  &lt;p&gt;&lt;img title="sac04" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="515" alt="sac04" src="http://gwb.blob.core.windows.net/newthingsilearned/WindowsLiveWriter/MakeSQLExpressDBaccessiblefromothercompu_D208/sac04_1.png" width="673" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;Again, by default the SQLBrowser service is disabled, so let’s change that to Manual, click ‘Apply’ (which will enable the ‘Start’ button) then click the ‘Start’ button, which will start the service.  OK, we’re almost finished; the last step is to restart the SQL Server service itself, so let’s click on the Service node under the SQLEXPRESS and Database Engine node in the tree view.  The dialog will change to the following:&lt;/p&gt;  &lt;p&gt;&lt;img title="sac05" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="514" alt="sac05" src="http://gwb.blob.core.windows.net/newthingsilearned/WindowsLiveWriter/MakeSQLExpressDBaccessiblefromothercompu_D208/sac05_1.png" width="671" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;Click ‘Stop’ and then wait for the service stoppage to complete, then click ‘Start’ again.  You should be able to connect to your SQLExpress instance from another computer (if it’s the default instance, you would use &lt;em&gt;computername&lt;/em&gt;\SQLEXPRESS as the server name).  Good luck!&lt;/p&gt; &lt;img src="http://geekswithblogs.net/NewThingsILearned/aggbug/136205.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Muljadi Budiman</dc:creator>
            <guid>http://geekswithblogs.net/NewThingsILearned/archive/2009/11/11/make-sqlexpress-db-accessible-from-other-computers.aspx</guid>
            <pubDate>Wed, 11 Nov 2009 16:08:57 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/NewThingsILearned/comments/136205.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/NewThingsILearned/archive/2009/11/11/make-sqlexpress-db-accessible-from-other-computers.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/NewThingsILearned/comments/commentRss/136205.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/NewThingsILearned/services/trackbacks/136205.aspx</trackback:ping>
        </item>
    </channel>
</rss>