<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>System.Reflection.Emit</title>
    <description>Technical Banterings of Jon Davis (A Web &amp; Software Developer)</description>
    <link>http://www.jondavis.net/techblog/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 1.4.5.0</generator>
    <language>en-US</language>
    <blogChannel:blogRoll>http://www.jondavis.net/techblog/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.dotnetblogengine.net/syndication.axd?format=rss</blogChannel:blink>
    <dc:creator>Jon Davis &lt;jon@jondavis.net&gt;</dc:creator>
    <dc:title>System.Reflection.Emit</dc:title>
    <geo:lat>33.583950</geo:lat>
    <geo:long>-111.876100</geo:long>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/stimpy77" type="application/rss+xml" /><item>
      <title>Office and COM interop with .NET: *Now* I'll give you a second glance</title>
      <description>&lt;p&gt;Well we're not quite a decade yet--certainly a lot longer than five years, though--since .NET came out and promised to be the next big thing for programming. C# was supposed to put VB6 to shame. It didn't, though, because with VB6 you had such things as optional parameters and variants--the latter being an ugly beast but under the covers the flexibility that VB6 was made programming so much quicker and easier sometimes. &lt;/p&gt;  &lt;p&gt;Now that C# 4.0 introduces optional parameters and dynamic objects, the whole playing field is changing. And now I can feel a bit freer to tinker with old-school technologies built on COM in my language of choice because the language has finally caught up with last decade's featureset in this respect. &lt;/p&gt;  &lt;p&gt;I like this somewhat recent blog post by SamNG: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/samng/archive/2009/06/16/com-interop-in-c-4-0.aspx"&gt;http://blogs.msdn.com/samng/archive/2009/06/16/com-interop-in-c-4-0.aspx&lt;/a&gt; &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Lets look at a quick Office example. &lt;/p&gt;    &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:991f89d5-fea6-456d-b43f-122e046ceb94" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="c#"&gt;static void Main()
{
    Word.Application app = new Word.Application();
    object m = Type.Missing;
    app.Documents.Add(ref m, ref m, ref m, ref m);
}&lt;/pre&gt;&lt;/div&gt;

  &lt;p&gt;This is such typical code! I have to struggle with the type system to make it happy, just to add a simple Word document! &lt;/p&gt;

  &lt;p&gt;... [With C# 4.0] in the following code, call (1) gets transformed into call (2). &lt;/p&gt;

  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:e34d073d-93ba-4cf8-bd23-a6a846bce417" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="c#"&gt;static void Main()
{
    Word.Application app = new Word.Application();
    // (1) Your initial call.
    app.Documents.Add(Type.Missing, Type.Missing, Type.Missing, Type.Missing);

    // (2) Compiler generates locals and inserts them.
    object m = Type.Missing;
    app.Documents.Add(ref m, ref m, ref m, ref m);
}&lt;/pre&gt;&lt;/div&gt;

  &lt;p&gt;The great thing about this too, is that with the introduction of named and optional arguments, and using the fact that the feature generates Type.Missing in place of default values for object on COM types, we can simply remove the arguments altogether! &lt;/p&gt;

  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:c3995ae9-ec37-4a14-b89d-9f62412e25d2" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="c#"&gt;static void Main()
{
    Word.Application app = new Word.Application();
    // (1) Your optional-parameter-omitted initial call.
    app.Documents.Add();

    // (2) Compiler generates locals and inserts them.
    object m = Type.Missing;
    app.Documents.Add(ref m, ref m, ref m, ref m);
}&lt;/pre&gt;&lt;/div&gt;

  &lt;p&gt;Pretty cool stuff huh? Definitely makes programming against the Office APIs much nicer. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Yup. Indeed. &lt;/p&gt;&lt;iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&amp;url=http://www.jondavis.net/techblog/post/2009/07/10/Office-and-COM-interop-with-NET-*Now*-Ill-give-you-a-second-glance.aspx&amp;amp;title=Office and COM interop with .NET: *Now* I'll give you a second glance" height="25" width="155" scrolling="no" frameborder="0"&gt;&lt;/iframe&gt;&lt;img src="http://feeds.feedburner.com/~r/stimpy77/~4/6hB3-MnrGyM" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/stimpy77/~3/6hB3-MnrGyM/post.aspx</link>
      <author>jon.nospam@nospam.jondavis.net (Jon)</author>
      <comments>http://www.jondavis.net/techblog/post/2009/07/10/Office-and-COM-interop-with-NET-*Now*-Ill-give-you-a-second-glance.aspx#comment</comments>
      <guid isPermaLink="false">http://www.jondavis.net/techblog/post.aspx?id=29d1556e-9dd4-4ab6-9dd6-cfa65ddc25f9</guid>
      <pubDate>Fri, 10 Jul 2009 14:27:00 -0700</pubDate>
      <category>Software Development</category>
      <dc:publisher>Jon</dc:publisher>
      <pingback:server>http://www.jondavis.net/techblog/pingback.axd</pingback:server>
      <pingback:target>http://www.jondavis.net/techblog/post.aspx?id=29d1556e-9dd4-4ab6-9dd6-cfa65ddc25f9</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.jondavis.net/techblog/trackback.axd?id=29d1556e-9dd4-4ab6-9dd6-cfa65ddc25f9</trackback:ping>
      <wfw:comment>http://www.jondavis.net/techblog/post/2009/07/10/Office-and-COM-interop-with-NET-*Now*-Ill-give-you-a-second-glance.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.jondavis.net/techblog/syndication.axd?post=29d1556e-9dd4-4ab6-9dd6-cfa65ddc25f9</wfw:commentRss>
    <feedburner:origLink>http://www.jondavis.net/techblog/post.aspx?id=29d1556e-9dd4-4ab6-9dd6-cfa65ddc25f9</feedburner:origLink></item>
    <item>
      <title>Silverlight 3: 3D support has buggy occlusion?</title>
      <description>&lt;p&gt;
I just downloaded Silverlight 3 and Blend 3. First thing I did was try out one of the samples. I grabbed the Zune 3D sample, then ran F5 to run it. I was able to spin the Zune model by dragging the mouse from the base of the model. But then I immediately noticed that it doesn&amp;#39;t look right. The arrows and artwork that are on the sides of the model do not get properly occluded while the whole thing is spun. The artwork occludes too soon, and the arrows don&amp;#39;t occlude at all. 
&lt;/p&gt;
&lt;p&gt;
Could be a bug in the sample. But could be a glitch in Silverlight itself. I wonder? 
&lt;/p&gt;
&lt;iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&amp;url=http://www.jondavis.net/techblog/post/2009/07/10/Silverlight-3-3D-support-has-buggy-occlusion.aspx&amp;amp;title=Silverlight 3: 3D support has buggy occlusion?" height="25" width="155" scrolling="no" frameborder="0"&gt;&lt;/iframe&gt;&lt;img src="http://feeds.feedburner.com/~r/stimpy77/~4/oGyRqEpe-og" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/stimpy77/~3/oGyRqEpe-og/post.aspx</link>
      <author>jon.nospam@nospam.jondavis.net (Jon)</author>
      <comments>http://www.jondavis.net/techblog/post/2009/07/10/Silverlight-3-3D-support-has-buggy-occlusion.aspx#comment</comments>
      <guid isPermaLink="false">http://www.jondavis.net/techblog/post.aspx?id=1a4fcf8a-0857-4605-8f5e-5dbcdb31eea5</guid>
      <pubDate>Fri, 10 Jul 2009 14:07:00 -0700</pubDate>
      <category>Silverlight</category>
      <dc:publisher>Jon</dc:publisher>
      <pingback:server>http://www.jondavis.net/techblog/pingback.axd</pingback:server>
      <pingback:target>http://www.jondavis.net/techblog/post.aspx?id=1a4fcf8a-0857-4605-8f5e-5dbcdb31eea5</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.jondavis.net/techblog/trackback.axd?id=1a4fcf8a-0857-4605-8f5e-5dbcdb31eea5</trackback:ping>
      <wfw:comment>http://www.jondavis.net/techblog/post/2009/07/10/Silverlight-3-3D-support-has-buggy-occlusion.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.jondavis.net/techblog/syndication.axd?post=1a4fcf8a-0857-4605-8f5e-5dbcdb31eea5</wfw:commentRss>
    <feedburner:origLink>http://www.jondavis.net/techblog/post.aspx?id=1a4fcf8a-0857-4605-8f5e-5dbcdb31eea5</feedburner:origLink></item>
    <item>
      <title>Visual Studio Debugger Tips (cont'd)</title>
      <description>&lt;p&gt;
Here&amp;#39;s another good article with debugger tips:
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;a href="http://geekswithblogs.net/sdorman/archive/2009/02/14/visual-studio-2008-debugging-tricks-ndash-multi-threaded-debugging.aspx"&gt;http://geekswithblogs.net/sdorman/archive/2009/02/14/visual-studio-2008-debugging-tricks-ndash-multi-threaded-debugging.aspx&lt;/a&gt; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
Have you ever hit Break while debugging a multi-threaded console app and the only thing VS tells you it&amp;#39;s still on is ReadLine(), where it&amp;#39;s waiting for some input but meanwhile some other threads are working and you can&amp;#39;t see them? The above-referenced article showed me how to access those other threads. It&amp;#39;s all at:
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	Debug menu -&amp;gt; Windows -&amp;gt; Threads 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&amp;url=http://www.jondavis.net/techblog/post/2009/07/08/Visual-Studio-Debugger-Tips-(contd).aspx&amp;amp;title=Visual Studio Debugger Tips (cont'd)" height="25" width="155" scrolling="no" frameborder="0"&gt;&lt;/iframe&gt;&lt;img src="http://feeds.feedburner.com/~r/stimpy77/~4/iiZryXkmBLE" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/stimpy77/~3/iiZryXkmBLE/post.aspx</link>
      <author>jon.nospam@nospam.jondavis.net (Jon)</author>
      <comments>http://www.jondavis.net/techblog/post/2009/07/08/Visual-Studio-Debugger-Tips-(contd).aspx#comment</comments>
      <guid isPermaLink="false">http://www.jondavis.net/techblog/post.aspx?id=2219f8d6-40dd-432c-8754-5e8d3fb702bb</guid>
      <pubDate>Wed, 08 Jul 2009 10:29:00 -0700</pubDate>
      <category>Software Development</category>
      <dc:publisher>Jon</dc:publisher>
      <pingback:server>http://www.jondavis.net/techblog/pingback.axd</pingback:server>
      <pingback:target>http://www.jondavis.net/techblog/post.aspx?id=2219f8d6-40dd-432c-8754-5e8d3fb702bb</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.jondavis.net/techblog/trackback.axd?id=2219f8d6-40dd-432c-8754-5e8d3fb702bb</trackback:ping>
      <wfw:comment>http://www.jondavis.net/techblog/post/2009/07/08/Visual-Studio-Debugger-Tips-(contd).aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.jondavis.net/techblog/syndication.axd?post=2219f8d6-40dd-432c-8754-5e8d3fb702bb</wfw:commentRss>
    <feedburner:origLink>http://www.jondavis.net/techblog/post.aspx?id=2219f8d6-40dd-432c-8754-5e8d3fb702bb</feedburner:origLink></item>
    <item>
      <title>Visual Studio Debugger Tips You Need To Know</title>
      <description>&lt;p&gt;
Came across this article today. It&amp;#39;s probably very old, as it&amp;#39;s on an ASP Classic file and has no date.
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&amp;nbsp;&lt;a href="http://www.eggheadcafe.com/articles/20050511.asp"&gt;http://www.eggheadcafe.com/articles/20050511.asp 
	&lt;/a&gt;
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
Good stuff, I didn&amp;#39;t know or forgot about half of that stuff. IMO, using a debugger correctly (vs. constant logging and alert pop-ups) is &lt;em&gt;huge&lt;/em&gt; when measuring one&amp;#39;s productivity.
&lt;/p&gt;
&lt;p&gt;
Incidentally, When looking for a &amp;quot;breakpoints window&amp;quot; I ended up being rather pleased to find that there&amp;#39;s a right-click context menu in the breakpoint gutter after a breakpoint has been set in the text editor, revealing:
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Location - Break execution when the program reaches this location in a file: File: [file path]; Line: [##]; Character: [##]; [checkbox] Allow the source code to be different from the original version&lt;/li&gt;
	&lt;li&gt;Condition - When the breakpoint location is reached, the expression is evaluated and the breakpoint is hit only if the expression is true or has changed. [checkbox] Condition: [textbox] [radio]: Is true; [radio]: Has changed
	&lt;ul&gt;
		&lt;li&gt;Yessss!! I&amp;#39;ve SO badly needed this one, I don&amp;#39;t know how many times I&amp;#39;ve pounded F5 while staring at my Watch window waiting for some string to show up in a loop, or actually wrote inline code like &lt;br /&gt;
		if (condition &amp;amp;&amp;amp; System.Diagnostics.Debugger.IsAttached) &lt;br /&gt;
		&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Diagnostics.Debugger.Break(); // my head open against the wall &lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Breapoint Hit Count - A breakpoint is hit when the breakpoint is reached and the condition is satisfied. The hitcount is the number of times the breakpoint has been hit. When the breakpoint is hit [drop-down]:
	&lt;ul&gt;
		&lt;li&gt;break always&lt;/li&gt;
		&lt;li&gt;break when the hit count is equal to [##]&lt;/li&gt;
		&lt;li&gt;break when the hit count is a multiple of [##]&lt;/li&gt;
		&lt;li&gt;break when the hit count is greater than or equal to [##]&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;Filter - You can restrict the breakpoint to only being set in certain processes and threads. Enter an expression to describe where the breakpoint should be set, or clear the expression to have the breakpoint set in all processes and threads. You can combine clauses using &amp;amp; (AND), || (OR), ! (NOT), and parentheses. Sample clauses: 
	&lt;ul&gt;
		&lt;li&gt;MachineName = &amp;quot;machine&amp;quot;&lt;/li&gt;
		&lt;li&gt;ProcessId = 123&lt;/li&gt;
		&lt;li&gt;ProcessName = &amp;quot;process&amp;quot;&lt;/li&gt;
		&lt;li&gt;ThreadId = 123&lt;/li&gt;
		&lt;li&gt;ThreadName = &amp;quot;thread&amp;quot;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;When Breakpoint Is Hit - Specify what to do when the breakpoint is hit.
	&lt;ul&gt;
		&lt;li&gt;[checkbox] Print a message: &lt;br /&gt;
		&lt;ul&gt;
			&lt;li&gt;sample: &amp;quot;Function: $FUNCTION, Thread: $TID $TNAME&amp;quot;&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li&gt;[checkbox] Run a macro: [macros drop-down]&lt;/li&gt;
		&lt;li&gt;Continue execution&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
Wow, that&amp;#39;s some powerful breakpoint logic I didn&amp;#39;t realize was right under my nose.
&lt;iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&amp;url=http://www.jondavis.net/techblog/post/2009/06/22/Visual-Studio-Debugger-Tips-You-Need-To-Know.aspx&amp;amp;title=Visual Studio Debugger Tips You Need To Know" height="25" width="155" scrolling="no" frameborder="0"&gt;&lt;/iframe&gt;&lt;img src="http://feeds.feedburner.com/~r/stimpy77/~4/3xgveMdASzQ" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/stimpy77/~3/3xgveMdASzQ/post.aspx</link>
      <author>jon.nospam@nospam.jondavis.net (Jon)</author>
      <comments>http://www.jondavis.net/techblog/post/2009/06/22/Visual-Studio-Debugger-Tips-You-Need-To-Know.aspx#comment</comments>
      <guid isPermaLink="false">http://www.jondavis.net/techblog/post.aspx?id=60948f1a-acad-4050-b2c6-177b807f9e9c</guid>
      <pubDate>Mon, 22 Jun 2009 17:45:00 -0700</pubDate>
      <category>Software Development</category>
      <dc:publisher>Jon</dc:publisher>
      <pingback:server>http://www.jondavis.net/techblog/pingback.axd</pingback:server>
      <pingback:target>http://www.jondavis.net/techblog/post.aspx?id=60948f1a-acad-4050-b2c6-177b807f9e9c</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.jondavis.net/techblog/trackback.axd?id=60948f1a-acad-4050-b2c6-177b807f9e9c</trackback:ping>
      <wfw:comment>http://www.jondavis.net/techblog/post/2009/06/22/Visual-Studio-Debugger-Tips-You-Need-To-Know.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.jondavis.net/techblog/syndication.axd?post=60948f1a-acad-4050-b2c6-177b807f9e9c</wfw:commentRss>
    <feedburner:origLink>http://www.jondavis.net/techblog/post.aspx?id=60948f1a-acad-4050-b2c6-177b807f9e9c</feedburner:origLink></item>
    <item>
      <title>Nail-biting success with Windows 7 Media Center and CableCard</title>
      <description>&lt;blockquote&gt;
	&lt;p&gt;
	I got &lt;a href="http://en.wikipedia.org/wiki/CableCARD"&gt;CableCard&lt;/a&gt; working today with Windows 7 Media Center. This is my first CableCard install. The install was not smooth, but it was successful. I&amp;#39;d heard a lot of horror stories about CableCard, but most of these stories were from two years or so ago. I expected the whole matter to be cleaned up by now. It has probably improved a lot, but I was surprised by how bumpy the ride was.
	&lt;/p&gt;
	&lt;p&gt;
	...
	&lt;/p&gt;
	&lt;p&gt;
	COX technicians really, genuinely, deeply &lt;em&gt;hate&lt;/em&gt; CableCards. This was the first visit to install CableCard, but the second visit from COX in the last couple weeks where the subject of CableCards came up. These guys&amp;nbsp;acknowledge that the idea behind CableCard is a sound one, but the problem is that they are so different, and the devices are so different, that it&amp;#39;s really hard to get a successful install. [I think Microsoft can relate to this sort of experience, being that their software works with most any white box PC on the planet.] Today&amp;#39;s installer had a nauseous-looking&amp;nbsp;frown on his face consistently from the moment he climbed the outer stairs to my door until the minute he walked out the door.. although, he had a slight skip in his step when he left. I&amp;#39;m not sure if that&amp;#39;s because he was glad the torture was over or if it was because it wasn&amp;#39;t another failure.
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
More at: &lt;a href="http://thegreenbutton.com/forums/thread/370299.aspx"&gt;http://thegreenbutton.com/forums/thread/370299.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&amp;url=http://www.jondavis.net/techblog/post/2009/06/22/Nail-biting-success-with-Windows-7-Media-Center-and-CableCard.aspx&amp;amp;title=Nail-biting success with Windows 7 Media Center and CableCard" height="25" width="155" scrolling="no" frameborder="0"&gt;&lt;/iframe&gt;&lt;img src="http://feeds.feedburner.com/~r/stimpy77/~4/39YLL_HT6v8" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/stimpy77/~3/39YLL_HT6v8/post.aspx</link>
      <author>jon.nospam@nospam.jondavis.net (Jon)</author>
      <comments>http://www.jondavis.net/techblog/post/2009/06/22/Nail-biting-success-with-Windows-7-Media-Center-and-CableCard.aspx#comment</comments>
      <guid isPermaLink="false">http://www.jondavis.net/techblog/post.aspx?id=53847649-d0a9-4333-b59f-56d6693aa4ba</guid>
      <pubDate>Mon, 22 Jun 2009 01:34:00 -0700</pubDate>
      <category>Electronics</category>
      <category>General Technology</category>
      <category>Pet Projects</category>
      <dc:publisher>Jon</dc:publisher>
      <pingback:server>http://www.jondavis.net/techblog/pingback.axd</pingback:server>
      <pingback:target>http://www.jondavis.net/techblog/post.aspx?id=53847649-d0a9-4333-b59f-56d6693aa4ba</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.jondavis.net/techblog/trackback.axd?id=53847649-d0a9-4333-b59f-56d6693aa4ba</trackback:ping>
      <wfw:comment>http://www.jondavis.net/techblog/post/2009/06/22/Nail-biting-success-with-Windows-7-Media-Center-and-CableCard.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.jondavis.net/techblog/syndication.axd?post=53847649-d0a9-4333-b59f-56d6693aa4ba</wfw:commentRss>
    <feedburner:origLink>http://www.jondavis.net/techblog/post.aspx?id=53847649-d0a9-4333-b59f-56d6693aa4ba</feedburner:origLink></item>
    <item>
      <title>IIS Subweb Applications Are Virtual Directories</title>
      <description>&lt;p&gt;
Microsoft never ceases to amaze me how they keep showing the most obscure error messages and support documentation for the simplest of causes. 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;span style="font-family: 'Verdana', 'sans-serif'; color: maroon; font-size: 14pt"&gt;&lt;em&gt;HTTP Error 500.19 - Internal Server Error&lt;/em&gt;&lt;/span&gt; 
	&lt;/p&gt;
	&lt;span style="font-family: 'Verdana', 'sans-serif'; color: maroon; font-size: 14pt"&gt;&lt;span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8.5pt"&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-family: 'Arial', 'sans-serif'; color: black; font-size: 8.5pt"&gt; The requested page cannot be accessed because the related configuration data for the page is invalid. &lt;br /&gt;
	&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8.5pt"&gt;Error Code:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family: 'Arial', 'sans-serif'; color: black; font-size: 8.5pt"&gt; 0x80070005 &lt;br /&gt;
	&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8.5pt"&gt;Notification:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family: 'Arial', 'sans-serif'; color: black; font-size: 8.5pt"&gt; BeginRequest &lt;br /&gt;
	&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8.5pt"&gt;Module:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family: 'Arial', 'sans-serif'; color: black; font-size: 8.5pt"&gt; IIS Web Core &lt;br /&gt;
	&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8.5pt"&gt;Requested URL:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family: 'Arial', 'sans-serif'; color: black; font-size: 8.5pt"&gt; &lt;a href="http://www.jondavis.net/techblog/"&gt;http://www.mysite.com/myapp/&lt;/a&gt;&lt;br /&gt;
	&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8.5pt"&gt;Physical Path:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family: 'Arial', 'sans-serif'; color: black; font-size: 8.5pt"&gt;&amp;nbsp;~~ &lt;br /&gt;
	&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8.5pt"&gt;Logon User:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family: 'Arial', 'sans-serif'; color: black; font-size: 8.5pt"&gt; Not yet determined &lt;br /&gt;
	&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8.5pt"&gt;Logon Method:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family: 'Arial', 'sans-serif'; color: black; font-size: 8.5pt"&gt; Not yet determined &lt;br /&gt;
	&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8.5pt"&gt;Handler:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family: 'Arial', 'sans-serif'; color: black; font-size: 8.5pt"&gt; Not yet determined &lt;br /&gt;
	&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8.5pt"&gt;Config Error:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family: 'Arial', 'sans-serif'; color: black; font-size: 8.5pt"&gt; Cannot read configuration file &lt;br /&gt;
	&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8.5pt"&gt;Config File:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family: 'Arial', 'sans-serif'; color: black; font-size: 8.5pt"&gt;&amp;nbsp;~~ &lt;br /&gt;
	&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8.5pt"&gt;Config Source:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family: 'Arial', 'sans-serif'; color: black; font-size: 8.5pt"&gt; &lt;/span&gt;
	&lt;table border="0" cellpadding="0" class="MsoNormalTable" style="width: 100%; background: #ffffcc"&gt;
		&lt;tbody&gt;
			&lt;tr&gt;
				&lt;td style="background-color: transparent; border-color: #f0f0f0; padding: 0.75pt"&gt;
				&lt;p style="line-height: normal; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" class="MsoNormal"&gt;
				&lt;span style="font-family: 'Lucida Console'; color: black; font-size: 9pt"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;-1: &lt;/span&gt;
				&lt;/p&gt;
				&lt;span style="font-family: 'Lucida Console'; color: red; font-size: 9pt"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;0: &lt;/span&gt;&lt;span style="font-family: 'Lucida Console'; color: black; font-size: 9pt"&gt;&lt;/span&gt;&lt;/td&gt;
			&lt;/tr&gt;
		&lt;/tbody&gt;
	&lt;/table&gt;
	&lt;span style="font-family: 'Arial', 'sans-serif'; color: black; font-size: 8.5pt"&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=62293&amp;amp;IIS70Error=500,19,0x80070005,6000"&gt;&lt;span style="font-family: 'Times New Roman', 'serif'; color: blue; font-size: 12pt"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;strong&gt;&lt;u&gt;&lt;span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8.5pt"&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=62293&amp;amp;IIS70Error=500,19,0x80070005,6000"&gt;&lt;span style="color: black"&gt;More Information...&lt;/span&gt;&lt;span style="font-family: 'Arial', 'sans-serif'; color: blue; font-weight: normal"&gt; &lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;span style="font-family: 'Arial', 'sans-serif'; color: black; font-size: 8.5pt"&gt;This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Verdana', 'sans-serif'; color: maroon; font-size: 14pt"&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8.5pt"&gt;&lt;/span&gt;&lt;/strong&gt;&amp;nbsp; 
&lt;/blockquote&gt;
&lt;p&gt;
I was getting IIS 7 error 500.19 on Windows Server 2008 over the weekend, and when I discovered it I spent hours on this error. Google didn&amp;#39;t help; everyone pointed to invalid XML in the web.config or in applicationHost.config, or said that there must be an invalid DLL reference in applicationHost.config, or said that I need to add the proper users (IIS_IUSRs, Network Service, IUSR) to the directory and/or web.config. None of these solutions applied. There was nothing in my Windows event logs and enabling IIS tracing produced no log files. 
&lt;/p&gt;
&lt;p&gt;
It turned out to be a simple cause: the physical directory as configured in Basic Settings for the application was wrong. Why Microsoft did not include this rather obvious scenario &lt;a href="http://support.microsoft.com/default.aspx/kb/942055"&gt;in the Help file&lt;/a&gt; for this error is beyond me!! 
&lt;/p&gt;
&lt;p&gt;
In my case, my root web was working fine, but my subwebs were not working fine and I got this error for the subweb. The subweb was an individually configured ASP.NET application. I figured that this wasn&amp;#39;t important because the root web was just a flat HTML file, but it mattered. 
&lt;/p&gt;
&lt;p&gt;
What happened in my case&amp;nbsp;was that a few days ago I had relocated the root web, then updated IIS to point to the new directory. All of the subweb applications, however, were treated by IIS as virtual directories, each with its own physical directory mapping. So each had the stale path.&amp;nbsp;More specifically, I moved &amp;quot;C:\dir\www.mysite.com&amp;quot; to &amp;quot;C:\dir\mysite.com&amp;quot;, updated IIS for my site to point to \dir\mysite.com, and left it as such. The applications under ...\mysite.com were each pointing to the stale absolute path of&amp;nbsp;C:\dir\www.mysite.com\[application] instead of picking up the relative path of their parent directory. 
&lt;/p&gt;
&lt;p&gt;
I had to update each subweb application&amp;#39;s Basic Settings to point to the revised path, and the 500.19 error went away. 
&lt;/p&gt;
&lt;p&gt;
Hope this helps others like it would&amp;#39;ve helped me. 
&lt;/p&gt;
&lt;p&gt;
Jon 
&lt;/p&gt;
&lt;iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&amp;url=http://www.jondavis.net/techblog/post/2009/06/21/IIS-Subweb-Applications-Are-Virtual-Directories.aspx&amp;amp;title=IIS Subweb Applications Are Virtual Directories" height="25" width="155" scrolling="no" frameborder="0"&gt;&lt;/iframe&gt;&lt;img src="http://feeds.feedburner.com/~r/stimpy77/~4/AS9w3n-CUkU" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/stimpy77/~3/AS9w3n-CUkU/post.aspx</link>
      <author>jon.nospam@nospam.jondavis.net (Jon)</author>
      <comments>http://www.jondavis.net/techblog/post/2009/06/21/IIS-Subweb-Applications-Are-Virtual-Directories.aspx#comment</comments>
      <guid isPermaLink="false">http://www.jondavis.net/techblog/post.aspx?id=476e1a84-41c8-4490-a99b-5d2b7b2f80b1</guid>
      <pubDate>Sun, 21 Jun 2009 14:32:00 -0700</pubDate>
      <category>Servers and Services</category>
      <category>Web Development</category>
      <dc:publisher>Jon</dc:publisher>
      <pingback:server>http://www.jondavis.net/techblog/pingback.axd</pingback:server>
      <pingback:target>http://www.jondavis.net/techblog/post.aspx?id=476e1a84-41c8-4490-a99b-5d2b7b2f80b1</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.jondavis.net/techblog/trackback.axd?id=476e1a84-41c8-4490-a99b-5d2b7b2f80b1</trackback:ping>
      <wfw:comment>http://www.jondavis.net/techblog/post/2009/06/21/IIS-Subweb-Applications-Are-Virtual-Directories.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.jondavis.net/techblog/syndication.axd?post=476e1a84-41c8-4490-a99b-5d2b7b2f80b1</wfw:commentRss>
    <feedburner:origLink>http://www.jondavis.net/techblog/post.aspx?id=476e1a84-41c8-4490-a99b-5d2b7b2f80b1</feedburner:origLink></item>
    <item>
      <title>SQL Server Is Not Case Sensitive!! (Traumatically Humbling Note To Self)</title>
      <description>&lt;p&gt;
I don&amp;#39;t know if it&amp;#39;s a good idea for me to post this. This is so humiliating and humbling that I&amp;#39;m scared that anyone who might actually read my blog would consider me genuinely, well, &amp;quot;one who rides the short bus&amp;quot;.&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
But SQL Server is not case sensitive. I didn&amp;#39;t know that. I&amp;#39;ve been a web &amp;amp; app developer with SQL Server as my essential RDBMS for .. gosh, twelve years now. Yet, I&amp;#39;ve frequently used LOWER() and LIKE to try to nudge field/text comparisons to be case insensitive, yet this whole time I didn&amp;#39;t need to. SQL is not C#. 
&lt;/p&gt;
&lt;p&gt;
This guy speaks my words precisely.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.bennadel.com/blog/723-SQL-Server-Text-Matching-Is-Case-INSENSITIVE.htm"&gt;http://www.bennadel.com/blog/723-SQL-Server-Text-Matching-Is-Case-INSENSITIVE.htm&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Down to detail. &amp;quot;I am officially retarded,&amp;quot; indeed, that&amp;#39;s exactly how I feel. Well maybe if more people would blog this then less of us would feel so awful. 
&lt;/p&gt;
&lt;p&gt;
How to make it case sensitive? Here&amp;#39;s a sample: &lt;a href="http://blog.sqlauthority.com/2007/04/30/case-sensitive-sql-query-search/"&gt;http://blog.sqlauthority.com/2007/04/30/case-sensitive-sql-query-search/&lt;/a&gt; 
&lt;/p&gt;
&lt;iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&amp;url=http://www.jondavis.net/techblog/post/2009/06/15/SQL-Server-Is-Not-Case-Sensitive!!.aspx&amp;amp;title=SQL Server Is Not Case Sensitive!! (Traumatically Humbling Note To Self)" height="25" width="155" scrolling="no" frameborder="0"&gt;&lt;/iframe&gt;&lt;img src="http://feeds.feedburner.com/~r/stimpy77/~4/KnUcNiFzx_s" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/stimpy77/~3/KnUcNiFzx_s/post.aspx</link>
      <author>jon.nospam@nospam.jondavis.net (Jon)</author>
      <comments>http://www.jondavis.net/techblog/post/2009/06/15/SQL-Server-Is-Not-Case-Sensitive!!.aspx#comment</comments>
      <guid isPermaLink="false">http://www.jondavis.net/techblog/post.aspx?id=97b9b5c7-fa40-417e-968c-b6966ec17dbc</guid>
      <pubDate>Mon, 15 Jun 2009 22:29:00 -0700</pubDate>
      <category>SQL Server</category>
      <dc:publisher>Jon</dc:publisher>
      <pingback:server>http://www.jondavis.net/techblog/pingback.axd</pingback:server>
      <pingback:target>http://www.jondavis.net/techblog/post.aspx?id=97b9b5c7-fa40-417e-968c-b6966ec17dbc</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.jondavis.net/techblog/trackback.axd?id=97b9b5c7-fa40-417e-968c-b6966ec17dbc</trackback:ping>
      <wfw:comment>http://www.jondavis.net/techblog/post/2009/06/15/SQL-Server-Is-Not-Case-Sensitive!!.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.jondavis.net/techblog/syndication.axd?post=97b9b5c7-fa40-417e-968c-b6966ec17dbc</wfw:commentRss>
    <feedburner:origLink>http://www.jondavis.net/techblog/post.aspx?id=97b9b5c7-fa40-417e-968c-b6966ec17dbc</feedburner:origLink></item>
    <item>
      <title>SQL Server Express Edition and Dynamic Ports</title>
      <description>&lt;p&gt;While transferring to my new web host, I ran into a roadblock that had me stalled for a day or two while I tried to figure out what was going wrong. I like to use my own laptop here at home when managing SQL stuff, so I poked a special hole in the Windows Firewall on my new VPS instance to just allow my IP on port 1433, while enabling TCP/IP for SQL Server and restarting the service. But I could not connect!&lt;/p&gt;&lt;p&gt;I spent several hours poking at it, rebooting it, turning off the Windows firewall completely (temporarily), trying to get connected to that darn SQL Server instance I had installed on my new VPS, but it just would not connect. Then I noticed that the client tools (namely SSMS) on the VPS itself could not connect to ITSELF on the TCP/IP stack, it could only connect on Shared Memory or Named Pipes. What is going on?!! Could it be a bad OS image on the VPS?&lt;/p&gt;&lt;p&gt;Eventually it got resolved. The VPS hosting company was very helpful in assisting me on the matter, and at the same time I got some replies on&amp;nbsp;&lt;a href="http://www.sqlservercentral.com/Forums/Topic718583-391-1.aspx"&gt;a SQLServerCentral.com forum post&lt;/a&gt;&amp;nbsp;that narrowed down to the same problem: Dynamic Ports.&lt;/p&gt;&lt;p&gt;This SQLServerCentral.com forum reply was the critical new knowledge for this weekend.&lt;/p&gt;&lt;blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px"&gt;				&lt;em&gt;Hello Jon,&lt;/em&gt;&lt;/blockquote&gt;&lt;blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px"&gt;				&lt;em&gt;&lt;br /&gt;				&lt;/em&gt;&lt;/blockquote&gt;&lt;blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px"&gt;				&lt;em&gt;SQL Server Express (2005 &amp;amp; 2008) defaults to Dynamic Ports, whereas the Default Instance of other Editions listen on Static Port 1433 (by default).&amp;nbsp;&lt;/em&gt;&lt;/blockquote&gt;&lt;blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px"&gt;				&lt;em&gt;&lt;br /&gt;				&lt;/em&gt;&lt;/blockquote&gt;&lt;blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px"&gt;				&lt;em&gt;Having a Zero in the Dynamic Port configuration will have been overriding the Static Port that you entered, and therefore causing your connection problems.&lt;/em&gt;&lt;/blockquote&gt;&lt;blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px"&gt;				&lt;em&gt;&lt;br /&gt;				&lt;/em&gt;&lt;/blockquote&gt;&lt;blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px"&gt;				&lt;em&gt;Regards,&lt;/em&gt;&lt;/blockquote&gt;&lt;blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px"&gt;				&lt;em&gt;&lt;br /&gt;				&lt;/em&gt;&lt;/blockquote&gt;&lt;blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px"&gt;				&lt;em&gt;John Marsh&amp;nbsp;&lt;/em&gt;&lt;/blockquote&gt;&lt;blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-width: initial; border-color: initial; border-style: none; padding: 0px"&gt;				&amp;nbsp;&lt;/blockquote&gt;&lt;p&gt;I&amp;#39;d never heard of dynamic ports before. And the reason why I&amp;#39;ve never run into this issue before was because I&amp;#39;ve always used the full version of SQL Server that comes with MSDN licenses, and that version, by default, does not use dynamic ports by default, it uses Port 1433, which I expected SQL Server to default to in my case. But for both SQL Server 2005 and SQL Server 2008, the Express edition defaults to use Dynamic Ports when TCP/IP connections are enabled. So all my setting of Port 1433 in the Configuration Manager was completely ignored because it switched right back over to Dynamic Ports. To make things even more confusing, to enable Dynamic Ports, the setting is set to &amp;#39;0&amp;#39;. That&amp;#39;s &amp;#39;0&amp;#39;, as in the programmatic standard for FALSE, just not in this case, as is thoroughly documented in SQL Server documentation. Heh heh.&lt;/p&gt;&lt;p&gt;So with the Dynamic Ports&amp;#39; setting of &amp;#39;0&amp;#39; &lt;em&gt;removed&lt;/em&gt;, I&amp;#39;m up and running. And now this blog (not to mention other, more legitimate sites I run [sic?]) is &lt;em&gt;finally&lt;/em&gt;&amp;nbsp;(as of Sunday afternoon) moved off my home PC and onto my new VPS.&lt;/p&gt;&lt;iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&amp;url=http://www.jondavis.net/techblog/post/2009/05/17/SQL-Server-Express-Edition-and-Dynamic-Ports.aspx&amp;amp;title=SQL Server Express Edition and Dynamic Ports" height="25" width="155" scrolling="no" frameborder="0"&gt;&lt;/iframe&gt;&lt;img src="http://feeds.feedburner.com/~r/stimpy77/~4/IkzwAxPzIgg" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/stimpy77/~3/IkzwAxPzIgg/post.aspx</link>
      <author>jon.nospam@nospam.jondavis.net (Jon)</author>
      <comments>http://www.jondavis.net/techblog/post/2009/05/17/SQL-Server-Express-Edition-and-Dynamic-Ports.aspx#comment</comments>
      <guid isPermaLink="false">http://www.jondavis.net/techblog/post.aspx?id=f03b9116-6b1d-4c8a-94b0-ba240e634b9b</guid>
      <pubDate>Sun, 17 May 2009 14:13:00 -0700</pubDate>
      <category>Servers and Services</category>
      <category>SQL Server</category>
      <dc:publisher>Jon</dc:publisher>
      <pingback:server>http://www.jondavis.net/techblog/pingback.axd</pingback:server>
      <pingback:target>http://www.jondavis.net/techblog/post.aspx?id=f03b9116-6b1d-4c8a-94b0-ba240e634b9b</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.jondavis.net/techblog/trackback.axd?id=f03b9116-6b1d-4c8a-94b0-ba240e634b9b</trackback:ping>
      <wfw:comment>http://www.jondavis.net/techblog/post/2009/05/17/SQL-Server-Express-Edition-and-Dynamic-Ports.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.jondavis.net/techblog/syndication.axd?post=f03b9116-6b1d-4c8a-94b0-ba240e634b9b</wfw:commentRss>
    <feedburner:origLink>http://www.jondavis.net/techblog/post.aspx?id=f03b9116-6b1d-4c8a-94b0-ba240e634b9b</feedburner:origLink></item>
    <item>
      <title>So Long, Farewell</title>
      <description>&lt;p&gt;No I&amp;#39;m not killing off my blog. I am, however, going to stop being so cheap, and start hosting my IIS web apps, including this blog, on an external server for a change. &lt;/p&gt;&lt;p&gt;For years now I&amp;#39;ve been hosting my blog here behind a home cable modem. As I post this--indeed this&amp;#39;ll be the last night that this will be the case--I have a cheap virtual dedicated Linux server with Apache proxying out to my home IP on an alternate port. COX only blocks port 80 (the web port, and some other ones like SMTP&amp;#39;s), so I have my router at home rigged to redirect traffic on the alternate port back to port 80 and to my internal web server&amp;#39;s IP address (this is the same server that &amp;quot;serves&amp;quot; me prerecorded shows on my HDTV via Vista Media Center). The proxy/router setup works, but then COX keeps killing off my Internet connection. I keep having to stand up, go to the back room where the cable modem is, disconnect the cable modem power and coax, wait for 5 seconds, and reconnect everything. (Yes, the coax, too. It doesn&amp;#39;t resync unless I do that.) &lt;/p&gt;&lt;p&gt;My web site tends to go offline all day while I&amp;#39;m at work. I&amp;#39;ve noticed that the disconnects happen routinely&amp;nbsp;at about 3:15 PM and at about 1:45 AM, but they also happen erratically and sporatically throughout the day, and it often stays offline until human intervention (manual shutoff and powerup). And, I am beginning to suspect that they are actually monitoring network traffic and they disconnect me when they see any normal flood of inbound HTTP requests that come from two or more visitors at a time.&amp;nbsp;It might also be heat-related; the disconnects are suddenly much more frequent lately, and coincidentally it&amp;#39;s suddenly a lot hotter around here in this Arizona climate. &lt;/p&gt;&lt;p&gt;So I&amp;#39;m finally caving in; short of tunnelling the proxied HTTP packets, I&amp;nbsp;can&amp;#39;t beat&amp;nbsp;COX at this game. I&amp;#39;m going to try a VPS from &lt;a href="http://www.automatedvps.com/about.php"&gt;http://www.automatedvps.com/about.php&lt;/a&gt;&amp;nbsp;.. They look like an under-established outfit but so far they are not just affordable for Win2008 virtual dedicated hosting, the VPS I&amp;#39;ve already snagged feels&amp;nbsp;quite performant. I&amp;#39;ll have all the Windows play dough I could ask for, and I won&amp;#39;t have to worry about my blog or any major web site I might be hosting going offline because COX wants to keep us from hosting stuff. &lt;/p&gt;&lt;p&gt;Incidentally, before signing up with AutomatedVPS.com, I tried Mosso.com&amp;#39;s Site Cloud. I&amp;#39;d been slobbering over their Kool Aid for so long, I had to give them a shot. It was ugly, though. Their control panel behaves erratically, frequently showing multiples of new objects being added until you refresh or until a Live Chat support staff deletes the extras. I had to throw the whole thing out when I saw that I had NO control over IIS 7 and the subweb applications and application pools.&lt;/p&gt;&lt;p&gt;------&lt;/p&gt;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: Ouch. Yeah, that took a lil more time than I expected to transfer everything (see next post re SQL Express and Dynamic Ports), but it&amp;#39;s switched now.&amp;nbsp;&lt;/p&gt;&lt;iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&amp;url=http://www.jondavis.net/techblog/post/2009/05/15/So-Long-Farewell.aspx&amp;amp;title=So Long, Farewell" height="25" width="155" scrolling="no" frameborder="0"&gt;&lt;/iframe&gt;&lt;img src="http://feeds.feedburner.com/~r/stimpy77/~4/eSTftBF91qU" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/stimpy77/~3/eSTftBF91qU/post.aspx</link>
      <author>jon.nospam@nospam.jondavis.net (Jon)</author>
      <comments>http://www.jondavis.net/techblog/post/2009/05/15/So-Long-Farewell.aspx#comment</comments>
      <guid isPermaLink="false">http://www.jondavis.net/techblog/post.aspx?id=cd2de091-abc0-4852-900e-eff728936992</guid>
      <pubDate>Fri, 15 May 2009 02:10:00 -0700</pubDate>
      <category>Servers and Services</category>
      <category>Web Development</category>
      <dc:publisher>Jon</dc:publisher>
      <pingback:server>http://www.jondavis.net/techblog/pingback.axd</pingback:server>
      <pingback:target>http://www.jondavis.net/techblog/post.aspx?id=cd2de091-abc0-4852-900e-eff728936992</pingback:target>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://www.jondavis.net/techblog/trackback.axd?id=cd2de091-abc0-4852-900e-eff728936992</trackback:ping>
      <wfw:comment>http://www.jondavis.net/techblog/post/2009/05/15/So-Long-Farewell.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.jondavis.net/techblog/syndication.axd?post=cd2de091-abc0-4852-900e-eff728936992</wfw:commentRss>
    <feedburner:origLink>http://www.jondavis.net/techblog/post.aspx?id=cd2de091-abc0-4852-900e-eff728936992</feedburner:origLink></item>
    <item>
      <title>My ‘Aha!’ Moment With Javascript</title>
      <description>&lt;p&gt;For most people this goes back to Javascript 101 but it’s worth blogging, in my opinion. A lot of people truly have no idea how much power is available on the client side of web apps, and they actually think that Javascript is dying.&lt;/p&gt;  &lt;p&gt;The true power of Javascript was not made known to me until I had my aha! moment. It was about two or three years ago, and I think I could sum up (profusely, with freeze-dried concentration) what triggered my realization when these two essential facts became clear:&lt;/p&gt;  &lt;h2&gt;Discovery #1:&lt;/h2&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:972b02ff-30cf-438d-9e76-d4beb1e70fa2" class="wlWriterSmartContent"&gt;   &lt;pre class="js" name="code"&gt;var myFunc = function() { };
var myObj = new myFunc();&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;.. is to Javascript what this is to C# .. &lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:e90abd49-fab1-4161-a9f2-30c4a1dca62c" class="wlWriterSmartContent"&gt;
  &lt;pre class="c#" name="code"&gt;public class MyClass 
{
	public MyClass() { } 
}
MyClass myObj = new MyClass();&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;That is to say, Javascript functions are functions (of course) but also “classes” (object prototypes) and constructors all rolled into one. So, for example, to accomplish this in C# ..&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:20d5e300-fc55-4dc9-aac5-377e64acf79f" class="wlWriterSmartContent"&gt;
  &lt;pre class="c#" name="code"&gt;class MyClass {
	void DoSomething() {
		MessageBox.Show(&amp;quot;something&amp;quot;);
	}
}

... 

MyClass myObj = new MyClass();
myObj.DoSomething();&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;.. you could do this in Javascript ..&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:221ebc5d-af02-44b6-a721-e27befef6b15" class="wlWriterSmartContent"&gt;
  &lt;pre class="js" name="code"&gt;function myFunc() { }

myFunc.prototype.doSomething = function() {
	alert('something');
};

...

var myObj = new myFunc();
myObj.doSomething();&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Or, you could assign the &lt;em&gt;doSomething&lt;/em&gt; member function “at runtime” (dynamically appending the member to the object after the object has already been instantiated).&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:af6715b3-fd3c-4908-addc-fbed4cf5f428" class="wlWriterSmartContent"&gt;
  &lt;pre class="js" name="code"&gt;var myFunc = new function() {
	this.doSomething = function() {
		alert('something');
	};
};

var myObj = new myFunc();
myObj.doSomething();


// or even


myObj.doSomethingElse = function() { alert('something else'); };
myObj.doSomethingElse();&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Note that ‘this’ is used to reference the object instance that the function instance is. Incidentally, you can ensure “this” works when calling other objects’ functions by using &lt;em&gt;function_name&lt;/em&gt;.call(&lt;em&gt;object&lt;/em&gt;, &lt;em&gt;params)&lt;/em&gt;;.&lt;/p&gt;

&lt;p&gt;That said, these things point out the dynamic nature of Javascript object members – you can append properties and functions to an object at runtime by using syntax like [object].doSomething = function() { }. It also shows that members on an object are akin to a string-keyed hashtable.&lt;/p&gt;

&lt;p&gt;And that hashtable-like behavior brings about the second part of my “aha!” moment.&lt;/p&gt;

&lt;h2&gt;Discovery #2:&lt;/h2&gt;

&lt;p&gt;All user-defined objects, including functions, are ultimately string-keyed hashtables. That is not a limiting behavior but an &lt;em&gt;extra feature&lt;/em&gt; because they are still real objects.&lt;/p&gt;

&lt;p&gt;But JSON (Javascript object notation) objects are extraordinarily handy as alternatives to functions because of the expressive way you can declare them.&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:85d34943-5306-435f-a124-ee910d8b0512" class="wlWriterSmartContent"&gt;
  &lt;pre class="js" name="code"&gt;var myNewObject = {
	member_A : &amp;quot;abc&amp;quot;,
	member_B : 123
};&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;.. is akin to C#’s ..&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:16da00cc-f4dd-4ef2-8755-6f8d12bb688d" class="wlWriterSmartContent"&gt;
  &lt;pre class="c#" name="code"&gt;Dictionary&amp;lt;string, object&amp;gt; myNewObject = new Dictionary&amp;lt;string, object&amp;gt;();
myNewObject[&amp;quot;member_A&amp;quot;] = &amp;quot;abc&amp;quot;;
myNewObject[&amp;quot;member_B&amp;quot;] = 123;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;And it’s even more powerful when you consider that the members can be functions.&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:0a39ed9d-c4fb-415e-87f5-35e02b10345f" class="wlWriterSmartContent"&gt;
  &lt;pre class="js" name="code"&gt;myNewObject = {
	doSomething: function() {
		alert('something');
	}
};
myNewObject.doSomething(); // invoke

// or,

myNewObject = { };
myNewObject.doSomething = function() {
	alert('something');
};
myNewObject.doSomething(); // invoke&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;.. can be implemented in C# 3.0 like so ..&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:11179542-d1b6-4334-be74-e565d75e07bf" class="wlWriterSmartContent"&gt;
  &lt;pre class="c#" name="code"&gt;delegate void SimpleMethod();
public static void RunSnippet()
{
	var myNewObject = new Dictionary&amp;lt;string, object&amp;gt;();
	myNewObject[&amp;quot;doSomething&amp;quot;] = (SimpleMethod)(() =&amp;gt;
		MessageBox.Show(&amp;quot;something&amp;quot;)
	);
	
	// .. 
	
	((SimpleMethod)myNewObject[&amp;quot;doSomething&amp;quot;])(); // invoke
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;In fact, take a look at this old blog post I saw at Ajaxian.com: &lt;a title="http://colinramsay.co.uk/diary/2008/04/02/javascript-generation-a-change-of-heart/" href="http://colinramsay.co.uk/diary/2008/04/02/javascript-generation-a-change-of-heart/"&gt;http://colinramsay.co.uk/diary/2008/04/02/javascript-generation-a-change-of-heart/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In return, comparing the two languages reveals the power of C# 3.0, as well. C# 4.0’s dynamic objects will be trying even harder to “be powerful like Javascript already was”. &lt;/p&gt;

&lt;p&gt;*evil grin*&lt;/p&gt;&lt;iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&amp;url=http://www.jondavis.net/techblog/post/2009/05/14/My-e28098Aha!e28099-Moment-With-Javascript.aspx&amp;amp;title=My ‘Aha!’ Moment With Javascript" height="25" width="155" scrolling="no" frameborder="0"&gt;&lt;/iframe&gt;&lt;img src="http://feeds.feedburner.com/~r/stimpy77/~4/FQpXEHm9r4s" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/stimpy77/~3/FQpXEHm9r4s/post.aspx</link>
      <author>jon.nospam@nospam.jondavis.net (Jon)</author>
      <comments>http://www.jondavis.net/techblog/post/2009/05/14/My-e28098Aha!e28099-Moment-With-Javascript.aspx#comment</comments>
      <guid isPermaLink="false">http://www.jondavis.net/techblog/post.aspx?id=582c3ecb-1c53-437c-86f9-3efeee9b96d6</guid>
      <pubDate>Thu, 14 May 2009 01:25:42 -0700</pubDate>
      <category>Web Development</category>
      <category>Software Development</category>
      <dc:publisher>Jon</dc:publisher>
      <pingback:server>http://www.jondavis.net/techblog/pingback.axd</pingback:server>
      <pingback:target>http://www.jondavis.net/techblog/post.aspx?id=582c3ecb-1c53-437c-86f9-3efeee9b96d6</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.jondavis.net/techblog/trackback.axd?id=582c3ecb-1c53-437c-86f9-3efeee9b96d6</trackback:ping>
      <wfw:comment>http://www.jondavis.net/techblog/post/2009/05/14/My-e28098Aha!e28099-Moment-With-Javascript.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.jondavis.net/techblog/syndication.axd?post=582c3ecb-1c53-437c-86f9-3efeee9b96d6</wfw:commentRss>
    <feedburner:origLink>http://www.jondavis.net/techblog/post.aspx?id=582c3ecb-1c53-437c-86f9-3efeee9b96d6</feedburner:origLink></item>
    <item>
      <title>Quickie Alarm</title>
      <description>&lt;p&gt;I flew out to California on Friday night to visit my siblings, and when I arrived I rented a car and drove around in the middle of the night looking for a cheap place to sleep. After an hour of getting completely lost I finally found a Motel 6 (*shudder*), climbed into bed, and then realized that there’s no alarm clock in the room. Great.&lt;/p&gt;  &lt;p&gt;So I threw together another alarm clock on my laptop. I went through the trouble of giving it a nice touch, so it took an hour or two rather than a minute or two, but it did the job and I was proud and still managed to sleep well.&lt;/p&gt;  &lt;p&gt;And now I’m sharing it here online. This is freeware with source code included. (Uses free &lt;a href="http://www.devexpress.com/Downloads/NET/" target="_blank"&gt;Developer Express&lt;/a&gt; controls.)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.jondavis.net/techblog/image.axd?picture=WindowsLiveWriter/QuickieAlarm/519AA81F/image.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.jondavis.net/techblog/image.axd?picture=WindowsLiveWriter/QuickieAlarm/09D91F38/image_thumb.png" width="278" height="160" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;.. click ‘Go’ and ..&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.jondavis.net/techblog/image.axd?picture=WindowsLiveWriter/QuickieAlarm/6E39CD8E/image.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.jondavis.net/techblog/image.axd?picture=WindowsLiveWriter/QuickieAlarm/46935164/image_thumb.png" width="275" height="365" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Download: &lt;a href="http://www.jondavis.net/codeprojects/QuickieAlarm/QuickieAlarm.zip"&gt;http://www.jondavis.net/codeprojects/QuickieAlarm/QuickieAlarm.zip&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&amp;url=http://www.jondavis.net/techblog/post/2009/05/13/Quickie-Alarm.aspx&amp;amp;title=Quickie Alarm" height="25" width="155" scrolling="no" frameborder="0"&gt;&lt;/iframe&gt;&lt;img src="http://feeds.feedburner.com/~r/stimpy77/~4/04PTrGFeNy0" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/stimpy77/~3/04PTrGFeNy0/post.aspx</link>
      <author>jon.nospam@nospam.jondavis.net (Jon)</author>
      <comments>http://www.jondavis.net/techblog/post/2009/05/13/Quickie-Alarm.aspx#comment</comments>
      <guid isPermaLink="false">http://www.jondavis.net/techblog/post.aspx?id=6d6bf8bb-3ca2-427c-8f10-95edd24648ca</guid>
      <pubDate>Wed, 13 May 2009 23:39:27 -0700</pubDate>
      <category>Open Source</category>
      <category>Cool Tools</category>
      <category>Pet Projects</category>
      <dc:publisher>Jon</dc:publisher>
      <pingback:server>http://www.jondavis.net/techblog/pingback.axd</pingback:server>
      <pingback:target>http://www.jondavis.net/techblog/post.aspx?id=6d6bf8bb-3ca2-427c-8f10-95edd24648ca</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.jondavis.net/techblog/trackback.axd?id=6d6bf8bb-3ca2-427c-8f10-95edd24648ca</trackback:ping>
      <wfw:comment>http://www.jondavis.net/techblog/post/2009/05/13/Quickie-Alarm.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.jondavis.net/techblog/syndication.axd?post=6d6bf8bb-3ca2-427c-8f10-95edd24648ca</wfw:commentRss>
    <feedburner:origLink>http://www.jondavis.net/techblog/post.aspx?id=6d6bf8bb-3ca2-427c-8f10-95edd24648ca</feedburner:origLink></item>
    <item>
      <title>Set Up IIS For An MVC App: When All Else Fails, Check View Config</title>
      <description>&lt;p&gt;I got stumped today when trying to set up a CruiseControl.NET+RoboCopy powered development server deployment for an ASP.NET MVC web app. I set up MVC Framework (gets MVC into the GAC), did the wildcarding in the IIS app config, and everything worked fine, except for strongly typed views. I was confounded. The Event Viewer showed: &lt;/p&gt;  &lt;blockquote&gt;Exception information:    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Exception type: HttpParseException     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Exception message: Could not load type 'MyMvcApp.ViewPage&amp;lt;MyModel&amp;gt;'. &lt;/blockquote&gt;  &lt;p&gt;This turned out to be caused by a simple mistake. After cc.net compiles the app, RoboCopy copies all the .aspx files over to the web app, and ignores the .cs files, the .config files, etc., so that the .config files don’t get overwritten. I had manually deployed the main web.config file for the app, but I forgot that the Views directory &lt;em&gt;also&lt;/em&gt; has a web.config. &lt;/p&gt;  &lt;p&gt;Why there is a web.config in the Views directory, I don’t know yet. But the extra .config file in the Views directory is absolutely mandatory to get an MVC app working on IIS, or at least on IIS 6 anyway (haven’t tried 7). &lt;/p&gt;&lt;iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&amp;url=http://www.jondavis.net/techblog/post/2009/04/29/Set-Up-IIS-For-An-MVC-App-When-All-Else-Fails-Check-View-Config.aspx&amp;amp;title=Set Up IIS For An MVC App: When All Else Fails, Check View Config" height="25" width="155" scrolling="no" frameborder="0"&gt;&lt;/iframe&gt;&lt;img src="http://feeds.feedburner.com/~r/stimpy77/~4/l5fzDrUgxT4" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/stimpy77/~3/l5fzDrUgxT4/post.aspx</link>
      <author>jon.nospam@nospam.jondavis.net (Jon)</author>
      <comments>http://www.jondavis.net/techblog/post/2009/04/29/Set-Up-IIS-For-An-MVC-App-When-All-Else-Fails-Check-View-Config.aspx#comment</comments>
      <guid isPermaLink="false">http://www.jondavis.net/techblog/post.aspx?id=e8a6f3d6-0401-4f87-ac90-332436c9879f</guid>
      <pubDate>Wed, 29 Apr 2009 17:22:00 -0700</pubDate>
      <category>Web Development</category>
      <category>Software Development</category>
      <dc:publisher>Jon</dc:publisher>
      <pingback:server>http://www.jondavis.net/techblog/pingback.axd</pingback:server>
      <pingback:target>http://www.jondavis.net/techblog/post.aspx?id=e8a6f3d6-0401-4f87-ac90-332436c9879f</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://www.jondavis.net/techblog/trackback.axd?id=e8a6f3d6-0401-4f87-ac90-332436c9879f</trackback:ping>
      <wfw:comment>http://www.jondavis.net/techblog/post/2009/04/29/Set-Up-IIS-For-An-MVC-App-When-All-Else-Fails-Check-View-Config.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.jondavis.net/techblog/syndication.axd?post=e8a6f3d6-0401-4f87-ac90-332436c9879f</wfw:commentRss>
    <feedburner:origLink>http://www.jondavis.net/techblog/post.aspx?id=e8a6f3d6-0401-4f87-ac90-332436c9879f</feedburner:origLink></item>
    <item>
      <title>Visual Studio 2008 Crashes When Using ASP.NET MVC (Nasty, NASTY Bug!)</title>
      <description>&lt;p&gt;Some people (like me) have had issues with Visual Studio 2008 suddenly disappearing without errors when the developer user opens up an .aspx file, a .master file, or some other code file in an ASP.NET MVC project.&lt;/p&gt;  &lt;p&gt;Had this show stopping issue beat me black and blue over the last 24 hours. I finally got past it when I used the /safemode switch with devenv.exe, but that disables all my lovely add-ins like Resharper. :(&lt;/p&gt;  &lt;p&gt;Finally, one of the team members pointed me to “NDP20SP2-KB963676-x86.exe”. He had the same issue and tried to run this hotfix and it worked for him. &lt;/p&gt;  &lt;p&gt;It seems to be working so far for me, too. The hotfix is here:&lt;/p&gt;  &lt;p&gt;&lt;a title="https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=16827&amp;amp;wa=wsignin1.0" href="https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=16827&amp;amp;wa=wsignin1.0"&gt;https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=16827&amp;amp;wa=wsignin1.0&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;File for Windows XP: NDP20SP2-KB963676-x86.exe&lt;/p&gt;  &lt;p&gt;More info here: &lt;a href="http://www.google.com/search?q=KB963676"&gt;http://www.google.com/search?q=KB963676&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&amp;url=http://www.jondavis.net/techblog/post/2009/04/16/Visual-Studio-2008-Crashes-When-Using-ASPNET-MVC-(Nasty-NASTY-Bug!).aspx&amp;amp;title=Visual Studio 2008 Crashes When Using ASP.NET MVC (Nasty, NASTY Bug!)" height="25" width="155" scrolling="no" frameborder="0"&gt;&lt;/iframe&gt;&lt;img src="http://feeds.feedburner.com/~r/stimpy77/~4/WaT5sIfocJY" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/stimpy77/~3/WaT5sIfocJY/post.aspx</link>
      <author>jon.nospam@nospam.jondavis.net (Jon)</author>
      <comments>http://www.jondavis.net/techblog/post/2009/04/16/Visual-Studio-2008-Crashes-When-Using-ASPNET-MVC-(Nasty-NASTY-Bug!).aspx#comment</comments>
      <guid isPermaLink="false">http://www.jondavis.net/techblog/post.aspx?id=3774b98b-053c-4f72-a122-87e5b3a6da6c</guid>
      <pubDate>Thu, 16 Apr 2009 10:05:35 -0700</pubDate>
      <category>Web Development</category>
      <category>Software Development</category>
      <dc:publisher>Jon</dc:publisher>
      <pingback:server>http://www.jondavis.net/techblog/pingback.axd</pingback:server>
      <pingback:target>http://www.jondavis.net/techblog/post.aspx?id=3774b98b-053c-4f72-a122-87e5b3a6da6c</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.jondavis.net/techblog/trackback.axd?id=3774b98b-053c-4f72-a122-87e5b3a6da6c</trackback:ping>
      <wfw:comment>http://www.jondavis.net/techblog/post/2009/04/16/Visual-Studio-2008-Crashes-When-Using-ASPNET-MVC-(Nasty-NASTY-Bug!).aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.jondavis.net/techblog/syndication.axd?post=3774b98b-053c-4f72-a122-87e5b3a6da6c</wfw:commentRss>
    <feedburner:origLink>http://www.jondavis.net/techblog/post.aspx?id=3774b98b-053c-4f72-a122-87e5b3a6da6c</feedburner:origLink></item>
    <item>
      <title>AJAX Deferred Loader for ASP.NET</title>
      <description>&lt;p&gt;Here’s a simple ASP.NET control that takes a URL parameter, renders a placeholder on the page, and uses Javascript to “lazy-load” the view content for that placeholder area. It basically does what &lt;a href="http://www.sprinklejs.com/" target="_blank"&gt;my sprinkle.js&lt;/a&gt; did a long while back, but it takes advantage of ASP.NET controls and jQuery simplicity with &lt;a href="http://docs.jquery.com/Ajax/load" target="_blank"&gt;its load() function&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;It also has self-refreshing. This is good for updating a section of a page with progress information, without refreshing the entire page.&lt;/p&gt;  &lt;p&gt;To use it, &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Compile the source code (below) to your Web Application project’s assembly, or create an assembly and reference the assembly in your project. You should put this control in its own namespace or in a “.Controls” namespace because of #2 below. &lt;/li&gt;    &lt;li&gt;Add a header to any page that would use it to explicitly import all controls under the namespace for which you’re using this control.      &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:18d4a04e-a724-47f2-9f48-9ef307d21b18" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="xml"&gt;&amp;lt;%@ Register Assembly="MvcApplication1" Namespace="MvcApplication1.Controls" TagPrefix="demo" %&amp;gt;&lt;/pre&gt;&lt;/div&gt;
  &lt;/li&gt;

  &lt;li&gt;Be sure jQuery is referenced on the page, ideally in the &amp;lt;head&amp;gt; tag. If you’re using Web Forms and &amp;lt;head runat=”server”&amp;gt;, the process of getting it in there is a little complicated but that’s a different topic. I’m using ASP.NET MVC and I just put it in the Master page. Ultimately, jQuery needs to be loaded before anything else loads, that’s your objective, so you figure it out. 
    &lt;br /&gt;

    &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:a53a069a-5984-4bbc-8445-83c57d78e28c" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="xml"&gt;&amp;lt;html&amp;gt;&amp;lt;!-- ... --&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;!-- ... --&amp;gt;
  &amp;lt;script language="javascript" type="text/javascript" src="../../Scripts/jquery-1.3.2.min-vsdoc.js"&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script language="javascript" type="text/javascript" src="&amp;lt;%=ResolveUrl("~/Scripts/jquery-1.3.2.min.js") %&amp;gt;"&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;!-- ... --&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;&amp;lt;!-- ... --&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/pre&gt;&lt;/div&gt;
  &lt;/li&gt;

  &lt;li&gt;Now you can reference inline. Note the “RefreshInterval” setting, which is an integer that indicates, in seconds, how often to refresh the region. In this sample, it updates every two seconds. Note also that the HTML that comes back from the referenced URL can include script markup that cancels the interval, such as if a process has completed. 
    &lt;br /&gt;&amp;#160; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:0d183885-efa8-4794-bbdf-5427c1eda070" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="xml"&gt;&amp;lt;demo:AjaxDeferredView runat="server" ViewUrl="~/Deferred" RefreshInterval="2"&amp;gt;
    &amp;lt;asp:Panel runat="server"&amp;gt;Please wait ...&amp;lt;/asp:Panel&amp;gt;
&amp;lt;/demo:AjaxDeferredView&amp;gt;&lt;/pre&gt;&lt;/div&gt;
  &lt;/li&gt;

  &lt;li&gt;This is what gets outputted with the above tag. Note the “undefined, undefined” are there because the PostData and the Callback optional properties are not set on the control tag. 
    &lt;br /&gt;

    &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:0a03925c-9890-47b6-a8d9-ea31337b8c8a" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="xml"&gt;&amp;lt;div id="ctl00_MainContent_ctl00"&amp;gt;
    &amp;lt;div&amp;gt;
		Please wait ...
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;script language="javascript" type="text/javascript"&amp;gt;&amp;lt;!--
$(document).ready(function() {
	window['ctl00_MainContent_ctl00_interval'] = setInterval(function() {
		$('#ctl00_MainContent_ctl00').load('http://localhost:5577/Deferred', undefined, undefined);
	}, 2000);
	$('#ctl00_MainContent_ctl00').load('http://localhost:5577/Deferred');
});
--&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;/div&gt;
  &lt;/li&gt;

  &lt;li&gt;And finally, what the end user will actually see is a momentary, split-second, or too-fast-to-see placeholder being swapped out for the content at the loaded URL. &lt;/li&gt;

  &lt;li&gt;Here’s an example of how to clear that interval in the sample ~/Deferred view that comes back, such as if a process has completed, or in this case after the 5th hit (from any visitor). This sample might be the actual page that is invoked from the AJAX call.&amp;#160; Note the ClearParentInterval control, and that the logic that changes its ClearInterval property precedes its position on the page. 
    &lt;br /&gt;

    &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:fbe90fbf-3f4d-4831-a7fa-1c2dd5cae5a5" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="xml"&gt;&amp;lt;%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage" %&amp;gt;
&amp;lt;%@ Register Assembly="MvcApplication1" Namespace="MvcApplication1.Controls" TagPrefix="demo" %&amp;gt;
&amp;lt;% Response.Cache.SetCacheability(HttpCacheability.NoCache); %&amp;gt;
Welcome to my deferred content. 
&amp;lt;%
    
    //live counter
    var i = (int)(Context.Application["defercnt"] ?? 0);
    i++;
    Context.Application["defercnt"] = i;
    %&amp;gt;&amp;lt;%=i %&amp;gt;
    
&amp;lt;% if (i &amp;gt;= 5) // shutdown interval after 5 views
 {
     ClearIntervalControl.ClearInterval = true;
 } %&amp;gt;
 &amp;lt;demo:ClearParentInterval runat="server" ID="ClearIntervalControl" /&amp;gt;
&lt;/pre&gt;&lt;/div&gt;

    &lt;br /&gt;This outputs the following when ClearInterval is set to &lt;em&gt;true&lt;/em&gt;. The point of the example is in the ID’ing of the &amp;lt;span&amp;gt; tag and in the &amp;lt;script&amp;gt; tag’s contents. It basically walks up the DOM tree by one parent to get the placeholder’s ID in the DOM, then tacks on “_interval” and assumes that to be the name of the interval (which it is). 

    &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:c8d8d40c-f4a6-47b8-b70e-1ef6959c944c" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="xml"&gt;&amp;lt;div&amp;gt;Welcome to my deferred content. 5&amp;lt;/div&amp;gt;
    
&amp;lt;span id="ClearIntervalControl"&amp;gt;
&amp;lt;/span&amp;gt;
&amp;lt;script type="text/javascript" language="javascript"&amp;gt;
	var ClearIntervalControl_ClearIntervalParentRef = $('#ClearIntervalControl').parent().attr('id') + '_interval';
	if (window[ClearIntervalControl_ClearIntervalParentRef]) {
		clearInterval(window[ClearIntervalControl_ClearIntervalParentRef]);
	}
&amp;lt;/script&amp;gt;
&lt;/pre&gt;&lt;/div&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here’s the control source:&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:6451d21c-0c54-406e-822c-7d6b8d21becf" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="c#"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;

namespace MvcApplication1.Controls
{
    public class AjaxDeferredView : System.Web.UI.Control
    {
        protected override void OnInit(EventArgs e)
        {
            if (string.IsNullOrEmpty(ContainerTag))
                ContainerTag = "div";
        }

        protected override void Render(HtmlTextWriter writer)
        {
            writer.WriteLine();
            writer.WriteBeginTag(ContainerTag);
            writer.WriteAttribute("id", ClientID);
            writer.Write("&amp;gt;");
            base.Render(writer);
            writer.WriteEndTag(ContainerTag);
            writer.WriteLine();
            writer.WriteLine("&amp;lt;script language=\"javascript\" type=\"text/javascript\"&amp;gt;&amp;lt;!--");
            writer.WriteLine("$(document).ready(function() {");
            if (RefreshInterval &amp;gt; 0)
            {
                writer.WriteLine("\twindow['" + this.ClientID + "_interval']"
                    + " = setInterval(function() {");
                writer.WriteLine("\t\t$('#" + this.ClientID + "').load('"
                    + ResolveFullUrl(this.ViewUrl) + "', " 
                    + GetDataArg() + ", " + GetCallbackArg() + ");");
                writer.WriteLine("\t}, " + RefreshInterval * 1000 + ");");
            }
            writer.WriteLine("\t$('#" + this.ClientID + "').load('"
                + ResolveFullUrl(this.ViewUrl) + "');");
            writer.WriteLine("});");
            writer.WriteLine("--&amp;gt;&amp;lt;/script&amp;gt;");
        }

        [PersistenceMode(PersistenceMode.Attribute)]
        public object PostData { get; set; }

        [PersistenceMode(PersistenceMode.Attribute)]
        public string Callback { get; set; }

        [PersistenceMode(PersistenceMode.Attribute)]
        public string ViewUrl { get; set; }

        [PersistenceMode(PersistenceMode.Attribute)]
        public string ContainerTag { get; set; }

        [PersistenceMode(PersistenceMode.Attribute)]
        public int RefreshInterval { get; set; }

        private string GetDataArg()
        {
            if (PostData == null) return "undefined";
            // todo: convert complex class to JSON
            return PostData.ToString();
        }

        private string GetCallbackArg()
        {
            if (string.IsNullOrEmpty(Callback)) return "undefined";
            return Callback;
        }

        private string ResolveFullUrl(string url)
        {
            var ret = new Uri(Request.Url, Page.ResolveUrl(url));
            return ret.ToString();
        }

        private HttpResponse Response
        {
            get { return HttpContext.Current.Response; }
        }

        private HttpRequest Request
        {
            get { return HttpContext.Current.Request; }
        }
    }

    public class ClearParentInterval : Control
    {
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            if (string.IsNullOrEmpty(ContainerTag))
                ContainerTag = "span";
        }
        protected override void Render(HtmlTextWriter writer)
        {
            writer.WriteBeginTag(ContainerTag);
            writer.WriteAttribute("id", this.ClientID);
            writer.WriteLine("&amp;gt;");
            base.Render(writer);
            writer.WriteEndTag(ContainerTag);
            writer.WriteLine();
            if (ClearInterval.HasValue &amp;amp;&amp;amp; ClearInterval.Value)
            {
                writer.WriteLine("&amp;lt;script type=\"text/javascript\" language=\"javascript\"&amp;gt;");
                writer.WriteLine("\tvar " + ClientID + "_ClearIntervalParentRef = $('#" + this.ClientID +
                                 "').parent().attr('id') + '_interval';");
                writer.WriteLine("\tif (window[" + ClientID + "_ClearIntervalParentRef]) {");
                writer.WriteLine("\t\tclearInterval(window[" + ClientID + "_ClearIntervalParentRef]);");
                writer.WriteLine("\t}");
                writer.WriteLine("&amp;lt;/script&amp;gt;");
            }
        }
        [PersistenceMode(PersistenceMode.Attribute)]
        public string ContainerTag { get; set; }

        public bool? ClearInterval { get; set; }
    }
}
&lt;/pre&gt;&lt;/div&gt;&lt;iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&amp;url=http://www.jondavis.net/techblog/post/2009/04/11/AJAX-Deferred-Loader-for-ASPNET.aspx&amp;amp;title=AJAX Deferred Loader for ASP.NET" height="25" width="155" scrolling="no" frameborder="0"&gt;&lt;/iframe&gt;&lt;img src="http://feeds.feedburner.com/~r/stimpy77/~4/6Cw5jT12XWU" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/stimpy77/~3/6Cw5jT12XWU/post.aspx</link>
      <author>jon.nospam@nospam.jondavis.net (Jon)</author>
      <comments>http://www.jondavis.net/techblog/post/2009/04/11/AJAX-Deferred-Loader-for-ASPNET.aspx#comment</comments>
      <guid isPermaLink="false">http://www.jondavis.net/techblog/post.aspx?id=b51a4775-c431-42a1-bc36-bb8e11880cbf</guid>
      <pubDate>Sat, 11 Apr 2009 14:19:31 -0700</pubDate>
      <category>Web Development</category>
      <dc:publisher>Jon</dc:publisher>
      <pingback:server>http://www.jondavis.net/techblog/pingback.axd</pingback:server>
      <pingback:target>http://www.jondavis.net/techblog/post.aspx?id=b51a4775-c431-42a1-bc36-bb8e11880cbf</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.jondavis.net/techblog/trackback.axd?id=b51a4775-c431-42a1-bc36-bb8e11880cbf</trackback:ping>
      <wfw:comment>http://www.jondavis.net/techblog/post/2009/04/11/AJAX-Deferred-Loader-for-ASPNET.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.jondavis.net/techblog/syndication.axd?post=b51a4775-c431-42a1-bc36-bb8e11880cbf</wfw:commentRss>
    <feedburner:origLink>http://www.jondavis.net/techblog/post.aspx?id=b51a4775-c431-42a1-bc36-bb8e11880cbf</feedburner:origLink></item>
    <item>
      <title>TDD: Here I Go!!</title>
      <description>&lt;p&gt;
About a week and a half ago&amp;nbsp;I finally started breaking ground (that is, created a Visual Studio soluton and started writing code, with the intention of it being used in production) on a big composite pet project I&amp;#39;ve been considering for a very long time. I won&amp;#39;t get into what the project is going to be about (at least not now), but I will say parts of it are multi-faceted software foundation&amp;nbsp;/ framework. So, once I&amp;#39;m done, I&amp;#39;ll be able to take a bunch of the code I wrote here and re-apply it on a completely different project. This is important to me as I am seriously in need of gaining some inertia in pet project development and deployments. 
&lt;/p&gt;
&lt;p&gt;
So right away I started writing tests to &amp;quot;prove out&amp;quot; each little piece of code as I wrote it. I&amp;#39;d heard the TDD gospel and wanted to convert, but I don&amp;#39;t have a lot of TDD practice under my belt. But right away I had about 75% code coverage, which I felt was pretty good compared to 0% of projects in the past. Every time I wrote a little bit of code, I hit Ctrl+R, A to be sure nothing I just did failed.&amp;nbsp;This worked fine, at the beginning, while working with simple, lightweight objects. 
&lt;/p&gt;
&lt;p&gt;
Pretty soon I found myself implementing abstract provider/service classes, and then create at least one or two implementations of them. And then I wrote this big dependency object that gets passed around back and forth. By the time I had some prototype code written, I realized that my tests would not break because I hadn&amp;#39;t been writing code&amp;nbsp;around my tests, I had been writing my tests around the code I had been writing. And at this point I was clueless as to whether the code I had just written would work, because this was all&amp;nbsp;plumbing code. I wanted to at least try something and see if the basics were working, so I created a console application and wrote some code with Console.Write()&amp;#39;s to get a visual on the output. But at this point things were getting messy. My dependency object I had created was created for the one implementation class of my abstract provider/service object. I now had a throw-away console app in my solution that didn&amp;#39;t belong. And my test coverage was down to something like 5%. 
&lt;/p&gt;
&lt;p&gt;
That&amp;#39;s when I realized I was going about this all wrong. For months I had a hard time understanding why TDD proponents argued that writing code before their tests is &amp;quot;putting the cart before the horse&amp;quot;, when writing tests before code seemed so backwards to me. But now it started to click. For many years, I&amp;#39;ve been designing code in my head, then implementing those designs in code, and if it works, great, if not, I fix the bugs. I&amp;#39;m starting to see now how I need to retrain myself. It&amp;#39;s okay to design code in your head. You just need to document those designs in tests. At first, they won&amp;#39;t even compile. Fine. But at least document your designs in tests. 
&lt;/p&gt;
&lt;p&gt;
Funny, I haven&amp;#39;t ever heard anyone make the connection, but writing tests with mocks of the way you want your code to work is exactly the same to a programmer as wireframes are to web design. One should not design a web page by throwing some HTML into a web site, trying to make it look nice and complete, and then showing it to the customer for the first time and saying, &amp;quot;Here you go, it&amp;#39;s done. Now tell me what&amp;#39;s wrong with it.&amp;quot;&amp;nbsp;Rather, a&amp;nbsp;professional web production team would first collect the requirements (in workflow verbiage) of the web site, throw together some wireframe mock-ups, create Photoshop design comps in parallel, and &lt;em&gt;then&lt;/em&gt; go to implementation, all the while following up with the customer for feedback during each and every step along the way. TDD is exactly the same but for the programmer. The tests are wireframes and business rules, just like a web application spec has bullet-point business rule text that serves as manual tests for all parties involved to both define and validate the implementation. 
&lt;/p&gt;
&lt;p&gt;
Even if there is no third party customer who would approve your &amp;quot;wireframes&amp;quot; and you&amp;#39;re working solo, the analogy of &amp;quot;wireframing a web design&amp;quot; should still apply. A web designer/engineer&amp;nbsp;can, but shouldn&amp;#39;t, create a web site before wireframing it. He should start with a napkin, and go from there. Likewise, one can, but shouldn&amp;#39;t, write code before writing tests for that code, because &lt;strong&gt;tests are not just validations that assumed functionality works but are also definitions of assumed functionality&lt;/strong&gt;, and without definitions of assumed functionality there are really no coding objectives. 
&lt;/p&gt;
&lt;p&gt;
The hardest part for me to do TDD so far in this new experience is realizing I wasn&amp;#39;t doing TDD in the first place, and then going back and scrapping all the code I had just written, whether it was good or not. I knew it had a little bit of &amp;#39;bad&amp;#39; mixed in with the good, and that should not be acceptable. Awareness of &amp;quot;a little bit of bad code buried in there&amp;quot; typically means mostly bad code in the long run, and a lot of wasted time, because &lt;strong&gt;bad code cascades&lt;/strong&gt; and affects everything else, like yeast. 
&lt;/p&gt;
&lt;p&gt;
One other thing about these incidents is that I&amp;#39;ve also been re-learning the theory of YAGNI (you ain&amp;#39;t gonna need it!). I was getting too comfortable with the idea of introducing extra method signatures on objects that were not getting properly tested to begin with, and for which my use cases were purely theoretical, and not truely&amp;nbsp;intentional. I&amp;#39;ve argued here in this blog in the past that YAGNI is extremely naive and not the appropriate attitude when writing software in smaller shops (like one or two man bands) because the multi-role developer often knows exacty what he needs and should not be withheld from adding what he needs in order to do his job. That&amp;#39;s great, ignore YAGNI, so long as you&amp;#39;re taking an &amp;quot;undisciplined&amp;quot;, less-formal approach to software or are writing software that is not intended to be reused such as a framework. However, in my case, I&amp;#39;m writing framework bits, and I must balance ease of use by way of high versatility&amp;nbsp;versus ease of use by way of simplicity. Other programmers, including myself at some later point in time, should not be confused with options. Programmers are software users, just like their end-users are software users. So the end-users use the mouse and click simple things, whereas programmers use framework code to write code, fine, either way, they&amp;#39;re all users. The Apple and Google approaches are to keep it simple, stupid (KISS). Don&amp;#39;t overwhelm the user with options, especially if either of two options reach the same outcome. I should define one &amp;quot;best practices&amp;quot; path and only introduce the other path when it is &lt;em&gt;needed&lt;/em&gt;, not when it is &lt;em&gt;slightly and occasionally convenient&lt;/em&gt;. 
&lt;/p&gt;
&lt;p&gt;
Part of the reason why I write like such is to drive it into my head. I still settle for less than what I preach sometimes. 
&lt;/p&gt;
&lt;p&gt;
There&amp;#39;s one other thing; tests are a part of the TDD strategy, but I&amp;#39;m also beginning to think that once I have made some headway into these framework bits to be able to actually write some code that passes tests, I might also start writing some application/implementation project code. Call it a manual test if you like. The tests themselves should not lose priority. But I think it makes sense, to an extent, to see code written in action as soon as it&amp;#39;s feasible in order to prove out code design prototypes.&amp;nbsp;Writing application code&amp;nbsp;should NOT&amp;nbsp;actually &lt;em&gt;be&lt;/em&gt; additional&amp;nbsp;tests but rather take advantage of what&amp;#39;s alreay passing and help guide the tests as the tests are being written. In this light, the only problem I have with TDD is that&amp;nbsp;TDD&amp;nbsp;is spoken of too often in terms of unit and integration tests, whereas&amp;nbsp;the whole lifecycle of designing with tests and of&amp;nbsp;testing must be much broader than unit and intgration tests. TDD starts with unit tests, but unit tests, by definition, only test one tiny unit of functionality. In order to really drive your design and development through tests, you need to be able to test workflows, too. Starting from Point A, given&amp;nbsp;&lt;em&gt;n&lt;/em&gt; parameters, we should ultimately arrive at B, and this might involve several steps. 
&lt;/p&gt;
&lt;p&gt;
Oh, I still need to watch &lt;a href="http://www.asp.net/learn/mvc-videos/#MVCStorefrontStarterKit"&gt;Rob Conery&amp;#39;s MVC&amp;nbsp;Storefront&amp;nbsp;videos&lt;/a&gt; where he, too, learned TDD. I got about ten or so videos in until I caught up,&amp;nbsp;and then stopped watching while he kept streaming them out. 
&lt;/p&gt;
&lt;iframe src="http://widgets.dzone.com/links/widgets/zoneit.html?t=2&amp;url=http://www.jondavis.net/techblog/post/2009/04/04/TDD-Here-I-Go!!.aspx&amp;amp;title=TDD: Here I Go!!" height="25" width="155" scrolling="no" frameborder="0"&gt;&lt;/iframe&gt;&lt;img src="http://feeds.feedburner.com/~r/stimpy77/~4/sOtUM6AyEYc" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/stimpy77/~3/sOtUM6AyEYc/post.aspx</link>
      <author>jon.nospam@nospam.jondavis.net (Jon)</author>
      <comments>http://www.jondavis.net/techblog/post/2009/04/04/TDD-Here-I-Go!!.aspx#comment</comments>
      <guid isPermaLink="false">http://www.jondavis.net/techblog/post.aspx?id=b30922ef-f3a0-4550-ad2e-f7d9f451e5fb</guid>
      <pubDate>Sat, 04 Apr 2009 11:57:00 -0700</pubDate>
      <category>C#</category>
      <dc:publisher>Jon</dc:publisher>
      <pingback:server>http://www.jondavis.net/techblog/pingback.axd</pingback:server>
      <pingback:target>http://www.jondavis.net/techblog/post.aspx?id=b30922ef-f3a0-4550-ad2e-f7d9f451e5fb</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.jondavis.net/techblog/trackback.axd?id=b30922ef-f3a0-4550-ad2e-f7d9f451e5fb</trackback:ping>
      <wfw:comment>http://www.jondavis.net/techblog/post/2009/04/04/TDD-Here-I-Go!!.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.jondavis.net/techblog/syndication.axd?post=b30922ef-f3a0-4550-ad2e-f7d9f451e5fb</wfw:commentRss>
    <feedburner:origLink>http://www.jondavis.net/techblog/post.aspx?id=b30922ef-f3a0-4550-ad2e-f7d9f451e5fb</feedburner:origLink></item>
  </channel>
</rss>
