<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" 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:dc="http://purl.org/dc/elements/1.1/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>Did it with .NET</title>
    <link>http://diditwith.net/</link>
    <description>Dustin Campbell &amp;mdash; Musings &amp;bull; Ramblings &amp;bull; Whatever...</description>
    <language>en-us</language>
    <copyright>Dustin Campbell</copyright>
    <lastBuildDate>Sat, 18 Feb 2012 23:44:30 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>blog@diditwith.net</managingEditor>
    <webMaster>blog@diditwith.net</webMaster>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/DidItWithDotNet" /><feedburner:info uri="diditwithdotnet" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license><image><url>http://www.feedburner.com/fb/images/pub/fb_pwrd.gif</url></image><item>
      <trackback:ping>http://diditwith.net/Trackback.aspx?guid=f7ea1c53-aa0c-4063-817e-8342522e30e2</trackback:ping>
      <pingback:server>http://diditwith.net/pingback.aspx</pingback:server>
      <pingback:target>http://diditwith.net/PermaLink,guid,f7ea1c53-aa0c-4063-817e-8342522e30e2.aspx</pingback:target>
      <dc:creator>Dustin Campbell</dc:creator>
      <wfw:comment>http://diditwith.net/CommentView,guid,f7ea1c53-aa0c-4063-817e-8342522e30e2.aspx</wfw:comment>
      <wfw:commentRss>http://diditwith.net/SyndicationService.asmx/GetEntryCommentsRss?guid=f7ea1c53-aa0c-4063-817e-8342522e30e2</wfw:commentRss>
      <slash:comments>9</slash:comments>
      
      <title>Writing F# Type Extensions for Nullable</title>
      <guid isPermaLink="false">http://diditwith.net/PermaLink,guid,f7ea1c53-aa0c-4063-817e-8342522e30e2.aspx</guid>
      <link>http://feedproxy.google.com/~r/DidItWithDotNet/~3/4faCKVqUoFA/WritingFTypeExtensionsForNullable.aspx</link>
      <pubDate>Sat, 18 Feb 2012 23:44:30 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
A &lt;a href="http://msdn.microsoft.com/en-us/library/dd233211.aspx"&gt;type extension&lt;/a&gt; is&#xD;
F#’s syntax for augmenting an existing type with new members – similar in spirit to&#xD;
C# and VB’s extensions methods. I employ type extensions to make life a bit easier&#xD;
when working with .NET libraries from F#. For example, I might make &lt;a href="http://msdn.microsoft.com/en-us/library/system.io.stream.readbyte.aspx"&gt;System.IO.Stream.ReadByte()&lt;/a&gt; a&#xD;
bit more natural to use from F# by writing a type extension like so:&#xD;
&lt;/p&gt;&#xD;
        &lt;div style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; padding-bottom: 4px; background-color: rgb(255,255,255); margin: 4px; padding-left: 4px; padding-right: 4px; font-family: consolas,'Courier New',courier,monospace; color: rgb(0,0,0); font-size: small; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted; padding-top: 4px"&gt;&#xD;
          &lt;span style="color: blue"&gt;type&lt;/span&gt; Stream &lt;span style="color: blue"&gt;with&lt;/span&gt;&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;match&lt;/span&gt; x.ReadByte() &lt;span style="color: blue"&gt;with&lt;/span&gt;&lt;br&gt;&#xD;
    | -1 &lt;span style="color: blue"&gt;-&amp;gt;&lt;/span&gt; None&lt;br&gt;&#xD;
    |  b &lt;span style="color: blue"&gt;-&amp;gt;&lt;/span&gt; Some(byte b) &#xD;
&lt;/div&gt;&#xD;
        &lt;p&gt;&#xD;
The function above captures the semantic of the int returned by Stream.ReadByte(),&#xD;
which might be either an unsigned byte or -1 when at the end of the stream. In F#,&#xD;
this semantic is easily represented as an &lt;a href="http://msdn.microsoft.com/en-us/library/dd233245.aspx"&gt;Option&lt;/a&gt; and&#xD;
then more easily consumed by other F# code.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
So yes, type extensions are dead useful. However, if you’re writing a type extension&#xD;
for a generic type, you’ll need to include all of the type parameters &lt;em&gt;and&lt;/em&gt; there &lt;a href="http://msdn.microsoft.com/en-us/library/dd233203.aspx"&gt;constraints&lt;/a&gt;.&#xD;
Normally this isn’t a big deal, but I just spent several minutes tearing (more) of&#xD;
my hair out trying to determine the correct incantation to write a type extension&#xD;
for &lt;a href="http://msdn.microsoft.com/en-us/library/b3h38hb0.aspx"&gt;Nullable&lt;t&gt;&lt;/t&gt;&lt;/a&gt;.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
In the documentation, Nullable&lt;t&gt;&#xD;
is declared with two generic constraints: a struct constraint and a default constructor&#xD;
constraint. However, that’s not quite enough to make the F# compiler happy. F# expects&#xD;
a type constraint to System.ValueType as well. So, &lt;em&gt;three&lt;/em&gt; constraints are&#xD;
needed to declare a type extension for Nullable&lt;t&gt;&#xD;
.&#xD;
&lt;/t&gt;&lt;/t&gt;&lt;/p&gt;&#xD;
        &lt;div style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; padding-bottom: 4px; background-color: rgb(255,255,255); margin: 4px; padding-left: 4px; padding-right: 4px; font-family: consolas,'Courier New',courier,monospace; color: rgb(0,0,0); font-size: small; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted; padding-top: 4px"&gt;&#xD;
          &lt;span style="color: blue"&gt;type&lt;/span&gt; Nullable&amp;lt;'a &lt;span style="color: blue"&gt;when&lt;/span&gt; 'a&#xD;
: &lt;span style="color: blue"&gt;struct&lt;/span&gt;&lt;br&gt;&#xD;
                  &lt;span style="color: blue"&gt;and&lt;/span&gt; 'a&#xD;
