<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://devlicio.us/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Scott Seely</title><link>http://devlicio.us/blogs/scott_seely/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>I’m such a friggin idiot—Day of Mobile has that Jay Freeman!</title><link>http://devlicio.us/blogs/scott_seely/archive/2010/02/26/i-m-such-a-friggin-idiot-day-of-mobile-has-that-jay-freeman.aspx</link><pubDate>Sat, 27 Feb 2010 01:17:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:55568</guid><dc:creator>Scott Seely</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/scott_seely/rsscomments.aspx?PostID=55568</wfw:commentRss><comments>http://devlicio.us/blogs/scott_seely/archive/2010/02/26/i-m-such-a-friggin-idiot-day-of-mobile-has-that-jay-freeman.aspx#comments</comments><description>&lt;p&gt;I&amp;rsquo;m hosting a conference in Chicago called &lt;a href="http://www.dayofmobile.com"&gt;Day of Mobile&lt;/a&gt;. At the end of the day, we are having a big time keynote from &lt;a href="http://www.saurik.com/"&gt;Jay Freeman&lt;/a&gt;. These days, he&amp;rsquo;s a rock star in the iPhone universe. For some reason, and I&amp;rsquo;m a complete moron for not realizing this until a few minutes ago, he is the same guy who brought the .NET world this little tool: &lt;a href="http://legacy.saurik.com/net/exemplar/"&gt;Anakrino&lt;/a&gt;. If you are scratching your head and wondering why that would impress me, it&amp;rsquo;s because I&amp;rsquo;m getting older and I&amp;rsquo;ve used every .NET tool in the world. Anakrino was a mainstay at Microsoft to decompile .NET assemblies to read in C# and VB.NET. It was easier to use than grabbing the source code. &lt;span style="text-decoration:line-through;"&gt;Eventually, the tool found a home at RedGate and is now called .NET Reflector.&lt;/span&gt; &lt;em&gt;[edit: Apparently,&amp;nbsp;my memory is poor at times too. As a commenter so kindly pointed out, Lutz Roeder wrote Reflector, at one time a competitor of Anakrino.]&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;So, in the last few minutes, I&amp;rsquo;ve gone from realizing that we had a really awesome iPhone ninja speaking at the conference to realizing that we had one of those legendary brainiac developers at the conference. And, while I didn&amp;rsquo;t want to pimp the conference at devlicio.us, I now feel I should because he&amp;rsquo;s such a part of all of our everyday lives as .NET developers. I mean, the guy who single handedly wrote Anakrino&lt;span style="text-decoration:line-through;"&gt;/.NET Reflector&lt;/span&gt;. Holy friggin&amp;rsquo; crap! &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=55568" width="1" height="1"&gt;</description></item><item><title>Visual Studio 2010 Beta--&gt;RC install and ASP.NET</title><link>http://devlicio.us/blogs/scott_seely/archive/2010/02/10/visual-studio-2010-beta-gt-rc-install-and-asp-net.aspx</link><pubDate>Wed, 10 Feb 2010 14:31:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:55336</guid><dc:creator>Scott Seely</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/scott_seely/rsscomments.aspx?PostID=55336</wfw:commentRss><comments>http://devlicio.us/blogs/scott_seely/archive/2010/02/10/visual-studio-2010-beta-gt-rc-install-and-asp-net.aspx#comments</comments><description>&lt;p&gt;I installed the VS 2010 RC last night, after uninstalling the VS 2010 Beta. If you see that ASP.NET isn&amp;rsquo;t coming up/working on your machine, you may need to remap the ASP.NET handlers into IIS. To do that, go to the Microsoft.NET 4.0 folder on your machine (typically C:\Windows\Microsoft.NET\Framework64\v4.0.30128 on a 64-bit Windows install, C:\Windows\Microsoft.NET\Framework\v4.0.30128 on a 32-bit install). Once in that folder, run the following:&lt;/p&gt;
&lt;p&gt;aspnet_regiis.exe&amp;nbsp;&amp;ndash;i&lt;/p&gt;
&lt;p&gt;After doing this, your ASP.NET applications should start running again. This is the same trick that worked on earlier versions of .NET, but it&amp;rsquo;s been a while since we had a .NET upgrade. I thought this might help out a few of you out there. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=55336" width="1" height="1"&gt;</description></item><item><title>DataContract, Partial Types and Generated Code</title><link>http://devlicio.us/blogs/scott_seely/archive/2010/02/09/datacontract-partial-types-and-generated-code.aspx</link><pubDate>Tue, 09 Feb 2010 19:31:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:55328</guid><dc:creator>Scott Seely</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/scott_seely/rsscomments.aspx?PostID=55328</wfw:commentRss><comments>http://devlicio.us/blogs/scott_seely/archive/2010/02/09/datacontract-partial-types-and-generated-code.aspx#comments</comments><description>&lt;p&gt;The other day, a friend had an issue with a &lt;strong&gt;DataContract&lt;/strong&gt;. He had an Entity Model that used &lt;strong&gt;DataContract&lt;/strong&gt; serialization. The code, stripped down to its essence, had something like this:&lt;/p&gt;
&lt;pre class="code"&gt;[DataContract]
&lt;span style="color:blue;"&gt;public partial class &lt;/span&gt;SomeClass
{
    [DataMember]
    &lt;span style="color:blue;"&gt;public int &lt;/span&gt;MyInt { &lt;span style="color:blue;"&gt;get&lt;/span&gt;; &lt;span style="color:blue;"&gt;set&lt;/span&gt;; }
}
&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And this was all well and good. When transmitting &lt;strong&gt;SomeClass&lt;/strong&gt; over the wire, the fields on the entity model were transmitted. Now, my friend is really smart, and he knew that his version of serialization had implicit serialization. So, when adding new fields, he relied on implicit field serialization by augmenting &lt;strong&gt;SomeClass&lt;/strong&gt; in a separate file as:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;public partial class &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;SomeClass
&lt;/span&gt;{
    &lt;span style="color:blue;"&gt;public string &lt;/span&gt;MyString { &lt;span style="color:blue;"&gt;get&lt;/span&gt;; &lt;span style="color:blue;"&gt;set&lt;/span&gt;; }
}
&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Lo and behold, the field MyString didn&amp;rsquo;t appear on the wire. Why was this? This is because partial classes are a compiler trick that hides itself at the assembly level. The assembly indicated that SomeClass is a type that has the following C# implementation:&lt;/p&gt;
&lt;pre class="code"&gt;[&lt;span style="color:#2b91af;"&gt;DataContract&lt;/span&gt;]
&lt;span style="color:blue;"&gt;public partial class &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;SomeClass
&lt;/span&gt;{
    [&lt;span style="color:#2b91af;"&gt;DataMember&lt;/span&gt;]
    &lt;span style="color:blue;"&gt;public int &lt;/span&gt;MyInt { &lt;span style="color:blue;"&gt;get&lt;/span&gt;; &lt;span style="color:blue;"&gt;set&lt;/span&gt;; }

    &lt;span style="color:blue;"&gt;public string &lt;/span&gt;MyString { &lt;span style="color:blue;"&gt;get&lt;/span&gt;; &lt;span style="color:blue;"&gt;set&lt;/span&gt;; }
}
&lt;/pre&gt;
&lt;pre class="code"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;p&gt;This shows that &lt;strong&gt;MyString &lt;/strong&gt;is not part of the data contract, so the field doesn&amp;rsquo;t get serialized. At the assembly level, no one knows that you separated the implementation across two files. &lt;/p&gt;
&lt;p&gt;So, next time you are wondering why part of your object isn&amp;rsquo;t being serialized, see if you made any declarations about serialization on the type. If you did, you have turned off the automatic &amp;ldquo;magic&amp;rdquo; parts of serialization. Sometimes, wizards will make those decisions for you. One way to recognize that the work was done for you: look to see if the generated type has &lt;strong&gt;[DataContract]&lt;/strong&gt; on the partial class you are augmenting.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=55328" width="1" height="1"&gt;</description></item><item><title>Incorporating Video into a Silverlight 4 Application</title><link>http://devlicio.us/blogs/scott_seely/archive/2010/01/25/incorporating-video-into-a-silverlight-4-application.aspx</link><pubDate>Mon, 25 Jan 2010 12:00:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:55124</guid><dc:creator>Scott Seely</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/scott_seely/rsscomments.aspx?PostID=55124</wfw:commentRss><comments>http://devlicio.us/blogs/scott_seely/archive/2010/01/25/incorporating-video-into-a-silverlight-4-application.aspx#comments</comments><description>&lt;p&gt;



