<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://honestillusion.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Honest Illusion</title><subtitle type="html">Where Lightning's still the biggest thrill of all....</subtitle><id>http://honestillusion.com/blogs/blog_0/atom.aspx</id><link rel="alternate" type="text/html" href="http://honestillusion.com/blogs/blog_0/default.aspx" /><link rel="self" type="application/atom+xml" href="http://honestillusion.com/blogs/blog_0/atom.aspx" /><generator uri="http://communityserver.org" version="2.1.61129.1">Community Server</generator><updated>2007-06-20T14:33:33Z</updated><entry><title>Dev102's Challenge #13 : Brackets</title><link rel="alternate" type="text/html" href="http://honestillusion.com/blogs/blog_0/archive/2008/07/21/dev102-s-challenge-13-brackets.aspx" /><id>http://honestillusion.com/blogs/blog_0/archive/2008/07/21/dev102-s-challenge-13-brackets.aspx</id><published>2008-07-21T17:18:03Z</published><updated>2008-07-21T17:18:03Z</updated><content type="html">
  &lt;p&gt;Many people skipped last week's challenge (like I had planned to).  As it turned out, I was the only blogger to responded.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dev102.com/2008/07/21/a-programming-job-interview-challenge-13-brackets/"&gt;For this week's challenge,&lt;/a&gt; they've gone back to a platform-neutral algorithm question:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Your input is a string which is composed from bracket characters. The allowed characters are:’(', ‘)’, ‘['. ']‘, ‘{’, ‘}’, ‘&amp;lt;’ and ‘&amp;gt;’. Your mission is to determine whether the brackets structure is legal or not.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The simple sentence answer is "use a stack, pushing on an open character, and popping on a close character".  There are a few other things to look out for, but that's the basic concept.  For the actual code, I bypassed any kind of library Stack class, since we wanted the most efficient and for the very limited need of this function, I could jury-rig a faster one out of a char array.  Complexity is speed: O(N), space O(N)&lt;/p&gt;  &lt;pre class="c#"&gt;static bool TestBrackets(string testcase)
{
    // create a very simple stack.  
    // Since we push on open &amp;amp; pop an close, stack need only be half the
    // size of the input string.  The +1 is needed because we only check
    // for too many opens after we've pushed.
    char[] stack = new char[(testcase.Length / 2) +1];
    
    int SP=0;
    foreach(char chr in testcase)
    {
        switch(chr)
        {
            // For each open character, push the close char.
            case '[':
                stack[SP++] = ']';
                break;
            case '&amp;lt;':
                stack[SP++] = '&amp;gt;';
                break;
            case '{':
                stack[SP++] = '}';
                break;
            case '(':
                stack[SP++] = ')';
                break;
                
            case ']':
            case '&amp;gt;':
            case '}':
            case ')':
                // check for stack underflow (too many closes)
                // or a character we weren't expecting (bad  nesting)
                if (SP==0 || stack[--SP] != chr)
                    return false;  
                break;
        }
        // Check for stack overflow (too many opens)
        if (SP==stack.Length)
            return false;
    }
    // Finally, it's good if we've closed everything we've opened.
    return SP==0;
}&lt;/pre&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a title="Email Dev102%27s+Challenge+%2313+%3a+Brackets" href = "mailto:?body=Thought you might like this: http://honestillusion.com/blogs/blog_0/archive/2008/07/21/dev102-s-challenge-13-brackets.aspx&amp;subject=Dev102%27s+Challenge+%2313+%3a+Brackets"&gt;Email it!&lt;/a&gt; | &lt;a href = "http://del.icio.us/post?url=http://honestillusion.com/blogs/blog_0/archive/2008/07/21/dev102-s-challenge-13-brackets.aspx&amp;title=Dev102%27s+Challenge+%2313+%3a+Brackets" title="Submit Dev102%27s+Challenge+%2313+%3a+Brackets to del.icio.us" &gt;bookmark it!&lt;/a&gt; | &lt;a href = "http://www.digg.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/07/21/dev102-s-challenge-13-brackets.aspx&amp;phase=2" title="Submit Dev102%27s+Challenge+%2313+%3a+Brackets to digg.com"&gt;digg it!&lt;/a&gt; | &lt;a href = "http://reddit.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/07/21/dev102-s-challenge-13-brackets.aspx&amp;title=Dev102%27s+Challenge+%2313+%3a+Brackets" title="Submit Dev102%27s+Challenge+%2313+%3a+Brackets to reddit.com"&gt;reddit!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://honestillusion.com/aggbug.aspx?PostID=5391" width="1" height="1"&gt;</content><author><name>James</name><uri>http://honestillusion.com/members/James.aspx</uri></author></entry><entry><title>Dev102's Challenge #12 : Managed &amp; unmanaged</title><link rel="alternate" type="text/html" href="http://honestillusion.com/blogs/blog_0/archive/2008/07/16/dev102-s-challenge-12-managed-unmanaged.aspx" /><id>http://honestillusion.com/blogs/blog_0/archive/2008/07/16/dev102-s-challenge-12-managed-unmanaged.aspx</id><published>2008-07-16T18:52:52Z</published><updated>2008-07-16T18:52:52Z</updated><content type="html">
  &lt;p&gt;My solution(s) for last week's challenge were cited, but, only as an "honorable mention" / "also run".&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dev102.com/2008/07/14/a-programming-job-interview-challenge-12-managed-and-unmanaged/"&gt;This week's challenge&lt;/a&gt; is a different sort of animal.  Not that it is particularly difficult --- actually I suspect it's quite easy --- it's just that it requires a fairly specialize knowledge (Managed Extensions for C++ in this case).  A couple of them in the past required some basic knowledge of .Net &amp;amp; the CLR, but most of the time, the challenge involve a non-platform specific algorithm.&lt;/p&gt;  &lt;p&gt;So, knowing nothing about Managed Extension, I was just going to let this one pass.  But, I happened to run into an old friend (Will Depalo) from my days as a VC++ MVP.  When I went to .Net, I also switched to C#, but he stayed with C++, so I figured he would have some insight.  Reducing the problem to one sentence ("we have a unmanaged class accessing an instance variable of a managed class"), and he immediately  knew the answer ("you'll need to pin it"), and offered some advice ("look up '__pin' in the msdn").  However, didn't realize exactly how good that advice was, as the folk's at DEV102 apparently took the example source code from the __pin article to create the challenge.  So, here's my answer (I love stuff that can be answer via copy'n'paste):&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;pre class="c#"&gt;int main() 
{
   ManagedClass &lt;strong&gt;__pin&lt;/strong&gt; * pMngdClass = new ManagedClass;
   UnmanagedClass* pUnmngd = new UnmanagedClass;
   pUnmngd-&amp;gt;incr(&amp;amp;(pMngdClass-&amp;gt;i));
}&lt;/pre&gt;

&lt;p&gt;The rest is unchanged.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a title="Email Dev102%27s+Challenge+%2312+%3a+Managed+%26amp%3b+unmanaged" href = "mailto:?body=Thought you might like this: http://honestillusion.com/blogs/blog_0/archive/2008/07/16/dev102-s-challenge-12-managed-unmanaged.aspx&amp;subject=Dev102%27s+Challenge+%2312+%3a+Managed+%26amp%3b+unmanaged"&gt;Email it!&lt;/a&gt; | &lt;a href = "http://del.icio.us/post?url=http://honestillusion.com/blogs/blog_0/archive/2008/07/16/dev102-s-challenge-12-managed-unmanaged.aspx&amp;title=Dev102%27s+Challenge+%2312+%3a+Managed+%26amp%3b+unmanaged" title="Submit Dev102%27s+Challenge+%2312+%3a+Managed+%26amp%3b+unmanaged to del.icio.us" &gt;bookmark it!&lt;/a&gt; | &lt;a href = "http://www.digg.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/07/16/dev102-s-challenge-12-managed-unmanaged.aspx&amp;phase=2" title="Submit Dev102%27s+Challenge+%2312+%3a+Managed+%26amp%3b+unmanaged to digg.com"&gt;digg it!&lt;/a&gt; | &lt;a href = "http://reddit.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/07/16/dev102-s-challenge-12-managed-unmanaged.aspx&amp;title=Dev102%27s+Challenge+%2312+%3a+Managed+%26amp%3b+unmanaged" title="Submit Dev102%27s+Challenge+%2312+%3a+Managed+%26amp%3b+unmanaged to reddit.com"&gt;reddit!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://honestillusion.com/aggbug.aspx?PostID=5346" width="1" height="1"&gt;</content><author><name>James</name><uri>http://honestillusion.com/members/James.aspx</uri></author></entry><entry><title>Dev102's Challenge #11 - Summing Numbers</title><link rel="alternate" type="text/html" href="http://honestillusion.com/blogs/blog_0/archive/2008/07/08/dev102-s-challenge-11-summing-numbers.aspx" /><id>http://honestillusion.com/blogs/blog_0/archive/2008/07/08/dev102-s-challenge-11-summing-numbers.aspx</id><published>2008-07-08T13:55:37Z</published><updated>2008-07-08T13:55:37Z</updated><content type="html">
  &lt;p&gt;My answer was acknowledged as correct for last week's challenge.  So, let's see if we can make it two in a row.  &lt;a href="http://www.dev102.com/misc/a-programming-job-interview-challenge-11-summing-numbers/"&gt;This week&lt;/a&gt;: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Given a list of n integers and another integer called m, determine (true / false) if there exist 2 numbers in that list which sum up to m.       &lt;br /&gt;Example: 2,6,4,9,1,12,7 and m=14 -&amp;gt; 2 and 12 sum up to 14, so the answer is true.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This one is rather tricky.  There is no obvious (to me) solution.   I can see three viable methods, each with its own pros &amp;amp; cons.&lt;/p&gt;  &lt;p&gt;Method 1: We'll call this "brute force".  The obvious answer.  We add the values of list[1] and list[2],  then list[1] and list[3], then list[1] and list[4] and so forth, until we reach list[1] and list[ n ].  If we haven't found a match yet, we then move on to adding list[2] to list[3], then list[2] to list[4] etc. In code that would be: &lt;/p&gt;  &lt;pre class="c#"&gt;for(int i= 0; i &amp;lt;N-1; ++i) 
    for(int j= i+1; j &amp;lt; N; ++j) 
       if (list[ i ] + list[ j ] == M) &lt;/pre&gt;

