<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>The Code Project Latest postings for Clever Code</title>
    <link>http://www.codeproject.com</link>
    <description>Latest postings for Clever Code from The Code Project</description>
    <language>en-us</language>
    <image>
      <title>The Code Project Latest postings for Clever Code</title>
      <url>http://www.codeproject.com/App_Themes/Std/Img/logo100x30.gif</url>
      <link>http://www.codeproject.com</link>
      <width>100</width>
      <height>30</height>
      <description>The Code Project</description>
    </image>
    <copyright>Copyright  CodeProject, 1999-2012</copyright>
    <webMaster>webmaster@codeproject.com (Webmaster)</webMaster>
    <lastBuildDate>Tue, 07 Feb 2012 11:11:00 GMT</lastBuildDate>
    <ttl>20</ttl>
    <generator>C# Hand-coded goodness</generator>
    <item>
      <title>file converstion</title>
      <description>hey plz can anybody tell me how can i convert files(doc,pdf etc) to UDF(universal disk format) using .net libraries... if not. then tell me is there any other software third party?</description>
      <link>http://www.codeproject.com/Messages/4149913/file-converstion.aspx</link>
      <author>anikbutt22</author>
      <pubDate>Tue, 07 Feb 2012 11:11:00 GMT</pubDate>
      <subject>Clever Code</subject>
    </item>
    <item>
      <title>Linq2Horror</title>
      <description>Hi all,&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
