<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET Weblogs</title><link>http://weblogs.asp.net/</link><description /><dc:language>en-US</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Extension Methods Roundup: IndicesWhere, TakeEvery, Distinct</title><link>http://weblogs.asp.net/okloeten/archive/2008/05/18/6200566.aspx</link><pubDate>Sun, 18 May 2008 13:14:21 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6200566</guid><dc:creator>Omer van Kloeten</dc:creator><slash:comments>3</slash:comments><description>&lt;p&gt;As I do from time to time, here is a batch of three Extension Methods I've written recently:&lt;/p&gt;  &lt;h4&gt;IndicesWhere&lt;/h4&gt;  &lt;pre class="code"&gt;&lt;code&gt;&lt;span style="color: gray"&gt;/// &amp;lt;summary&amp;gt;
/// &lt;/span&gt;&lt;span style="color: green"&gt;Gets the indices where the predicate is true.
&lt;/span&gt;&lt;span style="color: gray"&gt;/// &amp;lt;/summary&amp;gt;
&lt;/span&gt;&lt;span style="color: blue"&gt;public static &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;int&lt;/span&gt;&amp;gt; IndicesWhere&amp;lt;T&amp;gt;(&lt;span style="color: blue"&gt;this &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;T&amp;gt; enumeration,&lt;span style="color: #2b91af"&gt; Func&lt;/span&gt;&amp;lt;T, &lt;span style="color: blue"&gt;bool&lt;/span&gt;&amp;gt; predicate)
{
    &lt;span style="color: green"&gt;// Check to see that enumeration is not null
    &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(enumeration == &lt;span style="color: blue"&gt;null&lt;/span&gt;)
        &lt;span style="color: blue"&gt;throw new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ArgumentNullException&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;enumeration&amp;quot;&lt;/span&gt;);

    &lt;span style="color: green"&gt;// Check to see that predicate is not null
    &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(predicate == &lt;span style="color: blue"&gt;null&lt;/span&gt;)
        &lt;span style="color: blue"&gt;throw new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ArgumentNullException&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;predicate&amp;quot;&lt;/span&gt;);

    &lt;span style="color: blue"&gt;int &lt;/span&gt;index = 0;

    &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(T item &lt;span style="color: blue"&gt;in &lt;/span&gt;enumeration)
    {
        &lt;span style="color: blue"&gt;if &lt;/span&gt;(predicate(item))
            &lt;span style="color: blue"&gt;yield return &lt;/span&gt;index;

        index++;
    }
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This is especially useful when you want to cache indices from an array, rather than the array itself. Here's an example:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;code&gt;&lt;span style="color: blue"&gt;var &lt;/span&gt;indicesWithValues = values.IndicesWhere(value =&amp;gt; value != &lt;span style="color: blue"&gt;null&lt;/span&gt;);&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;TakeEvery&lt;/h4&gt;

&lt;pre class="code"&gt;&lt;code&gt;&lt;span style="color: gray"&gt;/// &amp;lt;summary&amp;gt;
/// &lt;/span&gt;&lt;span style="color: green"&gt;Take items from 'startAt' every at 'hopLength' items.
&lt;/span&gt;&lt;span style="color: gray"&gt;/// &amp;lt;/summary&amp;gt;
&lt;/span&gt;&lt;span style="color: blue"&gt;public static &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;T&amp;gt; TakeEvery&amp;lt;T&amp;gt;(&lt;span style="color: blue"&gt;this &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;T&amp;gt; enumeration, &lt;span style="color: blue"&gt;int &lt;/span&gt;startAt, &lt;span style="color: blue"&gt;int &lt;/span&gt;hopLength)
{
    &lt;span style="color: green"&gt;// Check to see that enumeration is not null
    &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(enumeration == &lt;span style="color: blue"&gt;null&lt;/span&gt;)
        &lt;span style="color: blue"&gt;throw new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ArgumentNullException&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;enumeration&amp;quot;&lt;/span&gt;);

    &lt;span style="color: blue"&gt;int &lt;/span&gt;first = 0;
    &lt;span style="color: blue"&gt;int &lt;/span&gt;count = 0;

    &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(T item &lt;span style="color: blue"&gt;in &lt;/span&gt;enumeration)
    {
        &lt;span style="color: blue"&gt;if &lt;/span&gt;(first &amp;lt; startAt)
        {
            first++;
        }
        &lt;span style="color: blue"&gt;else if &lt;/span&gt;(first == startAt)
        {
            &lt;span style="color: blue"&gt;yield return &lt;/span&gt;item;

            first++;
        }
        &lt;span style="color: blue"&gt;else
        &lt;/span&gt;{
            count++;

            &lt;span style="color: blue"&gt;if &lt;/span&gt;(count == hopLength)
            {
                &lt;span style="color: blue"&gt;yield return &lt;/span&gt;item;

                count = 0;
            }
        }
    }
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This is equivalent to an unbounded series of &lt;code&gt;&lt;em&gt;Skip(startAt).Take(1).Skip(hopLength).Take(1).Skip(hopLength)&lt;/em&gt;&lt;/code&gt;... Useful for when you, for instance, need only every other item in a list.&lt;/p&gt;

&lt;h4&gt;Distinct&lt;/h4&gt;