&lt;p&gt;The complexity for this would be Summation N which is officially O(N*N) (although it's closer to O(N*N/2) ).  However, that's the worst case: we can exit early as soon as we find a valid match, making the average case O(N*N/4).  It's also important to note the basic operation that's being repeated (adding two number) is very fast.  Hence, this would be the winner for small values of N (and probably some very large "small values of N").&lt;/p&gt;

&lt;p&gt;Method 2: Which we'll call the "bi-directional search".  This would clearly be the winner, except for it's precondition: start with a sorted list.  Add the first and last elements of the list (list[1] + list[ N ]).  If they equal to goal, we're done. If they are more than the goal, add the first and second-to-last elements(list[1] + list[ N-1 ]).  If they are less, then add the second element to the last element (list[2] + list[ N ]).  Continue this way, moving up from the front when the sum is too low, and down from the back when it's too high until you either find a match, or meet in the middle.  The complexity of this algorithm in O(N) --- for a sorted list.  We're given an unsorted list, which means we'd have to sort it first.  Sorting is, at best, O(N*logN), making the total complexity O(N*logN + N), which I believe is still less than method 1, but the basic task being done for the sort (comparing &lt;em&gt;and&lt;/em&gt;  swapping) is much more expensive than for method 1.  Further, you must complete the sort before you can start the search, so you've taken the big hit before you get a chance for an early exit, making the average case O(NlogN+N/2), so this will win for large values of N, but they'd have to be &lt;em&gt;very&lt;/em&gt; large values of N.&lt;/p&gt;

&lt;p&gt;And, finally, Method 3, which we'll call the "partitioned search". Partition the list into two sublists, one with values less the M/2 and one with values greater than M/2. (The value equal to M/2 can be ignored, as we would need two of them, and we've been assured that the values in the list are unique).  If a solution exists, it will require one from each list; any combination of two from the lower sublist will be two low.  Any two from the upper list will be too high. So we just try every combination of one from each sublist.   In the worst case, that's O((N/2) * (N/2)) or O(N*N/4),  with an average case of O(N*N/8).  To explain with examples: Say we are given a list of 10 numbers.  Method 1 would require 55 additions to try every possibility. If we partitions the list into sublists of 5 &amp;amp; 5, then this method would require only 25 additions.  However, if the numbers break down so that the partitions are 8 &amp;amp; 2, then we'd need only 16 additions.  And, as before, we can exit early as soon as we find a match.  Partitioning can be done in O(N): Start by pointing at the first and last elements, just as in Method 2. Seek forward looking for an element greater than N/2.  When one is found, seek from the end, looking for an element less then N/2. When you have one of each, swap 'em and continue.  When the pointers meet, the list is partitioned in place.  That required only one pass through the list, so the step is O(N), making the total for the average case O(N*N/8 + N).&lt;/p&gt;

&lt;p&gt;Overall, Method 1 wins for small lists, Method 3 for larger lists, and Method 2 for very large lists.  Since memory read/write efficiency is the last bottleneck (how many additions is one swap worth?) the exact point where one method passes another is heavily platform dependant.&lt;/p&gt;