: (&lt;span style="color: blue"&gt;new&lt;/span&gt; : unit &lt;span style="color: blue"&gt;-&amp;gt;&lt;/span&gt; 'a)&lt;br&gt;&#xD;
                  &lt;span style="color: blue"&gt;and&lt;/span&gt; 'a&#xD;
:&amp;gt; System.ValueType&amp;gt; &lt;span style="color: blue"&gt;with&lt;/span&gt;&lt;br&gt;&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;member&lt;/span&gt; x.AsOption() =&lt;br&gt;&#xD;
        &lt;span style="color: blue"&gt;match&lt;/span&gt; x.HasValue &lt;span style="color: blue"&gt;with&lt;/span&gt;&lt;br&gt;&#xD;
        | &lt;span style="color: blue"&gt;true&lt;/span&gt;  &lt;span style="color: blue"&gt;-&amp;gt;&lt;/span&gt; Some(x.Value)&lt;br&gt;&#xD;
        | &lt;span style="color: blue"&gt;false&lt;/span&gt; &lt;span style="color: blue"&gt;-&amp;gt;&lt;/span&gt; None &#xD;
&lt;/div&gt;&#xD;
        &lt;p&gt;&#xD;
Of course, once you’ve written that, you shouldn’t need to write it again and you&#xD;
can use the extension to handle Nullable&lt;t&gt;&#xD;
a bit more naturally in F#.&#xD;
&lt;/t&gt;&lt;/p&gt;&#xD;
        &lt;div style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; padding-bottom: 4px; background-color: rgb(255,255,255); margin: 4px; padding-left: 4px; padding-right: 4px; font-family: consolas,'Courier New',courier,monospace; color: rgb(0,0,0); font-size: small; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted; padding-top: 4px"&gt;&#xD;
          &lt;span style="color: blue"&gt;match&lt;/span&gt; someNullable.AsOption() &lt;span style="color: blue"&gt;with&lt;/span&gt;&lt;br&gt;&#xD;
| Some(n) &lt;span style="color: blue"&gt;-&amp;gt;&lt;/span&gt; printfn &lt;span style="color: maroon"&gt;"%d"&lt;/span&gt; n&lt;br&gt;&#xD;
| None    &lt;span style="color: blue"&gt;-&amp;gt;&lt;/span&gt; () &#xD;
&lt;/div&gt;&#xD;
        &lt;img width="0" height="0" src="http://diditwith.net/aggbug.ashx?id=f7ea1c53-aa0c-4063-817e-8342522e30e2"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=4faCKVqUoFA:AvsDB_-LlyE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=4faCKVqUoFA:AvsDB_-LlyE:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=4faCKVqUoFA:AvsDB_-LlyE:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=4faCKVqUoFA:AvsDB_-LlyE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=4faCKVqUoFA:AvsDB_-LlyE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=4faCKVqUoFA:AvsDB_-LlyE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=4faCKVqUoFA:AvsDB_-LlyE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=4faCKVqUoFA:AvsDB_-LlyE:cGdyc7Q-1BI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cGdyc7Q-1BI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=4faCKVqUoFA:AvsDB_-LlyE:7qCK26UlVX8"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=7qCK26UlVX8" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=4faCKVqUoFA:AvsDB_-LlyE:cTv1dNCI_Tc"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cTv1dNCI_Tc" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DidItWithDotNet/~4/4faCKVqUoFA" height="1" width="1"/&gt;</description>
      <comments>http://diditwith.net/CommentView,guid,f7ea1c53-aa0c-4063-817e-8342522e30e2.aspx</comments>
      <category>F#</category>
      <category>Functional Programming</category>
      <category>Quality Code</category>
    <feedburner:origLink>http://diditwith.net/2012/02/18/WritingFTypeExtensionsForNullable.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://diditwith.net/Trackback.aspx?guid=0dc4461b-0836-4dcb-8994-17715003926e</trackback:ping>
      <pingback:server>http://diditwith.net/pingback.aspx</pingback:server>
      <pingback:target>http://diditwith.net/PermaLink,guid,0dc4461b-0836-4dcb-8994-17715003926e.aspx</pingback:target>
      <dc:creator>Dustin Campbell</dc:creator>
      <wfw:comment>http://diditwith.net/CommentView,guid,0dc4461b-0836-4dcb-8994-17715003926e.aspx</wfw:comment>
      <wfw:commentRss>http://diditwith.net/SyndicationService.asmx/GetEntryCommentsRss?guid=0dc4461b-0836-4dcb-8994-17715003926e</wfw:commentRss>
      <slash:comments>9</slash:comments>
      
      <title>Using Sublime Text 2 to Edit Git Commit Messages on Windows</title>
      <guid isPermaLink="false">http://diditwith.net/PermaLink,guid,0dc4461b-0836-4dcb-8994-17715003926e.aspx</guid>
      <link>http://feedproxy.google.com/~r/DidItWithDotNet/~3/_XHaWySlzD0/UsingSublimeText2ToEditGitCommitMessagesOnWindows.aspx</link>
      <pubDate>Sat, 18 Feb 2012 20:25:58 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
These days, I’m using the &lt;a href="http://www.sublimetext.com/blog/articles/sublime-text-2-beta"&gt;Sublime&#xD;
Text 2 Beta&lt;/a&gt; as my text editor of choice on Windows. I searched around to find&#xD;
the magical incantation to use that would allow Git to use it as my commit message&#xD;
editor and came up empty. It turns out not to be a big deal. Just create a batch file&#xD;
that launches sublime_text.exe with &lt;font face="Courier New"&gt;--wait&lt;/font&gt; and &lt;font face="Courier New"&gt;--new-window&lt;/font&gt; arguments.&#xD;
Something like the following:&#xD;
&lt;/p&gt;&#xD;
        &lt;div style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; padding-bottom: 4px; background-color: rgb(255,255,255); margin: 4px; padding-left: 4px; padding-right: 4px; font-family: consolas,'Courier New',courier,monospace; color: rgb(0,0,0); font-size: small; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted; padding-top: 4px"&gt;"C:\Program&#xD;
Files\Sublime Text 2\sublime_text.exe" --wait --new-window "%1"&#xD;
&lt;/div&gt;&#xD;
        &lt;p&gt;&#xD;
Then it’s just a matter of setting the batch file as the core editor used by git:&#xD;
&lt;/p&gt;&#xD;
        &lt;div style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; padding-bottom: 4px; background-color: rgb(255,255,255); margin: 4px; padding-left: 4px; padding-right: 4px; font-family: consolas,'Courier New',courier,monospace; color: rgb(0,0,0); font-size: small; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted; padding-top: 4px"&gt;git&#xD;
--config core.editor C:/Scripts/sublime.bat&#xD;
&lt;/div&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;Update (2/25/2012)&lt;/strong&gt;: The &lt;font face="Courier New"&gt;–multiinstance&lt;/font&gt; command&#xD;
will do a much better job when launching sublime_text.exe from the command prompt,&#xD;
especially when you already have an instance of sublime_text.exe open. Update your&#xD;
batch file to look like so, and you should be good to go.&#xD;
&lt;/p&gt;&#xD;
        &lt;div style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; padding-bottom: 4px; background-color: rgb(255,255,255); margin: 4px; padding-left: 4px; padding-right: 4px; font-family: consolas,'Courier New',courier,monospace; color: rgb(0,0,0); font-size: small; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted; padding-top: 4px"&gt;"C:\Program&#xD;
Files\Sublime Text 2\sublime_text.exe" --wait --multiinstance "%1"&#xD;
&lt;/div&gt;&#xD;
        &lt;img width="0" height="0" src="http://diditwith.net/aggbug.ashx?id=0dc4461b-0836-4dcb-8994-17715003926e"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=_XHaWySlzD0:rYGaSdZ7THg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=_XHaWySlzD0:rYGaSdZ7THg:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=_XHaWySlzD0:rYGaSdZ7THg:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=_XHaWySlzD0:rYGaSdZ7THg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=_XHaWySlzD0:rYGaSdZ7THg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=_XHaWySlzD0:rYGaSdZ7THg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=_XHaWySlzD0:rYGaSdZ7THg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=_XHaWySlzD0:rYGaSdZ7THg:cGdyc7Q-1BI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cGdyc7Q-1BI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=_XHaWySlzD0:rYGaSdZ7THg:7qCK26UlVX8"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=7qCK26UlVX8" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=_XHaWySlzD0:rYGaSdZ7THg:cTv1dNCI_Tc"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cTv1dNCI_Tc" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DidItWithDotNet/~4/_XHaWySlzD0" height="1" width="1"/&gt;</description>
      <comments>http://diditwith.net/CommentView,guid,0dc4461b-0836-4dcb-8994-17715003926e.aspx</comments>
      <category>Power Tools</category>
      <category>Tips &amp; Tricks</category>
    <feedburner:origLink>http://diditwith.net/2012/02/18/UsingSublimeText2ToEditGitCommitMessagesOnWindows.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://diditwith.net/Trackback.aspx?guid=3bb3962c-bece-48d4-8fe2-7140f059383d</trackback:ping>
      <pingback:server>http://diditwith.net/pingback.aspx</pingback:server>
      <pingback:target>http://diditwith.net/PermaLink,guid,3bb3962c-bece-48d4-8fe2-7140f059383d.aspx</pingback:target>
      <dc:creator>Dustin Campbell</dc:creator>
      <wfw:comment>http://diditwith.net/CommentView,guid,3bb3962c-bece-48d4-8fe2-7140f059383d.aspx</wfw:comment>
      <wfw:commentRss>http://diditwith.net/SyndicationService.asmx/GetEntryCommentsRss?guid=3bb3962c-bece-48d4-8fe2-7140f059383d</wfw:commentRss>
      <slash:comments>6</slash:comments>
      
      <title>Post-CodeMash Resolutions</title>
      <guid isPermaLink="false">http://diditwith.net/PermaLink,guid,3bb3962c-bece-48d4-8fe2-7140f059383d.aspx</guid>
      <link>http://feedproxy.google.com/~r/DidItWithDotNet/~3/bq9KLVJYYYc/PostCodeMashResolutions.aspx</link>
      <pubDate>Mon, 16 Jan 2012 00:25:23 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://diditwith.net/content/binary/Windows-Live-Writer/CodeMash-Resolutions_D528/logo-codemash_2.png"&gt;&#xD;
            &lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="CodeMash Logo" border="0" alt="CodeMash Logo" src="http://diditwith.net/content/binary/Windows-Live-Writer/CodeMash-Resolutions_D528/logo-codemash_thumb.png" width="126" height="134"&gt;&lt;/img&gt;&#xD;
          &lt;/a&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I failed to make any New Year’s resolutions this year. I guess I’d decided that things&#xD;
were going “OK” and I really didn’t need to make any changes. However, after spending&#xD;
the last several days at &lt;a href="http://codemash.org"&gt;CodeMash&lt;/a&gt; engaging with&#xD;
old friends and making new ones, I feel seriously challenged to step up my game. Below&#xD;
is my list of resolutions for the coming year.&#xD;
&lt;/p&gt;&#xD;
        &lt;ul&gt;&#xD;
          &lt;li&gt;&#xD;
            &lt;strong&gt;Get Back to Blogging&lt;/strong&gt;&#xD;
            &lt;br&gt;&#xD;
Some of you may have noticed that I haven’t blogged in awhile. In fact, I missed 2011&#xD;
entirely. &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-embarrassedsmile" alt="Embarrassed smile" src="http://diditwith.net/content/binary/Windows-Live-Writer/CodeMash-Resolutions_D528/wlEmoticon-embarrassedsmile_2.png"&gt;&lt;/img&gt;&lt;br&gt;&#xD;
At CodeMash, I met several very cool people for the first time who said that they&#xD;
knew me from my blog. It simply amazed (and flattered) me that, with no new content,&#xD;
this little programming blog was still making an impact. It’s time to dust things&#xD;
off around here.&lt;!--EndFragment--&gt;&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
            &lt;strong&gt;Start a New F# Pet Project&lt;/strong&gt;&#xD;
            &lt;br&gt;&#xD;
I have neglected my love of &lt;a href="http://msdn.microsoft.com/en-us/vstudio/hh388569"&gt;F#&lt;/a&gt; for&#xD;
a long time, but conversations at CodeMash convinced me that I need to rekindle my&#xD;
romance. &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
            &lt;strong&gt;Return to &lt;/strong&gt;&#xD;
            &lt;a href="http://twitter.com/dcampbell"&gt;Twitter&lt;/a&gt;&#xD;
            &lt;strong&gt;&#xD;
              &lt;br&gt;&#xD;
            &lt;/strong&gt;My activity has really slowed to a crawl over the past few years, and I intend&#xD;
to correct that. I’m tired of feeling out of the loop. &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
            &lt;strong&gt;Be at CodeMash Next Year&lt;/strong&gt;&#xD;
            &lt;br&gt;&#xD;
How did I allow myself to miss CodeMash for the last two years? I resolve to never&#xD;
let that to happen again.&lt;/li&gt;&#xD;
        &lt;/ul&gt;&#xD;
        &lt;img width="0" height="0" src="http://diditwith.net/aggbug.ashx?id=3bb3962c-bece-48d4-8fe2-7140f059383d"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=bq9KLVJYYYc:C1AXEsF8uTQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=bq9KLVJYYYc:C1AXEsF8uTQ:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=bq9KLVJYYYc:C1AXEsF8uTQ:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=bq9KLVJYYYc:C1AXEsF8uTQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=bq9KLVJYYYc:C1AXEsF8uTQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=bq9KLVJYYYc:C1AXEsF8uTQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=bq9KLVJYYYc:C1AXEsF8uTQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=bq9KLVJYYYc:C1AXEsF8uTQ:cGdyc7Q-1BI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cGdyc7Q-1BI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=bq9KLVJYYYc:C1AXEsF8uTQ:7qCK26UlVX8"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=7qCK26UlVX8" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=bq9KLVJYYYc:C1AXEsF8uTQ:cTv1dNCI_Tc"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cTv1dNCI_Tc" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DidItWithDotNet/~4/bq9KLVJYYYc" height="1" width="1"/&gt;</description>
      <comments>http://diditwith.net/CommentView,guid,3bb3962c-bece-48d4-8fe2-7140f059383d.aspx</comments>
      <category>Community</category>
      <category>Geek Life</category>
      <category>It's all about me</category>
    <feedburner:origLink>http://diditwith.net/2012/01/16/PostCodeMashResolutions.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://diditwith.net/Trackback.aspx?guid=2dfea34a-d25c-4f3d-8bda-11da1d85c84e</trackback:ping>
      <pingback:server>http://diditwith.net/pingback.aspx</pingback:server>
      <pingback:target>http://diditwith.net/PermaLink,guid,2dfea34a-d25c-4f3d-8bda-11da1d85c84e.aspx</pingback:target>
      <dc:creator>Dustin Campbell</dc:creator>
      <wfw:comment>http://diditwith.net/CommentView,guid,2dfea34a-d25c-4f3d-8bda-11da1d85c84e.aspx</wfw:comment>
      <wfw:commentRss>http://diditwith.net/SyndicationService.asmx/GetEntryCommentsRss?guid=2dfea34a-d25c-4f3d-8bda-11da1d85c84e</wfw:commentRss>
      
      <title>F# Contracts on the Cheap</title>
      <guid isPermaLink="false">http://diditwith.net/PermaLink,guid,2dfea34a-d25c-4f3d-8bda-11da1d85c84e.aspx</guid>
      <link>http://feedproxy.google.com/~r/DidItWithDotNet/~3/OkcCk0tpb-w/FContractsOnTheCheap.aspx</link>
      <pubDate>Sun, 31 Oct 2010 18:26:02 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
In my &lt;a href="http://en.wikipedia.org/wiki/Z-machine"&gt;current&lt;/a&gt; F# project, I’ve&#xD;
employed a very simple library to support basic contract checking. It’s not fantastically&#xD;
clever, but I thought I’d post it here in case others find it useful.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
To use the library, pipe values into the various functions of the “Is” module. For&#xD;
example…&#xD;
&lt;/p&gt;&#xD;
        &lt;div style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; padding-bottom: 4px; background-color: rgb(255,255,255); margin: 4px; padding-left: 4px; padding-right: 4px; font-family: consolas,'Courier New',courier,monospace; color: rgb(0,0,0); font-size: small; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted; padding-top: 4px"&gt;&#xD;
          &lt;span style="color: blue"&gt;let&lt;/span&gt; jz&#xD;
: OpcodeRoutine = &lt;span style="color: blue"&gt;fun&lt;/span&gt; (i, proc) &lt;span style="color: blue"&gt;-&amp;gt;&lt;/span&gt;&lt;br&gt;&#xD;
  &lt;span style="background-color: #dfffdf"&gt;i.Operands.Length |&amp;gt; Is.EqualTo&#xD;
1&lt;/span&gt;&lt;br&gt;&#xD;
  &lt;span style="background-color: #dfffdf"&gt;i.HasBranchOffset |&amp;gt; Is.True&lt;/span&gt;&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; x = i.Operands.[0] |&amp;gt; proc.GetOperandValue&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; res = x = 0us&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;if&lt;/span&gt; i.BranchOffset.Condition = res &lt;span style="color: blue"&gt;then&lt;/span&gt;&lt;br&gt;&#xD;
    proc.Branch i.BranchOffset &#xD;
&lt;/div&gt;&#xD;
        &lt;p&gt;&#xD;
If either of the two preconditions highlighted above fail, a ContractFailureException&#xD;
will be thrown.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The full module is below. Again, the following code isn’t exactly rocket science,&#xD;
but I’ve found it dead useful, and you might, too. &#xD;
&lt;/p&gt;&#xD;
        &lt;div style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; padding-bottom: 4px; background-color: rgb(255,255,255); margin: 4px; padding-left: 4px; padding-right: 4px; font-family: consolas,'Courier New',courier,monospace; color: rgb(0,0,0); font-size: small; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted; padding-top: 4px"&gt;&#xD;
          &lt;span style="color: blue"&gt;exception&lt;/span&gt; ContractFailureException &lt;span style="color: blue"&gt;of&lt;/span&gt; string&lt;br&gt;&lt;br&gt;&#xD;
[&amp;lt;RequiredModuleAccess&amp;gt;]&lt;br&gt;&lt;span style="color: blue"&gt;module&lt;/span&gt; Is =&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; &lt;span style="color: blue"&gt;inline&lt;/span&gt; &lt;span style="color: blue"&gt;private&lt;/span&gt; fail&#xD;
message =&lt;br&gt;&#xD;
    raise &amp;lt;| ContractFailureException(message)&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; &lt;span style="color: blue"&gt;inline&lt;/span&gt; &lt;span style="color: blue"&gt;private&lt;/span&gt; failf&#xD;
fmt =&lt;br&gt;&#xD;
    Printf.ksprintf fail fmt&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; &lt;span style="color: blue"&gt;inline&lt;/span&gt; True&#xD;
condition =&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;if&lt;/span&gt; condition &amp;lt;&amp;gt; &lt;span style="color: blue"&gt;true&lt;/span&gt; &lt;span style="color: blue"&gt;then&lt;/span&gt;&lt;br&gt;&#xD;
      fail &lt;span style="color: maroon"&gt;"condition should&#xD;
be true."&lt;/span&gt;&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; &lt;span style="color: blue"&gt;inline&lt;/span&gt; False&#xD;
condition =&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;if&lt;/span&gt; condition = &lt;span style="color: blue"&gt;true&lt;/span&gt; &lt;span style="color: blue"&gt;then&lt;/span&gt;&lt;br&gt;&#xD;
      fail &lt;span style="color: maroon"&gt;"condition should&#xD;
be false."&lt;/span&gt;&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; &lt;span style="color: blue"&gt;inline&lt;/span&gt; Null&#xD;
obj =&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;if&lt;/span&gt; obj &amp;lt;&amp;gt; &lt;span style="color: blue"&gt;null&lt;/span&gt; &lt;span style="color: blue"&gt;then&lt;/span&gt;&lt;br&gt;&#xD;
      fail &lt;span style="color: maroon"&gt;"obj should be null."&lt;/span&gt;&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; &lt;span style="color: blue"&gt;inline&lt;/span&gt; Some&#xD;
obj =&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;match&lt;/span&gt; obj &lt;span style="color: blue"&gt;with&lt;/span&gt;&lt;br&gt;&#xD;
    | Some(_) &lt;span style="color: blue"&gt;-&amp;gt;&lt;/span&gt; ()&lt;br&gt;&#xD;
    | None &lt;span style="color: blue"&gt;-&amp;gt;&lt;/span&gt; fail &lt;span style="color: maroon"&gt;"obj&#xD;
should be Some."&lt;/span&gt;&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; &lt;span style="color: blue"&gt;inline&lt;/span&gt; None&#xD;
obj =&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;match&lt;/span&gt; obj &lt;span style="color: blue"&gt;with&lt;/span&gt;&lt;br&gt;&#xD;
    | Some(_) &lt;span style="color: blue"&gt;-&amp;gt;&lt;/span&gt; fail &lt;span style="color: maroon"&gt;"obj&#xD;
should be None."&lt;/span&gt;&lt;br&gt;&#xD;
    | None &lt;span style="color: blue"&gt;-&amp;gt;&lt;/span&gt; ()&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; &lt;span style="color: blue"&gt;inline&lt;/span&gt; NotNull&#xD;
obj =&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;if&lt;/span&gt; obj = &lt;span style="color: blue"&gt;null&lt;/span&gt; &lt;span style="color: blue"&gt;then&lt;/span&gt;&lt;br&gt;&#xD;
      fail &lt;span style="color: maroon"&gt;"obj should not be&#xD;
null."&lt;/span&gt;&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; &lt;span style="color: blue"&gt;inline&lt;/span&gt; EqualTo&#xD;
expected value =&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;if&lt;/span&gt; value &amp;lt;&amp;gt; expected &lt;span style="color: blue"&gt;then&lt;/span&gt;&lt;br&gt;&#xD;
      failf &lt;span style="color: maroon"&gt;"value should be&#xD;
equal to %A."&lt;/span&gt; expected&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; &lt;span style="color: blue"&gt;inline&lt;/span&gt; NotEqualTo&#xD;
expected value =&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;if&lt;/span&gt; value = expected &lt;span style="color: blue"&gt;then&lt;/span&gt;&lt;br&gt;&#xD;
      failf &lt;span style="color: maroon"&gt;"value should not&#xD;
be equal to %A."&lt;/span&gt; expected&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; &lt;span style="color: blue"&gt;inline&lt;/span&gt; LessThan&#xD;
high value =&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;if&lt;/span&gt; value &amp;gt;= high &lt;span style="color: blue"&gt;then&lt;/span&gt;&lt;br&gt;&#xD;
      failf &lt;span style="color: maroon"&gt;"value should be&#xD;
less than %A."&lt;/span&gt; high&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; &lt;span style="color: blue"&gt;inline&lt;/span&gt; LessThanOrEqualTo&#xD;
high value =&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;if&lt;/span&gt; value &amp;gt; high &lt;span style="color: blue"&gt;then&lt;/span&gt;&lt;br&gt;&#xD;
      failf &lt;span style="color: maroon"&gt;"value should be&#xD;
less than or equal to %A."&lt;/span&gt; high&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; &lt;span style="color: blue"&gt;inline&lt;/span&gt; GreaterThan&#xD;
low value =&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;if&lt;/span&gt; value &amp;lt;= low &lt;span style="color: blue"&gt;then&lt;/span&gt;&lt;br&gt;&#xD;
      failf &lt;span style="color: maroon"&gt;"value should be&#xD;
greater than %A."&lt;/span&gt; low&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; &lt;span style="color: blue"&gt;inline&lt;/span&gt; GreaterThanOrEqualTo&#xD;
low value =&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;if&lt;/span&gt; value &amp;lt; low &lt;span style="color: blue"&gt;then&lt;/span&gt;&lt;br&gt;&#xD;
      failf &lt;span style="color: maroon"&gt;"value should be&#xD;
greater than or equal to %A."&lt;/span&gt; low&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; &lt;span style="color: blue"&gt;inline&lt;/span&gt; InRange&#xD;
low high value =&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;if&lt;/span&gt; value &amp;lt; low || value &amp;gt;&#xD;
high &lt;span style="color: blue"&gt;then&lt;/span&gt;&lt;br&gt;&#xD;
      failf &lt;span style="color: maroon"&gt;"value should be&#xD;
in range %A to %A."&lt;/span&gt; low high&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; &lt;span style="color: blue"&gt;inline&lt;/span&gt; NotInRange&#xD;
low high value =&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;if&lt;/span&gt; value &amp;gt;= low &amp;amp;&amp;amp;&#xD;
value &amp;lt;= high &lt;span style="color: blue"&gt;then&lt;/span&gt;&lt;br&gt;&#xD;
      failf &lt;span style="color: maroon"&gt;"value should not&#xD;
be in range %A to %A."&lt;/span&gt; low high&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; &lt;span style="color: blue"&gt;inline&lt;/span&gt; Empty&#xD;
(value : seq&amp;lt;_&amp;gt;) =&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;if&lt;/span&gt; not (value |&amp;gt; Seq.isEmpty) &lt;span style="color: blue"&gt;then&lt;/span&gt;&lt;br&gt;&#xD;
      fail &lt;span style="color: maroon"&gt;"value should be empty."&lt;/span&gt;&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; &lt;span style="color: blue"&gt;inline&lt;/span&gt; NotEmpty&#xD;
(value : seq&amp;lt;_&amp;gt;) =&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;if&lt;/span&gt; value |&amp;gt; Seq.isEmpty &lt;span style="color: blue"&gt;then&lt;/span&gt;&lt;br&gt;&#xD;
      fail &lt;span style="color: maroon"&gt;"value should not&#xD;
be empty."&lt;/span&gt;&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; &lt;span style="color: blue"&gt;inline&lt;/span&gt; OfType&amp;lt;'a&amp;gt;&#xD;
(value : obj) =&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;match&lt;/span&gt; value &lt;span style="color: blue"&gt;with&lt;/span&gt;&lt;br&gt;&#xD;
    | :? 'a &lt;span style="color: blue"&gt;-&amp;gt;&lt;/span&gt; ()&lt;br&gt;&#xD;
    | _ &lt;span style="color: blue"&gt;-&amp;gt;&lt;/span&gt; failf &lt;span style="color: maroon"&gt;"value&#xD;
should be of type %s."&lt;/span&gt; typeof&amp;lt;'a&amp;gt;.FullName&lt;br&gt;&lt;br&gt;&#xD;
  &lt;span style="color: blue"&gt;let&lt;/span&gt; &lt;span style="color: blue"&gt;inline&lt;/span&gt; NotOfType&amp;lt;'a&amp;gt;&#xD;
(value : obj) =&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;match&lt;/span&gt; value &lt;span style="color: blue"&gt;with&lt;/span&gt;&lt;br&gt;&#xD;
    | :? 'a &lt;span style="color: blue"&gt;-&amp;gt;&lt;/span&gt; failf &lt;span style="color: maroon"&gt;"value&#xD;
should not be of type %s."&lt;/span&gt; typeof&amp;lt;'a&amp;gt;.FullName&lt;br&gt;&#xD;
    | _ &lt;span style="color: blue"&gt;-&amp;gt;&lt;/span&gt; ()&lt;br&gt;&lt;/div&gt;&#xD;
        &lt;p&gt;&#xD;
Enjoy!&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://diditwith.net/aggbug.ashx?id=2dfea34a-d25c-4f3d-8bda-11da1d85c84e"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=OkcCk0tpb-w:9mjwfo03sZA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=OkcCk0tpb-w:9mjwfo03sZA:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=OkcCk0tpb-w:9mjwfo03sZA:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=OkcCk0tpb-w:9mjwfo03sZA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=OkcCk0tpb-w:9mjwfo03sZA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=OkcCk0tpb-w:9mjwfo03sZA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=OkcCk0tpb-w:9mjwfo03sZA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=OkcCk0tpb-w:9mjwfo03sZA:cGdyc7Q-1BI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cGdyc7Q-1BI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=OkcCk0tpb-w:9mjwfo03sZA:7qCK26UlVX8"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=7qCK26UlVX8" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=OkcCk0tpb-w:9mjwfo03sZA:cTv1dNCI_Tc"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cTv1dNCI_Tc" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DidItWithDotNet/~4/OkcCk0tpb-w" height="1" width="1"/&gt;</description>
      <comments>http://diditwith.net/CommentView,guid,2dfea34a-d25c-4f3d-8bda-11da1d85c84e.aspx</comments>
      <category>F#</category>
      <category>Functional Programming</category>
      <category>Z-Machine</category>
    <feedburner:origLink>http://diditwith.net/2010/10/31/FContractsOnTheCheap.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://diditwith.net/Trackback.aspx?guid=dddee84c-580c-438b-89c3-5282e5d6bc14</trackback:ping>
      <pingback:server>http://diditwith.net/pingback.aspx</pingback:server>
      <pingback:target>http://diditwith.net/PermaLink,guid,dddee84c-580c-438b-89c3-5282e5d6bc14.aspx</pingback:target>
      <dc:creator>Dustin Campbell</dc:creator>
      <wfw:comment>http://diditwith.net/CommentView,guid,dddee84c-580c-438b-89c3-5282e5d6bc14.aspx</wfw:comment>
      <wfw:commentRss>http://diditwith.net/SyndicationService.asmx/GetEntryCommentsRss?guid=dddee84c-580c-438b-89c3-5282e5d6bc14</wfw:commentRss>
      <slash:comments>2</slash:comments>
      
      <title>Goings On</title>
      <guid isPermaLink="false">http://diditwith.net/PermaLink,guid,dddee84c-580c-438b-89c3-5282e5d6bc14.aspx</guid>
      <link>http://feedproxy.google.com/~r/DidItWithDotNet/~3/gFRY6pm40z0/GoingsOn.aspx</link>
      <pubDate>Wed, 05 May 2010 15:00:52 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
The last several weeks have been pretty hectic for me. First, &lt;a href="http://msdn.microsoft.com/en-us/vstudio/default.aspx"&gt;Visual&#xD;
Studio 2010&lt;/a&gt; and .NET Framework 4 shipped. Of course, only those living in caves&#xD;
and under rocks missed that bit of news. However, that event forced me to leave my&#xD;
own cave and make a few public appearances.&#xD;
&lt;/p&gt;&#xD;
        &lt;ul&gt;&#xD;
          &lt;li&gt;&#xD;
April 12-15 - &lt;a href="http://www.devconnections.com/"&gt;DevConnections&lt;/a&gt;, Las Vegas&lt;br&gt;&lt;br&gt;&#xD;
One thing that I love about the Bellagio is how they go out of their way to make me&#xD;
comfortable by naming their convention center rooms after the &lt;a href="http://en.wikipedia.org/wiki/Teenage_mutant_ninja_turtles"&gt;Teenage&#xD;
Mutant Ninja Turtles&lt;/a&gt;. Let’s see, there’s Michelangelo… Raphael… Donatello… Huh?&#xD;
What do you mean the rooms were named after Renaissance painters?&lt;br&gt;&lt;br&gt;&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
April 26 - &lt;a href="http://www.dotnetrocks.com/default.aspx?showNum=548"&gt;.NET Rocks&#xD;
Road Trip&lt;/a&gt;, Houston&lt;br&gt;&lt;br&gt;&#xD;
Hanging out with &lt;a href="http://www.franklins.net/carl.aspx"&gt;Carl&lt;/a&gt; and &lt;a href="http://www.campbellassociates.ca/"&gt;Richard&lt;/a&gt; is&#xD;
always a blast. In the past, I’ve been left with stories that I can’t really share&#xD;
in mixed company. This time they turned on the microphones and pressed “record.”&lt;br&gt;&lt;br&gt;&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
June 7-10 – &lt;a href="http://northamerica.msteched.com"&gt;Tech Ed 2010&lt;/a&gt;, New Orleans&lt;br&gt;&lt;br&gt;&#xD;
I’ll be there. Who else is coming?&lt;/li&gt;&#xD;
        &lt;/ul&gt;&#xD;
        &lt;img width="0" height="0" src="http://diditwith.net/aggbug.ashx?id=dddee84c-580c-438b-89c3-5282e5d6bc14"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=gFRY6pm40z0:qwPUuooBAKw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=gFRY6pm40z0:qwPUuooBAKw:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=gFRY6pm40z0:qwPUuooBAKw:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=gFRY6pm40z0:qwPUuooBAKw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=gFRY6pm40z0:qwPUuooBAKw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=gFRY6pm40z0:qwPUuooBAKw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=gFRY6pm40z0:qwPUuooBAKw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=gFRY6pm40z0:qwPUuooBAKw:cGdyc7Q-1BI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cGdyc7Q-1BI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=gFRY6pm40z0:qwPUuooBAKw:7qCK26UlVX8"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=7qCK26UlVX8" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=gFRY6pm40z0:qwPUuooBAKw:cTv1dNCI_Tc"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cTv1dNCI_Tc" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DidItWithDotNet/~4/gFRY6pm40z0" height="1" width="1"/&gt;</description>
      <comments>http://diditwith.net/CommentView,guid,dddee84c-580c-438b-89c3-5282e5d6bc14.aspx</comments>
      <category>Community</category>
      <category>It's all about me</category>
    <feedburner:origLink>http://diditwith.net/2010/05/05/GoingsOn.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://diditwith.net/Trackback.aspx?guid=b0b7506a-029a-49b2-82c5-9898e924ef50</trackback:ping>
      <pingback:server>http://diditwith.net/pingback.aspx</pingback:server>
      <pingback:target>http://diditwith.net/PermaLink,guid,b0b7506a-029a-49b2-82c5-9898e924ef50.aspx</pingback:target>
      <dc:creator>Dustin Campbell</dc:creator>
      <wfw:comment>http://diditwith.net/CommentView,guid,b0b7506a-029a-49b2-82c5-9898e924ef50.aspx</wfw:comment>
      <wfw:commentRss>http://diditwith.net/SyndicationService.asmx/GetEntryCommentsRss?guid=b0b7506a-029a-49b2-82c5-9898e924ef50</wfw:commentRss>
      <slash:comments>14</slash:comments>
      
      <title>Empty Nothings</title>
      <guid isPermaLink="false">http://diditwith.net/PermaLink,guid,b0b7506a-029a-49b2-82c5-9898e924ef50.aspx</guid>
      <link>http://feedproxy.google.com/~r/DidItWithDotNet/~3/im7n9Q81CZw/EmptyNothings.aspx</link>
      <pubDate>Thu, 04 Mar 2010 15:42:19 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
A few weeks ago, some of my colleagues and I were discussing the idiosyncrasies of&#xD;
various programming languages (as we often find ourselves doing—we’re kind of geeky&#xD;
that way), when one of us pointed out that the following code is completely valid &lt;a href="http://en.wikipedia.org/wiki/C%2B%2B0x"&gt;C++0x&lt;/a&gt; syntax:&#xD;
&lt;/p&gt;&#xD;
        &lt;div style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; padding-bottom: 4px; background-color: #ffffff; margin: 4px; padding-left: 4px; padding-right: 4px; font-family: consolas,'Courier New',courier,monospace; color: #000000; font-size: small; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted; padding-top: 4px"&gt;[](){}();&#xD;
&lt;/div&gt;&#xD;
        &lt;p&gt;&#xD;
The “operator soup”&lt;sup&gt;1&lt;/sup&gt; above defines a &lt;a href="http://en.wikipedia.org/wiki/C%2B%2B0x#Lambda_functions_and_expressions"&gt;C++&#xD;
lambda expression&lt;/a&gt; (denoted by the square brackets) which declares no parameters&#xD;
(the first empty parentheses) or body (the empty curly braces) and is immediately&#xD;
invoked (the final parentheses). Conceptually, this is a &lt;a href="http://en.wikipedia.org/wiki/NOP"&gt;nop&lt;/a&gt;—an&#xD;
empty lambda that is immediately invoked.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
We found ourselves fascinated by this idea of a do-nothing lambda, and went ahead&#xD;
to define the same thing in our respective languages. Our first attempt was C#.&#xD;
&lt;/p&gt;&#xD;
        &lt;div style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; padding-bottom: 4px; background-color: #ffffff; margin: 4px; padding-left: 4px; padding-right: 4px; font-family: consolas,'Courier New',courier,monospace; color: #000000; font-size: small; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted; padding-top: 4px"&gt;()&#xD;
=&amp;gt; { }();&#xD;
&lt;/div&gt;&#xD;
        &lt;p&gt;&#xD;
While the code above looks quite pretty, it’s not exactly legal. In C#, lambdas must&#xD;
always have an explicit delegate type, so an ugly type-cast is required in order to&#xD;
compile:&#xD;
&lt;/p&gt;&#xD;
        &lt;div style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; padding-bottom: 4px; background-color: #ffffff; margin: 4px; padding-left: 4px; padding-right: 4px; font-family: consolas,'Courier New',courier,monospace; color: #000000; font-size: small; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted; padding-top: 4px"&gt;((&lt;span style="color: #2b91af"&gt;Action&lt;/span&gt;)(()&#xD;
=&amp;gt; { }))();&#xD;
&lt;/div&gt;&#xD;
        &lt;p&gt;&#xD;
