<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>mattberther.com</title>
  <link rel="self" href="http://mattberther.com/index.xml"/>
  <id>http://mattberther.com/index.xml</id>
  <updated>2003-04-04T00:00:00Z</updated>
  <author>
    <name>Matt Berther</name>
  </author>
  <entry>
    <title>Fixed Position Footers</title>
    <link rel="alternate" href="http://mattberther.com/2011/12/08/fixed-position-footers"/>
    <id>http://mattberther.com/2011/12/08/fixed-position-footers</id>
    <published>2011-12-08T00:00:00Z</published>
    <updated>2011-12-08T00:00:00Z</updated>
    <author>
      <name>Matt Berther</name>
    </author>
    <summary type="html">&lt;p&gt;Posting mostly for my own reference&amp;hellip;&lt;/p&gt;

&lt;p&gt;One thing I find that I need to do a lot is position a footer bar across the bottom of the page. The most common way to do this is to set a fixed position on the element and anchor it to the bottom using this css:&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;Posting mostly for my own reference&amp;hellip;&lt;/p&gt;

&lt;p&gt;One thing I find that I need to do a lot is position a footer bar across the bottom of the page. The most common way to do this is to set a fixed position on the element and anchor it to the bottom using this css:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; #footer {
      width: 100%;
      position: fixed;
      bottom: 0;
      height: 75px;
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Unfortunately, this doesnt work quite right in IE. When using this style definition in IE, the footer gets locked into a specific position in the viewport and when you resize from the corner anchor the footer does not move with the window.&lt;/p&gt;

&lt;p&gt;The &lt;del&gt;proper&lt;/del&gt; cross-browser way to declare a fixed position footer is to use negative margins, like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; #footer {
      width: 100%;
      position: fixed;
      top: 100%;
      margin-top: -75px;
      height: 75px;
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This appears to function properly in every browser I&amp;rsquo;ve looked at so far.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>The Software Behind the Site</title>
    <link rel="alternate" href="http://mattberther.com/2011/12/06/the-software-behind-the-site"/>
    <id>http://mattberther.com/2011/12/06/the-software-behind-the-site</id>
    <published>2011-12-06T00:00:00Z</published>
    <updated>2011-12-06T00:00:00Z</updated>
    <author>
      <name>Matt Berther</name>
    </author>
    <summary type="html">&lt;p&gt;Several times over the past months, I&amp;rsquo;ve received questions about the software and setup that I use to run the mattberther.com blog and related pages. Since the site recently underwent a dramatic change in tooling, I want to detail what I chose and why&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;Several times over the past months, I&amp;rsquo;ve received questions about the software and setup that I use to run the mattberther.com blog and related pages. Since the site recently underwent a dramatic change in tooling, I want to detail what I chose and why.&lt;/p&gt;

&lt;p&gt;Before the change, the site was powered by wordpress. I had my own rackspace virtual server that I was using to host the apache and mysql server servers required by wordpress. Wordpress is not a bad piece of software, but what I realized is that it tries very hard to be all things to all people.&lt;/p&gt;

&lt;p&gt;Enter the blog engine Im using now: &lt;a href="http://cloudhead.io/toto"&gt;toto&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Toto&amp;rsquo;s philosophy is akin to mine: use the best tool for the job. Toto&amp;rsquo;s website states that &amp;ldquo;everything that can be done better with another tool should be&amp;rdquo;. To that end, toto doesn&amp;rsquo;t use complicated web frameworks. It doesn&amp;rsquo;t use a database. There&amp;rsquo;s no built-in commenting support. If you want comments, you&amp;rsquo;ll use &lt;a href="http://disqus.com"&gt;disqus&lt;/a&gt;. It also relies on git for version control. When you combine toto with a Heroku account, you also use git to deploy the site. Its designed to be used with a proxy cache for high availability and fast response times.&lt;/p&gt;

&lt;p&gt;Migrating the posts from the mysql database to the text files proved to be relatively straightforward, using a simple ruby script to iterate over the rows and format a text file that matched toto&amp;rsquo;s expectations. Importing the comments into the disqus platform was equally straightforward using their JSON API.&lt;/p&gt;