&lt;p&gt;In the back of my mind, two other ideas for other methods keep flowing through. The first tells me that there should be some way to accomplish this through summing the list.  This would be O(N), but I just can't think of a way to make it work.  The other involves building a matrix.  I'm pretty sure I could make that work, in a way that O(N) once the matrix is built, but building it would be greater the O(N) itself, so the whole task would be no faster than the means described above.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a title="Email Dev102%27s+Challenge+%2311+-+Summing+Numbers" href = "mailto:?body=Thought you might like this: http://honestillusion.com/blogs/blog_0/archive/2008/07/08/dev102-s-challenge-11-summing-numbers.aspx&amp;subject=Dev102%27s+Challenge+%2311+-+Summing+Numbers"&gt;Email it!&lt;/a&gt; | &lt;a href = "http://del.icio.us/post?url=http://honestillusion.com/blogs/blog_0/archive/2008/07/08/dev102-s-challenge-11-summing-numbers.aspx&amp;title=Dev102%27s+Challenge+%2311+-+Summing+Numbers" title="Submit Dev102%27s+Challenge+%2311+-+Summing+Numbers to del.icio.us" &gt;bookmark it!&lt;/a&gt; | &lt;a href = "http://www.digg.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/07/08/dev102-s-challenge-11-summing-numbers.aspx&amp;phase=2" title="Submit Dev102%27s+Challenge+%2311+-+Summing+Numbers to digg.com"&gt;digg it!&lt;/a&gt; | &lt;a href = "http://reddit.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/07/08/dev102-s-challenge-11-summing-numbers.aspx&amp;title=Dev102%27s+Challenge+%2311+-+Summing+Numbers" title="Submit Dev102%27s+Challenge+%2311+-+Summing+Numbers to reddit.com"&gt;reddit!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://honestillusion.com/aggbug.aspx?PostID=5203" width="1" height="1"&gt;</content><author><name>James</name><uri>http://honestillusion.com/members/James.aspx</uri></author></entry><entry><title>Dev102's Challenge #10 - The Missing Number</title><link rel="alternate" type="text/html" href="http://honestillusion.com/blogs/blog_0/archive/2008/07/01/dev102-s-challenge-10-the-missing-number.aspx" /><id>http://honestillusion.com/blogs/blog_0/archive/2008/07/01/dev102-s-challenge-10-the-missing-number.aspx</id><published>2008-07-01T18:50:34Z</published><updated>2008-07-01T18:50:34Z</updated><content type="html">
  &lt;p&gt;I didn't actually skip last week's challenge for Dev102.  I did write up a solution.  I just forgot to post it.  It was wrong anyway.&lt;/p&gt;  &lt;p&gt;Well, no sense it looking backward... &lt;a href="http://www.dev102.com/net/a-programming-job-interview-challenge-10-the-missing-number/"&gt;This week's&lt;/a&gt;:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Your input is an unsorted list of n numbers ranging from 1 to n+1, all of the numbers are unique, meaning that a number can’t appear twice in that list. ..One of the numbers is missing and you are asked to provide the most efficient method to find that missing number.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And Shahar was right, it was rather easy.  We just add up the number we get, and subtract that value from the sum we should have gotten if the missing number wasn't missing.&lt;/p&gt;  &lt;p&gt;int FindMissingNumber(IEnumerable&amp;lt;int&amp;gt; list)    &lt;br /&gt;{     &lt;br /&gt;    int actualSum = 0;     &lt;br /&gt;    int expectedSum = 0;     &lt;br /&gt;    int n = 1;     &lt;br /&gt;    foreach(int i in list)     &lt;br /&gt;    {     &lt;br /&gt;        actualSum += i;     &lt;br /&gt;        expectedSum += n++;     &lt;br /&gt;    }     &lt;br /&gt;    expectedSum += n;     &lt;br /&gt;    return expectedSum - actualSum;     &lt;br /&gt;} &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Things to note:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The complexity of the algorithm in O(n).   &lt;/li&gt;    &lt;li&gt;I  assured that complexity by using the least powerful collection interface (IEnumerable), and iterated through it only once. &lt;/li&gt;    &lt;li&gt;I summed the expected total manually instead of an formula on list.Count, but for some collection types (such as a linked lists) Count is, by itself, O(n). &lt;/li&gt;    &lt;li&gt;The method will work for an empty sequence, returning 1. &lt;/li&gt; &lt;/ul&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a title="Email Dev102%27s+Challenge+%2310+-+The+Missing+Number" href = "mailto:?body=Thought you might like this: http://honestillusion.com/blogs/blog_0/archive/2008/07/01/dev102-s-challenge-10-the-missing-number.aspx&amp;subject=Dev102%27s+Challenge+%2310+-+The+Missing+Number"&gt;Email it!&lt;/a&gt; | &lt;a href = "http://del.icio.us/post?url=http://honestillusion.com/blogs/blog_0/archive/2008/07/01/dev102-s-challenge-10-the-missing-number.aspx&amp;title=Dev102%27s+Challenge+%2310+-+The+Missing+Number" title="Submit Dev102%27s+Challenge+%2310+-+The+Missing+Number to del.icio.us" &gt;bookmark it!&lt;/a&gt; | &lt;a href = "http://www.digg.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/07/01/dev102-s-challenge-10-the-missing-number.aspx&amp;phase=2" title="Submit Dev102%27s+Challenge+%2310+-+The+Missing+Number to digg.com"&gt;digg it!&lt;/a&gt; | &lt;a href = "http://reddit.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/07/01/dev102-s-challenge-10-the-missing-number.aspx&amp;title=Dev102%27s+Challenge+%2310+-+The+Missing+Number" title="Submit Dev102%27s+Challenge+%2310+-+The+Missing+Number to reddit.com"&gt;reddit!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://honestillusion.com/aggbug.aspx?PostID=5140" width="1" height="1"&gt;</content><author><name>James</name><uri>http://honestillusion.com/members/James.aspx</uri></author></entry><entry><title>DEV102's Programming Job Interview Challenge #8</title><link rel="alternate" type="text/html" href="http://honestillusion.com/blogs/blog_0/archive/2008/06/18/dev102-s-programming-job-interview-challenge-8.aspx" /><id>http://honestillusion.com/blogs/blog_0/archive/2008/06/18/dev102-s-programming-job-interview-challenge-8.aspx</id><published>2008-06-18T19:23:13Z</published><updated>2008-06-18T19:23:13Z</updated><content type="html">
  &lt;p&gt;
    &lt;a href="http://www.dev102.com/net/a-programming-job-interview-challenge-7-coins-of-the-round-table/"&gt;I skipped last week's DEV102 challenge&lt;/a&gt;.   I didn't think my answer was right.  Turns out that it was. I was assuming that it had a limitation that would disqualify it.  I assumed that my solution would only work if you placed the coins in a tight grid with each newly-placed coin touching an existing coin.  As a practical matter, this is true.  It would be virtually impossible to properly place a coin mirroring the freely-placed previous coin without resorting to a tape measure and protractor.  And the placement would have to be exact for it to work.  So I suppressed my solution for lack of practicality, when all they really wanted was a theoretic solution. &lt;/p&gt;  &lt;p&gt;Anyway, onward to &lt;a href="http://www.dev102.com/net/a-programming-job-interview-challenge-8-a-needle-in-a-haystack/"&gt;this week's challenge, #8&lt;/a&gt; (excerpted):&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;You are writing a software component that receives a binary record every 20 millisecond. .... Your component goal is to alert whenever it identifies a specific expression (which is provided at the initialization process) in the stream of records - you are looking for a specific combination of binary records. &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The answer is, of course, a &lt;a href="http://en.wikipedia.org/wiki/Finite_State_Machine"&gt;&lt;strong&gt;Finite State Machine&lt;/strong&gt;&lt;/a&gt;. To explain how one works, we need to come up with a example expression to search for.  Let's say these records come it four formats: Type A, type B, type C and Type D, and we are looking a sequence of records in the following pattern: ABACB (if you'd like, you can assume that there are many record types, and Type D represents "any record that's not type A, B or C").  So, we start in state "0". State 0 can be called "looking for first A record".  At state 0, if we find an A record, we move into state 1 ("Find first A, looking for first B").  If we find any other kind of record, we stay in state 0.  This can be expressed in table form as:&lt;/p&gt;  &lt;div align="center"&gt;   &lt;table cellspacing="0" cellpadding="2" align="center"&gt;       &lt;tr&gt;         &lt;td&gt; &lt;/td&gt;          &lt;td&gt;Next state&lt;/td&gt;          &lt;td&gt;when &lt;/td&gt;          &lt;td&gt;record &lt;/td&gt;          &lt;td&gt;found&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;Current State VV&lt;/td&gt;          &lt;td&gt;A&lt;/td&gt;          &lt;td&gt;B&lt;/td&gt;          &lt;td&gt;C&lt;/td&gt;          &lt;td&gt;D&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;1&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;       &lt;/tr&gt;     &lt;/table&gt; &lt;/div&gt;  &lt;p&gt;Next when we are in state 1, if we find a B record, we move into state 2, but the other transitions are a bit trickier.  If we find a C or D, we're back to state 0 ("looking for 1st A"), but if we find another A, we have to stay in state 1.  Adding that to our graph:&lt;/p&gt;  &lt;div align="center"&gt;   &lt;table cellspacing="0" cellpadding="2" align="center"&gt;       &lt;tr&gt;         &lt;td&gt; &lt;/td&gt;          &lt;td&gt;Next state&lt;/td&gt;          &lt;td&gt;when &lt;/td&gt;          &lt;td&gt;record &lt;/td&gt;          &lt;td&gt;found&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;Current State VV&lt;/td&gt;          &lt;td&gt;A&lt;/td&gt;          &lt;td&gt;B&lt;/td&gt;          &lt;td&gt;C&lt;/td&gt;          &lt;td&gt;D&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;1&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;1&lt;/td&gt;          &lt;td&gt;1&lt;/td&gt;          &lt;td&gt;2&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;       &lt;/tr&gt;     &lt;/table&gt; &lt;/div&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Ok, now, we are in state 2 ("found AB, looking for 2nd A"), Here if we find an A, we move on to state 3 --- anything else, and we're back to state 0.&lt;/p&gt;  &lt;div align="center"&gt;   &lt;table cellspacing="0" cellpadding="2" align="center"&gt;       &lt;tr&gt;         &lt;td&gt; &lt;/td&gt;          &lt;td&gt;Next state&lt;/td&gt;          &lt;td&gt;when &lt;/td&gt;          &lt;td&gt;record &lt;/td&gt;          &lt;td&gt;found&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;Current State VV&lt;/td&gt;          &lt;td&gt;A&lt;/td&gt;          &lt;td&gt;B&lt;/td&gt;          &lt;td&gt;C&lt;/td&gt;          &lt;td&gt;D&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;1&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;1&lt;/td&gt;          &lt;td&gt;1&lt;/td&gt;          &lt;td&gt;2&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;2&lt;/td&gt;          &lt;td&gt;3&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;       &lt;/tr&gt;     &lt;/table&gt; &lt;/div&gt;  &lt;p&gt;State 3 ("found ABA, looking for C"), is a bit trickier again.  If we find a C, naturally, we move into state 4. And if we find a D, were back into state 0.  But, if we an A, we step back to state 1.  And if we find a B, we step back only to state 2 (ie, we've found "ABAB" and the second "AB" may be the start of the pattern we want.&lt;/p&gt;  &lt;div align="center"&gt;   &lt;table cellspacing="0" cellpadding="2" align="center"&gt;       &lt;tr&gt;         &lt;td&gt; &lt;/td&gt;          &lt;td&gt;Next state&lt;/td&gt;          &lt;td&gt;when &lt;/td&gt;          &lt;td&gt;record &lt;/td&gt;          &lt;td&gt;found&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;Current State VV&lt;/td&gt;          &lt;td&gt;A&lt;/td&gt;          &lt;td&gt;B&lt;/td&gt;          &lt;td&gt;C&lt;/td&gt;          &lt;td&gt;D&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;1&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;1&lt;/td&gt;          &lt;td&gt;1&lt;/td&gt;          &lt;td&gt;2&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;2&lt;/td&gt;          &lt;td&gt;3&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;3&lt;/td&gt;          &lt;td&gt;1&lt;/td&gt;          &lt;td&gt;2&lt;/td&gt;          &lt;td&gt;4&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;       &lt;/tr&gt;     &lt;/table&gt; &lt;/div&gt;  &lt;p&gt;At state 4, we enter the endgame.  We're trying to find "ABACB", and so far we're found "ABAC".  If the next record is a B, we have success ("Let loose the pigeons!").  If it's an A, we go to state 1 (as usually). Anything else, and we start over at state 0.&lt;/p&gt;  &lt;div align="center"&gt;   &lt;table cellspacing="0" cellpadding="2" align="center"&gt;       &lt;tr&gt;         &lt;td&gt; &lt;/td&gt;          &lt;td&gt;Next state&lt;/td&gt;          &lt;td&gt;when &lt;/td&gt;          &lt;td&gt;record &lt;/td&gt;          &lt;td&gt;found&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;Current State VV&lt;/td&gt;          &lt;td&gt;A&lt;/td&gt;          &lt;td&gt;B&lt;/td&gt;          &lt;td&gt;C&lt;/td&gt;          &lt;td&gt;D&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;1&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;1&lt;/td&gt;          &lt;td&gt;1&lt;/td&gt;          &lt;td&gt;2&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;2&lt;/td&gt;          &lt;td&gt;3&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;3&lt;/td&gt;          &lt;td&gt;1&lt;/td&gt;          &lt;td&gt;2&lt;/td&gt;          &lt;td&gt;4&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;4&lt;/td&gt;          &lt;td&gt;1&lt;/td&gt;          &lt;td&gt;&lt;strong&gt;*&lt;/strong&gt;&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;          &lt;td&gt;0&lt;/td&gt;       &lt;/tr&gt;     &lt;/table&gt; &lt;/div&gt;  &lt;p&gt;Now, to put this into C# code, we merely need a simple pre-initialize int array following the structure of the chart we just built, and start with our state at 0.&lt;/p&gt;  &lt;p&gt;const int[,] states = new int [5,4]{&lt;/p&gt;  &lt;p&gt;{ 1,0,0,0},&lt;/p&gt;  &lt;p&gt;{1,2,0,0}&lt;/p&gt;  &lt;p&gt;{3,0,0,0}&lt;/p&gt;  &lt;p&gt;{1,2,4,0}&lt;/p&gt;  &lt;p&gt;{1,-1,0,0}&lt;/p&gt;  &lt;p&gt;};&lt;/p&gt;  &lt;p&gt;int state = 0;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Then as a new record comes in, we just determine it's type, and update the state:&lt;/p&gt;  &lt;p&gt;bool MatchFound(Record newRecord)    &lt;br /&gt;{&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;// return 0,1,2 or 3 for record type A,B,C or D respectively.      &lt;br /&gt;// can be assumed to be present, as per the spec.       &lt;br /&gt;int type = GetRecordType(newRecord);&lt;/p&gt;    &lt;p&gt;// Here's where the magic happens      &lt;br /&gt;// just a simple index into an array.       &lt;br /&gt;state = states[state, type];&lt;/p&gt;    &lt;p&gt;return state &amp;lt; 0;    // Report success or failure.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;}&lt;/p&gt;  &lt;p&gt; And that's it.  Total state held between records: one integer.  Total work needed per record to determine pattern: one array lookup and one int comparison. &lt;/p&gt;  &lt;p&gt;And the real beauty of this approach is that if we wanted to look for other patterns &lt;em&gt;at the same time&lt;/em&gt;, it could be done. For example, by just changing the states[] array in the above to this&lt;/p&gt;  &lt;p&gt;const int[,] states = new int [13,4]{&lt;/p&gt;  &lt;p&gt; {1,5,9,0},     &lt;br /&gt; {1,2,9,0},    &lt;br /&gt; {3,6,9,0},    &lt;br /&gt; {1,2,4,0},    &lt;br /&gt; {10,-1,9,0},    &lt;br /&gt; {1, 6, 9, 0},    &lt;br /&gt; {1, 6, 7, 0},    &lt;br /&gt; {10, 5, 8, 0},    &lt;br /&gt; {-2, 5, 9, 0},    &lt;br /&gt; {10,5, 9, 0},  &lt;br /&gt;{1, 11, 9, 0},  &lt;br /&gt;{3, 6, 12, 0},     &lt;br /&gt;{-3, 6, 9, 0} &lt;/p&gt;  &lt;p&gt;};&lt;/p&gt;  &lt;p&gt;Then we'd be able to search for ABACB (as before, found when state = -1) and BBCCA (found when state = -2), plus one more pattern (found when state = -3).&lt;/p&gt;  &lt;h3&gt;Class Homework&lt;/h3&gt;  &lt;p&gt;1) (simple) Try to figure out the third pattern that can be found using that state table. (It's a sequence of 5 records using just A B &amp;amp; C)&lt;/p&gt;  &lt;p&gt;2) (hopefully not possible)  Try to figure out a sequence of records that would cause the state machine to miss one of those patterns (Note: after one is found, we start over at state 0, so it's not intended to find overlapping sequences, such as "ABACBBCCA".  It's find the first but not the second.)&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a title="Email DEV102%27s+Programming+Job+Interview+Challenge+%238" href = "mailto:?body=Thought you might like this: http://honestillusion.com/blogs/blog_0/archive/2008/06/18/dev102-s-programming-job-interview-challenge-8.aspx&amp;subject=DEV102%27s+Programming+Job+Interview+Challenge+%238"&gt;Email it!&lt;/a&gt; | &lt;a href = "http://del.icio.us/post?url=http://honestillusion.com/blogs/blog_0/archive/2008/06/18/dev102-s-programming-job-interview-challenge-8.aspx&amp;title=DEV102%27s+Programming+Job+Interview+Challenge+%238" title="Submit DEV102%27s+Programming+Job+Interview+Challenge+%238 to del.icio.us" &gt;bookmark it!&lt;/a&gt; | &lt;a href = "http://www.digg.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/06/18/dev102-s-programming-job-interview-challenge-8.aspx&amp;phase=2" title="Submit DEV102%27s+Programming+Job+Interview+Challenge+%238 to digg.com"&gt;digg it!&lt;/a&gt; | &lt;a href = "http://reddit.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/06/18/dev102-s-programming-job-interview-challenge-8.aspx&amp;title=DEV102%27s+Programming+Job+Interview+Challenge+%238" title="Submit DEV102%27s+Programming+Job+Interview+Challenge+%238 to reddit.com"&gt;reddit!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://honestillusion.com/aggbug.aspx?PostID=5059" width="1" height="1"&gt;</content><author><name>James</name><uri>http://honestillusion.com/members/James.aspx</uri></author></entry><entry><title>DEV102's Programming Job Interview Challenge #6 </title><link rel="alternate" type="text/html" href="http://honestillusion.com/blogs/blog_0/archive/2008/06/02/dev102-s-programming-job-interview-challenge-6.aspx" /><id>http://honestillusion.com/blogs/blog_0/archive/2008/06/02/dev102-s-programming-job-interview-challenge-6.aspx</id><published>2008-06-02T14:16:00Z</published><updated>2008-06-02T14:16:00Z</updated><content type="html">
  &lt;p&gt;Another week, another C# interview question from the good folk's at Dev102.com -- Although I use the term "good folks" advisedly, as this week they did not even acknowledge the solution I posted for last weeks puzzle (which was both correct, and, I believe, the first blog post about it).&lt;/p&gt;

&lt;p&gt;Anyway, time to move on to &lt;a href="http://www.dev102.com/2008/06/02/a-programming-job-interview-challenge-6-c-games/"&gt;this week's question&lt;/a&gt;. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Look at the following Code segment written in C#:&lt;/p&gt;
&lt;div&gt;
&lt;div style="border-style:none;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;"&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;"&gt;&lt;span&gt;   1:&lt;/span&gt; ArrayList a = &lt;span&gt;new&lt;/span&gt; ArrayList();&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;"&gt;&lt;span&gt;   2:&lt;/span&gt; ArrayList b = &lt;span&gt;new&lt;/span&gt; ArrayList();&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;"&gt;&lt;span&gt;   3:&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;"&gt;&lt;span&gt;   4:&lt;/span&gt; a.Add(1);&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;"&gt;&lt;span&gt;   5:&lt;/span&gt; b.Add(1);&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;"&gt;&lt;span&gt;   6:&lt;/span&gt; a.Add(2);&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;"&gt;&lt;span&gt;   7:&lt;/span&gt; b.Add(2.0);&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;"&gt;&lt;span&gt;   8:&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;"&gt;&lt;span&gt;   9:&lt;/span&gt; Console.WriteLine((a[0] == b[0]));&lt;/pre&gt;
&lt;pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;"&gt;&lt;span&gt;  10:&lt;/span&gt; Console.WriteLine((a[1] == b[1]));&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
What will be typed into the console? And &lt;b&gt;&lt;span style="text-decoration:underline;"&gt;WHY?&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt; This one is fairly trivial (They seem to be alternating between difficult and easy questions).  And, as requested, I formulated my answer before typing it into VS (actually, I copy'n'pasted in SnippetCompiler), but the compiler DID confirm the answer I'd already theorized.&lt;/p&gt;
&lt;p&gt;This answer is short enough that we can use the cool "white-on-white; select to see it" trick--- However, RSS feed (and apparently the theme of this blog) seem to ignore the color style, so it's probably visible to you below.. &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;div style="color:white;"&gt;
&lt;p&gt;ArrayList is deep-down, just an object[].  To store an valuetype, like an int or float, in an ArrayList, that value would first have to be boxed.  Each valuetype is boxed separately, in distinct objects, even if they do happen to have the same value. When we get to the WriteLines, we are just performing (object) == (object) (actually, Object.ReferenceEquals(object1, object2); )  ReferenceEquals knows nothing about unboxing.  It just asks, "Are these two references pointing to the exact same object?".  For any two boxed objects, regardless of their value, the answer would be "No".  Hence, both lines print "False".&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;

&lt;p&gt; (select the blank space above)&lt;/p&gt;
&lt;br /&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a title="Email DEV102%27s+Programming+Job+Interview+Challenge+%236+" href = "mailto:?body=Thought you might like this: http://honestillusion.com/blogs/blog_0/archive/2008/06/02/dev102-s-programming-job-interview-challenge-6.aspx&amp;subject=DEV102%27s+Programming+Job+Interview+Challenge+%236+"&gt;Email it!&lt;/a&gt; | &lt;a href = "http://del.icio.us/post?url=http://honestillusion.com/blogs/blog_0/archive/2008/06/02/dev102-s-programming-job-interview-challenge-6.aspx&amp;title=DEV102%27s+Programming+Job+Interview+Challenge+%236+" title="Submit DEV102%27s+Programming+Job+Interview+Challenge+%236+ to del.icio.us" &gt;bookmark it!&lt;/a&gt; | &lt;a href = "http://www.digg.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/06/02/dev102-s-programming-job-interview-challenge-6.aspx&amp;phase=2" title="Submit DEV102%27s+Programming+Job+Interview+Challenge+%236+ to digg.com"&gt;digg it!&lt;/a&gt; | &lt;a href = "http://reddit.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/06/02/dev102-s-programming-job-interview-challenge-6.aspx&amp;title=DEV102%27s+Programming+Job+Interview+Challenge+%236+" title="Submit DEV102%27s+Programming+Job+Interview+Challenge+%236+ to reddit.com"&gt;reddit!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://honestillusion.com/aggbug.aspx?PostID=4914" width="1" height="1"&gt;</content><author><name>James</name><uri>http://honestillusion.com/members/James.aspx</uri></author><category term="Code" scheme="http://honestillusion.com/blogs/blog_0/archive/tags/Code/default.aspx" /><category term="C#" scheme="http://honestillusion.com/blogs/blog_0/archive/tags/C_2300_/default.aspx" /><category term=".Net" scheme="http://honestillusion.com/blogs/blog_0/archive/tags/.Net/default.aspx" /><category term="dotnet" scheme="http://honestillusion.com/blogs/blog_0/archive/tags/dotnet/default.aspx" /><category term="csharp" scheme="http://honestillusion.com/blogs/blog_0/archive/tags/csharp/default.aspx" /></entry><entry><title>DEV102's Programming Job Interview Challenge #5</title><link rel="alternate" type="text/html" href="http://honestillusion.com/blogs/blog_0/archive/2008/05/26/dev102-s-programming-job-interview-challenge-5.aspx" /><id>http://honestillusion.com/blogs/blog_0/archive/2008/05/26/dev102-s-programming-job-interview-challenge-5.aspx</id><published>2008-05-26T12:57:20Z</published><updated>2008-05-26T12:57:20Z</updated><content type="html">
  &lt;p&gt;DEV102 announced the &lt;a href="http://www.dev102.com/2008/05/26/a-programming-job-interview-challenge-5-records-sorting/"&gt;correct responses to last weeks challenge&lt;/a&gt; today.  Since I announced in my blog I got a prominent spot in their post, which is good considering I was one of about 10,000 correct answers and I gave it rather late in the process.  Hopefully, I can improve on both those areas this week.&lt;/p&gt;  &lt;p&gt;Two other things they messages showed.  1) It apparently takes a lot of hunting on this blog to figure out my name (&lt;strong&gt;James Curran&lt;/strong&gt;), and 2) They like it if you hide the solution with HTML tricks.  Unfortunately, while last week's answer was three simple lines of code, this week's so going to be too long to do that effectively.&lt;/p&gt;  &lt;p&gt;Anyway, on to &lt;a href="http://www.dev102.com/2008/05/26/a-programming-job-interview-challenge-5-records-sorting/"&gt;this week's puzzle&lt;/a&gt;:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;You are asked to sort a collection of records. The records are stored in a file on the disk, and the size of the file is much bigger than available memory you can work with. Assume a record size is 10 bytes and file size is 1GB. you read and write data to/from disk in units of pages where each page is 1KB big. You have few (less than 10) available pages of physical memory. Assume you are given a method to compare two records.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;How can you sort the records under the described conditions?&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The trick here is to do lots of merge sorts, but we get to that in a minute.  But first to prepare, we have to sort each page, hence, read one page, and sort it's records in memory.  Exactly how it's sorted is irrelevant. A page only has 100 10-byte records so Quicksort is probably overkill -- an Insertion sort is probably best. Then that page is written back to the file in place, and we more to the next one.&lt;/p&gt;  &lt;p&gt;When we finish sorting each page individually, then we begin the Mergesort.  Read two pages and merge them by comparing the first items in each list.  Once the new list fills a page, it's written to a new file.  Repeat this, and eventually, you have half as many segments, each two pages long. Then, do it all over again, merging two-page segments into four page segment.  The trick is, since the two-page segments are already sorted, they can be read in one page at a time, and the output can be written to disk as soon as a page is filled.&lt;/p&gt;  &lt;p&gt;Keep repeating the process, merge four-page segment into eight-page segments, 8-pages into 16-page, etc.  Eventually you will be merging two 512-page segments, and you're done.&lt;/p&gt;  &lt;p&gt;The process own requires three pages of physical memory, and we have a bit more, so some optimizing can be done, but that's essentially it.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a title="Email DEV102%27s+Programming+Job+Interview+Challenge+%235" href = "mailto:?body=Thought you might like this: http://honestillusion.com/blogs/blog_0/archive/2008/05/26/dev102-s-programming-job-interview-challenge-5.aspx&amp;subject=DEV102%27s+Programming+Job+Interview+Challenge+%235"&gt;Email it!&lt;/a&gt; | &lt;a href = "http://del.icio.us/post?url=http://honestillusion.com/blogs/blog_0/archive/2008/05/26/dev102-s-programming-job-interview-challenge-5.aspx&amp;title=DEV102%27s+Programming+Job+Interview+Challenge+%235" title="Submit DEV102%27s+Programming+Job+Interview+Challenge+%235 to del.icio.us" &gt;bookmark it!&lt;/a&gt; | &lt;a href = "http://www.digg.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/05/26/dev102-s-programming-job-interview-challenge-5.aspx&amp;phase=2" title="Submit DEV102%27s+Programming+Job+Interview+Challenge+%235 to digg.com"&gt;digg it!&lt;/a&gt; | &lt;a href = "http://reddit.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/05/26/dev102-s-programming-job-interview-challenge-5.aspx&amp;title=DEV102%27s+Programming+Job+Interview+Challenge+%235" title="Submit DEV102%27s+Programming+Job+Interview+Challenge+%235 to reddit.com"&gt;reddit!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://honestillusion.com/aggbug.aspx?PostID=4825" width="1" height="1"&gt;</content><author><name>James</name><uri>http://honestillusion.com/members/James.aspx</uri></author></entry><entry><title>DEV102's Programming Job Interview Challenge #4</title><link rel="alternate" type="text/html" href="http://honestillusion.com/blogs/blog_0/archive/2008/05/23/dev102-s-programming-job-interview-challenge-4.aspx" /><id>http://honestillusion.com/blogs/blog_0/archive/2008/05/23/dev102-s-programming-job-interview-challenge-4.aspx</id><published>2008-05-23T13:58:31Z</published><updated>2008-05-23T13:58:31Z</updated><content type="html">
  &lt;p&gt;The folks at Dev102.com are offering weekly programming challenges, where they offer questions, and let bloggers post about them.  I meant to write an answer for last week, but never got around to it.  Just as well -- my answer would have been wrong.  SO, let's move on to &lt;a href="http://www.dev102.com/2008/05/19/a-programming-job-interview-challenge-4/"&gt;this week's&lt;/a&gt;:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;How would you implement the following method: Foo(7) == 17 and Foo(17) == 7. Any other input to that method is not defined so you can return anything you want. Just follow those rules:&lt;/em&gt;&lt;/p&gt;    &lt;ul&gt;     &lt;li&gt;&lt;em&gt;Conditional statements (if, switch, …) are not allowed. &lt;/em&gt;&lt;/li&gt;      &lt;li&gt;&lt;em&gt;Usage of containers (hash tables, arrays, …) are not allowed. &lt;/em&gt;&lt;/li&gt;   &lt;/ul&gt; &lt;/blockquote&gt;  &lt;p&gt;My first thought was, since we can't use conditional statements, to use conditional &lt;em&gt;expressions&lt;/em&gt; instead:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;int foo(int n)      &lt;br /&gt;{      &lt;br /&gt;    return (n==7) ? 17 : (n==17) ? 7 : n;      &lt;br /&gt;} &lt;/font&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;But clearly, that is just cheating.  (And, besides, it turns out, it's not the best solution).&lt;/p&gt;  &lt;p&gt;My next attempt was to use subtraction to create factors of zero.&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;int foo(int n)      &lt;br /&gt;{      &lt;br /&gt;    return n + (10 * (n-17) * (n-6)) + (-10 * (n-16) * (n-7))  ;      &lt;br /&gt;} &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;There may be a formula in there that works, but that one doesn't, and before I found it, I stumble upon the &lt;em&gt;correct &lt;/em&gt;solution, which was just sitting there staring me in the face:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;int foo(int n)      &lt;br /&gt;{      &lt;br /&gt;    return 24-n;      &lt;br /&gt;} &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Yep, it's just that simple.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a title="Email DEV102%27s+Programming+Job+Interview+Challenge+%234" href = "mailto:?body=Thought you might like this: http://honestillusion.com/blogs/blog_0/archive/2008/05/23/dev102-s-programming-job-interview-challenge-4.aspx&amp;subject=DEV102%27s+Programming+Job+Interview+Challenge+%234"&gt;Email it!&lt;/a&gt; | &lt;a href = "http://del.icio.us/post?url=http://honestillusion.com/blogs/blog_0/archive/2008/05/23/dev102-s-programming-job-interview-challenge-4.aspx&amp;title=DEV102%27s+Programming+Job+Interview+Challenge+%234" title="Submit DEV102%27s+Programming+Job+Interview+Challenge+%234 to del.icio.us" &gt;bookmark it!&lt;/a&gt; | &lt;a href = "http://www.digg.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/05/23/dev102-s-programming-job-interview-challenge-4.aspx&amp;phase=2" title="Submit DEV102%27s+Programming+Job+Interview+Challenge+%234 to digg.com"&gt;digg it!&lt;/a&gt; | &lt;a href = "http://reddit.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/05/23/dev102-s-programming-job-interview-challenge-4.aspx&amp;title=DEV102%27s+Programming+Job+Interview+Challenge+%234" title="Submit DEV102%27s+Programming+Job+Interview+Challenge+%234 to reddit.com"&gt;reddit!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://honestillusion.com/aggbug.aspx?PostID=4766" width="1" height="1"&gt;</content><author><name>James</name><uri>http://honestillusion.com/members/James.aspx</uri></author><category term="Code" scheme="http://honestillusion.com/blogs/blog_0/archive/tags/Code/default.aspx" /><category term="C#" scheme="http://honestillusion.com/blogs/blog_0/archive/tags/C_2300_/default.aspx" /><category term=".Net" scheme="http://honestillusion.com/blogs/blog_0/archive/tags/.Net/default.aspx" /><category term="Programming" scheme="http://honestillusion.com/blogs/blog_0/archive/tags/Programming/default.aspx" /><category term="dotnet" scheme="http://honestillusion.com/blogs/blog_0/archive/tags/dotnet/default.aspx" /><category term="csharp" scheme="http://honestillusion.com/blogs/blog_0/archive/tags/csharp/default.aspx" /></entry><entry><title>The Need for Common Search Keywords.</title><link rel="alternate" type="text/html" href="http://honestillusion.com/blogs/blog_0/archive/2008/04/18/the-need-for-common-search-keywords.aspx" /><id>http://honestillusion.com/blogs/blog_0/archive/2008/04/18/the-need-for-common-search-keywords.aspx</id><published>2008-04-19T00:01:10Z</published><updated>2008-04-19T00:01:10Z</updated><content type="html">
  &lt;p&gt;if you ever tried to Google something like "how to write a linked list in C#" you may have noticed a problem.  Most search engines have trouble dealing with the pound sign (hash/number sign/octothorpe).  You run into the same problem search for information on ".Net" or "COM" or, for that matter, "Word" or "Access".  &lt;/p&gt;  &lt;p&gt;I hit upon a similar problem a few years ago.  I was trying to set up Microsoft Money to access my bank accounts online.  I went to my banks' websites, but had trouble finding the setup instructions.  Searching a bank's website for "Money" provides many false hits.  Searching for "Microsoft" isn't much better, when every page's footer contains "Best view on Microsoft Internet Explorer 2.0 or later".  Finally, I hit upon the trick:  I searched the site for "Quicken".  The instruction for Microsoft Money were always on the same page as the instruction for Quicken.&lt;/p&gt;  &lt;p&gt;This lead to to the idea to solve the problem I mentioned up top.  Basically, for very technology or product with an inconvenient name, we need a standard searchable keyword, so that whenever someone writes a blog post about a C# topic, if he includes the "csharp" keyword, then someone searching on "csharp" will be able to find it.  Of course, there's two problems with this: first we have to get bloggers to use the keywords and then we have to make sure the seekers know enough to use them.&lt;/p&gt;  &lt;p&gt;Last night I was at a .Net (dotnet) users' group meeting where some folks from MSDN (the website) were soliciting suggestions on improvements.  I presented this suggestion to them, and they were receptive to it, but it really isn't MSDN targeted at them.  The real solution would be to be a list of officially sanctioned keywords coming direct from Microsoft and  promoted by them (so that banks know to put "msmoney" on a page that described the setup for Microsoft Money.&lt;/p&gt;  &lt;p&gt;But in the mean time, I figured I could leverage some of the blogosphere to help push this idea along. &lt;/p&gt;  &lt;p&gt;So, let's start defining the ground rules.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;A keyword needs to be a single term ("csharp", not "c sharp") &lt;/li&gt;    &lt;li&gt;A keyword needs to uniquely (or very close to it) indicate the subject ("msword", not "word") (If your spell-checker says it's misspelled, that's a good sign) &lt;/li&gt;    &lt;li&gt;A keyword should be a string that is decipherable when written as one word in all lowercase. (so we don't run into the problem of "expertsexchange") &lt;/li&gt;    &lt;li&gt;Unfortunately, there are probably trademark issues to deal with (Microsoft will probably want it to be "microsoftword" instead of "msword") &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;So, to start us off, here are a few I thought up.  Be sure to include them in any blog post (in the body or tags or header) on the subject.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;"C#" = "csharp" &lt;/li&gt;    &lt;li&gt;"C++" = "cplusplus" &lt;/li&gt;    &lt;li&gt;".Net" = "dotnet" &lt;/li&gt;    &lt;li&gt;"ASP.NET" = "aspnet"  (or should we go for "aspdotnet"?) &lt;/li&gt;    &lt;li&gt;"ASP.NET Ajax" = "aspnetajax" &lt;/li&gt;    &lt;li&gt;"LINQ" = "linq" (that was easy -- maybe Microsoft is learning). &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt; &lt;/p&gt; &lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fhonestillusion.com%2fblogs%2fblog_0%2farchive%2f2008%2f04%2f18%2fthe-need-for-common-search-keywords.aspx"&gt;&lt;img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fhonestillusion.com%2fblogs%2fblog_0%2farchive%2f2008%2f04%2f18%2fthe-need-for-common-search-keywords.aspx" border="0" /&gt;&lt;/a&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a title="Email The+Need+for+Common+Search+Keywords." href = "mailto:?body=Thought you might like this: http://honestillusion.com/blogs/blog_0/archive/2008/04/18/the-need-for-common-search-keywords.aspx&amp;subject=The+Need+for+Common+Search+Keywords."&gt;Email it!&lt;/a&gt; | &lt;a href = "http://del.icio.us/post?url=http://honestillusion.com/blogs/blog_0/archive/2008/04/18/the-need-for-common-search-keywords.aspx&amp;title=The+Need+for+Common+Search+Keywords." title="Submit The+Need+for+Common+Search+Keywords. to del.icio.us" &gt;bookmark it!&lt;/a&gt; | &lt;a href = "http://www.digg.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/04/18/the-need-for-common-search-keywords.aspx&amp;phase=2" title="Submit The+Need+for+Common+Search+Keywords. to digg.com"&gt;digg it!&lt;/a&gt; | &lt;a href = "http://reddit.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/04/18/the-need-for-common-search-keywords.aspx&amp;title=The+Need+for+Common+Search+Keywords." title="Submit The+Need+for+Common+Search+Keywords. to reddit.com"&gt;reddit!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://honestillusion.com/aggbug.aspx?PostID=4702" width="1" height="1"&gt;</content><author><name>James</name><uri>http://honestillusion.com/members/James.aspx</uri></author></entry><entry><title>How can I easily log a message to a file for debugging purposes?</title><link rel="alternate" type="text/html" href="http://honestillusion.com/blogs/blog_0/archive/2008/04/16/how-can-i-easily-log-a-message-to-a-file-for-debugging-purposes.aspx" /><id>http://honestillusion.com/blogs/blog_0/archive/2008/04/16/how-can-i-easily-log-a-message-to-a-file-for-debugging-purposes.aspx</id><published>2008-04-16T14:06:47Z</published><updated>2008-04-16T14:06:47Z</updated><content type="html">
  &lt;p&gt;Today, either Bloglines.com or blogs.MSDN.com blinked, and suddenly I'm seeing old entries on the 'C# Frequently Asked Questions' blog as new.  No one has posted anything there in over two years. &lt;/p&gt; &lt;p&gt;Anyway, reading the most recent message, it offered a method for logging a message.  Now, ignoring side debates over log4net vs nLog vs. the Event log vs. Trace, and just concentrating on the code post --- It's not very good.  Look for yourself (then come back here)  &lt;a title="http://blogs.msdn.com/csharpfaq/archive/2006/03/27/562555.aspx" href="http://blogs.msdn.com/csharpfaq/archive/2006/03/27/562555.aspx"&gt;http://blogs.msdn.com/csharpfaq/archive/2006/03/27/562555.aspx&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Despite being written by a C# MVP (*), it shows a lack of understanding of basic .Net library features, and well as C#.  So, I figured, I'd rewrite it.  I limited myself to taking what's there and fixing it instead of going an entirely different way (ie, log4net vs nLog vs etc).  Here's the revised code:&lt;/p&gt; &lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.IO;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; LogMessageToFile(&lt;span class="kwrd"&gt;string&lt;/span&gt; msg)&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;string&lt;/span&gt; logFilepath = Path.Combine(Environment.GetEnvironmentVariable(&lt;span class="str"&gt;"TEMP"&lt;/span&gt;),&lt;span class="str"&gt;"My Log File.txt"&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;    &lt;span class="kwrd"&gt;using&lt;/span&gt; (StreamWriter sw = File.AppendText(logFilepath))&lt;/pre&gt;&lt;pre class="alt"&gt;    {&lt;/pre&gt;&lt;pre&gt;        &lt;span class="kwrd"&gt;string&lt;/span&gt; logLine = String.Format(&lt;span class="str"&gt;"{0:G}: {1}."&lt;/span&gt;, DateTime.Now, msg);&lt;/pre&gt;&lt;pre class="alt"&gt;        sw.WriteLine(logLine);&lt;/pre&gt;&lt;pre&gt;    }&lt;/pre&gt;&lt;pre class="alt"&gt;}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;A few years ago, I bought a number of books, all with the title of same variation of "C# Cookbook".  Again, a lot of bad code.  I've been meaning to start a series of articles about revising them.....&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;(*) Years ago, I was one of the very first C++ MVPs.  After ten years, I was dropped from the program.  Since then I've tried to become a C# MVP, without any luck. I'm beginning to get bitter about it.  ;-)&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a title="Email How+can+I+easily+log+a+message+to+a+file+for+debugging+purposes%3f" href = "mailto:?body=Thought you might like this: http://honestillusion.com/blogs/blog_0/archive/2008/04/16/how-can-i-easily-log-a-message-to-a-file-for-debugging-purposes.aspx&amp;subject=How+can+I+easily+log+a+message+to+a+file+for+debugging+purposes%3f"&gt;Email it!&lt;/a&gt; | &lt;a href = "http://del.icio.us/post?url=http://honestillusion.com/blogs/blog_0/archive/2008/04/16/how-can-i-easily-log-a-message-to-a-file-for-debugging-purposes.aspx&amp;title=How+can+I+easily+log+a+message+to+a+file+for+debugging+purposes%3f" title="Submit How+can+I+easily+log+a+message+to+a+file+for+debugging+purposes%3f to del.icio.us" &gt;bookmark it!&lt;/a&gt; | &lt;a href = "http://www.digg.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/04/16/how-can-i-easily-log-a-message-to-a-file-for-debugging-purposes.aspx&amp;phase=2" title="Submit How+can+I+easily+log+a+message+to+a+file+for+debugging+purposes%3f to digg.com"&gt;digg it!&lt;/a&gt; | &lt;a href = "http://reddit.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/04/16/how-can-i-easily-log-a-message-to-a-file-for-debugging-purposes.aspx&amp;title=How+can+I+easily+log+a+message+to+a+file+for+debugging+purposes%3f" title="Submit How+can+I+easily+log+a+message+to+a+file+for+debugging+purposes%3f to reddit.com"&gt;reddit!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://honestillusion.com/aggbug.aspx?PostID=4660" width="1" height="1"&gt;</content><author><name>James</name><uri>http://honestillusion.com/members/James.aspx</uri></author><category term="Code" scheme="http://honestillusion.com/blogs/blog_0/archive/tags/Code/default.aspx" /><category term="C#" scheme="http://honestillusion.com/blogs/blog_0/archive/tags/C_2300_/default.aspx" /><category term=".Net" scheme="http://honestillusion.com/blogs/blog_0/archive/tags/.Net/default.aspx" /><category term="Programming" scheme="http://honestillusion.com/blogs/blog_0/archive/tags/Programming/default.aspx" /><category term="MVP" scheme="http://honestillusion.com/blogs/blog_0/archive/tags/MVP/default.aspx" /></entry><entry><title>Predictions</title><link rel="alternate" type="text/html" href="http://honestillusion.com/blogs/blog_0/archive/2008/03/25/predictions.aspx" /><id>http://honestillusion.com/blogs/blog_0/archive/2008/03/25/predictions.aspx</id><published>2008-03-26T03:16:00Z</published><updated>2008-03-26T03:16:00Z</updated><content type="html">
  &lt;P&gt;My friend Chris is, like me, a staunch Democratic.  Unlike me, he's also an incredible pessimist.  In 2006, he made what he called his "optimistic" prediction for the midterm election: The democrats would gain 3 Senate seat, 10 house seats, and 3 governorships. (Actual results: Democrats gained 6 Senate seats, 30 House seats, and 6 Governors).  I didn't make any predictions then.&lt;/P&gt;
