<?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>Jason Pettys Blog</title>
	<atom:link href="http://jason.pettys.name/feed/" rel="self" type="application/rss+xml" />
	<link>http://jason.pettys.name</link>
	<description></description>
	<lastBuildDate>Sun, 05 Feb 2012 04:15:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>The Speed of Trust: Chapter 2</title>
		<link>http://jason.pettys.name/2012/02/04/the-speed-of-trust-chapter-2/</link>
		<comments>http://jason.pettys.name/2012/02/04/the-speed-of-trust-chapter-2/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 04:12:47 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Leadership]]></category>
		<category><![CDATA[Softer Skills]]></category>

		<guid isPermaLink="false">http://jason.pettys.name/2012/02/04/the-speed-of-trust-chapter-2/</guid>
		<description><![CDATA[There were two points in the second chapter of The Speed of Trust that had an impact on me. Stewardship and Accountability I learned in this chapter that the Stephen Covey who wrote this book is the son of the &#8230; <a href="http://jason.pettys.name/2012/02/04/the-speed-of-trust-chapter-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There were two points in the second chapter of <em><a href="http://www.amazon.com/gp/product/1416549005/ref=as_li_ss_tl?ie=UTF8&amp;tag=jaspetblo-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1416549005">The Speed of Trust</a></em> that had an impact on me.</p>
<h3>Stewardship and Accountability</h3>
<p>I learned in this chapter that the Stephen Covey who wrote this book is the son of the Stephen Covey who wrote the popular <em><a href="http://www.amazon.com/gp/product/0743269519/ref=as_li_ss_tl?ie=UTF8&amp;tag=jaspetblo-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0743269519">Seven Habits</a></em> book. In <em>Seven Habits</em>, the father tells the story of teaching his son to take care of his yard. In <em>The Speed of Trust</em> we get to hear that very son tell <em>his</em> side of the story. I enjoyed seeing this story from those different perspectives. The son’s main point was that when his father entrusted the keeping of the yard to him, that trust inspired him to become trustworthy. The main aspects of this story that I found instructive were:</p>
<ul>
<li><strong>Clear stewardship.</strong> The father said the grass was to be kept “green and clean.” He showed in detail by example what both of those words meant.</li>
<li><strong>Defined accountability. </strong>The father explained that once a week they would walk through the yard together to see how well the son was keeping the yard green and clean.</li>
<li><strong>Autonomy of the “steward.” </strong>The father explained that the son was to use his own plan, his own timeline, his own resources, his own ideas to carry out his stewardship. The father didn’t give him detailed instructions, and wasn’t going to be reminding him and driving him to get the work done.</li>
<li><strong>Sufficient equipping. </strong>The father said he would be willing to help if the son needed it. It was clear that the son would need to ask for it, but all the resources of the father would be available to the son to be successful in his stewardship.</li>
<li><strong>Allowing failure.</strong> Things didn’t go perfectly right away; the son neglected his duties for a while. Yet the father honored the son’s autonomy by not nagging on him to get to work. The time of reckoning came, of course, at the agreed upon appointment when the accounting came. There were tears at this accounting, but the agreement continued, and the father dealt with things in a way that lead to the son learning how to keep the yard green and clean.</li>
<li><strong>Trust created trustworthiness. </strong>In this book, Covey’s primary emphasis was that when you entrust something to someone, just the very act of entrusting someone with the responsibility can inspire them to become more trustworthy. (Of course one can take this to naïve and foolish extremes.)</li>
</ul>
<p>The story in the book that illustrates these things adds a lot of meaning to these points. I am going to try to put this into practice with my kids and their chores and schoolwork. At this point we are homeschooling our kids, and a few of them wear their mother out because she has to keep riding them to keep on their work. I think a system like this may help – to tell them, “It’s no longer your mother’s job to make sure you get your work done. It’s your job. And every other evening you have an appointment with me, where you will give an account of where your schoolwork and chores are at.”</p>
<h3>Trust = Character + Competence</h3>
<p>It seems very true to me. When we trust someone in a particular circumstance, we have to trust both their character and their competence. Other ways to describes these are integrity and intelligence; personal trust and expertise trust; heart and head.</p>
<p>Consider that a person can be a wonderfully nice and honest person who never breaks the most minute law, always holds doors for ladies and helps the elderly. But if that person is not a very good carpenter, you’re not going to trust him to build the shed in your back yard. For specific circumstances, character is not enough; competence is necessary.</p>
<p>The reverse is certainly true: you can have the most proficient carpenter in the world, but if he’s a liar and a cheat and has a dangerous temper, you’re not going to want to work with him, either.</p>
<p>I found the examination of the two facets of trust to be very clarifying to my own thinking.</p>
]]></content:encoded>
			<wfw:commentRss>http://jason.pettys.name/2012/02/04/the-speed-of-trust-chapter-2/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>&quot;Please Prepay&quot;</title>
		<link>http://jason.pettys.name/2012/01/18/please-prepay/</link>
		<comments>http://jason.pettys.name/2012/01/18/please-prepay/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 15:11:12 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Leadership]]></category>

		<guid isPermaLink="false">http://jason.pettys.name/2012/01/18/please-prepay/</guid>
		<description><![CDATA[Yesterday&#8217;s post about The Speed of Trust hit me in a new way this morning when I was filling up with gas. The sign on the pump said, &#8220;Please Prepay.&#8221; Wow, does that slow things down, doesn&#8217;t it? Instead of &#8230; <a href="http://jason.pettys.name/2012/01/18/please-prepay/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://jason.pettys.name/2012/01/17/the-speed-of-trust-chapter-1/">Yesterday&#8217;s post</a> about <em><a href="http://www.amazon.com/gp/product/1416549005/ref=as_li_ss_tl?ie=UTF8&amp;tag=jaspetblo-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1416549005">The Speed of Trust</a></em> hit me in a new way this morning when I was filling up with gas. The sign on the pump said, &#8220;Please Prepay.&#8221; Wow, does that slow things down, doesn&#8217;t it? Instead of simply filling up and walking in to pay, I have to walk in, walk out, fill up, and walk in again. That also has to create extra overhead for the workers if I overpay the first time in: they have to keep track of how much I gave them and then look it up when I come in for change. If I underpay then I suppose I don&#8217;t get a full gas tank and either have to fill up more often or go through further rigmarole to top off.</p>
<p>Yet one more way that the world is slowed down because of the number of people who aren&#8217;t trustworthy.</p>
]]></content:encoded>
			<wfw:commentRss>http://jason.pettys.name/2012/01/18/please-prepay/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Speed of Trust: Chapter 1</title>
		<link>http://jason.pettys.name/2012/01/17/the-speed-of-trust-chapter-1/</link>
		<comments>http://jason.pettys.name/2012/01/17/the-speed-of-trust-chapter-1/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 12:14:23 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Leadership]]></category>

		<guid isPermaLink="false">http://jason.pettys.name/?p=118</guid>
		<description><![CDATA[I’m slowly picking my way through Stephen Covey’s book, The Speed of Trust. In chapter one Stephen makes a compelling argument that trust makes a very real difference in the amount of time and money required to get work done. &#8230; <a href="http://jason.pettys.name/2012/01/17/the-speed-of-trust-chapter-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I’m slowly picking my way through Stephen Covey’s book, <a href="http://www.amazon.com/gp/product/1416549005/ref=as_li_ss_tl?ie=UTF8&amp;tag=jaspetblo-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1416549005"><em>The Speed of Trust</em></a>. In chapter one Stephen makes a compelling argument that trust makes a very real difference in the amount of time and money required to get work done.</p>
<h3>Corporate Application</h3>
<p>Consider the example of Warren Buffet when acquiring McLane Distribution from Wal-Mart. Such a merger typically takes months, with several million dollars for accountants, auditors, and attorneys. The two parties in the case trusted one another; the deal was made with a two-hour meeting, and completed in less than a month. I find Warren Buffett’s words from his 2004 annual report to be very powerful: “We did no ‘due diligence.’ We knew everything would be exact as Wal-Mart said it would be – and it was.”</p>
<p>On the other hand, the incredible cost large companies face of implementing the Sarbanes-Oxley can be attributed to the distrust created by Enron and WorldCom.</p>
<h3>Individual Application</h3>
<p>The speed of trust is not just for the corporate world. The book suggests that the “office politics” that people hate are usually extra overhead created because people distrust one another.</p>
<p>When describing what trust is, as Covey sees it, he writes that trust is <em>confidence</em>; it’s the opposite of <em>suspicion</em>. When you trust someone, you have confidence in their integrity and abilities. When you distrust someone, you are suspicious of their integrity, agenda, capabilities or their track record. Working with someone you trust is often joyful and efficient; working with someone you distrust is draining, tedious and cumbersome.</p>
<p>My own example: consider even simply going on a camping and fishing trip with someone you have confidence in: you believe they are trustworthy to bring ample supplies; you have confidence in their abilities to be able to help efficiently with all the little duties needed to have a fun and successful trip. How much less would you enjoy a trip like that with someone who you didn&#8217;t have confidence in?</p>
<h3>&#8220;Doug&#8221;</h3>
<p>I thought it was a surprising coincidence that after reading this chapter I heard a couple more stories in a different context that related to this.</p>
<p>I heard second-hand the story of a successful businessman in the Fargo area. His family has owned a grain elevator for years in the past. When a farmer brings his grain in, an elevator worker scoops a handful of grain out to sample it for chaff and moisture content; the value of the grain depends on the sample. Elevator owners know that the shape they hold their hand in as they scoop up the grain makes a difference in the amount of chaff picked up. There&#8217;s a big temptation for owners to pick up as much chaff as they can, and thereby pay less for the grain. When this man&#8217;s father taught him to do it, he said, &#8220;You hold your hand like this, to get the best possible price for the farmer. The reason, Doug, is that our customers must trust us.&#8221;</p>
<p>Later in this man&#8217;s life, when his software business was growing but still struggling, this life-lesson of trust was tested. The company had shipped out software with a major bug. The timing couldn&#8217;t have been worse: the nation-wide (world-wide?) convention was imminent.</p>
<p>Of course the buzz of the convention was angry customers complaining about the issue. Doug took a huge risk, putting the company on the line. During a talk of the convention he said, &#8220;We messed up. We&#8217;re working hard to fix it. We know this is costing you money. I can&#8217;t make any promises, but <em>send us a bill for the expense we&#8217;ve cost you.</em>&#8221; This was very risky because the company at this time wasn&#8217;t flush with cash. But suddenly so much of the trust (confidence) that had been lost in this company was turned around. The tone of conversations at the convention changed dramatically.</p>
<p>Here&#8217;s where the speed of trust hits hard: Out of the hundreds of customers that were invited to send bills, <em>only two did</em>. I suppose this indicates that the customers weren&#8217;t as concerned about the money loss as they were the lack of confidence they had in the company, and when Doug acknowledged the mix-up and was willing to go to such lengths to make it right, the trust and confidence was restored.</p>
<h3>Looking forward to the rest of the book</h3>
<p>Covey talks about how earning and keeping trust sometimes has to be a deliberate effort; you don&#8217;t get it by default. People with whom you don&#8217;t often interact, by default will doubt you. Covey talks about <em>proactively</em> establishing and increasing trust. I&#8217;m excited to learn what he has to say about doing that; hopefully the techniques aren&#8217;t ways to <em>fake</em> trustworthiness, but simply ways to express whether you are trustworthy or not. I&#8217;m excited about how the ideas in this book might improve relationships in every area of my life.</p>
<p>Link to <a href="http://www.amazon.com/gp/product/1416549005/ref=as_li_ss_tl?ie=UTF8&amp;tag=jaspetblo-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1416549005"><em>The Speed of Trust</em></a> on Amazon.</p>
]]></content:encoded>
			<wfw:commentRss>http://jason.pettys.name/2012/01/17/the-speed-of-trust-chapter-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Force a SQL Restore</title>
		<link>http://jason.pettys.name/2011/12/16/force-a-sql-restore/</link>
		<comments>http://jason.pettys.name/2011/12/16/force-a-sql-restore/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 22:34:05 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[CodeMinder]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://jason.pettys.name/2011/12/16/force-a-sql-restore/</guid>
		<description><![CDATA[Really tired of having to google this and piece it together every time I want it, so I&#8217;m posting it here. .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } &#8230; <a href="http://jason.pettys.name/2011/12/16/force-a-sql-restore/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Really tired of having to google this and piece it together every time I want it, so I&#8217;m posting it here.</p>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<pre class="csharpcode"><span class="kwrd">alter</span> <span class="kwrd">database</span> DbName
    <span class="kwrd">set</span> single_user
    <span class="kwrd">with</span> <span class="kwrd">rollback</span> <span class="kwrd">immediate</span>
<span class="kwrd">go</span>

<span class="kwrd">restore</span> <span class="kwrd">database</span> DbName
    <span class="kwrd">from</span> <span class="kwrd">disk</span> = <span class="str">'path/to/backup.bak'</span>
    <span class="kwrd">with</span> <span class="kwrd">file</span> = 1, replace</pre>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<p>Notables:</p>
<ul>
<li>Works best to run against the master database.</li>
<li>The file = 1 part may need to be changed if there are multiple backups in the file and the one you want isn&#8217;t the first one.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jason.pettys.name/2011/12/16/force-a-sql-restore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>User Experience: Find the Send Button</title>
		<link>http://jason.pettys.name/2011/12/16/user-experience-find-the-send-button/</link>
		<comments>http://jason.pettys.name/2011/12/16/user-experience-find-the-send-button/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 17:50:14 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[General PC Usage]]></category>
		<category><![CDATA[UX]]></category>

		<guid isPermaLink="false">http://jason.pettys.name/2011/12/16/user-experience-find-the-send-button/</guid>
		<description><![CDATA[I typically use Gmail; I do have a Hotmail account and needed to use that for something the other day. I typed up my new message, and had to hunt for the Send button. It took about 5-10 seconds. I &#8230; <a href="http://jason.pettys.name/2011/12/16/user-experience-find-the-send-button/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I typically use Gmail; I do have a Hotmail account and needed to use that for something the other day. I typed up my new message, and <u>had to hunt for the Send button</u>. It took about 5-10 seconds.</p>
<p><a href="http://jason.pettys.name/wp-content/uploads/2011/12/image2.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jason.pettys.name/wp-content/uploads/2011/12/image_thumb2.png" width="615" height="394"></a></p>
<p>I found the obscurity of the Send button annoying. &#8220;There&#8217;s got to be a better way to do that,&#8221; thought I. Pull up Gmail &#8211; no problem finding it. A much smarter UX design. A breath of fresh air, even.</p>
<p><a href="http://jason.pettys.name/wp-content/uploads/2011/12/image3.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jason.pettys.name/wp-content/uploads/2011/12/image_thumb3.png" width="621" height="462"></a></p>
<p>Microsoft seems to really struggle with getting good UX, and it kills me. It&#8217;s like being a Minnesota Vikings fan &#8211; I really want them to do well, but even when they&#8217;ve got something good going, and put together a really awesome thing, they always seem to snatch defeat from the jaws of victory. My wife doesn&#8217;t use a Windows Phone because of some very specific UX decisions Microsoft made poorly (see &#8220;aside&#8221; below). I suspect the reason Microsoft can&#8217;t get UX right has to do with this image being a little too true: <a href="http://www.bonkersworld.net/organizational-charts/">http://www.bonkersworld.net/organizational-charts/</a></p>
<p>A culture of militant fragmentation manifests itself in their products; their UI&#8217;s come out fragmented rather than cohesive. It&#8217;s hard to sort out political power plays from earnest pursuit of excellence, so stuff that really should get done gets blocked. And it&#8217;s been going on for a loooong time (eg, how far buried ClearType was in Windows XP).</p>
<p>I know there are folks within Microsoft trying to change this. Here&#8217;s wishing for the best to them and to the Vikings.</p>
<p>&#8212;</p>
<p>Aside: the Windows Phone UX disaster was that to save a phone number on a new contact, you had to first click &#8220;Ok&#8221; for the phone number, then click &#8220;Save&#8221; on the contact. The second step shouldn&#8217;t have <em>ever</em> been there. Steve Jobs would have found it before the phone ever released, fired the person who put it in there, and it never would have seen the light of day. Thankfully Microsoft fixed this UX travesty in Mango, but they created an Apple fan in my wife &#8211; she returned her Windows Phone and loves her iPhone now.</p>
]]></content:encoded>
			<wfw:commentRss>http://jason.pettys.name/2011/12/16/user-experience-find-the-send-button/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>NDesk.Options</title>
		<link>http://jason.pettys.name/2011/11/17/ndesk-options/</link>
		<comments>http://jason.pettys.name/2011/11/17/ndesk-options/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 23:15:47 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jason.pettys.name/2011/11/17/ndesk-options/</guid>
		<description><![CDATA[Parsing command-line arguments can be deceptively tricky. Often it starts as something very simple to do manually, but as more arguments and formats and flexibility are desired, the effort required to do it well can explode. So there are several &#8230; <a href="http://jason.pettys.name/2011/11/17/ndesk-options/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Parsing command-line arguments can be deceptively tricky. Often it starts as something very simple to do manually, but as more arguments and formats and flexibility are desired, the effort required to do it well can explode.</p>
<p>So there are several nuget packages for libraries to help with this. I chose <a href="http://www.ndesk.org/Options">NDesk.Options</a> and I liked it. Here&#8217;s what your command-line argument code might look if you used this library.</p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">class</span> MyProgramSettings {

    <span class="kwrd">public</span> <span class="kwrd">string</span> InputFile { get; set; }
    <span class="kwrd">public</span> <span class="kwrd">string</span> ErrorFile { get; set; }
    <span class="kwrd">public</span> <span class="kwrd">string</span> OutputFile { get; set; }
    <span class="kwrd">public</span> <span class="kwrd">bool</span> ShowStackTrace { get; set; }

}

<span class="kwrd">public</span> <span class="kwrd">static</span> Main(<span class="kwrd">string</span>[] args) {
    var settings = <span class="kwrd">new</span> MyProgramSettings();
    var showHelp = <span class="kwrd">false</span>;

    var parser = <span class="kwrd">new</span> NDesk.Options.OptionSet() {
        { <span class="str">"h|?|help"</span>,  <span class="str">"Show available options"</span>,       v =&gt; showHelp = <span class="kwrd">true</span> },
        { <span class="str">"i=|input"</span>,  <span class="str">"The name of the input file."</span>,  v =&gt; settings.InputFile = v },
        { <span class="str">"e=|error"</span>,  <span class="str">"The name file to log errors."</span>, v =&gt; settings.ErrorFile = v },
        { <span class="str">"o=|output"</span>, <span class="str">"The name of the output file."</span>, v =&gt; settings.OutputFile = v },
        { <span class="str">"s|stack "</span>,  <span class="str">"Show stack traces."</span>,           v =&gt; settings.ShowStackTrace = <span class="kwrd">true</span> }
    };

    parser.Parse(args);
    <span class="kwrd">if</span>(showHelp) {
        parser.WriteOptionDescriptions(Console.Out);
    }
}
</pre>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
]]></content:encoded>
			<wfw:commentRss>http://jason.pettys.name/2011/11/17/ndesk-options/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Write MSMQ Messages from PowerShell</title>
		<link>http://jason.pettys.name/2011/11/07/write-msmq-messages-from-powershell/</link>
		<comments>http://jason.pettys.name/2011/11/07/write-msmq-messages-from-powershell/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 22:59:10 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[CodeMinder]]></category>
		<category><![CDATA[MSMQ]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jason.pettys.name/2011/11/07/write-msmq-messages-from-powershell/</guid>
		<description><![CDATA[This PowerShell script sends a message to an MSMQ. I did it this particular way because NServiceBus can consume messages sent like this. [Reflection.Assembly]::LoadWithPartialName("System.Messaging"); $queueName = '.\Private$\your.queue.name'; $queue = new-object System.Messaging.MessageQueue $queueName; $utf8 = new-object System.Text.UTF8Encoding; $tran = new-object System.Messaging.MessageQueueTransaction; &#8230; <a href="http://jason.pettys.name/2011/11/07/write-msmq-messages-from-powershell/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This PowerShell script sends a message to an MSMQ. I did it this particular way because NServiceBus can consume messages sent like this.</p>
<pre class="csharpcode">[Reflection.Assembly]::LoadWithPartialName(<span class="str">"System.Messaging"</span>);

$queueName = <span class="str">'.\Private$\your.queue.name'</span>;
$queue = <span class="kwrd">new</span>-<span class="kwrd">object</span> System.Messaging.MessageQueue $queueName;
$utf8 = <span class="kwrd">new</span>-<span class="kwrd">object</span> System.Text.UTF8Encoding;

$tran = <span class="kwrd">new</span>-<span class="kwrd">object</span> System.Messaging.MessageQueueTransaction;
$tran.Begin();

$msgContent = <span class="str">'&lt;?xml version="1.0" ?&gt;
    &lt;Messages xmlns="your-xml-namespace"&gt;
        &lt;IWebApplicationStartupCompleting&gt;
        &lt;/IWebApplicationStartupCompleting&gt;
    &lt;/Messages&gt;'</span>;
$msgBytes = $utf8.GetBytes($msgContent);

$msgStream = <span class="kwrd">new</span>-<span class="kwrd">object</span> System.IO.MemoryStream;
$msgStream.Write($msgBytes, 0, $msgBytes.Length);

$msg = <span class="kwrd">new</span>-<span class="kwrd">object</span> System.Messaging.Message;
$msg.BodyStream = $msgStream;
$queue.Send($msg, $tran);

$tran.Commit();</pre>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
]]></content:encoded>
			<wfw:commentRss>http://jason.pettys.name/2011/11/07/write-msmq-messages-from-powershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Read MSMQ Messages from PowerShell</title>
		<link>http://jason.pettys.name/2011/11/07/read-msmq-messages-from-powershell/</link>
		<comments>http://jason.pettys.name/2011/11/07/read-msmq-messages-from-powershell/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 22:09:48 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[CodeMinder]]></category>
		<category><![CDATA[MSMQ]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jason.pettys.name/2011/11/07/read-msmq-messages-from-powershell/</guid>
		<description><![CDATA[This script dumps the contents of an MSMQ to the console. This one dumps the Journal contents of a private queue; of course you&#8217;ll have to adjust that line for your queue. [Reflection.Assembly]::LoadWithPartialName("System.Messaging") $queueName = '.\Private$\your.queue.name\Journal$'; $queue = new-object System.Messaging.MessageQueue &#8230; <a href="http://jason.pettys.name/2011/11/07/read-msmq-messages-from-powershell/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This script dumps the contents of an MSMQ to the console. This one dumps the Journal contents of a private queue; of course you&#8217;ll have to adjust that line for your queue.</p>
<pre class="csharpcode">[Reflection.Assembly]::LoadWithPartialName(<span class="str">"System.Messaging"</span>)

$queueName = <span class="str">'.\Private$\your.queue.name\Journal$'</span>;
$queue = <span class="kwrd">new</span>-<span class="kwrd">object</span> System.Messaging.MessageQueue $queueName;
$utf8 = <span class="kwrd">new</span>-<span class="kwrd">object</span> System.Text.UTF8Encoding;

$msgs = $queue.GetAllMessages();
$msgs | %{
    write-host $_.Id;
    write-host $utf8.GetString($_.BodyStream.ToArray());
};</pre>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } -->&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://jason.pettys.name/2011/11/07/read-msmq-messages-from-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript: this and that.</title>
		<link>http://jason.pettys.name/2011/10/06/javascript-this-and-that/</link>
		<comments>http://jason.pettys.name/2011/10/06/javascript-this-and-that/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 16:29:49 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jason.pettys.name/2011/10/06/javascript-this-and-that/</guid>
		<description><![CDATA[This is a brief description of a technique recommend by Douglas Crockford, probably in Act III of his JavaScript video series. Code that looks right, but is wrong: There are a few workarounds; the one Douglas Crockford recommends is to &#8230; <a href="http://jason.pettys.name/2011/10/06/javascript-this-and-that/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is a brief description of a technique recommend by Douglas Crockford, probably in Act III of his <a href="http://yuiblog.com/crockford/">JavaScript video series</a>.
<p>Code that looks right, but is wrong:
<p><a href="http://jason.pettys.name/wp-content/uploads/2011/10/clip_image002.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://jason.pettys.name/wp-content/uploads/2011/10/clip_image002_thumb.jpg" width="625" height="260"></a>
<p>There are a few workarounds; the one Douglas Crockford recommends is to create a new variable (conventionally named &#8220;that&#8221;) referenced by the inner function.
<p><a href="http://jason.pettys.name/wp-content/uploads/2011/10/clip_image004.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://jason.pettys.name/wp-content/uploads/2011/10/clip_image004_thumb.jpg" width="624" height="234"></a>
<p>The &#8220;that&#8221; convention is fitting because you&#8217;re saying, &#8220;It&#8217;s not the close-by <i>this</i>, it&#8217;s <i>that</i> &#8216;this&#8217; from over there.&#8221; Kinda cute.
<p>Incidentally, CoffeeScript has a construct to compensate for the confusing (although very logical) behavior of <em>this</em> in JavaScript. I like CoffeeScript; been playing with it in a side project and hope to use it for a Javascript-heavy green-field project soon.
<p><b>Bottom Line:</b> with JavaScript, when you have a function defined inside of another function, &#8220;this&#8221; in the inner function might not be what you expect.</p>
]]></content:encoded>
			<wfw:commentRss>http://jason.pettys.name/2011/10/06/javascript-this-and-that/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DuckDuckGo FTW</title>
		<link>http://jason.pettys.name/2011/09/29/duckduckgo-ftw/</link>
		<comments>http://jason.pettys.name/2011/09/29/duckduckgo-ftw/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 19:51:02 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[General PC Usage]]></category>

		<guid isPermaLink="false">http://jason.pettys.name/2011/09/29/duckduckgo-ftw/</guid>
		<description><![CDATA[On a trial basis I’ve been using DuckDuckGo instead of Google for searches. You can even set Chrome up to use DuckDuckGo for queries typed into its &#8220;omnibar.&#8221; Today DuckDuckGo earned this blog post from me. I wanted to know &#8230; <a href="http://jason.pettys.name/2011/09/29/duckduckgo-ftw/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>On a trial basis I’ve been using DuckDuckGo instead of Google for searches. You can even set Chrome up to use DuckDuckGo for queries typed into its &#8220;omnibar.&#8221; Today DuckDuckGo earned this blog post from me.</p>
<p>I wanted to know how to get the list of parameters for a stored procedure programmatically. I typed in my search terms and here&#8217;s ddg&#8217;s response. What blew me away was that <strong>it pulled the exact answer to my question from stack overflow and put it at the top of the result list</strong>:</p>
<p><a href="http://jason.pettys.name/wp-content/uploads/2011/09/image.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jason.pettys.name/wp-content/uploads/2011/09/image_thumb.png" width="583" height="554"></a></p>
<p>Cool. I could say it saved me a bunch of time, but it prompted me to write this blog post, so that&#8217;s not true this time.&nbsp; <img src='http://jason.pettys.name/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://jason.pettys.name/2011/09/29/duckduckgo-ftw/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

