<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Brian Hartsock's Blog</title>
	<atom:link href="http://blog.brianhartsock.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.brianhartsock.com</link>
	<description>The exciting life of a software developer and nerd</description>
	<pubDate>Tue, 19 Aug 2008 16:01:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>Worst email joke ever!</title>
		<link>http://blog.brianhartsock.com/2008/08/19/worst-email-joke-ever/</link>
		<comments>http://blog.brianhartsock.com/2008/08/19/worst-email-joke-ever/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 16:01:41 +0000</pubDate>
		<dc:creator>bhartsock</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.brianhartsock.com/?p=117</guid>
		<description><![CDATA[Matt: I wonder if SPAM is good, I have never had it before (while holding up a can of SPAM).
Me: Ya, haven&#8217;t you ever fried SPAM before?
Matt: Only at the gateway level.
Oh the joys of working for an email company.
]]></description>
			<content:encoded><![CDATA[<p><strong>Matt:</strong> I wonder if <a href="http://www.spam.com/">SPAM </a>is good, I have never had it before (while holding up a can of <a href="http://www.spam.com/">SPAM</a>).<br />
<strong>Me:</strong> Ya, haven&#8217;t you ever fried SPAM before?<br />
<strong>Matt:</strong> Only at the gateway level.</p>
<p>Oh the joys of working for an email company.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.brianhartsock.com/2008/08/19/worst-email-joke-ever/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Amazon Unbox</title>
		<link>http://blog.brianhartsock.com/2008/08/11/amazon-unbox/</link>
		<comments>http://blog.brianhartsock.com/2008/08/11/amazon-unbox/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 21:16:14 +0000</pubDate>
		<dc:creator>bhartsock</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[MythTV]]></category>

		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://blog.brianhartsock.com/?p=115</guid>
		<description><![CDATA[I downloaded Amazon&#8217;s Unbox this weekend to watch some BSG (yes I am a nerd).  Unbox is Amazon&#8217;s video download service.  I say service because it is much more than just another download.  Amazon allows me to re-download videos or transfer them to multiple machines.  Obviously, the Unbox player doesn&#8217;t allow [...]]]></description>
			<content:encoded><![CDATA[<p>I downloaded <a href="http://www.amazon.com/gp/video/help/faq.html?pf_rd_p=298517001&#038;pf_rd_s=center-1&#038;pf_rd_t=101&#038;pf_rd_i=16261631&#038;pf_rd_m=ATVPDKIKX0DER&#038;pf_rd_r=0KECERDC2B9H9BSJ6Q7A">Amazon&#8217;s Unbox</a> this weekend to watch some <a href="http://www.scifi.com/battlestar/">BSG</a> (yes I am a nerd).  Unbox is Amazon&#8217;s video download service.  I say service because it is much more than just another download.  Amazon allows me to re-download videos or transfer them to multiple machines.  Obviously, the Unbox player doesn&#8217;t allow burning to DVD, but I am over my purist-open-world days.</p>
<p>As with any service, there is room for vast improvements.  The software is slow and buggy, but not bad enough to piss me off, which means it is still very usable.  Also, the software only works on Windows XP or Vista, which is annoying for me because I run Ubuntu and Windows.  In the future, software for linux that could be integrated with MythTV would be stellar-sweet.  (Something tells me the suits are worried about the ability to rip the videos easier in linux).</p>
<p>All things considered, it is exactly what I wanted when my craving for season 4 of BSG got the best of me.  I can&#8217;t compare it to similar services, but it is worth trying if you don&#8217;t care to hook your laptop up to your TV and pay $1.89 an episode.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.brianhartsock.com/2008/08/11/amazon-unbox/feed/</wfw:commentRss>
		</item>
		<item>
		<title>LINQ bites back</title>
		<link>http://blog.brianhartsock.com/2008/08/07/linq-bites-back/</link>
		<comments>http://blog.brianhartsock.com/2008/08/07/linq-bites-back/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 19:59:31 +0000</pubDate>
		<dc:creator>bhartsock</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.brianhartsock.com/?p=114</guid>
		<description><![CDATA[Today I found some odd behavior when working with LINQ.  It is hard to describe, so here is the code.

public void Foo&#40;IEnumerable&#60;string&#62; strings&#41;
&#123;
	IEnumberable&#60;string&#62; stringsInDb = strings.Where&#40;s =&#62; this.QueryTheDbAndTakeALongTime&#40;s&#41;&#41;;
&#160;
	foreach&#40;string str in stringsInDb&#41;
	&#123;
		//Where clause in LINQ is actually executed 
	&#125;
&#160;
	foreach&#40;string str in stringsInDb&#41;
	&#123;
		//Where clause in LINQ is actually executed  AGAIN
	&#125;
&#125;

Luckily, some unit tests detected this [...]]]></description>
			<content:encoded><![CDATA[<p>Today I found some odd behavior when working with LINQ.  It is hard to describe, so here is the code.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp"><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> Foo<span style="color: #000000;">&#40;</span>IEnumerable<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">string</span><span style="color: #008000;">&gt;</span> strings<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	IEnumberable<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">string</span><span style="color: #008000;">&gt;</span> stringsInDb <span style="color: #008000;">=</span> strings.<span style="color: #0000FF;">Where</span><span style="color: #000000;">&#40;</span>s <span style="color: #008000;">=&gt;</span> <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">QueryTheDbAndTakeALongTime</span><span style="color: #000000;">&#40;</span>s<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
	<span style="color: #0600FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> str <span style="color: #0600FF;">in</span> stringsInDb<span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #008080; font-style: italic;">//Where clause in LINQ is actually executed </span>
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #0600FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> str <span style="color: #0600FF;">in</span> stringsInDb<span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #008080; font-style: italic;">//Where clause in LINQ is actually executed  AGAIN</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Luckily, some unit tests detected this behavior.  It actually isn&#8217;t surprising when you think about it though.  The proper thing to do for this case is actually call <em>ToList()</em> after the <em>Where()</em>.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp">IEnumberable<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">string</span><span style="color: #008000;">&gt;</span> stringsInDb <span style="color: #008000;">=</span> strings.<span style="color: #0000FF;">Where</span><span style="color: #000000;">&#40;</span>s <span style="color: #008000;">=&gt;</span> <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">QueryTheDbAndTakeALongTime</span><span style="color: #000000;">&#40;</span>s<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToList</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;</pre></div></div>

<p>Don&#8217;t let this behavior bite you.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.brianhartsock.com/2008/08/07/linq-bites-back/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Switcheroo</title>
		<link>http://blog.brianhartsock.com/2008/07/26/switcheroo/</link>
		<comments>http://blog.brianhartsock.com/2008/07/26/switcheroo/#comments</comments>
		<pubDate>Sat, 26 Jul 2008 20:33:39 +0000</pubDate>
		<dc:creator>bhartsock</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.brianhartsock.com/?p=112</guid>
		<description><![CDATA[Today I was thinking, and I realized something odd.  My development computer is Windows.  My personal computer is Ubuntu.  Weird huh?
]]></description>
			<content:encoded><![CDATA[<p>Today I was thinking, and I realized something odd.  My development computer is Windows.  My personal computer is Ubuntu.  Weird huh?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.brianhartsock.com/2008/07/26/switcheroo/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Code your Documents</title>
		<link>http://blog.brianhartsock.com/2008/07/26/code-your-documents/</link>
		<comments>http://blog.brianhartsock.com/2008/07/26/code-your-documents/#comments</comments>
		<pubDate>Sat, 26 Jul 2008 18:09:44 +0000</pubDate>
		<dc:creator>bhartsock</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://blog.brianhartsock.com/?p=111</guid>
		<description><![CDATA[Every developer has heard the phrase document your code.  The reason this is important is the functionality is now coupled with a description of how it works.   Now a future developer can load up a single source of information and understand the functionality.  But, more importantly, the odds of the documentation [...]]]></description>
			<content:encoded><![CDATA[<p>Every developer has heard the phrase <em>document your code</em>.  The reason this is important is the functionality is now coupled with a description of how it works.   Now a future developer can load up a single source of information and understand the functionality.  But, more importantly, the odds of the documentation staying updated are higher because of this coupling.  The same can&#8217;t be said for a standalone document.</p>
<p>Well, shouldn&#8217;t the same be true for documents, specifically those that describe some sort of process?  For example, a document describing the steps to setup an IIS web server for a particular application is perfect to convert to an automated script.  So, today, I started on a simple script to setup IIS compression using <a href="http://msdn.microsoft.com/en-us/library/wea2sca5(VS.80).aspx">MSBuild</a>.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</pre></td><td class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Project</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Types --&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;PropertyGroup<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;adsutilPath<span style="font-weight: bold; color: black;">&gt;</span></span></span>C:\inetpub\AdminScripts\adsutil.vbs<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/adsutilPath<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;cscriptPath<span style="font-weight: bold; color: black;">&gt;</span></span></span>cscript<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/cscriptPath<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;StaticFilesToCompress<span style="font-weight: bold; color: black;">&gt;</span></span></span>html htm js txt<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/StaticFilesToCompress<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;DynamicFilesToCompress<span style="font-weight: bold; color: black;">&gt;</span></span></span>aspx asp dll exe axd<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/DynamicFilesToCompress<span style="font-weight: bold; color: black;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/PropertyGroup<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Target</span> <span style="color: #000066;">Name</span>=<span style="color: #ff0000;">&quot;IisCompression&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Message</span> <span style="color: #000066;">Text</span>=<span style="color: #ff0000;">&quot;Turn on static and dynamic compression for all of IIS.&quot;</span> <span style="color: #000066;">Importance</span>=<span style="color: #ff0000;">&quot;high&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/502ef631-3695-4616-b268-cbe7cf1351ce.mspx?mfr=true --&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Exec</span> <span style="color: #000066;">Command</span>=<span style="color: #ff0000;">&quot;$(cscriptPath) $(adsutilPath) set w3svc/filters/compression/parameters/HcDoStaticCompression true&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Exec</span> <span style="color: #000066;">Command</span>=<span style="color: #ff0000;">&quot;$(cscriptPath) $(adsutilPath) set w3svc/filters/compression/parameters/HcDoDynamicCompression true &quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Message</span> <span style="color: #000066;">Text</span>=<span style="color: #ff0000;">&quot;Select files to compress for static and dyanamic compression.&quot;</span> <span style="color: #000066;">Importance</span>=<span style="color: #ff0000;">&quot;high&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/d52ff289-94d3-4085-bc4e-24eb4f312e0e.mspx?mfr=true --&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Exec</span> <span style="color: #000066;">Command</span>=<span style="color: #ff0000;">&quot;$(cscriptPath) $(adsutilPath) set W3SVC/Filters/Compression/Deflate/HcFileExtensions $(StaticFilesToCompress)&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Exec</span> <span style="color: #000066;">Command</span>=<span style="color: #ff0000;">&quot;$(cscriptPath) $(adsutilPath) set W3SVC/Filters/Compression/gzip/HcFileExtensions $(StaticFilesToCompress)&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Exec</span> <span style="color: #000066;">Command</span>=<span style="color: #ff0000;">&quot;$(cscriptPath) $(adsutilPath) set W3SVC/Filters/Compression/Deflate/HcScriptFileExtensions $(DynamicFilesToCompress)&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Exec</span> <span style="color: #000066;">Command</span>=<span style="color: #ff0000;">&quot;$(cscriptPath) $(adsutilPath) set W3SVC/Filters/Compression/gzip/HcScriptFileExtensions $(DynamicFilesToCompress)&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
&nbsp;
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Target<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Project<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Not only does this script automate the process, but it serves as a living document for the process.  By doing this, the documented process is now coupled to the task itself.</p>
<p>The next step to coding processes is coding tasks that can&#8217;t be automated.  For example, during a deployment, if some sort of fatal error occurs, the next task might be to call your boss and clean up your resume.  Why not code a message in the deploy script to give you the list of people and phone numbers to call in case of an emergency, then load up your resume in Word?  Again, the documented process is now coupled with the task itself.</p>
<p>Obviously, this article grows out of my dislike of documentation.  I dislike it, not because it isn&#8217;t useful, but because it takes a lot of time and, in my personal experience, isn&#8217;t used very often.  By integrating the documentation with the task itself, I think we gain more value from it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.brianhartsock.com/2008/07/26/code-your-documents/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Book Review: Continuous Integration</title>
		<link>http://blog.brianhartsock.com/2008/07/18/book-review-continuous-integration/</link>
		<comments>http://blog.brianhartsock.com/2008/07/18/book-review-continuous-integration/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 19:17:03 +0000</pubDate>
		<dc:creator>bhartsock</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.brianhartsock.com/?p=104</guid>
		<description><![CDATA[
Continuous Integration is an easy read that anyone directly involved in the software development process could gain a lot from.  Even though it doesn&#8217;t really introduce anything new, it ties everything most developers have learned over time into a single process, called continuous integration.  Here are a few of the things that I [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://blog.brianhartsock.com/wp-content/uploads/2008/06/51jrahs3ggl_sl500_aa240_.jpg'><img src="http://blog.brianhartsock.com/wp-content/uploads/2008/06/51jrahs3ggl_sl500_aa240_.jpg" alt="Continuous Integration" title="Continuous Integration" width="240" height="240" class="alignright size-medium wp-image-105" /></a><br />
<a href="http://www.amazon.com/Continuous-Integration-Improving-Addison-Wesley-Signature/dp/0321336380">Continuous Integration</a> is an easy read that anyone directly involved in the software development process could gain a lot from.  Even though it doesn&#8217;t really introduce anything new, it ties everything most developers have learned over time into a single process, called continuous integration.  Here are a few of the things that I really liked about the book.</p>
<h4>Automation</h4>
<p>Automate everything.  Automation limits the ability for bugs to creep into a process and it also makes  processes easier to follow.  After reading this book, I was really motivated to automate everything and so far it has been a great decision.   Some good examples of things that should be automated are:</p>
<ul>
<li>Tests</li>
<li>Environment setup and teardown, especially databases</li>
<li>Code inspection</li>
<li>Deployment</li>
</ul>
<h4>Databases</h4>
<p>Very often, databases are not part of a build process or version control.  This allows differences between different environments to potentially cause bugs.  Putting database schemas and test data in version control can help prevent this.  But, what I like the most, is it documents the setup of the database so potentially any developer could setup a new one.  </p>
<p>For example, when a new developer starts, I can show him the <a href="http://nant.sourceforge.net/">NAnt</a> or <a href="http://msdn.microsoft.com/en-us/library/wea2sca5(VS.80).aspx">MSBuild</a> task to execute in order to generate a new developer DB.  This is much easier than having to guide someone through MySQL, MSSQL, or any other database for the first time.</p>
<h4>Transparency</h4>
<p>Lastly, the biggest thing I learned from this book is how easily continuous integration can provide project transparency.  In my experience, all to often the developers and the rest of an organization get out of touch regarding a project&#8217;s status.  Continuous integration, combined with more agile development practices, allows a project to be completely transparent throughout an organization, from developers, to QA, to designers, and even senior leadership.  No longer does a looming release date bring surprises for those outside the development team.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.brianhartsock.com/2008/07/18/book-review-continuous-integration/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Geocities Nostalgia</title>
		<link>http://blog.brianhartsock.com/2008/07/10/geocities-nostalgia/</link>
		<comments>http://blog.brianhartsock.com/2008/07/10/geocities-nostalgia/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 15:45:18 +0000</pubDate>
		<dc:creator>bhartsock</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.brianhartsock.com/?p=108</guid>
		<description><![CDATA[I am doing some home wiring at my parents house and Googled around for some info on wiring phone jacks.  I came across this page, which strangely reminded me of my first website on Geocities 13 years ago. 
It was a website on Duke Nukem, and made heavy use of frames, animated gifs, and [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://blog.brianhartsock.com/wp-content/uploads/2008/07/dukenukem3dbox.jpg'><img src="http://blog.brianhartsock.com/wp-content/uploads/2008/07/dukenukem3dbox-300x225.jpg" alt="" title="dukenukem3dbox" width="300" height="225" class="alignright size-medium wp-image-109" /></a>I am doing some home wiring at my parents house and Googled around for some info on wiring phone jacks.  I came across this <a href="http://www.homephonewiring.com/">page</a>, which strangely reminded me of my first website on <a href="http://geocities.yahoo.com/">Geocities</a> 13 years ago. </p>
<p>It was a website on Duke Nukem, and made heavy use of frames, animated gifs, and some sweet back ground music.  I also had a badass page hit counter.</p>
<p>Man I wish I could find that site.  I think they deleted it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.brianhartsock.com/2008/07/10/geocities-nostalgia/feed/</wfw:commentRss>
		</item>
		<item>
		<title>LINQ&#8217;d up</title>
		<link>http://blog.brianhartsock.com/2008/07/08/linqd-up/</link>
		<comments>http://blog.brianhartsock.com/2008/07/08/linqd-up/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 01:27:48 +0000</pubDate>
		<dc:creator>bhartsock</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.brianhartsock.com/?p=107</guid>
		<description><![CDATA[I just used LINQ  for the first time ever in code.  Pretty exciting.  For me, it doesn&#8217;t get much better than transforming some mundane 6 liner into an elegant one liner.
This&#8230;

int count = 0;
foreach &#40;string email in this.emails&#41;
&#123;
    if &#40;email.EndsWith&#40;&#34;@mydomain.com&#34;&#41;&#41; count++;
&#125;
return count;

becomes this&#8230;

return this.emails.Count&#40;email =&#62; email.EndsWith&#40;&#34;@mydomain.com&#34;&#41;&#41;;

In some weird kind [...]]]></description>
			<content:encoded><![CDATA[<p>I just used <a href="http://msdn.microsoft.com/en-us/netframework/aa904594.aspx">LINQ </a> for the first time ever in code.  Pretty exciting.  For me, it doesn&#8217;t get much better than transforming some mundane 6 liner into an elegant one liner.</p>
<p>This&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="csharp"><span style="color: #FF0000;">int</span> count <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span>;
<span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> email <span style="color: #0600FF;">in</span> <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">emails</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>email.<span style="color: #0000FF;">EndsWith</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;@mydomain.com&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> count<span style="color: #008000;">++</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">return</span> count;</pre></div></div>

<p>becomes this&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="csharp"><span style="color: #0600FF;">return</span> <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">emails</span>.<span style="color: #0000FF;">Count</span><span style="color: #000000;">&#40;</span>email <span style="color: #008000;">=&gt;</span> email.<span style="color: #0000FF;">EndsWith</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;@mydomain.com&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;</pre></div></div>

<p>In some weird kind of way, I feel like an emo Ruby developer.  Maybe I&#8217;ll start wearing some tighter clothes.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.brianhartsock.com/2008/07/08/linqd-up/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Amazon S3, JungleDisk, and Me</title>
		<link>http://blog.brianhartsock.com/2008/06/29/amazon-s3-jungledisk-and-me/</link>
		<comments>http://blog.brianhartsock.com/2008/06/29/amazon-s3-jungledisk-and-me/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 23:36:20 +0000</pubDate>
		<dc:creator>bhartsock</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.brianhartsock.com/?p=103</guid>
		<description><![CDATA[I have been meaning to buy an external hard-drive to backup a lot of my data.  Well, today I decided to try out Amazon S3 as my storage medium instead of an external hard-drive.
JungleDisk has proven a great program to transfer files to S3.  In addition to working on Windows, Linux, and Mac, [...]]]></description>
			<content:encoded><![CDATA[<p>I have been meaning to buy an external hard-drive to backup a lot of my data.  Well, today I decided to try out <a href="http://www.amazon.com/s3">Amazon S3</a> as my storage medium instead of an external hard-drive.</p>
<p><a href="http://www.jungledisk.com/">JungleDisk</a> has proven a great program to transfer files to S3.  In addition to working on Windows, Linux, and Mac, it allow the mounting of S3 buckets as hard-drives.  Very good program to work with.  Right now, I am backing up my Linux desktop and my Windows laptop.</p>
<p>Whether or not I stick with it, I don&#8217;t know.  Right now, I have around 40GB of data to backup, which is $6 a month on S3 and $4 for initial upload.  I am guessing, I will probably have to spend close to $10 a month for this service.  Considering 500GB external hard-drives run about $100 right now, it doesn&#8217;t seem extremely cost effective.  Then again, I am also paying for data redundancy and recoverability, right?  Something tells me, this service will get me to organize my files better and delete files I don&#8217;t care about.  Either way, I can afford to try it out for a few months, which is something you can&#8217;t really say about a hard-drive.</p>
<p>Lastly, <a href="http://hackaddict.blogspot.com/2007/04/how-to-use-jungledisk-amazon-s3-and.html">here</a> is a good guide on using rsync with S3.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.brianhartsock.com/2008/06/29/amazon-s3-jungledisk-and-me/feed/</wfw:commentRss>
		</item>
		<item>
		<title>NUnit and RowTest</title>
		<link>http://blog.brianhartsock.com/2008/06/19/nunit-and-rowtest/</link>
		<comments>http://blog.brianhartsock.com/2008/06/19/nunit-and-rowtest/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 03:05:45 +0000</pubDate>
		<dc:creator>bhartsock</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.brianhartsock.com/?p=102</guid>
		<description><![CDATA[I have been researching different unit testing tools for .NET lately.  Obviously, NUnit was the first I came across, but MbUnit had the RowTest attribute, which allows parameters to be added to tests.  This saves a lot of code and is really a must have feature.  Luckily, I found an NUnit addin [...]]]></description>
			<content:encoded><![CDATA[<p>I have been researching different unit testing tools for .NET lately.  Obviously, <a href="http://www.nunit.org/index.php">NUnit</a> was the first I came across, but <a href="http://www.mbunit.com/">MbUnit</a> had the RowTest attribute, which allows parameters to be added to tests.  This saves a lot of code and is really a must have feature.  Luckily, I found an NUnit addin for RowTest <a href="http://www.andreas-schlapsi.com/projects/rowtest-extension-for-nunit/">here</a>.  The latest version here is linked to NUnit 2.4.6, so I rebuilt it from source to use NUnit 2.4.7.</p>
<p>To install for <a href="http://www.testdriven.net/">TestDriven.NET</a>, just create an addins folder in the <em>%install root%\TestDriven.NET 2.0\NUnit\2.4\</em> and copy NUnitExtension.RowTest.AddIn.dll to the newly created folder.  Then in your test project, just reference NUnitExtensino.RowTest and you are set to go.</p>
<p>Here is an example:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="csharp"><span style="color: #0600FF;">namespace</span> TestExample
<span style="color: #000000;">&#123;</span>
     <span style="color: #000000;">&#91;</span>TestFixture<span style="color: #000000;">&#93;</span>
     <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> Tests
     <span style="color: #000000;">&#123;</span>
          <span style="color: #000000;">&#91;</span>RowTest<span style="color: #000000;">&#93;</span>
          <span style="color: #000000;">&#91;</span>Row<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">-4</span>,<span style="color: #FF0000;">4</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
          <span style="color: #000000;">&#91;</span>Row<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">-5</span>,<span style="color: #FF0000;">5</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
          <span style="color: #000000;">&#91;</span>Row<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">-6</span>,<span style="color: #FF0000;">6</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
          <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> TestAddEqualsZero<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> x, <span style="color: #FF0000;">int</span> y<span style="color: #000000;">&#41;</span>
          <span style="color: #000000;">&#123;</span>
               Assert.<span style="color: #0000FF;">IsTrue</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>x <span style="color: #008000;">+</span> y<span style="color: #000000;">&#41;</span> <span style="color: #008000;">==</span> <span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span>;
          <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.brianhartsock.com/2008/06/19/nunit-and-rowtest/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 5.517 seconds -->