Sigh, so close, yet so dissatisfying!&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The stronger notion of &lt;a href="http://en.wikipedia.org/wiki/Type_inference"&gt;type&#xD;
inference&lt;/a&gt; in F# allows for much more succinctness.&lt;sup&gt;2&lt;/sup&gt;&lt;/p&gt;&#xD;
        &lt;div style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; padding-bottom: 4px; background-color: #ffffff; margin: 4px; padding-left: 4px; padding-right: 4px; font-family: consolas,'Courier New',courier,monospace; color: #000000; font-size: small; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted; padding-top: 4px"&gt;(&lt;span style="color: blue"&gt;fun&lt;/span&gt; () &lt;span style="color: blue"&gt;-&amp;gt;&lt;/span&gt; ())() &#xD;
&lt;/div&gt;&#xD;
        &lt;p&gt;&#xD;
However, my favorite version is written in &lt;a href="http://msdn.microsoft.com/en-us/library/2x7h1hfk(VS.100).aspx"&gt;Visual&#xD;
Basic 10&lt;/a&gt;.&#xD;
&lt;/p&gt;&#xD;
        &lt;div style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; padding-bottom: 4px; background-color: #ffffff; margin: 4px; padding-left: 4px; padding-right: 4px; font-family: consolas,'Courier New',courier,monospace; color: #000000; font-size: small; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted; padding-top: 4px"&gt;&#xD;
          &lt;span style="color: blue"&gt;Call&lt;/span&gt; (&lt;span style="color: blue"&gt;Sub&lt;/span&gt;() &lt;span style="color: blue"&gt;Exit&lt;/span&gt; &lt;span style="color: blue"&gt;Sub&lt;/span&gt;)()&#xD;
