<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Humor</title>
        <link>http://ayende.com/Blog/category/472.aspx</link>
        <description>Humor</description>
        <language>en-US</language>
        <copyright>Ayende Rahien</copyright>
        <managingEditor>Ayende@ayende.com</managingEditor>
        <generator>Subtext Version 2.0.0.0</generator>
        <item>
            <title>NHibernate &amp;ndash; Get Thou Out Of My Database &amp;ndash; 2nd Edition</title>
            <link>http://ayende.com/Blog/archive/2009/06/08/nhibernate-ndash-get-thou-out-of-my-database-ndash-2nd.aspx</link>
            <description>&lt;p&gt;Following up on &lt;a href="http://ayende.com/Blog/archive/2009/06/06/nhibernate-ndash-get-thou-out-of-my-database.aspx"&gt;my previous post&lt;/a&gt;, the customer has complained about table names like [tbl_-1434067361], apparently they felt that this was misusing their naming policy. I told them that while I understood that, it &lt;em&gt;did&lt;/em&gt; meet their naming policy. I got a new naming policy that stated that numbers are not allowed in column or table name, (and showing forethought) that table names must be composed of valid English words.&lt;/p&gt;  &lt;p&gt;I, of course, decided that if this is what they wanted, they will get just that. And created this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/NHibernateGetThouOutOfMyDatabase2ndEditi_10BE2/image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/NHibernateGetThouOutOfMyDatabase2ndEditi_10BE2/image_thumb_1.png" width="866" height="379" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The words.txt file was taken from this URL: &lt;a title="http://www.puzzlers.org/pub/wordlists/pocket.txt" href="http://www.puzzlers.org/pub/wordlists/pocket.txt"&gt;http://www.puzzlers.org/pub/wordlists/pocket.txt&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The result is exactly per their specification:&lt;/p&gt;  &lt;blockquote&gt;   &lt;div&gt;     &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;create&lt;/span&gt; &lt;span style="color: #0000ff"&gt;table&lt;/span&gt; [tbl_colonel] (
  [col_verbiage] &lt;span style="color: #0000ff"&gt;INT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;IDENTITY&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,
   [col_unsparing] NVARCHAR(255) &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,
   [col_indomitable] NVARCHAR(255) &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,
   [col_bulldog] &lt;span style="color: #0000ff"&gt;BIT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,
   [col_thank] DATETIME &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,
   &lt;span style="color: #0000ff"&gt;primary&lt;/span&gt; &lt;span style="color: #0000ff"&gt;key&lt;/span&gt; ([col_verbiage])
)
&lt;span style="color: #0000ff"&gt;create&lt;/span&gt; &lt;span style="color: #0000ff"&gt;table&lt;/span&gt; [tbl_stump] (
  [col_upheaval] &lt;span style="color: #0000ff"&gt;INT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;IDENTITY&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,
   [col_promissory] NVARCHAR(255) &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,
   [col_predecessor] NVARCHAR(255) &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,
   [col_chafer] NVARCHAR(255) &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,
   [col_unyoke] &lt;span style="color: #0000ff"&gt;INT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,
   [col_vise] NVARCHAR(255) &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,
   PostId &lt;span style="color: #0000ff"&gt;INT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,
   &lt;span style="color: #0000ff"&gt;primary&lt;/span&gt; &lt;span style="color: #0000ff"&gt;key&lt;/span&gt; ([col_upheaval])
)

&lt;span style="color: #0000ff"&gt;create&lt;/span&gt; &lt;span style="color: #0000ff"&gt;table&lt;/span&gt; [tbl_reprieve] (
  [col_wherewith] &lt;span style="color: #0000ff"&gt;INT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;IDENTITY&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,
   [col_wolf] VARBINARY(8000) &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,
   [col_legendary] NVARCHAR(255) &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,
   [col_ago] NVARCHAR(255) &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,
   [col_carabineer] DATETIME &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,
   [col_referee] NVARCHAR(255) &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;,
   &lt;span style="color: #0000ff"&gt;primary&lt;/span&gt; &lt;span style="color: #0000ff"&gt;key&lt;/span&gt; ([col_wherewith])
)&lt;/pre&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;

