<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>codeSMART</title>
	<atom:link href="http://codesmart.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://codesmart.wordpress.com</link>
	<description>Coding, development, general ranting - what more do you want?</description>
	<lastBuildDate>Tue, 06 Oct 2009 22:51:06 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='codesmart.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/62cbbad087bf016f9a1647b1b2d39e20?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>codeSMART</title>
		<link>http://codesmart.wordpress.com</link>
	</image>
			<item>
		<title>The argument against Test Driven Development</title>
		<link>http://codesmart.wordpress.com/2009/10/07/the-argument-against-test-driven-design/</link>
		<comments>http://codesmart.wordpress.com/2009/10/07/the-argument-against-test-driven-design/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 22:45:31 +0000</pubDate>
		<dc:creator>daggmano</dc:creator>
				<category><![CDATA[Other Development]]></category>
		<category><![CDATA[Musings]]></category>

		<guid isPermaLink="false">http://codesmart.wordpress.com/?p=225</guid>
		<description><![CDATA[It seems that every time I listen to a software development podcast (which is often), somebody is talking up the benefits of Test Driven Development (TDD).  TDD does indeed have many advantages.  It focuses our efforts by ensuring that the code we write is written for a reason, i.e. to make a test, which has [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codesmart.wordpress.com&blog=3603093&post=225&subd=codesmart&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>It seems that every time I listen to a software development podcast (which is often), somebody is talking up the benefits of Test Driven Development (TDD).  TDD does indeed have many advantages.  It focuses our efforts by ensuring that the code we write is written for a reason, i.e. to make a test, which has been derived from the requirements specification, pass.  This is in keeping with the YAGNI (You Ain&#8217;t Gonna Need It) principle.</p>
<p>TDD also allows a safety net for refactoring, to ensure that, after a refactoring, the code is no more broken than it was before the refactoring.  TDD is also likely to lead to &#8216;better&#8217; code &#8211; more modular, cleaner, with less unwanted dependencies between classes.  And all of these are worthy goals, and perhaps are reasons in themselves for adopting (at least partially) the TDD process.</p>
<p>Where I take exception, however, is that it is somehow implied (and even stated) that TDD cannot help but ensure that the code we write will be &#8216;correct&#8217;.  <a href="http://en.wikipedia.org/wiki/Test_driven_development#Benefits">Wikipedia states</a> that, &#8220;Test-driven development offers more that just simple validation of correctness&#8221;, which would indicate that TDD does indeed offer validation of correctness.  But it doesn&#8217;t.  Let me illustrate the point.</p>
<p>I need a method that will return the square of a given integer.  That seems simple, so I write a unit test.</p>
<pre class="brush: csharp;">
[Test]
public void TestThatTwoSquaredIsFour()
{
    Assert.IsTrue(Square(2) == 4);
}
</pre>
<p>Note that this is psuedo-code, but you get the idea.  Okay, let&#8217;s have a crack at writing the method to satisfy this test.  Again, <a href="http://en.wikipedia.org/wiki/Test_driven_development#3._Write_some_code">Wikipedia gives us some guidance</a>.</p>
<blockquote><p>The next step is to write some code that will cause the test to pass&#8230; It is important that the code written is <em>only</em> designed to pass the test&#8230;</p></blockquote>
<p>So, with this in mind, here is my code.</p>
<pre class="brush: csharp;">
public int Square(int n)
{
    return 4;
}
</pre>
<p>This is the simplest code that I can write that will pass the test.  And the test will pass.  Since this is the case, we obviously have not specified the requirements clearly enough (through tests), so we&#8217;ll add another test.</p>
<pre class="brush: csharp;">
[Test]
public void TestThatThreeSquaredIsNine()
{
    Assert.IsTrue(Square(3) == 9);
}
</pre>
<p>Our code now fails the second test, so let&#8217;s &#8216;fix&#8217; the code in the simplest way possible.</p>
<pre class="brush: csharp;">
public int Square(int n)
{
    if (n == 2)
        return 4;
    else
        return 9;
}
</pre>
<p>Run the tests again, and we have a nice green lawn.  But incorrect code.  We can go on adding more and more specific test cases, modify our method under test to pass those tests by using if statements or switch statements, and still have incorrect code.</p>
<p>How about adding a randomization aspect to the test, such as the following?</p>
<pre class="brush: csharp;">
[Test]
public void TestThatSquareOfRandomNumberIsCorrect()
{
    int n = Random(1000);
    int result = n * n;

    Assert.IsTrue(Square(n) == result);
}
</pre>
<p>We now have a test that will (probably) force us to write a method which calculates a result rather than selecting from a limited range of options, but there are two problems: first, the test is overly complicated, and second, we have already written the required method inside the test!</p>
<p>So here&#8217;s the takeaway: Test Driven Development is a useful methodology which encourages the developer to develop only what is needed, in a testable and maintainable way.  However, it is important to realise that TDD does NOT mean that the produced code is correct in all cases &#8211; <em>it is only correct in those cases for which specific tests exist</em>.  As far as TDD is concerned, the code can fail in every other imaginable case.  So keep using your brain as you develop.  Allow TDD to do those things at which it excels, but don&#8217;t expect it to have the <a href="http://en.wikipedia.org/wiki/Midas_touch">Midas Touch</a> &#8211; or you may very well fail.</p>
Posted in Other Development Tagged: Musings <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codesmart.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codesmart.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codesmart.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codesmart.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codesmart.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codesmart.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codesmart.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codesmart.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codesmart.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codesmart.wordpress.com/225/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codesmart.wordpress.com&blog=3603093&post=225&subd=codesmart&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codesmart.wordpress.com/2009/10/07/the-argument-against-test-driven-design/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bb40691d8b7509db80e7679e2bed33fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">daggmano</media:title>
		</media:content>
	</item>
		<item>
		<title>Loading forms dynamically in WPF</title>
		<link>http://codesmart.wordpress.com/2009/10/06/loading-forms-dynamically-in-wpf/</link>
		<comments>http://codesmart.wordpress.com/2009/10/06/loading-forms-dynamically-in-wpf/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 00:30:42 +0000</pubDate>
		<dc:creator>daggmano</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://codesmart.wordpress.com/?p=221</guid>
		<description><![CDATA[A friend of mine who is learning WPF recently asked me how to load forms dynamically into the panes of a tab control. Being the helpful sort I am, I wrote up a quick app that demonstrates this.
Essentially, the idea is to create the forms as UserControls, and then load these at runtime into the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codesmart.wordpress.com&blog=3603093&post=221&subd=codesmart&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A friend of mine who is learning WPF recently asked me how to load forms dynamically into the panes of a tab control. Being the helpful sort I am, I wrote up a quick app that demonstrates this.</p>
<p>Essentially, the idea is to create the forms as UserControls, and then load these at runtime into the host control (either a TabItem or some other Content or Item control such as a Grid). Remember that for a Content Control, you would set mycontrol.Content to the new form, while an Items control can contain multiple children, so to replace the content with a form you would call mycontrol.Children.Clear(), followed by mycontrol.Children.Add(newform).</p>
<p>The demo app is <a href="http://cid-6bd010a81465a625.skydrive.live.com/self.aspx/.Public/DynamicFormsDemo.zip">available here</a>.</p>
Posted in Coding Tagged: .NET, Tutorial, WPF <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codesmart.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codesmart.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codesmart.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codesmart.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codesmart.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codesmart.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codesmart.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codesmart.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codesmart.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codesmart.wordpress.com/221/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codesmart.wordpress.com&blog=3603093&post=221&subd=codesmart&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codesmart.wordpress.com/2009/10/06/loading-forms-dynamically-in-wpf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bb40691d8b7509db80e7679e2bed33fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">daggmano</media:title>
		</media:content>
	</item>
		<item>
		<title>Japan &#8211; The Last Day</title>
		<link>http://codesmart.wordpress.com/2009/09/11/japan-the-last-day/</link>
		<comments>http://codesmart.wordpress.com/2009/09/11/japan-the-last-day/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 10:13:16 +0000</pubDate>
		<dc:creator>daggmano</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Japan]]></category>

		<guid isPermaLink="false">http://codesmart.wordpress.com/?p=188</guid>
		<description><![CDATA[I managed to find some free internet access in the departure lounge, so decided to make use of it.  I left Panasonic today at 3pm local time, and caught the train back to the hotel to pick up my baggage.  My timing was impeccable, as the airport bus was only a few short minutes from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codesmart.wordpress.com&blog=3603093&post=188&subd=codesmart&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I managed to find some free internet access in the departure lounge, so decided to make use of it.  I left Panasonic today at 3pm local time, and caught the train back to the hotel to pick up my baggage.  My timing was impeccable, as the airport bus was only a few short minutes from leaving as I got to the stop.  The 70-odd minute ride to the airport was quiet, and gave me a chance to try to find a word to sum up my impressions of Japan.  I think I found it &#8211; &#8220;drab&#8221;.</p>
<p>Now, this may be peculiar to this part of Japan (Osaka &#8211; Kyoto), but everything feels just a little gray, perhaps grimy, and yet remarkably sterile.  There is very little litter, and I never saw any graffiti at all.  Perhaps the youth of Japan are instilled with a little more respect for others and for authority here, and certainly crime is lower in Japan than back at home.  For all that, it still feels a little lifeless.</p>
<p>Approaching Kansai Airport near Osaka, I realised something I hadn&#8217;t picked up when I arrived - Kansai Aiport is on a man-made island (check it out on <a href="http://maps.google.com.au/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=kansai+airport+osaka&amp;sll=10.833306,139.306641&amp;sspn=60.600977,76.992187&amp;ie=UTF8&amp;cd=1&amp;ll=34.418098,135.264187&amp;spn=0.100684,0.150375&amp;z=13">Google Maps</a>), and is reached by a bridge about 3km long!</p>
<p>I arrived at the airport about 90 minutes before check in opened, and so sat down for a while before taking a walk to find some sustenance.   Much to my delight, I found &#8230; a Starbucks!!  Real coffee!!  I was so thrilled at the prospect that is was some minutes before I realised that I had lost my mobile phone.  It must have slipped out of my pocket while I was sitting down, two floors above.  Retracing my steps brought no joy &#8211; it was gone.  So, off to the info counter.  Had a phone been handed in?  &#8220;Oh, please wait while I get paperwork&#8221;.  It wasn&#8217;t until about a minute later that she pulls out my phone and says, &#8220;Is this yours?&#8221;  That phone may not be much more than a hill of beans, but it was my hill, and those were my beans!!</p>
<p>Anyway, I am looking forward to getting back to Oz and seeing my (in some cases sick) kids again.  It&#8217;s been a good trip, and one that has given me some good memories, but for now, I&#8217;m glad it&#8217;s over.</p>
Posted in Miscellaneous Tagged: Japan <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codesmart.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codesmart.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codesmart.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codesmart.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codesmart.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codesmart.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codesmart.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codesmart.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codesmart.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codesmart.wordpress.com/188/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codesmart.wordpress.com&blog=3603093&post=188&subd=codesmart&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codesmart.wordpress.com/2009/09/11/japan-the-last-day/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bb40691d8b7509db80e7679e2bed33fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">daggmano</media:title>
		</media:content>
	</item>
		<item>
		<title>Japan &#8211; Days 2 to about 5</title>
		<link>http://codesmart.wordpress.com/2009/09/10/japan-days-2-to-about-5/</link>
		<comments>http://codesmart.wordpress.com/2009/09/10/japan-days-2-to-about-5/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 13:54:12 +0000</pubDate>
		<dc:creator>daggmano</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Japan]]></category>

		<guid isPermaLink="false">http://codesmart.wordpress.com/?p=158</guid>
		<description><![CDATA[OK, so I lost track of how many days I&#8217;ve been here.  I&#8217;ll cover the major events and see how we go from there&#8230;  Tuesday arrived, delivering to me the worst headache I&#8217;ve had in a long time.  Of course, it would have helped if I&#8217;d brought some Panadol.  Note to self&#8230;  I spent a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codesmart.wordpress.com&blog=3603093&post=158&subd=codesmart&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img class="alignright size-full wp-image-161" title="Japanese Panadol - perhaps..." src="http://codesmart.files.wordpress.com/2009/09/img_26642.jpg?w=300&#038;h=155" alt="Japanese Panadol - perhaps..." width="300" height="155" />OK, so I lost track of how many days I&#8217;ve been here.  I&#8217;ll cover the major events and see how we go from there&#8230;  Tuesday arrived, delivering to me the worst headache I&#8217;ve had in a long time.  Of course, it would have helped if I&#8217;d brought some Panadol.  Note to self&#8230;  I spent a long day at the office (until about 6pm, to make up for the fact that I left at 4 on Monday due to a timezone issue&#8230;) nursing my head.  On the way back to the hotel, I dropped into a 7-11 style store, and spent some small amount of time trying to communicate to the man behind the checkout that my head hurt and I needed something for it.  After much effort, I eventually got something that looked kind of like what I wanted.  At least, it said &#8220;Pain / Fever Reliever&#8221; on  side &#8211; the ONLY English words on the box other than the brand.</p>
<p><img class="alignleft size-full wp-image-162" title="It's Coke Jim, but not as we know it" src="http://codesmart.files.wordpress.com/2009/09/img_2670.jpg?w=200&#038;h=185" alt="It's Coke Jim, but not as we know it" width="200" height="185" />Speaking of pain relief, the lack of good cof<img class="alignright size-full wp-image-163" title="Various cans..." src="http://codesmart.files.wordpress.com/2009/09/img_2668.jpg?w=300&#038;h=200" alt="Various cans..." width="300" height="200" />fee here has forced me to look elsewhere for my caffeine fix.  Coke is available here in all shapes and sizes &#8211; quite literally.  On the left is one sample from a vending machine.  Screw top, 300ml bottle made of&#8230; wait for it&#8230; aluminium!  They also have Coke in more &#8216;normal&#8217; style cans, although a bit elongated.  These come in at least two sizes, 250ml and something larger (haven&#8217;t seen it close up).   On the right is the 250ml can, along with a couple other interesting cans in the hotel fridge: orange juice (still, not sparkling) and coffee.  Iced coffee.  Possibly black iced coffee.  Yes, this is a strange place&#8230;</p>
<p>Today (Thursday), I managed to take the afternoon off to slip in a bit of sight seeing.  I caught the train into Kyoto and walked down to the Imperial Palace.  For today, I&#8217;ll leave you with a smattering of images from this trip.  Enjoy.</p>
<div id="attachment_167" class="wp-caption alignleft" style="width: 410px"><img class="size-full wp-image-167" title="The Thomas Train" src="http://codesmart.files.wordpress.com/2009/09/img_2674.jpg?w=400&#038;h=267" alt="One train has been painted with Thomas characters.  I saw it 3 times, or there is more than one like this." width="400" height="267" /><p class="wp-caption-text">One train has been painted with Thomas characters. I saw it 3 times, or there is more than one like this.</p></div>
<div id="attachment_168" class="wp-caption alignleft" style="width: 410px"><img class="size-full wp-image-168" title="Kamo River 1" src="http://codesmart.files.wordpress.com/2009/09/img_2675.jpg?w=400&#038;h=267" alt="The Kamo River runs through Kyoto." width="400" height="267" /><p class="wp-caption-text">The Kamo River runs through Kyoto.</p></div>
<div id="attachment_169" class="wp-caption alignleft" style="width: 410px"><img class="size-full wp-image-169" title="Gate 1" src="http://codesmart.files.wordpress.com/2009/09/img_2681.jpg?w=400&#038;h=267" alt="One of the gates into the Imperial Palace grounds." width="400" height="267" /><p class="wp-caption-text">One of the gates into the Imperial Palace grounds.</p></div>
<div id="attachment_170" class="wp-caption alignleft" style="width: 410px"><img class="size-full wp-image-170" title="Gate 2" src="http://codesmart.files.wordpress.com/2009/09/img_2683.jpg?w=400&#038;h=267" alt="Inside the grounds, there are several palaces. This is one of the gates into one of the palaces." width="400" height="267" /><p class="wp-caption-text">Inside the grounds, there are several palaces. This is one of the gates into one of the palaces.</p></div>
<div id="attachment_171" class="wp-caption alignleft" style="width: 610px"><img class="size-full wp-image-171" title="Panorama" src="http://codesmart.files.wordpress.com/2009/09/img_2699_stitch.jpg?w=600&#038;h=89" alt="A quick panorama of the south wall of the Imperial Palace." width="600" height="89" /><p class="wp-caption-text">A quick panorama of the south wall of the Imperial Palace.</p></div>
<div id="attachment_172" class="wp-caption alignleft" style="width: 410px"><img class="size-full wp-image-172" title="End of the Line" src="http://codesmart.files.wordpress.com/2009/09/img_2707.jpg?w=400&#038;h=267" alt="This was as close as I got to seeing the Imperial Palace proper, as I hadn't booked a tour and didn't want to argue with the guards." width="400" height="267" /><p class="wp-caption-text">This was as close as I got to seeing the Imperial Palace proper, as I hadn&#39;t booked a tour and didn&#39;t want to argue with the guards.</p></div>
<div id="attachment_173" class="wp-caption alignleft" style="width: 277px"><img class="size-full wp-image-173" title="Tree 1" src="http://codesmart.files.wordpress.com/2009/09/img_2710.jpg?w=267&#038;h=400" alt="This tree was a bit like a Roll Up. See the next photo..." width="267" height="400" /><p class="wp-caption-text">This tree was a bit like a Roll Up. See the next photo...</p></div>
<div id="attachment_174" class="wp-caption alignleft" style="width: 410px"><img class="size-full wp-image-174" title="Tree 2" src="http://codesmart.files.wordpress.com/2009/09/img_2711.jpg?w=400&#038;h=267" alt="Yep, totally hollow." width="400" height="267" /><p class="wp-caption-text">Yep, totally hollow.</p></div>
<div id="attachment_175" class="wp-caption alignleft" style="width: 410px"><img class="size-full wp-image-175" title="Garden" src="http://codesmart.files.wordpress.com/2009/09/img_2712.jpg?w=400&#038;h=267" alt="Tranquility in the palace grounds." width="400" height="267" /><p class="wp-caption-text">Tranquility in the palace grounds.</p></div>
<div id="attachment_176" class="wp-caption alignleft" style="width: 410px"><img class="size-full wp-image-176" title="Fuel" src="http://codesmart.files.wordpress.com/2009/09/img_2714.jpg?w=400&#038;h=222" alt="I read somewhere that you can't pump your own petrol in Japan. Notice the hoses hanging from the roof, waiting for the attendants to grab them as you pull up." width="400" height="222" /><p class="wp-caption-text">I read somewhere that you can&#39;t pump your own petrol in Japan. Notice the hoses hanging from the roof, waiting for the attendants to grab them as you pull up.</p></div>
<div id="attachment_177" class="wp-caption alignleft" style="width: 277px"><img class="size-full wp-image-177" title="Street Scene" src="http://codesmart.files.wordpress.com/2009/09/img_2716.jpg?w=267&#038;h=400" alt="Kyoto street scene." width="267" height="400" /><p class="wp-caption-text">Kyoto street scene.</p></div>
<div id="attachment_178" class="wp-caption alignleft" style="width: 410px"><img class="size-full wp-image-178" title="Kamo River 2" src="http://codesmart.files.wordpress.com/2009/09/img_2719.jpg?w=400&#038;h=242" alt="More of the Kamo River." width="400" height="242" /><p class="wp-caption-text">More of the Kamo River.</p></div>
<div id="attachment_179" class="wp-caption alignleft" style="width: 277px"><img class="size-full wp-image-179" title="Shrine" src="http://codesmart.files.wordpress.com/2009/09/img_2721.jpg?w=267&#038;h=400" alt="There were quite a few of these shrines dotted about the place. The swastika symbol is relevant to Buddhism, not Nazism." width="267" height="400" /><p class="wp-caption-text">There were quite a few of these shrines dotted about the place. The swastika symbol is relevant to Buddhism, not Nazism.</p></div>
<div id="attachment_180" class="wp-caption alignleft" style="width: 262px"><img class="size-full wp-image-180" title="Clock 1" src="http://codesmart.files.wordpress.com/2009/09/img_2725.jpg?w=252&#038;h=400" alt="Back in Moriguschi, this clock is near my hotel. At certain times, the bells ring to form a tune (no doubt delightful, but I never heard it)." width="252" height="400" /><p class="wp-caption-text">Back in Moriguschi, this clock is near my hotel. At certain times, the bells ring to form a tune (no doubt delightful, but I never heard it).</p></div>
<div id="attachment_181" class="wp-caption alignleft" style="width: 277px"><img class="size-full wp-image-181" title="Clock 2" src="http://codesmart.files.wordpress.com/2009/09/img_2726.jpg?w=267&#038;h=400" alt="A close-up of the clock. Presumably the figures dance to the bells." width="267" height="400" /><p class="wp-caption-text">A close-up of the clock. Presumably the figures dance to the bells.</p></div>
<div id="attachment_182" class="wp-caption alignleft" style="width: 277px"><img class="size-full wp-image-182" title="Wind thing" src="http://codesmart.files.wordpress.com/2009/09/img_2732.jpg?w=267&#038;h=400" alt="Near the clock is the place where plastic chairs go to die..." width="267" height="400" /><p class="wp-caption-text">Near the clock is the place where plastic chairs go to die...</p></div>
Posted in Miscellaneous Tagged: Japan <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codesmart.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codesmart.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codesmart.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codesmart.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codesmart.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codesmart.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codesmart.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codesmart.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codesmart.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codesmart.wordpress.com/158/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codesmart.wordpress.com&blog=3603093&post=158&subd=codesmart&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codesmart.wordpress.com/2009/09/10/japan-days-2-to-about-5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bb40691d8b7509db80e7679e2bed33fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">daggmano</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/img_26642.jpg" medium="image">
			<media:title type="html">Japanese Panadol - perhaps...</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/img_2670.jpg" medium="image">
			<media:title type="html">It's Coke Jim, but not as we know it</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/img_2668.jpg" medium="image">
			<media:title type="html">Various cans...</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/img_2674.jpg" medium="image">
			<media:title type="html">The Thomas Train</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/img_2675.jpg" medium="image">
			<media:title type="html">Kamo River 1</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/img_2681.jpg" medium="image">
			<media:title type="html">Gate 1</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/img_2683.jpg" medium="image">
			<media:title type="html">Gate 2</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/img_2699_stitch.jpg" medium="image">
			<media:title type="html">Panorama</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/img_2707.jpg" medium="image">
			<media:title type="html">End of the Line</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/img_2710.jpg" medium="image">
			<media:title type="html">Tree 1</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/img_2711.jpg" medium="image">
			<media:title type="html">Tree 2</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/img_2712.jpg" medium="image">
			<media:title type="html">Garden</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/img_2714.jpg" medium="image">
			<media:title type="html">Fuel</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/img_2716.jpg" medium="image">
			<media:title type="html">Street Scene</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/img_2719.jpg" medium="image">
			<media:title type="html">Kamo River 2</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/img_2721.jpg" medium="image">
			<media:title type="html">Shrine</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/img_2725.jpg" medium="image">
			<media:title type="html">Clock 1</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/img_2726.jpg" medium="image">
			<media:title type="html">Clock 2</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/img_2732.jpg" medium="image">
			<media:title type="html">Wind thing</media:title>
		</media:content>
	</item>
		<item>
		<title>Japan &#8211; Day 1</title>
		<link>http://codesmart.wordpress.com/2009/09/07/japan-day-1/</link>
		<comments>http://codesmart.wordpress.com/2009/09/07/japan-day-1/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 13:28:43 +0000</pubDate>
		<dc:creator>daggmano</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Japan]]></category>

		<guid isPermaLink="false">http://codesmart.wordpress.com/?p=147</guid>
		<description><![CDATA[Before I left Sydney I decided that Japanese youth culture and I were just not going to get along.  For a start, I prefer the top of my pants to be ABOVE my knees.  Anyway, my work was paying for me to fly to Japan for a week, so who was I to complain?
Despite being [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codesmart.wordpress.com&blog=3603093&post=147&subd=codesmart&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Before I left Sydney I decided that Japanese youth culture and I were just not going to get along.  For a start, I prefer the top of my pants to be ABOVE my knees.  Anyway, my work was paying for me to fly to Japan for a week, so who was I to complain?</p>
<p>Despite being a JetStar flight, things were surprisingly comfortable for the 9 hour flight into Osaka.  Being in a wing exit row helped &#8211; I could stretch out a bit &#8211; and the personal video-on-demand unit didn&#8217;t hurt either.  I was able to watch a couple of movies that I wanted to see (&#8220;<a href="http://www.lovethebeast.com.au/">Love the Beast</a>&#8220;, &#8220;<a href="http://www.fastandfuriousmovie.net/">Fast and Furious</a>&#8220;), and was able to jump back to my childhood with a couple of episodes of &#8220;<a href="http://en.wikipedia.org/wiki/Pinky_and_the_Brain">Pinky and the Brain</a>&#8221; (&#8220;Are you pondering what I&#8217;m pondering, Pinky?&#8221;  &#8220;I think so Brain, but if you swap the &#8216;P&#8217; with an &#8216;O&#8217; my name would be &#8216;Oinky&#8217;!&#8221;).</p>
<p>Arriving in Osaka, I was struck by the fact that there were not one but two air bridges allocated to each terminal gate, to help load and unload quicker (or to keep first class away from cattle class), and that we didn&#8217;t walk to the baggage carousel and customs &#8211; we got on a train!  After clearing customs (the cavity search was surprisingly gentle), I was able to catch a bus for the ride out to <a href="http://maps.google.com/maps?source=s_q&amp;hl=en&amp;geocode=&amp;q=moriguchi,+Japan&amp;sll=34.737689,135.566354&amp;sspn=0.007186,0.007167&amp;ie=UTF8&amp;radius=0.2&amp;split=1&amp;filter=0&amp;rq=1&amp;ev=zi&amp;ll=34.735176,135.566021&amp;spn=0.007186,0.007167&amp;z=17&amp;iwloc=A">Moriguchi</a> (about a 70 minute ride).</p>
<p>The area around the hotel (Royal Pines) is not very touristy, Moriguchi being more of an industrial centre, but nevertheless I packed my camera and took to the streets in search of points of interest and food.  I wasn&#8217;t very successful in either attempt, so I present you with a view from my hotel room.  The area at lower left is the train station.</p>
<div id="attachment_148" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-148" title="Room with a View" src="http://codesmart.files.wordpress.com/2009/09/view.jpg?w=500&#038;h=333" alt="View from the hotel room window" width="500" height="333" /><p class="wp-caption-text">View from the hotel room window</p></div>
<p> </p>
<p>Since I had been unable to buy a power adapter in Australia, and had forgotten to get one at the Osaka airport, I used my short battery life to Skype my wife, read a chapter or two of Jeremy Clarkson&#8217;s &#8220;<a href="http://www.amazon.co.uk/Dont-Stop-Now-Jeremy-Clarkson/dp/071814905X">Don&#8217;t stop me now</a>&#8220;, and went to bed.</p>
<p>Morning came.  To be honest, today has been a bit of a mad rush and I haven&#8217;t had much time to process it yet, but a few salient points stick out.</p>
<p>Firstly, I have decided that the Japanese wouldn&#8217;t recognise a good cup of coffee if it fell on them from the top of Mount Fuji.  The cappucino I had tonight in the hotel restaurant looked and tasted a little like frothy dishwater.  The &#8216;American Brew&#8217; I had for breakfast this morning was like said dishwater after it had cleaned a good number of sushi bowls.  Still and all, it contained caffeine, and so was a necessary evil.  Interestingly, the hotel room doesn&#8217;t have coffee sachets.  Green tea and noodle cups, but no coffee.</p>
<p>Dinner tonight (at the aforementioned restaurant) was quite good, despite the coffee.  I ordered &#8216;Aussie Beef and Vegetables&#8217;, being the adventurous type.  I should have known better.  The meat was excellent, but was served on a plate of bean shoots and onion, with potato, beans, pumpkin, and some red substance with little flavour and less texture.  Could have been tofu.  Oh, and the eating implements?  Chopsticks!  How Aussie!  Well, we are a multicultural nation, are we not?</p>
<p>The meal was surprisingly cheap: 1500 yen for the main dish (about $18 or so).  What was less appealing was the cost of a Johnnie Walker and Coke &#8211; also 1500 yen!</p>
<p>Anyway, time to wrap up for the day.  I leave you with a smattering of Engrish signs hanging around the hotel room.  You&#8217;d think that it wouldn&#8217;t be hard to hire someone who speaks English natively to translate, but apparently it is.  Very hard.</p>
<div id="attachment_150" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-150" title="Bugle" src="http://codesmart.files.wordpress.com/2009/09/bugle.jpg?w=500&#038;h=212" alt="Eye of Newt.  Wing of Bat.  Bugle of Fire Alarm." width="500" height="212" /><p class="wp-caption-text">Eye of Newt. Wing of Bat. Bugle of Fire Alarm.</p></div>
<div id="attachment_151" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-151" title="Modernity" src="http://codesmart.files.wordpress.com/2009/09/modernity.jpg?w=500&#038;h=220" alt="Yes, indeed it is!  But touch not when the kettle is hot." width="500" height="220" /><p class="wp-caption-text">Yes, indeed it is! But touch not when the kettle is hot.</p></div>
<div id="attachment_152" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-152" title="OffTheLamp" src="http://codesmart.files.wordpress.com/2009/09/offthelamp.jpg?w=500&#038;h=167" alt="Honestly, who names their lamp &quot;Off&quot;?  And why does it need to wash?" width="500" height="167" /><p class="wp-caption-text">Honestly, who names their lamp &quot;Off&quot;? And why does it need to wash?</p></div>
Posted in Miscellaneous Tagged: Japan <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codesmart.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codesmart.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codesmart.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codesmart.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codesmart.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codesmart.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codesmart.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codesmart.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codesmart.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codesmart.wordpress.com/147/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codesmart.wordpress.com&blog=3603093&post=147&subd=codesmart&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codesmart.wordpress.com/2009/09/07/japan-day-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bb40691d8b7509db80e7679e2bed33fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">daggmano</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/view.jpg" medium="image">
			<media:title type="html">Room with a View</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/bugle.jpg" medium="image">
			<media:title type="html">Bugle</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/modernity.jpg" medium="image">
			<media:title type="html">Modernity</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/09/offthelamp.jpg" medium="image">
			<media:title type="html">OffTheLamp</media:title>
		</media:content>
	</item>
		<item>
		<title>31 Days of Refactoring on LosTechies</title>
		<link>http://codesmart.wordpress.com/2009/08/13/31-days-of-refactoring-on-lostechies/</link>
		<comments>http://codesmart.wordpress.com/2009/08/13/31-days-of-refactoring-on-lostechies/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 04:31:09 +0000</pubDate>
		<dc:creator>daggmano</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://codesmart.wordpress.com/?p=136</guid>
		<description><![CDATA[August is Refactoring Month for Sean Chambers over on LosTechies.  Some of the methods he looks at are well known, some not so much, but all are worth knowing.  Check it out at http://www.lostechies.com/blogs/sean_chambers/archive/2009/07/31/31-days-of-refactoring.aspx.
Posted in Coding Tagged: C#, Tutorial      <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codesmart.wordpress.com&blog=3603093&post=136&subd=codesmart&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>August is Refactoring Month for Sean Chambers over on LosTechies.  Some of the methods he looks at are well known, some not so much, but all are worth knowing.  Check it out at <a href="http://www.lostechies.com/blogs/sean_chambers/archive/2009/07/31/31-days-of-refactoring.aspx">http://www.lostechies.com/blogs/sean_chambers/archive/2009/07/31/31-days-of-refactoring.aspx</a>.</p>
Posted in Coding Tagged: C#, Tutorial <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codesmart.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codesmart.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codesmart.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codesmart.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codesmart.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codesmart.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codesmart.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codesmart.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codesmart.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codesmart.wordpress.com/136/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codesmart.wordpress.com&blog=3603093&post=136&subd=codesmart&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codesmart.wordpress.com/2009/08/13/31-days-of-refactoring-on-lostechies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bb40691d8b7509db80e7679e2bed33fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">daggmano</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows 7 API Code Pack v1.0 released</title>
		<link>http://codesmart.wordpress.com/2009/08/10/windows-7-api-code-pack-v1-0-released/</link>
		<comments>http://codesmart.wordpress.com/2009/08/10/windows-7-api-code-pack-v1-0-released/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 01:15:23 +0000</pubDate>
		<dc:creator>daggmano</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Interop]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://codesmart.wordpress.com/?p=133</guid>
		<description><![CDATA[My new best friend, the Windows 7 Code Pack, has been released.  From Charlie Calvert&#8217;s Community Blog:
The Windows® API Code Pack for Microsoft® .NET Framework provides  support for various features of Windows 7 and previous releases of that  operating system. The Code Pack has  reached version 1.0 and has been published  on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codesmart.wordpress.com&blog=3603093&post=133&subd=codesmart&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>My new best friend, the Windows 7 Code Pack, has been released.  From <a href="http://blogs.msdn.com/charlie/archive/2009/08/07/windows-7-code-pack-v-1-0-released.aspx">Charlie Calvert&#8217;s Community Blog</a>:</p>
<blockquote><p>The <strong>Windows® API Code Pack for Microsoft® .NET Framework</strong> provides  support for various features of Windows 7 and previous releases of that  operating system. The Code Pack has  reached version 1.0 and has been published  on Code Gallery:</p>
<ul>
<li><a href="http://code.msdn.microsoft.com/WindowsAPICodePack/Release/ProjectReleases.aspx?ReleaseId=3077">Download  it</a></li>
<li><a href="http://code.msdn.microsoft.com/WindowsAPICodePack">Read about  it</a></li>
<li><a href="http://code.msdn.microsoft.com/WindowsAPICodePack/Thread/List.aspx">Discuss  it</a></li>
<li><a href="http://code.msdn.microsoft.com/WindowsAPICodePack/WorkItem/List.aspx">Report  bugs</a></li>
</ul>
<p>Here are some of the features you can from managed code using the Code  Pack:</p>
<ul>
<li>Windows 7 Taskbar Jump Lists, Icon Overlay, Progress Bar, Tabbed Thumbnails,  and Thumbnail Toolbars.</li>
<li>Windows 7 Libraries, Known Folders, non-file system containers.</li>
<li>Windows Shell Search API support, a hierarchy of Shell Namespace entities,  and Drag and Drop functionality for Shell Objects.</li>
<li>Explorer Browser Control.</li>
<li>Shell property system.</li>
<li>Windows Vista and Windows 7 Common File Dialogs, including custom controls.</li>
<li>Windows Vista and Windows 7 Task Dialogs.</li>
<li>Direct3D 11.0, Direct3D 10.1/10.0, DXGI 1.0/1.1, Direct2D 1.0, DirectWrite,  Windows Imaging Component (WIC) APIs. (DirectWrite and WIC have partial support)</li>
<li>Sensor Platform APIs</li>
<li>Extended Linguistic Services APIs</li>
<li>Power Management APIs</li>
<li>Application Restart and Recovery APIs</li>
<li>Network List Manager APIs</li>
<li>Command Link control and System defined Shell icons.</li>
</ul>
</blockquote>
Posted in Coding Tagged: Interop, Microsoft <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codesmart.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codesmart.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codesmart.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codesmart.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codesmart.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codesmart.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codesmart.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codesmart.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codesmart.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codesmart.wordpress.com/133/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codesmart.wordpress.com&blog=3603093&post=133&subd=codesmart&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codesmart.wordpress.com/2009/08/10/windows-7-api-code-pack-v1-0-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bb40691d8b7509db80e7679e2bed33fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">daggmano</media:title>
		</media:content>
	</item>
		<item>
		<title>When analogies break down&#8230;</title>
		<link>http://codesmart.wordpress.com/2009/07/13/when-analogies-break-down/</link>
		<comments>http://codesmart.wordpress.com/2009/07/13/when-analogies-break-down/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 03:18:11 +0000</pubDate>
		<dc:creator>daggmano</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://codesmart.wordpress.com/?p=117</guid>
		<description><![CDATA[USB 3.0 (running at a mind-numbing 5.0 Gbps) is just around the corner, and it got me thinking about the similarities of version numbers vs. features to the .NET Framework.  Let&#8217;s have a look so far:



Version
USB
.NET Framework


v1.0
First release, 1.5 Mbps
First release, slow and buggy


v1.1
Full speed, 12 Mbps
Many improvements, but no major leaps in technology


v2.0
High speed, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codesmart.wordpress.com&blog=3603093&post=117&subd=codesmart&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>USB 3.0 (running at a mind-numbing 5.0 Gbps) is just around the corner, and it got me thinking about the similarities of version numbers vs. features to the .NET Framework.  Let&#8217;s have a look so far:</p>
<table border="0">
<tbody>
<tr>
<th>Version</th>
<th>USB</th>
<th>.NET Framework</th>
</tr>
<tr>
<td>v1.0</td>
<td>First release, 1.5 Mbps</td>
<td>First release, slow and buggy</td>
</tr>
<tr>
<td>v1.1</td>
<td>Full speed, 12 Mbps</td>
<td>Many improvements, but no major leaps in technology</td>
</tr>
<tr>
<td>v2.0</td>
<td>High speed, 480 Mbps</td>
<td>Significantly improved performance and development speed, reduces LoC required by (up to) 80%</td>
</tr>
<tr>
<td>v3.0</td>
<td>SuperSpeed 5.0 Gbps</td>
<td>WPF, WCF, WF, etc.</td>
</tr>
</tbody>
</table>
<p>OK, so .NET 3.0 was just a few layers on top of v2.0, while USB 3.0 is an order of magnitude faster.  The real question is however, what will USB v3.5sp1 bring us?</p>
Posted in Miscellaneous  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codesmart.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codesmart.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codesmart.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codesmart.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codesmart.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codesmart.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codesmart.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codesmart.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codesmart.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codesmart.wordpress.com/117/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codesmart.wordpress.com&blog=3603093&post=117&subd=codesmart&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codesmart.wordpress.com/2009/07/13/when-analogies-break-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bb40691d8b7509db80e7679e2bed33fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">daggmano</media:title>
		</media:content>
	</item>
		<item>
		<title>The IEqualityComparer in action</title>
		<link>http://codesmart.wordpress.com/2009/06/23/the-iequalitycomparer-in-action/</link>
		<comments>http://codesmart.wordpress.com/2009/06/23/the-iequalitycomparer-in-action/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 23:44:44 +0000</pubDate>
		<dc:creator>daggmano</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://codesmart.wordpress.com/?p=101</guid>
		<description><![CDATA[I recently had the situation where I had a class similar to the following:



public class Item
{
    public Guid ItemID { get; set; }
    public string ItemName { get; set; }
    public IList Categories { get; set; }
}

public class Category
{
    public Guid CategoryID { [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codesmart.wordpress.com&blog=3603093&post=101&subd=codesmart&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I recently had the situation where I had a class similar to the following:</p>
<pre>
<pre>
<pre class="brush: csharp;">
public class Item
{
    public Guid ItemID { get; set; }
    public string ItemName { get; set; }
    public IList Categories { get; set; }
}

public class Category
{
    public Guid CategoryID { get; set; }
    public string CategoryName { get; set; }
}
</pre>
</pre>
</pre>
<p>Data for the application was pulled out of a Linq to SQL class, working off a SQL database.  (I don&#8217;t want to get into a discussion on the semantics of my design choice &#8211; perhaps Items should be members of Categories instead of the other way around.  Just enjoy the show for now&#8230;)</p>
<p>What I wanted to do was to filter a Linq query from the database (containing IQueryable&lt;Item&gt;) for items that contained Categories with a given CategoryID.  No problems!   Just run up a Linq to SQL query to get the Category instance matching that CategoryID as follows:</p>
<pre>
<pre>
<pre class="brush: csharp;">
var myCategory = (from c in datacontext.dbCategories
                  where c.ID == myCategoryID
                  select new Category
                  {
                      CategoryID = c.ID,
                      CategoryName = c.Name
                  }).Single();
</pre>
</pre>
</pre>
<p>Note that the filter as shown below won&#8217;t work on an IQueryable&lt;Item&gt; (due to the Contains() clause), so we&#8217;ll evaluate the incoming IQueryable&lt;Item&gt; as it comes in, and (for convenience) convert it back to IQueryable on the way out.  We&#8217;ll implement the method as an extension method, because we can.</p>
<pre>
<pre>
<pre class="brush: csharp;">
public IQueryable FilterByCategory(this IQueryable qry, Category cat)
{
    return (from i in qry.ToList()        // Evaluate the qry
            where i.Categories.Contains(cat)
            select i).AsQueryable();
}
</pre>
</pre>
</pre>
<p>Now, this is all fine, as far as it goes.   Except for one small thing.</p>
<p>It didn&#8217;t work.</p>
<p>My result set was empty.   Always.</p>
<p>So what&#8217;s going on?   Basically, here&#8217;s the thing.   Have a look at the following code fragments:</p>
<pre>
<pre>
<pre class="brush: csharp;">
int x = 7;
int y = 7;
Debug.Assert(x == y);    // Assert is true

class MyObject
{
    public int Value;

    public MyObject(int val)
    {
        Value = val;
    }
}
MyObject a = new MyObject(7);
MyObject b = new MyObject(7);
Debug.Assert(a == b);    // Assert fails!
</pre>
</pre>
</pre>
<p>It may seem obvious, but the reason the second Assert fails is that, despite having the same internal value, <strong>a and b are not the same!</strong> And this is the problem with my filter query above.   Despite the Category instance I received from the SQL query having the same internal values as (perhaps) a Category in the Categories property of an Item, <strong>they are not the same object</strong> and so the comparison will fail.<br />
What we need is some way of telling .NET that two instances of an object are the same, even if they are different objects, and this is where the IEqualityComparer comes in.   We can create the following class:</p>
<pre>
<pre>
<pre class="brush: csharp;">
class CategoryComparer : IEqualityComparer
{
    #region IEqualityComparer Members

    public bool IsEqual(Category x, Category y)
    {
        return x.CategoryID == y.CategoryID;
    }

    public int GetHashCode(Category obj)
    {
        return obj.CategoryID.GetHashCode();
    }

    #endregion
}
</pre>
</pre>
</pre>
<p>We have created a class that says that two instances of Category are equal when their CategoryID values match, and have based their Hash Code on the CategoryID value rather than the instance itself.   All we need to do now is to plug it in to the query, as follows:</p>
<pre>
<pre>
<pre class="brush: csharp;">
public IQueryable FilterByCategory(this IQueryable qry, Category cat)
{
    return (from i in qry.ToList()        // Evaluate the qry
            where i.Categories.Contains(cat, new CategoryComparer())
            select i).AsQueryable();
}
</pre>
</pre>
</pre>
<p>Voila!   .NET is a wonderful environment, but there are always a few gotchas lying around for the unsuspecting.  Work through probelms methodically, and you&#8217;ll find there&#8217;s always a way.</p>
Posted in Coding Tagged: .NET, C# <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codesmart.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codesmart.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codesmart.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codesmart.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codesmart.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codesmart.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codesmart.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codesmart.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codesmart.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codesmart.wordpress.com/101/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codesmart.wordpress.com&blog=3603093&post=101&subd=codesmart&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codesmart.wordpress.com/2009/06/23/the-iequalitycomparer-in-action/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bb40691d8b7509db80e7679e2bed33fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">daggmano</media:title>
		</media:content>
	</item>
		<item>
		<title>Premature Optimization</title>
		<link>http://codesmart.wordpress.com/2009/04/09/premature-optimization/</link>
		<comments>http://codesmart.wordpress.com/2009/04/09/premature-optimization/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 00:27:42 +0000</pubDate>
		<dc:creator>daggmano</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://codesmart.wordpress.com/?p=92</guid>
		<description><![CDATA[Aren&#8217;t the people at Microsoft nice?  Apparently they made Internet Explorer 8 just right for NineMSN.


(Maybe a more truthful approach would be to say that the NineMSN site is optimized for IE8?  But why let the facts get in the way of a good story?)
Posted in Miscellaneous       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codesmart.wordpress.com&blog=3603093&post=92&subd=codesmart&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Aren&#8217;t the people at Microsoft nice?  Apparently they made Internet Explorer 8 just right for NineMSN.</p>
<p><img class="alignnone size-full wp-image-97" title="optimised" src="http://codesmart.files.wordpress.com/2009/04/optimised.jpg" alt="optimised" width="0" height="0" /></p>
<p><img class="alignnone size-full wp-image-98" title="optimised2" src="http://codesmart.files.wordpress.com/2009/04/optimised2.jpg" alt="optimised2" width="448" height="243" /></p>
<p>(Maybe a more truthful approach would be to say that the NineMSN site is optimized for IE8?  But why let the facts get in the way of a good story?)</p>
Posted in Miscellaneous  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codesmart.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codesmart.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codesmart.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codesmart.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codesmart.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codesmart.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codesmart.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codesmart.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codesmart.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codesmart.wordpress.com/92/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codesmart.wordpress.com&blog=3603093&post=92&subd=codesmart&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://codesmart.wordpress.com/2009/04/09/premature-optimization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bb40691d8b7509db80e7679e2bed33fe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">daggmano</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/04/optimised.jpg" medium="image">
			<media:title type="html">optimised</media:title>
		</media:content>

		<media:content url="http://codesmart.files.wordpress.com/2009/04/optimised2.jpg" medium="image">
			<media:title type="html">optimised2</media:title>
		</media:content>
	</item>
	</channel>
</rss>