&lt;/div&gt;&#xD;
        &lt;p&gt;&#xD;
What it lacks in succinctness,&lt;sup&gt;3&lt;/sup&gt; it makes up for with human-readable clarity.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;font size="3"&gt;How do &lt;em&gt;you&lt;/em&gt; write a do-nothing lambda in your language?&lt;/font&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
        &lt;p style="border-top: rgb(221,221,221) 1px solid"&gt;&#xD;
          &lt;sup&gt;1&lt;/sup&gt;One could also declare the square brackets with either an = or &amp;amp; operator&#xD;
inside to define how variables that are declared in the same scope as the lambda are&#xD;
captured within the lambda function’s closure. It’s amazing how much one can do without&#xD;
typing a single identifier character!&#xD;
&lt;/p&gt;&#xD;
        &lt;div style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; padding-bottom: 4px; background-color: #ffffff; margin: 4px; padding-left: 4px; padding-right: 4px; font-family: consolas,'Courier New',courier,monospace; color: #000000; font-size: small; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted; padding-top: 4px"&gt;[&amp;amp;](){}();&#xD;
&lt;/div&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;sup&gt;2&lt;/sup&gt;Note that the F# example contains a subtle difference from the others&#xD;
in that it returns a value of type &lt;a href="http://en.wikipedia.org/wiki/Unit_type"&gt;Unit&lt;/a&gt;.&#xD;
This implies that the entire F# expression could be passed as an argument to another&#xD;
function, but that is not true of the other examples.&lt;br&gt;&lt;br&gt;&lt;sup&gt;3&lt;/sup&gt;Though it’s the same size as the C# version when unnecessary whitespace&#xD;
characters are removed.&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://diditwith.net/aggbug.ashx?id=b0b7506a-029a-49b2-82c5-9898e924ef50"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=im7n9Q81CZw:ksFvzddpZBQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=im7n9Q81CZw:ksFvzddpZBQ:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=im7n9Q81CZw:ksFvzddpZBQ:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=im7n9Q81CZw:ksFvzddpZBQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=im7n9Q81CZw:ksFvzddpZBQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=im7n9Q81CZw:ksFvzddpZBQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=im7n9Q81CZw:ksFvzddpZBQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=im7n9Q81CZw:ksFvzddpZBQ:cGdyc7Q-1BI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cGdyc7Q-1BI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=im7n9Q81CZw:ksFvzddpZBQ:7qCK26UlVX8"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=7qCK26UlVX8" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=im7n9Q81CZw:ksFvzddpZBQ:cTv1dNCI_Tc"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cTv1dNCI_Tc" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DidItWithDotNet/~4/im7n9Q81CZw" height="1" width="1"/&gt;</description>
      <comments>http://diditwith.net/CommentView,guid,b0b7506a-029a-49b2-82c5-9898e924ef50.aspx</comments>
      <category>C#</category>
      <category>F#</category>
      <category>Functional Programming</category>
      <category>Visual Basic</category>
    <feedburner:origLink>http://diditwith.net/2010/03/04/EmptyNothings.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://diditwith.net/Trackback.aspx?guid=d9f4b7f5-1a14-4158-9b4a-31ab416c512e</trackback:ping>
      <pingback:server>http://diditwith.net/pingback.aspx</pingback:server>
      <pingback:target>http://diditwith.net/PermaLink,guid,d9f4b7f5-1a14-4158-9b4a-31ab416c512e.aspx</pingback:target>
      <dc:creator>Dustin Campbell</dc:creator>
      <wfw:comment>http://diditwith.net/CommentView,guid,d9f4b7f5-1a14-4158-9b4a-31ab416c512e.aspx</wfw:comment>
      <wfw:commentRss>http://diditwith.net/SyndicationService.asmx/GetEntryCommentsRss?guid=d9f4b7f5-1a14-4158-9b4a-31ab416c512e</wfw:commentRss>
      <slash:comments>3</slash:comments>
      
      <title>Random Crash</title>
      <guid isPermaLink="false">http://diditwith.net/PermaLink,guid,d9f4b7f5-1a14-4158-9b4a-31ab416c512e.aspx</guid>
      <link>http://feedproxy.google.com/~r/DidItWithDotNet/~3/Ftf1Aar2ltE/RandomCrash.aspx</link>
      <pubDate>Wed, 03 Mar 2010 21:04:58 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;div style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; padding-bottom: 4px; background-color: rgb(255,255,255); margin: 4px; padding-left: 4px; padding-right: 4px; font-family: consolas,'Courier New',courier,monospace; color: rgb(0,0,0); font-size: small; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted; padding-top: 4px"&gt;&#xD;
          &lt;span style="color: blue"&gt;Module&lt;/span&gt; &lt;span style="color: rgb(32,145,175)"&gt;RandomCrash&lt;/span&gt;&lt;br&gt;&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;Sub&lt;/span&gt; Main()&lt;br&gt;&#xD;
        &lt;span style="color: blue"&gt;Try&lt;/span&gt;&lt;br&gt;&#xD;
            &lt;span style="color: blue"&gt;Throw&lt;/span&gt; &lt;span style="color: blue"&gt;New&lt;/span&gt; &lt;span style="color: rgb(32,145,175)"&gt;Exception&lt;/span&gt;&lt;br&gt;&#xD;
        &lt;span style="color: blue"&gt;Catch&lt;/span&gt; ex &lt;span style="color: blue"&gt;As&lt;/span&gt; &lt;span style="color: rgb(32,145,175)"&gt;Exception&lt;/span&gt; &lt;span style="color: blue"&gt;When&lt;/span&gt; &lt;span style="color: rgb(32,145,175)"&gt;DateTime&lt;/span&gt;.Now.Ticks &lt;span style="color: blue"&gt;Mod&lt;/span&gt; 2&#xD;