&lt;p&gt;It's really been pissing me off that there's no overload to &lt;a href="http://msdn.microsoft.com/library/system.linq.enumerable.distinct.aspx" target="_blank"&gt;Distinct&lt;/a&gt; that takes a delegate, which means I have to write a new class whenever my comparison isn't the default one. When talking about Anonymous Types, &lt;strong&gt;Distinct becomes useless&lt;/strong&gt;. So here's an overload I can actually use:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;code&gt;&lt;span style="color: blue"&gt;private class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;EqualityComparer&lt;/span&gt;&amp;lt;T&amp;gt; : &lt;span style="color: #2b91af"&gt;IEqualityComparer&lt;/span&gt;&amp;lt;T&amp;gt;
{
    &lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Func&lt;/span&gt;&amp;lt;T, T, &lt;span style="color: blue"&gt;bool&lt;/span&gt;&amp;gt; Comparer { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;internal set&lt;/span&gt;; }
    &lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Func&lt;/span&gt;&amp;lt;T, &lt;span style="color: blue"&gt;int&lt;/span&gt;&amp;gt; Hasher { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;internal set&lt;/span&gt;; }

    &lt;span style="color: blue"&gt;bool &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IEqualityComparer&lt;/span&gt;&amp;lt;T&amp;gt;.Equals(T x, T y)
    {
        &lt;span style="color: blue"&gt;return this&lt;/span&gt;.Comparer(x, y);
    }

    &lt;span style="color: blue"&gt;int &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IEqualityComparer&lt;/span&gt;&amp;lt;T&amp;gt;.GetHashCode(T obj)
    {
        &lt;span style="color: green"&gt;// No hashing capabilities. Default to Equals(x, y).
        &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(&lt;span style="color: blue"&gt;this&lt;/span&gt;.Hasher == &lt;span style="color: blue"&gt;null&lt;/span&gt;)
            &lt;span style="color: blue"&gt;return &lt;/span&gt;0;

        &lt;span style="color: blue"&gt;return this&lt;/span&gt;.Hasher(obj);
    }
}

&lt;span style="color: gray"&gt;/// &amp;lt;summary&amp;gt;
/// &lt;/span&gt;&lt;span style="color: green"&gt;Gets distinct items by a comparer delegate.
&lt;/span&gt;&lt;span style="color: gray"&gt;/// &amp;lt;/summary&amp;gt;
&lt;/span&gt;&lt;span style="color: blue"&gt;public static &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;T&amp;gt; Distinct&amp;lt;T&amp;gt;(&lt;span style="color: blue"&gt;this &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;T&amp;gt; enumeration, &lt;span style="color: #2b91af"&gt;Func&lt;/span&gt;&amp;lt;T, T, &lt;span style="color: blue"&gt;bool&lt;/span&gt;&amp;gt; comparer)
{
    &lt;span style="color: blue"&gt;return &lt;/span&gt;Distinct(enumeration, comparer, &lt;span style="color: blue"&gt;null&lt;/span&gt;);
}