&lt;p&gt;The fun part about this approach is that you &lt;em&gt;still&lt;/em&gt; get great level of security, while maintaining the naming convention. Even more than that, you get queries like:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;div&gt;
    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; col_verbiage, col_indomitable, col_bulldog, col_wolf, col_legendary, col_referee
&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; tbl_colonel &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; tbl_repreieve &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; tbl_repreieve.tbl_referee = tbl_colonel.col.unsparing
&lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; col_ago = &lt;span style="color: #006080"&gt;&lt;a href="mailto:'Fun@house.at'"&gt;'Fun@house.at'&lt;/a&gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;

&lt;p&gt;It is obvious that we are getting users &amp;amp; blogs with specific email, right?&lt;/p&gt;

&lt;p&gt;This is actually much harder than just numeric values, because this is going to &lt;em&gt;really&lt;/em&gt; mess with your mind.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Nitpicker corner: Yes, this is a humorous post, don’t take it seriously, and please don’t really do it to unsuspecting customers / DBAs. Unleash it on silly integration teams only.&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://ayende.com/Blog/aggbug/10965.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/06/08/nhibernate-ndash-get-thou-out-of-my-database-ndash-2nd.aspx</guid>
            <pubDate>Mon, 08 Jun 2009 16:03:00 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/06/08/nhibernate-ndash-get-thou-out-of-my-database-ndash-2nd.aspx#feedback</comments>
            <slash:comments>10</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10965.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Does this include a trip to Mars as well?</title>
            <link>http://ayende.com/Blog/archive/2009/06/02/does-this-include-a-trip-to-mars-as-well.aspx</link>
            <description>&lt;p&gt;I'll be the first to admit that I am not the best at Geography, but somehow I don't think that this is likely.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://ayende.com/Blog/images/ayende_com/Blog/200906020644.jpg" width="434" height="109" alt="200906020644.jpg" /&gt;&lt;/p&gt;
