﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
	<title>Archaic Christianity</title>
	<link>http://www.ArchaicChristianity.com/</link>
	<description>The feed for the blog.</description>
	<lastBuildDate>Tue, 23 Jun 2009 14:56:30 GMT</lastBuildDate>
	<managingEditor>eric.sowell@gmail.com</managingEditor>
	<webMaster>eric.sowell@gmail.com</webMaster>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<item>
	<title>Principles of Software Testing</title>
	<link>http://www.thecodinghumanist.com/Blog/Archives/2009/06/23/PrinciplesOfSoftwareTesting.aspx</link>
	<description><p>A few months ago I did lunch-n-learn at work around testing. I wrote down a number of principles that were useful to keep in mind when thinking about when writing automated tests. I figured I would share.</p>

<ol>
<li><b>Testing as Safeguard</b>.
The basic, most obvious idea behind testing. Rapid change in code should bring fear. Test to reduce fear.</li>

<li><b>Testing as Proof</b>.
Tests can be a good way to prove to you and your peers that your code doesn’t suck.</li>

<li><b>Your Code Should Be As Independent as Possible I (Separation of Concerns)</b>.
Code that is in the BL should not be concerned with Html, the HttpRequest object and such things. The UI should not be concerned with the DL. Make each area concerned only with its own matters as much as possible.</li>

<li><b>Your Code Should Be As Independent as Possible II (Dependency Injection &amp; Mocking)</b>.
It is impossible to remove all dependencies from your code. However, the fewer dependencies and places of tight coupling, the easier code is to test. A popular and effective way to reduce dependency is to follow the pattern of dependency injection where you supply to the code being called its external dependency. Mocking also helps in this regard, as it allows you to handle dependencies in tests more easily, and gives you fantastic control over the values returned from typically-dependent code.</li>

<li><b>Testing Can Help Design (TDD)</b>.
Making code testable from the start will almost always lead to better design because it practically forces the separation of concerns and helps you focus on the big picture of the functionality and not the details of its implementation.</li>

<li><b>Testing as Documentation</b>.
Test code is some of the best documentation you can have. It not only explains how to use code, but because it is always being run it is kept up-to-date. This is rarely the case with external documentation.</li>

<li><b>Do Not Use Shared Mutable Dependencies</b>.
If two tests share the same thing, and that thing can change, your tests are likely invalid and can lead to inconsistent results. Unless the resources you are using are static, create what you need for your test each time.</li>

<li><b>Express Test Intent with the Name</b>.
Don’t name your test something like “Test1”. Use an expressive name so you can glance at the test and know what it covers.</li>

<li><b>Testing Allows More Parallel Development</b>.
Want to run your code and get working when the database guys aren’t finished, you don’t have the final documentation on an api you will be using, or the code you are calling doesn’t work? Use mock objects to give yourself something to program against.</li>

<li><b>Avoid Static and Sealed</b>.
Static and sealed classes and members cannot be overridden. This gets in the way of testing. There are times for these things, but if it ever needs to be switched out for mocking or dependency injection, you are out of luck.</li>

<li><b>The Test Must Pass Consistently</b>.
Inconsistently passing tests usually do so because they are using shared data or resources with other tests. Isolate tests from each other. Never check in a test if it occassionally fails. Otherwise you never know when you have a real problem.</li>

<li><b>Expression of Intent versus Actual Execution</b>.
Sometimes it is a lot easier to test something if it returns an expression of intent rather than actually executing an action. For example, the RedirectResult in ASP.NET MVC. You cannot for a unit test test an actual redirect easily, but you <i>can</i> test if a RedirectResult is returned from an action. This can also help with achieving a separation of concerns, as it might be better to execute that action elsewhere.</li>

<li><b>Test as You Go</b>.
If you do all of your coding and then stop to test, testing is often very tedious and boring. If you test as you go it is a lot more interesting. So test as you develop as it will help your design (see TDD above) and seem like less of a chore.</li>

</ol>
</description>
	<pubDate>Tue, 23 Jun 2009 21:50:08 GMT</pubDate>
	<guid>http://www.thecodinghumanist.com/Blog/Archives/2009/06/23/PrinciplesOfSoftwareTesting.aspx</guid>