&lt;p&gt;I much prefer the simplicity of this new setup. The entire blog engine weighs in at about 300 lines of code. If running a blog without putting your hands on the metal and being able to control every nuance of your blog platform appeals to you, then certainly take a look at the toto/heroku combination. If not, then I believe that wordpress is a fine solution.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>"Gitting" TFS out of your way</title>
    <link rel="alternate" href="http://mattberther.com/2011/11/29/gitting-tfs-out-of-your-way"/>
    <id>http://mattberther.com/2011/11/29/gitting-tfs-out-of-your-way</id>
    <published>2011-11-29T00:00:00Z</published>
    <updated>2011-11-29T00:00:00Z</updated>
    <author>
      <name>Matt Berther</name>
    </author>
    <summary type="html">&lt;p&gt;More and more, I have developed a passion for the Git source control system. I love how Git stays out of my way, until I need to use it. Git offers a very easy way to test things out, whilst utilizing the benefits of source control. In the traditional, connected model of source control, experimentation proves to be somewhat difficult because you don&amp;rsquo;t want to corrupt your main development line. Branching and merging with most other systems is a nightmare at best. With Git, branches are very cheap and merging is virtually painless&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;More and more, I have developed a passion for the Git source control system. I love how Git stays out of my way, until I need to use it. Git offers a very easy way to test things out, whilst utilizing the benefits of source control. In the traditional, connected model of source control, experimentation proves to be somewhat difficult because you don&amp;rsquo;t want to corrupt your main development line. Branching and merging with most other systems is a nightmare at best. With Git, branches are very cheap and merging is virtually painless.&lt;/p&gt;

&lt;p&gt;I use Git for side projects as well as a few of the open source projects I am a part of. However, during the day, my organization uses Microsoft&amp;rsquo;s Team Foundation Server for source control. I find that in a connected source control model, I am constantly waiting on TFS to catch up. Either it&amp;rsquo;s out too lunch, or it needs to download and checkout a file before I can edit it. Experimentation is tough, for the reasons I mentioned earlier. Surely, there has to be something better, while still keeping TFS in the organization.&lt;/p&gt;

&lt;p&gt;Enter Git-TFS&amp;hellip; Git-tfs is a two-way bridge between Git and TFS created by &lt;a href="http://mattonrails.wordpress.com"&gt;Matt Burke&lt;/a&gt;. It allows me to clone a TFS repository and use Git for source control (without the hassles of being tied to a TFS server). This means: 1) no more waiting on TFS, 2) no more locked files, 3) no more requiring network connectivity to work on a project. At a time that I believe a development effort is ready to be committed to the main line, I use git-tfs to push my changes to the TFS server so that the rest of the team can get them.&lt;/p&gt;

&lt;p&gt;Sound interesting? Here&amp;rsquo;s how to get started:&lt;/p&gt;

&lt;p&gt;First step&amp;rsquo;s first. You need to have a Git installation on your machine. I use &lt;a href="http://code.google.com/p/msysgit/"&gt;msysGit&lt;/a&gt; 1.7.6 preview 20110708, but this should work with newer versions as well. I just used the default installation options, specifically, I chose to use the Git Bash only when prompted about how to use Git from the command line. I chose this option because it did not otherwise modify my system.&lt;/p&gt;

&lt;p&gt;Once you have a Git installation, you need to install the git-tfs plugin, which is available on github at &lt;a href="https://github.com/spraints/git-tfs"&gt;https://github.com/spraints/git-tfs&lt;/a&gt;. Installing the plugin is pretty straightforward. You can choose to either download or build it yourself. I went with the download option and extracted the zip file to c:\git-tfs. Once the files are in place, git has to know how to find them. The easiest way to do this is to add c:\git-tfs to your path (Advanced System Settings | Environment Variables).&lt;/p&gt;

&lt;p&gt;At this point, you are ready to clone a TFS repository using git-tfs. You can do this one of two ways:&lt;/p&gt;

