<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.pluralsight.com/community/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/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"><channel><title>Pluralsight Blogs</title><link>http://www.pluralsight.com/community/blogs/</link><description>See what you can learn</description><dc:language>en-US</dc:language><generator>CommunityServer 2008 SP1 (Build: 30619.63)</generator><item><title>Tito's Tacos</title><link>http://www.pluralsight.com/community/blogs/dbox/archive/2008/08/19/tito-s-tacos.aspx</link><pubDate>Wed, 20 Aug 2008 03:34:00 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52616</guid><dc:creator>don-box</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;a href="http://microsoftpdc.com/"&gt;PDC&lt;/a&gt; is increasingly taking up my time, so I&amp;#39;ve got LA on the brain.&lt;/p&gt;
&lt;p&gt;Having lived in LA for 39 years before joining the firm, I use PDC as an opportunity to visit my favorite haunts.&lt;/p&gt;
&lt;p&gt;My first stop will be &lt;a href="http://www.titostacos.com/"&gt;Tito&amp;#39;s Tacos&lt;/a&gt;.&amp;nbsp; Every time I go to LA (PDC or not), I go straight from LAX to Tito&amp;#39;s. &lt;/p&gt;
&lt;p&gt;For the PDC trips, I take as many people from my flight as possible.&lt;/p&gt;
&lt;p&gt;My recommendation is some combination of Tacos (with cheese) and Tostadas.&amp;nbsp;&amp;nbsp;Skip the burritos - way too much food and you don&amp;#39;t get that magical super-fresh lettuce/cheese combo happening.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52616" width="1" height="1"&gt;</description></item><item><title>Mary Jo's Codename Roundup</title><link>http://www.pluralsight.com/community/blogs/dbox/archive/2008/08/19/mary-jo-s-codename-roundup.aspx</link><pubDate>Wed, 20 Aug 2008 03:13:00 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52613</guid><dc:creator>don-box</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Ms. Foley has a call out for Microsoft codenames &lt;a href="http://blogs.zdnet.com/microsoft/?p=1537"&gt;over at ZDNet&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I first read this on my phone and was busy coming up with names I thought would be interesting project names. &lt;/p&gt;
&lt;p&gt;Unfortunately when I got home and read the blog, it was clear she was looking for actual names of existing projects, which I find way less interesting or fun.&lt;/p&gt;
&lt;p&gt;At the risk of incurring the wrath of MJF, let me be perfectly clear that the names I&amp;#39;m listing here have no known correlation to any existing or future projects. &lt;/p&gt;
&lt;p&gt;I just like the names.&lt;/p&gt;
&lt;p&gt;Penultimate&lt;/p&gt;
&lt;p&gt;Project Fifty Seven&lt;/p&gt;
&lt;p&gt;Neville&lt;/p&gt;
&lt;p&gt;Valhalla&lt;/p&gt;
&lt;p&gt;Folsom&lt;/p&gt;
&lt;p&gt;Cleveland&lt;/p&gt;
&lt;p&gt;Loki&lt;/p&gt;
&lt;p&gt;XK-4&lt;/p&gt;
&lt;p&gt;Maybe once Oslo is behind me I&amp;#39;ll get a chance to pick one of these up for my next gig...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52613" width="1" height="1"&gt;</description></item><item><title>Pluralsight's WCF/WF Developer Screencast Series</title><link>http://www.pluralsight.com/community/blogs/aaron/archive/2008/08/19/pluralsight-s-wcf-wf-developer-screencast-series.aspx</link><pubDate>Tue, 19 Aug 2008 23:44:52 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52609</guid><dc:creator>aaron-skonnard</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;Pluralsight has joined forces with the WCF/WF teams at Microsoft to deliver a series of short videos that illustrate how to get started using WCF/WF in your applications. The videos will be &lt;a href="http://channel9.msdn.com/Media/Screencasts/"&gt;hosted on Channel9 within the Screencasts section&lt;/a&gt;, and they&amp;#39;ll be highlighted on &lt;a href="http://blogs.msdn.com/endpoint/default.aspx"&gt;The .NET Endpoint Team Blog&lt;/a&gt; and the MSDN Dev Centers for &lt;a href="http://msdn.microsoft.com/en-us/netframework/aa663324.aspx"&gt;WCF&lt;/a&gt; &amp;amp; &lt;a href="http://msdn.microsoft.com/en-us/netframework/aa663328.aspx"&gt;WF&lt;/a&gt;. These videos provide 100-200 level content intended for folks new to the technology or those looking for quick tutorials on how to perform common tasks within each framework. &lt;/p&gt; &lt;p&gt;Cliff Simpkins &lt;a href="http://blogs.msdn.com/endpoint/archive/2008/08/13/screencast-creating-your-first-wcf-service.aspx"&gt;announced the first video in the WCF series&lt;/a&gt; last week -- you can find it &lt;a href="http://channel9.msdn.com/posts/cliff.simpkins/Endpoint-Screencasts-Creating-Your-First-WCF-Service/"&gt;over here on Channel9&lt;/a&gt;. It&amp;#39;s called &lt;em&gt;Creating Your First WCF Service&lt;/em&gt;. This short video guides you through how to create your first WCF Service from scratch in VS2008 - defining a data contract, a service contract, and testing/hosting the service using the new built-in WCF tools found in VS2008. &lt;/p&gt; &lt;p style="text-align:center;"&gt;&lt;a href="http://channel9.msdn.com/posts/cliff.simpkins/Endpoint-Screencasts-Creating-Your-First-WCF-Service/"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="154" alt="Creating your First WCF Service" src="http://www.pluralsight.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/aaron/EndpointScreenCastCreatingFirstWcfServiceVS2008_5F00_large_5F00_ch9_5F00_3_5F00_3.jpg" width="204" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;A new video will be posted every week in the series...so &lt;a href="http://channel9.msdn.com/Media/Screencasts/"&gt;check back on Channel9&lt;/a&gt; if you&amp;#39;re interested! And if you like what you see, you should also check out &lt;a href="http://www.pluralsight.com/main/olt/courses.aspx"&gt;Pluralsight&amp;#39;s new online training system&lt;/a&gt; that is currently in beta at the moment. You&amp;#39;ll be hearing more about this over the next few months but if you&amp;#39;re interested in participating in our early-adopter program, shoot me an email.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52609" width="1" height="1"&gt;</description></item><item><title>Programming the MetaWeblog API in .NET/C#</title><link>http://www.pluralsight.com/community/blogs/aaron/archive/2008/08/19/programming-the-metaweblog-api-in-net-c.aspx</link><pubDate>Tue, 19 Aug 2008 23:09:10 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52607</guid><dc:creator>aaron-skonnard</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Most modern blogging engines support the MetaWeblog API, which was &lt;a href="http://msdn.microsoft.com/en-us/library/bb259702.aspx"&gt;defined by XML-RPC.com&lt;/a&gt; many years ago.&amp;nbsp; It&amp;#39;s become one of the most popular API&amp;#39;s for programmatically interacting with blogs because of its simplicity. Even Microsoft&amp;#39;s Windows Live Spaces &lt;a href="http://msdn.microsoft.com/en-us/library/bb259702.aspx"&gt;provides support for it&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;I wanted to use this API recently to interact with our &lt;a href="http://communityserver.com/"&gt;Community Server&lt;/a&gt; implementation so I started searching around for client-side implementations that would be easy to program in C#. I was surprised that I couldn&amp;#39;t find a mainstream implementation readily available. So I followed &lt;a href="http://msdn.microsoft.com/en-us/library/aa905670.aspx"&gt;the example on MSDN&lt;/a&gt; and built my own MetaWeblog library in C# on top of Cook Computing&amp;#39;s &lt;a href="http://www.xml-rpc.net/"&gt;XML-RPC.NET library&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;Here&amp;#39;s what my MetaWeblogClient class looks like (truncated for brevity):&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;public class &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;MetaWeblogClient &lt;/span&gt;: &lt;span style="color:#2b91af;"&gt;XmlRpcClientProtocol
&lt;/span&gt;{
&lt;span style="color:gray;"&gt;    &lt;/span&gt;[&lt;span style="color:#2b91af;"&gt;XmlRpcMethod&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;metaWeblog.getRecentPosts&amp;quot;&lt;/span&gt;)]
    &lt;span style="color:blue;"&gt;public &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Post&lt;/span&gt;[] getRecentPosts(&lt;span style="color:blue;"&gt;string &lt;/span&gt;blogid, &lt;span style="color:blue;"&gt;string &lt;/span&gt;username, &lt;span style="color:blue;"&gt;string &lt;/span&gt;password, &lt;span style="color:blue;"&gt;int &lt;/span&gt;numberOfPosts)
    {
        &lt;span style="color:blue;"&gt;return &lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;Post&lt;/span&gt;[])&lt;span style="color:blue;"&gt;this&lt;/span&gt;.Invoke(&lt;span style="color:#a31515;"&gt;&amp;quot;getRecentPosts&amp;quot;&lt;/span&gt;, &lt;br /&gt;            &lt;span style="color:blue;"&gt;new object&lt;/span&gt;[] { blogid, username, password, numberOfPosts });
    }

&lt;span style="color:gray;"&gt;    &lt;/span&gt;[&lt;span style="color:#2b91af;"&gt;XmlRpcMethod&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;metaWeblog.newPost&amp;quot;&lt;/span&gt;)]
    &lt;span style="color:blue;"&gt;public string &lt;/span&gt;newPost(&lt;span style="color:blue;"&gt;string &lt;/span&gt;blogid, &lt;span style="color:blue;"&gt;string &lt;/span&gt;username, &lt;span style="color:blue;"&gt;string &lt;/span&gt;password, &lt;span style="color:#2b91af;"&gt;Post &lt;/span&gt;content, &lt;span style="color:blue;"&gt;bool &lt;/span&gt;publish)
    {

        &lt;span style="color:blue;"&gt;return &lt;/span&gt;(&lt;span style="color:blue;"&gt;string&lt;/span&gt;)&lt;span style="color:blue;"&gt;this&lt;/span&gt;.Invoke(&lt;span style="color:#a31515;"&gt;&amp;quot;newPost&amp;quot;&lt;/span&gt;, &lt;br /&gt;            &lt;span style="color:blue;"&gt;new object&lt;/span&gt;[] { blogid, username, password, content, publish });
    }&lt;br /&gt;    ...&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;With this class, you can simply make method calls like getRecentPosts, newPost, editPost, etc to interact with any blog that supports the MetaWeblog API. You will need to specify that URL to the MetaWeblog endpoint prior to making those method calls. Here&amp;#39;s an example:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;class &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Program