</item>
<item>
	<title>On Using the New Ajax Control Toolkit Html Editor</title>
	<link>http://www.thecodinghumanist.com/Blog/Archives/2009/05/16/OnUsingTheNewAjaxControlToolkitHtmlEditor.aspx</link>
	<description><p><a href="http://weblogs.asp.net/bleroy/archive/2009/05/13/new-release-of-the-ajax-control-toolkit.aspx">This announcement by Bertrand Le Roy on some new Ajax Control Toolkit controls</a> was a nice bit of news to me the other day. One thing I was looking for was a new Html editor...great timing! Tonight I set out to implement it in one of my MVC projects.</p>

<p>Since I was doing this in an MVC project, the <a href="http://www.asp.net/ajax/ajaxcontroltoolkit/samples/HTMLEditor/OtherSamples/ClientSide.htm">client-side only mode was the one for me</a>. So <a href="http://ajaxcontroltoolkit.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=27326">I went to the downloads</a> and downloaded the script files only version. As I tried to use the downloaded code and the example, problems ensued. The sample referenced several files and folders that did not exist in this source drop at all, and the javascript attempted to instantiate an object that had not been defined. Doh! Being a nice little boy, <a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=22433">I left a note on the issue tracker for the project</a>.</p>

<p>So I downloaded the source download and tried again. Things were much better this time, but some changes still needed to be made. All of the files referenced in the sample existed, but not at their specified paths. After some renaming and repathing, I managed to get it to work. Woot! Here are the changes to the js references and code I made to get the widget working (pardon the bad line breaks):</p>

<div style="width: 800px; overflow: auto;">
<!-- code formatted by http://manoli.net/csharpformat/ -->
<div class="csharpcode">
<pre class="alt"><span class="lnum">   1:  </span><span class="kwrd">&amp;lt;</span><span class="html">script</span> <span class="attr">src</span><span class="kwrd">="/Scripts/AjaxControlToolkit/Common/Common.js"</span></pre>
<pre><span class="lnum">   2:  </span><span class="attr">type</span><span class="kwrd">="text/javascript"</span><span class="kwrd">&amp;gt;&amp;lt;/</span><span class="html">script</span><span class="kwrd">&amp;gt;</span></pre>
<pre class="alt"><span class="lnum">   3:  </span>&amp;lt;script src=<span class="str">"/Scripts/AjaxControlToolkit/ExtenderBase/BaseScripts.js"</span></pre>
<pre><span class="lnum">   4:  </span>type=<span class="str">"text/javascript"</span>&amp;gt;&amp;lt;/script&amp;gt;</pre>
<pre class="alt"><span class="lnum">   5:  </span>&amp;lt;script src=<span class="str">"/Scripts/AjaxControlToolkit/HtmlEditor</pre>
<pre><span class="lnum">   6:  </span>/AjaxControlToolkit.HTMLEditor.ClientSideEditor.js"</span></pre>
<pre class="alt"><span class="lnum">   7:  </span>type=<span class="str">"text/javascript"</span>&amp;gt;&amp;lt;/script&amp;gt;</pre>
<pre><span class="lnum">   8:  </span>&amp;nbsp;</pre>
<pre class="alt"><span class="lnum">   9:  </span>&amp;lt;script src=<span class="str">"/Scripts/AjaxControlToolkit/DynamicPopulate/DynamicPopulateBehavior.js"</span></pre>
<pre><span class="lnum">  10:  </span>type=<span class="str">"text/javascript"</span>&amp;gt;<span class="kwrd">&amp;lt;/</span><span class="html">script</span><span class="kwrd">&amp;gt;</span></pre>
<pre class="alt"><span class="lnum">  11:  </span><span class="kwrd">&amp;lt;</span><span class="html">link</span> <span class="attr">href</span><span class="kwrd">="/Scripts/AjaxControlToolkit/HTMLEditor/Editor.css"</span></pre>
<pre><span class="lnum">  12:  </span><span class="attr">rel</span><span class="kwrd">="stylesheet"</span> <span class="attr">type</span><span class="kwrd">="text/css"</span> <span class="kwrd">/&amp;gt;</span></pre>
</div>
</div>