&lt;pre class="console"&gt;git tfs clone http://tfs:8080/ $/TeamProject/folder&lt;/pre&gt;


&lt;p&gt;or&lt;/p&gt;

&lt;pre class="console"&gt;git tfs quick-clone http://tfs:8080/ $/TeamProject/folder&lt;/pre&gt;


&lt;p&gt;At this point, you are ready to open your project. If you&amp;rsquo;re using Visual Studio (which you likely are), you may still have the TFS source control bindings in place. There&amp;rsquo;s several ways to handle this. You could 1) disconnect your network cable while starting the project, 2) update all of the projects to remove the source control bindings, or 3) install &lt;a href="http://visualstudiogallery.msdn.microsoft.com/425f09d8-d070-4ab1-84c1-68fa326190f4?SRC=Home"&gt;GoOffline&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Option one is obviously less than desirable. Option two is reasonable, however, we are assuming that others on the team continue to use TFS and need to have the bindings in place. That leaves the GoOffline solution. GoOffline is a free Visual Studio add-in that adds a Go Offline button to the Source Control menu. When the solution is in offline mode, any file renames or moves happen without communicating with the TFS server. Perfect!&lt;/p&gt;

&lt;p&gt;I prefer to work in feature branches (sometimes also referred to as topic branches). Again, branches are cheap in Git and this allows me the ability to experiment while enjoying the comforts of source control and not forcing experimental changes on my team. My typical workflow with git-tfs looks something like this:&lt;/p&gt;

&lt;pre class="console"&gt;# create and checkout a new branch for feature
git checkout -b feature_name

# write tests and code

# commit my changes with a meaningful commit message
git commit -am "meaningful commit message"

# repeat the code/commit process until the feature is complete

# when ready to commit the changes to the TFS repository, first sync any newer changes from the master

# switch to the master branch
git checkout master

# pull new changes from the TFS server
git tfs pull

# switch back to the feature branch
git checkout feature_name

# import the changes from the master branch onto our feature branch
git rebase master 

# last but not least, push to TFS
# optionally, add --build-default-comment which will create a default commit message
git tfs checkintool 

&lt;/pre&gt;


&lt;p&gt;The checkintool command brings up the TFS commit dialog which allows you to associate checkins with work items and modify the commit message. Importantly, the push to TFS is done as a single commit, so regardless of how many times you commit to your git repository, the change pushed to TFS reflects only the final result and not the journey it took to get there.&lt;/p&gt;

&lt;p&gt;I have only been using this workflow for a little while now, but for now, I am &lt;em&gt;very&lt;/em&gt; happy with it. Your mileage may vary. Please let me know in the comments if you&amp;rsquo;re using this and how it&amp;rsquo;s working for you.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Goals and Goal Setting</title>
    <link rel="alternate" href="http://mattberther.com/2011/11/27/goals-and-goal-setting"/>
    <id>http://mattberther.com/2011/11/27/goals-and-goal-setting</id>
    <published>2011-11-27T00:00:00Z</published>
    <updated>2011-11-27T00:00:00Z</updated>
    <author>
      <name>Matt Berther</name>
    </author>
    <summary type="html">&lt;p&gt;&lt;strong&gt;Goals and Goal Setting:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the book &lt;em&gt;What They Don&amp;rsquo;t Teach you at Harvard Business School&lt;/em&gt;, Mark McCormak discusses the importance of setting goals. The students in the 1979 Harvard MBA program were surveyed and asked &amp;ldquo;Have you set clear, written goals for your future and made plans to accomplish them?&amp;rdquo; Only three percent of the graduates had written goals and plans; 13 percent had goals, but they were not in writing; and 84 percent had no specific goals at all&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;&lt;strong&gt;Goals and Goal Setting:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the book &lt;em&gt;What They Don&amp;rsquo;t Teach you at Harvard Business School&lt;/em&gt;, Mark McCormak discusses the importance of setting goals. The students in the 1979 Harvard MBA program were surveyed and asked &amp;ldquo;Have you set clear, written goals for your future and made plans to accomplish them?&amp;rdquo; Only three percent of the graduates had written goals and plans; 13 percent had goals, but they were not in writing; and 84 percent had no specific goals at all.&lt;/p&gt;