&lt;img src="http://ayende.com/Blog/aggbug/10961.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/06/02/does-this-include-a-trip-to-mars-as-well.aspx</guid>
            <pubDate>Tue, 02 Jun 2009 10:45:15 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/06/02/does-this-include-a-trip-to-mars-as-well.aspx#feedback</comments>
            <slash:comments>11</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10961.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Random Developer Quotes</title>
            <link>http://ayende.com/Blog/archive/2009/05/13/random-developer-quotes.aspx</link>
            <description>&lt;p&gt;Those are just things that I happened to hear or say in the last week:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Q: Did you read the book Beautiful Architecture?&lt;/p&gt;    &lt;p&gt;A: No, I don’t read fantasy books.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Q: Why are you doing the dishes?&lt;/p&gt;    &lt;p&gt;A: I was a C++ programmer for a long time, I am used to cleaning up after myself.&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://ayende.com/Blog/aggbug/10916.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/05/13/random-developer-quotes.aspx</guid>
            <pubDate>Wed, 13 May 2009 10:20:00 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/05/13/random-developer-quotes.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10916.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Post #4000</title>
            <link>http://ayende.com/Blog/archive/2009/05/13/post-4000.aspx</link>
            <description>&lt;p&gt;Dear ALT.NET Community,&lt;/p&gt;  &lt;p&gt;You are likely familiar with that classic Warren Zevon song, Werewolves of London. I was reminded of this the last night being in London under a full moon and in the same hotel as one of the more famous Lycanthropic developers in the .NET community, Ayende Rahien, with whom you are also likely familiar as, well, you are reading his feed. Duh.&lt;/p&gt;  &lt;p&gt;Shocked? Read on...&lt;/p&gt;  &lt;p&gt;To call Ayende a werewolf is inacurate, of course. A lycanthrope, yes: Half-man, half-animal (i.e. manimal). But his primal half does not take the form of the lupine. Rather, Ayende is a were-Rhino. This should be obvious given the various logos and trade names he chooses. There you have it! His shape-shifting nature explains his Rhino fetish along with the genesis of the names of such projects RhinoMocks, RhinoCommons, Hibernating Rhinos, etc.&lt;/p&gt;  &lt;p&gt;Yes we're all familiar with the conventional wisdom detailed in the classic essay of the same name by Fred Brooks, "No Silver Bullets." In this corner case of our industry &lt;i&gt;there is a silver bullet, a couple (luckily, friends)!&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;There are a few things you can do to protect yourself from this marauding monster, Mr. Rahien. When in his manimilian state, if you ask him a question about NHibernate, you will stop the abomination in his tracks. If, being a proper member of the ALT.NET tribe, you cannot think of an NHibernate question (as you are undoubtedly an expert at this point) engage the brute in a discussion regarding the popular science fiction book series, "The Wheel of Time." That should do.&lt;/p&gt;  &lt;p&gt;IMPORTANT: a curious, oft-overlooked but quite dangerous feature of the wererhino is that the beastly transformation can be triggered when the subject views a piece of code built on the Entity Framework. Be very, very careful when working with EF code around Ayende.&lt;/p&gt;  &lt;p&gt;You have been warned.&lt;/p&gt;  &lt;p&gt;Yours truly,&lt;/p&gt;  &lt;p&gt;Dave Laribee&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10926.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/05/13/post-4000.aspx</guid>
            <pubDate>Tue, 12 May 2009 23:28:58 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/05/13/post-4000.aspx#feedback</comments>
            <slash:comments>6</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10926.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Why I released Windsor?</title>
            <link>http://ayende.com/Blog/archive/2009/05/08/why-i-released-windsor.aspx</link>
            <description>&lt;p&gt;Because getting &lt;a href="http://castle.uservoice.com/pages/16605-unofficial-castle-project-feedback-forum/suggestions/168104-kick-ayende-until-he-releases-windsor?direct_login_token=07e288937b357cb0b71f6dfe1efe580d&amp;amp;subdomain=castle&amp;amp;tracking_code=85a17ce065093ac02b037d648136a1b5"&gt;kicked&lt;/a&gt; that many times will &lt;em&gt;hurt&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://ayende.com/Blog/images/ayende_com/Blog/200905072355.jpg" width="480" height="88" alt="200905072355.jpg" /&gt;&lt;/p&gt;
&lt;img src="http://ayende.com/Blog/aggbug/10914.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/05/08/why-i-released-windsor.aspx</guid>
            <pubDate>Thu, 07 May 2009 21:56:23 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/05/08/why-i-released-windsor.aspx#feedback</comments>
            <slash:comments>7</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10914.aspx</wfw:commentRss>
        </item>
        <item>
            <title>1st April Post &amp;ndash; The multi purpose method</title>
            <link>http://ayende.com/Blog/archive/2009/04/01/1st-april-post-ndash-the-multi-purpose-method.aspx</link>
            <description>&lt;p&gt;Since it appears to be customary, I decided that I need to make a few posts for April 1st. Here is the second of them.&lt;/p&gt;  &lt;blockquote&gt;   &lt;div&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; RemoveReversalsMoveCompletedMessagesAndFinishSubQueueMove(Guid transactionId)
{
    Api.JetSetCurrentIndex(session, txs, &lt;span style="color: #006080"&gt;"by_tx_id"&lt;/span&gt;);
    Api.MakeKey(session, txs, transactionId.ToByteArray(), MakeKeyGrbit.NewKey);

    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (Api.TrySeek(session, txs, SeekGrbit.SeekEQ) == &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;)
        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;;
    Api.MakeKey(session, txs, transactionId.ToByteArray(), MakeKeyGrbit.NewKey);
    Api.JetSetIndexRange(session, txs, SetIndexRangeGrbit.RangeInclusive | SetIndexRangeGrbit.RangeUpperLimit);
    
    &lt;span style="color: #0000ff"&gt;do&lt;/span&gt;
    {
        &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; queue = Api.RetrieveColumnAsString(session, txs, txsColumns[&lt;span style="color: #006080"&gt;"queue"&lt;/span&gt;], Encoding.Unicode);
        &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; bookmarkData = Api.RetrieveColumn(session, txs, txsColumns[&lt;span style="color: #006080"&gt;"bookmark_data"&lt;/span&gt;]);
        &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; bookmarkSize = Api.RetrieveColumnAsInt32(session, txs, txsColumns[&lt;span style="color: #006080"&gt;"bookmark_size"&lt;/span&gt;]).Value;

        &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; actions = GetQueue(queue);

        &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; bookmark = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MessageBookmark
        {
            Bookmark = bookmarkData,
            QueueName = queue,
            Size = bookmarkSize
        };

        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (actions.GetMessageStatus(bookmark) == MessageStatus.Processing)
            actions.MoveToHistory(bookmark);
        &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
            actions.SetMessageStatus(bookmark, MessageStatus.ReadyToDeliver);

        Api.JetDelete(session, txs);
    } &lt;span style="color: #0000ff"&gt;while&lt;/span&gt; (Api.TryMoveNext(session, txs));
}&lt;/pre&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;