&lt;/p&gt;
&lt;p&gt;Over the past week, I spent some time with Silverlight 4. I&amp;rsquo;m really impressed by how easy it is to incorporate video into an application. This post shows how to capture video from the camera and display the video on the screen. The post also handles grabbing single frames of video. You might use this type of arrangement to allow users to upload images, hold impromptu web casts, and to do video conferencing.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve uploaded a barebones application that turns on video capture and displays the video (viewable &lt;a href="http://www.scottseely.com/blog/10-01-24/Incorporating_Video_into_a_Silverlight_4_Application.aspx"&gt;here&lt;/a&gt;) &lt;/p&gt;
&lt;p&gt;To understand how this works, you need to be familiar with the following objects:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CaptureSource&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CaptureDeviceConfiguration&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;VideoBrush&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The &lt;b&gt;CaptureSource&lt;/b&gt; type encapsulates the methods needed to interact with audio and video devices. &lt;/p&gt;
&lt;p&gt;&lt;b&gt;CaptureDeviceConfiguration&lt;/b&gt; acts as gatekeeper to the webcam and microphone. &lt;b&gt;CaptureDeviceConfiguration&lt;/b&gt; knows how to ask the user for permission to use the webcam or microphone. It also remembers what the user said about using the webcam or microphone during the current session. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;VideoBrush &lt;/strong&gt;knows how to paint using a video as the source.&lt;/p&gt;
&lt;p&gt;In order to interact with the camera, you need to know whether the user gave you permission and if not, you have to ask for permission. Once you have permission, you just need to capture video from the default camera, create the brush, and start capturing the video. &lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;private &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;CaptureSource &lt;/span&gt;_captureSource = &lt;span style="color:blue;"&gt;null&lt;/span&gt;;
&lt;span style="color:blue;"&gt;private void &lt;/span&gt;btnStartCapture_Click(&lt;span style="color:blue;"&gt;object &lt;/span&gt;sender, &lt;span style="color:#2b91af;"&gt;RoutedEventArgs &lt;/span&gt;e)
{
    &lt;span style="color:blue;"&gt;if &lt;/span&gt;(_captureSource != &lt;span style="color:blue;"&gt;null &lt;/span&gt;&amp;amp;&amp;amp; &lt;/pre&gt;
&lt;pre class="code"&gt;        _captureSource.State == &lt;span style="color:#2b91af;"&gt;CaptureState&lt;/span&gt;.Started)
    {
        &lt;span style="color:blue;"&gt;return&lt;/span&gt;;
    }
    &lt;span style="color:blue;"&gt;if&lt;/span&gt;(!&lt;span style="color:#2b91af;"&gt;CaptureDeviceConfiguration&lt;/span&gt;.AllowedDeviceAccess)
    {
        &lt;span style="color:blue;"&gt;if&lt;/span&gt;(!&lt;span style="color:#2b91af;"&gt;CaptureDeviceConfiguration&lt;/span&gt;.RequestDeviceAccess())
        {
            &lt;span style="color:blue;"&gt;return&lt;/span&gt;;
        }
    }

    _captureSource = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;CaptureSource
       &lt;/span&gt;{
         VideoCaptureDevice = &lt;/pre&gt;
&lt;pre class="code"&gt;           &lt;span style="color:#2b91af;"&gt;CaptureDeviceConfiguration&lt;/span&gt;.GetDefaultVideoCaptureDevice()
       };
    &lt;span style="color:blue;"&gt;var &lt;/span&gt;brush = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;VideoBrush&lt;/span&gt;();
    brush.SetSource(_captureSource);
    _captureSource.Start();
    rectVideo.Fill = brush;
}&lt;/pre&gt;
&lt;p&gt;Later on, when the user wants to capture the current video as an image, you just do something like this to put the current frame into an image control:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;private void &lt;/span&gt;btnGrabImage_Click(&lt;span style="color:blue;"&gt;object &lt;/span&gt;sender, &lt;span style="color:#2b91af;"&gt;RoutedEventArgs &lt;/span&gt;e)
{
    &lt;span style="color:blue;"&gt;if&lt;/span&gt;(_captureSource == &lt;span style="color:blue;"&gt;null &lt;/span&gt;|| _captureSource.State != &lt;span style="color:#2b91af;"&gt;CaptureState&lt;/span&gt;.Started)
    {
        &lt;span style="color:blue;"&gt;return&lt;/span&gt;;
    }
    _captureSource.AsyncCaptureImage(
        image =&amp;gt; imgCapture.Source = image
        );
}&lt;/pre&gt;
&lt;p&gt;As someone who spent way too much time in the C++/MFC era writing code to capture video from devices, I am incredibly impressed with the brevity of the code. I think the SL4 team did an awesome job here. Way to go! &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can grab the sample project &lt;a href="http://www.scottseely.com/downloads/WebCam/DimeCast.WebCam.zip"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=55124" width="1" height="1"&gt;</description></item><item><title>The Sieve of Eratosthenes and F#</title><link>http://devlicio.us/blogs/scott_seely/archive/2009/12/18/the-sieve-of-eratosthenes-and-f.aspx</link><pubDate>Sat, 19 Dec 2009 03:42:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:54649</guid><dc:creator>Scott Seely</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/scott_seely/rsscomments.aspx?PostID=54649</wfw:commentRss><comments>http://devlicio.us/blogs/scott_seely/archive/2009/12/18/the-sieve-of-eratosthenes-and-f.aspx#comments</comments><description>&lt;p&gt;There is a problem on the Euler project, &lt;a href="http://www.projecteuler.net"&gt;www.projecteuler.net&lt;/a&gt;, which asks to find the sum of all values under a given number. Problems on the Euler project have a range of solutions, where at least one solution has a runtime of under 1 minute. A popular, time efficient algorithm that finds all primes in a given range is the &lt;a href="http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes" target="_blank"&gt;Sieve of Eratosthenes&lt;/a&gt;. The basic algorithm is:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Create an array that contains all values from 2 up to the final maximum value &lt;/li&gt;    &lt;li&gt;Starting at 2, For each value in the array, mark all items that have indices of the current value that are multiples and NOT equivalent to the current index as 0 (eg. index mod [current value] == 0). &lt;/li&gt;    &lt;li&gt;March forward until you hit a non-zero value in the array, then mark all multiples as 0. &lt;/li&gt;    &lt;li&gt;Halt condition: stop when you cross the midpoint of the array (anything remaining that is non-zero is a prime since you already all multiples of 2). &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;In practice, this gives successive iterations of an array from 2 .. 10 as:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;[2, 3, 4, 5, 6, 7, 8, 9, 10] &lt;/li&gt;    &lt;li&gt;[2, 3, 0, 5, 0, 7, 0, 9, 0] &lt;/li&gt;    &lt;li&gt;[2, 3, 0, 5, 0, 7, 0, 0, 0] &lt;/li&gt;    &lt;li&gt;At this point, we reach 5, which is greater than the length of the array (9) divided by 2 (4.5). Any non-zero values in the array are prime. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;In C#, one possible implementation is:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;private static long &lt;/span&gt;SieveOfErastosthenes(&lt;span style="color:blue;"&gt;long &lt;/span&gt;maxvalue)
{
    &lt;span style="color:blue;"&gt;long&lt;/span&gt;[] values = &lt;span style="color:blue;"&gt;new long&lt;/span&gt;[maxvalue];
    &lt;span style="color:green;"&gt;// Populate the list
    &lt;/span&gt;&lt;span style="color:blue;"&gt;for &lt;/span&gt;(&lt;span style="color:blue;"&gt;long &lt;/span&gt;i = &lt;span style="color:brown;"&gt;0&lt;/span&gt;; i &amp;lt; values.LongLength; ++i)
    {
        values[i] = i;
    }
    values[&lt;span style="color:brown;"&gt;0&lt;/span&gt;] = &lt;span style="color:brown;"&gt;0&lt;/span&gt;;
    values[&lt;span style="color:brown;"&gt;1&lt;/span&gt;] = &lt;span style="color:brown;"&gt;0&lt;/span&gt;;
    &lt;span style="color:blue;"&gt;for &lt;/span&gt;(&lt;span style="color:blue;"&gt;long &lt;/span&gt;i = &lt;span style="color:brown;"&gt;2&lt;/span&gt;; i &amp;lt; values.LongLength; ++i)
    {
        &lt;span style="color:blue;"&gt;if &lt;/span&gt;(values[i] != &lt;span style="color:brown;"&gt;0&lt;/span&gt;)
        {
            &lt;span style="color:blue;"&gt;for &lt;/span&gt;(&lt;span style="color:blue;"&gt;long &lt;/span&gt;j = i * &lt;span style="color:brown;"&gt;2&lt;/span&gt;; j &amp;lt; values.LongLength; j += i)
            {
                values[j] = &lt;span style="color:brown;"&gt;0&lt;/span&gt;;
            }
        }
    }

    &lt;span style="color:blue;"&gt;long &lt;/span&gt;retval = &lt;span style="color:brown;"&gt;0&lt;/span&gt;;
    &lt;span style="color:blue;"&gt;foreach &lt;/span&gt;(&lt;span style="color:blue;"&gt;long &lt;/span&gt;k &lt;span style="color:blue;"&gt;in &lt;/span&gt;values)
    {
        retval += k;
    }
    &lt;span style="color:blue;"&gt;return &lt;/span&gt;retval;
}&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;Overall computational complexity is O(n). If you aren’t familiar with big O notation, the overall complexity is bound by the size of the dataset times a constant—in this case 3, since we iterate through the complete dataset 3 times:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Populate the dataset &lt;/li&gt;

  &lt;li&gt;Mark all non primes as 0 &lt;/li&gt;

  &lt;li&gt;Sum the primes &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And yes, this works quite well, even for large values of n. My challenge was to get the sieve to work with performance equal to C#, only in F#. At the start of this, I had my first pass of the C# code running in ~600 ms for a value of 5 million. The challenge I set for myself was to achieve a similar timing in F#. The first few passes left me with runtimes of over 15 minutes (I killed the runs prior to completion). The reason why was simple: I wrote an O(n^3) algorithm. My challenge was to get this faster without using mutable values. My first pass looked like this:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;let rec &lt;/span&gt;sieveofErastosthenes values filterout maxval =
    &lt;span style="color:blue;"&gt;if &lt;/span&gt;(filterout &amp;gt;= (maxval/&lt;span style="color:brown;"&gt;2&lt;/span&gt;)) &lt;span style="color:blue;"&gt;then
        &lt;/span&gt;values
    &lt;span style="color:blue;"&gt;else
        let &lt;/span&gt;shouldFilter =
            &lt;span style="color:blue;"&gt;try
                let &lt;/span&gt;a = values |&amp;gt; List.find(&lt;span style="color:blue;"&gt;fun &lt;/span&gt;x &lt;span style="color:blue;"&gt;-&amp;gt; &lt;/span&gt;x = filterout)
                a &amp;lt;&amp;gt; &lt;span style="color:brown;"&gt;0
            &lt;/span&gt;&lt;span style="color:blue;"&gt;with
            &lt;/span&gt;| _ &lt;span style="color:blue;"&gt;as &lt;/span&gt;ex &lt;span style="color:blue;"&gt;-&amp;gt; false
        if &lt;/span&gt;(shouldFilter) &lt;span style="color:blue;"&gt;then
            &lt;/span&gt;sieveofErastosthenes (values 
                |&amp;gt; List.filter(&lt;span style="color:blue;"&gt;fun &lt;/span&gt;x &lt;span style="color:blue;"&gt;-&amp;gt; &lt;/span&gt;(x = filterout) || ((x % filterout) &amp;lt;&amp;gt; &lt;span style="color:brown;"&gt;0&lt;/span&gt;))) (filterout + &lt;span style="color:brown;"&gt;1&lt;/span&gt;) maxval
        &lt;span style="color:blue;"&gt;else
            &lt;/span&gt;sieveofErastosthenes values (values |&amp;gt; List.find(&lt;span style="color:blue;"&gt;fun &lt;/span&gt;x &lt;span style="color:blue;"&gt;-&amp;gt; &lt;/span&gt;x &amp;gt; filterout)) maxval