= 0&lt;br&gt;&lt;br&gt;&#xD;
        &lt;span style="color: blue"&gt;End&lt;/span&gt; &lt;span style="color: blue"&gt;Try&lt;/span&gt;&lt;br&gt;&#xD;
    &lt;span style="color: blue"&gt;End&lt;/span&gt; &lt;span style="color: blue"&gt;Sub&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;span style="color: blue"&gt;End&lt;/span&gt; &lt;span style="color: blue"&gt;Module&lt;/span&gt;&lt;/div&gt;&#xD;
        &lt;img width="0" height="0" src="http://diditwith.net/aggbug.ashx?id=d9f4b7f5-1a14-4158-9b4a-31ab416c512e"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=Ftf1Aar2ltE:t6uqXdi5DP4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=Ftf1Aar2ltE:t6uqXdi5DP4:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=Ftf1Aar2ltE:t6uqXdi5DP4:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=Ftf1Aar2ltE:t6uqXdi5DP4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=Ftf1Aar2ltE:t6uqXdi5DP4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=Ftf1Aar2ltE:t6uqXdi5DP4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=Ftf1Aar2ltE:t6uqXdi5DP4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=Ftf1Aar2ltE:t6uqXdi5DP4:cGdyc7Q-1BI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cGdyc7Q-1BI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=Ftf1Aar2ltE:t6uqXdi5DP4:7qCK26UlVX8"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=7qCK26UlVX8" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=Ftf1Aar2ltE:t6uqXdi5DP4:cTv1dNCI_Tc"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cTv1dNCI_Tc" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DidItWithDotNet/~4/Ftf1Aar2ltE" height="1" width="1"/&gt;</description>
      <comments>http://diditwith.net/CommentView,guid,d9f4b7f5-1a14-4158-9b4a-31ab416c512e.aspx</comments>
      <category>Feeble Attempts At Humor</category>
      <category>Visual Basic</category>
    <feedburner:origLink>http://diditwith.net/2010/03/03/RandomCrash.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://diditwith.net/Trackback.aspx?guid=0e316b70-08ab-4be4-9cb5-e017a3985c33</trackback:ping>
      <pingback:server>http://diditwith.net/pingback.aspx</pingback:server>
      <pingback:target>http://diditwith.net/PermaLink,guid,0e316b70-08ab-4be4-9cb5-e017a3985c33.aspx</pingback:target>
      <dc:creator>Dustin Campbell</dc:creator>
      <wfw:comment>http://diditwith.net/CommentView,guid,0e316b70-08ab-4be4-9cb5-e017a3985c33.aspx</wfw:comment>
      <wfw:commentRss>http://diditwith.net/SyndicationService.asmx/GetEntryCommentsRss?guid=0e316b70-08ab-4be4-9cb5-e017a3985c33</wfw:commentRss>
      <slash:comments>5</slash:comments>
      
      <title>Naming Anonymous Types with Generate from Usage</title>
      <guid isPermaLink="false">http://diditwith.net/PermaLink,guid,0e316b70-08ab-4be4-9cb5-e017a3985c33.aspx</guid>
      <link>http://feedproxy.google.com/~r/DidItWithDotNet/~3/pNBS2HsnjWo/NamingAnonymousTypesWithGenerateFromUsage.aspx</link>
      <pubDate>Sat, 24 Oct 2009 18:01:40 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