&lt;/span&gt;{
    &lt;span style="color:blue;"&gt;static void &lt;/span&gt;Main(&lt;span style="color:blue;"&gt;string&lt;/span&gt;[] args)
    {
        &lt;span style="color:#2b91af;"&gt;MetaWeblogClient &lt;/span&gt;blog = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;MetaWeblogClient&lt;/span&gt;();
        blog.Url = &lt;span style="color:#a31515;"&gt;&amp;quot;http://www.pluralsight.com/community/blogs/metablog.ashx&amp;quot;&lt;/span&gt;;

        &lt;span style="color:green;"&gt;// here&amp;#39;s how you post a new entry...
        &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Post &lt;/span&gt;newPost = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Post&lt;/span&gt;();
        newPost.dateCreated = &lt;span style="color:#2b91af;"&gt;DateTime&lt;/span&gt;.Now;
        newPost.title = &lt;span style="color:#a31515;"&gt;&amp;quot;Test post from Metablog Api&amp;quot;&lt;/span&gt;;
        newPost.description = &lt;span style="color:#a31515;"&gt;&amp;quot;This is the body of the post&amp;quot;&lt;/span&gt;;
        newPost.categories = &lt;span style="color:blue;"&gt;new string&lt;/span&gt;[] { &lt;span style="color:#a31515;"&gt;&amp;quot;WCF&amp;quot;, &amp;quot;WF&amp;quot; &lt;/span&gt;};
        blog.newPost(&lt;span style="color:#a31515;"&gt;&amp;quot;blogid&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;&amp;quot;username&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;&amp;quot;password&amp;quot;&lt;/span&gt;, newPost, &lt;span style="color:blue;"&gt;true&lt;/span&gt;);

        &lt;span style="color:green;"&gt;// here&amp;#39;s how you retrieve the most recent entries...
        &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Post&lt;/span&gt;[] posts = blog.getRecentPosts(&lt;span style="color:#a31515;"&gt;&amp;quot;blogid&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;&amp;quot;username&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;&amp;quot;password&amp;quot;&lt;/span&gt;, 5);
        &lt;span style="color:blue;"&gt;foreach &lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;Post &lt;/span&gt;post &lt;span style="color:blue;"&gt;in &lt;/span&gt;posts)
            &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(post.title);
    }
}&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;The code turns out to be wonderfully simple. So if you find yourself in the same boat as me, looking for a MetaWeblog C# implementation, feel free to &lt;a href="http://alt.pluralsight.com/aaron/bits/pluralsight.metaweblog.zip"&gt;download my library here&lt;/a&gt;. Hopefully it will save you a little bit of time! &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52607" width="1" height="1"&gt;</description></item><item><title>Learning Parallel Programming --- from shared-memory multi-threading to distributed-memory multi-processing</title><link>http://www.pluralsight.com/community/blogs/drjoe/archive/2008/08/18/learning-parallel-programming-from-shared-memory-multi-threading-to-distributed-memory-multi-processing.aspx</link><pubDate>Tue, 19 Aug 2008 03:29:00 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52542</guid><dc:creator>joe-hummel</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;We&amp;#39;re working with Microsoft to develop several&amp;nbsp;tutorials introducing developers to high-performance computing, parallel programming, and Windows HPC Server 2008.&amp;nbsp; Our first tutorial (for experienced HPC developers, &amp;quot;Exploiting Data Parallelism with OpenMP, MPI and HPC Server 2008&amp;quot;),&amp;nbsp;is available &lt;a href="http://www.pluralsight.com/community/blogs/drjoe/archive/2008/06/19/51178.aspx"&gt;here&lt;/a&gt;.&amp;nbsp;&amp;nbsp;We&amp;nbsp;are working on our second tutorial, &amp;quot;From Sequential to Parallel Development&amp;quot;, which is nearing completion.&amp;nbsp; This is more introductory in nature, taking the traditional &amp;quot;sequential&amp;quot; developer step-by-step into the world of parallel programming.&amp;nbsp; The tutorial is extensive, currently 50 pages in length, complete with source code, lab exercises, and solutions in both VC++ and C#.&lt;/p&gt;
&lt;p&gt;We start with a GUI-based Mandelbrot application, and show various ways to parallelize the application via multi-threading --- explicitly with .NET threads, then implicitly with OpenMP and the TPL (Task Parallel Library in the upcoming PFx, or Parallel Extensions to .NET).&amp;nbsp; We then architect a client-server version of the Mandelbrot app, introduce Windows HPC Server 2008, and show how to parallelize the app across a cluster.&amp;nbsp; This includes a discussion of many topics, including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Multi-threading&lt;/li&gt;
&lt;li&gt;Multi-processing&lt;/li&gt;
&lt;li&gt;BackgroundWorker and Thread classes&lt;/li&gt;
&lt;li&gt;OpenMP&lt;/li&gt;
&lt;li&gt;TPL&lt;/li&gt;
&lt;li&gt;MPI&lt;/li&gt;
&lt;li&gt;MPI.NET&lt;/li&gt;
&lt;li&gt;programming against the HPC Server 2008 API&lt;/li&gt;
&lt;li&gt;automating application deployment and job submission&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The goal is to show developers how to take a sequential, GUI-based application and parallelize this app across both multi-core and cluster-based hardware.&amp;nbsp; Here&amp;#39;s the current draft of the tutorial document:&amp;nbsp; &lt;a href="http://www.pluralsight.com/drjoe/sdk/SeqToParallelHPC.pdf"&gt;SeqToParallelHPC.pdf&lt;/a&gt;.&amp;nbsp; The current download including source code and lab exercises:&amp;nbsp; &lt;a href="http://www.pluralsight.com/drjoe/sdk/SeqToParallelHPC.zip"&gt;SeqToParallelHPC.zip&lt;/a&gt;.&amp;nbsp; Any and all feedback greatly appreciated.&amp;nbsp; Enjoy!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52542" width="1" height="1"&gt;</description></item><item><title>Serializable XmlDocument</title><link>http://www.pluralsight.com/community/blogs/keith/archive/2008/08/18/serializable-xmldocument.aspx</link><pubDate>Tue, 19 Aug 2008 02:58:00 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52538</guid><dc:creator>keith-brown</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;It&amp;#39;s surprising that XmlDocument isn&amp;#39;t marked [Serializable], because it&amp;#39;s very natural to serialize one into a stream. I wanted to put an object into ASP.NET ViewState the other day, and quickly ran into this roadblock, because part of the object included an XmlDocument, which is not serializable. A quick search revealed that most people deal with this problem by storing a string instead. Indeed, that was where I started, but I quickly realized that there are multiple places in my code where I want to do this sort of thing, and I don&amp;#39;t want to have to mess with it in each data structure that contains an XmlDocument.&lt;/p&gt;
&lt;p&gt;So I put together a simple class that holds an XmlDocument and implements ISerializable and called it SerializableXmlDocument. I&amp;#39;m sharing the source code here in the hopes that&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;a) somebody will find it useful, and&lt;/p&gt;
&lt;p&gt;b) somebody smarter than I am will point out how I screwed it up and help me make it better.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;SerializableXmlDocument includes implicit conversion operators to make it easy to convert to/from an XmlDocument. It holds the actual document in a property called Value. This &amp;quot;isomorph&amp;quot; pattern is one that I picked up from &lt;a href="http://www.pluralsight.com/community/blogs/craig/default.aspx" target="_blank"&gt;Craig&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;While writing this code, I also wrote a helpful extension method for getting a byte array out of a MemoryStream that is exactly the length of the data written to the stream so far (CopyUpToSeekPointer). So don&amp;#39;t go looking in the docs for MemoryStream for this method :) This is obviously not the most efficient way to consume bytes written to a MemoryStream since it copies the data into a new byte array, but it&amp;#39;s very convenient in many scenarios.&lt;/p&gt;
&lt;p&gt;Here is SerializableXmlDocument.cs:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Runtime.Serialization;&lt;br /&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Xml;&lt;br /&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.IO;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Pluralsight.Samples&lt;br /&gt;{&lt;br /&gt;    [Serializable]&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; SerializableXmlDocument : ISerializable&lt;br /&gt;    {&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; SerializableXmlDocument() { }&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; SerializableXmlDocument(XmlDocument &lt;span class="kwrd"&gt;value&lt;/span&gt;)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;this&lt;/span&gt;.Value = &lt;span class="kwrd"&gt;value&lt;/span&gt;;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; XmlDocument Value { get; set; }&lt;br /&gt;&lt;br /&gt;        &lt;span class="preproc"&gt;#region&lt;/span&gt; ISerializable implementation&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; SerializableXmlDocument(SerializationInfo info,&lt;br /&gt;                                       StreamingContext context)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;byte&lt;/span&gt;[] serializedData = (&lt;span class="kwrd"&gt;byte&lt;/span&gt;[])info.GetValue(&lt;span class="str"&gt;&amp;quot;doc&amp;quot;&lt;/span&gt;,&lt;br /&gt;                &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(&lt;span class="kwrd"&gt;byte&lt;/span&gt;[]));&lt;br /&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;null&lt;/span&gt; != serializedData)&lt;br /&gt;                &lt;span class="kwrd"&gt;this&lt;/span&gt;.Value = Deserialize(serializedData);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; GetObjectData(SerializationInfo info,&lt;br /&gt;                                  StreamingContext context)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;byte&lt;/span&gt;[] serializedData = &lt;span class="kwrd"&gt;null&lt;/span&gt;;&lt;br /&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;null&lt;/span&gt; != Value)&lt;br /&gt;                serializedData = Serialize(Value);&lt;br /&gt;            info.AddValue(&lt;span class="str"&gt;&amp;quot;doc&amp;quot;&lt;/span&gt;, serializedData);&lt;br /&gt;        }&lt;br /&gt;        &lt;span class="preproc"&gt;#endregion&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span class="preproc"&gt;#region&lt;/span&gt; &lt;span class="kwrd"&gt;implicit&lt;/span&gt; conversion to/from XmlDocument&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;implicit&lt;/span&gt; &lt;span class="kwrd"&gt;operator&lt;/span&gt; SerializableXmlDocument(&lt;br /&gt;            XmlDocument doc)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; SerializableXmlDocument(doc);&lt;br /&gt;        }&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;implicit&lt;/span&gt; &lt;span class="kwrd"&gt;operator&lt;/span&gt; XmlDocument(&lt;br /&gt;            SerializableXmlDocument sdoc)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; sdoc.Value;&lt;br /&gt;        }&lt;br /&gt;        &lt;span class="preproc"&gt;#endregion&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span class="preproc"&gt;#region&lt;/span&gt; Xml serialization helper methods&lt;br /&gt;        &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[] Serialize(XmlDocument doc)&lt;br /&gt;        {&lt;br /&gt;            MemoryStream stream = &lt;span class="kwrd"&gt;new&lt;/span&gt; MemoryStream();&lt;br /&gt;            doc.Save(stream);&lt;br /&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; stream.CopyUpToSeekPointer();&lt;br /&gt;        }&lt;br /&gt;        &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; XmlDocument Deserialize(&lt;span class="kwrd"&gt;byte&lt;/span&gt;[] serializedData)&lt;br /&gt;        {&lt;br /&gt;            XmlDocument doc = &lt;span class="kwrd"&gt;new&lt;/span&gt; XmlDocument();&lt;br /&gt;            doc.Load(&lt;span class="kwrd"&gt;new&lt;/span&gt; MemoryStream(serializedData, &lt;span class="kwrd"&gt;false&lt;/span&gt;));&lt;br /&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; doc;&lt;br /&gt;        }&lt;br /&gt;        &lt;span class="preproc"&gt;#endregion&lt;/span&gt;&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;...and here&amp;#39;s the CopyUpToSeekPointer extension method for MemoryStream:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.IO;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Pluralsight.Samples&lt;br /&gt;{&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; MemoryStreamExtensionMethods&lt;br /&gt;    {&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[] CopyUpToSeekPointer(&lt;br /&gt;            &lt;span class="kwrd"&gt;this&lt;/span&gt; MemoryStream stream)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="rem"&gt;// copy only the part of the buffer&lt;/span&gt;&lt;br /&gt;            &lt;span class="rem"&gt;// that contains the serialized document&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;long&lt;/span&gt; length = stream.Position;&lt;br /&gt;            &lt;span class="kwrd"&gt;byte&lt;/span&gt;[] buffer = stream.GetBuffer();&lt;br /&gt;            &lt;span class="kwrd"&gt;byte&lt;/span&gt;[] result = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[length];&lt;br /&gt;            &lt;span class="kwrd"&gt;for&lt;/span&gt; (&lt;span class="kwrd"&gt;int&lt;/span&gt; i = 0; i &amp;lt; length; ++i)&lt;br /&gt;                result[i] = buffer[i];&lt;br /&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; result;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;...and here&amp;#39;s a sample object that uses SerializableXmlDocument:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Pluralsight.Samples&lt;br /&gt;{&lt;br /&gt;    [Serializable]&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Item&lt;br /&gt;    {&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Name { get; set; }&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; SerializableXmlDocument Data { get; set; }&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Print()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine(&lt;span class="str"&gt;&amp;quot;Name: {0}&amp;quot;&lt;/span&gt;, Name);&lt;br /&gt;            Console.WriteLine(Data.Value.OuterXml);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;...and here&amp;#39;s a sample program that creates an instance of Item, serializes it, then deserializes it, printing diagnostics along the way to show that it&amp;#39;s working properly.&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Xml;&lt;br /&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Runtime.Serialization.Formatters.Binary;&lt;br /&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.IO;&lt;br /&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; Pluralsight.Samples;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;class&lt;/span&gt; DemoProgram&lt;br /&gt;{&lt;br /&gt;    &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Main(&lt;span class="kwrd"&gt;string&lt;/span&gt;[] args)&lt;br /&gt;    {&lt;br /&gt;        XmlDocument doc = &lt;span class="kwrd"&gt;new&lt;/span&gt; XmlDocument();&lt;br /&gt;        doc.LoadXml(&lt;span class="str"&gt;&amp;quot;&amp;lt;root&amp;gt;&amp;lt;child&amp;gt;text&amp;lt;/child&amp;gt;&amp;lt;/root&amp;gt;&amp;quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;        Item item = &lt;span class="kwrd"&gt;new&lt;/span&gt; Item&lt;br /&gt;        {&lt;br /&gt;            Name = &lt;span class="str"&gt;&amp;quot;Testing 123&amp;quot;&lt;/span&gt;,&lt;br /&gt;            Data = doc,&lt;br /&gt;        };&lt;br /&gt;&lt;br /&gt;        &lt;span class="rem"&gt;// print object before serialization&lt;/span&gt;&lt;br /&gt;        item.Print();&lt;br /&gt;&lt;br /&gt;        BinaryFormatter formatter = &lt;span class="kwrd"&gt;new&lt;/span&gt; BinaryFormatter();&lt;br /&gt;        MemoryStream stream = &lt;span class="kwrd"&gt;new&lt;/span&gt; MemoryStream();&lt;br /&gt;        formatter.Serialize(stream, item);&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;byte&lt;/span&gt;[] serializedItem = stream.CopyUpToSeekPointer();&lt;br /&gt;&lt;br /&gt;        Console.WriteLine(&lt;span class="str"&gt;&amp;quot;Serialized data (base64): {0}&amp;quot;&lt;/span&gt;,&lt;br /&gt;            Convert.ToBase64String(serializedItem));&lt;br /&gt;&lt;br /&gt;        item = (Item)formatter.Deserialize(&lt;br /&gt;            &lt;span class="kwrd"&gt;new&lt;/span&gt; MemoryStream(serializedItem, &lt;span class="kwrd"&gt;false&lt;/span&gt;));&lt;br /&gt;&lt;br /&gt;        &lt;span class="rem"&gt;// print object after deserialization&lt;/span&gt;&lt;br /&gt;        item.Print();&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;Here&amp;#39;s the output of the previous sample program:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.pluralsight.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/keith/sample_2D00_output_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" alt="sample-output" src="http://www.pluralsight.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/keith/sample_2D00_output_5F00_thumb.jpg" width="422" border="0" height="214" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Flame away!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52538" width="1" height="1"&gt;</description><category domain="http://www.pluralsight.com/community/blogs/keith/archive/tags/Geek+talk/default.aspx">Geek talk</category><category domain="http://www.pluralsight.com/community/blogs/keith/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>Impromptu Vacation</title><link>http://www.pluralsight.com/community/blogs/dbox/archive/2008/08/15/impromptu-vacation.aspx</link><pubDate>Sat, 16 Aug 2008 05:37:00 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52516</guid><dc:creator>don-box</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;For the first time ever, I&amp;nbsp;took a completely spontaneous vacation by booking a flight Wednesday to head out to Martha&amp;#39;s Vineyard to hang out with my wife &amp;amp; kids (and Sara Spalding&amp;#39;s husband and kid).&lt;/p&gt;
&lt;p&gt;I really like Martha&amp;#39;s Vineyard - I also really like not having to make any plans.&lt;/p&gt;
&lt;p&gt;Swimming in the Atlantic is also pretty cool - I forgot how much I like the ocean after 6+ years living near Lake Washington.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52516" width="1" height="1"&gt;</description></item><item><title>Two-way formatted data binding in ASP.NET</title><link>http://www.pluralsight.com/community/blogs/keith/archive/2008/08/15/two-way-formatted-data-binding-in-asp-net.aspx</link><pubDate>Fri, 15 Aug 2008 20:22:37 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52504</guid><dc:creator>keith-brown</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Two way data binding in ASP.NET is easy, just use the Bind expression and data will flow between your web controls and your data source flawlessly. Until that is, you try to use a format string:&lt;/p&gt; &lt;p&gt;Bind(&amp;quot;AmountCharged&amp;quot;, &amp;quot;{0:C}&amp;quot;)&lt;/p&gt; &lt;p&gt;While this displays just as you&amp;#39;d expect (e.g., $200), it doesn&amp;#39;t do so well when you submit an edit that includes the same value ($200):&lt;/p&gt; &lt;p&gt;&lt;span style="font-weight:normal;font-size:14pt;color:maroon;font-family:&amp;#39;Verdana&amp;#39;;"&gt;&lt;i&gt;Input string was not in a correct format.&lt;/i&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;I searched around and didn&amp;#39;t find much in the way of a clean solution, but I did solve the problem with just a few lines of code. The trick is to handle the data-bound control&amp;#39;s Updating event. Since I was working with a GridView, my solution looked a bit like this:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:GridView&lt;/span&gt; &lt;span class="attr"&gt;DataSourceID&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;#39;myDataSource&amp;#39;&lt;/span&gt;
              &lt;span class="attr"&gt;OnRowUpdating&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;#39;FixFormatting&amp;#39;&lt;/span&gt;
              &lt;span class="attr"&gt;AutoGenerateColumns&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;#39;false&amp;#39;&lt;/span&gt;
              &lt;span class="attr"&gt;CellPadding&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;3&amp;quot; ...&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Notice the OnRowUpdating handler that I&amp;#39;ve installed in my grid view. That code looks like this:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; FixFormatting(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, GridViewUpdateEventArgs args)
{
    &lt;span class="kwrd"&gt;decimal&lt;/span&gt; amountPaid = ParseDecimal((&lt;span class="kwrd"&gt;string&lt;/span&gt;)args.NewValues[&lt;span class="str"&gt;&amp;quot;AmountPaid&amp;quot;&lt;/span&gt;]);
    args.NewValues[&lt;span class="str"&gt;&amp;quot;AmountPaid&amp;quot;&lt;/span&gt;] = amountPaid;
}&lt;/pre&gt;
&lt;p&gt;When you handle this event, you&amp;#39;re given a dictionary of old and new values, which appear to come directly from the controls (in my case, a TextBox was used to gather the updated data AmountPaid, so the type of object that I found in NewValues[&amp;quot;AmountPaid&amp;quot;] was a string. I wrote a little helper method called ParseDecimal that parses a string into a decimal value, allowing currency characters, decimal points, and thousands separators. I also allowed a blank value to indicate zero:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;decimal&lt;/span&gt; ParseDecimal(&lt;span class="kwrd"&gt;string&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;)
{
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;string&lt;/span&gt;.IsNullOrEmpty(&lt;span class="kwrd"&gt;value&lt;/span&gt;))
        &lt;span class="kwrd"&gt;return&lt;/span&gt; 0;
    &lt;span class="kwrd"&gt;return&lt;/span&gt; Decimal.Parse(&lt;span class="kwrd"&gt;value&lt;/span&gt;,
        NumberStyles.AllowThousands |
        NumberStyles.AllowDecimalPoint |
        NumberStyles.AllowCurrencySymbol,
        CultureInfo.InstalledUICulture);
}
&lt;/pre&gt;
&lt;p&gt;This solved the problem quite nicely. Now two-way binding works with formatted data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52504" width="1" height="1"&gt;</description><category domain="http://www.pluralsight.com/community/blogs/keith/archive/tags/Geek+talk/default.aspx">Geek talk</category><category domain="http://www.pluralsight.com/community/blogs/keith/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>Musculosenioritis</title><link>http://www.pluralsight.com/community/blogs/mike/archive/2008/08/13/musculosenioritis.aspx</link><pubDate>Wed, 13 Aug 2008 15:40:21 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52467</guid><dc:creator>mike-woodring</dc:creator><slash:comments>3</slash:comments><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;[muhs-kyuh-loh-seen-yawr-eye-tis]&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;-noun &lt;em&gt;Pathology&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;soreness and weakness of the muscles, generally following athletic physical exertions reminiscent of the sufferer’s younger days; typically accompanied by the onset of stiffness and reduced ambulatory mobility during the 24-72 hours following the cessation of athletic activities.&lt;/p&gt;    &lt;p&gt;[origin: August 4-13, 2008; &lt;a href="http://dictionary.reference.com/search?r=2&amp;amp;q=musculo-"&gt;musculo&lt;/a&gt;- + &lt;a href="http://en.wikipedia.org/wiki/Old_age"&gt;senior&lt;/a&gt; + &lt;a href="http://en.wikipedia.org/wiki/-itis"&gt;-itis&lt;/a&gt;]&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I finally have a diagnosis.&amp;#160; Over the past few years, I’ve periodically suffered from a near-debilitating condition that results in great difficulty walking as well as moving from a sitting to a standing position; especially following prolonged periods of programming involving only the movement of my fingers and eyes.&amp;#160; Until today, nobody could tell me what it was I was suffering from.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This condition generally sets in after I compete in athletic events (soccer, in my case), where I run, jump, and otherwise exert myself as if I were still a strong, fit athlete younger than 24 years of age.&amp;#160; Alas, it has become increasingly apparent to me that this is no longer the case.&amp;#160; In my case, the breakthrough diagnosis came last night after the adult, co-ed soccer team I’m a member of completed our run at this year’s trophy.&amp;#160; We competed in 4 matches over a 4 day period last week, had the weekend off to ice and medicate our aches and pains, and then kicked off this week by competing in 2 more matches over the past 2 days.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;As I sat on the sidelines after our loss last night, physically depleted and sapped of every last scrap of energy within me, I wondered what had brought me to this low point in my life.&amp;#160; What malady was it that I could feel setting in even as I sat there limp with fatigue?&amp;#160; What was it that caused such foreboding of what was to come this morning – a condition that I knew would worsen over the next few days as I sat here at my computer, typing lambda expressions and disassembling the contents of memory pointed to be the EIP register?&amp;#160; What was it that could cause such physical pain merely attempting to rise from my chair and walk upstairs to refill my coffee cup?&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;And then it came to me - a word that so perfectly describes the condition suffered by myself and so many other over-the-hill athletes around the world: &lt;em&gt;&lt;strong&gt;musculosenioritis&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Yes, I finally have a name for my tormentor.&amp;#160; Like so many other afflictions, there is no known cure.&amp;#160; Some would point to studies that indicate the condition can be ameliorated by abstaining from athletic competition clearly suited to younger, more physically fit personnel.&amp;#160; But abstinance is no cure – it’s avoidance.&amp;#160; And I will always choose to face my challenges head on; without quitting.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;And so I will take what comfort I can just knowing that my affliction now bears a name, and that I am not alone in my suffering.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52467" width="1" height="1"&gt;</description></item><item><title>Visual Studio SP1 and The Metification of REST</title><link>http://www.pluralsight.com/community/blogs/scottallen/archive/2008/08/11/visual-studio-sp1-and-the-metification-of-rest.aspx</link><pubDate>Tue, 12 Aug 2008 02:39:00 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52475</guid><dc:creator>scott-allen</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;strong&gt;Metification&lt;/strong&gt; – verb&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;The act of adding metadata to a web service in order to facilitate tooling and discovery. &lt;/li&gt;    &lt;li&gt;The act of adding complexity to a web service in order to achieve tight coupling. &lt;/li&gt; &lt;/ol&gt;  &lt;blockquote&gt;   &lt;p&gt;Pick one. &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Service Pack 1 for Visual Studio 2008 has just arrived with new features, including version 1.0 of &lt;a href="http://astoria.mslivelabs.com/" target="_blank"&gt;ADO.NET Data Services&lt;/a&gt; (a.k.a Astoria). From the description (highlighting is mine):&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;ADO.NET Data Services … consists of a combination of patterns and libraries that enables any data store to be exposed as a flexible data service, naturally integrating with the Web, that can be consumed by Web clients within a corporate network or across the Internet. ADO.NET Data Services uses URIs to point to pieces of data and &lt;strong&gt;simple, well-known formats&lt;/strong&gt; to represent that data, such as JSON and ATOM/APP. This results in data being exposed to Web clients as a &lt;strong&gt;REST-style resource collection&lt;/strong&gt;, &lt;strong&gt;addressable with URIs that agents can interact with using standard HTTP verbs such as GET, POST, or DELETE&lt;/strong&gt;. &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Compared to the traditional SOAP approach, the &lt;a href="http://www.google.com/search?hl=en&amp;amp;q=REST" target="_blank"&gt;REST&lt;/a&gt;-style is a different model for exposing functionality over a web service. Instead of defining messages and exposing operations that act on those messages, you expose resources and act on the resources using common HTTP verbs. I’ve lately been thinking of SOAP based web services as “verb oriented” (exposing GetOrder and UpdateCustomer), while REST style web services are “noun oriented” (exposing Orders and Customers). Both models have advantages and disadvantages, but I’ve felt that REST partners well with rich, Internet applications that need to retrieve a variety of resources&amp;#160; using the same filtering and paging parameters. Modeling a heap of GetThisByThat operations using SOAP is tedious.&amp;#160; &lt;/p&gt;  &lt;p&gt;Noun and verbs aren’t the only difference between REST and SOAP. One of the primary strengths of REST is its inherent simplicity. The simplicity not only facilitates broad interoperability, but encourages an acceptance of REST from many who feel overwhelmed by the complexities of &lt;a href="http://www.google.com/search?hl=en&amp;amp;q=ws+death+star" target="_blank"&gt;WS-*&lt;/a&gt;. There are no tools required for REST - all you need is the ability to send an HTTP request and read the response. WS-*, on the other hand, is great when you need a digitally signed message including double-secret user credentials routed through an asynchronous and distributed, two-phase commit transaction with an extended buyer protection. Not everyone needs that flexibility, but you still pay the price for the flexibility when using the tooling and the API, and when configuring the service. &lt;/p&gt;  &lt;p&gt;Although we could continue talking about differences in REST and SOAP, I wanted to talk about metadata, and Astoria. &lt;/p&gt;  &lt;h2&gt;&lt;/h2&gt;  &lt;h3&gt;Metafication&lt;/h3&gt;  &lt;p&gt;REST proponents, as a rule of thumb, shun metadata – but not all forms of metadata. Metadata in prose or written documentation is fine. Metadata in a self-describing response format is fine. However, metadata for tooling is seen by many as pure evil. Part of the complexity in WS-* is in the quirky and convoluted folds of metadata formats like WSDL and XML Schema. REST has seen some attempts at standardized metadata (&lt;a href="http://www.25hoursaday.com/weblog/2007/06/04/WhatsWrongWithWADL.aspx" target="_blank"&gt;WADL&lt;/a&gt;, WSDL 2.0, XSD), but still resists all attempts for the most part.&amp;#160; &lt;/p&gt;  &lt;p&gt;I like metadata. Maybe I’ve been in the .NET ecosystem for so long that I expect tooling, but I still remember the first time I tried to write a program for the &lt;a href="http://www.flickr.com/services/api/" target="_blank"&gt;Flickr web service&lt;/a&gt; (which is technically just POX). I was shocked when I coudn’t find a WSDL file. Then I was surprised at how easy it was to craft the correct URL for an HTTP request, and shred apart the XML response to find photographs. It was so easy that ... well, it was just too easy. It reminded me of writing data access code from scratch. Data access code is so predictable and repetitive that we have tools, frameworks, and code generators to take care of the job. But those tools, frameworks, and code generators rely on metadata defined by a database schema, so their job is relatively straightforward. REST is a bit different, unless you are working with Astoria on the server and a CLR client. &lt;/p&gt;  &lt;p&gt;Let’s say you have some DTOs for employees, orders, and other objects you want to send over the wire. You’ll need to decorate them with enough information for the service to understand the primary key.&lt;/p&gt;  &lt;pre class="code"&gt;[&lt;span style="color:#2b91af;"&gt;DataServiceKey&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;ID&amp;quot;&lt;/span&gt;)]
&lt;span style="color:blue;"&gt;public class &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Employee
&lt;/span&gt;{
   
    &lt;span style="color:blue;"&gt;public int &lt;/span&gt;ID { &lt;span style="color:blue;"&gt;get&lt;/span&gt;; &lt;span style="color:blue;"&gt;set&lt;/span&gt;; }
    &lt;span style="color:blue;"&gt;public string &lt;/span&gt;Name { &lt;span style="color:blue;"&gt;get&lt;/span&gt;; &lt;span style="color:blue;"&gt;set&lt;/span&gt;; }
}
[&lt;span style="color:#2b91af;"&gt;DataServiceKey&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;ID&amp;quot;&lt;/span&gt;)]
&lt;span style="color:blue;"&gt;public class &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Order
&lt;/span&gt;{
    // …
}&lt;/pre&gt;