<br /><br />

<!-- code formatted by http://manoli.net/csharpformat/ -->
<div class="csharpcode">
<pre><span class="lnum">   1:  </span>        Sys.Application.add_init(function()</pre>
<pre><span class="lnum">   2:  </span>        {</pre>
<pre><span class="lnum">   3:  </span>            $create(AjaxControlToolkit.HTMLEditor.ClientSideEditor,</pre>
<pre><span class="lnum">   4:  </span>                {</pre>
<pre><span class="lnum">   5:  </span>                    imagesPath: <span class="str">"/Scripts/AjaxControlToolkit/HtmlEditor/Images/"</span>,</pre>
<pre><span class="lnum">   6:  </span>                    popupCss: </pre>
<pre><span class="lnum">   7:  </span><span class="str">"/Scripts/AjaxControlToolkit/HtmlEditor/Popups/AttachedTemplatePopup.css"</span>,</pre>
<pre><span class="lnum">   8:  </span>                    designPanelCss: <span class="str">"/Scripts/AjaxControlToolkit/HtmlEditor/DesignPanel.css"</span>,</pre>
<pre><span class="lnum">   9:  </span>                    documentCss: <span class="str">"/Scripts/AjaxControlToolkit/HtmlEditor/Document.css"</span></pre>
<pre><span class="lnum">  10:  </span>                },</pre>
<pre><span class="lnum">  11:  </span>                <span class="kwrd">null</span>, <span class="kwrd">null</span>, $get(<span class="str">"ReviewText"</span>));</pre>
<pre><span class="lnum">  12:  </span>        });</pre>
</div>

<p>It is now working. The only odd thing about it so far is that changing the view mode (wysiwyg/html) causes a page reload.</p>

<p>I hope some of you out there find this useful. Good luck!</p></description>
	<pubDate>Sun, 17 May 2009 05:06:23 GMT</pubDate>
	<guid>http://www.thecodinghumanist.com/Blog/Archives/2009/05/16/OnUsingTheNewAjaxControlToolkitHtmlEditor.aspx</guid>
</item>
<item>
	<title>Drawings: 1</title>
	<link>http://www.thecodinghumanist.com/Blog/Archives/2009/05/11/Drawings1.aspx</link>
	<description><p>Beware, oh world of art! I shall rain horrible drawings upon thee...</p>

<p>So I'm trying to re-awaken the sketcher within. I've been dabbling again recently, but it is time to be consistent. So, without further waiting, my drawing from May 10:</p>

<p><a href="/PictureUpload/Pic308.jpg"><img src="/PictureUpload/Pic308Thumbnail.jpg" /></a></p>

<p>The <a href="http://www.drawspace.com/lessons/lesson.php?id=c03">drawing instructions for this were found on the drawspace.com site here</a>.</p>

<p>I would have done the next drawing on the list today, but it looked boring. Instead I went for the next one, which involved <a href="http://www.drawspace.com/lessons/lesson.php?id=c06">drawing a Manga character</a>, or at least the head of one:</p>

<p><a href="/PictureUpload/Pic309.jpg"><img src="/PictureUpload/Pic309Thumbnail.jpg" /></a></p>

<p>As you can probably tell, both were pretty easy. But I guess I'll start slowly.</p></description>
	<pubDate>Tue, 12 May 2009 06:42:12 GMT</pubDate>
	<guid>http://www.thecodinghumanist.com/Blog/Archives/2009/05/11/Drawings1.aspx</guid>
</item>
<item>
	<title>New Site for ASP.NET MVC: How MVC Works</title>
	<link>http://www.thecodinghumanist.com/Blog/Archives/2009/02/25/NewSiteForASPNETMVC_HowMVCWorks.aspx</link>
	<description><p>Because I don't have enough to do, I just launched a new site called <a href="http://www.howmvcworks.net">How ASP.NET MVC Works</a>. Will be updating it occasionally with new content. Hope all you peeps find it useful.</p></description>
	<pubDate>Thu, 26 Feb 2009 03:04:10 GMT</pubDate>
	<guid>http://www.thecodinghumanist.com/Blog/Archives/2009/02/25/NewSiteForASPNETMVC_HowMVCWorks.aspx</guid>