&lt;p&gt;Ten years later, the members of the class were surveyed again. The 13 percent of the class that had goals were earning an average of twice as much as the 84 percent who had no goals at all. However, the three percent that had clear, written goals were earning on average, &lt;strong&gt;ten times the other 97 percent combined&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For many of us, during this time of year, we begin to look at performance reviews for our team members. An important part of a good performance review are effective goals for the coming year. I am certainly not a management expert and most of the ideas that I will share with you today are not my own. However, I do see value in each of the ideas. For me, these ideas make the goal setting process easier. I certainly hope that they can do the same for you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Top Tips:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Strong relationships with directs is paramount

&lt;ul&gt;
&lt;li&gt;Many management leaders propose that having weekly one-on-ones is the single most important way to cultivate a positive relationship with your direct reports.&lt;/li&gt;
&lt;li&gt;10/10/10 agenda

&lt;ul&gt;
&lt;li&gt;10 minutes for the direct to discuss whatever they want&lt;/li&gt;
&lt;li&gt;10 minutes for you to discuss whatever you would like with the direct&lt;/li&gt;
&lt;li&gt;10 minutes to discuss business and progress toward goals&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt; Create MT goals (measurable and timely) and use SMART to validate them

&lt;ul&gt;
&lt;li&gt;Examples:

&lt;ul&gt;
&lt;li&gt;By April 30, 2011, consolidate the presentation models used by the company&amp;rsquo;s applications.&lt;/li&gt;
&lt;li&gt;Integrate the new ERP system with the CRM system by October 31, 2010.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt; Create goals that intersect business and individual objectives

&lt;ul&gt;
&lt;li&gt;Examples:

&lt;ul&gt;
&lt;li&gt;By April 30, 2011, combine multiple automated test frameworks into a single framework and increase coverage of automated tests by 20% using the consolidated framework.&lt;/li&gt;
&lt;li&gt;Complete Microsoft developer certification 70-515 by April 30, 2011.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt; Emphasize cross-team collaboration

&lt;ul&gt;
&lt;li&gt;Examples:

&lt;ul&gt;
&lt;li&gt;Participate in a mentorship program to grow understanding of our organization&amp;rsquo;s business by April 30, 2011.&lt;/li&gt;
&lt;li&gt;Participate in a mentoring program to enhance leadership and communication skills by December 31, 2009.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt; Create personal goals

&lt;ul&gt;
&lt;li&gt;Examples:

&lt;ul&gt;
&lt;li&gt;Run a 5K race in less than 32 minutes by April 30, 2010&lt;/li&gt;
&lt;li&gt;Receive a belt promotion in my chosen martial art by December 31, 2011&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt; Be flexible&lt;/li&gt;
&lt;/ul&gt;


&lt;blockquote&gt;&lt;p&gt;&amp;ldquo;I&amp;rsquo;m much more likely to accomplish something if I write my goals down and share my goals with others. Recruiting the support of other people also helps keep me on track.&amp;rdquo;&lt;/p&gt;

&lt;p&gt;&amp;ldquo;What was/is valuable to me is taking into account what I want to do when setting goals. That results in my engagement right from the start.&amp;rdquo;&lt;/p&gt;

