<?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>Tue, 23 Feb 2010 21:29:04 +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>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>
		<item>
		<title>There Are Some Things I Can&#8217;t Say</title>
		<link>http://beautifulfutility.com/index.php/2009/01/28/there-are-some-things-i-cant-say/</link>
		<comments>http://beautifulfutility.com/index.php/2009/01/28/there-are-some-things-i-cant-say/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 01:33:25 +0000</pubDate>
		<dc:creator>KevDog</dc:creator>
				<category><![CDATA[Culture]]></category>
		<category><![CDATA[Food]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://beautifulfutility.com/index.php/2009/01/04/there-are-some-things-i-cant-say/</guid>
		<description><![CDATA[Why is it that I can tell my son that his Grandfather died (which was about six months ago) but I still can&#8217;t tell him that Barbaro died three years ago?
Every horse he sees he calls Barbaro. He talks about how he can run now, something I agree with. 
I distinctly remember that Kentucky Derby [...]]]></description>
			<content:encoded><![CDATA[<p>Why is it that I can tell my son that his Grandfather died (which was about six months ago) but I still can&#8217;t tell him that Barbaro died three years ago?</p>
<p>Every horse he sees he calls Barbaro. He talks about how he can run now, something I agree with. </p>
<p>I distinctly remember that Kentucky Derby and KJ yelling for Barbaro to win. I think he just like the sound of the name. </p>
<p>He&#8217;ll probably learn about Santa before this. </p>
]]></content:encoded>
			<wfw:commentRss>http://beautifulfutility.com/index.php/2009/01/28/there-are-some-things-i-cant-say/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I May Not Know Much About Art, But I Know What I Like&#8230;</title>
		<link>http://beautifulfutility.com/index.php/2009/01/25/i-may-not-know-much-about-art-but-i-know-what-i-like/</link>
		<comments>http://beautifulfutility.com/index.php/2009/01/25/i-may-not-know-much-about-art-but-i-know-what-i-like/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 16:52:59 +0000</pubDate>
		<dc:creator>KevDog</dc:creator>
				<category><![CDATA[Culture]]></category>

		<guid isPermaLink="false">http://beautifulfutility.com/?p=289</guid>
		<description><![CDATA[
Haven't we been here before? Like many things, Monty Python says it best...]]></description>
			<content:encoded><![CDATA[<p>Ta-Nehisi Coates gets on those who criticize people who cracked on the poetry at the Inauguration while admitting <a href="http://ta-nehisicoates.theatlantic.com/archives/2009/01/what_we_dont_understand.php">they don&#8217;t know about poetry.</a>.</p>
<p>Haven&#8217;t we been here before? Like many things, Monty Python says it best&#8230;</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/J4oKXagF3IE&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/J4oKXagF3IE&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://beautifulfutility.com/index.php/2009/01/25/i-may-not-know-much-about-art-but-i-know-what-i-like/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Ultimate Iraq War Weasel Word</title>
		<link>http://beautifulfutility.com/index.php/2009/01/25/the-ultimate-iraq-war-weasel-word/</link>
		<comments>http://beautifulfutility.com/index.php/2009/01/25/the-ultimate-iraq-war-weasel-word/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 14:22:26 +0000</pubDate>
		<dc:creator>KevDog</dc:creator>
				<category><![CDATA[Culture]]></category>

		<guid isPermaLink="false">http://beautifulfutility.com/?p=287</guid>
		<description><![CDATA[The prize goes to &#8220;precipitous&#8221;, as in &#8220;precipitous withdrawal&#8220;. Left out is any practical definition of what that means. Politically,  it means any course of actions that doesn&#8217;t go perfectly. And given the right-wing screeders who claim that the Iraq War has been won, there&#8217;s little doubt about which way they will go.
I&#8217;d dearly [...]]]></description>
			<content:encoded><![CDATA[<p>The prize goes to &#8220;precipitous&#8221;, as in &#8220;<a href="http://www.cnn.com/2009/WORLD/meast/01/22/iraq.withdrawal/">precipitous withdrawal</a>&#8220;. Left out is any practical definition of what that means. Politically,  it means any course of actions that doesn&#8217;t go perfectly. And given the right-wing screeders who claim that the Iraq War has been won, there&#8217;s little doubt about which way they will go.</p>
<p>I&#8217;d dearly love to find some reference to an Iraq War supporter who doesn&#8217;t modify &#8220;withdrawal&#8221; with &#8220;precipitous&#8221;, but I doubt there are any to be found.</p>
]]></content:encoded>
			<wfw:commentRss>http://beautifulfutility.com/index.php/2009/01/25/the-ultimate-iraq-war-weasel-word/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