</item>
<item>
	<title>Nice Little SMTP Server for Vista</title>
	<link>http://www.thecodinghumanist.com/Blog/Archives/2009/02/02/NiceLittleSMTPServerForVista.aspx</link>
	<description><p>Need to get SMTP up and running on Vista? Well, <a href="http://weblogs.asp.net/steveschofield/archive/2006/12/19/iis7-post-23-vista-and-smtp-server-where-is-it.aspx">I was looking around and found this blog post</a>. <a href="http://softstack.com/freesmtp.html">So I tried out this free SMTP server</a>. I am happy to report that it worked great! So, if you have the same issue...there you go.</p></description>
	<pubDate>Tue, 03 Feb 2009 05:48:11 GMT</pubDate>
	<guid>http://www.thecodinghumanist.com/Blog/Archives/2009/02/02/NiceLittleSMTPServerForVista.aspx</guid>
</item>
<item>
	<title>Play Ikariam</title>
	<link>http://www.thecodinghumanist.com/Blog/Archives/2009/01/29/PlayIkariam.aspx</link>
	<description><p>Dear reader, if you are a fan of strategy games like Civilization, I have a recommended (and free) game for you. It is called <a href="http://ikariam.org">Ikariam</a>. A few coworkers and I are playing the game and are creating an alliance. You should join us. If you are interested, join on the "Ny" server and shoot me an email so we can chat and collaborate.</p>

<p>Hope to see some of you on there.</p>

<p>Cross-posted from <a href="http://www.archaicchristianity.com/Blog/Archives/2009/1/29/PlayIkariam.aspx">http://www.archaicchristianity.com/Blog/Archives/2009/1/29/PlayIkariam.aspx</a>.</p></description>
	<pubDate>Fri, 30 Jan 2009 01:48:48 GMT</pubDate>
	<guid>http://www.thecodinghumanist.com/Blog/Archives/2009/01/29/PlayIkariam.aspx</guid>
</item>
<item>
	<title>On the Markup of Forms</title>
	<link>http://www.thecodinghumanist.com/Blog/Archives/2009/01/28/OnTheMarkupOfForms.aspx</link>
	<description><p>So <a href="http://fecklessmind.com/2009/01/23/how-to-reliable-forms-with-css/">I ran across an interesting way of marking up Html forms</a>. I thought it was nice, so I decided to bring that into the world of ASP.NET, because there is a (easy to overcome) roadblock in using the method in traditional ASP.NET (it is odd having to distinguish between traditional and MVC...).</p>

<p>You can use the method as it is basically described there with the exception of the <i>for</i> attribute on the <i>input</i> elements. With ASP.NET Old you may get a mangled id because of that INamingContainer business. Fortunately, this is not really a problem.</p>

<p>I basically followed the pattern for a form I built just the other day. It looks like this(click for larger image) :</p>

<div><a href="/PictureUpload/Pic247.jpg"><img src="/PictureUpload/Pic247Thumbnail.jpg" /></a></div>

<p>Because of INamingContainer and that I'm using a masterpage with a nested masterpage in it, you get ids that are very long, as you can see in this shot of the rendered source of the page:

<div><a href="/PictureUpload/Pic248.jpg"><img src="/PictureUpload/Pic248Thumbnail.jpg" /></a></div>