Now that &lt;a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx"&gt;Visual Studio&#xD;
2010 Beta 2&lt;/a&gt; is finally out the door, I’ve had a bit more time to spend coding&#xD;
on some of my personal projects. Yesterday, I happened upon a cool trick while using&#xD;
the new &lt;a href="http://msdn.microsoft.com/en-us/library/dd409796(VS.100).aspx"&gt;Generate&#xD;
from Usage&lt;/a&gt; feature. It was so helpful to me that I thought others might benefit,&#xD;
so I’m sharing it here.&#xD;
&lt;/p&gt;&#xD;
        &lt;h3&gt;The Anonymous Type Problem&#xD;
&lt;/h3&gt;&#xD;
        &lt;p&gt;&#xD;
When you need to project some data from a LINQ expression, &lt;a href="http://msdn.microsoft.com/en-us/library/bb387028.aspx"&gt;anonymous&#xD;
types&lt;/a&gt; can be enormously convenient.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted" title="C# Query" alt="C# Query" src="http://diditwith.net/content_images/NamingAnonymousTypes/CSharpQuery.png"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Because anonymous types are… well… &lt;em&gt;anonymous&lt;/em&gt;, they don’t have names that&#xD;
can be expressed in code. This is problematic if you want to expose an anonymous type&#xD;
as the return type of a function. I have run into this problem many times. When refactoring&#xD;
code, it’s easy to get into a situation like the one below.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted" title="Broken C# Function" alt="Broken C# Function" src="http://diditwith.net/content_images/NamingAnonymousTypes/CSharpFromFunction.png"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
So, how can you get around this problem? Well, there a few possibilities.&#xD;
&lt;/p&gt;&#xD;
        &lt;ol&gt;&#xD;
          &lt;li&gt;&#xD;
You could replace ??? with object and use reflection to get at the properties. (Yuck!) &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
You could make the function generic and add a parameter to “mumble” the anonymous&#xD;
type.&lt;sup&gt;1&lt;/sup&gt; (Awkward!) &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
Assuming C# 4.0, you could replace ??? with dynamic.&lt;sup&gt;2&lt;/sup&gt; (No compiler errors!)&lt;/li&gt;&#xD;
        &lt;/ol&gt;&#xD;
        &lt;p&gt;&#xD;