&lt;span style="color:blue;"&gt;let &lt;/span&gt;max = &lt;span style="color:brown;"&gt;5000000
&lt;/span&gt;&lt;span style="color:blue;"&gt;let &lt;/span&gt;sumofprimes =  sieveofErastosthenes [&lt;span style="color:brown;"&gt;2 &lt;/span&gt;.. max] &lt;span style="color:brown;"&gt;2 &lt;/span&gt;max |&amp;gt; List.map( &lt;span style="color:blue;"&gt;fun &lt;/span&gt;x &lt;span style="color:blue;"&gt;-&amp;gt; &lt;/span&gt;int64 x) |&amp;gt; List.sum&lt;/pre&gt;

&lt;p&gt;This code is correct—pass in 10 for the max and the value returned is 17. But the answer just never returned for larger values within reasonable time. Next, I tried using a mutable type: System.Collections.Generic.List&amp;lt;T&amp;gt;. This got the time down to a measureable 4s. That’s still 6.5x longer than the C# version. That next attempt looks like this:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;let &lt;/span&gt;sieveOfEratosthenes x =
    &lt;span style="color:blue;"&gt;let &lt;/span&gt;retval = &lt;span style="color:blue;"&gt;new &lt;/span&gt;List&amp;lt;int32&amp;gt;()
    retval.AddRange([&lt;span style="color:brown;"&gt;0 &lt;/span&gt;.. x])
    retval.Item(&lt;span style="color:brown;"&gt;0&lt;/span&gt;) &amp;lt;- &lt;span style="color:brown;"&gt;0
    &lt;/span&gt;retval.Item(&lt;span style="color:brown;"&gt;1&lt;/span&gt;) &amp;lt;- &lt;span style="color:brown;"&gt;0
    &lt;/span&gt;&lt;span style="color:blue;"&gt;for &lt;/span&gt;i &lt;span style="color:blue;"&gt;in &lt;/span&gt;&lt;span style="color:brown;"&gt;2 &lt;/span&gt;.. x &lt;span style="color:blue;"&gt;do
        if &lt;/span&gt;retval.Item(i) &amp;lt;&amp;gt; &lt;span style="color:brown;"&gt;0 &lt;/span&gt;&lt;span style="color:blue;"&gt;then
            for &lt;/span&gt;j &lt;span style="color:blue;"&gt;in &lt;/span&gt;&lt;span style="color:brown;"&gt;2 &lt;/span&gt;* i .. i .. x &lt;span style="color:blue;"&gt;do
                &lt;/span&gt;retval.Item(j) &amp;lt;- &lt;span style="color:brown;"&gt;0
    &lt;/span&gt;retval.ToArray()

&lt;span style="color:blue;"&gt;let &lt;/span&gt;max = &lt;span style="color:brown;"&gt;5000000
&lt;/span&gt;&lt;span style="color:blue;"&gt;let &lt;/span&gt;sumofprimes =  sieveOfEratosthenes max |&amp;gt; Seq.map( &lt;span style="color:blue;"&gt;fun &lt;/span&gt;x &lt;span style="color:blue;"&gt;-&amp;gt; &lt;/span&gt;int64 x) |&amp;gt; Seq.sum
printfn &lt;span style="color:maroon;"&gt;&amp;quot;%A\n&amp;quot; &lt;/span&gt;sumofprimes&lt;/pre&gt;

&lt;p&gt;Notice that this latest iteration executes a lot less code and, frankly, looks pretty close to the C# code. Through some investigation, I found that the call to preload the array consumed 2.6 s. I then switched to a sequence and shrank the execution time to 2300 ms. I was closing in on my goal and learning some stuff about the performance of various F# constructs. Loading using a sequence changed the AddRange call to this:&lt;/p&gt;

&lt;pre class="code"&gt;retval.AddRange([|&lt;span style="color:brown;"&gt;0 &lt;/span&gt;.. x|])&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The reason this takes less time is simple. When allocating a List, F# allocates and initializes all values up front. The Seq is created with an iterator and only allocates enough space to store the iterator and not much else. So far, so good. At this point, I did a search on F# implementations of the Sieve of Eratosthenes and found that &lt;a href="http://blogs.msdn.com/chrsmith/archive/2008/04/29/sieve-of-eratosthenes-in-f.aspx" target="_blank"&gt;Chris Smith had one&lt;/a&gt;. His implementation keeps track of which numbers AREN’T prime. Performance on his algorithm hits 8600 ms. That wound up being a step in the wrong direction.&lt;/p&gt;