&lt;span style="color: gray"&gt;/// &amp;lt;summary&amp;gt;
/// &lt;/span&gt;&lt;span style="color: green"&gt;Gets distinct items by comparer and hasher delegates (faster than only comparer).
&lt;/span&gt;&lt;span style="color: gray"&gt;/// &amp;lt;/summary&amp;gt;
&lt;/span&gt;&lt;span style="color: blue"&gt;public static &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;T&amp;gt; Distinct&amp;lt;T&amp;gt;(&lt;span style="color: blue"&gt;this &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;T&amp;gt; enumeration, &lt;span style="color: #2b91af"&gt;Func&lt;/span&gt;&amp;lt;T, T, &lt;span style="color: blue"&gt;bool&lt;/span&gt;&amp;gt; comparer, &lt;span style="color: #2b91af"&gt;Func&lt;/span&gt;&amp;lt;T, &lt;span style="color: blue"&gt;int&lt;/span&gt;&amp;gt; hasher)
{
    &lt;span style="color: green"&gt;// Check to see that enumeration is not null
    &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(enumeration == &lt;span style="color: blue"&gt;null&lt;/span&gt;)
        &lt;span style="color: blue"&gt;throw new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ArgumentNullException&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;enumeration&amp;quot;&lt;/span&gt;);

    &lt;span style="color: green"&gt;// Check to see that comparer is not null
    &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(comparer == &lt;span style="color: blue"&gt;null&lt;/span&gt;)
        &lt;span style="color: blue"&gt;throw new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ArgumentNullException&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;comparer&amp;quot;&lt;/span&gt;);

    &lt;span style="color: blue"&gt;return &lt;/span&gt;enumeration.Distinct(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;EqualityComparer&lt;/span&gt;&amp;lt;T&amp;gt; { Comparer = comparer, Hasher = hasher });
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I'll be integrating these methods into the &lt;a href="http://www.codeplex.com/linqext" target="_blank"&gt;Linq Extensions&lt;/a&gt; project soon enough. Good hunting. :)&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6200566" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/okloeten/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/okloeten/archive/tags/Tools_3A00_+Linq+Extensions/default.aspx">Tools: Linq Extensions</category></item><item><title>Cloning objects in .NET</title><link>http://weblogs.asp.net/esanchez/archive/2008/05/18/cloning-objects-in-net.aspx</link><pubDate>Sun, 18 May 2008 06:27:38 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6200321</guid><dc:creator>Edgar Sánchez</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;In an interesting project where I'm giving a hand, we need to clone objects of a number of different types, perhaps surprisingly the CLR doesn't offer a general cloning method, of course you could use &lt;a href="http://msdn.microsoft.com/en-us/system.object.memberwiseclone.aspx" target="_blank"&gt;MemberwiseClone()&lt;/a&gt; but this is a protected method, so it can be invoked only from inside the class of the object being cloned, which makes it difficult to use it in a general method, besides, MemberWiseClone() does just a &lt;a href="http://en.wikipedia.org/wiki/Object_copy#Shallow_copy" target="_blank"&gt;shallow copy&lt;/a&gt; and what we really need is a &lt;a href="http://en.wikipedia.org/wiki/Object_copy#Deep_copy" target="_blank"&gt;deep copy&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;There is a good reason for not having such a general method: object cloning is one of those problems which have a simple solution for simple scenarios but that resist a satisfactory solution for all the scenarios, for example the objects may have references to other objects and even to themselves be it directly or after a long chain, for example a customer has invoices that have payments that refer to the customer, a general cloning algorithm for a web several times more complex than that is anything but trivial. But the need of moving objects (and their web) is inescapable in distributed environments, because you have to move the invoices and the customers from the business layer to the presentation layer, so there are indeed mechanisms, albeit with some limitations, for serializing and deserializing object graphs, with the help of these mechanisms we can try and build a general object cloner:&lt;/p&gt;  &lt;div style="font-size: 10pt; background: #101010; color: white; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 1&lt;/span&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 2&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #8ac5ff"&gt;public&lt;/span&gt; &lt;span style="color: #8ac5ff"&gt;static&lt;/span&gt; T BinaryClone&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;T&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;(&lt;span style="color: #8ac5ff"&gt;this&lt;/span&gt; T originalObject)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 3&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 4&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #8ac5ff"&gt;using&lt;/span&gt; (&lt;span style="color: #8ac5ff"&gt;var&lt;/span&gt; stream &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #8ac5ff"&gt;new&lt;/span&gt; System&lt;span style="color: silver"&gt;.&lt;/span&gt;IO&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #64b1ff"&gt;MemoryStream&lt;/span&gt;())&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 5&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 6&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #8ac5ff"&gt;var&lt;/span&gt; binaryFormatter &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #8ac5ff"&gt;new&lt;/span&gt; System&lt;span style="color: silver"&gt;.&lt;/span&gt;Runtime&lt;span style="color: silver"&gt;.&lt;/span&gt;Serialization&lt;span style="color: silver"&gt;.&lt;/span&gt;Formatters&lt;span style="color: silver"&gt;.&lt;/span&gt;Binary&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #64b1ff"&gt;BinaryFormatter&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 7&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; binaryFormatter&lt;span style="color: silver"&gt;.&lt;/span&gt;Serialize(stream, originalObject);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 8&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; stream&lt;span style="color: silver"&gt;.&lt;/span&gt;Position &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #ffff80"&gt;0&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 9&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #8ac5ff"&gt;return&lt;/span&gt; (T)binaryFormatter&lt;span style="color: silver"&gt;.&lt;/span&gt;Deserialize(stream);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160; 10&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160; 11&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160; 12&lt;/span&gt;&amp;#160;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;We just convert, using as intermediary a memory stream, our object to a bit string and then we synthesize a *new object* from that bit string. The use of BinaryClone() flows nicely:&lt;/p&gt;  &lt;div style="font-size: 10pt; background: #101010; color: white; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 1&lt;/span&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 2&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #8ac5ff"&gt;var&lt;/span&gt; clone &lt;span style="color: silver"&gt;=&lt;/span&gt; person&lt;span style="color: silver"&gt;.&lt;/span&gt;BinaryClone();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 3&lt;/span&gt;&amp;#160;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Easy to write, but we have to be careful of the performance and the corner cases. I run a few *very informal* performance tests with this object:&lt;/p&gt;  &lt;div style="font-size: 10pt; background: #101010; color: white; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 1&lt;/span&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 2&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #8ac5ff"&gt;var&lt;/span&gt; person &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #8ac5ff"&gt;new&lt;/span&gt; &lt;span style="color: #64b1ff"&gt;Person&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 3&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 4&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Id &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #ffff80"&gt;101&lt;/span&gt;,&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 5&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Name &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #ff8040"&gt;&amp;quot;S&amp;#225;nchez, Sebasti&amp;#225;n&amp;quot;&lt;/span&gt;,&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 6&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Salary &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #ffff80"&gt;590.20m&lt;/span&gt;,&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 7&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; BirthDate &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #8ac5ff"&gt;new&lt;/span&gt; &lt;span style="color: #ffffaa"&gt;DateTime&lt;/span&gt;(&lt;span style="color: #ffff80"&gt;2000&lt;/span&gt;, &lt;span style="color: #ffff80"&gt;6&lt;/span&gt;, &lt;span style="color: #ffff80"&gt;15&lt;/span&gt;),&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 8&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Address &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #8ac5ff"&gt;new&lt;/span&gt; &lt;span style="color: #64b1ff"&gt;Address&lt;/span&gt; { Number &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #ff8040"&gt;&amp;quot;N24-78&amp;quot;&lt;/span&gt;, Street &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #ff8040"&gt;&amp;quot;Pasaje C&amp;#243;rdova&amp;quot;&lt;/span&gt; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160;&amp;#160; 9&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; };&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="background: #181818; color: #ffaa55"&gt;&amp;#160;&amp;#160; 10&lt;/span&gt;&amp;#160;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;And I found that doing a hundred thousand clones takes some nine thousand milliseconds, that is each cloning takes less than one ten-thousandth of a second, which is adequate to our needs. BinaryFormatter has been with us since .NET Framework 1.0 so I'm not like saying anything even remotely new or unknown, but tomorrow (or the day after, or the day after...) I'll talk about a small refinement to BinaryClone().&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6200321" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/esanchez/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/esanchez/archive/tags/.NET/default.aspx">.NET</category></item><item><title>New Article: Images as a Service with ADO.NET Data Services</title><link>http://weblogs.asp.net/timothykhouri/archive/2008/05/17/new-article-images-as-a-service-with-ado-net-data-services.aspx</link><pubDate>Sun, 18 May 2008 02:01:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6200149</guid><dc:creator>Nullable</dc:creator><slash:comments>0</slash:comments><description>For those of you who have already put your feet into the waters of .NET 3.5 SP1, you have probably seen some amazing things with ADO.NET Data Services coupled to the Entity Framework. But that coupling may lead to blindness. Allow me to explain. 
&lt;P mce_keep="true"&gt;[continue to article: &lt;A class="" title="Images as a Service with ADO.NET Data Services" href="http://www.singingeels.com/Articles/Images_as_a_Service_with_ADONET_Data_Services.aspx" mce_href="http://www.singingeels.com/Articles/Images_as_a_Service_with_ADONET_Data_Services.aspx"&gt;Images as a Service with ADO.NET Data Services&lt;/A&gt;]&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6200149" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/timothykhouri/archive/tags/General+Software+Development/default.aspx">General Software Development</category><category domain="http://weblogs.asp.net/timothykhouri/archive/tags/Community+News/default.aspx">Community News</category><category domain="http://weblogs.asp.net/timothykhouri/archive/tags/Astoria/default.aspx">Astoria</category><category domain="http://weblogs.asp.net/timothykhouri/archive/tags/ADO.NET/default.aspx">ADO.NET</category></item><item><title>Interesting Finds: 2008.05.18</title><link>http://weblogs.asp.net/yuanjian/archive/2008/05/17/interesting-finds-2008-05-18.aspx</link><pubDate>Sun, 18 May 2008 01:49:57 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6200142</guid><dc:creator>gOODiDEA</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;strong&gt;Debug&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/tom/archive/2008/05/15/asp-net-tips-what-to-gather-to-troubleshoot-part-3a-crash-revisited.aspx" target="_blank"&gt;ASP.NET Tips: What to gather to troubleshoot - part 3a - Crash revisited&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.technet.com/askperf/archive/2008/04/08/using-process-explorer-without-an-internet-connection.aspx" target="_blank"&gt;Using Process Explorer without an Internet Connection&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;.NET&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.codeproject.com/KB/recipes/LZW.aspx" target="_blank"&gt;Fast LZW Compression Using Binary Tree&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blog.paranoidferret.com/index.php/2008/05/12/getting-image-metadata-with-csharp/" target="_blank"&gt;Getting Image Metadata with C#&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Web&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blog.paranoidferret.com/index.php/2008/05/14/javascript-tutorial-continuous-pagination/" target="_blank"&gt;Javascript Tutorial - Continuous Pagination&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://feeds.feedburner.com/~r/SixRevisions/~3/290573542/" target="_blank"&gt;20 Useful Tools to Make Web Development More Efficient&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://mojax.mfoundry.com/display/mojax/Main+Page" target="_blank"&gt;Mojax&lt;/a&gt; - a mobile Ajax application framework &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Other&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/magazine/cc507642.aspx" target="_blank"&gt;Request/Response Testing with Windows PowerShell&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://devlicio.us/blogs/casey/archive/2008/05/16/what-determines-high-quality-code.aspx" target="_blank"&gt;What Determines High Quality Code?&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.ytechie.com/2008/05/writing-code-that-youre-proud-of.html" target="_blank"&gt;Writing code that you&amp;#8217;re proud of&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6200142" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/yuanjian/archive/tags/Interesting+Finds/default.aspx">Interesting Finds</category><category domain="http://weblogs.asp.net/yuanjian/archive/tags/Web/default.aspx">Web</category><category domain="http://weblogs.asp.net/yuanjian/archive/tags/Powershell/default.aspx">Powershell</category><category domain="http://weblogs.asp.net/yuanjian/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/yuanjian/archive/tags/Javascript/default.aspx">Javascript</category><category domain="http://weblogs.asp.net/yuanjian/archive/tags/WinDbg/default.aspx">WinDbg</category><category domain="http://weblogs.asp.net/yuanjian/archive/tags/Utility/default.aspx">Utility</category></item><item><title>"Swapping" instead of "Injecting" calls between classes</title><link>http://weblogs.asp.net/rosherove/archive/2008/05/17/quot-swapping-quot-instead-of-quot-injecting-quot-calls-between-classes.aspx</link><pubDate>Sun, 18 May 2008 01:01:15 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6200122</guid><dc:creator>RoyOsherove</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;Eli Lopian, &lt;a href="http://www.typemock.com/"&gt;Typemock CEO&lt;/a&gt; and awesome Coder, &lt;a href="http://www.elilopian.com/2008/05/15/ruby-style-mocking-in-net/"&gt;just created a nice little API wrapper&lt;/a&gt; around &lt;a href="http://www.typemock.com/"&gt;Typemock Isolator&lt;/a&gt; that would allow a very simple and readable &amp;quot;Swapping&amp;quot; effect between classes. It would allow you to write code like this:&lt;/p&gt;  &lt;p&gt;&lt;/p&gt; &lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;??\red224\green224\blue224;\red32\green32\blue32;\red238\green232\blue170;\red64\green196\blue255;\red192\green192\blue192;\red96\green255\blue96;}??\fs28 \cf1\cb2\highlight2     [\cf3 Test\cf1 ]\par ??       \cf4 public\cf1  \cf4 void\cf1  \cf3 SwapStatic_CallsFake\cf1 ()\par ??       \{\par ??           \cf3 Swap\cf5 .\cf3 StaticCalls\cf5 &amp;lt;\cf3 TypeA\cf1 , \cf3 TypeB\cf5 &amp;gt;\cf1 (); \par ??           \cf3 Assert\cf5 .\cf3 AreEqual\cf1 (\cf6 2\cf1 , \cf3 TypeA\cf5 .\cf3 StaticReturnOne\cf1 ()); \par ??           \cf3 Swap\cf5 .\cf3 Rollback\cf1 ();\par ??       \}\par ??\par ??       [\cf3 TestMethod\cf1 ]\par ??       \cf4 public\cf1  \cf4 void\cf1  \cf3 SwapInstance_CallsFake\cf1 ()\par ??       \{\par ??           \cf3 Swap\cf5 .\cf3 NextNew\cf5 &amp;lt;\cf3 OriginalClass\cf1 , \cf3 FakeClass\cf5 &amp;gt;\cf1 ();\par ??           \cf3 OriginalClass\cf1  \cf3 swappedInstance\cf1  \cf5 =\cf1  \cf4 new\cf1  \cf3 OriginalClass\cf1 ();\par ??           \cf3 Assert\cf5 .\cf3 AreEqual\cf1 (\cf6 2\cf1 , \cf3 swappedInstance\cf5 .\cf3 ReturnOne\cf1 ());\par ??       \}}
--&gt;  &lt;div style="font-size: 12pt; background: #202020; color: #e0e0e0; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: #eee8aa"&gt;Test&lt;/span&gt;]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;void&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;SwapStatic_CallsFake&lt;/span&gt;()&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #eee8aa"&gt;Swap&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;StaticCalls&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TypeA&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;TypeB&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;(); &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #eee8aa"&gt;Assert&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;AreEqual&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;2&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;TypeA&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;StaticReturnOne&lt;/span&gt;()); &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #eee8aa"&gt;Swap&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Rollback&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: #eee8aa"&gt;TestMethod&lt;/span&gt;]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;void&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;SwapInstance_CallsFake&lt;/span&gt;()&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #eee8aa"&gt;Swap&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;NextNew&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;OriginalClass&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;FakeClass&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #eee8aa"&gt;OriginalClass&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;swappedInstance&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;OriginalClass&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #eee8aa"&gt;Assert&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;AreEqual&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;2&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;swappedInstance&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;ReturnOne&lt;/span&gt;());&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The first test uses the &amp;quot;Swap&amp;quot; class to replace static calls and redirect them to your own class with static methods. The second one is more advanced and will mock all &lt;strong&gt;instance&lt;/strong&gt; calls made on the &lt;strong&gt;next instance that will be created of that type. &lt;/strong&gt;so the last line on the second test will actually call a method against the FakeClass type. &lt;/p&gt;  &lt;p&gt;pretty cool and very readable. &lt;a href="http://www.elilopian.com/2008/05/15/ruby-style-mocking-in-net"&gt;download the code and binaries from his post&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6200122" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/rosherove/archive/tags/Unit+Testing/default.aspx">Unit Testing</category><category domain="http://weblogs.asp.net/rosherove/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/rosherove/archive/tags/Agile/default.aspx">Agile</category><category domain="http://weblogs.asp.net/rosherove/archive/tags/Art+Of+Unit+Testing/default.aspx">Art Of Unit Testing</category></item><item><title>Enterprise Library 4.0 Released</title><link>http://weblogs.asp.net/hosamkamel/archive/2008/05/17/enterprise-library-4-0-released.aspx</link><pubDate>Sat, 17 May 2008 15:39:18 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6199466</guid><dc:creator>HosamKamel</dc:creator><slash:comments>1</slash:comments><description>&lt;h6&gt;&lt;/h6&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mikewalker/WindowsLiveWriter/EnterpriseLibrary4.0Released_103AE/clip_image001_2.jpg"&gt;&lt;img height="84" alt="clip_image001" src="http://blogs.msdn.com/blogfiles/mikewalker/WindowsLiveWriter/EnterpriseLibrary4.0Released_103AE/clip_image001_thumb.jpg" width="311" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc511823.aspx"&gt;Enterprise Library&lt;/a&gt; is a collection of application blocks intended for use by developers who build complex, enterprise-level applications. Enterprise Library is used when building applications that are typically to be deployed widely and to interoperate with other applications and systems. In addition, they generally have strict security, reliability, and performance requirements. &lt;/p&gt;  &lt;p&gt;The goals of Enterprise Library are the following:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;b&gt;Consistency&lt;/b&gt;. All Enterprise Library application blocks feature consistent design patterns and implementation approaches. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Extensibility&lt;/b&gt;. All application blocks include defined extensibility points that allow developers to customize the behavior of the application blocks by adding their own code. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Ease of use.&lt;/b&gt; Enterprise Library offers numerous usability improvements, including a graphical configuration tool, a simpler installation procedure, and clearer and more complete documentation and samples. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Integration.&lt;/b&gt; Enterprise Library application blocks are designed to work well together or individually. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;These are typically rationalized through:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Online Guidance &lt;/li&gt;    &lt;li&gt;Scenarios or &lt;a href="http://msdn.microsoft.com/en-us/library/cc512464.aspx#EntLib4lpGettingStarted"&gt;QuickStart samples&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;QuickStart Walkthroughs &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C8CA14D0-05EA-4A44-AE78-F5E4DF6208AF&amp;amp;displaylang=en"&gt;Hands-On Labs&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Sample Source Code &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;There will be a webcast in June 2008&amp;#160; giving an overview of the new features of Enterprise Library 4.0. You can find more detail on the Enterprise Library &lt;a href="http://msdn.microsoft.com/entlib"&gt;landing page&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;What's New&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;This release of Enterprise Library includes the following:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Integration with the Unity Application Block &lt;/li&gt;    &lt;li&gt;Windows Management Instrumentation (WMI) 2.0 support and improved instrumentation &lt;/li&gt;    &lt;li&gt;Performance improvements (particularly, in the Logging Application Block) &lt;/li&gt;    &lt;li&gt;Pluggable Cache Managers &lt;/li&gt;    &lt;li&gt;Visual Studio 2008 support &lt;/li&gt;    &lt;li&gt;Bug fixes &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;em&gt;Note: existing public APIs (v3.1) are still supported.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Links&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;MSDN site: &lt;a href="http://msdn.microsoft.com/entlib"&gt;http://msdn.microsoft.com/entlib&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Community Forum: &lt;a href="http://go.microsoft.com/fwlink/?LinkID=119312"&gt;http://go.microsoft.com/fwlink/?LinkID=119312&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Community Extensions: &lt;a href="http://codeplex.com/entlibcontrib"&gt;http://codeplex.com/entlibcontrib&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;VIA : &lt;/strong&gt;&lt;a href="http://blogs.msdn.com/mikewalker/archive/2008/05/16/enterprise-library-4-0-released.aspx" target="_blank"&gt;&lt;strong&gt;Mike Walker's Blog&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6199466" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/hosamkamel/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/hosamkamel/archive/tags/.NET+3.0+_2600_+.NET+3.5/default.aspx">.NET 3.0 &amp; .NET 3.5</category><category domain="http://weblogs.asp.net/hosamkamel/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://weblogs.asp.net/hosamkamel/archive/tags/Patterns+and+Practices/default.aspx">Patterns and Practices</category></item><item><title>.NET Framework 1.1 Service Pack 1 and Page.RegisterStartupScript</title><link>http://weblogs.asp.net/alexeigorkov/archive/2008/05/17/net-1-1-service-pack-1-and-page-registerstartupscript.aspx</link><pubDate>Sat, 17 May 2008 12:36:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6199383</guid><dc:creator>AGS777</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;First, if you are are developing exclusively ASP.NET 2.0+ applications, sorry, there is nothing interesting for you in this post.&lt;/p&gt;&lt;p&gt;Second, if you are involved in some ASP.NET 1.1 projects and have no plans to install new development environment, then, sorry again, there is probably no reason for you to read on either. Ok, I've done all I could to warn you against reading it. Don't blame me for wasting you time, because I am going to start from the very beginning.&lt;/p&gt;&lt;p&gt;One of my current projects is ASP.NET 1.1 Web Application. It is already released and rather stable. And yesterday I got new development machine on my workplace and migrated all my data to it. .NET Frameworks 1.1, 2.0, 3.0, 3.5 were preinstalled before I first logged in (thanks to our system administrators). I installed VS 2003 and SP1 for it, VS 2008, SVN client, some other necessary utilities and components. Then, updated sources from source control for the mentioned ASP.NET 1.1 Web Application and started it. Bang! Script error - some variable is undefined.&lt;/p&gt;&lt;p&gt;Actually there were a bunch of such errors on the page. As I intentionally mentioned earlier, the application is stable. And this particular page was not changed for quite some time. &lt;/p&gt;&lt;p&gt;Brief research of the generated HTML source, code-behind class and respective web controls revealed the cause of the exception: there was a sequence of similar Page.RegisterStartupScript statements which went in pairs. The first one in a pair registered some JavaScript object, and the second one - used the object in another declaration.&lt;br&gt;&lt;/p&gt;&lt;p&gt;First I checked source control's log - no related changes. Then, the next suspect - application configuration changes that could cause such behavior. But no, all the related controls' declarations on the page are static.&lt;/p&gt;&lt;p&gt;Ok, code was not changed, application is working fine on QA environment. So, something is wrong with my new machine. But what?&amp;nbsp;&lt;/p&gt;&lt;p&gt;I had a dim recollection that there is something wrong with the sequence of script registration in ASP.NET 1.1. But common sense told me that if something wrong could happen then it would had happened long ago.&lt;/p&gt;&lt;p&gt;Still, I opened Reflector and found such code inside RegisterScriptBlock method of System.Web.UI.Page class:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (scriptBlocks == null)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; scriptBlocks = new HybridDictionary();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;/p&gt;&lt;p&gt;As you probably well aware of, HybridDictionary changes its internal storage from ListDictionary to Hashtable starting from its ninth element. So, of course we cannot rely on any specific order of script registrations if script blocks are stored in HybridDictionary. But how did it work earlier and how the same code works on development server and QA environment without any bugs reported?&amp;nbsp;&lt;/p&gt;&lt;p&gt;So, I copied Reflector to the development server and found following code in the same RegisterScriptBlock method that I reviewed on my machine:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (scriptBlocks == null)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; scriptBlocks = new ListDictionary();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;/p&gt;&lt;p&gt;The code was fixed. But where did the fix come from? I recalled that there is a service pack for .NET 1.1 that I installed on my old development machine several years ago. Google promptly gave me a &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=a8f5654f-088e-40b2-bbdb-a83353618b38&amp;amp;displaylang=en" title=".NET 1.1 Service Pack 1" target="_blank" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=a8f5654f-088e-40b2-bbdb-a83353618b38&amp;amp;displaylang=en"&gt;link&lt;/a&gt;. &lt;/p&gt;&lt;p&gt;File name: NDP1.1sp1-KB867460-X86.exe, Version: 1, Date Published: 8/30/2004, Download Size: 10.2 MB &lt;br&gt;&lt;/p&gt;&lt;p&gt;Why am I presenting all this information here? Because the fix did not help, though I was almost certain that it should. The same HybridDictionary.&lt;/p&gt;&lt;p&gt;That's was fiasco. My working day was over several hours ago. Finish.&lt;/p&gt;&lt;p&gt;But today I decided to reproduce the issue at home. Fortunately I had a virtual machine with Windows XP and fortunately the copy of .NET 1.1 System.Web.dll had the same version as the one at work (i.e. HybridDictionary is used in RegisterScriptBlock).&lt;/p&gt;&lt;p&gt;So I started googling again and found the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=281FB2CD-C715-4F05-A01F-0455D2D9EBFB&amp;amp;displaylang=en" title=".NET 1.1 Service Pack 1" target="_blank" mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=281FB2CD-C715-4F05-A01F-0455D2D9EBFB&amp;amp;displaylang=en"&gt;second service pack&lt;/a&gt;. Strangely enough it has the same name (i.e. .NET Framework 1.1 &lt;b&gt;Service Pack 1&lt;/b&gt;) though with a lengthy suffix (.NET Framework 1.1 Service Pack 1 SYSTEM.WEB.DLL and MSCOREE.DLL Security Update for Windows 2000, Windows XP, Windows 2003 Server x64/IA64 and Windows 2003 Server R2 x64/IA64) . &lt;br&gt;&lt;/p&gt;&lt;p&gt;Like the previous service pack that I found, description for this one states that its purpose - security improvements. No mentions of ASP.NET-specific modifications. I could not find any documentation which describes the changes in detail.&lt;/p&gt;&lt;p&gt;But the main thing is that this second "Service Pack 1" done what I wanted. Eventually I had my ListDictionary back.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br&gt;The summary is: &lt;/p&gt;&lt;p&gt;1) there are at least TWO patches called ".NET 1.1 Service Pack 1"; &lt;/p&gt;&lt;p&gt;2) both of them state that they are focused on security improvements, but&lt;/p&gt;&lt;p&gt;3) one of them changes at least one fundamental aspect of ASP.NET 1.1 behavior.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br&gt;Thank you for reading. Good luck.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6199383" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/alexeigorkov/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/alexeigorkov/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Note on Customizing Content Query Web Part</title><link>http://weblogs.asp.net/coltk/archive/2008/05/17/note-on-customizing-content-query-web-part.aspx</link><pubDate>Sat, 17 May 2008 03:05:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6197713</guid><dc:creator>Colt</dc:creator><slash:comments>0</slash:comments><description>&lt;P mce_keep="true"&gt;Content Query Web Part (CQWP) is a powerful feature in SharePoint, where users can create custom view of data that is queried from various sources, lists, libraries, and present all in one web part. One of my tasks yesterday is to create a content query web part, and query the contents from two sub-sites. Specifically, I have 2 calendars in 2 sub-sites and I have to query all events and combine into a master calendar in the top site (Of course I can make use of the great filtering, sorting and grouping features in CQWP).&lt;/P&gt;
&lt;P&gt;After adding the CQWP, my next step is to customize the layout because the default one is too plain. I google and find all these useful articles:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://paulgalvin.spaces.live.com/Blog/cns!1CC1EDB3DAA9B8AA!491.entry"&gt;Display Content Query Web Part Results in a Grid / Table&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.heathersolomon.com/blog/articles/CustomItemStyle.aspx"&gt;Customizing the Content Query Web Part and Custom Item Styles&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/bb447557.aspx"&gt;How to: Customize XSL for the Content Query Web Part&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/aa981241.aspx"&gt;How to: Customize the Content Query Web Part by using Custom Properties&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A class="" href="http://blogs.msdn.com/ecm/archive/2006/10/25/configuring-and-customizing-the-content-query-web-part.aspx" target=_blank mce_href="http://blogs.msdn.com/ecm/archive/2006/10/25/configuring-and-customizing-the-content-query-web-part.aspx"&gt;Configuring and Customizing the Content Query Web Part&lt;/A&gt; &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;One of the techniques in customizing CQWP layout is to make use of internal field name and modify CommonViewFields in the exported .webpart file. I follow all steps, modify the .webpart and xsl files as I wish, but I still can't display the content in my CQWP (I can see some other default fields like Title though). &lt;/P&gt;
&lt;P&gt;Later, I find the bug is at the key element - CommonViewFields - It does not allow SPACE in the value string. For example: &lt;/P&gt;
&lt;P&gt;Wrong: &amp;nbsp;&amp;lt;property name="CommonViewFields" type="string"&amp;gt;Title, Text; Description, Note;&amp;lt;/property&amp;gt;&lt;/P&gt;
&lt;P&gt;Correct: &amp;lt;property name="CommonViewFields" type="string"&amp;gt;Title,Text;Description,Note&amp;lt;/property&amp;gt;&lt;/P&gt;
&lt;P&gt;My note is that we developers cannot add SPACE when typing the value, or even anywhere in the tag. And, we should not add a semi-colon at the end of the string.&lt;/P&gt;
&lt;P&gt;P.S. After customizing the layout and fields on the CQWP, we will most probably need to format the field, such as changing the time format of a DateTime field, number of decimal points etc, and here is a very useful reference article: &lt;A class="" href="http://www.microsoft.com/belux/msdn/nl/community/columns/stevenvandecraen/contentquerywebpart.mspx" target=_blank mce_href="http://www.microsoft.com/belux/msdn/nl/community/columns/stevenvandecraen/contentquerywebpart.mspx"&gt;Customizing the Content Query Web Part XSL&lt;/A&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6197713" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/coltk/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>ASP.NET and Images on a Network Share</title><link>http://weblogs.asp.net/kyleholder/archive/2008/05/16/asp-net-and-images-on-a-network-share.aspx</link><pubDate>Sat, 17 May 2008 01:58:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6197612</guid><dc:creator>du8die</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&amp;nbsp;The school district I work for had an idea for an application.&amp;nbsp; The need comes from several angles.&amp;nbsp; First of all, lunch counts are all done by paper.&amp;nbsp; Attendance is taken on paper, then it is sent to the Health Room, where tallies are made, and then everything is recorded into our Student Management System (SMS for short), and our Food Service app.&amp;nbsp; Most (if not all) of our elementary class rooms will have Smart Boards next year.&amp;nbsp; So we decided to write an app that would allow the students to "check in" in the morning on the smart board.&amp;nbsp; The kids can go up to the board and select their lunch choice, and do attendance all at once.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Getting the app to work was the easy part.&amp;nbsp; Our SMS keeps all of the students photos on a drive.&amp;nbsp; I wanted to use those photos directly off of the SMS server, rather than copy them locally.&amp;nbsp; So, I shared the folder that contained the pictures.&amp;nbsp; Then I mapped a drive on the server, and voila.&amp;nbsp; Everything didn't work.&amp;nbsp; &lt;/p&gt;&lt;p&gt;&amp;nbsp;Apparently, there are security restrictions that prevent a web app from using files on a network share.&amp;nbsp; It took a lot of iterations to get where I wanted.&amp;nbsp; I can post details if of the process if need-be.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Here's what I ended up with.&lt;/p&gt;&lt;p&gt;In SQL 2005, there is a little gem.&amp;nbsp; OpenRowSet.&lt;/p&gt;&lt;p&gt;&lt;b&gt;SELECT BulkColumn as 'Photo' FROM OPENROWSET(BULK N'p:\test.jpg', SINGLE_BLOB) AS Photo&lt;/b&gt;&lt;/p&gt;&lt;p&gt;This returns a single column with blob datatype.&amp;nbsp; So, I can then bring it into an image handler and go crazy. &lt;/p&gt;&lt;p&gt;Well, I mapped my drive, and then ran that command, and got an access denied error.&amp;nbsp; I realized that SQL Server runs under the local system account ("NT AUTHORITY\SYSTEM").&amp;nbsp; The mapped drive didn't exist under that identity.&amp;nbsp; So, I then found a reference somewhere (I forget the link) that says you can map a drive to the system account if you schedule a command to run with the AT command.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br&gt;So, I created a batch file that mapped the drive with the remote machine's authentication:&lt;/p&gt;&lt;p&gt;&lt;b&gt;net use p: \\10.10.xx.xx\pics remotemachinepassword /user:remotemachinename\remotemachineuser&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Then, I scheduled the AT command to run the batch file:&lt;/p&gt;&lt;p&gt;&lt;b&gt;at 20:00 c:\mapit.bat&lt;/b&gt;&lt;/p&gt;&lt;p&gt;This forced the system local account to have the mapped drive.&amp;nbsp; I then ran my SQL in my app that pulled the images over, and PERFECT!&lt;/p&gt;&lt;p&gt;So, using a little SQL Server magic and a mapped drive to the system local user, you can in fact, use a resource from a remote machine in an ASP.NET app.&lt;/p&gt;&lt;p&gt;I want to test the mapped drive without the SQL Server stuff.&amp;nbsp; I'll get to that on Monday.&lt;br&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6197612" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/kyleholder/archive/tags/ASP.Net/default.aspx">ASP.Net</category><category domain="http://weblogs.asp.net/kyleholder/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/kyleholder/archive/tags/SQL+Server/default.aspx">SQL Server</category></item><item><title>Winforms on Linux - Mono 2.0 Winform API is complete(?)</title><link>http://weblogs.asp.net/zroiy/archive/2008/05/17/winforms-on-unix-mono-2-0-winform-api-is-complete.aspx</link><pubDate>Fri, 16 May 2008 22:33:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6197078</guid><dc:creator>zroiy</dc:creator><slash:comments>1</slash:comments><description>&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;So looks like that the &lt;A class="" href="http://www.go-mono.com/" mce_href="http://www.go-mono.com"&gt;Mono&lt;/A&gt; project has reached a significant milestone by &lt;A class="" href="http://jpobst.blogspot.com/2008/05/big-finale.html" mce_href="http://jpobst.blogspot.com/2008/05/big-finale.html"&gt;completing all of its Winform 2.0 API&lt;/A&gt;.&lt;BR&gt;And it encouraged me to get back into evaluating Mono's progress. &lt;A class="" href="http://weblogs.asp.net/zroiy/archive/2007/11/03/running-c-winforms-applications-on-linux.aspx" mce_href="http://weblogs.asp.net/zroiy/archive/2007/11/03/running-c-winforms-applications-on-linux.aspx"&gt;A while back&lt;/A&gt;, I was disappointed that the rich text box component not functioning well, actually back than it simply crashed.&lt;BR&gt;I wanted to check out whether Mono has made good progress with it. So I fired up my &lt;A class="" href="http://ftp.novell.com/pub/mono/vmware/Mono-1.9.1_openSUSE-10.3.i686-4.zip" mce_href="http://ftp.novell.com/pub/mono/vmware/Mono-1.9.1_openSUSE-10.3.i686-4.zip"&gt;VMWare Suse machine&lt;/A&gt; , checked the mono version there&amp;nbsp; - it was an early version (1.2.5) . looks like it was a while back since I've touched it.&lt;BR&gt;Installing the 1.9 version was pretty easy, &lt;A class="" href="http://ftp.novell.com/pub/mono/sources-stable/" mce_href="http://ftp.novell.com/pub/mono/sources-stable/"&gt;just download it from the mono site&lt;/A&gt;, switched to root user by executing 'sudo su' on a terminal window, and then running the trivial installation commands&lt;BR&gt;&lt;BR&gt;&lt;EM&gt;tar -jxvf mono-1.9.1.tar.bz2&lt;BR&gt;cd mono-1.9.1&lt;BR&gt;./configure&lt;BR&gt;make&lt;BR&gt;make install&lt;BR&gt;&lt;/EM&gt;&lt;BR&gt;/usr/local/bin/mono -version &amp;nbsp;-&amp;gt; shows you that you've got the right version&lt;BR&gt;BTW, if you're downloading the VMWare image from&amp;nbsp;the link above , it is already preinstalled with the 1.9.1 version&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;Next I've created a simple Winforms application on Visual Studio 2005 on my windows box (which is also the host of my linux suse virtual machine), it is a simple winform with a RichTextBox component and a button that opens up a file dialog.&lt;/P&gt;
&lt;P dir=ltr&gt;I've tested it by opening a simple rtf file.&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&lt;A href="http://weblogs.asp.net/blogs/zroiy/win_rtf.JPG"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&lt;A href="http://weblogs.asp.net/blogs/zroiy/win_rtf.JPG"&gt;&lt;IMG src="http://weblogs.asp.net/blogs/zroiy/win_rtf.JPG" border=0&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;which includes both free text and an image.&lt;/P&gt;
&lt;P dir=ltr&gt;Next, I needed to move my compiled winform.exe file to the suse virtual machine&amp;nbsp;side. The easiest way to do this is to make sure there is a network connection between the virtual machine (guest) and the host machine and use the &lt;EM&gt;smbclient&lt;/EM&gt; command to connect to the host machine folder from the virtual machine.&lt;/P&gt;
&lt;P dir=ltr&gt;Here is a simple command line&lt;BR&gt;&lt;EM&gt;smbclient -w domain -user username \\[remote ip] password&lt;/EM&gt; &lt;BR&gt;this is what I used&lt;BR&gt;&lt;EM&gt;smbclinet -w domain -user user1 &lt;/EM&gt;&lt;A href="file://192.168.1.2/share"&gt;&lt;EM&gt;\\\\192.168.1.2\\share&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt; my_password&lt;/EM&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;within the smbclient application you can use the following commands (which resembles ftp commands)&lt;/P&gt;
&lt;P dir=ltr&gt;cd - change remote directory&lt;BR&gt;lcd - change local directory&lt;BR&gt;get - get a file&lt;BR&gt;dir - list remote directory content&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;So I got my rtf_window.exe and the sample rtf from my host machine into my virtual linux box, executed the application , loaded up the rtf file and this is what I got.&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&lt;A href="http://weblogs.asp.net/blogs/zroiy/linux_rtf.JPG"&gt;&lt;IMG src="http://weblogs.asp.net/blogs/zroiy/linux_rtf.JPG" border=0&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;Reminder , this is how it should look like&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&lt;A href="http://weblogs.asp.net/blogs/zroiy/win_rtf.JPG"&gt;&lt;IMG src="http://weblogs.asp.net/blogs/zroiy/win_rtf.JPG" border=0&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;Looks like some of the font properties are missing and images are not supported at all.&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;Overall it looks like that the Mono&amp;nbsp;guys have done a really good job in providing a real cross platform alternative , but&amp;nbsp;there's just this nagging RichTextBox thing..&amp;nbsp;&lt;BR&gt;Hey Mono guys, if you can fix this that would be great...&lt;/P&gt;
&lt;P dir=ltr&gt;(could it be that images are stored as BMP which is&amp;nbsp;Microsoft's IP ?)&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;Update :&amp;nbsp;using&amp;nbsp;the latest stack (&lt;A href="http://mono.ximian.com/monobuild/snapshot/snapshot_sources/mono/mono-103389.tar.bz2"&gt;mono-103389.tar.bz2&lt;/A&gt;&amp;nbsp; and &lt;A href="http://mono.ximian.com/monobuild/snapshot/snapshot_sources/libgdiplus/libgdiplus-101878.tar.bz2"&gt;libgdiplus-101878.tar.bz2&lt;/A&gt;&amp;nbsp;) doesn't help either&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6197078" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/zroiy/archive/tags/monoppix/default.aspx">monoppix</category><category domain="http://weblogs.asp.net/zroiy/archive/tags/winforms/default.aspx">winforms</category><category domain="http://weblogs.asp.net/zroiy/archive/tags/mono/default.aspx">mono</category><category domain="http://weblogs.asp.net/zroiy/archive/tags/Windows+Forms/default.aspx">Windows Forms</category><category domain="http://weblogs.asp.net/zroiy/archive/tags/cross+platform/default.aspx">cross platform</category><category domain="http://weblogs.asp.net/zroiy/archive/tags/.NET/default.aspx">.NET</category></item></channel></rss>