&lt;p&gt;&amp;ldquo;I think the addition of a personal goal is a great idea. It&amp;rsquo;s good for promoting personal improvement and makes the goal setting process less painful.&amp;rdquo;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I have used this model for a number of years. The quotes above are a few pieces of feedback that I received from my team regarding these ideas.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Cygwin - unable to remap to same address as parent</title>
    <link rel="alternate" href="http://mattberther.com/2011/11/22/cygwin---unable-to-remap-to-same-address-as-parent"/>
    <id>http://mattberther.com/2011/11/22/cygwin---unable-to-remap-to-same-address-as-parent</id>
    <published>2011-11-22T00:00:00Z</published>
    <updated>2011-11-22T00:00:00Z</updated>
    <author>
      <name>Matt Berther</name>
    </author>
    <summary type="html">&lt;p&gt;I find the windows command prompt somewhat limiting and have never really been able to make the leap to Powershell. Personally, I like to use a Cygwin shell for command line work. I am comfortable in a unix shell with previous Linux and Mac experience. I&amp;rsquo;m not an expert by any means, but I can get by&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;I find the windows command prompt somewhat limiting and have never really been able to make the leap to Powershell. Personally, I like to use a Cygwin shell for command line work. I am comfortable in a unix shell with previous Linux and Mac experience. I&amp;rsquo;m not an expert by any means, but I can get by.&lt;/p&gt;

&lt;p&gt;Recently, I installed the Cygwin shell on my 64bit Windows 7 system. After installing the developer tools and trying to compile ruby 1.9.2, I found that I had a tremendous amount of problems building. Id see numerous errors that stated:&lt;/p&gt;

&lt;pre class="console"&gt;unable to remap file to same address as parent
ruby ### fork: child XXX - died waiting for dll&lt;/pre&gt;


&lt;p&gt;The most commonly referenced &lt;a href="http://www.garethhunt.com/2008/02/11/cygwin-died-waiting-for-dll-loading/"&gt;solution&lt;/a&gt; was to rebase by doing the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start &amp;ndash;&gt; Run&lt;/li&gt;
&lt;li&gt;cmd.exe&lt;/li&gt;
&lt;li&gt;cd c:\path\to\cygwin\bin\&lt;/li&gt;
&lt;li&gt;ash.exe&lt;/li&gt;
&lt;li&gt;./bin/rebaseall&lt;/li&gt;
&lt;li&gt;Reboot&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;However, this did not work for me. I found a &lt;a href="http://cygwin.com/ml/cygwin/2011-04/msg00075.html"&gt;message on the cygwin mailing list&lt;/a&gt; stating that the gems may not add information to the proper paths and that we must create the list manually.&lt;/p&gt;

&lt;p&gt;To do this, first from your cygwin shell do:&lt;/p&gt;

&lt;pre class="console"&gt;find /lib/ruby/gems -name '*.so' &gt; /tmp/ruby.gems.local.so.lst&lt;/pre&gt;


&lt;p&gt;Then, follow steps the steps above, replacing step five with:&lt;/p&gt;

&lt;pre class="console"&gt;./bin/rebaseall -T /tmp/ruby.gems.local.so.lst&lt;/pre&gt;


&lt;p&gt;Since performing this, I have not seen any more of the remap file errors. Your mileage may vary though.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Hidden Gems in Code</title>
    <link rel="alternate" href="http://mattberther.com/2011/01/26/hidden-gems-in-code"/>
    <id>http://mattberther.com/2011/01/26/hidden-gems-in-code</id>
    <published>2011-01-26T00:00:00Z</published>
    <updated>2011-01-26T00:00:00Z</updated>
    <author>
      <name>Matt Berther</name>
    </author>
    <summary type="html">&lt;p&gt;This gem was spotted in some code that my team was working on today. It made us chuckle anyway. :)&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function GetAgeOptions(localization) {
  var ageArray = new Array();
&lt;/code&gt;&lt;/pre&gt;
</summary>
    <content type="html">&lt;p&gt;This gem was spotted in some code that my team was working on today. It made us chuckle anyway. :)&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function GetAgeOptions(localization) {
  var ageArray = new Array();
  ageArray[0] = "Nick Rocks";
  ageArray[1] = "Ben Rocks too";

  return ageArray;
}
&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>ListExtensions</title>
    <link rel="alternate" href="http://mattberther.com/2010/01/20/listextensions"/>
    <id>http://mattberther.com/2010/01/20/listextensions</id>
    <published>2010-01-20T00:00:00Z</published>
    <updated>2010-01-20T00:00:00Z</updated>
    <author>
      <name>Matt Berther</name>
    </author>
    <summary type="html">&lt;p&gt;I prefer to use the abstract &lt;code&gt;IList&amp;lt;T&amp;gt;&lt;/code&gt; interface in my public APIs, rather than passing around concrete &lt;code&gt;List&amp;lt;T&amp;gt;&lt;/code&gt; implementations. However, the one thing I&amp;rsquo;ve always missed was the awesome .ForEach syntax which was available on the &lt;code&gt;List&amp;lt;T&amp;gt;&lt;/code&gt; implementation&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;I prefer to use the abstract &lt;code&gt;IList&amp;lt;T&amp;gt;&lt;/code&gt; interface in my public APIs, rather than passing around concrete &lt;code&gt;List&amp;lt;T&amp;gt;&lt;/code&gt; implementations. However, the one thing I&amp;rsquo;ve always missed was the awesome .ForEach syntax which was available on the &lt;code&gt;List&amp;lt;T&amp;gt;&lt;/code&gt; implementation.&lt;/p&gt;