&lt;p&gt;And yes, it is from real code, and it is going to production soon.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10841.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/04/01/1st-april-post-ndash-the-multi-purpose-method.aspx</guid>
            <pubDate>Wed, 01 Apr 2009 20:28:23 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/04/01/1st-april-post-ndash-the-multi-purpose-method.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10841.aspx</wfw:commentRss>
        </item>
        <item>
            <title>1st April Post &amp;ndash; Sending Data</title>
            <link>http://ayende.com/Blog/archive/2009/04/01/1st-april-post-ndash-sending-data.aspx</link>
            <description>&lt;p&gt;Since it appears to be customary, I decided that I need to make a few posts for April 1st. Here is the first of them.&lt;/p&gt;  &lt;blockquote&gt;   &lt;div&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; IEnumerator&amp;lt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&amp;gt; SendInternal(AsyncEnumerator ae)
{
    &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;
    {
        &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;var&lt;/span&gt; client = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; TcpClient())
        {
            &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;
            {
                client.BeginConnect(Destination.Host, Destination.Port,
                                    ae.End(),
                                    &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);
            }
            &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception exception)
            {
                logger.WarnFormat(&lt;span style="color: #006080"&gt;"Failed to connect to {0} because {1}"&lt;/span&gt;, Destination, exception);
                Failure(exception);
                yield &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;
            }

            yield &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; 1;

            &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;
            {
                client.EndConnect(ae.DequeueAsyncResult());
            }
            &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception exception)
            {
                logger.WarnFormat(&lt;span style="color: #006080"&gt;"Failed to connect to {0} because {1}"&lt;/span&gt;, Destination, exception);
                Failure(exception);
                yield &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;
            }

            logger.DebugFormat(&lt;span style="color: #006080"&gt;"Successfully connected to {0}"&lt;/span&gt;, Destination);

            &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;var&lt;/span&gt; stream = client.GetStream())
            {
                &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; buffer = Messages.Serialize();

                &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; bufferLenInBytes = BitConverter.GetBytes(buffer.Length);

                logger.DebugFormat(&lt;span style="color: #006080"&gt;"Writing length of {0} bytes to {1}"&lt;/span&gt;, buffer.Length, Destination);

                &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;
                {
                    stream.BeginWrite(bufferLenInBytes, 0, bufferLenInBytes.Length, ae.End(), &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);
                }
                &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception exception)
                {
                    logger.WarnFormat(&lt;span style="color: #006080"&gt;"Could not write to {0} because {1}"&lt;/span&gt;, Destination,
                                      exception);
                    Failure(exception);
                    yield &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;
                }
            
                yield &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; 1;

                &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;
                {
                    stream.EndWrite(ae.DequeueAsyncResult());
                }
                &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception exception)
                {
                    logger.WarnFormat(&lt;span style="color: #006080"&gt;"Could not write to {0} because {1}"&lt;/span&gt;, Destination,
                                      exception);
                    Failure(exception);
                    yield &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;
                }

                logger.DebugFormat(&lt;span style="color: #006080"&gt;"Writing {0} bytes to {1}"&lt;/span&gt;, buffer.Length, Destination);

                &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;
                {
                    stream.BeginWrite(buffer, 0, buffer.Length, ae.End(), &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);
                }
                &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception exception)
                {
                    logger.WarnFormat(&lt;span style="color: #006080"&gt;"Could not write to {0} because {1}"&lt;/span&gt;, Destination,
                                    exception);
                    Failure(exception);
                    yield &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;
                }
            
                yield &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; 1;

                &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;
                {
                    stream.EndWrite(ae.DequeueAsyncResult());
                }
                &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception exception)
                {
                    logger.WarnFormat(&lt;span style="color: #006080"&gt;"Could not write to {0} because {1}"&lt;/span&gt;, Destination,
                                      exception);
                    Failure(exception);
                    yield &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;
                }

                logger.DebugFormat(&lt;span style="color: #006080"&gt;"Successfully wrote to {0}"&lt;/span&gt;, Destination);

                &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; recieveBuffer = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[ProtocolConstants.RecievedBuffer.Length];
                &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; readConfirmationEnumerator = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; AsyncEnumerator();

                &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;
                {
                    readConfirmationEnumerator.BeginExecute(
                        StreamUtil.ReadBytes(recieveBuffer, stream, readConfirmationEnumerator, &lt;span style="color: #006080"&gt;"recieve confirmation"&lt;/span&gt;), ae.End());
                }
                &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception exception)
                {
                    logger.WarnFormat(&lt;span style="color: #006080"&gt;"Could not read confirmation from {0} because {1}"&lt;/span&gt;, Destination,
                                      exception);
                    Failure(exception);
                    yield &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;
                }

                yield &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; 1;

                &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;
                {
                    readConfirmationEnumerator.EndExecute(ae.DequeueAsyncResult());
                }
                &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception exception)
                {
                    logger.WarnFormat(&lt;span style="color: #006080"&gt;"Could not read confirmation from {0} because {1}"&lt;/span&gt;, Destination,
                                      exception);
                    Failure(exception);
                    yield &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;
                }

                &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; recieveRespone = Encoding.Unicode.GetString(recieveBuffer);
                &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (recieveRespone == ProtocolConstants.QueueDoesNotExists)
                {
                    logger.WarnFormat(
                        &lt;span style="color: #006080"&gt;"Response from reciever {0} is that queue does not exists"&lt;/span&gt;,
                        Destination);
                    Failure(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; QueueDoesNotExistsException());
                    yield &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;
                }
                &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(recieveRespone!=ProtocolConstants.Recieved)
                {
                    logger.WarnFormat(
                        &lt;span style="color: #006080"&gt;"Response from reciever {0} is not the expected one, unexpected response was: {1}"&lt;/span&gt;,
                        Destination, recieveRespone);
                    Failure(&lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);
                    yield &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;
                }

                &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;
                {
                    stream.BeginWrite(ProtocolConstants.AcknowledgedBuffer, 0,
                                      ProtocolConstants.AcknowledgedBuffer.Length, ae.End(), &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);
                }
                &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception exception)
                {
                    logger.WarnFormat(&lt;span style="color: #006080"&gt;"Failed to write acknowledgement to reciever {0} because {1}"&lt;/span&gt;,
                                      Destination, exception);
                    Failure(exception);
                    yield &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;
                }

                yield &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; 1;

                &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;
                {
                    stream.EndWrite(ae.DequeueAsyncResult());
                }
                &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception exception)
                {
                    logger.WarnFormat(&lt;span style="color: #006080"&gt;"Failed to write acknowledgement to reciever {0} because {1}"&lt;/span&gt;,
                                      Destination, exception);
                    Failure(exception);
                    yield &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;
                }
                Success();

                buffer = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[ProtocolConstants.RevertBuffer.Length];
                &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; readRevertMessage = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; AsyncEnumerator(ae.ToString());
                readRevertMessage.BeginExecute(
                    StreamUtil.ReadBytes(buffer, stream, readRevertMessage, &lt;span style="color: #006080"&gt;"revert"&lt;/span&gt;), ae.End());
                yield &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; 1;
                &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;
                {
                    readRevertMessage.EndExecute(ae.DequeueAsyncResult());
                    &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; revert = Encoding.Unicode.GetString(buffer);
                    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (revert == ProtocolConstants.Revert)
                    {
                        Failure(&lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);
                    }
                }
                &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception)
                {
                    &lt;span style="color: #008000"&gt;// expected, there is nothing to do here, the&lt;/span&gt;
                    &lt;span style="color: #008000"&gt;// reciever didn't report anything for us&lt;/span&gt;
                }

            }
        }
    }
    &lt;span style="color: #0000ff"&gt;finally&lt;/span&gt;
    {
        &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; completed = SendCompleted;
        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (completed != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)
            completed();
    }
}&lt;/pre&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;