<p>And notice how I solved it. The <i>ClientID</i> property of any control will give you the final INamingContainer'd name (assuming you look at the property late enough in the page life-cycle...another topic altogether). Now, granted, you would render the page, get the id, and put it in the label, but if the masterpage hierarchy changes or a ASP.NET version upgrade changes the way those ids are generated, well, you're toast (and you probably wouldn't even notice). Use the <i>ClientID</i> and your problems with this method are solved.</p></description>
	<pubDate>Wed, 28 Jan 2009 16:24:20 GMT</pubDate>
	<guid>http://www.thecodinghumanist.com/Blog/Archives/2009/01/28/OnTheMarkupOfForms.aspx</guid>
</item>
<item>
	<title>ASP.NET MVC RC Available!</title>
	<link>http://www.thecodinghumanist.com/Blog/Archives/2009/01/28/ASP_NET_MVC_RCAvailable.aspx</link>
	<description><p>I haven't tried upgrading an existing site yet, but new website creation works well. The only thing I've seen so far is that if you create a unit test project to go with your web app it won't compile. Luckily, all you have to do is include the proper namespace reference to your controllers at the top.</p>

<p>You can find out more in <a href="http://weblogs.asp.net/scottgu/archive/2009/01/27/asp-net-mvc-1-0-release-candidate-now-available.aspx">ScottGu's rather long post on the RC bits</a>.</p></description>
	<pubDate>Wed, 28 Jan 2009 14:00:57 GMT</pubDate>
	<guid>http://www.thecodinghumanist.com/Blog/Archives/2009/01/28/ASP_NET_MVC_RCAvailable.aspx</guid>
</item>
<item>
	<title>Fun at Mini-PDC in Dallas</title>
	<link>http://www.thecodinghumanist.com/Blog/Archives/2009/01/26/FunAtMiniPDCInDallas.aspx</link>
	<description><p>So today was fun. Somehow my employer got five free tickets to the miniaturized version of the PDC that they had today at the Galleria in Dallas. Thankfully, I was able to go.</p>

<p>This was my first look at Windows Azure and it looks interesting. I even went to a session on it. It was an interesting session, but I didn't spend my whole day in that world.</p>

<p>The first session was on jQuery by Rob Paddock and it was quite good. I've been messing around with it lately so that was fun times.</p>

<p>I also went to one on building business apps with Silverlight 2 that ended up being interesting mostly because of the look at some of the things coming in Silverlight 3.</p>

<p>The last session was on the upcoming stuff in ASP.NET 4.0. Since I watched most of the video for this one from PDC I had already heard of some of it, but it was a useful session anyway.</p>

<p>And last but not least, the lunch provided was phenomenal! I ate four little bitty but tasty stakes, some very yummy potatoes and two pieces of fish. It was so good I couldn't stop eating.</p>

<p>If there is one of these coming to your area, I highly recommend attending!</p></description>
	<pubDate>Tue, 27 Jan 2009 05:58:27 GMT</pubDate>
	<guid>http://www.thecodinghumanist.com/Blog/Archives/2009/01/26/FunAtMiniPDCInDallas.aspx</guid>
</item>
<item>
	<title>How To Make Html Appear over Flash Content</title>
	<link>http://www.thecodinghumanist.com/Blog/Archives/2009/01/25/HowToMakeHtmlAppearOverFlashContent.aspx</link>
	<description><p>Some technologies love me. Some hate me. Flash is one of the latter, though I do try to make friends. I had one problem that took me much longer to solve than it should have. IMHO, the .NET community is much better about communicating how to do things than the Flash community. But, since I figured it out, I thought I would share it with you to help solve this problem for someone else.</p>

<p>So I had this issue. I was working on something for a client which involved a horizontal Html and Css menu. When various menu items were hovered over, submenus would drop down. Also, right below this a Flash movie was to appear. Unfortunately, Flash by default will display over overlapping Html elements.</p>

<p>Once I figured it out it was pretty obvious. You know, one of those times where you hit yourself for not getting it right the first time. Anyway, if you are curious, <a href="/Content/HtmlOverFlash/HtmlOverFlash.aspx">I set it up to work on a samples page</a>. There is also a download there for you if you want a few sample files.</p>

<p>If you have any questions, let me know.</p></description>
	<pubDate>Sun, 25 Jan 2009 22:56:11 GMT</pubDate>
	<guid>http://www.thecodinghumanist.com/Blog/Archives/2009/01/25/HowToMakeHtmlAppearOverFlashContent.aspx</guid>
</item>
</channel></rss>