&lt;p&gt;Next, I tried, explicitly initializing the list of integers and cut the time down to 1450 ms. The strategy was getting me closer to optimal timing and showed that, for 5 million int32s, I was filling in the list in 46 ms. &lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;let &lt;/span&gt;sieveOfEratosthenes x =
    &lt;span style="color:blue;"&gt;let &lt;/span&gt;retval = &lt;span style="color:blue;"&gt;new &lt;/span&gt;List&amp;lt;int32&amp;gt;(x + &lt;span style="color:brown;"&gt;1&lt;/span&gt;)
    &lt;span style="color:blue;"&gt;for &lt;/span&gt;i &lt;span style="color:blue;"&gt;in &lt;/span&gt;&lt;span style="color:brown;"&gt;0 &lt;/span&gt;.. x &lt;span style="color:blue;"&gt;do &lt;/span&gt;retval.Add(i)

    retval.Item(&lt;span style="color:brown;"&gt;0&lt;/span&gt;) &amp;lt;- &lt;span style="color:brown;"&gt;0
    &lt;/span&gt;retval.Item(&lt;span style="color:brown;"&gt;1&lt;/span&gt;) &amp;lt;- &lt;span style="color:brown;"&gt;0
    &lt;/span&gt;&lt;span style="color:blue;"&gt;for &lt;/span&gt;i &lt;span style="color:blue;"&gt;in &lt;/span&gt;&lt;span style="color:brown;"&gt;2 &lt;/span&gt;.. x &lt;span style="color:blue;"&gt;do
        if &lt;/span&gt;retval.Item(i) &amp;lt;&amp;gt; &lt;span style="color:brown;"&gt;0 &lt;/span&gt;&lt;span style="color:blue;"&gt;then
            for &lt;/span&gt;j &lt;span style="color:blue;"&gt;in &lt;/span&gt;&lt;span style="color:brown;"&gt;2 &lt;/span&gt;* i .. i .. x &lt;span style="color:blue;"&gt;do
                &lt;/span&gt;retval.Item(j) &amp;lt;- &lt;span style="color:brown;"&gt;0
    &lt;/span&gt;retval |&amp;gt; Seq.filter(&lt;span style="color:blue;"&gt;fun &lt;/span&gt;x &lt;span style="color:blue;"&gt;-&amp;gt; &lt;/span&gt;x &amp;lt;&amp;gt; &lt;span style="color:brown;"&gt;0&lt;/span&gt;)&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This was better, but I’d like to get closer to the C# version. The last thing I tried was moving to Array from System.Collections.Generic.List. This last change cut 250 ms, bringing my times down to 1200 ms. It looks like using lighter weight objects really will speed things up! That version is:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;let &lt;/span&gt;sieveOfEratosthenes x =
    &lt;span style="color:blue;"&gt;let &lt;/span&gt;retval = Array.zeroCreate(x + &lt;span style="color:brown;"&gt;1&lt;/span&gt;)
    &lt;span style="color:blue;"&gt;for &lt;/span&gt;i &lt;span style="color:blue;"&gt;in &lt;/span&gt;&lt;span style="color:brown;"&gt;0 &lt;/span&gt;.. x &lt;span style="color:blue;"&gt;do &lt;/span&gt;retval.[i] &amp;lt;- i
    retval.[&lt;span style="color:brown;"&gt;0&lt;/span&gt;] &amp;lt;- &lt;span style="color:brown;"&gt;0
    &lt;/span&gt;retval.[&lt;span style="color:brown;"&gt;1&lt;/span&gt;] &amp;lt;- &lt;span style="color:brown;"&gt;0
    &lt;/span&gt;&lt;span style="color:blue;"&gt;for &lt;/span&gt;i &lt;span style="color:blue;"&gt;in &lt;/span&gt;&lt;span style="color:brown;"&gt;2 &lt;/span&gt;.. x &lt;span style="color:blue;"&gt;do
        if &lt;/span&gt;(i % &lt;span style="color:brown;"&gt;2 &lt;/span&gt;&amp;lt;&amp;gt; &lt;span style="color:brown;"&gt;0&lt;/span&gt;) &amp;amp;&amp;amp; retval.[i] &amp;lt;&amp;gt; &lt;span style="color:brown;"&gt;0 &lt;/span&gt;&lt;span style="color:blue;"&gt;then
            for &lt;/span&gt;j &lt;span style="color:blue;"&gt;in &lt;/span&gt;&lt;span style="color:brown;"&gt;2 &lt;/span&gt;* i .. i .. x &lt;span style="color:blue;"&gt;do
                &lt;/span&gt;retval.[j] &amp;lt;- &lt;span style="color:brown;"&gt;0

    &lt;/span&gt;retval |&amp;gt; Seq.filter(&lt;span style="color:blue;"&gt;fun &lt;/span&gt;x &lt;span style="color:blue;"&gt;-&amp;gt; &lt;/span&gt;x &amp;lt;&amp;gt; &lt;span style="color:brown;"&gt;0&lt;/span&gt;)

&lt;span style="color:blue;"&gt;let &lt;/span&gt;max = &lt;span style="color:brown;"&gt;5000000
&lt;/span&gt;&lt;span style="color:blue;"&gt;let &lt;/span&gt;sumofprimes =  sieveOfEratosthenes max |&amp;gt; Seq.map( &lt;span style="color:blue;"&gt;fun &lt;/span&gt;x &lt;span style="color:blue;"&gt;-&amp;gt; &lt;/span&gt;int64 x) |&amp;gt; Seq.sum&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=54649" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/F_2300_/default.aspx">F#</category><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/.NET/default.aspx">.NET</category><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/VS+2010/default.aspx">VS 2010</category></item><item><title>Greatest Prime Factor in F#</title><link>http://devlicio.us/blogs/scott_seely/archive/2009/12/16/greatest-prime-factor-in-f.aspx</link><pubDate>Thu, 17 Dec 2009 00:00:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:54579</guid><dc:creator>Scott Seely</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/scott_seely/rsscomments.aspx?PostID=54579</wfw:commentRss><comments>http://devlicio.us/blogs/scott_seely/archive/2009/12/16/greatest-prime-factor-in-f.aspx#comments</comments><description>&lt;p&gt;Today I was reading an article in The Onion, &lt;a target="_blank" href="http://www.theonion.com/content/infograph/conquerors_you_may_have"&gt;Conquerors You May Have Missed&lt;/a&gt;,&amp;nbsp; and noticed that the number for the ant looked like it might be a big old prime, or at least have a large prime divisor. (For reference, the ant is # 43,168,974,563,247.) There are a number of algorithms for finding this answer, but my favorite is a little brute force algorithm that keeps dividing the big number by some other value until the two numbers are equal. Yes, I know I can short circuit a bunch of testing via a square root function, but BigInteger doesn&amp;rsquo;t have a sqrt function (yet&amp;hellip;). &lt;/p&gt;
&lt;p&gt;Anyhow, I cobbled this together and it worked right out of the gate:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;let rec &lt;/span&gt;largestFactor x y = 
    &lt;span style="color:blue;"&gt;if &lt;/span&gt;(x = y) &lt;span style="color:blue;"&gt;then &lt;/span&gt;y
    &lt;span style="color:blue;"&gt;else
        let &lt;/span&gt;z = x % y
        &lt;span style="color:blue;"&gt;if &lt;/span&gt;z = &lt;span style="color:brown;"&gt;0I &lt;/span&gt;&lt;span style="color:blue;"&gt;then &lt;/span&gt;largestFactor (x/y) y
        &lt;span style="color:blue;"&gt;else &lt;/span&gt;largestFactor x (y + &lt;span style="color:brown;"&gt;1I&lt;/span&gt;)

&lt;span style="color:blue;"&gt;let &lt;/span&gt;LargestPrime x = largestFactor x &lt;span style="color:brown;"&gt;2I

&lt;/span&gt;&lt;span style="color:blue;"&gt;let &lt;/span&gt;a = LargestPrime &lt;span style="color:brown;"&gt;43168974563247I