&lt;p&gt;Next, define a class with public IQueryable&amp;lt;T&amp;gt; properties for each “entity set” (Employees and Orders). IQueryable&amp;lt;T&amp;gt; is easy to conjure up, and the class below represents a read-only data source with some fake in-memory data. If you need create, update, and delete functionality the class will need to implement IUpdateable, too. Sean Wildermuth has a &lt;a href="http://wildermuth.com/2008/07/01/Implementing_IUpdatable_(Part_1)" target="_blank"&gt;three series blog post&lt;/a&gt; about IUpdateable that he wrote when implementing IUpdateable for the NHibernate LINQ project. &lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;public class &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;AcmeData &lt;/span&gt;&lt;span style="color:green;"&gt;
&lt;/span&gt;{
    public &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;IQueryable&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;Employee&lt;/span&gt;&amp;gt; Employees
    {
        &lt;span style="color:blue;"&gt;get 
        &lt;/span&gt;{   &lt;span style="color:blue;"&gt;return new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;Employee&lt;/span&gt;&amp;gt;
            {
                &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Employee&lt;/span&gt;() &lt;span style="color:green;"&gt;/* ... */&lt;/span&gt;,
                &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Employee&lt;/span&gt;() &lt;span style="color:green;"&gt;/* ... */&lt;/span&gt;,
                &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Employee&lt;/span&gt;() &lt;span style="color:green;"&gt;/* ... */
                // ...
            &lt;/span&gt;}.AsQueryable();        
        }
    }

&lt;span style="color:blue;"&gt;    public &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;IQueryable&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;Order&lt;/span&gt;&amp;gt; Orders
    {
        &lt;span style="color:green;"&gt;// ...
    &lt;/span&gt;}
    &lt;span style="color:green;"&gt;// ...
&lt;/span&gt;}&lt;/pre&gt;