&lt;p&gt;Today, I realized that I can use extension methods to add methods to interfaces.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;public static class ListExtensions
{
    public static void ForEach&amp;lt;T&amp;gt;(this IList&amp;lt;T&amp;gt; source, Action&amp;lt;T&amp;gt; action)
    {
        foreach (T item in source)
            action(item);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This now allows me to do things like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;public static void Main(string[] args)
{
    IList&amp;lt;string&amp;gt; items = GetItems();
    items.ForEach(Console.WriteLine);
}

private static IList&amp;lt;string&amp;gt; GetItems()
{
    return new List&amp;lt;string&amp;gt; { "abc", "123" };
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I much prefer this syntax to the foreach construct.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>The SwappableFile</title>
    <link rel="alternate" href="http://mattberther.com/2010/01/04/the-swappablefile"/>
    <id>http://mattberther.com/2010/01/04/the-swappablefile</id>
    <published>2010-01-04T00:00:00Z</published>
    <updated>2010-01-04T00:00:00Z</updated>
    <author>
      <name>Matt Berther</name>
    </author>
    <summary type="html">&lt;p&gt;I was doing some testing on a javascript abstraction that we created earlier. In order to test that the validation was being properly called, I wanted to drop in a new target javascript and then use WatiN to execute and validate the various calls to that javascript&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;I was doing some testing on a javascript abstraction that we created earlier. In order to test that the validation was being properly called, I wanted to drop in a new target javascript and then use WatiN to execute and validate the various calls to that javascript.&lt;/p&gt;

&lt;p&gt;I came up with (what I think is) a neat semantic for doing this. The SwappedFile implements the IDisposable interface, so you can wrap it up nicely in a using statement and make sure that the original file is reverted when completed.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class SwappedFile : IDisposable
{
    private readonly string originalFile;

    public SwappedFile(string originalFile, string newFile)
    {
        if (String.IsNullOrEmpty(originalFile)) throw new ArgumentNullException("originalFile");
        if (String.IsNullOrEmpty(newFile)) throw new ArgumentNullException("newFile");

        this.originalFile = originalFile;

        if (!File.Exists(String.Format("{0}-original", originalFile)))
        {
            File.Move(originalFile, String.Format("{0}-original", originalFile));
        }

        File.Copy(newFile, originalFile, true);
    }

    public void Dispose()
    {
        File.Delete(originalFile);
        File.Move(String.Format("{0}-original", originalFile), originalFile);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Usage is simple:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;using (new SwappedFile("original-file.txt", "new-file.txt"))
{
    // some operations using the new file
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I kinda like this, plus it beats having all of my code cluttered up with file manipulation statements.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Problems running cucumber with nokogiri</title>
    <link rel="alternate" href="http://mattberther.com/2009/09/24/problems-running-cucumber-with-nokogiri"/>
    <id>http://mattberther.com/2009/09/24/problems-running-cucumber-with-nokogiri</id>
    <published>2009-09-24T00:00:00Z</published>
    <updated>2009-09-24T00:00:00Z</updated>
    <author>
      <name>Matt Berther</name>
    </author>
    <summary type="html">&lt;p&gt;I installed cucumber last night and began trying to get some of the scenarios to work. One thing that kept plaguing me was the error message that kept coming up about using an old version of libxml2:&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;I installed cucumber last night and began trying to get some of the scenarios to work. One thing that kept plaguing me was the error message that kept coming up about using an old version of libxml2:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;HI. You&amp;rsquo;re using libxml2 version 2.6.16 which is over 4 years old and has plenty of bugs. We suggest that for maximum HTML/XML parsing pleasure, you upgrade your version of libxml2 and re-install nokogiri. If you like using libxml2 version 2.6.16, but don&amp;rsquo;t like this warning, please define the constant I_KNOW_I_AM_USING_AN_OLD_AND_BUGGY_VERSION_OF_LIBXML2 before requiring nokogiri.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;It turns out that this was relatively simply to correct on OSX Leopard by executing the following commands:&lt;/p&gt;

&lt;pre class="console"&gt;sudo gem uninstall nokogiri
curl -O ftp://xmlsoft.org/libxml2/libxml2-2.7.3.tar.gz
tar -zxvf libxml2-2.7.3.tar.gz
cd libxml2-2.7.3
./configure
make
sudo make install
sudo gem install nokogiri -- --with-xml2-include=/usr/local/include/libxml2 --with-xml2-lib=/usr/local/lib
&lt;/pre&gt;


&lt;p&gt;Although I did not see any problems from using the old version, I did get frustrated by receiving the error all the time. Problem solved.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>IIS7 and static files</title>
    <link rel="alternate" href="http://mattberther.com/2009/07/16/iis7-and-static-files"/>
    <id>http://mattberther.com/2009/07/16/iis7-and-static-files</id>
    <published>2009-07-16T00:00:00Z</published>
    <updated>2009-07-16T00:00:00Z</updated>
    <author>
      <name>Matt Berther</name>
    </author>
    <summary type="html">&lt;p&gt;So, the other day I was trying to debug a problem with one of our web applications. I had gone through the steps of making the appropriate changes to my IIS configuration for this application, so that it utilized the Classic .NET App Pool and everything seemed to be running properly. That is, until I noticed that some javascript files and some images were not rendering properly&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;So, the other day I was trying to debug a problem with one of our web applications. I had gone through the steps of making the appropriate changes to my IIS configuration for this application, so that it utilized the Classic .NET App Pool and everything seemed to be running properly. That is, until I noticed that some javascript files and some images were not rendering properly.&lt;/p&gt;

&lt;p&gt;As I utilized Firebug to try and understand what was going on, I saw that the javascript and image files were being sent with a content-length header of 0 bytes. Curious, what was causing this for some files but not all? I finally realized that the difference was that the files not being sent were static files.&lt;/p&gt;

&lt;p&gt;Thoroughly befuddled now, I began to scour the web.config file to see if something had gotten committed that caused this to happen. This was not the case. Ultimately what I found was that Microsoft, in their infinite wisdom, decided that, when picking the default settings for installing IIS7 on Windows 7 RC, people probably did not have static content that they would like to publish on the web, and therefore left the static file handler turned off. Seriously! WTF?!&lt;/p&gt;

&lt;p&gt;Anyways, to turn this on, go to Start | Control Panel | Programs and Features | Turn Windows Features On or Off | Internet Information Services | World Wide Web Services | Common Http Features and check the Static Content box.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Chuck Norris: The Programmer</title>
    <link rel="alternate" href="http://mattberther.com/2009/06/15/chuck-norris-the-programmer"/>
    <id>http://mattberther.com/2009/06/15/chuck-norris-the-programmer</id>
    <published>2009-06-15T00:00:00Z</published>
    <updated>2009-06-15T00:00:00Z</updated>
    <author>
      <name>Matt Berther</name>
    </author>
    <summary type="html">&lt;p&gt;Saw this from [codesqueeze][1] earlier today&amp;hellip; Hilarious stuff. :)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;When Chuck Norris throws exceptions, it&amp;rsquo;s across the room.&lt;/li&gt;
&lt;li&gt;All arrays Chuck Norris declares are of infinite size, because Chuck Norris knows no bounds&amp;hellip;&lt;/li&gt;
&lt;/ol&gt;

</summary>
    <content type="html">&lt;p&gt;Saw this from &lt;a href="http://www.codesqueeze.com/the-ultimate-top-25-chuck-norris-the-programmer-jokes"&gt;codesqueeze&lt;/a&gt; earlier today&amp;hellip; Hilarious stuff. :)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;When Chuck Norris throws exceptions, it&amp;rsquo;s across the room.&lt;/li&gt;
&lt;li&gt;All arrays Chuck Norris declares are of infinite size, because Chuck Norris knows no bounds.&lt;/li&gt;
&lt;li&gt;Chuck Norris doesn&amp;rsquo;t have disk latency because the hard drive knows to hurry the hell up.&lt;/li&gt;
&lt;li&gt;Chuck Norris writes code that optimizes itself.&lt;/li&gt;
&lt;li&gt;Chuck Norris can&amp;rsquo;t test for equality because he has no equal.&lt;/li&gt;
&lt;li&gt;Chuck Norris doesn&amp;rsquo;t need garbage collection because he doesn&amp;rsquo;t call .Dispose(), he calls .DropKick().&lt;/li&gt;
&lt;li&gt;Chuck Norris&amp;rsquo;s first program was kill -9.&lt;/li&gt;
&lt;li&gt;Chuck Norris burst the dot com bubble.&lt;/li&gt;
&lt;li&gt;All browsers support the hex definitions #chuck and #norris for the colors black and blue.&lt;/li&gt;
&lt;li&gt;MySpace actually isn&amp;rsquo;t your space, it&amp;rsquo;s Chuck&amp;rsquo;s (he just lets you use it).&lt;/li&gt;
&lt;li&gt;Chuck Norris can write infinite recursion functions &amp;mdash; and have them return.&lt;/li&gt;
&lt;li&gt;Chuck Norris can solve the Towers of Hanoi in one move.&lt;/li&gt;
&lt;li&gt;The only pattern Chuck Norris knows is God Object.&lt;/li&gt;
&lt;li&gt;Chuck Norris finished World of Warcraft.&lt;/li&gt;
&lt;li&gt;Project managers never ask Chuck Norris for estimations &amp;mdash; ever.&lt;/li&gt;
&lt;li&gt;Chuck Norris doesn&amp;rsquo;t use web standards as the web will conform to him.&lt;/li&gt;
&lt;li&gt;&amp;ldquo;It works on my machine&amp;rdquo; always holds true for Chuck Norris.&lt;/li&gt;
&lt;li&gt;Whiteboards are white because Chuck Norris scared them that way.&lt;/li&gt;
&lt;li&gt;Chuck Norris doesn&amp;rsquo;t do Burn Down charts, he does Smack Down charts.&lt;/li&gt;
&lt;li&gt;Chuck Norris can delete the Recycling Bin.&lt;/li&gt;
&lt;li&gt;Chuck Norris&amp;rsquo;s beard can type 140 wpm.&lt;/li&gt;
&lt;li&gt;Chuck Norris can unit test entire applications with a single assert.&lt;/li&gt;
&lt;li&gt;Chuck Norris doesn&amp;rsquo;t bug hunt as that signifies a probability of failure, he goes bug killing.&lt;/li&gt;
&lt;li&gt;Chuck Norris&amp;rsquo;s keyboard doesn&amp;rsquo;t have a Ctrl key because nothing controls Chuck Norris.&lt;/li&gt;
&lt;li&gt;When Chuck Norris is web surfing websites get the message &amp;ldquo;Warning: Internet Explorer has deemed this user to be malicious or dangerous. Proceed?&amp;rdquo;&lt;/li&gt;
&lt;/ol&gt;

</content>
  </entry>
</feed>