&lt;/span&gt;printf &lt;span style="color:maroon;"&gt;&amp;quot;%A&amp;quot; &lt;/span&gt;a&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Answer: 84,826,177&lt;/p&gt;
&lt;p&gt;So, the number isn&amp;rsquo;t prime, but the largest prime factor is pretty big! And, writing up the code to figure out the answer itself was pretty simple. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=54579" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/F_2300_/default.aspx">F#</category><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Slides and Code from Chicago Alt.NET meeting</title><link>http://devlicio.us/blogs/scott_seely/archive/2009/11/12/slides-and-code-from-chicago-alt-net-meeting.aspx</link><pubDate>Thu, 12 Nov 2009 15:00:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53675</guid><dc:creator>Scott Seely</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/scott_seely/rsscomments.aspx?PostID=53675</wfw:commentRss><comments>http://devlicio.us/blogs/scott_seely/archive/2009/11/12/slides-and-code-from-chicago-alt-net-meeting.aspx#comments</comments><description>&lt;p&gt;I want to say thanks to everyone who came out to watch me speak about OpenSocial at the Chicago Alt.NET meeting. Thanks for inviting me to present and for making the time so enjoyable. I’ve posted the slides and the code for the Canvas page &lt;a href="http://www.scottseely.com/downloads/OpenSocialAltNet.zip" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53675" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/OpenSocial/default.aspx">OpenSocial</category><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/JavaScript/default.aspx">JavaScript</category></item><item><title>Speaking at Chicago Alt.Net Meeting</title><link>http://devlicio.us/blogs/scott_seely/archive/2009/11/09/speaking-at-chicago-alt-net-meeting.aspx</link><pubDate>Tue, 10 Nov 2009 02:25:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53599</guid><dc:creator>Scott Seely</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/scott_seely/rsscomments.aspx?PostID=53599</wfw:commentRss><comments>http://devlicio.us/blogs/scott_seely/archive/2009/11/09/speaking-at-chicago-alt-net-meeting.aspx#comments</comments><description>&lt;p&gt;This month, I&amp;rsquo;ll be speaking at the Chicago Alt.Net user group meeting. Please check out the details &lt;a target="_blank" href="http://chicagoalt.net/event/November2009Meeting-BuildingOpenSocialApplications"&gt;here&lt;/a&gt; and register &lt;a target="_blank" href="http://altnetchicago-groupsite.eventbrite.com/"&gt;here&lt;/a&gt;. And, here is the blurb on the talk:&lt;/p&gt;
&lt;h4&gt;November 2009 Meeting&lt;/h4&gt;
&lt;h5&gt;Building OpenSocial Applications&lt;/h5&gt;
&lt;p&gt;6:00 pm &lt;br /&gt;Pizza and networking time &lt;/p&gt;
&lt;p&gt;6:30 pm&lt;/p&gt;
&lt;p&gt;From its &lt;a href="http://www.opensocial.org/"&gt;official web site&lt;/a&gt;: &lt;/p&gt;
&lt;blockquote&gt;&lt;i&gt;Friends are fun, but they&amp;#39;re only on some websites. &lt;b&gt;OpenSocial&lt;/b&gt; helps these sites share their social data with the web. Applications that use the OpenSocial APIs can be embedded within a social network itself, or access a site&amp;#39;s social data from anywhere on the web.&lt;/i&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;img src="http://chicagoalt.net/content/images/events/opensocial.png" align="right" alt="" /&gt; &lt;a href="http://www.opensocial.org/"&gt;OpenSocial&lt;/a&gt; is the platform that &lt;a href="http://myspace.com/"&gt;MySpace&lt;/a&gt;, &lt;a href="http://orkut.com/"&gt;Orkut&lt;/a&gt;, &lt;a href="http://ning.com/"&gt;Ning&lt;/a&gt;, &lt;a href="http://LinkedIn.com/"&gt;LinkedIn&lt;/a&gt;, &lt;a href="http://Hi5.com/"&gt;Hi5&lt;/a&gt;, and pretty much every social network but Facebook supports for creating games and other applications that run on these social network sites. &lt;/p&gt;
&lt;p&gt;In this talk, we focus on the MySpace platform and how one builds a MySpace application. This involves interacting with the OpenSocial JavaScript as well as receiving and sending OpenSocial requests on your own servers. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53599" width="1" height="1"&gt;</description></item><item><title>Iowa Code Camp November 2009 Slides Up</title><link>http://devlicio.us/blogs/scott_seely/archive/2009/11/07/iowa-code-camp-november-2009-slides-up.aspx</link><pubDate>Sun, 08 Nov 2009 00:39:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53499</guid><dc:creator>Scott Seely</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/scott_seely/rsscomments.aspx?PostID=53499</wfw:commentRss><comments>http://devlicio.us/blogs/scott_seely/archive/2009/11/07/iowa-code-camp-november-2009-slides-up.aspx#comments</comments><description>&lt;p&gt;I want to send out a big thank you to the team who put together the &lt;a target="_blank" href="http://iowacodecamp.com/"&gt;Iowa Code Camp&lt;/a&gt;. You people did an awesome job!!! I had a great time giving my talks and really enjoyed hanging out with the crowd in Iowa.&lt;/p&gt;
&lt;p&gt;For those of you who attended my talks, or just want to see the materials, I&amp;rsquo;ve posted things.&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.scottseely.com/downloads/IowaCC.WCF.zip"&gt;WCF Diagnostics Talk and Materials&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.scottseely.com/downloads/IowaCC.WinDBG.zip"&gt;WinDBG Talk and Materials&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;See you next year&amp;hellip;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53499" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/WCF/default.aspx">WCF</category><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/WinDBG/default.aspx">WinDBG</category></item><item><title>Speaking at nPlus1 ArcSummit- Chicago</title><link>http://devlicio.us/blogs/scott_seely/archive/2009/11/02/speaking-at-nplus1-arcsummit-chicago.aspx</link><pubDate>Mon, 02 Nov 2009 13:18:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53317</guid><dc:creator>Scott Seely</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/scott_seely/rsscomments.aspx?PostID=53317</wfw:commentRss><comments>http://devlicio.us/blogs/scott_seely/archive/2009/11/02/speaking-at-nplus1-arcsummit-chicago.aspx#comments</comments><description>&lt;p&gt;On December 7, I&amp;rsquo;ll be speaking at the nPlus1 ArcSummit for the optional morning session. I&amp;rsquo;d love to see the place packed! Here are the details:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.clicktoattend.com/invitation.aspx?code=142763"&gt;https://www.clicktoattend.com/invitation.aspx?code=142763&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;About nPlus1.org&lt;/h3&gt;
&lt;p&gt;nPlus1.org is a site dedicated to helping Architects, aspiring Architects and Lead Developers learn, connect and contribute. On this site you&amp;rsquo;ll have access to great first party content written by some of the most skilled and experienced Architects working today. You&amp;rsquo;ll also have access to, and be able to contribute to a nexus of content from around the Internet aimed at keeping Architects up to date on all the new developments in their fields of interest.&lt;/p&gt;
&lt;h4&gt;When&lt;/h4&gt;
&lt;p&gt;Monday December 7, 2009 &amp;ndash; 10:00PM to 5:00PM&lt;/p&gt;
&lt;h4&gt;Where&lt;/h4&gt;
&lt;p&gt;Microsoft MTC - Aon Center&lt;/p&gt;
&lt;p&gt;200 E. Randolph&lt;/p&gt;
&lt;p&gt;Suite 200&lt;/p&gt;
&lt;p&gt;Chicago, IL 60601&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.clicktoattend.com/directions.aspx?code=142763"&gt;driving directions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Free Lunch Provided&lt;/b&gt;&lt;/p&gt;
&lt;h4&gt;Agenda&lt;/h4&gt;
&lt;h5&gt;Morning Session (Optional): An Introduction to Object Oriented Programming &lt;/h5&gt;
&lt;p&gt;10:00 AM - 12:00 PM&lt;/p&gt;
&lt;p&gt;Are you new to OOP? Do you want a refresher on the benefits of Interfaces and the differences between implements and extends? The morning session is a two hour introductory course of Object Oriented Programming. If you are new to OOP the lessons in this session will prepare you for the more advanced topics in the afternoon.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;If you are already well versed in OOP then feel free to come have a refresher, or simply join us for lunch and the advanced sessions in the afternoon. The morning session is completely optional.&lt;/i&gt;&lt;/p&gt;
&lt;h5&gt;Afternoon sessions:&lt;/h5&gt;
&lt;h5&gt;Session One: Software Patterns&lt;/h5&gt;
&lt;p&gt;Patterns are an important tool to use as architects and developers. They provide a common vocabulary for us to design with, as well as a common approach to a common problem. Come learn about useful patterns, and how to use them in your everyday code.&lt;/p&gt;
&lt;h5&gt;Session Two: How I Learned To Love Dependency Injection &lt;/h5&gt;
&lt;p&gt;Dependency Injection is one of those scary topics that most developers avoid. It sounds all &amp;lsquo;high-falootin&amp;rsquo; and complex. It&amp;rsquo;s not. Really. We wouldn&amp;rsquo;t lie. It&amp;rsquo;s a great way to manage complexity in your system, and a great way to make your system so much more testable. And isn&amp;rsquo;t that what we all want? &lt;/p&gt;
&lt;p&gt;Each session will be followed by open discussions periods.&lt;/p&gt;
&lt;p&gt;A catered lunch will be provided starting at noon. This will divide the morning introductory sessions from the advanced sessions. Register once for all session and choose to attend the morning, the afternoon or both! Lunch is provided for attendees for any of the sessions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53317" width="1" height="1"&gt;</description></item><item><title>Lambdas aren’t just for managed code</title><link>http://devlicio.us/blogs/scott_seely/archive/2009/10/21/lambdas-aren-t-just-for-managed-code.aspx</link><pubDate>Wed, 21 Oct 2009 23:50:29 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:52899</guid><dc:creator>Scott Seely</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/scott_seely/rsscomments.aspx?PostID=52899</wfw:commentRss><comments>http://devlicio.us/blogs/scott_seely/archive/2009/10/21/lambdas-aren-t-just-for-managed-code.aspx#comments</comments><description>&lt;p&gt;A long time ago, I was a C++ developer. I actually thought of myself as a pretty darn good C++ developer and got way too excited when I finally got to meet folks like Scott Meyers and actually landed a job working with Bobby Schmidt—same team on MSDN. (If you know Bobby’s name, well, you were pretty deep into C++ circa 1999.) Then, like many C++ devs, I moved over to a garbage collected language. I’ve done more than my fair share of professional .NET and Java development. C++ has been left by the wayside. Today, I finally downloaded and installed Visual Studio 2010 Beta 2. I dug into the “What’s New” and, out of curiosity, decided to look at C++ first (I already know about many of the C# and VB changes). I saw two cool things:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;C++ now has an auto keyword. For you C# devs, it is pretty much the same as the C# var keyword. &lt;/li&gt;    &lt;li&gt;C++ has lambdas. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Now, I’m only a little ways into understanding C++ lambdas, so some of my information here may be suspect. The C++ lambda is just an anonymous function. You can pass variables into the function so that the variable is visible within the function. The syntax is:&lt;/p&gt;  &lt;p&gt;[ &lt;em&gt;list of variables from current scope to pass into lambda scope&lt;/em&gt; ] &lt;em&gt;return-type&lt;/em&gt;( &lt;em&gt;function signature&lt;/em&gt; ) { &lt;em&gt;code&lt;/em&gt; }&lt;/p&gt;  &lt;p&gt;The canonical example appears to be std::for_each from &amp;lt;algorithm&amp;gt;. &lt;/p&gt; &lt;code&gt;   &lt;p&gt;#include &amp;quot;stdafx.h&amp;quot;      &lt;br /&gt;#include &amp;lt;iostream&amp;gt;       &lt;br /&gt;#include &amp;lt;algorithm&amp;gt;       &lt;br /&gt;#include &amp;lt;vector&amp;gt;       &lt;br /&gt;using namespace std; &lt;/p&gt;    &lt;p&gt;int _tmain(int argc, _TCHAR* argv[])      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; vector&amp;lt;int&amp;gt; myints;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; for (auto i = 0; i &amp;lt; 10; ++i){       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; myints.push_back(i);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; auto number = 0;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; auto numSquared = 0;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; for_each(myints.begin(), myints.end(), [&amp;amp;number, &amp;amp;numSquared](int n) {&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; cout &amp;lt;&amp;lt; n &amp;lt;&amp;lt; endl;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; number += n;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; numSquared += n * n;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; });       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; cout &amp;lt;&amp;lt; &amp;quot;The sum is &amp;quot; &amp;lt;&amp;lt; number &amp;lt;&amp;lt; endl;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; cout &amp;lt;&amp;lt; &amp;quot;The sum of the squares is &amp;quot; &amp;lt;&amp;lt; numSquared &amp;lt;&amp;lt; endl;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; return 0;       &lt;br /&gt;}&lt;/p&gt; &lt;/code&gt;  &lt;p&gt;In this example, I have two values: number and numSquared. I make references of the value visible to the lambda, which prints out each value as it comes through and then sums the numbers and their squares. Once the function completes, the code emits the values to the console window. If you don’t want to pass anything to the lambda, you still need to state this. If I didn’t want number or numSquared visible, the lambda signature would be:&lt;/p&gt; &lt;code&gt;   &lt;p&gt;[](int n){}&lt;/p&gt; &lt;/code&gt;  &lt;p&gt;At some point, I’ll dig in and see what else this is good for, including how to build my own Functor signatures. Anyhow, just thought I’d share this little nugget with you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=52899" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/C_2B002B00_/default.aspx">C++</category><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/VS+2010/default.aspx">VS 2010</category></item><item><title>New F#/WCF Article up at InformIT</title><link>http://devlicio.us/blogs/scott_seely/archive/2009/09/30/new-f-wcf-article-up-at-informit.aspx</link><pubDate>Wed, 30 Sep 2009 19:10:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:51921</guid><dc:creator>Scott Seely</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/scott_seely/rsscomments.aspx?PostID=51921</wfw:commentRss><comments>http://devlicio.us/blogs/scott_seely/archive/2009/09/30/new-f-wcf-article-up-at-informit.aspx#comments</comments><description>&lt;p&gt;My article on programming REST services with F# and WCF went up at InformIT. Please go read it! &lt;a href="http://www.informit.com/articles/article.aspx?p=1394625" title="http://www.informit.com/articles/article.aspx?p=1394625"&gt;http://www.informit.com/articles/article.aspx?p=1394625&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=51921" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/WCF/default.aspx">WCF</category><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/F_2300_/default.aspx">F#</category><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Review of ANTS Memory Profiler</title><link>http://devlicio.us/blogs/scott_seely/archive/2009/08/23/review-of-ants-memory-profiler.aspx</link><pubDate>Sun, 23 Aug 2009 16:05:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:50429</guid><dc:creator>Scott Seely</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/scott_seely/rsscomments.aspx?PostID=50429</wfw:commentRss><comments>http://devlicio.us/blogs/scott_seely/archive/2009/08/23/review-of-ants-memory-profiler.aspx#comments</comments><description>&lt;p&gt;&lt;strong&gt;Quick Summary&lt;/strong&gt;: Highly recommended! This is a big time saver over WinDBG/SOS/CLRProfiler. Either combination will get the job done, but you will complete simple tasks in significantly less time if you choose ANTS Memory Profiler. &lt;/p&gt;
&lt;h2&gt;The review&lt;/h2&gt;
&lt;p&gt;Our sponsors over at Red Gate Software released a new version of their &lt;a target="_blank" href="http://www.red-gate.com/products/ants_memory_profiler/index.htm"&gt;Memory Profiler&lt;/a&gt; and asked devlicio.us to give it a spin and write up a review. I had never used the tool before, but I have used the standard Microsoft tools to troubleshoot memory issues. My biggest concern with the Red Gate product is not whether it works but if it is worth the price in terms of time saved and productivity. With a list price of US$495 for the standalone product or US$795 for the &lt;a target="_blank" href="http://www.red-gate.com/products/dotnet_tools_overview.htm"&gt;.NET Bundle&lt;/a&gt;, it needs to save a lot of time to be worth the money. To get a feel for how it compares to the Microsoft solution, I decided to run &lt;a target="_blank" href="http://blogs.msdn.com/tess/"&gt;Tess Ferrandez&lt;/a&gt;&amp;rsquo;s &lt;a target="_blank" href="http://blogs.msdn.com/tess/pages/net-debugging-demos-information-and-setup-instructions.aspx"&gt;.NET Debugging labs 3 and 6&lt;/a&gt; against the Red Gate Memory Profiler. In my evaluation, I&amp;rsquo;m mostly interested in seeing if I can get to all the data and find the planted bugs without spinning up WinDBG + the SOS CLR extension, AdPlus, and all those other tools. &lt;/p&gt;
&lt;h3&gt;Setup&lt;/h3&gt;
&lt;p&gt;My test system is a Dell Studio XPS M13 with 4GB RAM running Windows 7 Ultimate x64.&lt;/p&gt;
&lt;p&gt;I installed the &lt;a target="_blank" href="https://www.red-gate.com/dynamic/downloads/downloadform.aspx?download=.netdeveloperbundle"&gt;14 day trial of the .NET Bundle&lt;/a&gt;. When you download, you will get an email from someone at Red Gate asking how they can help you with your evaluation and reminding you that there are demos and exercises to learn the tool at the bottom of the &lt;a target="_blank" href="http://www.red-gate.com/products/ants_memory_profiler/index.htm"&gt;Memory Profiler home page&lt;/a&gt;. I then ran through the demos and labs to get familiar with how the Memory Profiler tool works. &lt;/p&gt;
&lt;p&gt;To recreate the problem scenarios, I used Tinyget from the &lt;a target="_blank" href="http://support.microsoft.com/kb/840671"&gt;IIS 6.0 Resource Kit Tools&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;For setup, I grabbed the &lt;a target="_blank" href="http://blogs.msdn.com/tess/attachment/7431454.ashx"&gt;BuggyBits.zip&lt;/a&gt; file and unzipped it into c:\inetput\wwwroot\BuggyBits. I then opened up Internet Information Services (IIS) Manager, navigated to and right-clicked on the BuggyBits folder, and selected Convert to Application. &lt;/p&gt;
&lt;h3&gt;Debugging &lt;a target="_blank" href="http://blogs.msdn.com/tess/archive/2008/02/15/net-debugging-demos-lab-3-memory.aspx"&gt;.NET Debugging Demos Lab 3: Memory&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;This lab stresses a web site and causes a high memory situation. The lab has a simple goal: figure out what caused the issue memory leak. I setup the Memory Profiler to run the BuggyBits application. One thing I ran into was that the profiler won&amp;rsquo;t actually start profiling until you navigate to another page in the IIS application. For BuggyBits, this meant navigating to http://localhost/BuggyBits/Links.aspx in order to start profiling. I then followed these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Take Memory Snapshot &lt;/li&gt;
&lt;li&gt;From a command line, ran tinyget -srv:localhost -uri:/BuggyBits/Links.aspx -loop:400 &lt;/li&gt;
&lt;li&gt;Took another Memory Snapshot &lt;/li&gt;
&lt;li&gt;Started my investigation &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I did find that if I ran the application in a loop of 4000 items, Memory Profiler ran into memory issues during the investigation. That said, it was easy enough to do the troubleshooting with a smaller repro case. &lt;/p&gt;
&lt;p&gt;The first screen I saw after taking the second snapshot is this:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/scott_5F00_seely/lab3snapshot_5F00_7FF885EC.png"&gt;&lt;img height="484" width="513" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/scott_5F00_seely/lab3snapshot_5F00_thumb_5F00_591A49DF.png" alt="lab3snapshot" border="0" title="lab3snapshot" style="border-right-width:0px;display:block;float:none;border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;From that, we can see that we have a lot of strings, but we also have two classes with very similar instance counts: StringBuilder and Link. StringBuilder is a .NET CLR type, but Link isn&amp;rsquo;t. From this same screen, we can also take a look at how many objects are on the Gen 0,1, and 2 heaps. Looking at the Gen 2 heap, we see a similar picture with 3505 Link objects on the heap. What is causing the number of Link objects to be so high? Looking at the source, we see a class with a finalizer declared&amp;mdash;the finalizer does some heavy work (simulated via Thread.Sleep):&lt;/p&gt;
&lt;div style="font-family:courier new;background:white;color:black;font-size:10pt;"&gt;
&lt;p style="margin:0px;"&gt;~Link()&lt;/p&gt;
&lt;p style="margin:0px;"&gt;{&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:green;"&gt;//some long running operation when cleaning up the data&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af;"&gt;Thread&lt;/span&gt;.Sleep(5000);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;At this point, we have a few things we can do to fix the code:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Eliminate the finalizer altogether. &lt;/li&gt;
&lt;li&gt;Implement IDisposable and make sure to explicitly Dispose any Link objects after they are used. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I tried both options, and saw that we stopped leaking Link onto any of the heaps. &lt;/p&gt;
&lt;p&gt;Discovery in this case was pretty simple as the first screen gave me enough data, via the increase in memory usage on the graph and the analysis to know what was going on as well as inform me if my changes helped. &lt;/p&gt;
&lt;h3&gt;Debugging &lt;a target="_blank" href="http://blogs.msdn.com/tess/archive/2008/03/17/net-debugging-demos-lab-6-memory-leak.aspx"&gt;.NET Debugging Demos Lab 6:_Memory Leak&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Another memory leak situation. I followed a similar setup to the previous example. Steps to gather data are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to http://localhost/BuggyBits/ProductInfo.aspx?ProductName=Bugspray &lt;/li&gt;
&lt;li&gt;Take Memory Snapshot &lt;/li&gt;
&lt;li&gt;From a command line, ran tinyget -srv:localhost -uri:/BuggyBits/ProductInfo.aspx?ProductName=Bugspray &amp;ndash;threads:50 -loop:20 &lt;/li&gt;
&lt;li&gt;Took another Memory Snapshot &lt;/li&gt;
&lt;li&gt;Started my investigation &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This time, I was greeted by the following summary:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/scott_5F00_seely/lab6snapshot1_5F00_3C8D3232.png"&gt;&lt;img height="484" width="513" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/scott_5F00_seely/lab6snapshot1_5F00_thumb_5F00_55E50F9F.png" alt="lab6snapshot-1" border="0" title="lab6snapshot-1" style="border-right-width:0px;display:block;float:none;border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto;" /&gt;&lt;/a&gt; A large growth in strings still isn&amp;rsquo;t interesting. This grows due to assemblies being loaded in between calls and is hard to pin as an issue. Looking at &amp;ldquo;Largest Growth in Instances&amp;rdquo;, I see that RuntimeType has grown by quite a bit. Let&amp;rsquo;s see why. I clicked on RuntimeType and saw this screen, showing me how the size had changed:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/scott_5F00_seely/lab6snapshot2_5F00_633AFCD8.png"&gt;&lt;img height="484" width="570" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/scott_5F00_seely/lab6snapshot2_5F00_thumb_5F00_4D60EEAE.png" alt="lab6snapshot-2" border="0" title="lab6snapshot-2" style="border-right-width:0px;display:block;float:none;border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto;" /&gt;&lt;/a&gt; I then selected the Class Reference Explorer and got a hint as to what is going on:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/scott_5F00_seely/lab6snapshot3_5F00_3237F9D3.png"&gt;&lt;img height="484" width="518" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/scott_5F00_seely/lab6snapshot3_5F00_thumb_5F00_2F429520.png" alt="lab6snapshot-3" border="0" title="lab6snapshot-3" style="border-right-width:0px;display:block;float:none;border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto;" /&gt;&lt;/a&gt;While it doesn&amp;rsquo;t consume much space, the big hint of System.Xml.Serialization.TypeDesc is enough of a hint that we might have a serialization issue. XmlSerialization generates new assemblies when certain constructors are run. One feature I particularly liked in this investigation was the ability to see what types of objects were holding onto the references of other types. Here is an example of the objects referring to our TypeDesc. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/scott_5F00_seely/lab6snapshot4_5F00_454900B2.png"&gt;&lt;img height="291" width="644" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/scott_5F00_seely/lab6snapshot4_5F00_thumb_5F00_03621B64.png" alt="lab6snapshot-4" border="0" title="lab6snapshot-4" style="border-right-width:0px;display:block;float:none;border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From here, I looked for uses of XmlSerializer and sure enough, found one of the versions that doesn&amp;rsquo;t cache the serializer. DataLayer.cs contains these lines:&lt;/p&gt;
&lt;div style="font-family:courier new;background:white;color:black;font-size:10pt;"&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 118&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af;"&gt;Type&lt;/span&gt;[] extraTypes = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Type&lt;/span&gt;[1];&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 119&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; extraTypes[0] = &lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;ShippingInfo&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 120&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 121&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af;"&gt;MemoryStream&lt;/span&gt; ms = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;MemoryStream&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 122&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af;"&gt;XmlSerializer&lt;/span&gt; xs = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;XmlSerializer&lt;/span&gt;(&lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;Product&lt;/span&gt;), extraTypes);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:#2b91af;"&gt;&amp;nbsp; 123&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xs.Serialize(ms, p);&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;This is one of the constructors that creates a new assembly for every XmlSerializer instance. To fix the issue, one should cache the serializer. I did so by creating a static property on the DataLayer class:&lt;/p&gt;
&lt;div style="font-family:courier new;background:white;color:black;font-size:10pt;"&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;static&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;XmlSerializer&lt;/span&gt; _xs = &lt;span style="color:blue;"&gt;null&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;static&lt;/span&gt; &lt;span style="color:blue;"&gt;object&lt;/span&gt; _xsLock = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:blue;"&gt;object&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;static&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;XmlSerializer&lt;/span&gt; Serializer&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;get&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;if&lt;/span&gt; (_xs == &lt;span style="color:blue;"&gt;null&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;lock&lt;/span&gt; (_xsLock)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;if&lt;/span&gt; (_xs == &lt;span style="color:blue;"&gt;null&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af;"&gt;Type&lt;/span&gt;[] extraTypes = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Type&lt;/span&gt;[1];&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; extraTypes[0] = &lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;ShippingInfo&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _xs = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;XmlSerializer&lt;/span&gt;(&lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;Product&lt;/span&gt;), extraTypes);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;return&lt;/span&gt; _xs;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;This sped up execution time and reduced the number of RuntimeType instances by 2,031.&lt;/p&gt;
&lt;h3&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/scott_5F00_seely/lab6snapshot5_5F00_287F65D0.png"&gt;&lt;img height="484" width="570" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/scott_5F00_seely/lab6snapshot5_5F00_thumb_5F00_2796DA19.png" alt="lab6snapshot-5" border="0" title="lab6snapshot-5" style="border-right-width:0px;display:block;float:none;border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto;" /&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;h3&gt;Other Impressions&lt;/h3&gt;
&lt;p&gt;Given the speed with which I could diagnose the above two issues, I was really impressed. I also loved the ability to dig around and see what classes were in use and track through object graphs. To get the same job done with the Microsoft SDK tools I would have to correlate information from WinDBG + SOS and from CLRProfiler. The fact that I could do all this drill down in one tool gave me a huge productivity boost. &lt;/p&gt;
&lt;p&gt;I did have some issues with using the profiler. I posted the issue to the Red Gate forum and had a resolution within a few days. It turned out due to the design of the Server Garbage Collector (the GC that runs on multi-core machines) has a behavior that may appear as memory corruption to a profiler. (You can read the forum thread &lt;a target="_blank" href="http://www.red-gate.com/MessageBoard/viewtopic.php?t=9421"&gt;here&lt;/a&gt;.) I had a few other interactions with Red Gate as well and found the company to be very responsive to my needs. Because of the way the tool presents information, I could see patterns quickly and fix the issues with ease. Thanks to the time saving properties, I heartily recommend buying at least one copy of the Memory Profiler for every dev team. This is something I will be using once per sprint to look for memory leaks. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=50429" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/Tools/default.aspx">Tools</category><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/Red+Gate/default.aspx">Red Gate</category><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Just one Solution for Daily WTF Praxis on 8-5-2009</title><link>http://devlicio.us/blogs/scott_seely/archive/2009/08/05/just-one-solution-for-daily-wtf-praxis-on-8-5-2009.aspx</link><pubDate>Wed, 05 Aug 2009 19:08:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:49867</guid><dc:creator>Scott Seely</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/scott_seely/rsscomments.aspx?PostID=49867</wfw:commentRss><comments>http://devlicio.us/blogs/scott_seely/archive/2009/08/05/just-one-solution-for-daily-wtf-praxis-on-8-5-2009.aspx#comments</comments><description>&lt;p&gt;Over at &lt;a target="_blank" href="http://thedailywtf.com/"&gt;The Daily WTF&lt;/a&gt;, they&amp;rsquo;ve started posting programming puzzles. The &lt;a target="_blank" href="http://thedailywtf.com/Comments/Nerds,-Jocks,-and-Lockers.aspx"&gt;latest one&lt;/a&gt; is a puzzle where a set of locker doors are toggled, starting from the closed state, to the open state. Starting at a step size of 1 and stopping at a step size equal to the number of lockers, one toggles each door. At a step size of 1, all doors are opened, step size of 2, all the even doors are closed. At a step size of 3, door 3 is closed, door 6 opened, and so on.&lt;/p&gt;
&lt;p&gt;Many of the solutions observe that only perfect squares remain opened when the algorithm is complete. That option is easy, but I wanted to do one that mimics the jocks effort of brute force solving the problem. &lt;/p&gt;
&lt;div style="font-family:lucida console;background:white;color:black;font-size:12pt;"&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// Init the lockers to the initial state&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// and mark all doors as closed (false)&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;let&lt;/span&gt; sw = System.Diagnostics.Stopwatch.StartNew()&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;let&lt;/span&gt; totalLockers = 100&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;let&lt;/span&gt; lockers = &lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [1..totalLockers] &lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;gt; Seq.map( &lt;span style="color:blue;"&gt;fun&lt;/span&gt; e &lt;span style="color:blue;"&gt;-&amp;gt;&lt;/span&gt; (e, &lt;span style="color:blue;"&gt;false&lt;/span&gt;))&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// Recursive function to set each door.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;let&lt;/span&gt; &lt;span style="color:blue;"&gt;rec&lt;/span&gt; openLockers l skip = &lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;let&lt;/span&gt; listLength = Seq.length(l)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;if&lt;/span&gt; (totalLockers &amp;lt; skip) &lt;span style="color:blue;"&gt;then&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:green;"&gt;// We&amp;#39;ve done our last toggle on the previous iteration. &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;else&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:green;"&gt;// Do the toggling and try again.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;let&lt;/span&gt; newList = &lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l |&amp;gt; Seq.map( &lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;fun&lt;/span&gt; (e, f : System.Boolean) &lt;span style="color:blue;"&gt;-&amp;gt;&lt;/span&gt; &lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;let&lt;/span&gt; modValue = (e % skip)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;match&lt;/span&gt; modValue &lt;span style="color:blue;"&gt;with&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | 0 &lt;span style="color:blue;"&gt;-&amp;gt;&lt;/span&gt; (e, not(f))&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | _ &lt;span style="color:blue;"&gt;-&amp;gt;&lt;/span&gt; (e, f)) &lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; openLockers newList (skip + 1)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;let&lt;/span&gt; remainingOpen = &lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (openLockers lockers 1) |&amp;gt; &lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Seq.filter(&lt;span style="color:blue;"&gt;fun&lt;/span&gt; (e, f:System.Boolean) &lt;span style="color:blue;"&gt;-&amp;gt;&lt;/span&gt; f) |&amp;gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Seq.map(&lt;span style="color:blue;"&gt;fun&lt;/span&gt; (e, f:System.Boolean) &lt;span style="color:blue;"&gt;-&amp;gt;&lt;/span&gt; e)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;sw.Stop()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p style="margin:0px;"&gt;Seq.iter (printf &lt;span style="color:maroon;"&gt;&amp;quot;%d\n&amp;quot;&lt;/span&gt;) remainingOpen&lt;/p&gt;
&lt;p style="margin:0px;"&gt;printf (&lt;span style="color:maroon;"&gt;&amp;quot;%s\n&amp;quot;&lt;/span&gt;) (sw.Elapsed.ToString())&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=49867" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/F_2300_/default.aspx">F#</category></item><item><title>Thirsty Developer interview is up!</title><link>http://devlicio.us/blogs/scott_seely/archive/2009/07/23/thirsty-developer-interview-is-up.aspx</link><pubDate>Thu, 23 Jul 2009 15:23:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:49541</guid><dc:creator>Scott Seely</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/scott_seely/rsscomments.aspx?PostID=49541</wfw:commentRss><comments>http://devlicio.us/blogs/scott_seely/archive/2009/07/23/thirsty-developer-interview-is-up.aspx#comments</comments><description>&lt;p&gt;At the end of June, Larry Clarkin met me at a Starbucks to do an interview. After a month of editting, the interview is ready for prime time. Please go to &lt;a href="http://thirstydeveloper.com/2009/07/22/69WebServicesWithScottSeely.aspx"&gt;http://thirstydeveloper.com/2009/07/22/69WebServicesWithScottSeely.aspx&lt;/a&gt;&amp;nbsp;and give it a listen!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=49541" width="1" height="1"&gt;</description></item></channel></rss>