&lt;P&gt;Since another election is looming, he's made is his predictions for the elections, and in the interest of balance, I've made mine.  And, since I'm probably going to lose the napkin I wrote them down on before November, I figured I'd record them here, so I know where I can find them, after the election.&lt;/P&gt;
&lt;P&gt;So, here goes:&lt;/P&gt;
&lt;H2&gt;Chris's Predictions&lt;/H2&gt;
&lt;P&gt;Republicans will gain 8 house seats, 2 governorship while the Senate will stay the same.  McCain will become president, winning 36 states.&lt;/P&gt;
&lt;H2&gt;James's Predictions:&lt;/H2&gt;
&lt;P&gt;Democrats will gain 10 House seats, 4 Senate seats, and 2 governorships.  The democrat will win the White House, winning 20 (mostly large) states.&lt;/P&gt;
&lt;P&gt;Neither of us ventured a prediction on who will be the Democratic candidate.  Chris wants Obama, because he things he has the best chance of winning.  I want Clinton, because I think she'll be the best president.&lt;/P&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a title="Email Predictions" href = "mailto:?body=Thought you might like this: http://honestillusion.com/blogs/blog_0/archive/2008/03/25/predictions.aspx&amp;subject=Predictions"&gt;Email it!&lt;/a&gt; | &lt;a href = "http://del.icio.us/post?url=http://honestillusion.com/blogs/blog_0/archive/2008/03/25/predictions.aspx&amp;title=Predictions" title="Submit Predictions to del.icio.us" &gt;bookmark it!&lt;/a&gt; | &lt;a href = "http://www.digg.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/03/25/predictions.aspx&amp;phase=2" title="Submit Predictions to digg.com"&gt;digg it!&lt;/a&gt; | &lt;a href = "http://reddit.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2008/03/25/predictions.aspx&amp;title=Predictions" title="Submit Predictions to reddit.com"&gt;reddit!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://honestillusion.com/aggbug.aspx?PostID=4583" width="1" height="1"&gt;</content><author><name>James</name><uri>http://honestillusion.com/members/James.aspx</uri></author></entry><entry><title>Joins - LINQ's critical, overlooked feature.</title><link rel="alternate" type="text/html" href="http://honestillusion.com/blogs/blog_0/archive/2007/12/18/joins-linq-s-critical-overlooked-feature.aspx" /><id>http://honestillusion.com/blogs/blog_0/archive/2007/12/18/joins-linq-s-critical-overlooked-feature.aspx</id><published>2007-12-19T01:35:00Z</published><updated>2007-12-19T01:35:00Z</updated><content type="html">
  &lt;p&gt;As i was planning my rewrite of NJTheater.com I looked at a couple different Object-Relationship Mappers (mostly code generators which examined a database schema and produced one class per table to read and write rows to it.  All seemed particularly lacking because of this.  Then I find LINQ, and realized that I had found exact the system I was looking for.&lt;/p&gt;  &lt;p&gt;To understand the problem, consider the main page of NJTheater.com, which on your average day looks something like this:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The Blue Bird (11/27/2007 - 12/31/2007)      &lt;br /&gt;by Shakespeare Theatre of New Jersey (at F.M. Kirby Theater in Madison) &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Doubt (11/27/2007 - 12/23/2007)      &lt;br /&gt;by George Street Playhouse (at George Street Playhouse in New Brunswick) &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Seussical: The Musical (12/1/2007 - 12/23/2007)      &lt;br /&gt;by Bergen County Players (at Little Firehouse Theatre in Oradell) &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The database is heavily normalized, so to retrieve that data, I need an SQL query that looks like this: &lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;Select pl.Title, p.StartDate, p.EndDate, t.Name, v.Name, v.City      &lt;br /&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;From Productions P      &lt;br /&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;inner join Troupes T on p.TroupeID = t.TroupeID      &lt;br /&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;inner join Venues V on p.VenueID = v.VenueID      &lt;br /&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;inner join Plays pl on p.PlayID = pl.PlayID      &lt;br /&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;where p. FirstDate &amp;gt;= GetDate() and p.FirstDate &amp;lt;= GetDate() + 7&lt;/font&gt;&lt;/p&gt; p&amp;gt;The actual query is a bit more complicated, but we'll go with that for now.   &lt;p&gt;That's one SQL statement which returns 3 to 30 rows (depending on the week) which holds all the data to be displayed.&lt;/p&gt;  &lt;p&gt;Which brings us to the problem.  Most ORM systems would have me translate that into something like&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;ProductionList productions = db.Productions.WhereBetween("StartDate", datetime.Now, DateTime.Now.AddDay(7));&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;And then use it like this:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;foreach (Production prod in productions)      &lt;br /&gt;     Print prod.Play.Title +" ( " +prod.StartDate + " - " + prod.EndDate + ")"       &lt;br /&gt;     Print "by " + prod.Troupe.Name " (at " + prod.Venue.Name + " in "+ prod.Venue.City +")"&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;(I made that syntax up, but it's fairly typical.)&lt;/p&gt;  &lt;p&gt;Which brings us to the problem.  The first line would generate one SQL query  which would look something like this:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;Select p.*      &lt;br /&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;From Productions P      &lt;br /&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;where p. FirstDate &amp;gt;= GetDate() and p.FirstDate &amp;lt;= GetDate() + 7&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;and would return about 15 records.  However, when it goes into the loop to render the actual page, then we sudden have a lot more SQL queries:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;Select title from play where playid = 123;      &lt;br /&gt;select name from troupe where troupeid=131;       &lt;br /&gt;select name, city  from venue where venueid=102;&lt;/font&gt;&lt;/p&gt; &lt;font face="Courier New"&gt;Select title from play where playid = 143;    &lt;br /&gt;select name from troupe where troupeid=134;     &lt;br /&gt;select name, city  from venue where venueid=202;&lt;/font&gt;   &lt;p&gt;etc etc.  We go from one query returning N rows, to 3N+1 queries.  We've just massively increased the amount of work needed to be done to render the front (and most popular)page on the web site.&lt;/p&gt;  &lt;p&gt;Which brings us back to LINQ.    The LINQ query I use is:&lt;/p&gt;  &lt;p&gt;var productions = from prod in db.Productions    &lt;br /&gt;        where prod.StartDate &amp;lt; DateTime.Now.AddDays(7)     &lt;br /&gt;        &amp;amp;&amp;amp; prod.StartDate &amp;gt; DateTime.Now     &lt;br /&gt;        orderby prod.Play.Title     &lt;br /&gt;        select new  &lt;br /&gt;               {     &lt;br /&gt;                   Title = prod.Play.Title,     &lt;br /&gt;                   Troupe = prod.Troupe.Name,     &lt;br /&gt;                   Venue = prod.Venue.Name,     &lt;br /&gt;                   City = prod.Venue.City,     &lt;br /&gt;                   StartDate = prod.StartDate ,     &lt;br /&gt;                   EndDate = prod.EndDate &lt;/p&gt;  &lt;p&gt;               };&lt;/p&gt; &lt;font face="Courier New"&gt;foreach (Production prod in productions)    &lt;br /&gt;     Print prod.Title +" ( " +prod.StartDate + " - " + prod.EndDate + ")"     &lt;br /&gt;     Print "by " + prod.Troupe " (at " + prod.Venue + " in "+ prod.City +")"&lt;/font&gt;   &lt;p&gt;The first thing you should notice is that except for the verbose select clause, this syntax is rather close to the one for my theoretic ORM.&lt;/p&gt;  &lt;p&gt;A more subtle difference is that I've slipped in a orderby based on one of the JOINs, which I'm not sure how I'd  do in the ORM.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;But the most important thing you should notice is that this will produce a single SQL statement, one that is virtual identical to the hand-crafted one I started this article with.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="ver"&gt;If you don't believe me, here's output from LINQPad:&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;SELECT [t].[Title], [t2].[ Name ] AS [Troupe], [t3].[ Name ] AS [Venue], [t3].[City],    &lt;br /&gt;       [t0].[FirstPerformance] AS [StartDate], [t0].[LastPerformance] AS [EndDate]     &lt;br /&gt;FROM [Productions] AS [t0]     &lt;br /&gt;INNER JOIN [Plays] AS [t1] ON [t1].[PlayID] = [t0].[PlayID]     &lt;br /&gt;INNER JOIN [Troupes] AS [t2] ON [t2].[TroupeID] = [t0].[TroupeID]     &lt;br /&gt;LEFT OUTER JOIN [Venues] AS [t3] ON [t3].[VenueID] = [t0].[VenueID]     &lt;br /&gt;WHERE ([t0].[FirstPerformance] &amp;lt; @p0) AND ([t0].[LastPerformance] &amp;gt; @p1)     &lt;br /&gt;ORDER BY [t1].[Title]     &lt;br /&gt;    &lt;br /&gt;-- @p0: Input DateTime (Size = 0; Prec = 0; Scale = 0) [12/25/2007 7:00:54 PM]     &lt;br /&gt;-- @p1: Input DateTime (Size = 0; Prec = 0; Scale = 0) [12/18/2007 7:00:54 PM]     &lt;br /&gt;-- Context: SqlProvider(Sql2005) Model: AttributedMetaModel Build: 3.5.21022.8     &lt;br /&gt;&lt;/p&gt; &lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fhonestillusion.com%2fblogs%2fblog_0%2farchive%2f2007%2f12%2f18%2fjoins-linq-s-critical-overlooked-feature.aspx"&gt;&lt;img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fhonestillusion.com%2fblogs%2fblog_0%2farchive%2f2007%2f12%2f18%2fjoins-linq-s-critical-overlooked-feature.aspx" border="0" /&gt;&lt;/a&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a title="Email Joins+-+LINQ%27s+critical%2c+overlooked+feature." href = "mailto:?body=Thought you might like this: http://honestillusion.com/blogs/blog_0/archive/2007/12/18/joins-linq-s-critical-overlooked-feature.aspx&amp;subject=Joins+-+LINQ%27s+critical%2c+overlooked+feature."&gt;Email it!&lt;/a&gt; | &lt;a href = "http://del.icio.us/post?url=http://honestillusion.com/blogs/blog_0/archive/2007/12/18/joins-linq-s-critical-overlooked-feature.aspx&amp;title=Joins+-+LINQ%27s+critical%2c+overlooked+feature." title="Submit Joins+-+LINQ%27s+critical%2c+overlooked+feature. to del.icio.us" &gt;bookmark it!&lt;/a&gt; | &lt;a href = "http://www.digg.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2007/12/18/joins-linq-s-critical-overlooked-feature.aspx&amp;phase=2" title="Submit Joins+-+LINQ%27s+critical%2c+overlooked+feature. to digg.com"&gt;digg it!&lt;/a&gt; | &lt;a href = "http://reddit.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2007/12/18/joins-linq-s-critical-overlooked-feature.aspx&amp;title=Joins+-+LINQ%27s+critical%2c+overlooked+feature." title="Submit Joins+-+LINQ%27s+critical%2c+overlooked+feature. to reddit.com"&gt;reddit!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://honestillusion.com/aggbug.aspx?PostID=4569" width="1" height="1"&gt;</content><author><name>James</name><uri>http://honestillusion.com/members/James.aspx</uri></author></entry><entry><title>My Second CodePlex Project : State Theater</title><link rel="alternate" type="text/html" href="http://honestillusion.com/blogs/blog_0/archive/2007/12/17/my-second-codeplex-project-state-theater.aspx" /><id>http://honestillusion.com/blogs/blog_0/archive/2007/12/17/my-second-codeplex-project-state-theater.aspx</id><published>2007-12-17T17:35:09Z</published><updated>2007-12-17T17:35:09Z</updated><content type="html">
  &lt;p&gt;Well, as I promised months ago, I've created my second CodePlex project.  Actually, I created months ago, while this site was down (as the artist I am, I think I'll refer to that as it's "black period"), But now that I'm back, I guess it's time to make a formal announcement.&lt;/p&gt; &lt;p&gt;The &lt;a href="http://www.codeplex.com/StateTheater" target="_blank"&gt;State Theater Project&lt;/a&gt; is my attempt to completely rewrite my main web site (&lt;a href="http://www.njtheater.com"&gt;www.njtheater.com&lt;/a&gt;).  The original (still at that web address for now) was written by me, mostly 10 years ago, in classic ASP.   The ASP pages are almost purely presentational -- they just read stuff from the database and display it on the screen, using a lot of questionable techniques (in some spots, I was formatting HTML in SQL select statements)&lt;/p&gt; &lt;p&gt;I added a few pages "recently" (i.e. within the last five years) in C#/ASP.NET.  These were interactive, and mostly hidden from view of most users.  Only registered users having certain roles saw them, and those pages allow those users to enter updates directly into the web site's database.&lt;/p&gt; &lt;p&gt;However, most of the theater companies just emailed the details of the shows, and hoped I found time to enter them.  (Especially, since most of the important info can't be entered via the web pages, so only I could do it).&lt;/p&gt; &lt;p&gt;The main problem is that I needed a Ajax-based drop-down listbox, because the database is heavily normalized, so when someone entered "William Shakespeare", I needed to know they really meant Person ID#74.  &lt;/p&gt; &lt;p&gt;Some years ago I paid good cash for one such control, which allowed me to get the few pages working that I did.  But it was rather limited (I still don't think it works with Firefox) and has a spotty update &amp;amp; support history and in general wasn't letting me advance.  When the Ajax craze start two years ago, a number of new, better and &lt;strong&gt;free&lt;/strong&gt; DDL controls became available, so I started to look into a new approach.&lt;/p&gt; &lt;p&gt;Originally, I planned on a complete ASP.NET approach, and started to work on that in the spring of 2006.  The first problem I had was my membership/roles data.  Membership was based on the FORUM_MEMBER table from Snitz Forums, which I had been using for the Forums section of the site.  &lt;/p&gt; &lt;p&gt;Now, Snitz is a fine forums packages, but it's also Classic ASP, but is getting kinda old -- it hasn't had a major update in year, and in fact, has had only two minor updates (most fixing security breaches) in the last 2 1/2 years.  But mostly, the problem with it is that it's membership system was intended to be used strictly for the forums themselves, and any allowance for it to be used as a general web site membership subsystem were clearly an afterthought.&lt;/p&gt; &lt;p&gt;What I wanted to do was to use the ASP.NET membership system that came with v2.0.  The trouble here was that Snitz stored passwords as a one-way hash.  There is no way to convert them back into the original password.  Which means that there's no way to more the account to the new database structure.  I'd have to assign new passwords to my 2000+ users.  That's wasn't workable.&lt;/p&gt; &lt;p&gt;Ah, but the ASP.NET membership system works on the provider model.  The SqlMembershipProvider that comes with 2.0 is just one example.  I could just write my own provider which used the existing table structure as a backing store.  I began this project in the summer of 2006. &lt;/p&gt; &lt;p&gt;The next problem was my laptop.  I was doing most of the work my lunch hour and one the train to &amp;amp; from work.  But my laptop was excessively old. (It was three years old when I bought it on eBay, and that was three years earlier).  It was taking much of the train trip just to awake from hibernation. I was just days away from buying a brand-spanking new laptop when I completely new problem arose -- I was laid off from my job.&lt;/p&gt; &lt;p&gt;Now, I bounced back from that fairly quickly --- but the time out of work chewed up the saving I was planning on using to buy the laptop--- but the new job gave me a laptop --- but the new job took away train ride to work (I had to drive there), and because I was consulting, I had to take short lunches.&lt;/p&gt; &lt;p&gt;Anyway, seven months later, that contract ended, and a new one began -- back on the train to NYC, and this time it was one long ride instead of two short ones, so I could get more done.  After a few weeks of saving, I finally got that new laptop, and I could finally complete the SnitzMembershipProvider which became the first CodePlex project, only a year after I had started it.&lt;/p&gt; &lt;p&gt;And so then I finally began the work on revising the web site. But, by this time, I'd become fascinated with &lt;a href="http://www.castleproject.org/monorail" target="_blank"&gt;Castle Monorail&lt;/a&gt; and LINQ, and decided to try those for the web site.   Plus, as much of the graphic design was mixed with the code, I tried for a more generic, skinnable approach of putting everything in &amp;lt;DIV&amp;gt;s and using CSS for styling it.  Finally, I'm trying to make it generic enough so that some other group in a different state could take the code and create there own similar web site for their state -- with a completely different look, just by changing the CSS file.&lt;/p&gt; &lt;p&gt;For the Ajax work, and pretty much all the interactive forms, I'm using the &lt;a href="http://extjs.com/" target="_blank"&gt;Ext.Js&lt;/a&gt; library, except for large textboxes, for which I'm using &lt;a href="http://tinymce.moxiecode.com/" target="_blank"&gt;TinyMCE&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;You can see what I've done so far as &lt;a href="http://www.NJTheater.org"&gt;www.NJTheater.org&lt;/a&gt;.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a title="Email My+Second+CodePlex+Project+%3a+State+Theater" href = "mailto:?body=Thought you might like this: http://honestillusion.com/blogs/blog_0/archive/2007/12/17/my-second-codeplex-project-state-theater.aspx&amp;subject=My+Second+CodePlex+Project+%3a+State+Theater"&gt;Email it!&lt;/a&gt; | &lt;a href = "http://del.icio.us/post?url=http://honestillusion.com/blogs/blog_0/archive/2007/12/17/my-second-codeplex-project-state-theater.aspx&amp;title=My+Second+CodePlex+Project+%3a+State+Theater" title="Submit My+Second+CodePlex+Project+%3a+State+Theater to del.icio.us" &gt;bookmark it!&lt;/a&gt; | &lt;a href = "http://www.digg.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2007/12/17/my-second-codeplex-project-state-theater.aspx&amp;phase=2" title="Submit My+Second+CodePlex+Project+%3a+State+Theater to digg.com"&gt;digg it!&lt;/a&gt; | &lt;a href = "http://reddit.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2007/12/17/my-second-codeplex-project-state-theater.aspx&amp;title=My+Second+CodePlex+Project+%3a+State+Theater" title="Submit My+Second+CodePlex+Project+%3a+State+Theater to reddit.com"&gt;reddit!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://honestillusion.com/aggbug.aspx?PostID=4568" width="1" height="1"&gt;</content><author><name>James</name><uri>http://honestillusion.com/members/James.aspx</uri></author></entry><entry><title>Oh My God! It's back!</title><link rel="alternate" type="text/html" href="http://honestillusion.com/blogs/blog_0/archive/2007/12/04/oh-my-god-it-s-back.aspx" /><id>http://honestillusion.com/blogs/blog_0/archive/2007/12/04/oh-my-god-it-s-back.aspx</id><published>2007-12-04T20:40:09Z</published><updated>2007-12-04T20:40:09Z</updated><content type="html">
  &lt;p&gt;Yes, after about 5 months of downtime, I finally was able to restore my blog.&lt;/p&gt; &lt;p&gt;What happened was, sometime mid-July, the PC that was running Sql Server on my network died.  It was acting funny for a few weeks, so I took it off line.  I removed the hard disk from it and attempted to install it on a different machine.  It worked OK as a second drive, but I couldn't boot from it.  At this point, I should have just left it as a second drive, but I didn't....&lt;/p&gt; &lt;p&gt;I tried re-installing Windows on that drive, and as I was doing this, the second PC failed.  That PC was my Internet gateway, so it was imperative that I get that one back online.  I shuffled disks around a bit, and got it working again.&lt;/p&gt; &lt;p&gt;Map of PCs:&lt;/p&gt; &lt;p&gt;pcA - Internet Gateway  (old Compaq, circa 2001)&lt;/p&gt; &lt;p&gt;pcB - Sql Server 2000  (identical old Compaq)&lt;/p&gt; &lt;p&gt;pcC - Sql Server 2005 (more recent generic PC, circa 2004)&lt;/p&gt; &lt;p&gt;pcD - Web server (Micron PC, circa 2002)&lt;/p&gt; &lt;p&gt;pcE - Work machine (generic PC, circa 2006)&lt;/p&gt; &lt;p&gt;pcF - HomeServer Beta 2 (generic PC, circa 2007)&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Now, pcB had been decommissioned, by was still was on the table with the others. pcC died, which is why the blog went down.   I tried moving the disk to pcA, which then proceeded to die itself.  I move the system disk from pcA to pcB to regain access to the Internet.  (Complication -- they had different NIC cards).  I then had to install the other apps that were running on pcC (notably my mail server). In midst of all this disk swapping, twice I forgot to power down the PC before pulled &amp;amp; reattaching a ribbon cable to a disk -- which killed the disks, one of which was the system disk to pcC.&lt;/p&gt; &lt;p&gt;So, all I needed to do now was to restore the back up of pcC from HomeServer onto a new hard disk.  pcA seemed to recover and I bought a new HD at a computer show, so, mid-August, you would think I was good to go.  No such luck.  HomeServer refused to restore the disk.  Which was crazy, as I had already restore that disk a few weeks earlier -- You'll recall that I said that pcC had been flaky for a while; one of those acts of flakiness was crashing it's hard disk.&lt;/p&gt; &lt;p&gt;One bought a new PC, which we'll call pcG (Woot.com had a close-out for $250).  HomeServer refused to restore to that machine either.   Finally, I had an idea: I put a disk back into pcC, and boot up HomeServer's restore disk on that.  This time it would restore the disk.  I then quickly copied the database files off it. (The website is now being run off SqlServer Express on pcD, which means beside reducing the number of mission-critical PCs from two to one, the setup is now finally LEGAL).&lt;/p&gt; &lt;p&gt;In the coming days, I plan on installing HomeServer RTM on pcF, and decommission my pcG (or at least salvage the most of the hard disks from it, for the new HomeServer).  I'm not sure what pcG's eventual use will be, but I'm happy just to be back to square one.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a title="Email Oh+My+God!+It%27s+back!" href = "mailto:?body=Thought you might like this: http://honestillusion.com/blogs/blog_0/archive/2007/12/04/oh-my-god-it-s-back.aspx&amp;subject=Oh+My+God!+It%27s+back!"&gt;Email it!&lt;/a&gt; | &lt;a href = "http://del.icio.us/post?url=http://honestillusion.com/blogs/blog_0/archive/2007/12/04/oh-my-god-it-s-back.aspx&amp;title=Oh+My+God!+It%27s+back!" title="Submit Oh+My+God!+It%27s+back! to del.icio.us" &gt;bookmark it!&lt;/a&gt; | &lt;a href = "http://www.digg.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2007/12/04/oh-my-god-it-s-back.aspx&amp;phase=2" title="Submit Oh+My+God!+It%27s+back! to digg.com"&gt;digg it!&lt;/a&gt; | &lt;a href = "http://reddit.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2007/12/04/oh-my-god-it-s-back.aspx&amp;title=Oh+My+God!+It%27s+back!" title="Submit Oh+My+God!+It%27s+back! to reddit.com"&gt;reddit!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://honestillusion.com/aggbug.aspx?PostID=4567" width="1" height="1"&gt;</content><author><name>James</name><uri>http://honestillusion.com/members/James.aspx</uri></author></entry><entry><title>My First CodePlex Project : SnitzMember</title><link rel="alternate" type="text/html" href="http://honestillusion.com/blogs/blog_0/archive/2007/06/20/my-first-codeplex-project-snitzmember.aspx" /><id>http://honestillusion.com/blogs/blog_0/archive/2007/06/20/my-first-codeplex-project-snitzmember.aspx</id><published>2007-06-20T18:33:33Z</published><updated>2007-06-20T18:33:33Z</updated><content type="html">
  &lt;p&gt;After many months to checking out the new projects on CodePlex almost daily, it's finally time for me to create one.  &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;As you might know, I also run the website, NJTheater.com.  Written about 10 years ago, all in classic ASP, it has a forum section -- which uses the open source Snitz Forum package.&lt;/p&gt; &lt;p&gt;Over the years, the membership has grown (over 3000 registered users), and I started to use the forum membership database, to manage authorization in other others of the website.&lt;/p&gt; &lt;p&gt;Now ASP.Net v2 came out, with it's built in Authentication/Authorization system, I thought "That's exactly what I need for my website" --- except it used a completely different db schema then the one I already had (and each hashed the passwords in different ways, so no conversion from one to the other was possible).&lt;/p&gt; &lt;p&gt;Fortunately, the membership system was built on using the Provider model, so I just had to create a Membership provider which fitted the interface, but used the existing membership database.   &lt;a href="http://www.codeplex.com/SnitzMember" target="_blank"&gt;SnitzMember&lt;/a&gt; is the provider.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Also, you may have noticed that I referred to this as my &lt;em&gt;first&lt;/em&gt; CodePlex project.  Well, you may have also noticed that I referred to NJTheater.com as 10 years old, and written in Classic ASP.  Stay Tuned.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a title="Email My+First+CodePlex+Project+%3a+SnitzMember" href = "mailto:?body=Thought you might like this: http://honestillusion.com/blogs/blog_0/archive/2007/06/20/my-first-codeplex-project-snitzmember.aspx&amp;subject=My+First+CodePlex+Project+%3a+SnitzMember"&gt;Email it!&lt;/a&gt; | &lt;a href = "http://del.icio.us/post?url=http://honestillusion.com/blogs/blog_0/archive/2007/06/20/my-first-codeplex-project-snitzmember.aspx&amp;title=My+First+CodePlex+Project+%3a+SnitzMember" title="Submit My+First+CodePlex+Project+%3a+SnitzMember to del.icio.us" &gt;bookmark it!&lt;/a&gt; | &lt;a href = "http://www.digg.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2007/06/20/my-first-codeplex-project-snitzmember.aspx&amp;phase=2" title="Submit My+First+CodePlex+Project+%3a+SnitzMember to digg.com"&gt;digg it!&lt;/a&gt; | &lt;a href = "http://reddit.com/submit?url=http://honestillusion.com/blogs/blog_0/archive/2007/06/20/my-first-codeplex-project-snitzmember.aspx&amp;title=My+First+CodePlex+Project+%3a+SnitzMember" title="Submit My+First+CodePlex+Project+%3a+SnitzMember to reddit.com"&gt;reddit!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://honestillusion.com/aggbug.aspx?PostID=4566" width="1" height="1"&gt;</content><author><name>James</name><uri>http://honestillusion.com/members/James.aspx</uri></author></entry></feed>