<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>LichtenBytes</title>
	<atom:link href="http://mlichtenberg.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mlichtenberg.wordpress.com</link>
	<description>Mike Lichtenberg&#039;s Weblog</description>
	<lastBuildDate>Tue, 14 Feb 2012 04:54:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mlichtenberg.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>LichtenBytes</title>
		<link>http://mlichtenberg.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mlichtenberg.wordpress.com/osd.xml" title="LichtenBytes" />
	<atom:link rel='hub' href='http://mlichtenberg.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Determine the Space Used by Each Table in a SQL Server Database</title>
		<link>http://mlichtenberg.wordpress.com/2012/02/13/determine-the-space-used-by-each-table-in-a-sql-server-database/</link>
		<comments>http://mlichtenberg.wordpress.com/2012/02/13/determine-the-space-used-by-each-table-in-a-sql-server-database/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 04:54:44 +0000</pubDate>
		<dc:creator>mlichtenberg</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">https://mlichtenberg.wordpress.com/?p=119</guid>
		<description><![CDATA[The following script will work on SQL Server 2005 and 2008 (and 2012?).&#160; Use it to determine a number of metrics about each table in a database, including number of rows, data size, index size, unused space, and total space reserved for the table. SET NOCOUNT ON DECLARE @table_name VARCHAR(500) DECLARE @SpaceUsed TABLE (&#160;&#160;&#160;&#160; &#160;&#160;&#160; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mlichtenberg.wordpress.com&amp;blog=15354164&amp;post=119&amp;subd=mlichtenberg&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following script will work on SQL Server 2005 and 2008 (and 2012?).&#160; Use it to determine a number of metrics about each table in a database, including number of rows, data size, index size, unused space, and total space reserved for the table.</p>
<div style="border-bottom:black 1px solid;border-left:black 1px solid;font-family:courier;border-top:black 1px solid;border-right:black 1px solid;padding:3px;">
<p>SET NOCOUNT ON </p>
<p>DECLARE @table_name VARCHAR(500) </p>
<p>DECLARE @SpaceUsed TABLE (&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160; tablename sysname,       <br />&#160;&#160;&#160; row_count INT,       <br />&#160;&#160;&#160; reserved VARCHAR(50),       <br />&#160;&#160;&#160; data VARCHAR(50),       <br />&#160;&#160;&#160; index_size VARCHAR(50),       <br />&#160;&#160;&#160; unused VARCHAR(50)       <br />) </p>
<p>DECLARE curTables CURSOR FOR&#160; <br />SELECT s.name + &#8216;.&#8217; + t.name&#160;&#160; <br />FROM sys.tables t&#160; INNER JOIN sys.schemas s       <br />&#160;&#160;&#160; ON t.schema_id = s.schema_id </p>
<p>OPEN curTables      <br />FETCH NEXT FROM curTables INTO @table_name       <br />WHILE @@FETCH_STATUS = 0&#160; <br />BEGIN&#160;&#160; <br />&#160;&#160;&#160; SET @table_name = REPLACE(REPLACE(@table_name, &#8216;[',''), ']&#8216;, &#8221;) </p>
<p>&#160;&#160;&#160; &#8212; make sure the object exists before calling sp_spacedused      <br />&#160;&#160;&#160; IF EXISTS(SELECT OBJECT_ID FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(@table_name))       <br />&#160;&#160;&#160; BEGIN       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; INSERT INTO @SpaceUsed EXEC sp_spaceused @table_name, false       <br />&#160;&#160;&#160; END       <br />&#160;&#160;&#160; FETCH NEXT FROM curTables INTO @table_name       <br />END       <br />CLOSE curTables       <br />DEALLOCATE curTables </p>
<p>&#8211; Compute the total size of each table and add the schemaname to the result set      <br />SELECT&#160;&#160;&#160; s.name as schemaname,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; su.tablename,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; su.row_count,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; su.data,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; su.index_size,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; su.unused,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; CONVERT(decimal, CONVERT(bigint, REPLACE(su.data, &#8216; KB&#8217;, &#8221;)) +       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; CONVERT(bigint, REPLACE(su.index_size, &#8216; KB&#8217;, &#8221;)) +       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; CONVERT(bigint, REPLACE(su.unused, &#8216; KB&#8217;, &#8221;))) / 1000 AS [total (MB)]       <br />FROM&#160;&#160;&#160; @SpaceUsed su INNER JOIN sys.tables t       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ON t.name = su.tablename       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; INNER JOIN sys.schemas s       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ON t.schema_id = s.schema_id       <br />ORDER BY&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; [total (MB)] DESC,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; schemaname,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; tablename</p>
</p></div>
<p>&#160;</p>
<p>Here is an example of the output you can expect from this script:</p>
<div style="border-bottom:black 1px solid;border-left:black 1px solid;font-family:courier;border-top:black 1px solid;border-right:black 1px solid;padding:3px;">
<p>schemaname tablename&#160;&#160;&#160;&#160; row_count&#160;&#160; data&#160;&#160;&#160;&#160;&#160; index_size unused&#160;&#160; total (MB)      <br />&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212; &#8212;&#8212;&#8212;- &#8212;&#8212;&#8211; &#8212;&#8212;&#8212;-       <br />dbo&#160;&#160;&#160;&#160;&#160;&#160;&#160; Page&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 116213&#160;&#160;&#160;&#160;&#160; 71864 KB&#160; 66304 KB&#160;&#160; 344 KB&#160;&#160; 138.512000       <br />dbo&#160;&#160;&#160;&#160;&#160;&#160;&#160; PageName&#160;&#160;&#160;&#160;&#160; 164508&#160;&#160;&#160;&#160;&#160; 17040 KB&#160; 37520 KB&#160;&#160; 336 KB&#160;&#160; 54.896000       <br />dbo&#160;&#160;&#160;&#160;&#160;&#160;&#160; IndicatedPage 103127&#160;&#160;&#160;&#160;&#160; 6208 KB&#160;&#160; 32 KB&#160;&#160;&#160;&#160;&#160; 40 KB&#160;&#160;&#160; 6.280000       <br />dbo&#160;&#160;&#160;&#160;&#160;&#160;&#160; Page_PageType 115770&#160;&#160;&#160;&#160;&#160; 4840 KB&#160;&#160; 32 KB&#160;&#160;&#160;&#160;&#160; 0 KB&#160;&#160;&#160;&#160; 4.872000       <br />dbo&#160;&#160;&#160;&#160;&#160;&#160;&#160; Item&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 254&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 136 KB&#160;&#160;&#160; 144 KB&#160;&#160;&#160;&#160; 48 KB&#160;&#160;&#160; 0.328000       <br />dbo&#160;&#160;&#160;&#160;&#160;&#160;&#160; Title&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 77&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 64 KB&#160;&#160;&#160;&#160; 224 KB&#160;&#160;&#160;&#160; 0 KB&#160;&#160;&#160;&#160; 0.288000</p>
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mlichtenberg.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mlichtenberg.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mlichtenberg.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mlichtenberg.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mlichtenberg.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mlichtenberg.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mlichtenberg.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mlichtenberg.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mlichtenberg.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mlichtenberg.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mlichtenberg.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mlichtenberg.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mlichtenberg.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mlichtenberg.wordpress.com/119/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mlichtenberg.wordpress.com&amp;blog=15354164&amp;post=119&amp;subd=mlichtenberg&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mlichtenberg.wordpress.com/2012/02/13/determine-the-space-used-by-each-table-in-a-sql-server-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/669522dbf2066167f81a1c3b7bd67d7a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mlichtenberg</media:title>
		</media:content>
	</item>
		<item>
		<title>Encoding XML in UTF-8 with .NET</title>
		<link>http://mlichtenberg.wordpress.com/2011/12/30/encoding-xml-in-utf-8-with-net/</link>
		<comments>http://mlichtenberg.wordpress.com/2011/12/30/encoding-xml-in-utf-8-with-net/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 16:38:12 +0000</pubDate>
		<dc:creator>mlichtenberg</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[StringWriter]]></category>
		<category><![CDATA[UTF-8]]></category>
		<category><![CDATA[XMLSerializer]]></category>

		<guid isPermaLink="false">https://mlichtenberg.wordpress.com/?p=114</guid>
		<description><![CDATA[The solution described here was inspired by the blog post found at http://rlacovara.blogspot.com/2011/02/how-to-create-xml-in-c-with-utf-8.html.&#160; It explains how to replace the default UTF-16 encoding with UTF-8.&#160; I have implemented a variation of this.&#160; In addition, a more generic solution is available at http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_20554526.html. This one (which I have not implemented), allows for variable encoding values for the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mlichtenberg.wordpress.com&amp;blog=15354164&amp;post=114&amp;subd=mlichtenberg&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The solution described here was inspired by the blog post found at <a href="http://rlacovara.blogspot.com/2011/02/how-to-create-xml-in-c-with-utf-8.html" target="_blank">http://rlacovara.blogspot.com/2011/02/how-to-create-xml-in-c-with-utf-8.html</a>.&#160; It explains how to replace the default UTF-16 encoding with UTF-8.&#160; I have implemented a variation of this.&#160; In addition, a more generic solution is available at <a href="http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_20554526.html." target="_blank">http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_20554526.html.</a> This one (which I have not implemented), allows for variable encoding values for the output.</p>
<p>By default, XML documents produced using C# and the .NET XMLSerializer class are encoded as UTF-16.&#160; I recently needed to change this to the more commonly-used UTF-8, and learned a few things along the way.</p>
<p>The first thing that I discovered (and perhaps should have already known) is that internally .NET stores all string representations as UTF-16.&#160; That is why, if you don’t change the default encoding, the XML is produced as UTF-16.</p>
<p>Next, I found that the Encoding property of the StringWriter class is read-only, so you can interrogate the default encoding (and see that it is in fact UTF-16) but cannot change it.&#160; </p>
<p>As I learned from the blog posts that I referenced above, the solution to changing the default UTF-16 encoding is to subclass the native .NET StringWriter class and override the default Encoding property value.</p>
<p>Following is a solution for producing a UTF-8-encoded XML document.&#160; The “StringWriterUtf8” class is the key to the solution.&#160; It inherits from the native System.IO.StringWriter class and overrides the Encoding property (returning Encoding.UTF8 instead of Encoding.UTF16).&#160; Using an instance of this class as the target for the XML serialization output produces UTF-8 output.</p>
<div style="border-bottom:black 1px solid;border-left:black 1px solid;padding-left:10px;padding-right:10px;border-top:black 1px solid;border-right:black 1px solid;">
<p>[Serializable]      <br />public class ClassToSerialize       <br />{       <br />&#160;&#160; public string ToXml()       <br />&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160; System.Xml.Serialization.XmlSerializer xml = new XmlSerializer(typeof(ClassToSerialize));       <br />&#160;&#160;&#160;&#160;&#160;&#160; StringWriterUtf8 text = new StringWriterUtf8();       <br />&#160;&#160;&#160;&#160;&#160;&#160; xml.Serialize(text, this);       <br />&#160;&#160;&#160;&#160;&#160;&#160; return text.ToString();       <br />&#160;&#160; }       </p>
<p>&#160;&#160; private String _errorMessage = String.Empty;       <br />&#160;&#160; public string Message       <br />&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160; get { return _errorMessage; }       <br />&#160;&#160;&#160;&#160;&#160;&#160; set { _errorMessage = value; }       <br />&#160;&#160; }       </p>
<p>&#160;&#160; private List&lt;string&gt; _citations = new List&lt;string&gt;();       <br />&#160;&#160; public List&lt;string&gt; citations       <br />&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160; get { return _citations; }       <br />&#160;&#160;&#160;&#160;&#160;&#160; set { _citations = value; }       <br />&#160;&#160; }       <br />}       </p>
<p>// Subclass the StringWriter class and override the default encoding.&#160; This       <br />// allows us to produce XML encoded as UTF-8.       <br />public class StringWriterUtf8 : System.IO.StringWriter       <br />{       <br />&#160;&#160; public override Encoding Encoding       <br />&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160; get       <br />&#160;&#160;&#160;&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return Encoding.UTF8;       <br />&#160;&#160;&#160;&#160;&#160;&#160; }       <br />&#160;&#160; }       <br />}       </p>
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mlichtenberg.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mlichtenberg.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mlichtenberg.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mlichtenberg.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mlichtenberg.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mlichtenberg.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mlichtenberg.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mlichtenberg.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mlichtenberg.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mlichtenberg.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mlichtenberg.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mlichtenberg.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mlichtenberg.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mlichtenberg.wordpress.com/114/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mlichtenberg.wordpress.com&amp;blog=15354164&amp;post=114&amp;subd=mlichtenberg&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mlichtenberg.wordpress.com/2011/12/30/encoding-xml-in-utf-8-with-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/669522dbf2066167f81a1c3b7bd67d7a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mlichtenberg</media:title>
		</media:content>
	</item>
		<item>
		<title>Laptop vs Tablet &#8211; First Impressions</title>
		<link>http://mlichtenberg.wordpress.com/2011/11/16/laptop-vs-tablet-first-impressions/</link>
		<comments>http://mlichtenberg.wordpress.com/2011/11/16/laptop-vs-tablet-first-impressions/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 06:11:55 +0000</pubDate>
		<dc:creator>mlichtenberg</dc:creator>
				<category><![CDATA[Consumer Technology]]></category>
		<category><![CDATA[Nook Color]]></category>
		<category><![CDATA[Tablet]]></category>

		<guid isPermaLink="false">https://mlichtenberg.wordpress.com/2011/11/16/laptop-vs-tablet-first-impressions/</guid>
		<description><![CDATA[This week I attended the Life &#38; Literature conference at the Field Museum in Chicago.&#160; The conference was sponsored by the Biodiversity Heritage Library. The target audience for this conference was scientists and librarians.&#160; I am a software developer, but am also the lead developer for BHL.&#160; As such, the attendees of the conference were [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mlichtenberg.wordpress.com&amp;blog=15354164&amp;post=113&amp;subd=mlichtenberg&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This week I attended the <a href="http://www.lifeandliterature.org/" target="_blank">Life &amp; Literature conference</a> at the <a href="http://fieldmuseum.org/" target="_blank">Field Museum</a> in Chicago.&#160; The conference was sponsored by the <a href="http://www.biodiversitylibrary.org/" target="_blank">Biodiversity Heritage Library</a>.</p>
<p>The target audience for this conference was scientists and librarians.&#160; I am a software developer, but am also the lead developer for BHL.&#160; As such, the attendees of the conference were my target users, so it made sense for me to attend and observe.</p>
<p>While attending the conference, I had two technology needs.&#160; First was a way to follow the <a href="http://twapperkeeper.com/hashtag/lifelit" target="_blank">#LifeLit</a> <a href="http://www.twitter.com" target="_blank">Twitter</a> hashtag, and second, I needed a way to take a few notes.</p>
<p>To accomplish those goals, I chose to use my <a href="http://www.barnesandnoble.com/NOOKcolor" target="_blank">Nook Color</a> instead of my laptop.&#160; If you’re not familiar with the Nook Color, it can be considered a “tablet lite”.&#160; While primarily an ebook reader, it runs a variant of the Android operating system and is capable of running apps and playing audio and video.&#160; </p>
<p>I have been skeptical that a tablet can truly be a laptop replacement, particularly for creating content.&#160; Just the same, this conference gave me a perfect opportunity to give it a try.&#160; So, with my Nook Color, I used the <a href="https://seesmic.com/" target="_blank">Seesmic</a> app to follow Twitter and the <a href="http://www.evernote.com/" target="_blank">EverNote</a> app to take notes.</p>
<p>Here I list the advantages and disadvantages of using a tablet computer.&#160; I say “tablet”, because even though my experience is with a Nook Color, I believe that these apply to all popular tablets (iPad, Nook Color, and the soon-to-come Kindle Fire).</p>
<p><strong>Tablet Advantages</strong></p>
<ul>
<li>Instant on – This provided a much better experience than waiting a few minutes for the laptop to boot.</li>
<li>Battery Life – I charged the Nook Color between day one and day two, but I didn’t have to.&#160; The laptop wouldn’t have made it through a single day. </li>
<li>Form factor – A light 7-inch tablet is much more convenient to handle than a 5.5 pound 14-inch laptop. </li>
<p>   <strong></strong></ul>
<ul><strong></strong></ul>
<ul><strong>Tablet Disadvantages</strong></ul>
<ul>
<li>Lack of Multi-tasking – I found it inconvenient to have to exit the Seesmic app whenever I wanted to take a note, and then exit the EverNote app to go back to Seesmic so I could continue following the Twitter feed.</li>
<li>On-screen Keyboard – I quickly became pretty good at typing with my thumbs on the on-screen keyboard, but I feel that if I had needed to take a lot of notes, then the laptop would have been a necessity.&#160; It’s possible that a larger tablet (like the iPad) might help with this problem, but I’m not sure. </li>
</ul>
<ul>In conclusion, I can say that the tablet worked well.&#160; I’m not convinced that it will be appropriate in all situations, but as a tablet skeptic, I can now admit that there are occasions where a tablet is useful for both consuming (in this case, the Twitter feed) and creating (my notes) content.</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mlichtenberg.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mlichtenberg.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mlichtenberg.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mlichtenberg.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mlichtenberg.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mlichtenberg.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mlichtenberg.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mlichtenberg.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mlichtenberg.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mlichtenberg.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mlichtenberg.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mlichtenberg.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mlichtenberg.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mlichtenberg.wordpress.com/113/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mlichtenberg.wordpress.com&amp;blog=15354164&amp;post=113&amp;subd=mlichtenberg&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mlichtenberg.wordpress.com/2011/11/16/laptop-vs-tablet-first-impressions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/669522dbf2066167f81a1c3b7bd67d7a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mlichtenberg</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Server Waits</title>
		<link>http://mlichtenberg.wordpress.com/2011/10/18/sql-server-waits/</link>
		<comments>http://mlichtenberg.wordpress.com/2011/10/18/sql-server-waits/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 23:09:23 +0000</pubDate>
		<dc:creator>mlichtenberg</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[dm_os_wait_stats]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">https://mlichtenberg.wordpress.com/2011/10/18/sql-server-waits/</guid>
		<description><![CDATA[When diagnosing performance problems with SQL Server, one of the first things I do is check the wait conditions on the server.&#160; The current wait conditions on the server can give insight into what is affecting performance.&#160; They can help identify the server resource being stressed (CPU, I/O, locking, and so on), which should narrow [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mlichtenberg.wordpress.com&amp;blog=15354164&amp;post=112&amp;subd=mlichtenberg&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When diagnosing performance problems with SQL Server, one of the first things I do is check the wait conditions on the server.&#160; The current wait conditions on the server can give insight into what is affecting performance.&#160; They can help identify the server resource being stressed (CPU, I/O, locking, and so on), which should narrow down the search for the cause of the problem.</p>
<p><strong>The T-SQL Script</strong></p>
<p>I use a T-SQL script to check wait conditions. I don’t remember where I originally acquired this script (I didn’t write it myself), but it has proven to be very useful.&#160; I have confirmed it to work on SQL Server 2005 and 2008.</p>
<p>The script queries the <a href="http://msdn.microsoft.com/en-us/library/ms179984(v=SQL.105).aspx" target="_blank">dm_os_wait_stats</a> dynamic management view and performs calculations on the information found there. It outputs a list of the waits are occurring on the server, including the percentage each wait contributes to the total wait time. </p>
<p>Here is the script:</p>
<div style="border-bottom:black 1px solid;border-left:black 1px solid;font-size:8pt;border-top:black 1px solid;border-right:black 1px solid;padding:3px;">
<p><font face="Courier New">IF NOT EXISTS(SELECT id FROM tempdb.dbo.sysobjects WHERE [name] like &#8216;#waits%&#8217;)        <br />BEGIN&#160; <br />&#160; &#8212; Get starting statistics&#160; <br />&#160; CREATE TABLE #Waits(&#160; <br />&#160;&#160;&#160; WaitType nvarchar(60) NOT NULL,&#160; <br />&#160;&#160;&#160; WaitTime bigint NULL,&#160; <br />&#160;&#160;&#160; [%Waiting] decimal(12, 2) NULL,&#160; <br />&#160;&#160;&#160; MonitorDate datetime NOT NULL&#160; <br />&#160; ) </font></p>
<p><font face="Courier New">&#160; INSERT INTO #Waits&#160; <br />&#160; SELECT&#160; <br />&#160;&#160;&#160; wait_type,&#160; <br />&#160;&#160;&#160; wait_time_ms / 1000,&#160; <br />&#160;&#160;&#160; CONVERT(DECIMAL(12,2), wait_time_ms * 100.0 / SUM(wait_time_ms) OVER()),&#160; <br />&#160;&#160;&#160; GETDATE()&#160; <br />&#160; FROM sys.dm_os_wait_stats&#160; <br />&#160; WHERE wait_type NOT LIKE &#8216;%SLEEP%&#8217;         <br />END </font></p>
<p><font face="Courier New">&#8211; Get the current stats and the percent change since the initial capture        <br />SELECT&#160; </font><font face="Courier New">NEW.WaitType,&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; NEW.WaitTime AS NewWaitTime,&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; NEW.[%Waiting] AS [New%Waiting],&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; OLD.WaitTime AS OldWaitTime,&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; OLD.[%Waiting] AS [Old%Waiting],&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; NEW.WaitTime &#8211; OLD.WaitTime AS Change         <br />INTO&#160;&#160;&#160; #tmpStats         <br />FROM&#160;&#160;&#160; (&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; SELECT WaitType = wait_type,&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; WaitTime = wait_time_ms / 1000,&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [%Waiting] = CONVERT(DECIMAL(12,2),         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font face="Courier New">wait_time_ms * 100.0 / SUM(wait_time_ms) OVER())&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; FROM&#160; sys.dm_os_wait_stats&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; WHERE wait_type NOT LIKE &#8216;%SLEEP%&#8217;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ) NEW&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; INNER JOIN&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; (&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; SELECT WaitType, WaitTime, [%Waiting] FROM #Waits&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ) OLD&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ON NEW.WaitType = OLD.WaitType </font></p>
<p><font face="Courier New">DECLARE @totalchange DECIMAL(10, 2)        <br />SELECT @totalchange = SUM(change) FROM #tmpStats </font></p>
<p><font face="Courier New">SELECT&#160; *,        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; CASE WHEN @TotalChange &gt; 0         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; THEN CONVERT(DECIMAL(10,2), CONVERT(DECIMAL(10,2),change) / @totalchange * 100)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ELSE 0         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; END AS [%WaitingSinceStart]         <br />FROM&#160;&#160;&#160; #tmpStats         <br />ORDER BY [%WaitingSinceStart] DESC </font></p>
<p><font face="Courier New">DROP TABLE #tmpStats</font></p>
<p></div>
<p><strong>Usage</strong></p>
<p>To analyze the wait conditions on a server, perform the following steps:</p>
<p>1) Open a query window in the SQL Server Management Studio </p>
<p>2) Execute the script</p>
<p>Upon this first execution of the script, you will get little useful information.&#160; Really all the first execution does is populate a temp table with a snapshot of the current wait state of the server (selected from the dm_os_waits_stats view).</p>
<p>3) DON’T CLOSE THE QUERY WINDOW!&#160; </p>
<p>You want to maintain the temp table created by the first execution of the script.&#160; </p>
<p>4) Wait 30 seconds, or 1 minute, or 5 minutes, or 10 minutes (or whatever makes sense).&#160; </p>
<p>The length of time you wait depends on the load on your server.&#160; The heavier the load, the less time you’ll need to wait.&#160; </p>
<p>5) Execute the script again.&#160; </p>
<p>It will select a new snapshot of the server’s wait state from the dm_os_waits_stats view, compare it to the original snapshot stored in the temporary table, and calculate the differences in wait times between the two.&#160; Now the output will accurately show the wait conditions that have occurred since the first time the script was run.&#160; </p>
<p>You can repeat this process as many times as necessary.&#160; As long as you reuse the same the query window (without dropping the temp table), you’ll continue to see the cumulative statistics since the first execution of the script.</p>
<p>NOTE: It is important to first execute this process during a period of normal database usage, so that the baseline wait conditions on the server can be established.&#160; There are always wait conditions occurring, even when a server is under no stress, so it is important to understand what is “normal” for the server.&#160; That way, problems can be more easily identified when the wait conditions deviate from the baseline conditions.</p>
<p><strong>Analyzing the Script Output</strong></p>
<p>There are many different types of waits that might occur.&#160; Here is an example of the script output: </p>
<div style="border-bottom:black 1px solid;border-left:black 1px solid;font-size:8pt;border-top:black 1px solid;border-right:black 1px solid;padding:3px;"> 
<p><font face="Courier New">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; New&#160;&#160;&#160;&#160;&#160; New&#160;&#160;&#160;&#160; Old&#160;&#160;&#160;&#160;&#160; Old&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; %Waiting        <br />WaitType&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; WaitTime Waiting WaitTime Waiting Change SinceStart         <br />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8211; &#8212;&#8212;- &#8212;&#8212;&#8211; &#8212;&#8212;- &#8212;&#8212; &#8212;&#8212;&#8212;-         <br />SQLTRACE_BUFFER_FLUSH 28156047 49.16&#160;&#160; 28155996 49.16&#160;&#160; 51&#160;&#160;&#160;&#160; 35.17         <br />CXPACKET&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 4202791&#160; 7.34&#160;&#160;&#160; 4202751&#160; 7.34&#160;&#160;&#160; 40&#160;&#160;&#160;&#160; 27.59         <br />PAGEIOLATCH_SH&#160;&#160;&#160;&#160;&#160;&#160;&#160; 2040584&#160; 3.56&#160;&#160;&#160; 2040562&#160; 3.56&#160;&#160;&#160; 22&#160;&#160;&#160;&#160; 15.17         <br />SOS_SCHEDULER_YIELD&#160;&#160; 12441434 21.72&#160;&#160; 12441417 21.72&#160;&#160; 17&#160;&#160;&#160;&#160; 11.72         <br />LATCH_EX&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 4595795&#160; 8.02&#160;&#160;&#160; 4595784&#160; 8.02&#160;&#160;&#160; 11&#160;&#160;&#160;&#160; 7.59         <br />PAGELATCH_UP&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 27982&#160;&#160;&#160; 0.05&#160;&#160;&#160; 27981&#160;&#160;&#160; 0.05&#160;&#160;&#160; 1&#160;&#160;&#160;&#160;&#160; 0.69         <br />PAGEIOLATCH_EX&#160;&#160;&#160;&#160;&#160;&#160;&#160; 91517&#160;&#160;&#160; 0.16&#160;&#160;&#160; 91516&#160;&#160;&#160; 0.16&#160;&#160;&#160; 1&#160;&#160;&#160;&#160;&#160; 0.69         <br />IO_COMPLETION&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 42555&#160;&#160;&#160; 0.07&#160;&#160;&#160; 42554&#160;&#160;&#160; 0.07&#160;&#160;&#160; 1&#160;&#160;&#160;&#160;&#160; 0.69         <br />PAGELATCH_EX&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 30927&#160;&#160;&#160; 0.05&#160;&#160;&#160; 30926&#160;&#160;&#160; 0.05&#160;&#160;&#160; 1&#160;&#160;&#160;&#160;&#160; 0.69         <br />PAGELATCH_KP&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0.00&#160;&#160;&#160; 0&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0.00&#160;&#160;&#160; 0&#160;&#160;&#160;&#160;&#160; 0.00</font></p>
</p></div>
<p>&#160; <br />On many servers, SQLTRACE_BUFFER_FLUSH will take up the majority of the wait time when the server is under no stress.&#160; That wait type is related to the default server trace that is enabled in SQL Server 2005 and 2008.&#160; Generally, it is a good thing if this wait type is taking up the majority of the wait time on the server.</p>
<p>CXPACKET and SOS_SCHEDULER_YIELD are related to parallelization and CPU usage.&#160; Any sustained increase in wait times for these two wait types indicates CPU pressure.&#160; An increase in PAGEIOLATCH_SH waits indicates IO issues.&#160; Increased CPU and IO waits may indicate a problem with a SQL query, high traffic conditions, or a non-SQL-related server issue.&#160; If waits like LCK_M_IX, LCK_M_X, or LCK_M_S (all generally very low) begin to increase, it is an indication of locking/blocking issues.&#160; Many other wait types <a href="http://msdn.microsoft.com/en-us/library/ms179984(v=SQL.105).aspx" target="_blank">are documented here</a>.</p>
<p>Generally, wait statistics will not pinpoint the exact cause of performance problems, but they can be very useful for identifying the areas that need investigation.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mlichtenberg.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mlichtenberg.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mlichtenberg.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mlichtenberg.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mlichtenberg.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mlichtenberg.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mlichtenberg.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mlichtenberg.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mlichtenberg.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mlichtenberg.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mlichtenberg.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mlichtenberg.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mlichtenberg.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mlichtenberg.wordpress.com/112/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mlichtenberg.wordpress.com&amp;blog=15354164&amp;post=112&amp;subd=mlichtenberg&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mlichtenberg.wordpress.com/2011/10/18/sql-server-waits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/669522dbf2066167f81a1c3b7bd67d7a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mlichtenberg</media:title>
		</media:content>
	</item>
		<item>
		<title>Catching Unhandled Exceptions in ASP.NET</title>
		<link>http://mlichtenberg.wordpress.com/2011/09/19/catching-unhandled-exceptions-in-asp-net/</link>
		<comments>http://mlichtenberg.wordpress.com/2011/09/19/catching-unhandled-exceptions-in-asp-net/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 04:07:48 +0000</pubDate>
		<dc:creator>mlichtenberg</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Debug Diagnostic Tool]]></category>
		<category><![CDATA[Exceptions]]></category>
		<category><![CDATA[Stack Overflow]]></category>

		<guid isPermaLink="false">https://mlichtenberg.wordpress.com/2011/09/19/catching-unhandled-exceptions-in-asp-net/</guid>
		<description><![CDATA[There are various methods that can be used to catch unhandled exceptions in an ASP.NET application.&#160; The appropriate method to use depends on the nature of the exception being thrown.&#160; This post walks through several examples to demonstrate several different types of “unhandled” exceptions and how to catch them. This investigation into unhandled exceptions was [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mlichtenberg.wordpress.com&amp;blog=15354164&amp;post=111&amp;subd=mlichtenberg&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There are various methods that can be used to catch unhandled exceptions in an ASP.NET application.&#160; The appropriate method to use depends on the nature of the exception being thrown.&#160; This post walks through several examples to demonstrate several different types of “unhandled” exceptions and how to catch them.</p>
<p>This investigation into unhandled exceptions was initiated by a stack overflow exception being thrown in a production application.&#160; That type of error proved to be the most challenging “unhandled exception” to handle, not least because of some incomplete or unclear documentation.</p>
<p>The following examples were tested in an ASP.NET WebForms (yes, boring old WebForms) application compiled with ASP.NET 4.0 and hosted with IIS 7.5 on Windows 7.</p>
<p>One type of “unhandled exception” is an exception thrown by a section of code that is not wrapped in a try-catch block.&#160; These types of exceptions can be caught by adding an exception handler to the <a href="http://msdn.microsoft.com/en-us/library/24395wz3.aspx" target="_blank">Application_Error</a> event in the global.asax file of a web application. </p>
<p>Most ASP.NET developers are familiar with the Application_Error event.&#160; The following example shows an implementation of this event handler that catches and logs unhandled exceptions.&#160; Notice that the <a href="http://msdn.microsoft.com/en-us/library/system.exception.innerexception.aspx" target="_blank">InnerException</a> of the Exception is what is actually logged.&#160; This is because the original exception is wrapped in an <a href="http://msdn.microsoft.com/en-us/library/system.web.httpunhandledexception.aspx" target="_blank">HttpUnhandledException</a> by the time it is caught by the Application_Error event.</p>
<div style="border-bottom:#000000 1px solid;border-left:#000000 1px solid;border-top:#000000 1px solid;border-right:#000000 1px solid;padding:10px;">
<p>void Application_Error(object sender, EventArgs e)      <br />{       <br />&#160;&#160; Exception ex = Server.GetLastError();       </p>
<p>&#160;&#160; // The original error may have been wrapped in a HttpUnhandledException,       <br />&#160;&#160; // so we need to log the details of the InnerException.       <br />&#160;&#160; ex = ex.InnerException ?? ex;       </p>
<p>&#160;&#160; try       <br />&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160; // Log the error       <br />&#160;&#160;&#160;&#160;&#160;&#160; string errMsg = string.Empty;       <br />&#160;&#160;&#160;&#160;&#160;&#160; if (ex.Message != null) errMsg = &quot;Message:&quot; + ex.Message + &quot;\r\n&quot;;       <br />&#160;&#160;&#160;&#160;&#160;&#160; if (ex.StackTrace != null) errMsg += &quot;Stack Trace:&quot; + ex.StackTrace;       <br />&#160;&#160;&#160;&#160;&#160;&#160; // * WRITE TO LOG *       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160; Server.ClearError();       <br />&#160;&#160; }       <br />&#160;&#160; catch       <br />&#160;&#160; {       <br />&#160;&#160; }       </p>
<p>&#160;&#160; Response.Redirect(&quot;~/Error.aspx?err=&quot; + ex.Message, false);       <br />}       </p>
</p></div>
<p> 
<p>A page with a single button can be used to test the Application_Error error handler.&#160; The code for the button click event is shown here.</p>
<div style="border-bottom:#000000 1px solid;border-left:#000000 1px solid;border-top:#000000 1px solid;border-right:#000000 1px solid;padding:10px;">
<p>protected void btnException_Click(object sender, EventArgs e)      <br />{       <br />&#160;&#160; // This will raise an exception, which we won&#8217;t handle here       <br />&#160;&#160; throw (new Exception(&quot;Test Exception&quot;));       <br />}       </p>
</p></div>
<p> 
<p>Another type of unhandled exception is an error (again not wrapped in a try-catch block) that occurs outside the normal request processing context of the ASP.NET runtime.&#160; An example is an error that occurs on another thread.&#160; An HttpModule that registers an event handler for the <a href="http://msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception.aspx" target="_blank">UnhandledException</a> event of the current AppDomain can be used to catch such exceptions.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms178468(v=VS.85).aspx" target="_blank">Http Modules</a> are assemblies that are called on every request.&#160; In that respect they are similar to ISAPI filters.&#160; Unlike ISAPI filters, they are written in managed code and are integrated with the ASP.NET application life cycle.&#160; ASP.NET itself uses modules to implement features such as forms authentication and caching.&#160; In regards to handling exceptions, the most important feature of http modules is that can consume application events.</p>
<p>The following is the complete code of a class that implements the <a href="http://msdn.microsoft.com/en-us/library/system.web.ihttpmodule.aspx" target="_blank">IHttpModule</a> interface.&#160; It includes an event handler for UnhandledException events.</p>
<div style="border-bottom:#000000 1px solid;border-left:#000000 1px solid;border-top:#000000 1px solid;border-right:#000000 1px solid;padding:10px;">
<p>using System;      <br />using System.Diagnostics;       <br />using System.Globalization;       <br />using System.IO;       <br />using System.Runtime.InteropServices;       <br />using System.Text;       <br />using System.Threading;       <br />using System.Web;       </p>
<p>namespace WebMonitor {       </p>
<p>&#160;&#160; public class UnhandledExceptionModule : IHttpModule       <br />&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160; static int _unhandledExceptionCount = 0;       <br />&#160;&#160;&#160;&#160;&#160;&#160; static string _sourceName = null;       <br />&#160;&#160;&#160;&#160;&#160;&#160; static object _initLock = new object();       <br />&#160;&#160;&#160;&#160;&#160;&#160; static bool _initialized = false;       </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; public void Init(HttpApplication app)       <br />&#160;&#160;&#160;&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Do this one time for each AppDomain.&#160; Verify that we&#8217;re on the correct ASP.NET version and       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // that the EventLog has been properly configured.&#160; If all is well, register an event handler for       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // unhandled exceptions.       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (!_initialized) {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; lock (_initLock) {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (!_initialized) {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; string webenginePath = Path.Combine(RuntimeEnvironment.GetRuntimeDirectory(),       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;webengine.dll&quot;);       </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (!File.Exists(webenginePath)) {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; throw new Exception(String.Format(CultureInfo.InvariantCulture,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;Failed to locate webengine.dll at &#8216;{0}&#8217;.&#160; This module requires .NET Framework 2.0.&quot;,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; webenginePath));       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }       </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; FileVersionInfo ver = FileVersionInfo.GetVersionInfo(webenginePath);       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; _sourceName = string.Format(CultureInfo.InvariantCulture, &quot;ASP.NET {0}.{1}.{2}.0&quot;,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ver.FileMajorPart, ver.FileMinorPart, ver.FileBuildPart);       </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (!EventLog.SourceExists(_sourceName)) {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; throw new Exception(String.Format(CultureInfo.InvariantCulture,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;There is no EventLog source named &#8216;{0}&#8217;. Module requires .NET Framework 2.0.&quot;,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; _sourceName));       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }       </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; AppDomain.CurrentDomain.UnhandledException +=&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; new UnhandledExceptionEventHandler(OnUnhandledException);       </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; _initialized = true;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }       <br />&#160;&#160;&#160;&#160;&#160;&#160; }&#160; </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; void OnUnhandledException(object o, UnhandledExceptionEventArgs e)       <br />&#160;&#160;&#160;&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Let this occur one time for each AppDomain.       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (Interlocked.Exchange(ref _unhandledExceptionCount, 1) != 0) return;       </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Build a message containing the exception details       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; StringBuilder message = new StringBuilder(&quot;\r\n\r\nUnhandledException logged by       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; UnhandledExceptionModule.dll:\r\n\r\nappId=&quot;);       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; string appId = (string) AppDomain.CurrentDomain.GetData(&quot;.appId&quot;);       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (appId != null) message.Append(appId);       </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Exception currentException = null;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; for (currentException = (Exception)e.ExceptionObject;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; currentException != null;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; currentException = currentException.InnerException) {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; message.AppendFormat(&quot;\r\n\r\ntype={0}\r\n\r\nmessage={1}\r\n\r\nstack=\r\n{2}\r\n\r\n&quot;,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; currentException.GetType().FullName,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; currentException.Message,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; currentException.StackTrace);       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Log the information to the event log       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; EventLog Log = new EventLog();       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Log.Source = _sourceName;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Log.WriteEntry(message.ToString(), EventLogEntryType.Error);       <br />&#160;&#160;&#160;&#160;&#160;&#160; }       <br />&#160;&#160; }       <br />} </p>
</p></div>
<p>To use the HttpModule within a web application, compile it and register the assembly in the <a href="http://msdn.microsoft.com/en-us/library/ms178684.aspx" target="_blank">web.config</a> file, as shown here.</p>
<div style="border-bottom:#000000 1px solid;border-left:#000000 1px solid;border-top:#000000 1px solid;border-right:#000000 1px solid;padding:10px;">
<p>&lt;system.webServer&gt;      <br />&lt;modules runAllManagedModulesForAllRequests=&quot;true&quot;&gt;       <br />&#160;&#160; &lt;add type=&quot;WebMonitor.UnhandledExceptionModule&quot; name=&quot;UnhandledExceptionModule&quot;/&gt;       <br />&lt;/modules&gt;       <br />&lt;/system.webServer&gt;       </p>
</p></div>
<p> 
<p>Testing this error handler is a bit more difficult, because the test needs to show that exceptions that bypass the Application_Error event handler are caught by the HttpModule.&#160; An error needs to be thrown that is not caught by the “normal” ASP.NET error pipeline (for example, the Application_Error event).&#160; </p>
<p>Again start with a single button on a web page.&#160; The click event of the button needs to spawn a thread that throws an exception which is not wrapped in a try-catch block..&#160; Here is the code for the click event.</p>
<div style="border-bottom:#000000 1px solid;border-left:#000000 1px solid;border-top:#000000 1px solid;border-right:#000000 1px solid;padding:10px;">
<p>protected void btnUnhandled_Click(object sender, EventArgs e)      <br />{       <br />&#160;&#160; // Queue the task.       <br />&#160;&#160; ThreadPool.QueueUserWorkItem(new WaitCallback(ThreadProc));       </p>
<p>&#160;&#160; // The Sleep gives the background thread time to run       <br />&#160;&#160; Thread.Sleep(1000);       <br />}       </p>
<p>// This thread procedure performs the task.       <br />static void ThreadProc(Object stateInfo) {       <br />&#160;&#160; throw (new Exception(&quot;Test Unhandled exception&quot;));       <br />}       </p>
</p></div>
<p> 
<p>Because the exception happens on a separate thread, the Application_Error event does not catch it. However, the HttpModule does.</p>
<p>Note that such an HttpModule exception handler will also catch any exceptions that an Application_Error event handler in global.asax will catch. So, an HttpModule exception handler can be used in tandem with an Application_Error event handler , or in place of the Application_Error event.</p>
<p>The final type of unhandled exception to examine is an exception that corrupts the state of the application.&#160; Probably the best-known example of this is a stack overflow.&#160; Because they require special handling, it might seem that exceptions like a <a href="http://msdn.microsoft.com/en-us/library/system.stackoverflowexception.aspx" target="_blank">StackOverflowException</a> are simply unhandled exceptions that occur outside the normal request processing context of ASP.NET, just as the error in the previous example.&#160; In fact, exceptions that corrupt the state of the application are a different class of exception entirely, and by definition <strong>cannot be caught</strong>.&#160; </p>
<p>This is true despite conflicting documentation that suggests that http modules can catch such errors, or that the legacyUnhandledExceptionPolicy setting in the aspnet.config file (located in the framework folder) can be modified to allow ASP.NET to handle such exceptions in a legacy manner (i.e. like ASP.NET 1.0 and 1.1).&#160; </p>
<p>Furthermore, some documentation suggests that stack overflow errors can be caught if the block of code throwing the error is decorated with the <a href="http://msdn.microsoft.com/en-us/library/system.security.securitycriticalattribute.aspx" target="_blank">System.Security.SecurityCritical</a> and <a href="http://msdn.microsoft.com/en-us/library/system.runtime.exceptionservices.handleprocesscorruptedstateexceptionsattribute(v=VS.100)" target="_blank">System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptions</a> attributes.&#160; (This, of course, assumes that you know the block of code throwing the error.)</p>
<p>The following is the codebehind for a page that generates a stack overflow error by calling a recursive function that never exits.&#160; It illustrates the use of the SecurityCritical and HandleProcessCorruptedStateExceptions attributes that are supposed to allow corrupted state exceptions, including stack overflows, to be caught.&#160; The attributes have no effect; the exceptions are not caught by the try-catch block.</p>
<div style="border-bottom:#000000 1px solid;border-left:#000000 1px solid;border-top:#000000 1px solid;border-right:#000000 1px solid;padding:10px;">
<p>using System;      <br />using System.Web;       <br />using System.Web.UI;       <br />using System.Web.UI.WebControls;       </p>
<p>namespace UnhandledExceptionWebApp       <br />{       <br />&#160;&#160; // Attribute doesn&#8217;t seem to work as advertised       <br />&#160;&#160; [System.Security.SecurityCritical]       <br />&#160;&#160; public partial class StackOverflow : System.Web.UI.Page       <br />&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160; // Attribute doesn&#8217;t seem to work as advertised; the stack overflow is NOT caught&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160; [System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptions]       <br />&#160;&#160;&#160;&#160;&#160;&#160; protected void Page_Load(object sender, EventArgs e)       <br />&#160;&#160;&#160;&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; try       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; this.Overflow(true);       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; catch (Exception ex)       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Response.Redirect(&quot;~/Error.aspx?err=&quot; + ex.Message, false);       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }       <br />&#160;&#160;&#160;&#160;&#160;&#160; }       </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; // Recursive function causes stack overflow       <br />&#160;&#160;&#160;&#160;&#160;&#160; private void Overflow(Boolean keepGoing)       <br />&#160;&#160;&#160;&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (keepGoing) this.Overflow(keepGoing);       <br />&#160;&#160;&#160;&#160;&#160;&#160; }       <br />&#160;&#160; }       <br />}</p>
</p></div>
<p> 
<p>In addition, if this page is added to an application that implements the previously discussed Application_Error and HttpModule event handlers, the stack overflow error is not caught.&#160; Even changing the legacyUnhandledExceptionPolicy setting in the aspnet.config file has no effect.&#160; The stack overflow exception is not caught by any of the error handlers.&#160; It seems that all of the documentation that suggests various methods for capturing stack overflow exceptions is incorrect or misleading.</p>
<p>It appears that there is NO WAY to catch and log a stack overflow error.&#160; So, how can a stack overflow exception be “handled”?</p>
<p>The answer is to use the <a href="http://www.microsoft.com/download/en/details.aspx?id=26798" target="_blank">Debug Diagnostic Tool</a> from Microsoft (the latest version at the time of this writing is 1.2).&#160;&#160; This tool includes a debugger service that can capture a dump file when a stack overflow occurs.&#160; That file can then be analyzed to find the code that is causing the stack overflow.</p>
<p>Complete configuration and usage details for the Debug Diagnostic Tool are outside the scope of this post.&#160; In brief, the steps to follow to capture a stack trace when a stack overflow exception occurs are:</p>
<ol>
<li>Install the Debug Diagnostic Tool </li>
<li>Create a Rule to capture Stack Overflow exceptions and perform a Log Stack Trace action. </li>
<li>Run the web application. </li>
<li>Run the Debug Diagnostic Tool. </li>
<li>Cause the exception to occur. </li>
</ol>
<p>For more detailed information, see the documentation of the tool <a href="http://www.microsoft.com/download/en/details.aspx?id=26798" target="_blank">here</a>.</p>
<p>When a stack overflow exception occurs, the Debug Diagnostic Tool will capture a stack trace and write it to a log file.&#160; An example of the log contents can be seen here (with the function call that is producing the stack overflow highlighted):</p>
<div style="border-bottom:#000000 1px solid;border-left:#000000 1px solid;border-top:#000000 1px solid;border-right:#000000 1px solid;padding:10px;">[9/1/2011 11:10:24 PM] First chance exception &#8211; 0xc00000fd caused by thread with System ID: 4004    <br />[9/1/2011 11:10:24 PM] Stack Trace     <br />ChildEBP RetAddr Args to Child     <br />WARNING: Frame IP not in any known module. Following frames may be wrong.     <br />03c5300c 00bc0c74 017751b4 00000000 00000001 0xbc0c6e     <br />03c53020 00bc0c74 017751b4 00000000 00000001 0xbc0c74     <br />03c53034 00bc0c74 017751b4 00000000 00000001 0xbc0c74     <br />&#8230; (the preceding line repeated many many times)     <br />…     <br /><strong>03c8eccc 00bc0c74 StackOverflowWebApp.StackOverflow.Overflow(Boolean)      <br />03c8ece0 00bc0c74 StackOverflowWebApp.StackOverflow.Overflow(Boolean)       <br />03c8ecf4 00bc0c74 StackOverflowWebApp.StackOverflow.Overflow(Boolean)       <br />&#8230; (the preceding line repeated many many times)       <br />…</strong>     <br />03c8ed08 00bc0bb5 StackOverflowWebApp.StackOverflow.Page_Load(System.Object, System.EventArgs)     <br />03c8ed54 0116d5cf System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr, System.Object, System.Object, System.EventArgs)     <br />03c8ed64 5d7d5694 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(System.Object, System.EventArgs)     <br />03c8ed78 5d7c8cbc System.Web.UI.Control.OnLoad(System.EventArgs)     <br />03c8ed8c 5d7c8d1b System.Web.UI.Control.LoadRecursive()     <br />03c8eda4 5d7c66e0 System.Web.UI.Page.ProcessRequestMain(Boolean, Boolean)     <br />03c8efcc 5d7c5cad System.Web.UI.Page.ProcessRequest(Boolean, Boolean)     <br />03c8f004 5d7c5bcf System.Web.UI.Page.ProcessRequest()     </p>
</div>
<p> 
<p>The log shows a stack trace which positively identifies the part of the code that is throwing the error (the StackOverflowWebApp.StackOverflow.Overflow(Boolean) method).</p>
<p>Note that the Debug Diagnostic Tool service is set to start automatically.&#160; This may not be desirable, especially if the tool is only needed briefly to debug a particular error.&#160; Also, the tool seems to affect the performance of the web site being debugged.&#160; Use this tool carefully, especially if it must be pointed at a production web site.</p>
<p>In summary, unhandled exceptions in an ASP.NET application can be caught with an Application_Error event handler in the global.asax, or by creating a HttpModule to catch the AppDomain.UnhandledException event.&#160; An HttpModule is required to catch unhandled exceptions that occur outside the normal processing of requests by the ASP.NET runtime.&#160; For errors that corrupt the state of the application, such as stack overflow exceptions, use the Debug Diagnostic Tool to capture a stack trace at the time of the error.</p>
<p>The complete source code for an application that includes all of the examples shown here <a href="https://github.com/mlichtenberg/UnhandledExceptionWebApp" target="_blank">is available for download</a>.&#160; Please note that the web site should be compiled and hosted under IIS to ensure that the the error handlers will behave properly.&#160; Running the application in debugging mode from within Visual Studio produces different results than you will see in a production environment.&#160; Visual Studio tries to help handle the errors, but that prevents some of the intended event handlers from working as expected, and does not allow for a complete understanding of how the various error handlers work outside the development environment.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mlichtenberg.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mlichtenberg.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mlichtenberg.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mlichtenberg.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mlichtenberg.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mlichtenberg.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mlichtenberg.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mlichtenberg.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mlichtenberg.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mlichtenberg.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mlichtenberg.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mlichtenberg.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mlichtenberg.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mlichtenberg.wordpress.com/111/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mlichtenberg.wordpress.com&amp;blog=15354164&amp;post=111&amp;subd=mlichtenberg&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mlichtenberg.wordpress.com/2011/09/19/catching-unhandled-exceptions-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/669522dbf2066167f81a1c3b7bd67d7a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mlichtenberg</media:title>
		</media:content>
	</item>
		<item>
		<title>St. Louis Day of .NET &#8211; S.O.L.I.D.</title>
		<link>http://mlichtenberg.wordpress.com/2011/08/24/st-louis-day-of-net-s-o-l-i-d/</link>
		<comments>http://mlichtenberg.wordpress.com/2011/08/24/st-louis-day-of-net-s-o-l-i-d/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 03:47:09 +0000</pubDate>
		<dc:creator>mlichtenberg</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[SOLID]]></category>
		<category><![CDATA[St. Louis Day of .NET]]></category>

		<guid isPermaLink="false">https://mlichtenberg.wordpress.com/2011/08/24/st-louis-day-of-net-s-o-l-i-d/</guid>
		<description><![CDATA[This is part of a series of posts containing my notes from the sessions I attended at the 2011 St. Louis Day of .NET conference. This series does not attempt to give complete accounts of the information presented in each session; it is just a way to capture the bullet points, notes, and opinions that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mlichtenberg.wordpress.com&amp;blog=15354164&amp;post=110&amp;subd=mlichtenberg&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is part of a series of posts containing my notes from the sessions I attended at the 2011 St. Louis Day of .NET conference. </p>
<p>This series does not attempt to give complete accounts of the information presented in each session; it is just a way to capture the bullet points, notes, and opinions that I recorded while attending the conference. I have previously posted <a href="http://mlichtenberg.wordpress.com/2011/08/10/st-louis-day-of-net-2011-reflections-and-session-materials/">a list of all of the session materials and sample code</a> that I have been able to find online, so if you are looking for a more precise account of a session, try looking there.</p>
<p>My favorite presenter at this year’s conference was <a href="http://blog.unhandled-exceptions.com">Steve Bohlen</a>.&#160; He presented at three session; I attended two: “Taming Dependency Chaos with Inversion of Control Containers” and “Refactoring to a SOLID Foundation”.&#160; Both were excellent.&#160; Following are my notes from the SOLID session.</p>
<p><strong>Single Responsibility Principle</strong></p>
<p>There should never be more than one reason for a class to change.&#160; Each class should do one thing.</p>
<p><strong>Open-Closed Principle</strong></p>
<p>Software Entities (classes, modules, functions, etc) should be open for extension, but closed for modification.</p>
<p>Instead of this:</p>
<p>&#160;&#160;&#160;&#160; public class Report    <br />&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public void Print()     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }     <br />&#160;&#160;&#160;&#160; }</p>
<p>Use this:</p>
<p>&#160;&#160;&#160;&#160; public class Report    <br />&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public <b>virtual</b> void Print()     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }     <br />&#160;&#160;&#160;&#160; }</p>
<p>So that you can do this:</p>
<p>&#160;&#160;&#160;&#160; public class Report2 : Report    <br />&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public override void Print()     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }     <br />&#160;&#160;&#160;&#160; }</p>
<p>In this case, the old working code (&quot;Report&quot; class) still works, and we have also added new functionality (&quot;Report2&quot; class).</p>
<p><strong>Liskov Substitution Principle</strong></p>
<p>Functions that use pointers or references to base classes must be able to use objects of derived classes <b>without knowing it</b>. (Polymorphism; important part highlighted)</p>
<p>Instead of:</p>
<p>&#160;&#160;&#160;&#160; public class LetterReport    <br />&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public virtual void Print()     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }     <br />&#160;&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160;&#160; public class TabloidReport : LetterReport    <br />&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public override void Print()     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }     <br />&#160;&#160;&#160;&#160; }</p>
<p>Here, TabloidReport overrides a particular kind of report (LetterReport).</p>
<p>Do this instead:</p>
<p>&#160;&#160;&#160;&#160; public abstract class Report    <br />&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public abstract void Print()     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }     <br />&#160;&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160;&#160; public class LetterReport : Report    <br />&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public override void Print()     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }     <br />&#160;&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160;&#160; public class TabloidReport : Report    <br />&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public override void Print()     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }     <br />&#160;&#160;&#160;&#160; }</p>
<p>Now, the base class for the reports is truly generic (it&#8217;s not a particular kind of report).</p>
<p><strong>Interface Segregation Principle</strong></p>
<p>Clients should not be forced to depend upon interfaces that they do not use.</p>
<p>Do not build catch-all interfaces like this:</p>
<p>&#160;&#160;&#160;&#160; public interface IDataAccess    <br />&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public void SetConnectionString();     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public void Connect();     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public Data GetReportData();     <br />&#160;&#160;&#160;&#160; }</p>
<p>Instead, interfaces should &quot;build upon&quot; other interfaces, as such (interface composition):</p>
<p>&#160;&#160;&#160;&#160; public interface IDataAccess    <br />&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public void SetConnectionString();     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public void Connect();     <br />&#160;&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160;&#160; public interface IReportDataAccess : IDataAccess    <br />&#160;&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public Data GetReportData();     <br />&#160;&#160;&#160;&#160; }</p>
<p>Now, classes can select the interface that makes the most sense, rather than getting a single interface with everything.</p>
<p><strong>Dependency Inversion Principle</strong></p>
<p>High level modules should not depend on low level modules.&#160; Both should depend on abstractions.&#160; Abstractions should not depend upon details. Details should depend upon abstractions.</p>
<p>This is where dependency injection and object composition comes into play.&#160; No easy code example to give here.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mlichtenberg.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mlichtenberg.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mlichtenberg.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mlichtenberg.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mlichtenberg.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mlichtenberg.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mlichtenberg.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mlichtenberg.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mlichtenberg.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mlichtenberg.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mlichtenberg.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mlichtenberg.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mlichtenberg.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mlichtenberg.wordpress.com/110/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mlichtenberg.wordpress.com&amp;blog=15354164&amp;post=110&amp;subd=mlichtenberg&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mlichtenberg.wordpress.com/2011/08/24/st-louis-day-of-net-s-o-l-i-d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/669522dbf2066167f81a1c3b7bd67d7a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mlichtenberg</media:title>
		</media:content>
	</item>
		<item>
		<title>St. Louis Day of .NET &#8211; jQuery Plug-ins</title>
		<link>http://mlichtenberg.wordpress.com/2011/08/22/st-louis-day-of-net-jquery-plug-ins/</link>
		<comments>http://mlichtenberg.wordpress.com/2011/08/22/st-louis-day-of-net-jquery-plug-ins/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 03:12:47 +0000</pubDate>
		<dc:creator>mlichtenberg</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[St. Louis Day of .NET]]></category>

		<guid isPermaLink="false">https://mlichtenberg.wordpress.com/2011/08/22/st-louis-day-of-net-jquery-plug-ins/</guid>
		<description><![CDATA[This is part of a series of posts containing my notes from the sessions I attended at the 2011 St. Louis Day of .NET conference. This series does not attempt to give complete accounts of the information presented in each session; it is just a way to capture the bullet points, notes, and opinions that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mlichtenberg.wordpress.com&amp;blog=15354164&amp;post=108&amp;subd=mlichtenberg&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is part of a series of posts containing my notes from the sessions I attended at the 2011 St. Louis Day of .NET conference. </p>
<p>This series does not attempt to give complete accounts of the information presented in each session; it is just a way to capture the bullet points, notes, and opinions that I recorded while attending the conference. I have previously posted <a href="http://mlichtenberg.wordpress.com/2011/08/10/st-louis-day-of-net-2011-reflections-and-session-materials/">a list of all of the session materials and sample code</a> that I have been able to find online, so if you are looking for a more precise account of a session, try looking there.</p>
<p>One of the better sessions I attended at this year’s conference was <a href="http://github.com/irobinson">Ian Robinson</a>’s “Building jQuery Plug-Ins”.&#160; Too many sessions I attended this year skipped the how-to-get-started and jumped right into examining the code of a finished product.&#160; This session, on the other hand, stepped through the entire process of building a jQuery plug-in.&#160; Here are my notes from the session:</p>
<p><strong>The Process</strong></p>
<ul>
<li>Wrap business logic with plug-in logic </li>
<li>The business logic can stay largely the same </li>
<li>Modify to inject settings and context </li>
<li>Modify for safety and to play well with others <u>       <br /></u><strong></strong></li>
<p>   <strong></strong></ul>
<ul><strong>First step</strong></ul>
<p>Wrap in a closure&#8230;</p>
<p>(function($) {    <br />&#160;&#160;&#160;&#160; // ahh&#8230; safety     <br />})(jQuery);</p>
<p>This structure ensures that our code doesn&#8217;t conflict with others (takes it out of global scope and defines the plug-in&#8217;s own scope).&#160; It also ensures that when a dollar sign ($) is used in the body of this code, it means jQuery (and not anything else).</p>
<p><a title="http://nathansjslessons.appspot.com/" href="http://nathansjslessons.appspot.com/">http://nathansjslessons.appspot.com/</a> (What’s A Closure?) </p>
<p><strong>Define the Plug-in</strong></p>
<p>No selecting needed:</p>
<p>&#160;&#160;&#160;&#160; $.fn.myPlugin = function(options) {&#8230;};</p>
<p>Select and return (chain):</p>
<p>&#160;&#160;&#160;&#160; $.fn.myPlugin = function(options) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return this.each(function() {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8230;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; });     <br />&#160;&#160;&#160;&#160; };</p>
<p><strong>Establish Default Options</strong></p>
<p>&#160;&#160;&#160;&#160; $.fn.myPlugin.defaultOptions = {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; speed: &#8216;slow&#8217;     <br />&#160;&#160;&#160;&#160; };</p>
<p>&#160;&#160;&#160;&#160; var opts = $.extend({}, $.fn.myPlugin.defaultOptions, options);</p>
<p><strong>Inject HTML Context</strong></p>
<p>Options aren&#8217;t just for settings.</p>
<p>Inject all context through options.&#160; For example:</p>
<p>&#160;&#160;&#160;&#160; $(&#8216;.nav&#8217;).myPlugin({    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; speed: &#8216;fast&#8217;,     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; subNavSelector: &#8216;li.subnav&#8217;     <br />&#160;&#160;&#160;&#160; });</p>
<p><strong>Events</strong></p>
<p>Determine if you need to enforce document.ready.&#160; If not, let the user of the plug-in do it.</p>
<p>If you&#8217;re ever unbinding events, bind with a namespace first.&#160; For example:</p>
<p>&#160;&#160;&#160;&#160; $(&#8216;elem&#8217;).unbind(&#8216;click.Namespace&#8217;, function(){&#8230;});</p>
<p><strong>Complete Example</strong></p>
<p>(function($) {    <br />&#160;&#160;&#160;&#160; $.fn.myPlugin = function(options) {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var opts = $.extend({}, $.fn.myPlugin.defaultOptions, options), $moduleWrap = this;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Iterate over all elements contained in the current context ($moduleWrap = &quot;.myClass&quot;???)     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $moduleWrap.each(function() {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Grab the element being evaulated     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var $module = $(this);     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8230; do something &#8230;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; })     <br />&#160;&#160;&#160;&#160; };</p>
<p>&#160;&#160;&#160;&#160; $.fn.myPlugin.defaultOptions = {&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; speed: &#8216;slow&#8217;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; subNavSelector: &#8216;li.subnav&#8217;     <br />&#160;&#160;&#160;&#160; };</p>
<p>&#160;&#160;&#160;&#160; $(document).ready(function() {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#8216;.myClass&#8217;).myPlugin();     <br />&#160;&#160;&#160;&#160; });     <br />})(jQuery);</p>
<p><strong>More examples and documentation      <br /></strong><a href="http://css-tricks.com/snippets/jquery/jquery-plugin-template/">http://css-tricks.com/snippets/jquery/jquery-plugin-template/</a>     <br /><a href="http://docs.jquery.com/Plugins/Authoring">http://docs.jquery.com/Plugins/Authoring</a>     <br /><a href="http://jquery.ian-robinson.com/">http://jquery.ian-robinson.com</a> (jQuery Crash Course)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mlichtenberg.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mlichtenberg.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mlichtenberg.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mlichtenberg.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mlichtenberg.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mlichtenberg.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mlichtenberg.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mlichtenberg.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mlichtenberg.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mlichtenberg.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mlichtenberg.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mlichtenberg.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mlichtenberg.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mlichtenberg.wordpress.com/108/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mlichtenberg.wordpress.com&amp;blog=15354164&amp;post=108&amp;subd=mlichtenberg&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mlichtenberg.wordpress.com/2011/08/22/st-louis-day-of-net-jquery-plug-ins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/669522dbf2066167f81a1c3b7bd67d7a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mlichtenberg</media:title>
		</media:content>
	</item>
		<item>
		<title>St. Louis Day of .NET &#8211; Entity Framework 4.1</title>
		<link>http://mlichtenberg.wordpress.com/2011/08/21/st-louis-day-of-net-entity-framework-4-1/</link>
		<comments>http://mlichtenberg.wordpress.com/2011/08/21/st-louis-day-of-net-entity-framework-4-1/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 01:17:17 +0000</pubDate>
		<dc:creator>mlichtenberg</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Entity Framework]]></category>
		<category><![CDATA[St. Louis Day of .NET]]></category>

		<guid isPermaLink="false">https://mlichtenberg.wordpress.com/2011/08/21/st-louis-day-of-net-entity-framework-4-1/</guid>
		<description><![CDATA[This is part of a series of posts containing my notes from the sessions I attended at the 2011 St. Louis Day of .NET conference. This series does not attempt to give complete accounts of the information presented in each session; it is just a way to capture the bullet points, notes, and opinions that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mlichtenberg.wordpress.com&amp;blog=15354164&amp;post=106&amp;subd=mlichtenberg&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is part of a series of posts containing my notes from the sessions I attended at the 2011 St. Louis Day of .NET conference. </p>
<p>This series does not attempt to give complete accounts of the information presented in each session; it is just a way to capture the bullet points, notes, and opinions that I recorded while attending the conference. I have previously posted <a href="http://mlichtenberg.wordpress.com/2011/08/10/st-louis-day-of-net-2011-reflections-and-session-materials/">a list of all of the session materials and sample code</a> that I have been able to find online, so if you are looking for a more precise account of a session, try looking there.</p>
<p><a href="http://www.codebadger.com">Brad Tutterow</a> presented The Tasty Flavors of Entity Framework 4.1, which introduced the various ways (Code-First, Model-First, and Database-First) to develop with the latest version of Entity Framework.&#160; Here are my (rather brief) notes from the session.</p>
<ul>
<li>More information about Entity Framework on Julie Lerman&#8217;s blog:&#160; <a href="http://thedatafarm.com/blog/">http://thedatafarm.com/blog/</a> </li>
<li>A very good decision tree for which &quot;flavor&quot; (database-first, model-first, code-first)&#160; of Entity Framework 4.1 to use can be found at <a href="http://thedatafarm.com/blog/data-access/model-first-database-first-or-code-first-ndash-update-to-data-points-column/">http://thedatafarm.com/blog/data-access/model-first-database-first-or-code-first-ndash-update-to-data-points-column/</a> </li>
<li>The &#8216;DbContext&#8217; object was added in Entity Framework 4.1, and is the preferred object for interacting with Entity Framework.&#160; Previously, the only option was &#8216;ObjectContext&#8217;. </li>
<li>If you have existing data access classes that represent your data model, you can use the code-first method for EF.&#160; (This is Interesting&#8230; worth trying out to see how it works.&#160; Perhaps offers another way to migrate to EF from existing code.) </li>
<li>Code-first requires *manual* creation of the DBContext class.&#160; Then, add a connection string with a name that matches the name of the DBContext class.&#160; On the first run of the code-first application, the database will be created automatically.&#160; (Whoa, really?&#160; Will have to think about how this can work in a controlled production environment.) </li>
<li>With the code-first approach, use the <a href="http://msdn.microsoft.com/en-us/library/hh295844(v=VS.103).aspx">Fluent API</a> if your entities (classes) differ from the data model. </li>
</ul>
<p>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mlichtenberg.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mlichtenberg.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mlichtenberg.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mlichtenberg.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mlichtenberg.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mlichtenberg.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mlichtenberg.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mlichtenberg.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mlichtenberg.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mlichtenberg.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mlichtenberg.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mlichtenberg.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mlichtenberg.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mlichtenberg.wordpress.com/106/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mlichtenberg.wordpress.com&amp;blog=15354164&amp;post=106&amp;subd=mlichtenberg&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mlichtenberg.wordpress.com/2011/08/21/st-louis-day-of-net-entity-framework-4-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/669522dbf2066167f81a1c3b7bd67d7a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mlichtenberg</media:title>
		</media:content>
	</item>
		<item>
		<title>St. Louis Day of .NET &#8211; Code Contracts</title>
		<link>http://mlichtenberg.wordpress.com/2011/08/20/st-louis-day-of-net-code-contracts/</link>
		<comments>http://mlichtenberg.wordpress.com/2011/08/20/st-louis-day-of-net-code-contracts/#comments</comments>
		<pubDate>Sat, 20 Aug 2011 12:42:48 +0000</pubDate>
		<dc:creator>mlichtenberg</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Code Contracts]]></category>
		<category><![CDATA[St. Louis Day of .NET]]></category>

		<guid isPermaLink="false">https://mlichtenberg.wordpress.com/2011/08/20/st-louis-day-of-net-code-contracts/</guid>
		<description><![CDATA[This is part of a series of posts containing my notes from the sessions I attended at the 2011 St. Louis Day of .NET conference. This series does not attempt to give complete accounts of the information presented in each session; it is just a way to capture the bullet points, notes, and opinions that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mlichtenberg.wordpress.com&amp;blog=15354164&amp;post=105&amp;subd=mlichtenberg&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is part of a series of posts containing my notes from the sessions I attended at the 2011 St. Louis Day of .NET conference. </p>
<p>This series does not attempt to give complete accounts of the information presented in each session; it is just a way to capture the bullet points, notes, and opinions that I recorded while attending the conference. I have previously posted <a href="http://mlichtenberg.wordpress.com/2011/08/10/st-louis-day-of-net-2011-reflections-and-session-materials/">a list of all of the session materials and sample code</a> that I have been able to find online, so if you are looking for a more precise account of a session, try looking there.</p>
<p>Jeff Ayers presented a session on a very new add-on to Visual Studio, Code Contracts.&#160; I have been reading <a href="http://msdn.microsoft.com/en-us/magazine/gg983479.aspx">Dino Esposito’s ongoing series of articles</a> about Code Contracts in MSDN Magazine, and was interested in hearing another perspective on the technology.&#160; The verdict seems to be that the technology is not quite ready for prime-time.&#160; Here are my notes from the session..</p>
<ul>
<li>Code Contracts Standard/Premium from Microsoft DevLabs is the Visual Studio plug-in that is needed to enable the technology.&#160; Available from <a href="http://msdn.microsoft.com/en-us/devlabs/dd491992">http://msdn.microsoft.com/en-us/devlabs/dd491992</a>.</li>
<li>Description from the download site: &quot;Code Contracts provide a language-agnostic way to express coding assumptions in .NET programs. The contracts take the form of pre-conditions, post-conditions, and object invariants. Contracts act as checked documentation of your external and internal APIs. The contracts are used to improve testing via runtime checking, enable static contract verification, and documentation generation. Code Contracts bring the advantages of design-by-contract programming to all .NET programming languages.&quot;</li>
<li>An example of a code contract in C# is data validation that that be defined simply by adding attributes to a method or class.</li>
<li>Looking at the above description of code contracts, an example&#160; &quot;coding assumption&quot; is that an input value to a method will be between 1 and 10.&#160; This would be a &quot;pre-condition&quot; for the execution of the method.&#160; The method is decorated with an attribute that specifies the contract conditions.&#160; The contract conditions are verified via &quot;runtime checking&quot;.&#160; The attributes also enable &quot;static verfication&quot; and &quot;documentation generation&quot;.</li>
<li>Contracts are checked at run-time.</li>
<li>After working with Code Contracts for three weeks, the presenter believes that the tool, while useful, is not completely mature.&#160; The session demonstrations illustrated the difficultly in working with the toolset at the present time.</li>
<li>System.Diagnostics.Contracts is the namespace to include to gain access to the code contract functionality</li>
<li>Exceptions of type &quot;ContractException&quot; cannot be caught.&#160; (Perhaps something that will change in the future?)&#160; Instead, you can specify the type of exception to be thrown when a contract is violated.&#160; For example, you can choose to throw an ArgumentException.&#160; Those exception types can be caught as usual.</li>
<li>Examination of the IL revealed that a lot of additional code is generated by the compiler to handle contracts.&#160; The presenter stated that while good for producing developer feedback, contracts should not yet be included in production builds, at least for object invariant contracts.&#160; It adds too much overhead to a running application, affecting performance.</li>
<li>The tool does not work for WCF, because the WSDL doesn&#8217;t reflect the contract feedback that is so useful to users of the service (developers).</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mlichtenberg.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mlichtenberg.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mlichtenberg.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mlichtenberg.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mlichtenberg.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mlichtenberg.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mlichtenberg.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mlichtenberg.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mlichtenberg.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mlichtenberg.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mlichtenberg.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mlichtenberg.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mlichtenberg.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mlichtenberg.wordpress.com/105/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mlichtenberg.wordpress.com&amp;blog=15354164&amp;post=105&amp;subd=mlichtenberg&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mlichtenberg.wordpress.com/2011/08/20/st-louis-day-of-net-code-contracts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/669522dbf2066167f81a1c3b7bd67d7a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mlichtenberg</media:title>
		</media:content>
	</item>
		<item>
		<title>St. Louis Day of .NET 2011 &#8211; Brief Notes on Objective-C, LINQ, and NHibernate</title>
		<link>http://mlichtenberg.wordpress.com/2011/08/17/st-louis-day-of-net-2011-brief-notes-on-objective-c-linq-and-nhibernate/</link>
		<comments>http://mlichtenberg.wordpress.com/2011/08/17/st-louis-day-of-net-2011-brief-notes-on-objective-c-linq-and-nhibernate/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 03:13:06 +0000</pubDate>
		<dc:creator>mlichtenberg</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[NHibernate]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[St. Louis Day of .NET]]></category>

		<guid isPermaLink="false">https://mlichtenberg.wordpress.com/2011/08/17/st-louis-day-of-net-2011-brief-notes-on-objective-c-linq-and-nhibernate/</guid>
		<description><![CDATA[This is part of a series of posts containing my notes from the sessions I attended at the 2011 St. Louis Day of .NET conference. This series does not attempt to give complete accounts of the information presented in each session; it is just a way to capture the bullet points, notes, and opinions that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mlichtenberg.wordpress.com&amp;blog=15354164&amp;post=103&amp;subd=mlichtenberg&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is part of a series of posts containing my notes from the sessions I attended at the 2011 St. Louis Day of .NET conference. </p>
<p>This series does not attempt to give complete accounts of the information presented in each session; it is just a way to capture the bullet points, notes, and opinions that I recorded while attending the conference. I have previously posted <a href="http://mlichtenberg.wordpress.com/2011/08/10/st-louis-day-of-net-2011-reflections-and-session-materials/">a list of all of the session materials and sample code</a> that I have been able to find online, so if you are looking for a more precise account of a session, try looking there.</p>
<p>I took only brief notes in sessions focusing on Objective-C, LINQ, and NHibernate, so I’m combining all of them into this post.</p>
<p>First up is <strong>Looking at Objective-C Through the Glass of a Typical .NET Developer</strong>, presented by <a href="http://twitter.com/#!/mulbud">Muljadi Budiman</a>.&#160; This session, on a decidedly NON-Microsoft topic, was filled to overflowing… needed a bigger room for this one.&#160; Perhaps my favorite sound-bite of the conference came from this session… “does anyone think this is NOT weird?”.</p>
<ul>
<li>Objective-C is a superset of C, very different from C#</li>
<li>Each class made up of two files:&#160; header files (*.h) provide an provide interface, and source files (*m) provide the implementation</li>
<li><a href="http://developer.apple.com/xcode/">XCode</a> is the OSX-based Objective-C development environment</li>
<li>Classes must be referred to with a pointer syntax.&#160; For example, <em>NSString*</em> instead of <em>NSString</em>, or <em>Person*</em> instead of <em>Person</em></li>
<li>Accessibility operators (@private, @public, @protected) are valid only for variables, not classes, methods, or properties.&#160; Because of this, *any* method or property can be overridden.</li>
<li>In Objective-C, you must allocate (alloc) and initialize (init) objects.&#160; Use &quot;new&quot; to alloc, init, and call constructor.&#160; In addition, objects should be &quot;release&quot; when you are done with them.&#160; If not, the objects stay in memory.</li>
<li>&quot;Protocols&quot; behave something like interfaces in C#</li>
<li>There are no static classes.</li>
</ul>
<p>Next is <strong>Deliver Cleaner Code with LINQ to Objects</strong>.&#160; Not the best choice of sessions on my part.&#160; The material presented was fine, but it didn’t teach me much I didn’t already know.</p>
<ul>
<li>Don&#8217;t use &quot;var&quot; just because you can.&#160; Use it when you truly don&#8217;t know the return type until run-time.</li>
<li>When using LINQ, you can use either extension methods or LINQ queries.&#160; Queries are typically easier for developers with database experience, but some functionality is only available via extension methods.</li>
<li>Extension methods utilize lambda expressions.</li>
<li>The compiler turns the LINQ query syntax into extension methods.</li>
<p>LINQ Extension Method Example    <br /><font face="Courier New">var list = contacts.Where(x =&gt; x.State == &quot;TX&quot;).Select (c =&gt; c.BirthDate);</font></ul>
<p>LINQ Query Syntax Example   <br /><font face="Courier New">var list = from c in contacts where c.State == &#8216;TX&quot; select c;</font></p>
<p>The last couple notes are from <a href="http://twitter.com/#!/leebrandt">Lee Brandt’s</a> session on NHibernate, titled <strong>NHibernate, Fluent NHibernate, and the Repository Pattern</strong>.&#160; The demos given in this session mostly focused on (relatively) complex completed code.&#160; There was no from-the-start “Hello World” example given.&#160; So while I was able to get a general sense of what it takes to work with NHibernate, I was left with a lot of unanswered questions.</p>
<ul>
<li>It looks like extensive up-front work is needed to wire up the database (create mappings, etc)</li>
<li>Unanswered question:&#160; Is there no way to auto-generate the initial class-to-database mappings?</li>
<p>These links may be useful for future research into NHibernate:</ul>
<p><a href="http://wiki.fluentnhibernate.org/Auto_mapping">http://wiki.fluentnhibernate.org/Auto_mapping</a>    <br /><a href="http://www.fincher.org/tips/Languages/NHibernate.shtml">http://www.fincher.org/tips/Languages/NHibernate.shtml</a>    <br /><a href="http://stackoverflow.com/questions/278046/free-nhibernate-helper-tools">http://stackoverflow.com/questions/278046/free-nhibernate-helper-tools</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mlichtenberg.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mlichtenberg.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mlichtenberg.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mlichtenberg.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mlichtenberg.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mlichtenberg.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mlichtenberg.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mlichtenberg.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mlichtenberg.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mlichtenberg.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mlichtenberg.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mlichtenberg.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mlichtenberg.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mlichtenberg.wordpress.com/103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mlichtenberg.wordpress.com&amp;blog=15354164&amp;post=103&amp;subd=mlichtenberg&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mlichtenberg.wordpress.com/2011/08/17/st-louis-day-of-net-2011-brief-notes-on-objective-c-linq-and-nhibernate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/669522dbf2066167f81a1c3b7bd67d7a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mlichtenberg</media:title>
		</media:content>
	</item>
	</channel>
</rss>
