<?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:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">

<channel>
	<title>Chad Gorshing's Blog</title>
	
	<link>http://blog.gorshing.net</link>
	<description>Be Good</description>
	<lastBuildDate>Sun, 12 Sep 2010 16:39:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ChadGorshingsBlog" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="chadgorshingsblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Different Levels of Cooks</title>
		<link>http://blog.gorshing.net/2010/09/12/different-levels-of-cooks/</link>
		<comments>http://blog.gorshing.net/2010/09/12/different-levels-of-cooks/#comments</comments>
		<pubDate>Sun, 12 Sep 2010 16:39:43 +0000</pubDate>
		<dc:creator>gorshing</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.gorshing.net/?p=164</guid>
		<description><![CDATA[There are a few different types of people who cook food. First you have the person who doesn&#8217;t actually cook the food themselves, they typically perform to go out and pay for this service. They don&#8217;t worry about many aspects to cooking, such as the act itself, preparation, tools (oven, pots, utensils). They typically enjoy [...]]]></description>
			<content:encoded><![CDATA[<p>There are a few different types of people who cook food. First you have the person who doesn&#8217;t actually cook the food themselves, they typically perform to go out and pay for this service. They don&#8217;t worry about many aspects to cooking, such as the act itself, preparation, tools (oven, pots, utensils). They typically enjoy the experience, what the cooks produce, and the presentation; and are content with being disconnected of the process.</p>
<p>Another type is more of a single parent mom who is busy enough with running her kids around to where ever they need to be. She cares tremendously about her kids and what she puts into their body, but many times, due to time constraints, they order out. When she does cook, she is looking for a recipe which will provide a quick meal and enough to feed all her kids. She is not concerned with all the aspects of cooking as she would much rather spend time with her kids and helping with homework. They look towards someone or something to help create the meal quicker, so their uni-tools begin to emerge.</p>
<p>Family recipes and consistency is the typical meal plan for another type of family. Tradition sets in because of sentimental value and a sense of belonging to a family and how things used to be back in the good &#8216;ol days. They will most always cook the food themselves and are absolutely closed to the idea of improving or changing how their meals are made. After all how dare someone suggest a change to a family legacy? The tools they use stay the same, they are still using the knife and cutting board that has been handed down generation after generation.</p>
<p>The one which fits my household currently is having a tradition but also trying out different recipes found by watching AB (Alton Brown), Emeril Lagasse, Rachael Ray, Giada De Laurentiis, and numerous other shows and magazine recipes. There are family traditions, but they are willing to try something different in hopes of improving the family meal. One draw back to this is on occasion the meals turn out horrible, either by cooking the meal completely wrong or by not satisfying the family&#8217;s taste buds. After a disaster they using revert either to paying for a meal as a last resort, or by going back to the traditions they are comfortable with. But also on other occasions great things come from trying out different recipes and ways of cooking and new traditions are born. They also start to care about their tools and what they are using to cook with. A sense of pride of their tools and the process begins to emerge.</p>
<p>Professional cooks are on a level all their own, and they typically take on the &#8216;chef&#8217; moniker. They possess great culinary skill and each cook begins to take on a specialty they are either talented in or have a great desire in learning more about. There is also a ranking system within a team. You have an executive chef, su chef, saute chef and so on. They pay top dollar for the tools they use and the environment in which they work is something completely different than other people who cook. They study the *art* of cooking, travel the world to see how people prepare food, offer up their talents for other people to use and consume their product. What they currently produce will not stand, they actively make an attempt at progressing further.</p>
<p>What do you think? How well does this transfer over to the software world? I also wonder how much contention is between these different levels. As I see it, in the software world, groups of developers are also quick to make a judgement about another set/type of developers. We need to see that all of us have different priorities in what we want to accomplish and neither side is wrong.</p>
<p>One last thing I would like to note about chefs, I can&#8217;t help but imagine that at some family gatherings people will ask for the chefs advice for a quick fix here and there.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gorshing.net/2010/09/12/different-levels-of-cooks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET MVC Tags</title>
		<link>http://blog.gorshing.net/2010/09/12/asp-net-mvc-tags/</link>
		<comments>http://blog.gorshing.net/2010/09/12/asp-net-mvc-tags/#comments</comments>
		<pubDate>Sun, 12 Sep 2010 15:43:19 +0000</pubDate>
		<dc:creator>gorshing</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.gorshing.net/?p=222</guid>
		<description><![CDATA[I was looking through the NerdDinner source code, and ran across the]]></description>
			<content:encoded><![CDATA[<p>I was looking through the NerdDinner source code, and ran across the <%: syntax in the views. I tried many different combinations of searching through Google and Stackoverflow, but I couldn't find anything. I finally found the answer accidently while reading Phil Haack's <a href="http://haacked.com/archive/2009/09/25/html-encoding-code-nuggets.aspx">blog post</a>. I kept trying to search for tags (including the words percent and colon) and the like, but it looks like Microsoft references them as a code block or code nugget.</p>
<p>This is to replace or supersede the <%= syntax. More specifically it is to alleviate some of the repetitive typing of <%= Html.Encode as is typically seen through ASP.NET MVC apps.</p>
<p>Please refer back to Phil&#8217;s post on more information about this topic, this is something more people need to be aware of and using through their MVC2 apps (only for ASP.NET 4).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gorshing.net/2010/09/12/asp-net-mvc-tags/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cherish Your Opponent</title>
		<link>http://blog.gorshing.net/2010/06/21/cherish-your-opponent/</link>
		<comments>http://blog.gorshing.net/2010/06/21/cherish-your-opponent/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 02:54:15 +0000</pubDate>
		<dc:creator>gorshing</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.gorshing.net/?p=235</guid>
		<description><![CDATA[I was reading about Harold Abrahams recently and was absolutely blown away by something I read in Wikipedia&#8217;s article (I have shorten it for brevity): Abrahams won the 100m in a time of 10.6 seconds, beating all the American favorites. In third place was Arthur Porritt &#8230; The Paris Olympics 100m dash took place at [...]]]></description>
			<content:encoded><![CDATA[<p>I was reading about Harold Abrahams recently and was absolutely blown away by something I read in <a href="http://en.wikipedia.org/wiki/Harold_Abrahams">Wikipedia&#8217;s article</a> (I have shorten it for brevity):</p>
<blockquote><p>Abrahams won the 100m in a time of 10.6 seconds, beating all the American favorites. In third place was Arthur Porritt &#8230; The Paris Olympics 100m dash took place at 7pm on 7 July 1924 (Abrahams and Porritt dined together at 7pm on 7 July every year thereafter, until Abrahams&#8217; death).</p></blockquote>
<p>I had to read this a couple times then had to sit and reflect on this to make sure I understand it wholly.</p>
<p>I have read and been told of some of the great respect and honor people seemed to once have in the past. I think we are starting to lose this (maybe I&#8217;ve just not been enlightened).</p>
<p>There are times when I don&#8217;t stay in contact with people whom I consider to be good friends of mine, let alone people who were once my opponent/competitor. I do not think I can fathom the great respect or honor these gentlemen had for each other.</p>
<p>I would be glad to see this once again in our age, and it all starts with the person in the mirror.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gorshing.net/2010/06/21/cherish-your-opponent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Table of Contents Code Kata</title>
		<link>http://blog.gorshing.net/2010/06/17/table-of-contents-code-kata/</link>
		<comments>http://blog.gorshing.net/2010/06/17/table-of-contents-code-kata/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 13:43:50 +0000</pubDate>
		<dc:creator>gorshing</dc:creator>
				<category><![CDATA[Code Katas]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.gorshing.net/?p=226</guid>
		<description><![CDATA[I was looking through some code the other day that generated web based documentation for a framework. They, of course, list everything in a table of contents layout with those being links to the actual files. In order to achieve this, they break out each section into a file. So the first section is located [...]]]></description>
			<content:encoded><![CDATA[<p>I was looking through some code the other day that generated web based documentation for a framework. They, of course, list everything in a table of contents layout with those being links to the actual files.</p>
<p>In order to achieve this, they break out each section into a file. So the first section is located in the file named &#8220;1. Introduction.txt&#8221;, and the 2.3.5.1 section is located in the file named &#8220;2.3.5.1 Section Name.txt&#8221; &#8211; simple enough?</p>
<p>They do not use another file to specify how to order these files, there is already a convention. They just execute a directory listing, then sort this list.</p>
<p>As an example, given this as input:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[
  '2.2 Next Agenda Item.txt',
  '2.1.1 Baby Step.txt',
  '1. Introduction.txt',
  '2.1 Moving Forward.txt',
  '2. Getting Started.txt'
]</pre></div></div>

<p>Should result in:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[
  '1. Introduction.txt',
  '2. Getting Started.txt',
  '2.1 Moving Forward.txt',
  '2.1.1 Baby Step.txt',
  '2.2 Next Agenda Item.txt'
]</pre></div></div>

<p>I wouldn&#8217;t worry about actually making the files. Just have a list of file names, then sort them to match up with how they are actually suppose to be sorted.</p>
<p>So I&#8217;m curious, do you think this is code kata? It is much shorter than other ones I have seen, but I think we do need variations of katas.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gorshing.net/2010/06/17/table-of-contents-code-kata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Startup Success Podcast</title>
		<link>http://blog.gorshing.net/2010/03/29/the-startup-success-podcast/</link>
		<comments>http://blog.gorshing.net/2010/03/29/the-startup-success-podcast/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 12:58:18 +0000</pubDate>
		<dc:creator>gorshing</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.gorshing.net/?p=218</guid>
		<description><![CDATA[I am not sure how I ended up subscribing to &#8216;The Startup Success Podcast&#8216;, but I am very glad that I did. I have been listening to this for about three weeks now, and I have been passing up some of my other podcast subscriptions in favor of this one. Some of the more recent [...]]]></description>
			<content:encoded><![CDATA[<p>I am not sure how I ended up subscribing to &#8216;<a href="http://startuppodcast.wordpress.com/">The Startup Success Podcast</a>&#8216;, but I am very glad that I did. I have been listening to this for about three weeks now, and I have been passing up some of my other podcast subscriptions in favor of this one.</p>
<p>Some of the more recent ones I have really enjoyed are:<br />
#52 <a href="http://twitter.com/SRAMANA">Sramana Mitra</a><br />
#53 <a href="http://twitter.com/benhatten">Ben Hatten</a> of <a href="http://www.legalriver.com/">Legal River</a><br />
#55 <a href="http://twitter.com/GTDGuy">David Allen</a> of <a href="http://en.wikipedia.org/wiki/Getting_Things_Done">Getting Things Done</a><br />
#56 <a href="http://www.atomicobject.com/pages/Carl+Erickson">Carl Erickson</a> of <a href="http://www.atomicobject.com/">Atomic Object</a><br />
#57 <a href="http://sethgodin.typepad.com/">Seth Godin</a></p>
<p>And on my way to work this morning I started #60 <a href="http://www.youtube.com/watch?v=rrkrvAUbU9Y">Daniel</a> <a href="http://www.danpink.com/">Pink</a> on Startups and Motivation (part 1), I have really enjoyed this first part, and I&#8217;m looking forward to part two.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gorshing.net/2010/03/29/the-startup-success-podcast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Character Sets Having Trouble With An Apostrophe</title>
		<link>http://blog.gorshing.net/2010/02/10/character-sets-having-trouble-with-an-apostrophe/</link>
		<comments>http://blog.gorshing.net/2010/02/10/character-sets-having-trouble-with-an-apostrophe/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 05:24:25 +0000</pubDate>
		<dc:creator>gorshing</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.gorshing.net/?p=204</guid>
		<description><![CDATA[In the past I had read Joel Spolsky&#8217;s article over character sets. Occasionally I run into a problem where certain characters do not show correctly, but for the most part I do nothing about it as I can determine what the word or letter is suppose to be. At one my previous client location, I [...]]]></description>
			<content:encoded><![CDATA[<p>In the past I had read Joel Spolsky&#8217;s article over <a href="http://www.joelonsoftware.com/articles/Unicode.html">character sets</a>. Occasionally I run into a problem where certain characters do not show correctly, but for the most part I do nothing about it as I can determine what the word or letter is suppose to be.</p>
<p>At one my previous client location, I was lucky enough to have a broken test. This struck me as odd, as it was only one test and not many. It was on a fresh install of Ubuntu and I assumed I had something out of place relating to configuration. I spent roughly four hours tracking down the problem and finally determined that Ubuntu was set to use UTF-8 and the development and deployment environments where meant to run as 8859, the Windows default encoding.</p>
<p>So when will you change? Dave Ramsey said &#8220;<em>Most people won&#8217;t change until the pain of where they are exceeds the pain of the change</em>&#8220;, well I hit that point. I have begun to learn a little more about the funny looking &#8216;?&#8217; symbols shown when I expect something else.</p>
<p>The <a href="http://www.npiquet.com/news.asp?NewsID=340">article</a> which I was reading happened to be something referenced from Wikipedia. I&#8217;m not sure how this will show up as I would expect someone to correct the issue, but the following are some cropped images of how it looked on a WindowsXP box (they look the same on Mac using FireFox, Chrome, and Safari):<br />
Safari<br />
<a href="http://blog.gorshing.net/wp-content/uploads/2010/02/Safari.png"><img src="http://blog.gorshing.net/wp-content/uploads/2010/02/Safari.png" alt="" title="Safari" width="114" height="29" class="alignnone size-full wp-image-208" /></a></p>
<p>Internet Explorer<br />
<a href="http://blog.gorshing.net/wp-content/uploads/2010/02/InternetExplorer.png"><img src="http://blog.gorshing.net/wp-content/uploads/2010/02/InternetExplorer.png" alt="" title="InternetExplorer" width="123" height="24" class="alignnone size-full wp-image-207" /></a></p>
<p>FireFox<br />
<a href="http://blog.gorshing.net/wp-content/uploads/2010/02/firefox.png"><img src="http://blog.gorshing.net/wp-content/uploads/2010/02/firefox.png" alt="" title="firefox" width="119" height="23" class="alignnone size-full wp-image-206" /></a></p>
<p>Chrome<br />
<a href="http://blog.gorshing.net/wp-content/uploads/2010/02/Chrome.png"><img src="http://blog.gorshing.net/wp-content/uploads/2010/02/Chrome.png" alt="" title="Chrome" width="112" height="25" class="alignnone size-full wp-image-205" /></a></p>
<p>The character is obviously an apostrophe, but saving the source out and viewing the value shows 0222/0&#215;92/146 (1001 0010 binary, take your pick). The encoding of the page is set to <a href="http://en.wikipedia.org/wiki/ISO/IEC_8859-2">8859-2</a>, which Firefox sets the page to correctly &#8230; but of course this shows the question mark in the diamond shape. When I override the default encoding and change it to <a href="http://en.wikipedia.org/wiki/ISO/IEC_8859-1">8859-1</a> then it shows fine.</p>
<p>I thought that I had it all figured out at this point. This is an easy case right? The encoding is just wrong, in that it shouldn&#8217;t be 8859-2, but 8859-1. Well if you look through the 8859-1 character set, there is not any apostrophe near 146 (side note: if you don&#8217;t know how to use an apostrophe or unsure on some parts, then <a href="http://theoatmeal.com/comics/apostrophe">The Oatmeal</a> has an awesome explanation). I tried many combinations to try and get something to calculate out, such as dropping the most significant bit which would leave me with 18 decimal. But I could never get close to what an apostrophe should be showing as.</p>
<p>As it turns out, according to <a href="http://htmlhelp.com/reference/charset/">this article</a>:</p>
<blockquote><p>ISO-8859-1 explicitly does not define displayable characters for positions 0-31 and 127-159, and the HTML standard does not allow those to be used for displayable characters.</p></blockquote>
<p>So it seems like no browser should show anything for that character.</p>
<p>So the question still remains, why does switching the encoding to 8859-1 make Firefox show it right?</p>
<p>Shockingly, <a href="http://en.wikipedia.org/wiki/ISO/IEC_8859-1#ISO-8859-1_and_Windows-1252_confusion">Wikipedia</a> to the rescue:</p>
<blockquote><p>It is very common to mislabel text data with the charset label ISO-8859-1, even though the data is really Windows-1252 encoded. In Windows-1252, codes between 0&#215;80 and 0x9F are used for letters and punctuation, whereas they are control codes in ISO-8859-1. Many web browsers and e-mail clients will interpret ISO-8859-1 control codes as Windows-1252 characters in order to accommodate such mislabeling but it is not standard behaviour and care should be taken to avoid generating these characters in ISO-8859-1 labeled content. However, the draft HTML 5 specification requires that documents advertised as ISO-8859-1 actually be parsed with the Windows-1252 encoding.</p></blockquote>
<p>So FireFox, upon being told of using the 8859-1 character set instead of the declared 8859-2, notices this mistake and displays it as the Windows-1252 encoding. Doing so the apostrophe finally shows up in correct fashion.</p>
<p>I believe I&#8217;m going to enjoy this journey down the Character Set Path.</p>
<p>I must acknowledge <a href="http://www.drpaulcarter.com/">Paul Carter</a>, as he pointed out the article from Wikipedia.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gorshing.net/2010/02/10/character-sets-having-trouble-with-an-apostrophe/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My Lessons Learned From Rhino.Mocks</title>
		<link>http://blog.gorshing.net/2010/01/25/my-lessons-learned-from-rhino-mocks/</link>
		<comments>http://blog.gorshing.net/2010/01/25/my-lessons-learned-from-rhino-mocks/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 03:42:18 +0000</pubDate>
		<dc:creator>gorshing</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.gorshing.net/?p=188</guid>
		<description><![CDATA[Recently I have begun working with Rhino.Mocks and I stumbled a little bit getting up to speed. My experience with mocks is from using JMock1 with a Java project. This is the first time I have used mocks on a .NET project so it took me a little bit getting used to the syntax. From [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have begun working with Rhino.Mocks and I stumbled a little bit getting up to speed. My experience with mocks is from using JMock1 with a Java project. This is the first time I have used mocks on a .NET project so it took me a little bit getting used to the syntax.</p>
<p>From looking at all the tutorials and examples on the web about Rhino.Mocks I couldn&#8217;t really find anything that was a kick in the pants from my stand point. Most of the tutorials didn&#8217;t discuss the methods Rhino.Mocks framework in any detail, and would instead go into, somewhat, depth about the theory of mocking. I already know (or at least think I do) the theory of mocking so I was really wanting something to get me going quickly.</p>
<p>I found a video by the creator of Rhino.Mocks, Ayende, which really helped out. I wanted to put up here some of the key points. You can watch the video at http://www.ayende.com/hibernating-rhinos.aspx.</p>
<p>The &#8216;_mocks&#8217; variable listed below is a reference to the mocks repository, this will basically contain all of your mocks:</p>
<pre lang="C#">var _mocks = new MockRepository();</pre>
<p>The ReplayAll method, _mocks.ReplayAll(), puts the framework into record mode. You will need to call this method after creating your mocks and setting expectations. The Rhino.Mock framework will begin to track all the method calls and verify the expected counts (if any) are meet. In the video Ayende talks about this around 11:08, 28:10 &#038; 29:50. There is not any issue with calling this method repeatedly, so having it in your TearDown method as a precaution will not cause any problems.</p>
<p>One other thing that sent me on a wild goose chase is the error message:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">require a return value or an exception to throw</pre></div></div>

<p>This will occur when you don&#8217;t move your tests from Record mode to Replay mode (typically you are missing a _mocks.ReplayAll() method call). What happens is you call a method such as &#8216;user.GetPurchases()&#8217;, and in my case I was making an assertion on the expected values. But the framework is waiting on you to specify an expectation or a return value, but since this is missing Rhino.Mocks can not handle it and so throws that exception.</p>
<p>As the name implies &#8216;_mocks.VerifyAll()&#8217; will verify any outstanding expectations which were set by you, I have this in my TearDown method as well.</p>
<p>What&#8217;s the difference between Expect.Call and LastCall.Constraints?<br />
As he discusses in the video at 36:55, this is due to a constraint the compiler enforces. If you had the following code:</p>
<pre lang="C#">class User {
  public void Save() { .... }
}</pre>
<p>Then of course the compiler will not allow you to have syntax such as:</p>
<pre lang="C#">Expect.Call(user.Save())</pre>
<p>You will need a way to execute the call, then set expectations on that &#8230; well, last call. Simple name huh? Shockingly he discusses this as well in the video at 36:55. Both of syntaxes are basically the same, the Expect.Call syntax is actually changed into the LastCall format. He shows how to mock out a void return type around 19:40.</p>
<p>Another exception/error you might stumble across is:</p>
<pre>This action is invalid when the mock object is in verified state.</pre>
<p>You will run across this while trying to setup a mock or expectation and in the record phase. My mistake was putting the creation of the MockRepository instance (the _mocks variable) in the TestFixtureSetup method &#8211; being this is only called once per the entire test class, my MockRepository was not being recreated. So I received the error &#8211; switching this to be what I expected, the Setup attribute, then all was well.</p>
<p>Something I have yet to look into is the difference between the following lines:</p>
<pre lang="C#">Expect.Call(order.PaidInFull).Return(false);

-- and --

SetupResult.For(order.PaidInFull).Return(false);</pre>
<p>If you know of what the difference might be, I would be happy to hear.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gorshing.net/2010/01/25/my-lessons-learned-from-rhino-mocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the blank constraint in Grails</title>
		<link>http://blog.gorshing.net/2009/11/29/using-the-blank-constraint-in-grails/</link>
		<comments>http://blog.gorshing.net/2009/11/29/using-the-blank-constraint-in-grails/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 15:16:47 +0000</pubDate>
		<dc:creator>gorshing</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.gorshing.net/2009/11/29/using-the-blank-constraint-in-grails/</guid>
		<description><![CDATA[I have just begun using Grails for Less Out and have been accustomed to using the ‘def’ keyword when declaring any variables. I really don’t have any particular reason in doing it this way, I just wanted to use the features of Groovy when ever possible … when in Rome. This past weekend I was [...]]]></description>
			<content:encoded><![CDATA[<p>I have just begun using Grails for <a href="http://www.lessout.com">Less Out</a> and have been accustomed to using the ‘def’ keyword when declaring any variables. I really don’t have any particular reason in doing it this way, I just wanted to use the features of Groovy when ever possible … when in Rome.</p>
<p>This past weekend I was working on an Action which is passed a Command, the Command has a few constraints and one of them was:</p>

<div class="wp_syntax"><div class="code"><pre class="grails" style="font-family:monospace;">static constraints = { 
  name blank:false, nullable:false 
}</pre></div></div>

<p>This is pretty harmless, but I was not able to get a test to pass. I was never able to get the blank constraint to fail.</p>
<p>I then started to hunt through the Grails source code and found the <a href="http://github.com/grails/grails-core/blob/master/src/java/org/codehaus/groovy/grails/validation/BlankConstraint.java">BlankConstraint</a> source. More specifically, I think the culprit (somebody please prove me wrong here) is the ‘supports’ method.</p>

<div class="wp_syntax"><div class="code"><pre class="grails" style="font-family:monospace;">public boolean supports(Class type) {
        return type != null &amp;&amp; String.class.isAssignableFrom(type);
&nbsp;
}</pre></div></div>

<p>One thing I left out is I declared the &#8216;name&#8217; variable as:</p>

<div class="wp_syntax"><div class="code"><pre class="grails" style="font-family:monospace;">def name</pre></div></div>

<p>The ‘supports’ method checks if String is assignable from the passed in type, and since you can think of def as an Object (<a href="http://groovy.codehaus.org/Scoping+and+the+Semantics+of+%22def%22">documentation</a>) then the method will return false.</p>
<p>Once I changed my declaration to: </p>

<div class="wp_syntax"><div class="code"><pre class="grails" style="font-family:monospace;">String name</pre></div></div>

<p>Then all my test validations worked correctly.</p>
<p>I could see how Grails would not want to throw an exception in this scenario (especially given this late in the game) but a log statement stating it is skipping over this contraints would be very much appreciated.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gorshing.net/2009/11/29/using-the-blank-constraint-in-grails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion, TortoiseSVN, and Putty</title>
		<link>http://blog.gorshing.net/2009/10/29/subversion-tortoisesvn-and-putty/</link>
		<comments>http://blog.gorshing.net/2009/10/29/subversion-tortoisesvn-and-putty/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 22:05:07 +0000</pubDate>
		<dc:creator>gorshing</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.gorshing.net/?p=175</guid>
		<description><![CDATA[I recently changed development machines and needed to setup TortoiseSVN again using SSH, and I ran into a problem where I could only access Subversion if it was the only authorized key. For my host I&#8217;m using Site5, but I&#8217;m sure this applies more generally than just for Site5. I already have another set of [...]]]></description>
			<content:encoded><![CDATA[<p>I recently changed development machines and needed to setup TortoiseSVN again using SSH, and I ran into a problem where I could only access Subversion if it was the only authorized key. For my host I&#8217;m using Site5, but I&#8217;m sure this applies more generally than just for Site5. I already have another set of keys working for ssh, and that public key is the first line of my authorized_keys2 file (the &#8217;2&#8242; is somewhat optional).</p>
<p>My url for svn is something similar to &#8216;svn+ssh://domainname_svn/trunk&#8217;, I verified this just to make sure from a backup I have on another machine. So I knew I was using the right url, but I still wasn&#8217;t able to connect. I have pageant running and have both (one for ssh and one specifically for svn) keys loaded.</p>
<p>When I tried to check out a working copy with Tortoise, it would give me a error. When I would change my authorized_keys file on the server to only have the svn key then it worked just fine. Once again I knew the server was setup correctly as I had no problems previously.</p>
<p>What my problem was I had not specified a key under putty. I use putty&#8217;s saved sessions to specify a couple of options only for my svn connection. I had not specified anything under Connection -> SSH -> Auth -> Private Key.</p>
<p>Once I filled that in with the correct key then it didn&#8217;t matter what keys Pageant had loaded.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gorshing.net/2009/10/29/subversion-tortoisesvn-and-putty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gossip According to Dave Ramsey</title>
		<link>http://blog.gorshing.net/2009/09/07/gossip-according-to-dave-ramsey/</link>
		<comments>http://blog.gorshing.net/2009/09/07/gossip-according-to-dave-ramsey/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 22:20:29 +0000</pubDate>
		<dc:creator>gorshing</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.gorshing.net/2009/09/07/gossip-according-to-dave-ramsey/</guid>
		<description><![CDATA[I regularly listen to ‘The Dave Ramsey’ on my iPod and thought his rant on gossip in the work place was a pretty good piece. How do you incorporate a no-gossip policy at work? (mp3 download 5.54MB 6 minutes)]]></description>
			<content:encoded><![CDATA[<p>I regularly listen to ‘The Dave Ramsey’ on my iPod and thought his rant on gossip in the work place was a pretty good piece.</p>
<p><a href="http://blog.gorshing.net/wp-content/uploads/2009/09/Dave Ramsey - Gossip.mp3">How do you incorporate a no-gossip policy at work</a>? (mp3 download 5.54MB 6 minutes)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gorshing.net/2009/09/07/gossip-according-to-dave-ramsey/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