Because none of these solutions is particularly savory, most of us are forced to create&#xD;
a new named type to replace the anonymous type. Thankfully, there are some fantastic&#xD;
third-party refactoring tools out there that can automate this tedious process, but&#xD;
if you don’t use one of these tools you’re stuck writing the code by hand.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Actually, no, that’s not quite true.&#xD;
&lt;/p&gt;&#xD;
        &lt;h3&gt;Generate from Usage to The Rescue!&#xD;
&lt;/h3&gt;&#xD;
        &lt;p&gt;&#xD;
In Visual Studio 2010, the new Generate from Usage feature makes the task of coding&#xD;
up new classes a snap! Just type a new name for the anonymous type in the editor,&#xD;
making the code look like a type constructor followed by an &lt;a href="http://msdn.microsoft.com/en-us/library/bb397680.aspx"&gt;object&#xD;
initializer&lt;/a&gt;. Then, press Ctrl+. to expand the smart tag that immediately appears&#xD;
and choose the first suggestion to generate a new class.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted" title="Generate Class" alt="Generate Class" src="http://diditwith.net/content_images/NamingAnonymousTypes/GenerateClass.png"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Next, expand each smart tag in the object initializer to generate each property.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted" title="Generate Property" alt="Generate Property" src="http://diditwith.net/content_images/NamingAnonymousTypes/GenerateProperty.png"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
When you’re finished, you should have a brand new class containing each property,&#xD;
declared as &lt;a href="http://msdn.microsoft.com/en-us/library/bb384054.aspx"&gt;auto-implemented&#xD;
properties&lt;/a&gt;. Cool!&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted" title="Generated Class" alt="Generated Class" src="http://diditwith.net/content_images/NamingAnonymousTypes/CSharpGeneratedClass.png"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
For Visual Basic coders, Generate from Usage is even easier. Let’s start with the&#xD;
same LINQ expression in VB. (Notice the lack of the “_” line continuation characters.&#xD;
Hooray for VB10 &lt;a href="http://blogs.msdn.com/vbteam/archive/2009/03/27/implicit-line-continuation-in-vb-10-tyler-whitney.aspx"&gt;implicit&#xD;
line continuation&lt;/a&gt;!)&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted" title="VB Query" alt="VB Query" src="http://diditwith.net/content_images/NamingAnonymousTypes/VBQuery.png"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Just like before, type the name of the new type that you wish to generate and press&#xD;
Ctrl+. to expand the smart tag. After choosing the first suggestion from the smart&#xD;
tag, you’re finished. The VB Generate Class feature will drill into the object initializer&#xD;
and generate all of the necessary properties at the same time that the class is generated.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted" title="VB Generate Class" alt="VB Generate Class" src="http://diditwith.net/content_images/NamingAnonymousTypes/VBGenerateClass.png"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;h3&gt;Wrapping Up&#xD;
&lt;/h3&gt;&#xD;
        &lt;p&gt;&#xD;
Of course, this technique is not without flaws.&#xD;
&lt;/p&gt;&#xD;
        &lt;ul&gt;&#xD;
          &lt;li&gt;&#xD;
The resulting type is not immutable like the anonymous type that you’re replacing.&#xD;
To address this, you can easily modify the generated properties to be read-only. &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
The new type does not have the same structural equality semantics that anonymous types&#xD;
have. In practice, I’ve rarely run into an bug caused by anonymous type structural&#xD;
equality, but if this is a concern for you, use one of the &lt;a href="http://diditwith.net/2007/12/22/TwelveDaysOfRefactorXmasDayThreeNameAnonymousType.aspx"&gt;excellent&#xD;
third-party tools&lt;/a&gt; that account for these differences.&lt;/li&gt;&#xD;
        &lt;/ul&gt;&#xD;
        &lt;p&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
        &lt;p style="border-top: rgb(221,221,221) 1px solid"&gt;&#xD;
          &lt;sup&gt;1&lt;/sup&gt;See Wes Dyer's excellent &lt;a href="http://blogs.msdn.com/wesdyer/archive/2007/02/11/baby-names-nameless-keys-and-mumbling.aspx"&gt;article&lt;/a&gt; for&#xD;
an example of this clever trick.&lt;br&gt;&lt;sup&gt;2&lt;/sup&gt;Check out Bill Wagner's &lt;a href="http://srtsolutions.com/blogs/billwagner/archive/2008/11/11/duck-typing-in-c-4-0.aspx"&gt;post&lt;/a&gt; for&#xD;
details.&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://diditwith.net/aggbug.ashx?id=0e316b70-08ab-4be4-9cb5-e017a3985c33"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=pNBS2HsnjWo:FGgPZYDEVjk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=pNBS2HsnjWo:FGgPZYDEVjk:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=pNBS2HsnjWo:FGgPZYDEVjk:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=pNBS2HsnjWo:FGgPZYDEVjk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=pNBS2HsnjWo:FGgPZYDEVjk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=pNBS2HsnjWo:FGgPZYDEVjk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=pNBS2HsnjWo:FGgPZYDEVjk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=pNBS2HsnjWo:FGgPZYDEVjk:cGdyc7Q-1BI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cGdyc7Q-1BI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=pNBS2HsnjWo:FGgPZYDEVjk:7qCK26UlVX8"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=7qCK26UlVX8" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=pNBS2HsnjWo:FGgPZYDEVjk:cTv1dNCI_Tc"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cTv1dNCI_Tc" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DidItWithDotNet/~4/pNBS2HsnjWo" height="1" width="1"/&gt;</description>
      <comments>http://diditwith.net/CommentView,guid,0e316b70-08ab-4be4-9cb5-e017a3985c33.aspx</comments>
      <category>C#</category>
      <category>Tips &amp; Tricks</category>
      <category>Visual Basic</category>
      <category>Visual Studio</category>
    <feedburner:origLink>http://diditwith.net/2009/10/24/NamingAnonymousTypesWithGenerateFromUsage.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://diditwith.net/Trackback.aspx?guid=eb6b7d27-1ede-4f32-9622-976a9f09d178</trackback:ping>
      <pingback:server>http://diditwith.net/pingback.aspx</pingback:server>
      <pingback:target>http://diditwith.net/PermaLink,guid,eb6b7d27-1ede-4f32-9622-976a9f09d178.aspx</pingback:target>
      <dc:creator>Dustin Campbell</dc:creator>
      <wfw:comment>http://diditwith.net/CommentView,guid,eb6b7d27-1ede-4f32-9622-976a9f09d178.aspx</wfw:comment>
      <wfw:commentRss>http://diditwith.net/SyndicationService.asmx/GetEntryCommentsRss?guid=eb6b7d27-1ede-4f32-9622-976a9f09d178</wfw:commentRss>
      <slash:comments>2</slash:comments>
      
      <title>A Lover of Monkeys</title>
      <guid isPermaLink="false">http://diditwith.net/PermaLink,guid,eb6b7d27-1ede-4f32-9622-976a9f09d178.aspx</guid>
      <link>http://feedproxy.google.com/~r/DidItWithDotNet/~3/EzuwryoSO70/ALoverOfMonkeys.aspx</link>
      <pubDate>Fri, 26 Jun 2009 04:07:05 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
The other day, I caught a quick snapshot of &lt;a href="http://diditwith.net/2007/12/10/ItsAGirl.aspx"&gt;Bethany&lt;/a&gt; playing&#xD;
with her favorite new toy:&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted" src="http://diditwith.net/content_images/Monkey.jpg"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted" src="http://diditwith.net/content_images/Monkey2.jpg"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
A special thanks to my friend &lt;a href="http://beyondfocus.com/"&gt;Joseph Hill&lt;/a&gt; for&#xD;
providing her favorite monkey!&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://diditwith.net/aggbug.ashx?id=eb6b7d27-1ede-4f32-9622-976a9f09d178"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=EzuwryoSO70:K-M2sXW_6yA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=EzuwryoSO70:K-M2sXW_6yA:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=EzuwryoSO70:K-M2sXW_6yA:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=EzuwryoSO70:K-M2sXW_6yA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=EzuwryoSO70:K-M2sXW_6yA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=EzuwryoSO70:K-M2sXW_6yA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=EzuwryoSO70:K-M2sXW_6yA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=EzuwryoSO70:K-M2sXW_6yA:cGdyc7Q-1BI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cGdyc7Q-1BI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=EzuwryoSO70:K-M2sXW_6yA:7qCK26UlVX8"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=7qCK26UlVX8" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=EzuwryoSO70:K-M2sXW_6yA:cTv1dNCI_Tc"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cTv1dNCI_Tc" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DidItWithDotNet/~4/EzuwryoSO70" height="1" width="1"/&gt;</description>
      <comments>http://diditwith.net/CommentView,guid,eb6b7d27-1ede-4f32-9622-976a9f09d178.aspx</comments>
      <category>Feeble Attempts At Humor</category>
      <category>It's all about me</category>
    <feedburner:origLink>http://diditwith.net/2009/06/26/ALoverOfMonkeys.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://diditwith.net/Trackback.aspx?guid=adf10d38-3d3e-4341-ad41-11618d5d622b</trackback:ping>
      <pingback:server>http://diditwith.net/pingback.aspx</pingback:server>
      <pingback:target>http://diditwith.net/PermaLink,guid,adf10d38-3d3e-4341-ad41-11618d5d622b.aspx</pingback:target>
      <dc:creator>Dustin Campbell</dc:creator>
      <wfw:comment>http://diditwith.net/CommentView,guid,adf10d38-3d3e-4341-ad41-11618d5d622b.aspx</wfw:comment>
      <wfw:commentRss>http://diditwith.net/SyndicationService.asmx/GetEntryCommentsRss?guid=adf10d38-3d3e-4341-ad41-11618d5d622b</wfw:commentRss>
      
      <title>CodeRush Xpress for C# and VB is Live!</title>
      <guid isPermaLink="false">http://diditwith.net/PermaLink,guid,adf10d38-3d3e-4341-ad41-11618d5d622b.aspx</guid>
      <link>http://feedproxy.google.com/~r/DidItWithDotNet/~3/3fHZMff0D4w/CodeRushXpressForCAndVBIsLive.aspx</link>
      <pubDate>Fri, 15 May 2009 00:59:29 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