I think the following could also qualify as a coding horror but I intentionally wrote it this way (one giant linq statement) because of a discussion with a collegue:&lt;br /&gt;
&lt;pre&gt;Directory.EnumerateFiles(args[&lt;span class="code-digit"&gt;0&lt;/span&gt;], &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;*.cs"&lt;/span&gt;, SearchOption.AllDirectories).AsParallel().Select(f =&amp;gt; &lt;span class="code-keyword"&gt;new&lt;/span&gt; { File = f, Bytes = File.ReadAllBytes(f) }).Select(f =&amp;gt; &lt;span class="code-keyword"&gt;new&lt;/span&gt; { File = f.File, Bytes = f.Bytes, Encoding = f.Bytes.Take(&lt;span class="code-digit"&gt;3&lt;/span&gt;).SequenceEqual(&lt;span class="code-keyword"&gt;new&lt;/span&gt; byte[] { &lt;span class="code-digit"&gt;239&lt;/span&gt;, &lt;span class="code-digit"&gt;187&lt;/span&gt;, &lt;span class="code-digit"&gt;191&lt;/span&gt; }) ? Encoding.UTF8 : Encoding.Default }).ForAll(f =&amp;gt; File.WriteAllText(f.File, f.Encoding.GetString(f.Bytes).Split(&lt;span class="code-keyword"&gt;new&lt;/span&gt; string[] { Environment.NewLine }, StringSplitOptions.None).Select(l =&amp;gt; &lt;span class="code-keyword"&gt;new&lt;/span&gt; { Line = l, Index = l.Select((c, i) =&amp;gt; &lt;span class="code-keyword"&gt;new&lt;/span&gt; { Char = c, Index = i }).FirstOrDefault(c =&amp;gt; c.Char != &lt;span class="code-string"&gt;'&lt;/span&gt;&lt;span class="code-string"&gt; '&lt;/span&gt; &amp;amp;&amp;amp; c.Char != &lt;span class="code-string"&gt;'&lt;/span&gt;&lt;span class="code-string"&gt;\t'&lt;/span&gt;) }).Select(l =&amp;gt; l.Index == null ? l.Line : l.Line.Select((c, i) =&amp;gt; (i &amp;lt; l.Index.Index &amp;amp;&amp;amp; c == &lt;span class="code-string"&gt;'&lt;/span&gt;&lt;span class="code-string"&gt;\t'&lt;/span&gt;) ? &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;    "&lt;/span&gt; : c.ToString()).Aggregate((s1, s2) =&amp;gt; s1 + s2)).Aggregate((s1, s2) =&amp;gt; s1 + Environment.NewLine + s2), f.Encoding));&lt;/pre&gt;
&amp;nbsp;&lt;br /&gt;
Here another version where I tried to get a proper formatting:&lt;br /&gt;
&lt;pre lang="cs"&gt;&lt;span class="code-keyword"&gt;static&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; Main(&lt;span class="code-keyword"&gt;string&lt;/span&gt;[] args)
{
    Directory.EnumerateFiles(args[&lt;span class="code-digit"&gt;0&lt;/span&gt;], &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;*.cs"&lt;/span&gt;, SearchOption.AllDirectories).
        AsParallel().
        Select(f =&amp;gt; &lt;span class="code-keyword"&gt;new&lt;/span&gt; {
            File = f,
            Bytes = File.ReadAllBytes(f)
        }).
        Select(f =&amp;gt; &lt;span class="code-keyword"&gt;new&lt;/span&gt; {
            File = f.File,
            Bytes = f.Bytes,
            Encoding = f.Bytes.Take(&lt;span class="code-digit"&gt;3&lt;/span&gt;).SequenceEqual(&lt;span class="code-keyword"&gt;new&lt;/span&gt; &lt;span class="code-keyword"&gt;byte&lt;/span&gt;[] { &lt;span class="code-digit"&gt;239&lt;/span&gt;, &lt;span class="code-digit"&gt;187&lt;/span&gt;, &lt;span class="code-digit"&gt;191&lt;/span&gt; })
                ? Encoding.UTF8 : Encoding.Default
        }).
        ForAll(f =&amp;gt; File.WriteAllText(f.File,
            f.Encoding.GetString(f.Bytes).Split(
                &lt;span class="code-keyword"&gt;new&lt;/span&gt; &lt;span class="code-keyword"&gt;string&lt;/span&gt;[] { Environment.NewLine }, StringSplitOptions.None).
            Select(l =&amp;gt; &lt;span class="code-keyword"&gt;new&lt;/span&gt; { Line = l, Index = l.
                Select((c, i) =&amp;gt; &lt;span class="code-keyword"&gt;new&lt;/span&gt; { Char = c, Index = i }).
                FirstOrDefault(c =&amp;gt; c.Char != &lt;span class="code-string"&gt;'&lt;/span&gt;&lt;span class="code-string"&gt; '&lt;/span&gt; &amp;amp;&amp;amp; c.Char != &lt;span class="code-string"&gt;'&lt;/span&gt;&lt;span class="code-string"&gt;\t'&lt;/span&gt;) }).
            Select(l =&amp;gt; l.Index == &lt;span class="code-keyword"&gt;null&lt;/span&gt; ? l.Line : l.Line.
                Select((c, i) =&amp;gt; (i &amp;lt; l.Index.Index &amp;amp;&amp;amp; c == &lt;span class="code-string"&gt;'&lt;/span&gt;&lt;span class="code-string"&gt;\t'&lt;/span&gt;)
                    ? &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;    "&lt;/span&gt; : c.ToString()).Aggregate((s1, s2) =&amp;gt; s1 + s2)).
                Aggregate((s1, s2) =&amp;gt; s1 + Environment.NewLine + s2), f.Encoding));
}&lt;/pre&gt;
&amp;nbsp;&lt;br /&gt;
So what does this do?&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;i&gt;args[0]&lt;/i&gt; should be a directory where C#-Files are located (*.cs). It opens all files, does a bit of Encoding-analysis (this might not work in every case but its fine for me), replaces Tabs at the beginning of each line with whitespaces (4 for each tab), removes alle whitespaces and tabs in otherwise totally empty lines and writes the file back with the proper encoding.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
Interestingly this runs faster than I would have expected. For a codebase with about 8800 files it runs just a few seconds. I would even think (haven't measured it) that searching, reading and writing the files is more time consuming than the rest of the linq in between.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Robert</description>
      <link>http://www.codeproject.com/Messages/4137922/Linq2Horror.aspx</link>
      <author>Robert Rohde</author>
      <pubDate>Wed, 25 Jan 2012 08:01:00 GMT</pubDate>
      <subject>Clever Code</subject>
    </item>
    <item>
      <title>Vim (linux) regex to create links</title>
      <description>I've been working on about a dozen web pages that I updated. These pages have tables of courses that students can take, and the the page they link to changed. So, after a quick search, I used this regex in Vim (one of the best text editors):&lt;br /&gt;
&lt;pre&gt;:%s/&amp;lt;td&amp;gt;\(\w\+\)\s\(\d\+\)&amp;lt;\/td&amp;gt;/&amp;lt;td&amp;gt;&amp;lt;a href=&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;courses.php?course=\1%20\2"&lt;/span&gt;&amp;gt;\1 \2&amp;lt;\/a&amp;gt;&amp;lt;\/td&amp;gt;/i&lt;/pre&gt;</description>
      <link>http://www.codeproject.com/Messages/4134792/Vim-linux-regex-to-create-links.aspx</link>
      <author>Kevin Schaefer</author>
      <pubDate>Fri, 20 Jan 2012 23:50:00 GMT</pubDate>
      <subject>Clever Code</subject>
    </item>
    <item>
      <title>Single Update Query for.....</title>
      <description>&lt;pre lang="sql"&gt;
    &lt;span class="code-keyword"&gt;create&lt;/span&gt; &lt;span class="code-keyword"&gt;table&lt;/span&gt; trns.a(id &lt;span class="code-keyword"&gt;int&lt;/span&gt;,name &lt;span class="code-keyword"&gt;varchar&lt;/span&gt;(&lt;span class="code-digit"&gt;20&lt;/span&gt;))
&lt;span class="code-keyword"&gt;insert&lt;/span&gt; &lt;span class="code-keyword"&gt;into&lt;/span&gt; TRNS.a &lt;span class="code-keyword"&gt;values&lt;/span&gt;(&lt;span class="code-digit"&gt;1&lt;/span&gt;,&lt;span class="code-string"&gt;'&lt;/span&gt;&lt;span class="code-string"&gt;A'&lt;/span&gt;)
&lt;span class="code-keyword"&gt;insert&lt;/span&gt; &lt;span class="code-keyword"&gt;into&lt;/span&gt; TRNS.a &lt;span class="code-keyword"&gt;values&lt;/span&gt;(&lt;span class="code-digit"&gt;2&lt;/span&gt;,&lt;span class="code-string"&gt;'&lt;/span&gt;&lt;span class="code-string"&gt;B'&lt;/span&gt;)
&lt;span class="code-keyword"&gt;insert&lt;/span&gt; &lt;span class="code-keyword"&gt;into&lt;/span&gt; TRNS.a &lt;span class="code-keyword"&gt;values&lt;/span&gt;(&lt;span class="code-digit"&gt;3&lt;/span&gt;,&lt;span class="code-string"&gt;'&lt;/span&gt;&lt;span class="code-string"&gt;C'&lt;/span&gt;)
&lt;span class="code-keyword"&gt;insert&lt;/span&gt; &lt;span class="code-keyword"&gt;into&lt;/span&gt; TRNS.a &lt;span class="code-keyword"&gt;values&lt;/span&gt;(&lt;span class="code-digit"&gt;4&lt;/span&gt;,&lt;span class="code-string"&gt;'&lt;/span&gt;&lt;span class="code-string"&gt;D'&lt;/span&gt;)
&lt;span class="code-keyword"&gt;insert&lt;/span&gt; &lt;span class="code-keyword"&gt;into&lt;/span&gt; TRNS.a &lt;span class="code-keyword"&gt;values&lt;/span&gt;(&lt;span class="code-digit"&gt;5&lt;/span&gt;,&lt;span class="code-string"&gt;'&lt;/span&gt;&lt;span class="code-string"&gt;E'&lt;/span&gt;)
&lt;span class="code-keyword"&gt;insert&lt;/span&gt; &lt;span class="code-keyword"&gt;into&lt;/span&gt; TRNS.a &lt;span class="code-keyword"&gt;values&lt;/span&gt;(&lt;span class="code-digit"&gt;6&lt;/span&gt;,&lt;span class="code-string"&gt;'&lt;/span&gt;&lt;span class="code-string"&gt;F'&lt;/span&gt;)
&amp;nbsp;
&lt;span class="code-keyword"&gt;select&lt;/span&gt; *from a
&lt;span class="code-keyword"&gt;if&lt;/span&gt; you run &lt;span class="code-keyword"&gt;select&lt;/span&gt; Query, you will get
id  name
&lt;span class="code-comment"&gt;--&lt;/span&gt;&lt;span class="code-comment"&gt;-----------------
&lt;/span&gt;&lt;span class="code-digit"&gt;1&lt;/span&gt;   A
&lt;span class="code-digit"&gt;2&lt;/span&gt;   B
&lt;span class="code-digit"&gt;3&lt;/span&gt;   C
&lt;span class="code-digit"&gt;4&lt;/span&gt;   D
.   .
.   .
&amp;nbsp;
Q. I need &lt;span class="code-keyword"&gt;to&lt;/span&gt; &lt;span class="code-keyword"&gt;Update&lt;/span&gt; the above &lt;span class="code-keyword"&gt;table&lt;/span&gt; &lt;span class="code-keyword"&gt;in&lt;/span&gt; single &lt;span class="code-keyword"&gt;update&lt;/span&gt; statement &lt;span class="code-keyword"&gt;to&lt;/span&gt; get result &lt;span class="code-keyword"&gt;like&lt;/span&gt;
&lt;span class="code-keyword"&gt;select&lt;/span&gt; *from a
&amp;nbsp;
id  name
&lt;span class="code-comment"&gt;--&lt;/span&gt;&lt;span class="code-comment"&gt;-----------------
&lt;/span&gt;&lt;span class="code-digit"&gt;1&lt;/span&gt;   B
&lt;span class="code-digit"&gt;2&lt;/span&gt;   A
&lt;span class="code-digit"&gt;3&lt;/span&gt;   D
&lt;span class="code-digit"&gt;4&lt;/span&gt;   C
.   .
.   .
&amp;nbsp;
Note: I know the solution, So I have put this question under &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Clever Code"&lt;/span&gt;.&lt;/pre&gt;</description>
      <link>http://www.codeproject.com/Messages/4131680/Single-Update-Query-for.aspx</link>
      <author>guptasanjay56</author>
      <pubDate>Wed, 18 Jan 2012 14:36:00 GMT</pubDate>
      <subject>Clever Code</subject>
    </item>
    <item>
      <title>The mystery function</title>
      <description>This is a little game.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
Someone in CodeProject wrote this:&lt;br /&gt;
I'll let you guess what this does and how it should be named:&lt;br /&gt;
&lt;pre lang="cs"&gt;&lt;span class="code-keyword"&gt;static&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt; f(&lt;span class="code-keyword"&gt;int&lt;/span&gt; v)
{
    &lt;span class="code-keyword"&gt;unchecked&lt;/span&gt;
    {
&amp;nbsp;
        v--;
        v |= v &amp;gt;&amp;gt; &lt;span class="code-digit"&gt;1&lt;/span&gt;;
        v |= v &amp;gt;&amp;gt; &lt;span class="code-digit"&gt;2&lt;/span&gt;;
        v |= v &amp;gt;&amp;gt; &lt;span class="code-digit"&gt;4&lt;/span&gt;;
        v |= v &amp;gt;&amp;gt; &lt;span class="code-digit"&gt;8&lt;/span&gt;;
        v |= v &amp;gt;&amp;gt; &lt;span class="code-digit"&gt;16&lt;/span&gt;;
        v++;
    }
    &lt;span class="code-keyword"&gt;return&lt;/span&gt; v;
}&lt;/pre&gt;
&amp;nbsp;&lt;br /&gt;
&lt;small&gt;For the record when I posted this I promise did not realize that previous post was speaking about the exact same thing.&lt;br /&gt;
How extraordinary is this?&lt;/small&gt;</description>
      <link>http://www.codeproject.com/Messages/4122350/The-mystery-function.aspx</link>
      <author>Pascal Ganaye</author>
      <pubDate>Mon, 09 Jan 2012 08:49:00 GMT</pubDate>
      <subject>Clever Code</subject>
    </item>
    <item>
      <title>Cool bitwise trick page</title>
      <description>&lt;a href="http://graphics.stanford.edu/~seander/bithacks.html"&gt;Bit hacks&lt;/a&gt;[&lt;a href="http://graphics.stanford.edu/~seander/bithacks.html" target="_blank" title="New Window"&gt;^&lt;/a&gt;]&lt;br /&gt;
For example: Round up to the next highest power of 2:&lt;br /&gt;
&lt;pre&gt;&lt;span class="code-keyword"&gt;unsigned&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt; v; &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; compute the next highest power of 2 of 32-bit v
&lt;/span&gt;
v--;
v |= v &amp;gt;&amp;gt; &lt;span class="code-digit"&gt;1&lt;/span&gt;;
v |= v &amp;gt;&amp;gt; &lt;span class="code-digit"&gt;2&lt;/span&gt;;
v |= v &amp;gt;&amp;gt; &lt;span class="code-digit"&gt;4&lt;/span&gt;;
v |= v &amp;gt;&amp;gt; &lt;span class="code-digit"&gt;8&lt;/span&gt;;
v |= v &amp;gt;&amp;gt; &lt;span class="code-digit"&gt;16&lt;/span&gt;;
v++;&lt;/pre&gt;
This makes my previous code soooo lame (Math.Pow(2,Math.Log(v,2)+1)) or sth like this).&lt;br /&gt;
&lt;div class="signature"&gt;Greetings - Jacek&lt;/div&gt;</description>
      <link>http://www.codeproject.com/Messages/4113671/Cool-bitwise-trick-page.aspx</link>
      <author>Jacek Gajek</author>
      <pubDate>Wed, 28 Dec 2011 11:46:00 GMT</pubDate>
      <subject>Clever Code</subject>
    </item>
    <item>
      <title>Translating a jagged array</title>
      <description>The code below translates a jagged array. For a jagged array A, the result is a n*m jagged array, where the outer size is n=max(A[i].Length) and the inner size of each subarray is m=A.GetLength(0).&lt;br /&gt;
Remark: Holes after null or incomplete subarrays will be filled with default(T).&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;pre&gt;MyType[][] &lt;span class="code-keyword"&gt;array&lt;/span&gt; = ...;
MyType[][] translated = &lt;span class="code-keyword"&gt;array&lt;/span&gt;.Translate();&lt;/pre&gt;
For examle:&lt;br /&gt;
1.&lt;br /&gt;
&lt;pre&gt;&lt;span class="code-keyword"&gt;array&lt;/span&gt; = &lt;span class="code-keyword"&gt;new&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt;[&lt;span class="code-digit"&gt;5&lt;/span&gt;][] { 
    &lt;span class="code-keyword"&gt;new&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt;[]  { &lt;span class="code-digit"&gt;5&lt;/span&gt;, &lt;span class="code-digit"&gt;6&lt;/span&gt;, &lt;span class="code-digit"&gt;7&lt;/span&gt;    },
    &lt;span class="code-keyword"&gt;new&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt; [] { &lt;span class="code-digit"&gt;1&lt;/span&gt;, &lt;span class="code-digit"&gt;2&lt;/span&gt;, &lt;span class="code-digit"&gt;3&lt;/span&gt;, &lt;span class="code-digit"&gt;4&lt;/span&gt; },
    &lt;span class="code-keyword"&gt;new&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt; [] {            },
    &lt;span class="code-keyword"&gt;new&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt; [] { &lt;span class="code-digit"&gt;0&lt;/span&gt;, &lt;span class="code-digit"&gt;1&lt;/span&gt;       },
    null,
};
expected = &lt;span class="code-keyword"&gt;new&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt;[&lt;span class="code-digit"&gt;4&lt;/span&gt;][] { 
    &lt;span class="code-keyword"&gt;new&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt;[] { &lt;span class="code-digit"&gt;5&lt;/span&gt;, &lt;span class="code-digit"&gt;1&lt;/span&gt;, &lt;span class="code-digit"&gt;0&lt;/span&gt;, &lt;span class="code-digit"&gt;0&lt;/span&gt;, &lt;span class="code-digit"&gt;0&lt;/span&gt; },
    &lt;span class="code-keyword"&gt;new&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt;[] { &lt;span class="code-digit"&gt;6&lt;/span&gt;, &lt;span class="code-digit"&gt;2&lt;/span&gt;, &lt;span class="code-digit"&gt;0&lt;/span&gt;, &lt;span class="code-digit"&gt;1&lt;/span&gt;, &lt;span class="code-digit"&gt;0&lt;/span&gt; },
    &lt;span class="code-keyword"&gt;new&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt;[] { &lt;span class="code-digit"&gt;7&lt;/span&gt;, &lt;span class="code-digit"&gt;3&lt;/span&gt;, &lt;span class="code-digit"&gt;0&lt;/span&gt;, &lt;span class="code-digit"&gt;0&lt;/span&gt;, &lt;span class="code-digit"&gt;0&lt;/span&gt; },
    &lt;span class="code-keyword"&gt;new&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt;[] { &lt;span class="code-digit"&gt;0&lt;/span&gt;, &lt;span class="code-digit"&gt;4&lt;/span&gt;, &lt;span class="code-digit"&gt;0&lt;/span&gt;, &lt;span class="code-digit"&gt;0&lt;/span&gt;, &lt;span class="code-digit"&gt;0&lt;/span&gt; },
};&lt;/pre&gt;
2.&lt;br /&gt;
&lt;pre&gt;&lt;span class="code-keyword"&gt;array&lt;/span&gt; = &lt;span class="code-keyword"&gt;new&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt;[&lt;span class="code-digit"&gt;2&lt;/span&gt;][] { 
    null,
    null,
};
expected = &lt;span class="code-keyword"&gt;new&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt;[&lt;span class="code-digit"&gt;1&lt;/span&gt;][] { 
    &lt;span class="code-keyword"&gt;new&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt;[] { &lt;span class="code-digit"&gt;0&lt;/span&gt;, &lt;span class="code-digit"&gt;0&lt;/span&gt; },
};&lt;/pre&gt;
For nullable types, there would be null instead of 0.&lt;br /&gt;
&lt;pre lang="cs"&gt;&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; &lt;span class="code-keyword"&gt;class&lt;/span&gt; JaggedArrayExtensions
{ 
    &lt;span class="code-SummaryComment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;summary&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;    &lt;span class="code-SummaryComment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; Translates a given jagged array. Holes after null or incomplete subarrays will be fileld with default(T).
&lt;/span&gt;    &lt;span class="code-SummaryComment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;summary&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;    &lt;span class="code-SummaryComment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;typeparam&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;name="T"&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;&amp;gt;&lt;/span&gt;Type of elements in the array&lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;typeparam&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;    &lt;span class="code-SummaryComment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;param&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;name="array"&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;&amp;gt;&lt;/span&gt;The array to translate&lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;param&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;    &lt;span class="code-SummaryComment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;returns&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;&amp;gt;&lt;/span&gt;A n*m jagged array, where the outer size is n=max(A[i].Length) and 
&lt;/span&gt;    &lt;span class="code-SummaryComment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; the inner size of each subarray is m=A.GetLength(0).&lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;returns&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; T[][] Translate&amp;lt;T&amp;gt;(&lt;span class="code-keyword"&gt;this&lt;/span&gt; T[][] array)
    {
        &lt;span class="code-keyword"&gt;if&lt;/span&gt; (array == &lt;span class="code-keyword"&gt;null&lt;/span&gt;)
            &lt;span class="code-keyword"&gt;throw&lt;/span&gt; &lt;span class="code-keyword"&gt;new&lt;/span&gt; ArgumentNullException();
        &lt;span class="code-keyword"&gt;if&lt;/span&gt; (array.Length == &lt;span class="code-digit"&gt;0&lt;/span&gt;)
            &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;new&lt;/span&gt; T[&lt;span class="code-digit"&gt;0&lt;/span&gt;][];
        &lt;span class="code-keyword"&gt;int&lt;/span&gt; columnCount = array.Max(sub =&amp;gt; sub == &lt;span class="code-keyword"&gt;null&lt;/span&gt; ? &lt;span class="code-digit"&gt;1&lt;/span&gt; : sub.Length);
        &lt;span class="code-keyword"&gt;int&lt;/span&gt; rowCount = array.Length;
        T[][] res = &lt;span class="code-keyword"&gt;new&lt;/span&gt; T[columnCount][];
        &lt;span class="code-keyword"&gt;for&lt;/span&gt; (&lt;span class="code-keyword"&gt;int&lt;/span&gt; i = &lt;span class="code-digit"&gt;0&lt;/span&gt;; i &amp;lt; columnCount; i++)
        {
            res[i] = &lt;span class="code-keyword"&gt;new&lt;/span&gt; T[rowCount];
            &lt;span class="code-keyword"&gt;for&lt;/span&gt; (&lt;span class="code-keyword"&gt;int&lt;/span&gt; j = &lt;span class="code-digit"&gt;0&lt;/span&gt;; j &amp;lt; rowCount; j++)
            {
                &lt;span class="code-keyword"&gt;if&lt;/span&gt; (array[j] == &lt;span class="code-keyword"&gt;null&lt;/span&gt; || i &amp;gt;= array[j].Length)
                    res[i][j] = &lt;span class="code-keyword"&gt;default&lt;/span&gt;(T);
                &lt;span class="code-keyword"&gt;else&lt;/span&gt;
                    res[i][j] = array[j][i];
            }
        }
        &lt;span class="code-keyword"&gt;return&lt;/span&gt; res;
    }
}&lt;/pre&gt;
&lt;div class="signature"&gt;Greetings - Jacek&lt;/div&gt;</description>
      <link>http://www.codeproject.com/Messages/4094570/Translating-a-jagged-array.aspx</link>
      <author>Jacek Gajek</author>
      <pubDate>Sun, 04 Dec 2011 14:33:00 GMT</pubDate>
      <subject>Clever Code</subject>
    </item>
    <item>
      <title>For peer review:  InputBox.</title>
      <description>Purpose:  A simple data entry dialog, functionally similar to MessageBox.  Feedback is welcomed.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;pre lang="c#"&gt;
&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Sample Utilization:
&lt;/span&gt;
&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;Example 1
&lt;/span&gt;&lt;span class="code-keyword"&gt;string&lt;/span&gt; s = &lt;span class="code-keyword"&gt;string&lt;/span&gt;.Empty;
&lt;span class="code-keyword"&gt;if&lt;/span&gt; (InputBox.ShowDialog(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Type your name:"&lt;/span&gt;, &lt;span class="code-keyword"&gt;ref&lt;/span&gt; s) == DialogResult.Cancel) &lt;span class="code-keyword"&gt;return&lt;/span&gt;;
&amp;nbsp;
&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;Example 2
&lt;/span&gt;&lt;span class="code-keyword"&gt;int&lt;/span&gt; x = ((&lt;span class="code-keyword"&gt;int&lt;/span&gt;?)InputBox.Create(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Multiply by 2:"&lt;/span&gt;, &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;1"&lt;/span&gt;) ?? &lt;span class="code-digit"&gt;0&lt;/span&gt;) * &lt;span class="code-digit"&gt;2&lt;/span&gt;;
&lt;/pre&gt;
&amp;nbsp;&lt;br /&gt;
InputBox Class&lt;br /&gt;
&lt;pre lang="c#"&gt;
&lt;span class="code-SummaryComment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;summary&amp;gt;&lt;/span&gt;
&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Input&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;dialog&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;box&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;used&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;for&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;simple&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;user&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;data&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;entry.&lt;/span&gt;
&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;summary&amp;gt;&lt;/span&gt;
&lt;span class="code-SummaryComment"&gt;public&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;static&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;class&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;InputBox&lt;/span&gt;
&lt;span class="code-SummaryComment"&gt;{&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Standard&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;DialogResult&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;method&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;used&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;for&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;simple&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;user&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;input.&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;param&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;name="caption"&amp;gt;Title&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;for&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;the&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Input&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;form.&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;param&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;param&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;name="defaultValue"&amp;gt;Default&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;to&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;be&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;displayed&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;in&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;the&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;textbox.&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;param&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;returns&amp;gt;DialogResult,&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;and&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;updates&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;the&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;value&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;of&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;reference&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;parameter&lt;/span&gt; 
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;defaultValue&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;if&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;the&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;result&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;is&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;DialogResult.OK.&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;returns&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;public&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;static&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;DialogResult&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;ShowDialog(string&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;caption,&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;ref&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;string&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;defaultValue)&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;{&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;InputForm&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;inForm&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;=&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;new&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;InputForm(caption,&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;defaultValue);&lt;/span&gt;
&amp;nbsp;
        &lt;span class="code-SummaryComment"&gt;if&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;(inForm.ShowDialog()&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;==&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;DialogResult.OK)&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;{&lt;/span&gt;
            &lt;span class="code-SummaryComment"&gt;defaultValue&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;=&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;inForm.StringValue;&lt;/span&gt;
            &lt;span class="code-SummaryComment"&gt;return&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;DialogResult.OK;&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;}&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;return&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;DialogResult.Cancel;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;}&lt;/span&gt;
&amp;nbsp;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Direct&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;InputBox&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;method,&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;used&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;for&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;immediate&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;typecasting.&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Shows&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;the&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;dialog&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;as&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;part&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;of&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;its&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;creation.&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;param&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;name="caption"&amp;gt;Title&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;for&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;the&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Input&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;form.&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;param&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;param&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;name="defaultValue"&amp;gt;Default&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;to&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;be&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;displayed&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;in&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;the&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;textbox.&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;param&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;returns&amp;gt;InputForm&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;ready&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;to&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;be&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;typecast&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;to&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;the&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;appropriate&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;value&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;type.&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;returns&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;public&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;static&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;InputForm&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Create(string&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;caption,&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;string&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;defaultValue)&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;{&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;InputForm&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;inForm&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;=&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;new&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;InputForm(caption,&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;defaultValue);&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;if&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;(inForm.ShowDialog()&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;==&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;DialogResult.Cancel)&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;inForm.StringValue&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;=&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;string.Empty;&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;return&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;inForm;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;}&lt;/span&gt;
&lt;span class="code-SummaryComment"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/pre&gt;
&amp;nbsp;&lt;br /&gt;
InputForm (used by InputBox)&lt;br /&gt;
&lt;pre lang="c#"&gt;
&lt;span class="code-SummaryComment"&gt;///&lt;/span&gt;&lt;span class="code-comment"&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;summary&amp;gt;&lt;/span&gt;
&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Display&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;class&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;for&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;InputBox.&lt;/span&gt;  &lt;span class="code-SummaryComment"&gt;Should&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;not&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;be&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;used&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;directly,&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;use&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;InputBox&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;instead.&lt;/span&gt;
&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;summary&amp;gt;&lt;/span&gt;
&lt;span class="code-SummaryComment"&gt;public&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;partial&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;class&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;InputForm&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;:&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Form&lt;/span&gt;
&lt;span class="code-SummaryComment"&gt;{&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;#region&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Constructors&lt;/span&gt;
&amp;nbsp;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Default&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;constructor.&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;public&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;InputForm()&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;{&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;InitializeComponent();&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;}&lt;/span&gt;
&amp;nbsp;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Parameterized&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;constructor.&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;param&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;name="caption"&amp;gt;Title&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;for&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;the&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Input&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;form.&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;param&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;param&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;name="defaultValue"&amp;gt;Default&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;to&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;be&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;displayed&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;in&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;the&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;textbox.&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;param&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;public&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;InputForm(string&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;caption,&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;string&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;defaultValue)&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;:&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;this()&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;{&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;this.Text&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;=&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;caption;&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;txtValue.Text&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;=&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;defaultValue;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;}&lt;/span&gt;
&amp;nbsp;
    &lt;span class="code-SummaryComment"&gt;#endregion&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Constructors&lt;/span&gt;
&amp;nbsp;
    &lt;span class="code-SummaryComment"&gt;#region&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Public&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Properties&lt;/span&gt;
&amp;nbsp;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Accessor&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;for&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;the&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;textbox&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;value.&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;public&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;string&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;StringValue&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;{&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;get&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;{&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;return&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;txtValue.Text;&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;}&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;set&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;{&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;txtValue.Text&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;=&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;value;&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;}&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;}&lt;/span&gt;
&amp;nbsp;
    &lt;span class="code-SummaryComment"&gt;#endregion&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Public&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Properties&lt;/span&gt;
&amp;nbsp;
    &lt;span class="code-SummaryComment"&gt;#region&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Typecasting&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Operators&lt;/span&gt;
&amp;nbsp;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Typecasting&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;operator.&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;param&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;name="inForm"&amp;gt;Completed&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;InputForm&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;with&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;user&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;entry.&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;param&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;returns&amp;gt;Nullable&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;value:&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;double.&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;returns&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;public&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;static&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;explicit&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;operator&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;double&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;?&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;(InputForm&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;inForm)&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;{&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;if&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;(inForm.StringValue&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;==&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;string.Empty)&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;return&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;null;&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;try&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;{&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;return&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;double.Parse(inForm.StringValue);&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;}&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;catch&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;{&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;return&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;null;&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;}&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;}&lt;/span&gt;
&amp;nbsp;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Typecasting&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;operator.&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;param&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;name="inForm"&amp;gt;Completed&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;InputForm&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;with&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;user&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;entry.&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;param&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;returns&amp;gt;Nullable&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;value:&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;int.&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;returns&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;public&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;static&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;explicit&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;operator&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;int&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;?&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;(InputForm&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;inForm)&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;{&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;if&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;(inForm.StringValue&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;==&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;string.Empty)&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;return&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;null;&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;try&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;{&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;return&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Int32.Parse(inForm.StringValue);&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;}&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;catch&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;{&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;return&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;null;&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;}&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;}&lt;/span&gt;
&amp;nbsp;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Typecasting&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;operator.&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;param&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;name="inForm"&amp;gt;Completed&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;InputForm&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;with&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;user&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;entry.&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;param&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;returns&amp;gt;Nullable&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;value:&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;long.&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;returns&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;public&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;static&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;explicit&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;operator&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;long&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;?&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;(InputForm&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;inForm)&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;{&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;if&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;(inForm.StringValue&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;==&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;string.Empty)&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;return&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;null;&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;try&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;{&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;return&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Int64.Parse(inForm.StringValue);&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;}&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;catch&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;{&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;return&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;null;&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;}&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;}&lt;/span&gt;
&amp;nbsp;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Typecasting&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;operator.&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;param&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;name="inForm"&amp;gt;Completed&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;InputForm&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;with&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;user&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;entry.&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;param&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;returns&amp;gt;String&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;value.&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;returns&amp;gt;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;public&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;static&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;explicit&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;operator&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;string(InputForm&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;inForm)&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;{&lt;/span&gt;
        &lt;span class="code-SummaryComment"&gt;return&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;inForm.StringValue;&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;}&lt;/span&gt;
&amp;nbsp;
    &lt;span class="code-SummaryComment"&gt;#endregion&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Typecasting&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;Operators&lt;/span&gt;
&lt;span class="code-SummaryComment"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/pre&gt;</description>
      <link>http://www.codeproject.com/Messages/4085104/For-peer-review-InputBox.aspx</link>
      <author>Timothy CIAN</author>
      <pubDate>Tue, 22 Nov 2011 20:06:00 GMT</pubDate>
      <subject>Clever Code</subject>
    </item>
    <item>
      <title>ProjectEuler problem 24 solution - in PDP/8 assembly language</title>
      <description>I solved this in PDP/8 assembly language PAL/8. It's a brute force loop unrolled for the /8. The answer is in octal so don't panic.&lt;br /&gt;
&lt;pre lang="text"&gt;
.PAL E24,E24&amp;lt;E24/G
&amp;nbsp;
HALT instruction, PC: 00442 (JMP I 443)
sim&amp;gt; E 20:31    / examine the answer
20:     0002
21:     0007
22:     0010
23:     0003
24:     0011
25:     0001
26:     0005
27:     0004
30:     0006
31:     0000
sim&amp;gt; G 7600     /  back to the monitor
.
&lt;/pre&gt;
&amp;nbsp;&lt;br /&gt;
Recent work for $(DAYJOB) has triggered memories of PDP/8, PAL/8, OS/8, FOTP, PIP, ODT, and the whole suite of stuff from the dark ages [1]. Here's my source code listing:&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;pre lang="text"&gt;
.TYPE E24.LS
&amp;nbsp;
/ PROJECTEULER.NET PROBLEM 24             PAL8-V12B 02-NOV-77 PAGE 1
&amp;nbsp;
             / PROJECTEULER.NET PROBLEM 24
             /
             / A PERMUTATION IS AN ORDERED ARRANGEMENT OF OBJECTS.
             / FOR EXAMPLE, 3124 IS ONE POSSIBLE PERMUTATION OF
             / THE DIGITS 1, 2, 3 AND 4. IF ALL OF THE PERMUTATIONS
             / ARE LISTED NUMERICALLY OR ALPHABETICALLY,
             / WE CALL IT LEXICOGRAPHIC ORDER.
             / THE LEXICOGRAPHIC PERMUTATIONS OF 0, 1 AND 2 ARE:
             /
             /     012   021   102   120   201   210
             /
             / WHAT IS THE MILLIONTH LEXICOGRAPHIC PERMUTATION
             / OF THE DIGITS 0, 1, 2, 3, 4, 5, 6, 7, 8 AND 9?
             /
             / PAL/8 DIGITAL EQUIPMENT CORPORATION (DEC) PDP/8
             / ASSEMBLY LANGUAGE SOLUTION BY CHUCK ROLKE, 2-NOV-2011
             /
       0010          *10
00010  0000  CHKPTR, 0
&amp;nbsp;
       0020          *20
                                             / SOLUTION IS CONSTRUCTED HERE
00020  0000  D0,     0
00021  0000  D1,     0
00022  0000  D2,     0
00023  0000  D3,     0
00024  0000  D4,     0
00025  0000  D5,     0
00026  0000  D6,     0
00027  0000  D7,     0
00030  0000  D8,     0
00031  0000  D9,     0
                                             / COUNTERS
00032  0000  C0,     0
00033  0000  C1,     0
00034  0000  C2,     0
00035  0000  C3,     0
00036  0000  C4,     0
00037  0000  C5,     0
00040  0000  C6,     0
00041  0000  C7,     0
00042  0000  C8,     0
00043  0000  C9,     0
                                             / SUBR POINTERS
00044  0202  PTR0,   S0
00045  0215  PTR1,   S1
00046  0233  PTR2,   S2
00047  0251  PTR3,   S3
00050  0267  PTR4,   S4
00051  0305  PTR5,   S5
00052  0323  PTR6,   S6
00053  0341  PTR7,   S7
00054  0400  PTR8,   S8
00055  0416  PTR9,   S9
                                             / SEARCH COUNT
&amp;nbsp;
/ PROJECTEULER.NET PROBLEM 24             PAL8-V12B 02-NOV-77 PAGE 1-1
&amp;nbsp;
00056  6700  CLO,    6700                    / -1000000  LOW 12 BITS
00057  7413  CHI,    7413                    / -1000000 HIGH 12 BITS
&amp;nbsp;
00060  0017  PD0M1,  D0-1                    / AUTOINCREMENT PTR TO D0
00061  7766  KM10,   -12                     / MINUS 10.
&amp;nbsp;
             /
             / CHK - IS A DIGIT USED YET?
             /       RETURN AC==0 YES, DIGIT IN USE
             /              AC!=0  NO, DIGIT IS AVAILABLE TO USE
00062  0000  CHK,    0
00063  7200          CLA                     / AC=0
00064  1462          TAD I   CHK             / GET ADDRESS OF DIGIT TO TEST FO
00065  2062          ISZ     CHK
00066  3110          DCA     CHKTP           / SAVE TEST DIGIT ADDRESS
00067  1510          TAD I   CHKTP           / READ THE DIGIT
00070  7041          CIA                     / NEGATE IT
00071  3110          DCA     CHKTP           / SAVE TEST VALUE
00072  1462          TAD I   CHK             / GET NEGATIVE NUMBER OF DIGITS
00073  2062          ISZ     CHK
00074  3111          DCA     CHKCNT          / SAVE COUNT
00075  1060          TAD     PD0M1           / GET ADDRESS OF FIRST DIGIT
00076  3010          DCA     CHKPTR          / SAVE ADDRESS OF DIGIT TO TEST
00077  7200  CHKL,   CLA                     / AC=0
00100  1410          TAD I   CHKPTR          / READ NEXT DIGIT TO TEST
00101  1110          TAD     CHKTP           / COMPARE TO VALUE TO TEST
00102  7450          SNA                     / SKIP IF VALUE TEST FAILS
00103  5462          JMP I   CHK             / RETURN 0 IF DIGIT IN USE
00104  2111          ISZ     CHKCNT          / COUNT DIGITS TESTED
00105  5077          JMP     CHKL            / JUMP TO TEST NEXT
00106  7240          CLA CMA                 / SET TO NONZERO
00107  5462          JMP I   CHK             / RETURN NZ AS DIGIT IS UNUSED
00110  0000  CHKTP,  0                       / PTR TO AND VAL OF DIGIT TO TEST
00111  0000  CHKCNT, 0                       / NEGATIVE COUNT OF DIGITS TO TES
&amp;nbsp;
       0200          *200
                                             / MAIN ENTRY POINT
00200  4444  START,  JMS I   PTR0            / CALL SOLUTION ENGINE
00201  7402          HLT                     / UH, OH. NO SOLUTION FOUND.
&amp;nbsp;
                                             / S0 - SOLVE DIGIT D0
00202  0000  S0,     0
00203  7402          HLT
00204  7200          CLA
00205  3020          DCA     D0
00206  1061          TAD     KM10
00207  3032          DCA     C0
00210  4445  S0L,    JMS I   PTR1
00211  2020          ISZ     D0
00212  2032          ISZ     C0
00213  5210          JMP     S0L
00214  5602          JMP I   S0
&amp;nbsp;
                                             / S1 - SOLVE DIGIT D1
00215  0000  S1,     0
&amp;nbsp;
/ PROJECTEULER.NET PROBLEM 24             PAL8-V12B 02-NOV-77 PAGE 1-2
&amp;nbsp;
00216  7200          CLA
00217  3021          DCA     D1
00220  1061          TAD     KM10
00221  3033          DCA     C1
00222  4062  S1L,    JMS     CHK
00223  0021          D1
00224  7777          -1
00225  7440          SZA
00226  4446          JMS I   PTR2
00227  2021          ISZ     D1
00230  2033          ISZ     C1
00231  5222          JMP     S1L
00232  5615          JMP I   S1
&amp;nbsp;
                                             / S2 - SOLVE DIGIT D2
00233  0000  S2,     0
00234  7200          CLA
00235  3022          DCA     D2
00236  1061          TAD     KM10
00237  3034          DCA     C2
00240  4062  S2L,    JMS     CHK
00241  0022          D2
00242  7776          -2
00243  7440          SZA
00244  4447          JMS I   PTR3
00245  2022          ISZ     D2
00246  2034          ISZ     C2
00247  5240          JMP     S2L
00250  5633          JMP I   S2
&amp;nbsp;
                                             / S3 - SOLVE DIGIT D3
00251  0000  S3,     0
00252  7200          CLA
00253  3023          DCA     D3
00254  1061          TAD     KM10
00255  3035          DCA     C3
00256  4062  S3L,    JMS     CHK
00257  0023          D3
00260  7775          -3
00261  7440          SZA
00262  4450          JMS I   PTR4
00263  2023          ISZ     D3
00264  2035          ISZ     C3
00265  5256          JMP     S3L
00266  5651          JMP I   S3
                                             / S4 - SOLVE DIGIT D4
00267  0000  S4,     0
00270  7200          CLA
00271  3024          DCA     D4
00272  1061          TAD     KM10
00273  3036          DCA     C4
00274  4062  S4L,    JMS     CHK
00275  0024          D4
00276  7774          -4
00277  7440          SZA
&amp;nbsp;
/ PROJECTEULER.NET PROBLEM 24             PAL8-V12B 02-NOV-77 PAGE 1-3
&amp;nbsp;
00300  4451          JMS I   PTR5
00301  2024          ISZ     D4
00302  2036          ISZ     C4
00303  5274          JMP     S4L
00304  5667          JMP I   S4
&amp;nbsp;
                                             / S5 - SOLVE DIGIT D5
00305  0000  S5,     0
00306  7200          CLA
00307  3025          DCA     D5
00310  1061          TAD     KM10
00311  3037          DCA     C5
00312  4062  S5L,    JMS     CHK
00313  0025          D5
00314  7773          -5
00315  7440          SZA
00316  4452          JMS I   PTR6
00317  2025          ISZ     D5
00320  2037          ISZ     C5
00321  5312          JMP     S5L
00322  5705          JMP I   S5
&amp;nbsp;
                                             / S6 - SOLVE DIGIT D6
00323  0000  S6,     0
00324  7200          CLA
00325  3026          DCA     D6
00326  1061          TAD     KM10
00327  3040          DCA     C6
00330  4062  S6L,    JMS     CHK
00331  0026          D6
00332  7772          -6
00333  7440          SZA
00334  4453          JMS I   PTR7
00335  2026          ISZ     D6
00336  2040          ISZ     C6
00337  5330          JMP     S6L
00340  5723          JMP I   S6
&amp;nbsp;
                                             / S7 - SOLVE DIGIT D7
00341  0000  S7,     0
00342  7200          CLA
00343  3027          DCA     D7
00344  1061          TAD     KM10
00345  3041          DCA     C7
00346  4062  S7L,    JMS     CHK
00347  0027          D7
00350  7771          -7
00351  7440          SZA
00352  4454          JMS I   PTR8
00353  2027          ISZ     D7
00354  2041          ISZ     C7
00355  5346          JMP     S7L
00356  5741          JMP I   S7
&amp;nbsp;
       0400          *400
&amp;nbsp;
/ PROJECTEULER.NET PROBLEM 24             PAL8-V12B 02-NOV-77 PAGE 1-4
&amp;nbsp;
                                             / S8 - SOLVE DIGIT D8
00400  0000  S8,     0
00401  7200          CLA
00402  3030          DCA     D8
00403  1061          TAD     KM10
00404  3042          DCA     C8
00405  4062  S8L,    JMS     CHK
00406  0030          D8
00407  7770          -10
00410  7440          SZA
00411  4455          JMS I   PTR9
00412  2030          ISZ     D8
00413  2042          ISZ     C8
00414  5205          JMP     S8L
00415  5600          JMP I   S8
&amp;nbsp;
                                             / S9 - SOLVE DIGIT D9
00416  0000  S9,     0
00417  7200          CLA
00420  3031          DCA     D9
00421  1061          TAD     KM10
00422  3043          DCA     C9
00423  4062  S9L,    JMS     CHK
00424  0031          D9
00425  7767          -11
00426  7440          SZA
00427  4234          JMS     TESTD
00430  2031          ISZ     D9
00431  2043          ISZ     C9
00432  5223          JMP     S9L
00433  5616          JMP I   S9
                                             / TESTD - ANOTHER ITER COMPLETE
00434  0000  TESTD,  0
00435  2056          ISZ     CLO
00436  5634          JMP I   TESTD
00437  2057          ISZ     CHI
00440  5634          JMP I   TESTD
                                             / 1,000,000TH FOUND
00441  7402          HLT
&amp;nbsp;
00442  5643          JMP I   MON
00443  7600  MON,    7600
             $
&amp;nbsp;
/ PROJECTEULER.NET PROBLEM 24             PAL8-V12B 02-NOV-77 PAGE 2
&amp;nbsp;
CHI    0057      S7     0341
CHK    0062      S7L    0346
CHKCNT 0111      S8     0400
CHKL   0077      S8L    0405
CHKPTR 0010      S9     0416
CHKTP  0110      S9L    0423
CLO    0056      TESTD  0434
C0     0032
C1     0033
C2     0034
C3     0035
C4     0036
C5     0037
C6     0040
C7     0041
C8     0042
C9     0043
D0     0020
D1     0021
D2     0022
D3     0023
D4     0024
D5     0025
D6     0026
D7     0027
D8     0030
D9     0031
KM10   0061
MON    0443
PD0M1  0060
PTR0   0044
PTR1   0045
PTR2   0046
PTR3   0047
PTR4   0050
PTR5   0051
PTR6   0052
PTR7   0053
PTR8   0054
PTR9   0055
START  0200
S0     0202
S0L    0210
S1     0215
S1L    0222
S2     0233
S2L    0240
S3     0251
S3L    0256
S4     0267
S4L    0274
S5     0305
S5L    0312
S6     0323
S6L    0330
&amp;nbsp;

&amp;nbsp;
ERRORS DETECTED: 0
LINKS GENERATED: 0
&lt;/pre&gt;
&amp;nbsp;&lt;br /&gt;
[1] &lt;br /&gt;
* Note the listing year is '77'. OS/8 had too few bits for the year field, way ahead of its time.&lt;br /&gt;
* Octal?&lt;br /&gt;
* All upper case - we're talking teletypes, my friends.&lt;br /&gt;
* I coded one routine with the classic dense comments. The rest - you're on your own.&lt;br /&gt;
* There's no self modifying code. I'm a purist. Would Atlant approve?&lt;br /&gt;
* My real PDP/8-M died a few years back. Coded on Mr. Bob Supnic's simulator.</description>
      <link>http://www.codeproject.com/Messages/4070231/ProjectEuler-problem-24-solution-in-PDP-8-assembly.aspx</link>
      <author>MrChug</author>
      <pubDate>Fri, 04 Nov 2011 17:09:00 GMT</pubDate>
      <subject>Clever Code</subject>
    </item>
    <item>
      <title>Extract from Jigsaw</title>
      <description>This is an extract from the 'Implementing Programming Languages using C# 4.0'  article published last week (late oct 2011)&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
Some of the code really blow my mind.&lt;br /&gt;
This code works, but how on earth does it work?&lt;br /&gt;
I need to spend spend some time on this.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;pre lang="c#"&gt;
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;delegate&lt;/span&gt; Lambda Lambda(Lambda x);
&amp;nbsp;
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda Id         = x =&amp;gt; x;
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda Zero       = f =&amp;gt; x =&amp;gt; x;
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda True       = x =&amp;gt; y =&amp;gt; x;
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda False      = x =&amp;gt; y =&amp;gt; y;
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda One        = f =&amp;gt; x =&amp;gt; f(x);
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda Two        = f =&amp;gt; x =&amp;gt; f(f(x));
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda Succ       = n =&amp;gt; f =&amp;gt; x =&amp;gt; f(n(f)(x));
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda Three      = Succ(Two);
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda Pred       = n =&amp;gt; f =&amp;gt; x =&amp;gt; n(g =&amp;gt; h =&amp;gt; h(g(f)))(u =&amp;gt; x)(Id);
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda Plus       = m =&amp;gt; n =&amp;gt; f =&amp;gt; x =&amp;gt; m(f)(n(f)(x));
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda Sub        = m =&amp;gt; n =&amp;gt; n (Pred) (m);
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda And        = p =&amp;gt; q =&amp;gt; p(q)(p);
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda Or         = p =&amp;gt; q =&amp;gt; p(p)(q);
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda Not        = p =&amp;gt; a =&amp;gt; b =&amp;gt; p(b)(a);
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda IfThenElse = p =&amp;gt; a =&amp;gt; b =&amp;gt; p(a)(b);
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda IsZero     = n =&amp;gt; n(x =&amp;gt; False)(True);
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda IsLtEqOne  = n =&amp;gt; IsZero(Pred(n));
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda Pair       = x =&amp;gt; y =&amp;gt; f =&amp;gt; f(x)(y);
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda First      = pair =&amp;gt; pair(True);
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda Second     = pair =&amp;gt; pair(False);
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda Nil        = x =&amp;gt; True;
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda Null       = p =&amp;gt; p(x =&amp;gt; y =&amp;gt; False);
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda LtEq       = x =&amp;gt; y =&amp;gt; IsZero(Sub(x)(y));
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda Gt         = x =&amp;gt; y =&amp;gt; LtEq(y)(x);
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Lambda Eq         = x =&amp;gt; y =&amp;gt; And(LtEq(x)(y))(LtEq(y)(x));&lt;/pre&gt;</description>
      <link>http://www.codeproject.com/Messages/4067634/Extract-from-Jigsaw.aspx</link>
      <author>Pascal Ganaye</author>
      <pubDate>Wed, 02 Nov 2011 10:00:00 GMT</pubDate>
      <subject>Clever Code</subject>
    </item>
    <item>
      <title>Simple Camera Tethering Using WIA</title>
      <description>I'm a freelance studio/event photographer. For years I've had to use often expensive and complex software to tether my cameras to my laptop. I needed a fast, lightweight tool to do the job without all the cumbersome tools, so as the saying goes "if you want it done right, do it yourself". Here is a quick and simple framework for tethering Nikon cameras with near instant file transfer and image viewing. This is just a vb.net framework and should be modified to suit your taste. Have fun...&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Imports WIA&lt;br /&gt;Imports System.Runtime.InteropServices&lt;br /&gt;Imports System.Environment&lt;br /&gt;Imports System.IO&lt;br /&gt;&amp;nbsp;&lt;br /&gt;'Add reference to wiaaut.dll located in \Windows\System32&lt;br /&gt;'Add Panel1 with Dock=Fill and BackgroundImage=Zoom&lt;br /&gt;'Form1.text = Waiting...&lt;br /&gt;&amp;nbsp;&lt;br /&gt;Public Class Form1&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; Public Const wiaEventItemCreated = "{4C8F4EF5-E14F-11D2-B326-00C04F68CE61}"&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; Public Const wiaEventDeviceConnected = "{A28BBADE-64B6-11D2-A231-00C04FA31809}"&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; Public Const wiaEventDeviceDisconnected = "{143E4E83-6497-11D2-A231-00C04FA31809}"&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; Public WIA_Dialog As New WIA.CommonDialog&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; Public WIA_DeviceMgr As New WIA.DeviceManager&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; Public WIA_Device As WIA.Device&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; WIA_DeviceMgr.RegisterEvent(wiaEventItemCreated, "*")&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; WIA_DeviceMgr.RegisterEvent(wiaEventDeviceConnected, "*")&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; WIA_DeviceMgr.RegisterEvent(wiaEventDeviceDisconnected, "*")&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; AddHandler WIA_DeviceMgr.OnEvent, AddressOf Me.WIA_OnEvent&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; End Sub&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; Private Sub WIA_OnEvent(ByVal EventID As String, ByVal DeviceID As String, ByVal ItemId As String)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; Dim device As String&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; If EventID = wiaEventDeviceConnected Then&lt;br /&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; Try&lt;br /&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; 'set param2 to False to automatically select the device&lt;br /&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; 'set param2 to True to show device select dialog&lt;br /&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; WIA_Device = WIA_Dialog.ShowSelectDevice(WiaDeviceType.CameraDeviceType, False, True)&lt;br /&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; 'display device information&lt;br /&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; device = "Connected To "&lt;br /&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; For Each prop As WIA.Property In WIA_Device.Properties&lt;br /&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; Select Case prop.Name&lt;br /&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;&amp;nbsp; Case "Manufacturer"&lt;br /&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;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; device += prop.Value.ToString &amp;amp; " "&lt;br /&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;&amp;nbsp; Case "Description"&lt;br /&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;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; device += prop.Value.ToString&lt;br /&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; End Select&lt;br /&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; Next&lt;br /&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; Me.Text = device&lt;br /&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; Catch ex As Exception&lt;br /&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; Debug.WriteLine("Error Connecting To Camera")&lt;br /&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; End Try&lt;br /&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; Exit Sub&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; If EventID = wiaEventDeviceDisconnected Then&lt;br /&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; Me.Text = "Waiting..."&lt;br /&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; Me.Panel1.BackgroundImage = Nothing&lt;br /&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; Exit Sub&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; If EventID = wiaEventItemCreated Then&lt;br /&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; Me.Panel1.BackgroundImage = Nothing&lt;br /&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; Dim itm As Item = WIA_Device.GetItem(ItemId)&lt;br /&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; Dim img As ImageFile = itm.Transfer&lt;br /&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; Dim fname As String = "C:\Temp\" &amp;amp; itm.Properties("Item Name").Value &amp;amp; "." &amp;amp; img.FileExtension&lt;br /&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; img.SaveFile(fname)&lt;br /&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; Me.Panel1.BackgroundImage = Image.FromFile(fname)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; End Sub&lt;br /&gt;&amp;nbsp;&lt;br /&gt;End Class</description>
      <link>http://www.codeproject.com/Messages/4065107/Simple-Camera-Tethering-Using-WIA.aspx</link>
      <author>gmillwater</author>
      <pubDate>Sat, 29 Oct 2011 19:04:00 GMT</pubDate>
      <subject>Clever Code</subject>
    </item>
    <item>
      <title>Strange</title>
      <description>Today I just noticed that generally:&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
power(rand(),2) &amp;gt; rand()*rand() &lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Practically in excel&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
rand() * rand() average is 1/4&lt;br /&gt;
rand()^2 average is 1/3&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
It blows my mind.</description>
      <link>http://www.codeproject.com/Messages/4062532/Strange.aspx</link>
      <author>Pascal Ganaye</author>
      <pubDate>Wed, 26 Oct 2011 13:53:00 GMT</pubDate>
      <subject>Clever Code</subject>
    </item>
    <item>
      <title>NTFS, win7 and 20 million files</title>
      <description>Hi,&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
I'm about to begin a small project in which I must be able to store and lookup up to 20. mio. files - in the best possible way. Needless to say fast.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
For this I have been around -&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
http://en.wikipedia.org/wiki/NTFS#Limitations&lt;br /&gt;
http://www.ntfs.com/ntfs_vs_fat.htm&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
And now my question: Dealing with a production load in the area around 60.000 files (=pictures) per day each around 300 kb in size, what would be the best ratio of what number of files in what number of directorys to make the search-time best? Obviously I do not put all the files in one directory, but in a number of dir's. So what would be the best economy for such a thing?&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
Seems to be hard to find information about on the web.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Thanx' in advance,&lt;br /&gt;
Kind regards,&lt;br /&gt;
&lt;div class="signature"&gt;Michael Pauli&lt;/div&gt;</description>
      <link>http://www.codeproject.com/Messages/4018820/NTFS-win7-and-20-million-files.aspx</link>
      <author>Michael Pauli</author>
      <pubDate>Fri, 09 Sep 2011 10:31:00 GMT</pubDate>
      <subject>Clever Code</subject>
    </item>
    <item>
      <title>The quest for fastest strstr-like function in C</title>
      <description>Hi to all C programmers,&lt;br /&gt;
my desire is with help of more experienced guys/girls to boost the following function:&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;pre&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; ### Mix(2in1) of Karp-Rabin &amp;amp; Boyer-Moore-Horspool algorithm [
&lt;/span&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Caution: For better speed the case 'if (cbPattern==1)' was removed, so Pattern must be longer than 1 char.
&lt;/span&gt;&lt;span class="code-keyword"&gt;char&lt;/span&gt; * Railgun_Quadruplet (&lt;span class="code-keyword"&gt;char&lt;/span&gt; * pbTarget,
     &lt;span class="code-keyword"&gt;char&lt;/span&gt; * pbPattern,
     unsigned &lt;span class="code-keyword"&gt;long&lt;/span&gt; cbTarget,
     unsigned &lt;span class="code-keyword"&gt;long&lt;/span&gt; cbPattern)
{
    &lt;span class="code-keyword"&gt;char&lt;/span&gt; * pbTargetMax = pbTarget + cbTarget;
    register unsigned &lt;span class="code-keyword"&gt;long&lt;/span&gt;  ulHashPattern;
    unsigned &lt;span class="code-keyword"&gt;long&lt;/span&gt; ulHashTarget;
    unsigned &lt;span class="code-keyword"&gt;long&lt;/span&gt; count;
    unsigned &lt;span class="code-keyword"&gt;long&lt;/span&gt; countSTATIC;
&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;  unsigned long countRemainder;
&lt;/span&gt;
&lt;span class="code-comment"&gt;/*&lt;/span&gt;&lt;span class="code-comment"&gt;
    const unsigned char SINGLET = *(char *)(pbPattern);
    const unsigned long Quadruplet2nd = SINGLET&amp;lt;&amp;lt;8;
    const unsigned long Quadruplet3rd = SINGLET&amp;lt;&amp;lt;16;
    const unsigned long Quadruplet4th = SINGLET&amp;lt;&amp;lt;24;
*/&lt;/span&gt;
    unsigned &lt;span class="code-keyword"&gt;char&lt;/span&gt; SINGLET;
    unsigned &lt;span class="code-keyword"&gt;long&lt;/span&gt; Quadruplet2nd;
    unsigned &lt;span class="code-keyword"&gt;long&lt;/span&gt; Quadruplet3rd;
    unsigned &lt;span class="code-keyword"&gt;long&lt;/span&gt; Quadruplet4th;
&amp;nbsp;
    unsigned &lt;span class="code-keyword"&gt;long&lt;/span&gt;  AdvanceHopperGrass;
&amp;nbsp;
    &lt;span class="code-keyword"&gt;long&lt;/span&gt; i; &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;BMH needed
&lt;/span&gt;    &lt;span class="code-keyword"&gt;int&lt;/span&gt; a, j, bm_bc[ASIZE]; &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;BMH needed
&lt;/span&gt;    unsigned &lt;span class="code-keyword"&gt;char&lt;/span&gt; ch; &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;BMH needed
&lt;/span&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;    unsigned char lastch, firstch; //BMH needed
&lt;/span&gt;
    &lt;span class="code-keyword"&gt;if&lt;/span&gt; (cbPattern &amp;gt; cbTarget)
        &lt;span class="code-keyword"&gt;return&lt;/span&gt;(NULL);
&amp;nbsp;
&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Doesn't work when cbPattern = 1
&lt;/span&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; The next IF-fragment works very well with cbPattern&amp;gt;1, OBVIOUSLY IT MUST BE UNROLLED(but crippled with less functionality) SINCE either cbPattern=2 or cbPattern=3!
&lt;/span&gt;&lt;span class="code-keyword"&gt;if&lt;/span&gt; ( cbPattern&amp;lt;&lt;span class="code-digit"&gt;4&lt;/span&gt;) { &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; This IF makes me unhappy: it slows down from 390KB/clock to 367KB/clock for 'fast' pattern. This fragment(for 2..3 pattern lengths) is needed because I need a function different than strchr but sticking to strstr i.e. lengths above 1 are to be handled.
&lt;/span&gt;        pbTarget = pbTarget+cbPattern;
        ulHashPattern = ( (*(&lt;span class="code-keyword"&gt;char&lt;/span&gt; *)(pbPattern))&amp;lt;&amp;lt;&lt;span class="code-digit"&gt;8&lt;/span&gt; ) + *(pbPattern+(cbPattern-1));
&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;        countSTATIC = cbPattern-2;
&lt;/span&gt;
&lt;span class="code-keyword"&gt;if&lt;/span&gt; ( cbPattern==3) {
    &lt;span class="code-keyword"&gt;for&lt;/span&gt; ( ;; )
    {
        &lt;span class="code-keyword"&gt;if&lt;/span&gt; ( ulHashPattern == ( (*(&lt;span class="code-keyword"&gt;char&lt;/span&gt; *)(pbTarget-3))&amp;lt;&amp;lt;&lt;span class="code-digit"&gt;8&lt;/span&gt; ) + *(pbTarget-1) ) {
         &lt;span class="code-keyword"&gt;if&lt;/span&gt; ( *(&lt;span class="code-keyword"&gt;char&lt;/span&gt; *)(pbPattern+1) == *(&lt;span class="code-keyword"&gt;char&lt;/span&gt; *)(pbTarget-2) ) &lt;span class="code-keyword"&gt;return&lt;/span&gt;((pbTarget-3));
        }
        &lt;span class="code-keyword"&gt;if&lt;/span&gt; ( (&lt;span class="code-keyword"&gt;char&lt;/span&gt;)(ulHashPattern&amp;gt;&amp;gt;8) != *(pbTarget-2) ) pbTarget++;
        pbTarget++;
        &lt;span class="code-keyword"&gt;if&lt;/span&gt; (pbTarget &amp;gt; pbTargetMax)
            &lt;span class="code-keyword"&gt;return&lt;/span&gt;(NULL);
    }
} &lt;span class="code-keyword"&gt;else&lt;/span&gt; {
}
    &lt;span class="code-keyword"&gt;for&lt;/span&gt; ( ;; )
    {
        &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; The line below gives for 'cbPattern'&amp;gt;=1:
&lt;/span&gt;        &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Karp_Rabin_Kaze_4_OCTETS_hits/Karp_Rabin_Kaze_4_OCTETS_clocks: 4/543
&lt;/span&gt;        &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Karp_Rabin_Kaze_4_OCTETS performance: 372KB/clock
&lt;/span&gt;&lt;span class="code-comment"&gt;/*&lt;/span&gt;&lt;span class="code-comment"&gt;
        if ( (ulHashPattern == ( (*(char *)(pbTarget-cbPattern))&amp;lt;&amp;lt;8 ) + *(pbTarget-1)) &amp;amp;&amp;amp; !memcmp(pbPattern, pbTarget-cbPattern, (unsigned int)cbPattern) )
            return((long)(pbTarget-cbPattern));
*/&lt;/span&gt;
&amp;nbsp;
        &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; The fragment below gives for 'cbPattern'&amp;gt;=2:
&lt;/span&gt;        &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Karp_Rabin_Kaze_4_OCTETS_hits/Karp_Rabin_Kaze_4_OCTETS_clocks: 4/546
&lt;/span&gt;        &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Karp_Rabin_Kaze_4_OCTETS performance: 370KB/clock
&lt;/span&gt;
&lt;span class="code-comment"&gt;/*&lt;/span&gt;&lt;span class="code-comment"&gt;
//For 2 and 3 [
        if ( ulHashPattern == ( (*(char *)(pbTarget-cbPattern))&amp;lt;&amp;lt;8 ) + *(pbTarget-1) ) {
//         count = countSTATIC;
         count = cbPattern-2;
//         while ( count &amp;amp;&amp;amp; *(char *)(pbPattern+1+(countSTATIC-count)) == *(char *)(pbTarget-cbPattern+1+(countSTATIC-count)) ) {
         while ( count &amp;amp;&amp;amp; *(char *)(pbPattern+1) == *(char *)(pbTarget-2) ) { // Crippling i.e. only 2 and 3 chars are allowed!
               count--;
         }
         if ( count == 0) return((pbTarget-cbPattern));
        }
        if ( (char)(ulHashPattern&amp;gt;&amp;gt;8) != *(pbTarget-cbPattern+1) ) pbTarget++;
//For 2 and 3 ]
*/&lt;/span&gt;
&amp;nbsp;

        &lt;span class="code-keyword"&gt;if&lt;/span&gt; ( ulHashPattern == ( (*(&lt;span class="code-keyword"&gt;char&lt;/span&gt; *)(pbTarget-2))&amp;lt;&amp;lt;&lt;span class="code-digit"&gt;8&lt;/span&gt; ) + *(pbTarget-1) )
            &lt;span class="code-keyword"&gt;return&lt;/span&gt;((pbTarget-2));
        &lt;span class="code-keyword"&gt;if&lt;/span&gt; ( (&lt;span class="code-keyword"&gt;char&lt;/span&gt;)(ulHashPattern&amp;gt;&amp;gt;8) != *(pbTarget-1) ) pbTarget++;
&amp;nbsp;

        &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; The fragment below gives for 'cbPattern'&amp;gt;=2:
&lt;/span&gt;	&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Karp_Rabin_Kaze_4_OCTETS_hits/Karp_Rabin_Kaze_4_OCTETS_clocks: 4/554
&lt;/span&gt;	&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Karp_Rabin_Kaze_4_OCTETS performance: 364KB/clock
&lt;/span&gt;&lt;span class="code-comment"&gt;/*&lt;/span&gt;&lt;span class="code-comment"&gt;
        if ( ulHashPattern == ( (*(char *)(pbTarget-cbPattern))&amp;lt;&amp;lt;8 ) + *(pbTarget-1) ) {
         count = countSTATIC&amp;gt;&amp;gt;2;
         countRemainder = countSTATIC % 4;
&amp;nbsp;
         while ( count &amp;amp;&amp;amp; *(unsigned long *)(pbPattern+1+((count-1)&amp;lt;&amp;lt;2)) == *(unsigned long *)(pbTarget-cbPattern+1+((count-1)&amp;lt;&amp;lt;2)) ) {
               count--;
         }
	 //if (count == 0) {  // Disastrous degradation only from this line(317KB/clock when 1+2x4+2+1 bytes pattern: 'skillessness'; 312KB/clock when 1+1x4+2+1 bytes pattern: 'underdog'), otherwise 368KB/clock.
         while ( countRemainder &amp;amp;&amp;amp; *(char *)(pbPattern+1+(countSTATIC-countRemainder)) == *(char *)(pbTarget-cbPattern+1+(countSTATIC-countRemainder)) ) {
               countRemainder--;
         }
         //if ( countRemainder == 0) return((long)(pbTarget-cbPattern));
         if ( count+countRemainder == 0) return((long)(pbTarget-cbPattern));
         //}
        }
*/&lt;/span&gt;
&amp;nbsp;
        pbTarget++;
        &lt;span class="code-keyword"&gt;if&lt;/span&gt; (pbTarget &amp;gt; pbTargetMax)
            &lt;span class="code-keyword"&gt;return&lt;/span&gt;(NULL);
    }
} &lt;span class="code-keyword"&gt;else&lt;/span&gt; { &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;if ( cbPattern&amp;lt;4)
&lt;/span&gt;&lt;span class="code-keyword"&gt;if&lt;/span&gt; (cbTarget&amp;lt;&lt;span class="code-digit"&gt;961&lt;/span&gt;) &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; This value is arbitrary(don't know how exactly), it ensures(at least must) better performance than 'Boyer_Moore_Horspool'.
&lt;/span&gt;{
        pbTarget = pbTarget+cbPattern;
        ulHashPattern = *(unsigned &lt;span class="code-keyword"&gt;long&lt;/span&gt; *)(pbPattern);
&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;        countSTATIC = cbPattern-1;
&lt;/span&gt;
    &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;SINGLET = *(char *)(pbPattern);
&lt;/span&gt;    SINGLET = ulHashPattern &amp;amp; 0xFF;
    Quadruplet2nd = SINGLET&amp;lt;&amp;lt;&lt;span class="code-digit"&gt;8&lt;/span&gt;;
    Quadruplet3rd = SINGLET&amp;lt;&amp;lt;&lt;span class="code-digit"&gt;16&lt;/span&gt;;
    Quadruplet4th = SINGLET&amp;lt;&amp;lt;&lt;span class="code-digit"&gt;24&lt;/span&gt;;
&amp;nbsp;
    &lt;span class="code-keyword"&gt;for&lt;/span&gt; ( ;; )
    {
	AdvanceHopperGrass = &lt;span class="code-digit"&gt;0&lt;/span&gt;;
	ulHashTarget = *(unsigned &lt;span class="code-keyword"&gt;long&lt;/span&gt; *)(pbTarget-cbPattern);
&amp;nbsp;
        &lt;span class="code-keyword"&gt;if&lt;/span&gt; ( ulHashPattern == ulHashTarget ) { &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Three unnecessary comparisons here, but 'AdvanceHopperGrass' must be calculated - it has a higher priority.
&lt;/span&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;         count = countSTATIC;
&lt;/span&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;         while ( count &amp;amp;&amp;amp; *(char *)(pbPattern+1+(countSTATIC-count)) == *(char *)(pbTarget-cbPattern+1+(countSTATIC-count)) ) {
&lt;/span&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;	       if ( countSTATIC==AdvanceHopperGrass+count &amp;amp;&amp;amp; SINGLET != *(char *)(pbTarget-cbPattern+1+(countSTATIC-count)) ) AdvanceHopperGrass++;
&lt;/span&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;               count--;
&lt;/span&gt;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;         }
&lt;/span&gt;         count = cbPattern-1;
         &lt;span class="code-keyword"&gt;while&lt;/span&gt; ( count &amp;amp;&amp;amp; *(&lt;span class="code-keyword"&gt;char&lt;/span&gt; *)(pbPattern+(cbPattern-count)) == *(&lt;span class="code-keyword"&gt;char&lt;/span&gt; *)(pbTarget-count) ) {
	       &lt;span class="code-keyword"&gt;if&lt;/span&gt; ( cbPattern-1==AdvanceHopperGrass+count &amp;amp;&amp;amp; SINGLET != *(&lt;span class="code-keyword"&gt;char&lt;/span&gt; *)(pbTarget-count) ) AdvanceHopperGrass++;
               count--;
         }
         &lt;span class="code-keyword"&gt;if&lt;/span&gt; ( count == &lt;span class="code-digit"&gt;0&lt;/span&gt;) &lt;span class="code-keyword"&gt;return&lt;/span&gt;((pbTarget-cbPattern));
        } &lt;span class="code-keyword"&gt;else&lt;/span&gt; { &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; The goal here: to avoid memory accesses by stressing the registers.
&lt;/span&gt;    &lt;span class="code-keyword"&gt;if&lt;/span&gt; ( Quadruplet2nd != (ulHashTarget &amp;amp; 0x0000FF00) ) {
         AdvanceHopperGrass++;
         &lt;span class="code-keyword"&gt;if&lt;/span&gt; ( Quadruplet3rd != (ulHashTarget &amp;amp; 0x00FF0000) ) {
              AdvanceHopperGrass++;
              &lt;span class="code-keyword"&gt;if&lt;/span&gt; ( Quadruplet4th != (ulHashTarget &amp;amp; 0xFF000000) ) AdvanceHopperGrass++;
         }
    }
	}
&amp;nbsp;
	AdvanceHopperGrass++;
&amp;nbsp;
	pbTarget = pbTarget + AdvanceHopperGrass;
        &lt;span class="code-keyword"&gt;if&lt;/span&gt; (pbTarget &amp;gt; pbTargetMax)
            &lt;span class="code-keyword"&gt;return&lt;/span&gt;(NULL);
    }
} &lt;span class="code-keyword"&gt;else&lt;/span&gt; { &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;if (cbTarget&amp;lt;961)
&lt;/span&gt;        countSTATIC = cbPattern-2;
    &lt;span class="code-comment"&gt;/*&lt;/span&gt;&lt;span class="code-comment"&gt; Preprocessing */&lt;/span&gt;
    &lt;span class="code-keyword"&gt;for&lt;/span&gt; (a=0; a &amp;lt; ASIZE; a++) bm_bc[a]=cbPattern;
    &lt;span class="code-keyword"&gt;for&lt;/span&gt; (j=0; j &amp;lt; cbPattern-1; j++) bm_bc[pbPattern[j]]=cbPattern-j-1;
&amp;nbsp;
    &lt;span class="code-comment"&gt;/*&lt;/span&gt;&lt;span class="code-comment"&gt; Searching */&lt;/span&gt;
    &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;lastch=pbPattern[cbPattern-1];
&lt;/span&gt;    &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;firstch=pbPattern[0];
&lt;/span&gt;    i=0;
    &lt;span class="code-keyword"&gt;while&lt;/span&gt; (i &amp;lt;= cbTarget-cbPattern) {
       ch=pbTarget[i+cbPattern-1];
       &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;if (ch ==lastch)
&lt;/span&gt;          &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;if (memcmp(&amp;amp;pbTarget[i],pbPattern,cbPattern-1) == 0) OUTPUT(i);
&lt;/span&gt;          &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;if (ch == lastch &amp;amp;&amp;amp; pbTarget[i] == firstch &amp;amp;&amp;amp; memcmp(&amp;amp;pbTarget[i],pbPattern,cbPattern-1) == 0) return(i);  // Kaze: The idea(to prevent execution of slower 'memcmp') is borrowed from Karp-Rabin i.e. to perform a slower check only when the target "looks like".
&lt;/span&gt;          &lt;span class="code-keyword"&gt;if&lt;/span&gt; (ch == pbPattern[cbPattern-1] &amp;amp;&amp;amp; pbTarget[i] == pbPattern[&lt;span class="code-digit"&gt;0&lt;/span&gt;])
             {
         count = countSTATIC;
         &lt;span class="code-keyword"&gt;while&lt;/span&gt; ( count &amp;amp;&amp;amp; *(&lt;span class="code-keyword"&gt;char&lt;/span&gt; *)(pbPattern+1+(countSTATIC-count)) == *(&lt;span class="code-keyword"&gt;char&lt;/span&gt; *)(&amp;amp;pbTarget[i]+1+(countSTATIC-count)) ) {
               count--;
         }
         &lt;span class="code-keyword"&gt;if&lt;/span&gt; ( count == &lt;span class="code-digit"&gt;0&lt;/span&gt;) &lt;span class="code-keyword"&gt;return&lt;/span&gt;(pbTarget+i);
	     }
       i+=bm_bc[ch];
    }
    &lt;span class="code-keyword"&gt;return&lt;/span&gt;(NULL);
} &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;if (cbTarget&amp;lt;961)
&lt;/span&gt;} &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;if ( cbPattern&amp;lt;4)
&lt;/span&gt;}
&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; ### Mix(2in1) of Karp-Rabin &amp;amp; Boyer-Moore-Horspool algorithm ]&lt;/span&gt;&lt;/pre&gt;
&amp;nbsp;&lt;br /&gt;
There are tricky and slippery drawbacks as which compiler is used and what options are used. My tests show that this revision (6+) is fastest when Microsoft C v16 (from VisualStudio 2010) is used - it outperforms even the powerful Intel C v12, no joke here.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
I would be really glad for any suggestions or ideas how to speed up more the Railgun_Quadruplet.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
Oh, I forgot to give the homepage with my latest benchmarks:&lt;br /&gt;
&lt;a href="http://www.sanmayce.com/Railgun/index.html"&gt;http://www.sanmayce.com/Railgun/index.html&lt;/a&gt;[&lt;a href="http://www.sanmayce.com/Railgun/index.html" target="_blank" title="New Window"&gt;^&lt;/a&gt;]</description>
      <link>http://www.codeproject.com/Messages/4013144/The-quest-for-fastest-strstr-like-function-in-C.aspx</link>
      <author>Sanmayce</author>
      <pubDate>Fri, 02 Sep 2011 17:15:00 GMT</pubDate>
      <subject>Clever Code</subject>
    </item>
    <item>
      <title>My Far Call</title>
      <description>Windows at Red Hat: my far call.&lt;br /&gt;
Seek, climb, ponder, fall, more joy unfound.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
Hack stack-tracker before halls template&lt;ofgold&gt;.&lt;br /&gt;
Wandering, wondering at core's cold binding lure.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
Helpless room full of empty pages make boost.&lt;br /&gt;
Style accepted by an eye trained on goals unseen.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
Life newly constructed sees not both heaps.&lt;br /&gt;
Heaven's world attached keeps a .NET brother.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
Unspoken languages, who speaks now? QA checks.&lt;br /&gt;
Hear how dear kits near appear. Who speaks now?&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
Unfolding world's new day sees team progress.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
In its gut life passes by: WinSDK.&lt;br /&gt;
&lt;div class="signature"&gt;They will never have seen anything like us them there. - M. Spirito&lt;/div&gt;&lt;/ofgold&gt;</description>
      <link>http://www.codeproject.com/Messages/4012096/My-Far-Call.aspx</link>
      <author>MrChug</author>
      <pubDate>Fri, 02 Sep 2011 01:42:00 GMT</pubDate>
      <subject>Clever Code</subject>
    </item>
    <item>
      <title>Queue through all files in a directory (and subdirectories).</title>
      <description>Here is an easy way to queue all files in a folder (and subfolders).  You only need to initialize it with &lt;code&gt;_folders.Enqueue(SomeRootDirectoryInfo);&lt;/code&gt; before using it...&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;pre lang="c#"&gt;
&lt;span class="code-keyword"&gt;private&lt;/span&gt; Queue&amp;lt;DirectoryInfo&amp;gt; _folders = &lt;span class="code-keyword"&gt;new&lt;/span&gt; Queue&amp;lt;DirectoryInfo&amp;gt;();
&lt;span class="code-keyword"&gt;private&lt;/span&gt; Queue&amp;lt;FileInfo&amp;gt; _files = &lt;span class="code-keyword"&gt;new&lt;/span&gt; Queue&amp;lt;FileInfo&amp;gt;();
&lt;/pre&gt;
&lt;pre lang="c#"&gt;
&lt;span class="code-keyword"&gt;public&lt;/span&gt; FileInfo NextFile
{
    &lt;span class="code-keyword"&gt;get&lt;/span&gt;
    {
        &lt;span class="code-keyword"&gt;lock&lt;/span&gt; (_files)
        {
            &lt;span class="code-keyword"&gt;if&lt;/span&gt; (_files.Count != &lt;span class="code-digit"&gt;0&lt;/span&gt;)
                &lt;span class="code-keyword"&gt;return&lt;/span&gt; _files.Dequeue();
            &lt;span class="code-keyword"&gt;else&lt;/span&gt;
            {
                &lt;span class="code-keyword"&gt;lock&lt;/span&gt; (_folders)
                {
                    &lt;span class="code-keyword"&gt;while&lt;/span&gt; (_folders.Count != &lt;span class="code-digit"&gt;0&lt;/span&gt;)
                    {
                        DirectoryInfo dir = _folders.Dequeue();
                        &lt;span class="code-keyword"&gt;foreach&lt;/span&gt; (DirectoryInfo d &lt;span class="code-keyword"&gt;in&lt;/span&gt; dir.GetDirectories())
                            _folders.Enqueue(d);
                        &lt;span class="code-keyword"&gt;foreach&lt;/span&gt; (FileInfo f &lt;span class="code-keyword"&gt;in&lt;/span&gt; dir.GetFiles()) 
                            _files.Enqueue(f);
                        &lt;span class="code-keyword"&gt;if&lt;/span&gt; (_files.Count != &lt;span class="code-digit"&gt;0&lt;/span&gt;) &lt;span class="code-keyword"&gt;return&lt;/span&gt; _files.Dequeue();
                    }
                }
            }
        }
        &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;null&lt;/span&gt;;  &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;Default
&lt;/span&gt;    }
}
&lt;/pre&gt;</description>
      <link>http://www.codeproject.com/Messages/3991365/Queue-through-all-files-in-a-directory-and-subdire.aspx</link>
      <author>Timothy CIAN</author>
      <pubDate>Fri, 12 Aug 2011 14:33:00 GMT</pubDate>
      <subject>Clever Code</subject>
    </item>
    <item>
      <title>Comment Switching</title>
      <description>I have a static string which I am constantly switch to a known value for debugging. But now I have come up with something that saves me 3 key strokes!!!&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
consider...&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;pre lang="c#"&gt;&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; &lt;span class="code-keyword"&gt;string&lt;/span&gt; MyString = &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;"&lt;/span&gt;;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;@"DEBUG VALUE";&lt;/span&gt;&lt;/pre&gt;
&amp;nbsp;&lt;br /&gt;
...I was constantly deleting &lt;pre lang="c#"&gt;&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;"&lt;/span&gt;;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;&lt;/span&gt;&lt;/pre&gt; and re-adding for each toggle. Now I have changed to this...&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;pre lang="c#"&gt;&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; &lt;span class="code-keyword"&gt;string&lt;/span&gt; MyString = &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;"&lt;/span&gt;;&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;*/@"DEBUG VALUE";&lt;/span&gt;&lt;/pre&gt;
&amp;nbsp;&lt;br /&gt;
...now I just need to add/remove &lt;pre lang="c#"&gt;&lt;span class="code-comment"&gt;/*&lt;/span&gt;&lt;span class="code-comment"&gt;&lt;/span&gt;&lt;/pre&gt; each time to toggle the value...&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;pre lang="c#"&gt;&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; &lt;span class="code-keyword"&gt;string&lt;/span&gt; MyString = &lt;span class="code-comment"&gt;/*&lt;/span&gt;&lt;span class="code-comment"&gt;"";//*/&lt;/span&gt;&lt;span class="code-string"&gt;@"&lt;/span&gt;&lt;span class="code-string"&gt;DEBUG VALUE"&lt;/span&gt;;&lt;/pre&gt;
&amp;nbsp;&lt;br /&gt;
result!  &lt;img src="/script/Forums/Images/smiley_laugh.gif" align="top" alt="Laugh | :laugh:" /&gt;  &lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
...and I don't want to hear about your #DEBUG comments&lt;br /&gt;
&lt;div class="signature"&gt;My opinions are right, and yours are wrong! (or at least that is my opinion)&lt;/div&gt;</description>
      <link>http://www.codeproject.com/Messages/3983549/Comment-Switching.aspx</link>
      <author>musefan</author>
      <pubDate>Fri, 05 Aug 2011 14:52:00 GMT</pubDate>
      <subject>Clever Code</subject>
    </item>
    <item>
      <title>MatchList</title>
      <description>&lt;pre lang="c#"&gt;
    &lt;span class="code-SummaryComment"&gt;///&lt;/span&gt;
    &lt;span class="code-comment"&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;summary&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;///&lt;/span&gt;
    &lt;span class="code-comment"&gt; Compares two lists to ensure that they match without duplication.
&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;///&lt;/span&gt;
    &lt;span class="code-comment"&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;summary&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;///&lt;/span&gt;
    &lt;span class="code-comment"&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;typeparam&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;name="T"&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;&amp;gt;&lt;/span&gt;Generic Type; string, DateTime, int etc.&lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;typeparam&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;///&lt;/span&gt;
    &lt;span class="code-comment"&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;param&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;name="List1"&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;&amp;gt;&lt;/span&gt;First list to compare.&lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;param&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;///&lt;/span&gt;
    &lt;span class="code-comment"&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;param&lt;/span&gt; &lt;span class="code-SummaryComment"&gt;name="List2"&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;&amp;gt;&lt;/span&gt;Second list to compare.&lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;param&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;///&lt;/span&gt;
    &lt;span class="code-comment"&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;returns&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;///&lt;/span&gt;
    &lt;span class="code-comment"&gt; True if the collections match and do not contain duplicates (regardless of sequence).
&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;///&lt;/span&gt;
    &lt;span class="code-comment"&gt; False if either list is null, or they do not match.
&lt;/span&gt;
    &lt;span class="code-SummaryComment"&gt;///&lt;/span&gt;
    &lt;span class="code-comment"&gt; &lt;span class="code-SummaryComment"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;/&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;returns&lt;/span&gt;&lt;span class="code-SummaryComment"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;
    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; &lt;span class="code-keyword"&gt;bool&lt;/span&gt; MatchList&amp;lt;T&amp;gt;(List&amp;lt;T&amp;gt; List1, List&amp;lt;T&amp;gt; List2)
{
    &lt;span class="code-keyword"&gt;if&lt;/span&gt; (List1 == &lt;span class="code-keyword"&gt;null&lt;/span&gt; || List2 == &lt;span class="code-keyword"&gt;null&lt;/span&gt;) &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;false&lt;/span&gt;;
    &lt;span class="code-keyword"&gt;return&lt;/span&gt; ((List1.Count == List2.Count) &amp;amp;&amp;amp; (List1.Count == List1.Intersect(List2).Count()));
}&lt;/pre&gt;</description>
      <link>http://www.codeproject.com/Messages/3978613/MatchList.aspx</link>
      <author>Timothy CIAN</author>
      <pubDate>Mon, 01 Aug 2011 20:22:00 GMT</pubDate>
      <subject>Clever Code</subject>
    </item>
    <item>
      <title>Did I St-St-Stutter?</title>
      <description>&lt;pre lang="asp.net"&gt;
    &lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;
    &lt;span class="code-leadattribute"&gt;asp:PlaceHolder&lt;/span&gt; &lt;span class="code-attribute"&gt;runat&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;server"&lt;/span&gt; &lt;span class="code-attribute"&gt;ID&lt;/span&gt;&lt;span class="code-keyword"&gt;="&lt;/span&gt;&lt;span class="code-keyword"&gt;phPhone"&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;
  (Code to Insert Phone Number)
&lt;span class="code-keyword"&gt;&amp;lt;&lt;/span&gt;&lt;span class="code-keyword"&gt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;asp:PlaceHolder&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&amp;nbsp;&lt;br /&gt;
I still use hungarian notation when naming ASP.NET server controls. I hope my coworkers don't think I have a speech im... imp... imped... a speech problem.&lt;br /&gt;
&lt;div class="signature"&gt;&lt;blockquote class="FQ"&gt;&lt;div class="FQA"&gt;Martin Fowler wrote:&lt;/div&gt;Any fool can write code that a computer can understand. Good programmers write code that humans can understand.&lt;/blockquote&gt;&lt;/div&gt;</description>
      <link>http://www.codeproject.com/Messages/3966537/Did-I-St-St-Stutter.aspx</link>
      <author>AspDotNetDev</author>
      <pubDate>Thu, 21 Jul 2011 17:24:00 GMT</pubDate>
      <subject>Clever Code</subject>
    </item>
    <item>
      <title>Useful thingy</title>
      <description>I have just noticed that in the .NET 4.0 the &lt;a href="http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&amp;amp;l=EN-US&amp;amp;k=k%28SYSTEM.ENUM.HASFLAG%29;k%28HASFLAG%29;k%28TargetFrameworkMoniker-%22.NETFRAMEWORK%2cVERSION%3dV4.0%22%29;k%28DevLang-CSHARP%29&amp;amp;rd=true"&gt;Enum.HasFlag(Enum)&lt;/a&gt;[&lt;a href="http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&amp;amp;l=EN-US&amp;amp;k=k%28SYSTEM.ENUM.HASFLAG%29;k%28HASFLAG%29;k%28TargetFrameworkMoniker-%22.NETFRAMEWORK%2cVERSION%3dV4.0%22%29;k%28DevLang-CSHARP%29&amp;amp;rd=true" target="_blank" title="New Window"&gt;^&lt;/a&gt;] method was introduced. Not much clever from my side, but I rarely put a dot after enum's member so I could notice the new feature. &lt;img src="/script/Forums/Images/thumbs_up.gif" align="top" alt="Thumbs Up | :thumbsup:" /&gt; &lt;br /&gt;
&lt;div class="signature"&gt;Greetings - Jacek&lt;/div&gt;</description>
      <link>http://www.codeproject.com/Messages/3947924/Useful-thingy.aspx</link>
      <author>Jacek Gajek</author>
      <pubDate>Tue, 05 Jul 2011 11:02:00 GMT</pubDate>
      <subject>Clever Code</subject>
    </item>
  </channel>
</rss>
