<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Beautiful Futility</title>
	<atom:link href="http://beautifulfutility.com/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://beautifulfutility.com</link>
	<description>Cynicism is humor in ill health. H.G. Wells</description>
	<lastBuildDate>Sun, 18 Jul 2010 03:22:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Checking for Existing Index In RavenDB</title>
		<link>http://beautifulfutility.com/index.php/2010/07/17/checking-for-existing-index-in-ravendb/</link>
		<comments>http://beautifulfutility.com/index.php/2010/07/17/checking-for-existing-index-in-ravendb/#comments</comments>
		<pubDate>Sun, 18 Jul 2010 03:06:44 +0000</pubDate>
		<dc:creator>KevDog</dc:creator>
				<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://beautifulfutility.com/?p=330</guid>
		<description><![CDATA[For my current personal project (i.e., code I am writing for my wife) I am using RavenDB for a few reasons:

 It&#8217;s time to break out of the OO/RDBMS impedance mismatch
 Ayende is a freaking monster
 It seems the most promising of the document db&#8217;s out there

In order to do queries by anything other than [...]]]></description>
			<content:encoded><![CDATA[<p>For my current personal project (i.e., code I am writing for my wife) I am using <a href="http://ravendb.net/">RavenDB</a> for a few reasons:</p>
<ul>
<li> It&#8217;s time to break out of the OO/RDBMS impedance mismatch</li>
<li> <a href="http://ayende.com/Blog/default.aspx">Ayende</a> is a freaking monster</li>
<li> It seems the most promising of the document db&#8217;s out there</li>
</ul>
<p>In order to do queries by anything other than an id, you need to create an index. The problem space for this site is theater and here is the code I want to write.</p>
<p><code><br />
private static readonly IndexDefinition  FindByNameIndex = new IndexDefinition<br />
{<br />
    Map = shows =&gt; from show in shows select new { show.Title }<br />
};</p>
<p>public static void ConfigureIndices(DocumentStore documentStore)<br />
{<br />
var showsIndex = documentStore.DatabaseCommands.GetIndex("ShowsByTitle");<br />
if(showsIndex !=null)<br />
documentStore.DatabaseCommands.PutIndex("ShowsByTitle", FindByNameIndex);<br />
}<br />
</code></p>
<p>What I find odd about the API at this point is that the GetIndex method throws an InvalidOperationException index doesn&#8217;t exist (which is fine, no problems there) but that there doesn&#8217;t seem to be a way to check if the index does exist, something like:</p>
<p><code><br />
bool indexExists = documentStore.DatabaseCommands.DoesIndexExist("ShowsByTitle");<br />
</code></p>
<p>I could just wrap the current call in a try/catch, but that seems a little strange for what seems to be a standard use case of checking to see if something exists.</p>
]]></content:encoded>
			<wfw:commentRss>http://beautifulfutility.com/index.php/2010/07/17/checking-for-existing-index-in-ravendb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Day of Pomodoro</title>
		<link>http://beautifulfutility.com/index.php/2010/05/21/the-day-of-pomodoro/</link>
		<comments>http://beautifulfutility.com/index.php/2010/05/21/the-day-of-pomodoro/#comments</comments>
		<pubDate>Fri, 21 May 2010 13:48:26 +0000</pubDate>
		<dc:creator>KevDog</dc:creator>
				<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://beautifulfutility.com/?p=326</guid>
		<description><![CDATA[I have a problem with shiny things distracting me. But since the shiny things are so compelling, I need a mental way to deal with them. It needs to be streamlined, simple, and effective. I&#8217;ve tried the GTD way, but I can&#8217;t seem to hold onto doing it for than a week at a time.
For [...]]]></description>
			<content:encoded><![CDATA[<p>I have a problem with shiny things distracting me. But since the shiny things are so compelling, I need a mental way to deal with them. It needs to be streamlined, simple, and effective. I&#8217;ve tried the <a href="en.wikipedia.org/wiki/Getting_Things_Done">GTD</a> way, but I can&#8217;t seem to hold onto doing it for than a week at a time.</p>
<p>For a couple of years now, I&#8217;ve seen posts on <a href="http://www.pomodorotechnique.com/">The Pomodoro Technique</a>, the 25 minute at a time way to manage daily work. </p>
<p>So far, so good. No matter how it goes, I think I really need to take a lesson from Scott Hanselman. That guy gets tons done in a day and there must be a reason.</p>
]]></content:encoded>
			<wfw:commentRss>http://beautifulfutility.com/index.php/2010/05/21/the-day-of-pomodoro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using CodedUITest in Visual Studio 2010</title>
		<link>http://beautifulfutility.com/index.php/2010/05/20/using-codeduitest-in-visual-studio-2010/</link>
		<comments>http://beautifulfutility.com/index.php/2010/05/20/using-codeduitest-in-visual-studio-2010/#comments</comments>
		<pubDate>Thu, 20 May 2010 20:07:28 +0000</pubDate>
		<dc:creator>KevDog</dc:creator>
				<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://beautifulfutility.com/?p=321</guid>
		<description><![CDATA[Since the company I work for doesn&#8217;t have a big QA presence (we&#8217;re working on it), it&#8217;s often the case that UI changes break things with no one being aware of it.
I&#8217;m not a giant fan of automated UI tests, my brief experience with them has shown them to be brittle. Regardless, I was still [...]]]></description>
			<content:encoded><![CDATA[<p>Since the company I work for doesn&#8217;t have a big QA presence (we&#8217;re working on it), it&#8217;s often the case that UI changes break things with no one being aware of it.</p>
<p>I&#8217;m not a giant fan of automated UI tests, my brief experience with them has shown them to be brittle. Regardless, I was still excited when the CodedUITest functionality was baked into Visual Studio 2010.</p>
<p>Here&#8217;s how things have gone for me so far:</p>
<p>1. Rookie mistake, don&#8217;t launch your web application in debug mode. If you do, you won&#8217;t be able to generate the code from what you have recorded.</p>
<p>2. Make the first action be to click on the browser to bring it into focus.</p>
<p>3. Like all unit tests, keep the assertions small. The first test I got to run successfully only checked that after I logged in, my name was in the welcome tag.</p>
<p>I&#8217;m going to be trying this feature out over the next couple of weeks and hope to post something more substantive on it. Maybe one of those vaunted series of posts all the cool kids do.</p>
]]></content:encoded>
			<wfw:commentRss>http://beautifulfutility.com/index.php/2010/05/20/using-codeduitest-in-visual-studio-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Server.Map Path Failure</title>
		<link>http://beautifulfutility.com/index.php/2010/02/23/server-map-path-failure/</link>
		<comments>http://beautifulfutility.com/index.php/2010/02/23/server-map-path-failure/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 21:29:04 +0000</pubDate>
		<dc:creator>KevDog</dc:creator>
				<category><![CDATA[Culture]]></category>

		<guid isPermaLink="false">http://beautifulfutility.com/?p=318</guid>
		<description><![CDATA[This is one of those posts that exists to remind myself of my own stupidity.
So, this is the code I was writing:
string pathToFile =
Server.MapPath(ConfigurationManager.AppSettings.Get(&#8221;SmartCardMaker_PathToPdfForm&#8221;));
FileStream _stream = new FileStream(pathToFile,FileMode.Open,FileAccess.ReadWrite);
string pathToFile =                    Server.MapPath(ConfigurationManager.AppSettings.Get(&#8221;SmartCardMaker_PathToPdfForm&#8221;));
FileStream _stream = new FileStream(pathToFile,FileMode.Open,FileAccess.ReadWrite);
Seems pretty straightforward, but for the life of me I couldn&#8217;t figure out [...]]]></description>
			<content:encoded><![CDATA[<p>This is one of those posts that exists to remind myself of my own stupidity.</p>
<p>So, this is the code I was writing:</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">string pathToFile =</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Server.MapPath(ConfigurationManager.AppSettings.Get(&#8221;SmartCardMaker_PathToPdfForm&#8221;));</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">FileStream _stream = new FileStream(pathToFile,FileMode.Open,FileAccess.ReadWrite);</div>
<p>string pathToFile =                    Server.MapPath(ConfigurationManager.AppSettings.Get(&#8221;SmartCardMaker_PathToPdfForm&#8221;));</p>
<p>FileStream _stream = new FileStream(pathToFile,FileMode.Open,FileAccess.ReadWrite);</p>
<p>Seems pretty straightforward, but for the life of me I couldn&#8217;t figure out why the code would run locally and on the dev server, but not on the staging environment, where I was getting a SecurityAccessException. Here&#8217;s the catch;</p>
<p>I&#8217;m using a WebDeployment Project on this gig (like I nearly always do) with sections of web.config being overwritten based on build configuration. I forgot to add the key for the path to the replacement files and the call to Server.MapPath() was returning the path to the folder of the page that was making the call.</p>
<p>I didn&#8217;t find it on the dev box, because I was using the &#8220;publish&#8221; function rather than the deployment script, so the same web.config file was being used locally and on dev.</p>
<p>It would have been nice if the call to ConfigurationManager.AppSettings.Get had thrown an exception on the missing key item rather than failing silently, but it would have been smarter for me to make the changes to web.config replacement files in the first place.</p>
<p>Some days, I&#8217;m a real dummy.</p>
]]></content:encoded>
			<wfw:commentRss>http://beautifulfutility.com/index.php/2010/02/23/server-map-path-failure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom DataAnnotation for US States</title>
		<link>http://beautifulfutility.com/index.php/2009/11/28/custom-dataannotation-for-us-states/</link>
		<comments>http://beautifulfutility.com/index.php/2009/11/28/custom-dataannotation-for-us-states/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 04:54:46 +0000</pubDate>
		<dc:creator>KevDog</dc:creator>
				<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://beautifulfutility.com/?p=310</guid>
		<description><![CDATA[Pivoting off this post by Phil Haack about creating custom data annotations, I found myself in need of one today when putting together some code for a project for the spousal unit. I wanted to be sure that a given field contained a valid abbreviation for a U.S. State.
It&#8217;s simple, but it works. I&#8217;m going [...]]]></description>
			<content:encoded><![CDATA[<p>Pivoting off <a href="http://haacked.com/archive/2009/11/19/aspnetmvc2-custom-validation.aspx" target="_blank">this post</a> by Phil Haack about creating custom data annotations, I found myself in need of one today when putting together some code for a project for the spousal unit. I wanted to be sure that a given field contained a valid abbreviation for a U.S. State.</p>
<p>It&#8217;s simple, but it works. I&#8217;m going to be creating a lot of these custom validators now that I know how easy it is. Let&#8217;s go to the code:</p>
<p>public class IsStateAttribute : ValidationAttribute<br />
{<br />
private static string stateAbbreviationsRegex =  @&#8221;\A(?:AL|AK|AS|AZ|AR|CA|CO|CT|DE|DC|FL|FM|GA|GU|HI|ID|IL|IN|</p>
<p>IA|KS|KY|LA|ME|MH|MD|MA|MI|MN|MS|MO|MT|NE|NV|NH|NJ|NM|NY|</p>
<p>NC|ND|MP|OH|OK|OR|PW|PR|RI|SC|SD|TN|TX|UT|VT|VI|VA|WA|WV|WI|</p>
<p>WY|AE|AA|AP)\Z&#8221;;<br />
public override bool IsValid(object value)<br />
{<br />
if (value == null)<br />
{<br />
return true;<br />
}<br />
var state = (string)value;<br />
if (Regex.IsMatch(state, stateAbbreviationsRegex))<br />
{<br />
return true;<br />
}</p>
<p>return false;<br />
}<br />
}</p>
<p>A couple of things to notice:</p>
<p>1. If there is no entry, the attribute returns true. This is another tidbit I got from Phil, let the RequiredAttribute do its thing. We&#8217;re only here to validate if the value is present.</p>
<p>2. For the keen-eyed, there are more than 50 entries in the regex. Why? Because I included U.S. Territories like Guam (Guam is a funny word in and of itself. Back in the stand-up comedy days, I used it more than once in a punchline. Sorry if I&#8217;m offending anyone reading this in Guam.) as well as military abbreviations. You don&#8217;t have to use them in whatever drop-down you&#8217;re filling this field with, I added them for completeness.</p>
<p>Usage is what you would expect:</p>
<p>[IsState(ErrorMessage="Please Enter a Valid State Abbreviation")]<br />
[Required(ErrorMessage = "State is Required")]<br />
public string State { get; set; }</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://beautifulfutility.com/index.php/2009/11/28/custom-dataannotation-for-us-states/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linq to Sql Won&#8217;t Generate Partial Methods for View</title>
		<link>http://beautifulfutility.com/index.php/2009/11/23/linq-to-sql-wont-generate-partial-methods-for-view/</link>
		<comments>http://beautifulfutility.com/index.php/2009/11/23/linq-to-sql-wont-generate-partial-methods-for-view/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 18:37:58 +0000</pubDate>
		<dc:creator>KevDog</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[LinqToSql]]></category>

		<guid isPermaLink="false">http://beautifulfutility.com/?p=308</guid>
		<description><![CDATA[So let&#8217;s say that you drag your view onto the design surface in L2S. Why, you ask, aren&#8217;t there the extensibility methods for OnCreated() and the rest of the INotifyPropertyChanged interface?
Because a view doesn&#8217;t have a primary key and without one there is nothing to track.
Set a PK, save, and watch the magic happen.
]]></description>
			<content:encoded><![CDATA[<p>So let&#8217;s say that you drag your view onto the design surface in L2S. Why, you ask, aren&#8217;t there the extensibility methods for OnCreated() and the rest of the INotifyPropertyChanged interface?</p>
<p>Because a view doesn&#8217;t have a primary key and without one there is nothing to track.</p>
<p>Set a PK, save, and watch the magic happen.</p>
]]></content:encoded>
			<wfw:commentRss>http://beautifulfutility.com/index.php/2009/11/23/linq-to-sql-wont-generate-partial-methods-for-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s Literally Been Months&#8230;</title>
		<link>http://beautifulfutility.com/index.php/2009/11/17/304/</link>
		<comments>http://beautifulfutility.com/index.php/2009/11/17/304/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 03:33:48 +0000</pubDate>
		<dc:creator>KevDog</dc:creator>
				<category><![CDATA[Culture]]></category>

		<guid isPermaLink="false">http://beautifulfutility.com/?p=304</guid>
		<description><![CDATA[Since I have written a post here, and for good reason. Most of the time that I spent writing about politics and such here in comments in other places, I was unemployed. Which makes plenty of time available for writing and venting one&#8217;s spleen. It&#8217;s all well and good to call yourself a freelance software [...]]]></description>
			<content:encoded><![CDATA[<p>Since I have written a post here, and for good reason. Most of the time that I spent writing about politics and such here in comments in other places, I was unemployed. Which makes plenty of time available for writing and venting one&#8217;s spleen. It&#8217;s all well and good to call yourself a freelance software engineer, but if there ain&#8217;t no code coming out from the fingers, you&#8217;re lying to yourself.</p>
<p>So, since late last year I&#8217;ve been back in the game full-time. And now I will be transitioning this blog to more technical matters. For those who like web programming, Agile development practices, and long discussions about how to properly caffeinate oneself for a long night of coding, welcome. For the few of you (and you know who you are), many thanks for the time that you did hang with me here.</p>
]]></content:encoded>
			<wfw:commentRss>http://beautifulfutility.com/index.php/2009/11/17/304/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Man, I&#8217;m Tired&#8230;</title>
		<link>http://beautifulfutility.com/index.php/2009/02/05/man-im-tired/</link>
		<comments>http://beautifulfutility.com/index.php/2009/02/05/man-im-tired/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 02:15:14 +0000</pubDate>
		<dc:creator>KevDog</dc:creator>
				<category><![CDATA[Culture]]></category>

		<guid isPermaLink="false">http://beautifulfutility.com/?p=299</guid>
		<description><![CDATA[&#8230;and I know that most of you are too. Sorry, I just need a moment to vent to the outside world. The kids are swimming the bacteria frappe of kindergarten and pre-school and I have a sinus blockage so bad that oxygen needs a passport to get into my lungs.
There, that feels better already.
]]></description>
			<content:encoded><![CDATA[<p>&#8230;and I know that most of you are too. Sorry, I just need a moment to vent to the outside world. The kids are swimming the bacteria frappe of kindergarten and pre-school and I have a sinus blockage so bad that oxygen needs a passport to get into my lungs.</p>
<p>There, that feels better already.</p>
]]></content:encoded>
			<wfw:commentRss>http://beautifulfutility.com/index.php/2009/02/05/man-im-tired/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#8217;m Trying to Be the Shepherd</title>
		<link>http://beautifulfutility.com/index.php/2009/01/30/im-trying-to-be-the-shepherd/</link>
		<comments>http://beautifulfutility.com/index.php/2009/01/30/im-trying-to-be-the-shepherd/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 13:55:39 +0000</pubDate>
		<dc:creator>KevDog</dc:creator>
				<category><![CDATA[Culture]]></category>

		<guid isPermaLink="false">http://beautifulfutility.com/?p=297</guid>
		<description><![CDATA[There is an inherent contradiction, I think, in being a widely read blogger and a decent human being. As just about anyone who has been here at least once knows, I made some people mad last week. The consequence of that were three days of easily my best traffic on the web.
Things have dropped more [...]]]></description>
			<content:encoded><![CDATA[<p>There is an inherent contradiction, I think, in being a widely read blogger and a decent human being. As just about anyone who has been here at least once knows, I made some people mad last week. The consequence of that were three days of easily my best traffic on the web.</p>
<p>Things have dropped more than a little since then, mostly because I have less time to write. But also because I am, in the real world, trying to be less argumentative. Or at least less of a jerk about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://beautifulfutility.com/index.php/2009/01/30/im-trying-to-be-the-shepherd/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Definition of Ass-Hat</title>
		<link>http://beautifulfutility.com/index.php/2009/01/30/the-definition-of-ass-hat/</link>
		<comments>http://beautifulfutility.com/index.php/2009/01/30/the-definition-of-ass-hat/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 13:49:28 +0000</pubDate>
		<dc:creator>KevDog</dc:creator>
				<category><![CDATA[Culture]]></category>

		<guid isPermaLink="false">http://beautifulfutility.com/?p=295</guid>
		<description><![CDATA[Has to go to CEO Howard Schultz of Starbucks, who described closing 300 stores and firing nearly seven thousand workers as a courageous decision.
Not to put too fine a point on it, Howie ol&#8217; boy, but this has nothing to do with courage. This has to do with saving your own ass and the company [...]]]></description>
			<content:encoded><![CDATA[<p>Has to go to CEO Howard Schultz of Starbucks, who described closing 300 stores and firing nearly seven thousand workers as a <a href="http://www.usatoday.com/money/industries/food/2009-01-28-starbucks_N.htm">courageous decision</a>.</p>
<p>Not to put too fine a point on it, Howie ol&#8217; boy, but this has nothing to do with courage. This has to do with saving your own ass and the company you built. Here&#8217;s a little test for you: go to one of the people you just laid off and tell them how courageous you are for fucking up their life.</p>
<p>I won&#8217;t hold my breath.</p>
]]></content:encoded>
			<wfw:commentRss>http://beautifulfutility.com/index.php/2009/01/30/the-definition-of-ass-hat/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