Last October, &lt;a href="http://devexpress.com"&gt;DevExpress&lt;/a&gt; released a massively&#xD;
powerful &lt;strong&gt;&lt;font color="#008000"&gt;FREE&lt;/font&gt;&lt;/strong&gt; tool specifically for&#xD;
C# developers called CodeRush Xpress. Today, in partnership with Microsoft, DevExpress&#xD;
has outdone themselves with a brand new version of CodeRush Xpress containing full&#xD;
support for both C# and Visual Basic. This release merges CodeRush Xpress with Refactor!&#xD;
for Visual Basic, creating one giant über-tool with an amazing features:&#xD;
&lt;/p&gt;&#xD;
        &lt;ul&gt;&#xD;
          &lt;li&gt;&#xD;
Duplicate Line &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
Highlight All References &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
Increase or Reduce Selection &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
Smart Clipboard Operations &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
Generate from Using (TDD) &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
Quick Navigation Window &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
Quick File Navigation &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
            &lt;strong&gt;60+&lt;/strong&gt; Refactorings!&lt;/li&gt;&#xD;
        &lt;/ul&gt;&#xD;
        &lt;p&gt;&#xD;
Get it while it’s hot! You can download your &lt;strong&gt;&lt;font color="#008000"&gt;FREE&lt;/font&gt;&lt;/strong&gt; copy&#xD;
of CodeRush Xpress for Visual Studio 2008 from &lt;a title="http://devexpress.com/crx" href="http://devexpress.com/crx"&gt;http://devexpress.com/crx&lt;/a&gt;.&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://diditwith.net/aggbug.ashx?id=adf10d38-3d3e-4341-ad41-11618d5d622b"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=3fHZMff0D4w:DibI5k8q2gI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=3fHZMff0D4w:DibI5k8q2gI:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=3fHZMff0D4w:DibI5k8q2gI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=3fHZMff0D4w:DibI5k8q2gI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=3fHZMff0D4w:DibI5k8q2gI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=3fHZMff0D4w:DibI5k8q2gI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=3fHZMff0D4w:DibI5k8q2gI:cGdyc7Q-1BI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cGdyc7Q-1BI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=3fHZMff0D4w:DibI5k8q2gI:7qCK26UlVX8"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=7qCK26UlVX8" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=3fHZMff0D4w:DibI5k8q2gI:cTv1dNCI_Tc"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cTv1dNCI_Tc" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DidItWithDotNet/~4/3fHZMff0D4w" height="1" width="1"/&gt;</description>
      <comments>http://diditwith.net/CommentView,guid,adf10d38-3d3e-4341-ad41-11618d5d622b.aspx</comments>
    <feedburner:origLink>http://diditwith.net/2009/05/15/CodeRushXpressForCAndVBIsLive.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://diditwith.net/Trackback.aspx?guid=aaca9fbb-5908-4b66-a6f7-6c7b99856c50</trackback:ping>
      <pingback:server>http://diditwith.net/pingback.aspx</pingback:server>
      <pingback:target>http://diditwith.net/PermaLink,guid,aaca9fbb-5908-4b66-a6f7-6c7b99856c50.aspx</pingback:target>
      <dc:creator>Dustin Campbell</dc:creator>
      <wfw:comment>http://diditwith.net/CommentView,guid,aaca9fbb-5908-4b66-a6f7-6c7b99856c50.aspx</wfw:comment>
      <wfw:commentRss>http://diditwith.net/SyndicationService.asmx/GetEntryCommentsRss?guid=aaca9fbb-5908-4b66-a6f7-6c7b99856c50</wfw:commentRss>
      <slash:comments>4</slash:comments>
      
      <title>YAPES: Problem Ten</title>
      <guid isPermaLink="false">http://diditwith.net/PermaLink,guid,aaca9fbb-5908-4b66-a6f7-6c7b99856c50.aspx</guid>
      <link>http://feedproxy.google.com/~r/DidItWithDotNet/~3/VXxiXJlAFjY/YAPESProblemTen.aspx</link>
      <pubDate>Tue, 17 Mar 2009 10:13:48 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
I’m back again with another post in my &lt;a href="http://diditwith.net/CategoryView,category,Project%2BEuler.aspx"&gt;Yet&#xD;
Another Project Euler Series&lt;/a&gt;. As a reminder, my approach to these problems is&#xD;
to try to find the most beautiful solution that I can using F#. While performance&#xD;
is an important, I’m looking for the most elegant solutions that I can find.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://projecteuler.net/"&gt;Project Euler&lt;/a&gt;&#xD;
          &lt;a href="http://projecteuler.net/index.php?section=problems&amp;amp;id=10"&gt;problem&#xD;
ten&lt;/a&gt; is another dealing prime numbers.&#xD;
&lt;/p&gt;&#xD;
        &lt;blockquote&gt;&#xD;
          &lt;div&gt;The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.&#xD;
&lt;/div&gt;&#xD;
          &lt;br&gt;&#xD;
          &lt;div&gt;Find the sum of all the primes below two million.&#xD;
&lt;/div&gt;&#xD;
        &lt;/blockquote&gt;&#xD;
        &lt;p&gt;&#xD;
As you can guess, there’s not too much to this problem. In fact, we’ll declare just&#xD;
one simple supporting function.&#xD;
&lt;/p&gt;&#xD;
        &lt;div style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; padding-bottom: 4px; background-color: rgb(255,255,255); margin: 4px; padding-left: 4px; padding-right: 4px; font-family: consolas,'Courier New',courier,monospace; color: rgb(0,0,0); font-size: small; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted; padding-top: 4px"&gt;&#xD;
          &lt;span style="color: blue"&gt;let&lt;/span&gt; lessThan&#xD;
y x = x &amp;lt; y &#xD;
&lt;/div&gt;&#xD;
        &lt;p&gt;&#xD;
Using the above function and our existing prime number generator, our solution is&#xD;
short and simple.&#xD;
&lt;/p&gt;&#xD;
        &lt;div style="border-bottom: rgb(221,221,221) 1px dotted; border-left: rgb(221,221,221) 1px dotted; padding-bottom: 4px; background-color: rgb(255,255,255); margin: 4px; padding-left: 4px; padding-right: 4px; font-family: consolas,'Courier New',courier,monospace; color: rgb(0,0,0); font-size: small; border-top: rgb(221,221,221) 1px dotted; border-right: rgb(221,221,221) 1px dotted; padding-top: 4px"&gt;primes&lt;br&gt;&#xD;
  |&amp;gt; Seq.take_while (lessThan 2000000L)&lt;br&gt;&#xD;
  |&amp;gt; Seq.sum&#xD;
&lt;/div&gt;&#xD;
        &lt;p&gt;&#xD;
I feel a little guilty that this post is so short, but that’s the benefit of spending &lt;a href="http://diditwith.net/2008/09/17/YAPESProblemSevenPart1.aspx"&gt;two&lt;/a&gt;&lt;a href="http://diditwith.net/2009/01/20/YAPESProblemSevenPart2.aspx"&gt;whole&lt;/a&gt; blog&#xD;
posts working out a prime number generator for &lt;a href="http://projecteuler.net/index.php?section=problems&amp;amp;id=7"&gt;problem&#xD;
seven&lt;/a&gt;.&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://diditwith.net/aggbug.ashx?id=aaca9fbb-5908-4b66-a6f7-6c7b99856c50"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=VXxiXJlAFjY:UE1a5xhHEWQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=VXxiXJlAFjY:UE1a5xhHEWQ:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=VXxiXJlAFjY:UE1a5xhHEWQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=VXxiXJlAFjY:UE1a5xhHEWQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=VXxiXJlAFjY:UE1a5xhHEWQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?i=VXxiXJlAFjY:UE1a5xhHEWQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=VXxiXJlAFjY:UE1a5xhHEWQ:cGdyc7Q-1BI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cGdyc7Q-1BI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=VXxiXJlAFjY:UE1a5xhHEWQ:7qCK26UlVX8"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=7qCK26UlVX8" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DidItWithDotNet?a=VXxiXJlAFjY:UE1a5xhHEWQ:cTv1dNCI_Tc"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DidItWithDotNet?d=cTv1dNCI_Tc" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DidItWithDotNet/~4/VXxiXJlAFjY" height="1" width="1"/&gt;</description>
      <comments>http://diditwith.net/CommentView,guid,aaca9fbb-5908-4b66-a6f7-6c7b99856c50.aspx</comments>
      <category>F#</category>
      <category>Functional Programming</category>
      <category>Project Euler</category>
    <feedburner:origLink>http://diditwith.net/2009/03/17/YAPESProblemTen.aspx</feedburner:origLink></item>
  </channel>
</rss>