&lt;p&gt;And yes, it is from real code, and it is going to production soon.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10840.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/04/01/1st-april-post-ndash-sending-data.aspx</guid>
            <pubDate>Wed, 01 Apr 2009 20:25:58 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/04/01/1st-april-post-ndash-sending-data.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10840.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Raising the level of abstraction</title>
            <link>http://ayende.com/Blog/archive/2009/02/11/raising-the-level-of-abstraction.aspx</link>
            <description>&lt;p&gt;Right now I am working with a co-worker, and I realized that I am:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Using Mac OS&lt;/li&gt;    &lt;li&gt;Running Windows in VMWare Fusion &lt;/li&gt;    &lt;li&gt;To connect via SharedView to a remote machine&lt;/li&gt;    &lt;li&gt;To connect via remote desktop to another machine&lt;/li&gt;    &lt;li&gt;Which is also a virtual instance&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;And I wonder about the latency…&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10777.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/02/11/raising-the-level-of-abstraction.aspx</guid>
            <pubDate>Wed, 11 Feb 2009 17:54:59 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/02/11/raising-the-level-of-abstraction.aspx#feedback</comments>
            <slash:comments>8</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10777.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Laughing in code</title>
            <link>http://ayende.com/Blog/archive/2009/02/10/laughing-in-code.aspx</link>
            <description>&lt;p&gt;I am not sure that this will make any sort of sense world wide, but Israeli coders should have a chuckle or two over this:&lt;/p&gt; &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/Laughingincode_D37F/image_2.png"&gt;&lt;img height="170" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/Laughingincode_D37F/image_thumb.png" width="460" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10774.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/02/10/laughing-in-code.aspx</guid>
            <pubDate>Tue, 10 Feb 2009 13:02:41 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/02/10/laughing-in-code.aspx#feedback</comments>
            <slash:comments>11</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10774.aspx</wfw:commentRss>
        </item>
        <item>
            <title>There is no database</title>
            <link>http://ayende.com/Blog/archive/2009/01/15/there-is-no-database.aspx</link>
            <description>&lt;p&gt;I just noticed that for the last few months I have been consistently denying the existence of a database. I use the term persistent storage when asked, and when asked I usually say: “There is no database”.&lt;/p&gt;  &lt;p&gt;It has gotten to the point that this is how I draw the DB on most whiteboard sessions:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/Thereisnodatabase_CDF3/image_2.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="242" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/Thereisnodatabase_CDF3/image_thumb.png" width="225" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10719.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/01/15/there-is-no-database.aspx</guid>
            <pubDate>Wed, 14 Jan 2009 22:38:46 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/01/15/there-is-no-database.aspx#feedback</comments>
            <slash:comments>10</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10719.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>