&lt;p&gt;Then you need an .svc file…&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;%&lt;span style="color:#a31515;"&gt;@ &lt;/span&gt;&lt;span style="color:red;"&gt;ServiceHost Language&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;C#&lt;/span&gt;&amp;quot; 
    &lt;span style="color:red;"&gt;Factory&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;System.Data.Services.DataServiceHostFactory, 
             System.Data.Services, 
             Version=3.5.0.0, Culture=neutral, 
             PublicKeyToken=b77a5c561934e089&lt;/span&gt;&amp;quot; 
    &lt;span style="color:red;"&gt;Service&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;AcmeDataService&lt;/span&gt;&amp;quot; %&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;… and you’ll also need a code-behind file for the .svc (which is all setup for you using an ADO.NET data service template, you just add some configuration):&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;public class &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;AcmeDataService &lt;/span&gt;: &lt;span style="color:#2b91af;"&gt;DataService&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;AcmeData&lt;/span&gt;&amp;gt;
{        
    &lt;span style="color:blue;"&gt;public static void &lt;/span&gt;InitializeService(&lt;span style="color:#2b91af;"&gt;IDataServiceConfiguration &lt;/span&gt;config)
    {
        config.SetEntitySetAccessRule(&lt;span style="color:#a31515;"&gt;&amp;quot;Employees&amp;quot;&lt;/span&gt;, &lt;span style="color:#2b91af;"&gt;EntitySetRights&lt;/span&gt;.AllRead);
        &lt;span style="color:green;"&gt;// ... more rules
    &lt;/span&gt;}
}&lt;/pre&gt;

&lt;p&gt;At this point you can start testing the service using a web browser and looking at, for example, http://localhost/AcmeDataService.svc/Employees. What is more interesting is looking at http://localhost/AcmeDataService.svc/$metadata, because there you’ll find service metadata, which is where the magic starts. &lt;/p&gt;

&lt;p&gt;To consume the service, right-click on a project in Visual Studio and select “Add Service Reference…”. Yes – the same “Add Service Reference” command you might have seen in the hit motion picture “SOAP and WSDL – an XML Love Story”. This feature blurs the lines between REST and WS-*. Enter the root URL to the service and Visual Studio will generate a proxy – but not the type of proxy you receive when using SOAP based web services. This proxy will derive from DataServiceContext class and you can use it like so:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;var &lt;/span&gt;employees = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;AcmeData&lt;/span&gt;(serviceRoot)
                    .Employees
                    .Where(e =&amp;gt; e.Name == &lt;span style="color:#a31515;"&gt;&amp;quot;Scott&amp;quot;&lt;/span&gt;)
                    .OrderBy(e =&amp;gt; e.Name)
                    .Skip(2)
                    .Take(2)                      
                    .ToList();&lt;/pre&gt;

&lt;p&gt;DataServiceContext does a little bit of magic to turn the LINQ query into the following HTTP request. It’s LINQ to REST:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre&gt;GET /AcmeDataService.svc/Employees()&lt;br /&gt;    ?$filter=Name%20eq%20&amp;#39;Scott&amp;#39;&amp;amp;$orderby=Name&amp;amp;$skip=2&amp;amp;$top=2 HTTP/1.1&lt;br /&gt;User-Agent: Microsoft ADO.NET Data Services&lt;br /&gt;Accept: application/atom+xml,application/xml&lt;br /&gt;&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;The data service will respond with some XML that the data context uses to create objects that look just like the server side DTOs. &lt;/p&gt;

&lt;p&gt;I’m sure some are horrified at this metification of REST, but for scenarios when you need to talk between two CLR appdomains (think ASP.NET and Silverlight), this approach gives you the advantages of thinking about nouns in a RESTful model without writing all the glue code to wire up an endpoints and parse XML. Beauty! &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52475" width="1" height="1"&gt;</description></item><item><title>Visual Studio 2008 SP1 and Team Foundation Server 2008 SP1 available now</title><link>http://www.pluralsight.com/community/blogs/brian/archive/2008/08/11/visual-studio-2008-sp1-and-team-foundation-server-2008-sp1-available-now.aspx</link><pubDate>Mon, 11 Aug 2008 18:05:00 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52439</guid><dc:creator>brian-randell</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;On &lt;a href="http://msdn.microsoft.com/en-us/subscriptions/default.aspx"&gt;MSDN Subscriber downloads&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:line-through;"&gt;A quick look at the Microsoft.com downloads site and I don&amp;#39;t see it yet for the .NET Framework 3.5 but I imagine soon.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Update: &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;.NET Framework SP1 is &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=AB99342F-5D1A-413D-8319-81DA479AB0D7&amp;amp;displaylang=en"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;VS is &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=fbee1648-7106-44a7-9649-6d9f6d58056e&amp;amp;DisplayLang=en"&gt;here&lt;/a&gt;&amp;nbsp;.&lt;/p&gt;
&lt;p&gt;Thanks to &lt;a href="http://blogs.msdn.com/pblog/archive/2008/08/11/visual-studio-2008-sp1-and-net-framework-3-5-sp1-released.aspx"&gt;Paolo Barone&lt;/a&gt; for the links.&lt;/p&gt;
&lt;p&gt;And now TFS is showing up too &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=9e40a5b6-da41-43a2-a06d-3cee196bfe3d&amp;amp;DisplayLang=en"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52439" width="1" height="1"&gt;</description><category domain="http://www.pluralsight.com/community/blogs/brian/archive/tags/VSTS/default.aspx">VSTS</category></item><item><title>DasKeyboard Enabled</title><link>http://www.pluralsight.com/community/blogs/fritz/archive/2008/08/08/daskeyboard-enabled.aspx</link><pubDate>Fri, 08 Aug 2008 16:58:00 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52404</guid><dc:creator>fritz-onion</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;After reading Scott Hanselman&amp;#39;s &lt;a href="http://www.hanselman.com/blog/DasKeyboardTheNextGeneration.aspx"&gt;review&lt;/a&gt; of &lt;a href="http://www.daskeyboard.com/"&gt;DasKeyboard&lt;/a&gt;, I knew one was in my future. I&amp;#39;m very finicky about how my keyboard feels, and for the past several years have been using a &lt;a href="http://www.pcuniverse.com/Lenovo-ThinkPad-USB-Keyboard-with-UltraNav-Keyboard-USB-UltraNav/41N5673/pd/p4034971&amp;amp;m_id=32&amp;amp;utm_source=google&amp;amp;utm_medium=ps"&gt;Thinkpad keyboard&lt;/a&gt; for my desktop which I quite like, it&amp;#39;s exactly like typing on my Thinkpad laptop. But when I read how this keyboard clicked like the old IBM 101s (which I loved) and had mechanical key switches, I was sure I&amp;#39;d love it.&lt;/p&gt; &lt;p&gt;Well, it arrived today, and it is by far the best keyboard I&amp;#39;ve ever typed on. It&amp;#39;s very satisfying to type on - especially if you can type fast, you get this nice clickety-clackety sound going that makes you want to keep typing faster. An in case you&amp;#39;re wondering, yes, I got the &lt;em&gt;ultimate&lt;/em&gt; version with 100% blank keys. It appealed to me as a classical guitarist (my non-tech hobby) where you have to have an innate feel for where each fret is because there are no visual indicators on the fretboard to help you. Having no symbols on the keys means you have to &amp;#39;just know&amp;#39; - no hunting and pecking allowed. Like the guitar, it takes some getting used to, but in the end it changes the way you interact with the computer. There are two raised bars on the &amp;#39;f&amp;#39; and &amp;#39;j&amp;#39; keys to help your hands get to home position. &lt;a href="http://www.pluralsight.com/main/instructor.aspx?name=keith-brown"&gt;Keith&lt;/a&gt; told me I should file them off - only then would I truly be at one with the keyboard :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52404" width="1" height="1"&gt;</description></item><item><title>Value Stream Mapping</title><link>http://www.pluralsight.com/community/blogs/starr/archive/2008/08/06/value-stream-mapping.aspx</link><pubDate>Wed, 06 Aug 2008 21:01:44 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52380</guid><dc:creator>david-starr</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Alan just finished recording an Elegant Code Cast with me that will be published later.&lt;/p&gt;  &lt;p&gt;I attended &lt;a href="http://www.netobjectives.com/bio-alan-shalloway" target="_blank"&gt;Alan Shalloway&lt;/a&gt;’s session at &lt;a href="http://www.agile2008.org/" target="_blank"&gt;Agile 2008&lt;/a&gt; on &lt;a href="http://en.wikipedia.org/wiki/Value_Stream_Mapping" target="_blank"&gt;Value Stream Mapping&lt;/a&gt;. I have been wanting to pick up the skill of creating value stream maps for some time and this is a great introduction to the idea. Value Stream Mapping is essentially modeling a problem in terms of Lean and looking for opportunities to optimize your organization in terms of Lean.&lt;/p&gt;  &lt;p&gt;Frankly, this looks like typical &lt;a href="http://en.wikipedia.org/wiki/Business_process_modeling" target="_blank"&gt;Business Process Modeling&lt;/a&gt; with the added dimension of the value you are trying to optimize for. It also looks similar &lt;a href="http://en.wikipedia.org/wiki/Root_cause_analysis" target="_blank"&gt;Root Cause Analysis&lt;/a&gt;. I will definitely try this in the real word to see how effective a communication device this model can be.&lt;/p&gt;  &lt;p&gt;Here are the steps of creating a value stream map. &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Identify Actions Performed in the Value Stream      &lt;ol&gt;       &lt;li&gt;Identify the stream of work between idea conceptualization and delivery to a customer &lt;/li&gt;        &lt;li&gt;Model the major process and gates involved in creation and delivery &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt;    &lt;li&gt;Determine Calendar Time      &lt;ol&gt;       &lt;li&gt;How long does it take to get from conceptualization to delivery &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt;    &lt;li&gt;Calculate Time Actually Worked on the Action      &lt;ol&gt;       &lt;li&gt;Measure time per person &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt;    &lt;li&gt;Identify Times Between Actions      &lt;ol&gt;       &lt;li&gt;How long do you pause in between actions? &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt;    &lt;li&gt;Identify Loop Backs Required      &lt;ol&gt;       &lt;li&gt;How much rework is occurring? &lt;/li&gt;        &lt;li&gt;How many pieces of work are being rejected for defects? &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt;    &lt;li&gt;Identify how many items are waiting in any queues in the system.      &lt;ol&gt;       &lt;li&gt;Are there any queues occurring before actions in the process? &lt;/li&gt;        &lt;li&gt;How large are they? Don’t go overboard here, just look for big or little. &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt;    &lt;li&gt;Compute Process Cycle Efficiency      &lt;ol&gt;       &lt;li&gt;Process Cycle Efficiency = Tome Worked/Total Cycle Time          &lt;ul&gt;           &lt;li&gt;This is pretty self evident and pretty cool. How many of us actually look at this? &lt;/li&gt;            &lt;li&gt;509 hrs/3433 hrs = 14.9% efficiency &lt;/li&gt;            &lt;li&gt;This is worth shock value, but it the key is to raise the % by reducing the denominator &lt;/li&gt;            &lt;li&gt;If you can approach 50% in software development, you are cooking well. Most teams run between .01% and 8%. Agile teams typically run around 30%. &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;strong&gt;Other Notes&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Single Piece Flow is always a theme with Alan and today was no exception. Single piece flow is a technique of optimizing the whole and reducing time to market by focusing on one thing at a time.&lt;/li&gt;    &lt;li&gt;Determine the prime metric of value before you begin. Are you measuring time, cost, quality, or what?&lt;/li&gt;    &lt;li&gt;Focus on delays and loop backs for optimizations &lt;/li&gt;    &lt;li&gt;Value streams may be created on a feature by feature basis &lt;/li&gt;    &lt;li&gt;“Metrics as they are applied today are almost always counterproductive.” &lt;/li&gt;    &lt;li&gt;“The best metric I know is end-to-end cycle time.” &lt;/li&gt;    &lt;li&gt;“Measuring the efficiency of a single step is extremely counterproductive.” &lt;/li&gt; &lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52380" width="1" height="1"&gt;</description></item><item><title>My Life in a Bush of Legacy Code – Michael Feathers</title><link>http://www.pluralsight.com/community/blogs/starr/archive/2008/08/06/my-life-in-a-bush-of-legacy-code-michael-feathers.aspx</link><pubDate>Wed, 06 Aug 2008 20:56:04 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52378</guid><dc:creator>david-starr</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;I am attending this session from the &lt;a href="http://www.michaelfeathers.com/" target="_blank"&gt;godfather of legacy code&lt;/a&gt;. How could I pass it up?&lt;/p&gt;  &lt;p&gt;Michael’s core assertion is that a code base reflects the business climate of the organization that created it. &lt;/p&gt;  &lt;h3&gt;Session Quotes&lt;/h3&gt;  &lt;ul&gt;   &lt;li&gt;The result of my book has been the opportunity for me to see some of the worst code you can imagine. &lt;/li&gt;    &lt;li&gt;Two things we deal with: Laziness and ignorance. Ignorance is forgivable and correctable. &lt;/li&gt;    &lt;li&gt;Code is alive and it has its own defenses. A big one is the code’s complexity increases in order to keep you from messing with it. Like a garden getting out of control.      &lt;ul&gt;       &lt;li&gt;&lt;em&gt;Personal Note:&lt;/em&gt; I like to think about this as “trending to entropy”. Organic systems (like a code base or a human) ill trend to entropy without constant attention to its health. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Organic systems go through periods of recession and recovery.      &lt;ul&gt;       &lt;li&gt;Like breaking down muscles to get stronger. &lt;/li&gt;        &lt;li&gt;Like the U.S. economy today. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;If an organization has no competition, code will atrophy &lt;/li&gt;    &lt;li&gt;TCO of a code base increases due to complexity, not its size. &lt;/li&gt;    &lt;li&gt;The way of the magpie is to chase shiny things. Magpie’s create sticky balls of mud. Don’t be a magpie. &lt;/li&gt;    &lt;li&gt;Emergence works. Put a small group of people together and let them own a problem. They will almost always succeed. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Dunbar&amp;#39;s_number" target="_blank"&gt;Dunbar’s Number&lt;/a&gt;. Look it up, this is cool. Group sizes larger than this require restrictive rules, laws, and policies in order to maintain stability. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;My question: “Do you have some prescriptive guidance for an individual team member who would like to evolve the the team and reclaim a code base that has trended toward entropy?”&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Have someone on the team who can do green field TDD. Someone on the team needs to understand what to strive for. &lt;/li&gt;    &lt;li&gt;Set standards for quality and team behavior and hold people accountable to those standards. &lt;/li&gt;    &lt;li&gt;Find the area of code that everyone is scared of. Attack that one first. The team will feel better having relieved its pain and realized initial success.      &lt;ul&gt;       &lt;li&gt;Note: This one reminds me of Mary Poppendieck’s saying, “Find the thing that is hard to do, and do it more often.” &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52378" width="1" height="1"&gt;</description></item><item><title>Where to get Password Minder</title><link>http://www.pluralsight.com/community/blogs/keith/archive/2008/08/05/where-to-get-password-minder.aspx</link><pubDate>Tue, 05 Aug 2008 17:00:00 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52369</guid><dc:creator>keith-brown</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;We recently updated our website and some links have broken as a result. Here&amp;#39;s the place you should go to get the latest version of Password Minder:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mercury.pluralsight.com/tools.aspx"&gt;http://mercury.pluralsight.com/tools.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Sorry for any inconvenience!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52369" width="1" height="1"&gt;</description><category domain="http://www.pluralsight.com/community/blogs/keith/archive/tags/Security/default.aspx">Security</category><category domain="http://www.pluralsight.com/community/blogs/keith/archive/tags/Geek+talk/default.aspx">Geek talk</category><category domain="http://www.pluralsight.com/community/blogs/keith/archive/tags/Identity/default.aspx">Identity</category></item><item><title>Welcome Sahil!</title><link>http://www.pluralsight.com/community/blogs/fritz/archive/2008/08/04/welcome-sahil.aspx</link><pubDate>Mon, 04 Aug 2008 14:45:46 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52353</guid><dc:creator>fritz-onion</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;It is with great pleasure that I introduce &lt;a href="http://www.winsmarts.com/"&gt;Sahil Malik&lt;/a&gt; as a Pluralsight instructor. Sahil comes to us with plenty of real-world experience working with clients deploying SharePoint solutions, as well as years of instructional experience - a perfect match for our expectations here at Pluralsight. He will be joining &lt;a href="http://www.pluralsight.com/main/instructor.aspx?name=brian-randell"&gt;Brian Randell&lt;/a&gt; to round out our SharePoint curriculum, focusing his efforts on &lt;a href="http://office.microsoft.com/en-us/sharepointserver/FX100492001033.aspx"&gt;MOSS&lt;/a&gt;. Welcome Sahil - I&amp;#39;m sure you will find the &lt;a href="http://blah.winsmarts.com/2008-8-pluralsight_Assimilate_SahilMalik.aspx"&gt;assimilation&lt;/a&gt; painless ;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52353" width="1" height="1"&gt;</description></item><item><title>Better exception reporting in ASP.NET part 2</title><link>http://www.pluralsight.com/community/blogs/keith/archive/2008/08/04/better-exception-reporting-in-asp-net-part-2.aspx</link><pubDate>Mon, 04 Aug 2008 14:11:14 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52349</guid><dc:creator>keith-brown</dc:creator><slash:comments>4</slash:comments><description>&lt;p&gt;This is the third post in a series.&lt;/p&gt; &lt;p&gt;The &lt;a href="http://www.pluralsight.com/community/blogs/keith/archive/2008/08/01/asp-net-health-monitoring-doesn-t-log-inner-exception-stack-trace.aspx" target="_blank"&gt;first post&lt;/a&gt; described the problem: ASP.NET wasn&amp;#39;t reporting inner exception stack traces.&lt;/p&gt; &lt;p&gt;The &lt;a href="http://www.pluralsight.com/community/blogs/keith/archive/2008/08/01/better-exception-reporting-in-asp-net.aspx" target="_blank"&gt;second post&lt;/a&gt; described my solution.&lt;/p&gt; &lt;p&gt;This post shows the code I used to solve the problem: a custom email provider for the Health Monitoring system in ASP.NET. Enjoy!&lt;/p&gt; &lt;p&gt;Here&amp;#39;s the provider. Note that I opted *not* to build a buffering provider to keep things simple:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; MyMailWebEventProvider : WebEventProvider
{
    &lt;span class="kwrd"&gt;string&lt;/span&gt; to;
    &lt;span class="kwrd"&gt;string&lt;/span&gt; from;
    &lt;span class="kwrd"&gt;string&lt;/span&gt; subjectPrefix;

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Initialize(&lt;span class="kwrd"&gt;string&lt;/span&gt; name,
        NameValueCollection config)
    {
        &lt;span class="kwrd"&gt;base&lt;/span&gt;.Initialize(name, config);

        to = GetAndRemoveStringAttribute(config, &lt;span class="str"&gt;&amp;quot;to&amp;quot;&lt;/span&gt;, &lt;span class="kwrd"&gt;true&lt;/span&gt;);
        from = GetAndRemoveStringAttribute(config, &lt;span class="str"&gt;&amp;quot;from&amp;quot;&lt;/span&gt;, &lt;span class="kwrd"&gt;true&lt;/span&gt;);
        subjectPrefix = GetAndRemoveStringAttribute(config,
            &lt;span class="str"&gt;&amp;quot;subjectPrefix&amp;quot;&lt;/span&gt;, &lt;span class="kwrd"&gt;false&lt;/span&gt;);
    }
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; ProcessEvent(WebBaseEvent raisedEvent)
    {
        SendMail(raisedEvent);
    }

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; SendMail(WebBaseEvent raisedEvent)
    {
        &lt;span class="kwrd"&gt;string&lt;/span&gt; subject = ComputeEmailSubject(raisedEvent);
        &lt;span class="kwrd"&gt;string&lt;/span&gt; body = ComputeEmailBody(raisedEvent);

        MailMessage msg = &lt;span class="kwrd"&gt;new&lt;/span&gt; MailMessage(from, to, subject, body);
        &lt;span class="kwrd"&gt;new&lt;/span&gt; SmtpClient().Send(msg);
    }

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; ComputeEmailBody(WebBaseEvent raisedEvent)
    {
        WebRequestErrorEvent errorEvent =
            raisedEvent &lt;span class="kwrd"&gt;as&lt;/span&gt; WebRequestErrorEvent;
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;null&lt;/span&gt; != errorEvent)
            &lt;span class="kwrd"&gt;return&lt;/span&gt; ErrorEventFormattingHelper.FormatRequestErrorEvent(errorEvent);
        &lt;span class="kwrd"&gt;else&lt;/span&gt; &lt;span class="kwrd"&gt;return&lt;/span&gt; raisedEvent.ToString();
    }

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; ComputeEmailSubject(WebBaseEvent raisedEvent)
    {
        StringBuilder subjectBuilder = &lt;span class="kwrd"&gt;new&lt;/span&gt; StringBuilder();

        &lt;span class="rem"&gt;// surface some details in subject about error events&lt;/span&gt;
        WebBaseErrorEvent errorEvent = raisedEvent &lt;span class="kwrd"&gt;as&lt;/span&gt; WebBaseErrorEvent;
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;null&lt;/span&gt; != errorEvent)
        {
            Exception unhandledException = errorEvent.ErrorException;

            &lt;span class="rem"&gt;// drill through reflection exceptions to show the root cause&lt;/span&gt;
            TargetInvocationException invocationException =
                unhandledException &lt;span class="kwrd"&gt;as&lt;/span&gt; TargetInvocationException;
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;null&lt;/span&gt; != invocationException)
            {
                Exception innerException =
                    DrillIntoTargetInvocationException(invocationException);
                subjectBuilder.AppendFormat(&lt;span class="str"&gt;&amp;quot;{0}&amp;quot;&lt;/span&gt;,
                    (innerException ?? invocationException).GetType().Name);
                &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;null&lt;/span&gt; != innerException)
                    subjectBuilder.Append(&lt;span class="str"&gt;&amp;quot; (via reflection)&amp;quot;&lt;/span&gt;);
            }
            &lt;span class="kwrd"&gt;else&lt;/span&gt; subjectBuilder.Append(unhandledException.GetType().Name);
        }

        &lt;span class="rem"&gt;// if we&amp;#39;ve not got anything better&lt;/span&gt;
        &lt;span class="rem"&gt;// just show the event type in the subject&lt;/span&gt;
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (0 == subjectBuilder.Length)
            subjectBuilder.AppendFormat(&lt;span class="str"&gt;&amp;quot;Event type: {0}&amp;quot;&lt;/span&gt;,
                raisedEvent.GetType().Name);

        &lt;span class="kwrd"&gt;if&lt;/span&gt; (!&lt;span class="kwrd"&gt;string&lt;/span&gt;.IsNullOrEmpty(subjectPrefix)) {
            subjectBuilder.Insert(0, &lt;span class="str"&gt;&amp;#39; &amp;#39;&lt;/span&gt;);
            subjectBuilder.Insert(0, subjectPrefix);
        }
        &lt;span class="kwrd"&gt;return&lt;/span&gt; subjectBuilder.ToString();
    }

    &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="rem"&gt;/// Reflection often hides exception details, so we try to drill down&lt;/span&gt;
    &lt;span class="rem"&gt;/// through the plumbing exceptions to find a likely cause&lt;/span&gt;
    &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;private&lt;/span&gt; Exception DrillIntoTargetInvocationException(
        TargetInvocationException outerException)
    {
        Exception innerException = outerException.InnerException;
        TargetInvocationException innerInvocationException =
            innerException &lt;span class="kwrd"&gt;as&lt;/span&gt; TargetInvocationException;
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;null&lt;/span&gt; != innerInvocationException)
            &lt;span class="kwrd"&gt;return&lt;/span&gt; DrillIntoTargetInvocationException(innerInvocationException);
        &lt;span class="kwrd"&gt;else&lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;null&lt;/span&gt; != innerException)
            &lt;span class="kwrd"&gt;return&lt;/span&gt; innerException;
        &lt;span class="kwrd"&gt;else&lt;/span&gt; &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;null&lt;/span&gt;;
    }

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; GetAndRemoveStringAttribute(NameValueCollection config,
        &lt;span class="kwrd"&gt;string&lt;/span&gt; attributeName, &lt;span class="kwrd"&gt;bool&lt;/span&gt; required)
    {
        &lt;span class="kwrd"&gt;string&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt; = config.Get(attributeName);
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (required &amp;amp;&amp;amp; &lt;span class="kwrd"&gt;string&lt;/span&gt;.IsNullOrEmpty(&lt;span class="kwrd"&gt;value&lt;/span&gt;))
            &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; ConfigurationErrorsException(&lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(
                &lt;span class="str"&gt;&amp;quot;Expected attribute {0}, which is missing or empty.&amp;quot;&lt;/span&gt;,
                attributeName));
        config.Remove(attributeName);
        &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;;
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Flush()
    {
        &lt;span class="rem"&gt;// nothing to do - this is not a buffering provider&lt;/span&gt;
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Shutdown()
    {
        &lt;span class="rem"&gt;// nothing to do here either&lt;/span&gt;
    }
}&lt;/pre&gt;
&lt;p&gt;Here&amp;#39;s a helper class that formats the error messages the way I want to see them. Note that I&amp;#39;ve omitted some fields that I personally didn&amp;#39;t care about, and I&amp;#39;ve reordered things a bit, so you might want to tweak this if you&amp;#39;re going to use it in your own system.&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;internal&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; ErrorEventFormattingHelper
{
    &lt;span class="kwrd"&gt;internal&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; FormatRequestErrorEvent(
        WebRequestErrorEvent errorEvent)
    {
        CustomEventFormatter formatter = 
            &lt;span class="kwrd"&gt;new&lt;/span&gt; CustomEventFormatter();

        formatter.AppendLine(&lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(
            &lt;span class="str"&gt;&amp;quot;Unhandled Exception in {0}:&amp;quot;&lt;/span&gt;,
            WebBaseEvent.ApplicationInformation
            .ApplicationVirtualPath));
        formatter.Indent();
        EmitExceptionAtAGlance(formatter, 
            errorEvent.ErrorException);
        formatter.RevertIndent();

        formatter.AppendLine();
        formatter.AppendLine(&lt;span class="str"&gt;&amp;quot;Exception stack trace(s):&amp;quot;&lt;/span&gt;);
        EmitExceptionStackTrace(formatter, 
            errorEvent.ErrorException);

        formatter.AppendLine();
        formatter.AppendLine(&lt;span class="str"&gt;&amp;quot;Event information:&amp;quot;&lt;/span&gt;);
        formatter.Indent();
        EmitEventInfo(formatter, errorEvent);
        formatter.RevertIndent();

        formatter.AppendLine();
        formatter.AppendLine(&lt;span class="str"&gt;&amp;quot;Application information:&amp;quot;&lt;/span&gt;);
        formatter.Indent();
        EmitApplicationInfo(formatter, 
            WebBaseEvent.ApplicationInformation);
        formatter.RevertIndent();

        formatter.AppendLine();
        formatter.AppendLine(&lt;span class="str"&gt;&amp;quot;Process/thread information:&amp;quot;&lt;/span&gt;);
        formatter.Indent();
        EmitProcessInfo(formatter, 
            errorEvent.ProcessInformation);
        formatter.RevertIndent();

        formatter.AppendLine();
        formatter.AppendLine(&lt;span class="str"&gt;&amp;quot;Request information:&amp;quot;&lt;/span&gt;);
        formatter.Indent();
        EmitRequestInfo(formatter, 
            errorEvent.RequestInformation);
        formatter.RevertIndent();

        &lt;span class="kwrd"&gt;return&lt;/span&gt; formatter.ToString();
    }

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; EmitEventInfo(
        CustomEventFormatter formatter,
        WebBaseEvent theEvent)
    {
        formatter.AppendLine(&lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(
            &lt;span class="str"&gt;&amp;quot;Event code: {0}&amp;quot;&lt;/span&gt;,
            theEvent.EventCode.ToString(
            CultureInfo.InvariantCulture)));
        formatter.AppendLine(&lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(
            &lt;span class="str"&gt;&amp;quot;Event message: {0}&amp;quot;&lt;/span&gt;, 
            theEvent.Message));
        formatter.AppendLine(&lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(
            &lt;span class="str"&gt;&amp;quot;Event time: {0}&amp;quot;&lt;/span&gt;, 
            theEvent.EventTime.ToString(
            CultureInfo.InvariantCulture)));
        formatter.AppendLine(&lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(
            &lt;span class="str"&gt;&amp;quot;Event ID: {0}&amp;quot;&lt;/span&gt;, 
            theEvent.EventID.ToString(&lt;span class="str"&gt;&amp;quot;N&amp;quot;&lt;/span&gt;, 
            CultureInfo.InvariantCulture)));
    }

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; EmitApplicationInfo(
        CustomEventFormatter formatter, 
        WebApplicationInformation appInfo)
    {
        formatter.AppendLine(&lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(
            &lt;span class="str"&gt;&amp;quot;Application domain: {0}&amp;quot;&lt;/span&gt;, 
            appInfo.ApplicationDomain));
        formatter.AppendLine(&lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(
            &lt;span class="str"&gt;&amp;quot;Application Virtual Path: {0}&amp;quot;&lt;/span&gt;, 
            appInfo.ApplicationVirtualPath));
        formatter.AppendLine(&lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(
            &lt;span class="str"&gt;&amp;quot;Application Physical Path: {0}&amp;quot;&lt;/span&gt;, 
            appInfo.ApplicationPath));
    }

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; EmitProcessInfo(
        CustomEventFormatter formatter, 
        WebProcessInformation webProcessInfo)
    {
        formatter.AppendLine(&lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(
            &lt;span class="str"&gt;&amp;quot;Process ID: {0}&amp;quot;&lt;/span&gt;, 
            webProcessInfo.ProcessID.ToString(
            CultureInfo.InvariantCulture)));
        formatter.AppendLine(&lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(
            &lt;span class="str"&gt;&amp;quot;Process name: {0}&amp;quot;&lt;/span&gt;, 
            webProcessInfo.ProcessName));
        formatter.AppendLine(&lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(
            &lt;span class="str"&gt;&amp;quot;Account name: {0}&amp;quot;&lt;/span&gt;, 
            webProcessInfo.AccountName));
    }

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; EmitRequestInfo(
        CustomEventFormatter formatter, 
        WebRequestInformation webRequestInfo)
    {
        &lt;span class="kwrd"&gt;string&lt;/span&gt; name = &lt;span class="kwrd"&gt;null&lt;/span&gt;;
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (webRequestInfo.Principal != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
            name = webRequestInfo.Principal.Identity.Name;

        formatter.AppendLine(&lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(
            &lt;span class="str"&gt;&amp;quot;Request URL: {0}&amp;quot;&lt;/span&gt;, 
            webRequestInfo.RequestUrl));
        formatter.AppendLine(&lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(
            &lt;span class="str"&gt;&amp;quot;Request path: {0}&amp;quot;&lt;/span&gt;, 
            webRequestInfo.RequestPath));
        formatter.AppendLine(&lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(
            &lt;span class="str"&gt;&amp;quot;User name: {0}&amp;quot;&lt;/span&gt;, 
            name ?? &lt;span class="str"&gt;&amp;quot;[ANONYMOUS]&amp;quot;&lt;/span&gt;));
        formatter.AppendLine(&lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(
            &lt;span class="str"&gt;&amp;quot;User host address: {0}&amp;quot;&lt;/span&gt;, 
            webRequestInfo.UserHostAddress));
    }

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; EmitExceptionAtAGlance(
        CustomEventFormatter formatter, 
        Exception exception)
    {
        formatter.AppendLine(&lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(
            &lt;span class="str"&gt;&amp;quot;Type: {0}&amp;quot;&lt;/span&gt;, 
            exception.GetType().Name));
        formatter.AppendLine(&lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(
            &lt;span class="str"&gt;&amp;quot;Message: {0}&amp;quot;&lt;/span&gt;, 
            exception.Message));
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;null&lt;/span&gt; != exception.InnerException)
        {
            formatter.Indent();
            formatter.AppendLine(&lt;span class="str"&gt;&amp;quot;--&amp;gt;Inner Exception&amp;quot;&lt;/span&gt;);
            EmitExceptionAtAGlance(formatter, 
                exception.InnerException);
            formatter.RevertIndent();
        }
    }

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; EmitExceptionStackTrace(
        CustomEventFormatter formatter, Exception exception)
    {
        formatter.AppendLine(exception.StackTrace);

        &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;null&lt;/span&gt; != exception.InnerException)
        {
            &lt;span class="rem"&gt;// no point indenting&lt;/span&gt;
            &lt;span class="rem"&gt;// since stack traces typically wrap like crazy&lt;/span&gt;
            formatter.AppendLine();
            formatter.AppendLine(&lt;span class="str"&gt;&amp;quot;--&amp;gt;Inner exception stack trace:&amp;quot;&lt;/span&gt;);
            EmitExceptionStackTrace(formatter, exception.InnerException);
        }
    }
}
&lt;/pre&gt;
&lt;p&gt;And finally, here&amp;#39;s a helper class that manages indentation levels for the output email message:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; CustomEventFormatter
{
    &lt;span class="kwrd"&gt;const&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; TabSpaces = 4;

    StringBuilder sb = &lt;span class="kwrd"&gt;new&lt;/span&gt; StringBuilder();
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; indentLevel;
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; startingNewLine = &lt;span class="kwrd"&gt;true&lt;/span&gt;;

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Indent()
    {
        ++indentLevel;
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; RevertIndent()
    {
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (indentLevel &amp;gt; 0)
            --indentLevel;
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Append(&lt;span class="kwrd"&gt;string&lt;/span&gt; text)
    {
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (startingNewLine)
            EmitIndent();
        sb.Append(text);
        startingNewLine = &lt;span class="kwrd"&gt;false&lt;/span&gt;;
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; AppendLine(&lt;span class="kwrd"&gt;string&lt;/span&gt; lineOfText)
    {
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (startingNewLine)
            EmitIndent();
        EmitIndent();
        sb.AppendLine(lineOfText);
        startingNewLine = &lt;span class="kwrd"&gt;true&lt;/span&gt;;
    }

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; EmitIndent()
    {
        sb.Append(&lt;span class="str"&gt;&amp;#39; &amp;#39;&lt;/span&gt;, TabSpaces * indentLevel);
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; AppendLine()
    {
        AppendLine(&lt;span class="kwrd"&gt;string&lt;/span&gt;.Empty);
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; ToString()
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; sb.ToString();
    }
}
&lt;/pre&gt;
&lt;p&gt;Build this into a library application and reference it in your config file. Here&amp;#39;s an example:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;healthMonitoring&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;providers&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;add&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;mailWebEventProvider&amp;quot;&lt;/span&gt;
         &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;MyMailWebEventProvider&amp;quot;&lt;/span&gt;
         &lt;span class="attr"&gt;to&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;web-fault@fabrikam.com&amp;quot;&lt;/span&gt;
         &lt;span class="attr"&gt;from&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;website@fabrikam.com&amp;quot;&lt;/span&gt;
         &lt;span class="attr"&gt;buffer&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt;
         &lt;span class="attr"&gt;subjectPrefix&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;[WEB-ERROR]&amp;quot;&lt;/span&gt;
       &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;providers&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;rules&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;add&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;All Errors Email&amp;quot;&lt;/span&gt;
         &lt;span class="attr"&gt;eventName&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;All Errors&amp;quot;&lt;/span&gt;
         &lt;span class="attr"&gt;provider&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;mailWebEventProvider&amp;quot;&lt;/span&gt;
         &lt;span class="attr"&gt;profile&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Default&amp;quot;&lt;/span&gt;
         &lt;span class="attr"&gt;minInstances&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;1&amp;quot;&lt;/span&gt;
         &lt;span class="attr"&gt;maxLimit&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Infinite&amp;quot;&lt;/span&gt;
         &lt;span class="attr"&gt;minInterval&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;00:01:00&amp;quot;&lt;/span&gt;
         &lt;span class="attr"&gt;custom&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;rules&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;healthMonitoring&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52349" width="1" height="1"&gt;</description><category domain="http://www.pluralsight.com/community/blogs/keith/archive/tags/Geek+talk/default.aspx">Geek talk</category><category domain="http://www.pluralsight.com/community/blogs/keith/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>In Toronto for Agile 2008</title><link>http://www.pluralsight.com/community/blogs/starr/archive/2008/08/03/in_2D00_toronto_2D00_for_2D00_agile_2D00_2008.aspx</link><pubDate>Mon, 04 Aug 2008 02:13:06 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52345</guid><dc:creator>david-starr</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I drove from Boise to Seattle yesterday to drop off my 4 kids at the grandparents house, then I got up at 4 this morning to catch a plane. Now, I am in Toronto and am really impressed! This place is cool!&lt;a href="http://www.pluralsight.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/starr/img019_5F00_2.jpg"&gt;&lt;img title="img019" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="245" alt="img019" src="http://www.pluralsight.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/starr/img019_5F00_thumb.jpg" width="320" align="right" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;There was a street festival in full swing when my friend Ken and I went walking and looking for dinner. Check this picture out: Real break dancers. Seriously, it’s like 1986! Awesome.&lt;/p&gt;  &lt;p&gt;I gotta hand it to my buddy. He passed up a limo ride with &lt;a href="http://www.poppendieck.com/" target="_blank"&gt;Mary Poppendieck&lt;/a&gt; to come ride to the hotel with me. Now, that’s a real friend :)!&lt;/p&gt;  &lt;p&gt;I will be up late tonight polishing my presentation for Thursday, &lt;a title="TDD Clinic- .Net and C#" href="http://submissions.agile2008.org/node/243"&gt;TDD Clinic- .Net and C#&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;If you are at the conference this week, watch for me and please say hello. I’d love to meet you!&lt;/p&gt;  &lt;p&gt;As always, watch the blog for my session notes as I experience the conference.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52345" width="1" height="1"&gt;</description></item><item><title>Twisted Coronas</title><link>http://www.pluralsight.com/community/blogs/keith/archive/2008/08/02/twisted-coronas.aspx</link><pubDate>Sat, 02 Aug 2008 17:33:51 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52330</guid><dc:creator>keith-brown</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Okay it&amp;#39;s Saturday, so let me share something completely nontechnical and fun.&lt;/p&gt; &lt;p&gt;What you need to make these cocktails:&lt;/p&gt; &lt;blockquote&gt;Six pack of &lt;a href="http://www.corona.com/" target="_blank"&gt;Corona Extra&lt;/a&gt;&lt;br /&gt;Bottle of &lt;a href="http://www.bacardi.com/us/en-us/products/additionalproducts/bacardilim%C3%B3n?accessibility=true&amp;amp;marketlanguageid=2" target="_blank"&gt;Bacardi Limon&lt;/a&gt;&lt;br /&gt;Lime&lt;br /&gt;Coctail stirrer (a chopstick works fine)&lt;/blockquote&gt; &lt;p&gt;Pop a slice of lime into a Corona and hand to a friend. Have them drink the neck, then refill with Bacardi Limon (putting the lime in first seems to reduce fizzing). Stir and hand back to them so they can drink it down as it fizzes up a bit.&lt;/p&gt; &lt;p&gt;Mixing rum and beer may sound nasty, but this actually results in a very smooth, tasty drink. It&amp;#39;s our favorite accompaniment when we are playing &lt;a href="http://www.xbox.com/en-us/games/r/rockband/" target="_blank"&gt;Rock Band&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;We took this recipe and applied it to one of our other favorite beers as well: &lt;a href="http://www.epinions.com/content_369863855748" target="_blank"&gt;Honey Moon Summer Ale&lt;/a&gt; (also works with &lt;a href="http://en.wikipedia.org/wiki/Blue_Moon_(beer)" target="_blank"&gt;Blue Moon&lt;/a&gt;, or any other typically orange-flavored beer). Just use &lt;a href="http://www.bacardi.com/us/en-us/products/additionalproducts/bacardio?accessibility=true&amp;amp;marketlanguageid=2" target="_blank"&gt;Barcardi O&lt;/a&gt; instead of Limon.&lt;/p&gt; &lt;p&gt;Enjoy!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52330" width="1" height="1"&gt;</description><category domain="http://www.pluralsight.com/community/blogs/keith/archive/tags/42/default.aspx">42</category></item><item><title>Comments</title><link>http://www.pluralsight.com/community/blogs/keith/archive/2008/08/01/comments.aspx</link><pubDate>Fri, 01 Aug 2008 21:38:00 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52316</guid><dc:creator>keith-brown</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;We recently switched our blog engine out, and I&amp;#39;m still getting the hang of the new system. Looks like due to a misconfiguration, several comments have been waiting for moderation for days or weeks. If yours was one of them, please accept my apology - I didn&amp;#39;t have email notifications turned on, so I wasn&amp;#39;t being notified that comments were coming in.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve since fixed the problem, so your comments should show up sooner. Sorry for any confusion!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52316" width="1" height="1"&gt;</description><category domain="http://www.pluralsight.com/community/blogs/keith/archive/tags/Geek+talk/default.aspx">Geek talk</category></item><item><title>Better exception reporting in ASP.NET</title><link>http://www.pluralsight.com/community/blogs/keith/archive/2008/08/01/better-exception-reporting-in-asp-net.aspx</link><pubDate>Fri, 01 Aug 2008 21:30:00 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52314</guid><dc:creator>keith-brown</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;In &lt;a href="http://www.pluralsight.com/community/blogs/keith/archive/2008/08/01/asp-net-health-monitoring-doesn-t-log-inner-exception-stack-trace.aspx" target="_blank"&gt;my last post&lt;/a&gt;, I commented on how ASP.NET health monitoring doesn&amp;#39;t output stack traces for inner exceptions, which can be problematic due to its heavy reliance on reflection. I spent the morning doing some further spelunking with &lt;a href="http://www.aisto.com/roeder/dotnet/" target="_blank"&gt;reflector&lt;/a&gt;, and my first solution was to implement a custom WebEvent that overrides ToString() to format itself with all of the data I care about. I then overrode the Error event via global.asax and raised my custom event, instead of letting ASP.NET raise its default event. This worked reasonably well with the SimpleMailWebEventProvider, but didn&amp;#39;t seem to change anything at all with the event log provider.&lt;/p&gt;
&lt;p&gt;What I found is that the two providers were using entirely different means to format the events! The email provider calls ToString(bool, bool) on the event to ask it to format itself. But the EventLogWebEventProvider does its own formatting of individual fields of the event. Indeed, its ProcessEvent method has a big list of checks:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; (eventRaised &lt;span class="kwrd"&gt;is&lt;/span&gt; WebBaseErrorEvent)&lt;br /&gt;    AddErrorStuff();&lt;br /&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; (eventRaised &lt;span class="kwrd"&gt;is&lt;/span&gt; WebAuthenticationSuccessAuditEvent)&lt;br /&gt;    AddLogonStuff();&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;So it seemed like a better approach would be to write my own provider. I left the event log provider alone, and I wrote a custom email provider to display errors in a more useful way. This also allowed me to drop some fields from the event report that aren&amp;#39;t useful for us. And I was able to construct a much more concise and useful subject line (the subject line that SimpleMailWebEventProvider uses is rather clunky since it assumes it might be spitting out a whole bunch of buffered events in one go).&lt;/p&gt;
&lt;p&gt;Not only does my provider include the stack traces for all of the exceptions in the chain, but in the subject line, I display the type of error that is at the root of the problem. So if I am formatting a TargetInvocationException, I drill into its InnerException chain until I find a different exception type, and display that exception type instead.&lt;/p&gt;
&lt;p&gt;Oh, one other benefit of building the custom provider instead of using a custom WebEvent was that I was then able to remove the Error handler from global.asax. All I had to do was replace the SimpleMailWebEventProvider with my own provider, and I got the behavior I wanted. Now my email notifications include detailed stack traces.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll post the code for this provider once it&amp;#39;s run for a little while in production and I&amp;#39;m satisfied that it works reasonably well.&lt;/p&gt;
&lt;p&gt;UPDATE: I included the code in my &lt;a href="http://www.pluralsight.com/community/blogs/keith/archive/2008/08/04/better-exception-reporting-in-asp-net-part-2.aspx"&gt;third post&lt;/a&gt; in this series.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52314" width="1" height="1"&gt;</description><category domain="http://www.pluralsight.com/community/blogs/keith/archive/tags/Geek+talk/default.aspx">Geek talk</category><category domain="http://www.pluralsight.com/community/blogs/keith/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>PDC 2008</title><link>http://www.pluralsight.com/community/blogs/mgudgin/archive/2008/08/02/pdc-2008.aspx</link><pubDate>Fri, 01 Aug 2008 18:38:00 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52310</guid><dc:creator>martin-gudgin</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&amp;nbsp;I&amp;#39;ve been in the U.S. nearly two years now, working away on various things with the &lt;a href="http://www.pluralsight.com/community/blogs/jeffsch/default.aspx"&gt;rest&lt;/a&gt; of the &lt;a href="http://www.pluralsight.com/community/blogs/dbox/default.aspx"&gt;folks&lt;/a&gt; on my &lt;a href="http://www.sellsbrothers.com/"&gt;team&lt;/a&gt;. Soon I&amp;#39;ll be able to talk about what I&amp;#39;ve been working on in public; &lt;a href="http://www.sellsbrothers.com/"&gt;Chris Sells&lt;/a&gt; and I will be delivering a talk at &lt;a href="http://microsoftpdc.com/Default.aspx"&gt;PDC 2008&lt;/a&gt;, currently entitled &lt;a href="http://channel9.msdn.com/pdc2008/TL%2028/"&gt;&amp;quot;Oslo&amp;quot;: Repository and Schemas&lt;/a&gt;, catchy, huh?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52310" width="1" height="1"&gt;</description><category domain="http://www.pluralsight.com/community/blogs/mgudgin/archive/tags/Oslo+PDC+Work/default.aspx">Oslo PDC Work</category></item><item><title>ASP.NET Health Monitoring doesn't log inner exception stack trace</title><link>http://www.pluralsight.com/community/blogs/keith/archive/2008/08/01/asp-net-health-monitoring-doesn-t-log-inner-exception-stack-trace.aspx</link><pubDate>Fri, 01 Aug 2008 17:21:00 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52306</guid><dc:creator>keith-brown</dc:creator><slash:comments>3</slash:comments><description>&lt;p&gt;This can be a problem, especially when an ObjectDataSource starts throwing exceptions. The stack trace looks the same because of the way the methods are invoked (via reflection) - you end up with a stack trace for a TargetInvocationException, which basically says, &amp;quot;I used reflection to invoke some method, and it threw an exception. See the inner exception for details.&amp;quot;&lt;/p&gt;
&lt;p&gt;ASP.NET&amp;#39;s health monitoring system does list the inner exceptions (apparently up to a maximum depth of two, from spelunking the code with &lt;a href="http://www.aisto.com/roeder/dotnet/"&gt;reflector&lt;/a&gt;), but it does not emit the stack traces for these exceptions, which would be &lt;i&gt;really helpful&lt;/i&gt;. I&amp;#39;ve spent some time this morning trying to figure out how I&amp;#39;d customize things to emit this, and it looks like what I&amp;#39;d have to do is catch the exception and generate a custom WebEvent that overrides ToString(bool, bool) and does everything that WebRequestErrorEvent does, but also generate the inner stack trace.&lt;/p&gt;
&lt;p&gt;That seems a bit ugly. A search for &amp;quot;ASP.NET web event inner exception stack trace&amp;quot; yielded no interesting results, so if you&amp;#39;ve dealt with this and have a cleaner solution, let me know. I&amp;#39;ll post my solution once I get it worked out.&lt;/p&gt;
&lt;p&gt;UPDATE: I ended up &lt;a href="http://www.pluralsight.com/community/blogs/keith/archive/2008/08/01/better-exception-reporting-in-asp-net.aspx"&gt;writing a custom email provider&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52306" width="1" height="1"&gt;</description><category domain="http://www.pluralsight.com/community/blogs/keith/archive/tags/Geek+talk/default.aspx">Geek talk</category><category domain="http://www.pluralsight.com/community/blogs/keith/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>Simulating Email in .NET</title><link>http://www.pluralsight.com/community/blogs/keith/archive/2008/08/01/simulating-email-in-net.aspx</link><pubDate>Fri, 01 Aug 2008 16:59:00 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52305</guid><dc:creator>keith-brown</dc:creator><slash:comments>4</slash:comments><description>&lt;p&gt;I use email as a notification mechanism a lot, and often in class I&amp;#39;ll demo sending email via a technique that I use frequently when developing code. It allows you to simulate sending an email message.&lt;/p&gt;
&lt;p&gt;The trick to doing this is not to hardcode things like host, port, etc. for your SMTP server when you use System.Net.Mail to send mail. Instead, use the default ctor for &lt;a href="http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx" target="_blank"&gt;SmtpClient&lt;/a&gt; as I&amp;#39;ve done in the code below.&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Main(&lt;span class="kwrd"&gt;string&lt;/span&gt;[] args)&lt;br /&gt;{&lt;br /&gt;    &lt;span class="rem"&gt;// note the use of the MailAddress class&lt;/span&gt;&lt;br /&gt;    &lt;span class="rem"&gt;// this allows me to specify display names as well as email addresses&lt;/span&gt;&lt;br /&gt;    MailAddress from = &lt;span class="kwrd"&gt;new&lt;/span&gt; MailAddress(&lt;span class="str"&gt;&amp;quot;admin@fabrikam.com&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;Fabrikam Website&amp;quot;&lt;/span&gt;);&lt;br /&gt;    MailAddress to = &lt;span class="kwrd"&gt;new&lt;/span&gt; MailAddress(&lt;span class="str"&gt;&amp;quot;mari@fabrikam.com&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;Mari Joyce&amp;quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;    MailMessage msg = &lt;span class="kwrd"&gt;new&lt;/span&gt; MailMessage(from, to);&lt;br /&gt;    msg.Subject  = &lt;span class="str"&gt;&amp;quot;Testing 123&amp;quot;&lt;/span&gt;;&lt;br /&gt;    msg.Body = &lt;span class="str"&gt;&amp;quot;This is only a test!&amp;quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;    &lt;span class="rem"&gt;// note use of default ctor&lt;/span&gt;&lt;br /&gt;    &lt;span class="rem"&gt;// this looks in config to figure out how to send mail&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;new&lt;/span&gt; SmtpClient().Send(msg);&lt;br /&gt;}&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;What you&amp;#39;re telling .NET by using the default ctor for SmtpClient is, &amp;quot;please use my config file to figure out how to send mail&amp;quot;. Now you can use the system.net/mailSettings/smtp section in config to specify the details of your mail server, and all of the code in your app that is written to use the default SmtpClient ctor will inherit these settings. Here&amp;#39;s an example of what the config on a production server might look like (if you put passwords in your config files, be sure to &lt;a href="http://msdn.microsoft.com/en-us/library/ms998283.aspx" target="_blank"&gt;encrypt those sections&lt;/a&gt;): &lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;configuration&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;system.net&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;mailSettings&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;smtp&lt;/span&gt; &lt;span class="attr"&gt;deliveryMethod&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Network&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;network&lt;/span&gt; &lt;span class="attr"&gt;host&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;mail.fabrikam.com&amp;quot;&lt;/span&gt;&lt;br /&gt;                 &lt;span class="attr"&gt;port&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;25&amp;quot;&lt;/span&gt;&lt;br /&gt;                 &lt;span class="attr"&gt;userName&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;WebsiteMailAccount&amp;quot;&lt;/span&gt;&lt;br /&gt;                 &lt;span class="attr"&gt;password&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;whatever&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;smtp&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;mailSettings&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;system.net&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;configuration&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;During development, I use different settings because I don&amp;#39;t usually want to deal with the hassle of installing an SMTP server on my development box. Instead, I want email messages delivered as individual files in a directory on my hard drive (I always have a c:\mail directory on my development box for just this purpose):&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;configuration&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;system.net&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;mailSettings&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;smtp&lt;/span&gt; &lt;span class="attr"&gt;deliveryMethod&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;SpecifiedPickupDirectory&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;specifiedPickupDirectory&lt;/span&gt; &lt;span class="attr"&gt;pickupDirectoryLocation&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;c:\mail&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;smtp&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;mailSettings&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;system.net&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;configuration&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;Now when I run the program above, I get a .EML file in my c:\mail directory:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.pluralsight.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/keith/image_5F00_2.png"&gt;&lt;img style="border-right:0px;border-top:0px;margin:0px 0px 0px 35px;border-left:0px;border-bottom:0px;" alt="image" src="http://www.pluralsight.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/keith/image_5F00_thumb.png" width="404" border="0" height="230" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Outlook Express is normally registered as the viewer for .EML files, so double-click the file to view it:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.pluralsight.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/keith/image_5F00_4.png"&gt;&lt;img style="border-right:0px;border-top:0px;margin:0px 0px 0px 35px;border-left:0px;border-bottom:0px;" alt="image" src="http://www.pluralsight.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/keith/image_5F00_thumb_5F00_1.png" width="292" border="0" height="287" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;If you&amp;#39;ve never seen this method of simulating email before, I hope you find it as useful as I have. Happy coding!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52305" width="1" height="1"&gt;</description><category domain="http://www.pluralsight.com/community/blogs/keith/archive/tags/Geek+talk/default.aspx">Geek talk</category></item><item><title>Controlling column width in a GridView</title><link>http://www.pluralsight.com/community/blogs/keith/archive/2008/07/30/controlling-column-width-in-a-gridview.aspx</link><pubDate>Wed, 30 Jul 2008 17:23:27 GMT</pubDate><guid isPermaLink="false">d057c89c-07b5-4bfb-b52f-d79d1e3ece89:52286</guid><dc:creator>keith-brown</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;I&amp;#39;ve been building some internal pages for our sales team here at &lt;a href="http://www.pluralsight.com/main/" target="_blank"&gt;Pluralsight&lt;/a&gt;, and many of those pages make use of the ASP.NET GridView control to display rectangular data. It&amp;#39;s generally a really easy to use control, but I&amp;#39;ve always struggled with getting column widths to look right.&lt;/p&gt;  &lt;p&gt;My goal is to fix the width of each column at design time, and any field that contains text that may be longer than my fixed width should wrap around, taking up more vertical space in the table. If you are trying to accomplish this goal, you might find these tips helpful.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;1) Set up a CssClass for the GridView itself and include the &lt;a href="http://www.w3.org/TR/REC-CSS2/tables.html#fixed-table-layout" target="_blank"&gt;table-layout:fixed&lt;/a&gt; style. This tells the browser that you&amp;#39;re going to specify the width of each cell. You may also want to include the overall width of the grid here as I mention in (3).&lt;/p&gt;    &lt;p&gt;2) The first row of the table sets the width for each cell, and that&amp;#39;s usually the HEADER row, not the item row, so use either HeaderStyle-CssClass or HeaderStyle-Width to set the width of the cell. I wasted a lot of time trying to set the width using the ItemStyle.&lt;/p&gt;    &lt;p&gt;3) Make certain the table itself is wide enough to hold all of the cells. I added up all of my cell widths and used that to set the width via the CssClass attribute on the GridView.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Using these guidelines, I&amp;#39;m having much better luck controlling the layout of my GridView controls. I hope this simple advise helps someone else!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=52286" width="1" height="1"&gt;</description><category domain="http://www.pluralsight.com/community/blogs/keith/archive/tags/Geek+talk/default.aspx">Geek talk</category><category domain="http://www.pluralsight.com/community/blogs/keith/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item></channel></rss>