<?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>Wed, 16 May 2012 14:15:52 +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>Global JavaScript Events with jQuery</title>
		<link>http://jason.pettys.name/2012/05/16/global-javascript-events-with-jquery/</link>
		<comments>http://jason.pettys.name/2012/05/16/global-javascript-events-with-jquery/#comments</comments>
		<pubDate>Wed, 16 May 2012 14:15:52 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://jason.pettys.name/2012/05/16/global-javascript-events-with-jquery/</guid>
		<description><![CDATA[When building web applications with sophisticated client-side behavior (i.e., you have a lot of JavaScript) I work hard to define loosely-coupled JavaScript modules. Intentional developers strive for structured and modular server-side code, but because of JavaScript&#8217;s history we tend not &#8230; <a href="http://jason.pettys.name/2012/05/16/global-javascript-events-with-jquery/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When building web applications with sophisticated client-side behavior (i.e., you have a lot of JavaScript) I work hard to define loosely-coupled JavaScript modules. Intentional developers strive for structured and modular server-side code, but because of JavaScript&#8217;s history we tend not to take the same care with it. We then repeat the sins of the past when we find ourselves with hundreds or thousands of lines of JavaScript that aren&#8217;t encapsulated and decoupled.</p>
<p><strong>Key Point:</strong> Write loosely-coupled JavaScript modules within your application.</p>
<p>Of course, you do need <em>some</em> coupling between modules. To realize the interactions that must occur between JavaScript modules, consider using a global event technique. Modules <u>publish</u> information to the world when something interesting happens; other modules <u>subscribe</u> to information they need to react to.</p>
<p><strong>Key Point: </strong>Publishers shouldn&#8217;t need to know anything about their subscribers.</p>
<p>Here are a few ways to set up a global publish/subscribe mechanism your JavaScript modules to use:</p>
<h2></h2>
<h2>Roll Your Own</h2>
<p>We don&#8217;t want to succumb to the &#8220;Not Invented Here&#8221; problem, but these few lines create a simple but useful window.Bus object that supports global events.</p>
<pre class="csharpcode">(<span class="kwrd">function</span>() {

    var subscriptions = null;

    window.Bus = {

        reset: <span class="kwrd">function</span>() {
             subscriptions = {};
        },

        subscribe: <span class="kwrd">function</span>(messageType, callback) {
            <span class="kwrd">if</span> (<span class="kwrd">typeof</span> subscriptions[messageType] === <span class="rem">'undefined') {</span>
                subscriptions[messageType] = [];
            }
            subscriptions[messageType].push(callback);
        },

        publish: <span class="kwrd">function</span>(messageType, args) {
            <span class="kwrd">if</span> (<span class="kwrd">typeof</span> subscriptions[messageType] === <span class="rem">'undefined') return;</span>
            var subscribers = subscriptions[messageType];
            <span class="kwrd">for</span> (var i=0; i&lt;subscribers.length; i++) {
                subscribers[i](args);
            }
        }

    };

    window.Bus.reset();

}());

// Subscriber usage:
window.Bus.subscribe(<span class="rem">'UserCreated', function(user) {</span>
    alert(<span class="rem">'User ' + user.Name + ' created!');</span>
});

// Publisher usage:
var newUser = { Name: <span class="str">"The Hulk"</span> };
window.Bus.publish(<span class="rem">'UserCreated', newUser);</span>
</pre>
<h2>jQuery</h2>
<p>One quick way to get there without adding any more dependencies than you probably already have is it just use features jQuery&#8217;s eventing system. Here&#8217;s code that demonstrates how to use jQuery as a global pub/sub framework. In this example, there are two modules, a publisher and a subscriber, each with a bit of HTML and a bit of JavaScript. The JavaScript comments explain the main points.</p>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">html</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">head</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">title</span><span class="kwrd">&gt;</span>Client-side Pub/Sub with jQuery<span class="kwrd">&lt;/</span><span class="html">title</span><span class="kwrd">&gt;</span>
    <span class="rem">&lt;!-- add reference to jQuery --&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">head</span><span class="kwrd">&gt;</span>

<span class="kwrd">&lt;</span><span class="html">body</span><span class="kwrd">&gt;</span>

    <span class="kwrd">&lt;</span><span class="html">div</span><span class="kwrd">&gt;</span>
        <span class="kwrd">&lt;</span><span class="html">input</span> <span class="attr">id</span><span class="kwrd">='PublishButton'</span> <span class="attr">type</span><span class="kwrd">='button'</span> <span class="attr">value</span><span class="kwrd">='Publish'</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span>

    <span class="kwrd">&lt;</span><span class="html">b</span><span class="kwrd">&gt;</span>Events:<span class="kwrd">&lt;/</span><span class="html">b</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">div</span> <span class="attr">id</span><span class="kwrd">='Subscriber1'</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span>

<span class="kwrd">&lt;/</span><span class="html">body</span><span class="kwrd">&gt;</span>

<span class="kwrd">&lt;</span><span class="html">script</span> <span class="attr">type</span><span class="kwrd">='text/javascript'</span><span class="kwrd">&gt;</span>
<span class="rem">// This function block correlates with the publisher's scope.</span>
$(<span class="kwrd">function</span>() {

    <span class="rem">// Represents a secret value only the publisher knows about directly,</span>
    <span class="rem">// but will include in its event args.</span>
    <span class="kwrd">var</span> someNumber = 7;

    <span class="rem">// When the button is clicked we publish an event.</span>
    $(<span class="str">"#PublishButton"</span>).click(<span class="kwrd">function</span>() {
        <span class="kwrd">var</span> dt = <span class="kwrd">new</span> Date();
        <span class="rem">//</span>
        <span class="rem">// The next line is the important one; notice how the event args</span>
        <span class="rem">// are passed as an array.</span>
        <span class="rem">//</span>
        $.<span class="kwrd">event</span>.trigger(<span class="str">'CustomEventName'</span>, [someNumber, dt]);
        someNumber++;
    });

});

<span class="rem">// This function block correlates with the subscriber's scope.</span>
$(<span class="kwrd">function</span>() {
    <span class="rem">//</span>
    <span class="rem">// Notice how we're not calling bind() on the subscriber like a typical</span>
    <span class="rem">// jQuery event, but calling it on our own UI component.</span>
    <span class="rem">// Also notice how the event args, which were published as an array,</span>
    <span class="rem">// are flattened into individual parameters.</span>
    <span class="rem">//</span>
    $(<span class="str">"#Subscriber1"</span>).bind(<span class="str">'CustomEventName'</span>, <span class="kwrd">function</span>(<span class="kwrd">event</span>, number, date) {
        $(<span class="str">"&lt;div&gt;"</span>).text(<span class="str">"Event published: "</span> + number + <span class="str">" @ "</span> + date).appendTo($(<span class="kwrd">this</span>));
    });
});
<span class="kwrd">&lt;/</span><span class="html">script</span><span class="kwrd">&gt;</span>

<span class="kwrd">&lt;/</span><span class="html">html</span><span class="kwrd">&gt;</span>
<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>
<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>
<h2>Use a Global Event Library</h2>
<p>The following JavaScript libraries are a few that provide a global pub/sub infrastructure:</p>
<ul>
<li>AmplifyJS: <a title="http://amplifyjs.com/api/pubsub/" href="http://amplifyjs.com/api/pubsub/">http://amplifyjs.com/api/pubsub/</a>
<li>PubSubJS: <a title="https://github.com/mroderick/PubSubJS" href="https://github.com/mroderick/PubSubJS">https://github.com/mroderick/PubSubJS</a>
<li>js-signals: <a title="http://millermedeiros.github.com/js-signals/" href="http://millermedeiros.github.com/js-signals/">http://millermedeiros.github.com/js-signals/</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jason.pettys.name/2012/05/16/global-javascript-events-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Snapshot Notes</title>
		<link>http://jason.pettys.name/2012/05/11/sql-snapshot-notes/</link>
		<comments>http://jason.pettys.name/2012/05/11/sql-snapshot-notes/#comments</comments>
		<pubDate>Fri, 11 May 2012 21:05:14 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[CodeMinder]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://jason.pettys.name/2012/05/11/sql-snapshot-notes/</guid>
		<description><![CDATA[Sometimes when testing you need to repetitively restore a database back to a certain point in time. For very large databases the regular SQL restore can take quite a while. It seemed to me that using snapshots instead of regular &#8230; <a href="http://jason.pettys.name/2012/05/11/sql-snapshot-notes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Sometimes when testing you need to repetitively restore a database back to a certain point in time. For very large databases the regular SQL restore can take quite a while. It seemed to me that using snapshots instead of regular backups cut this restore down quite a bit.</p>
<p><strong>To Create the Snapshot</strong></p>
<pre class="csharpcode"><span class="kwrd">create</span> <span class="kwrd">database</span> [NewDatabaseName] <span class="kwrd">on</span> (
    name = [SourceDatabaseLogicalName],
    filename = <span class="str">'\file\to\create\snapshot.ss'</span>
) <span class="kwrd">as</span> snapshot <span class="kwrd">of</span> [SourceDatabase]</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><strong>To Restore the Snapshot</strong></p>
<pre class="csharpcode"><span class="rem">-- force <strike>choke</strike> close any connections</span>
<span class="kwrd">alter</span> <span class="kwrd">database</span> [SourceDatabase]
    <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="rem">-- restore from snapshot</span>
<span class="kwrd">restore</span> <span class="kwrd">database</span> [SourceDatabase]
     <span class="kwrd">from</span> database_snapshot = <span class="str">'NewDatabaseName'</span>&nbsp;</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>
<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><strong>Notes</strong></p>
<ul>
<li>NewDatabaseName: The name of a database that doesn’t exist yet, but will be created and store the snapshot information.</li>
<li>SourceDatabase: The name of the database you want to create a snapshot of.</li>
<li>SourceDatabaseLogicalName: The “logical name” of the main MDF file for the database you want to create a snapshot of. In SQL Management Studio, do right-click/Properties for the database, and look here:</li>
</ul>
<blockquote>
<p><a href="http://jason.pettys.name/wp-content/uploads/2012/05/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/2012/05/image_thumb.png" width="428" height="235"></a></p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://jason.pettys.name/2012/05/11/sql-snapshot-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VB.NET Logical Operators</title>
		<link>http://jason.pettys.name/2012/05/08/vb-net-logical-operators/</link>
		<comments>http://jason.pettys.name/2012/05/08/vb-net-logical-operators/#comments</comments>
		<pubDate>Tue, 08 May 2012 15:19:44 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[VB]]></category>

		<guid isPermaLink="false">http://jason.pettys.name/?p=153</guid>
		<description><![CDATA[Quick chart to clarify which VB.NET operators one should use always.* Never Use Instead, Always Use: IIf(x, y, z) If(x, y, z) And AndAlso Or OrElse &#160; * Always means &#8220;pretty much always.&#8221; There may be some very rare, strange &#8230; <a href="http://jason.pettys.name/2012/05/08/vb-net-logical-operators/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Quick chart to clarify which VB.NET operators one should use always.*</p>
<div>
<table border="1" cellspacing="0" cellpadding="2" width="300" align="center">
<tbody>
<tr>
<td style="background-color: #77f; color: white;" width="150" align="center"><strong style="color: white;">Never Use</strong></td>
<td style="background-color: #77f; color: white;" width="150" align="center"><strong style="color: white;">Instead, Always Use:</strong></td>
</tr>
<tr>
<td width="150" align="center"><strong><span style="font-family: Consolas;">IIf(x, y, z)</span></strong></td>
<td width="150" align="center"><strong><span style="font-family: Consolas;">If(x, y, z)</span></strong></td>
</tr>
<tr>
<td width="150" align="center"><strong><span style="font-family: Consolas;">And</span></strong></td>
<td width="150" align="center"><strong><span style="font-family: Consolas;">AndAlso</span></strong></td>
</tr>
<tr>
<td width="150" align="center"><strong><span style="font-family: Consolas;">Or</span></strong></td>
<td width="150" align="center"><strong><span style="font-family: Consolas;">OrElse</span></strong></td>
</tr>
<tr>
<td width="150" align="center"><a href="http://jason.pettys.name/wp-content/uploads/2012/05/images.jpg"><img class="alignnone size-full wp-image-156" title="images" src="http://jason.pettys.name/wp-content/uploads/2012/05/images.jpg" alt="" width="176" height="176" /></a></td>
<td width="150" align="center"><a href="http://jason.pettys.name/wp-content/uploads/2012/05/logical_awesome.jpg"><img class="alignnone size-medium wp-image-157" title="logical_awesome" src="http://jason.pettys.name/wp-content/uploads/2012/05/logical_awesome-300x240.jpg" alt="" width="300" height="240" /></a></td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
<p><small><br />
* <em>Always</em> means &#8220;pretty much always.&#8221; There may be some very rare, strange cases to use the &#8220;never use&#8221; items.</small></p>
<p><small> </small></p>
<p><small><em>** Logical Awesome</em> image copied from <a href="http://logicalawesome.com/">this site</a>.<br />
</small></p>
]]></content:encoded>
			<wfw:commentRss>http://jason.pettys.name/2012/05/08/vb-net-logical-operators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Speed of Trust: Individual Credibility</title>
		<link>http://jason.pettys.name/2012/05/02/the-speed-of-trust-individual-credibility/</link>
		<comments>http://jason.pettys.name/2012/05/02/the-speed-of-trust-individual-credibility/#comments</comments>
		<pubDate>Thu, 03 May 2012 04:18:52 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Leadership]]></category>
		<category><![CDATA[Softer Skills]]></category>
		<category><![CDATA[The Speed of Trust]]></category>

		<guid isPermaLink="false">http://jason.pettys.name/2012/05/02/the-speed-of-trust-individual-credibility/</guid>
		<description><![CDATA[The Speed of Trust appears from here to be broken down into Five Waves of trust; these waves move from the inner-most out. That is, it begins with changing yourself, then working out to the people you interact most often &#8230; <a href="http://jason.pettys.name/2012/05/02/the-speed-of-trust-individual-credibility/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><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> appears from here to be broken down into Five Waves of trust; these waves move from the inner-most out. That is, it begins with changing yourself, then working out to the people you interact most often with, and continuing out to society at large:</p>
<ol>
<li>Self trust.</li>
<li>Relationship trust.</li>
<li>Organizational trust.</li>
<li>Market trust.</li>
<li>Societal trust.</li>
</ol>
<p>An introduction to “Self Trust” came next; that topic itself is broken down into four main cores. Self Trust comes down to credibility – are you a credible person? Even though people will give a simple Yes or No, or could give an answer on a one to ten scale for this, the book argues that there are four aspects of credibility, and your achievement in each of the four cores can vary:</p>
<ol>
<li><strong>Integrity.</strong> This relates to basic honesty, but goes further into having an understanding of your own values, and the courage to stand up for and live by your values when challenged.</li>
<li><strong>Intent.</strong> Are your motives and agendas (and the behavior they produce) guided by a genuine care for others, or do you operate in a self-centered way without regard to others? Imagine someone who was very honest, but had no deep concern at all for others. Even though such a person would never tell a lie, people can’t trust the person because they always have to guard themselves so as not to be taken advantage of.</li>
<li><strong>Capabilities.</strong> What are your talents, abilities, skills, knowledge, etc., that allow you to produce results? Again, imagine someone full of honesty and integrity, and always operating with the very best of intentions, yet utterly incompetent in any tasks they were given. Such a person, though possessing a wonderful character, would still not be trustworthy simply because of incapability.</li>
<li><strong>Results.</strong> Do you have a track record of accomplishing tasks? Do you work on the right thing, and see that right thing through till it’s done? Again, one can imagine a talented, fully capable individual full of integrity and the good intentions, yet they never seem to Get Things Done. Such a person’s credibility would certainly be in question.</li>
</ol>
<p>It’s is interesting to hypothesize an individual who has any three of the four cores of credibility listed above, but severely lacking the last.</p>
<p>When an expert witness is called to testify in a trial, the supporting lawyer will try to establish before the jury these four aspects; if the opposing attorney can seriously undermine the expert in any one of these items then the witnesses <em>credibility</em>, and the expert’s influence on the entire trial, is severely effected.</p>
<p>The next sections of the book drill down on each of the four cores individually. I’m in the process of building <a href="http://prezi.com/5lbsrfnts40h/the-speed-of-trust/">a Prezi presentation</a> to map the structure of the book and keep its outline straight in my mind.</p>
]]></content:encoded>
			<wfw:commentRss>http://jason.pettys.name/2012/05/02/the-speed-of-trust-individual-credibility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why is Estimating so Hard?</title>
		<link>http://jason.pettys.name/2012/04/20/why-is-estimating-so-hard/</link>
		<comments>http://jason.pettys.name/2012/04/20/why-is-estimating-so-hard/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 18:04:20 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Estimating]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jason.pettys.name/2012/04/20/why-is-estimating-so-hard/</guid>
		<description><![CDATA[Uncle Bob suggested a small software estimation exercise in a recent blog post, Why is Estimating So Hard? My best-case, nominal, and worst-case estimates were x, 2x, and 4x, respectively. My actual time spent was 3.4x, and while the final &#8230; <a href="http://jason.pettys.name/2012/04/20/why-is-estimating-so-hard/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Uncle Bob suggested a small software estimation exercise in a recent blog post, <em><a href="http://blog.8thlight.com/uncle-bob/2012/04/20/Why-Is-Estimating-So-Hard.html">Why is Estimating So Hard?</a></em></p>
<p>My best-case, nominal, and worst-case estimates were <em>x</em>, 2<em>x</em>, and 4<em>x</em>, respectively. My actual time spent was 3.4<em>x</em>, and while the final code worked I wasn&#8217;t real happy with it.</p>
<p>I had never thought before about the distinction between how long it takes <em>to do something</em> and how long it takes <em>to describe how to do something</em>. Uncle Bob uses the example of tying shoes &#8211; takes a few seconds to do, but I&#8217;ve heard of college communication classes being centered around how to describe how to do it. Everyone failed that assignment.</p>
<p>The accounting world would have other similar examples. How long does it take to reconcile a checkbook, assuming no major discrepancies? Compare that with how long it would take to write a step-by-step procedure describing how to reconcile a checkbook &#8212; one that could be used by someone who didn&#8217;t have any familiarity with checkbooks.</p>
<p>In some ways, that&#8217;s what computer programming is: writing detailed, step-by-step procedures for a machine &#8212; and this machine has absolutely zero intelligence on its own &#8212; no problem solving skills, no deductive capabilities and no intuition.</p>
]]></content:encoded>
			<wfw:commentRss>http://jason.pettys.name/2012/04/20/why-is-estimating-so-hard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Book: Notes to a Software Team Leader</title>
		<link>http://jason.pettys.name/2012/04/18/book-notes-to-a-software-team-leader/</link>
		<comments>http://jason.pettys.name/2012/04/18/book-notes-to-a-software-team-leader/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 14:09:04 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Leadership]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Softer Skills]]></category>

		<guid isPermaLink="false">http://jason.pettys.name/2012/04/18/book-notes-to-a-software-team-leader/</guid>
		<description><![CDATA[I heard about this new book, Notes to a Software Team Leader, on a podcast on my way to work this morning. Below is the &#8220;Manifesto&#8221; of the book; upon reading it I feel the book has potential to have &#8230; <a href="http://jason.pettys.name/2012/04/18/book-notes-to-a-software-team-leader/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I heard about this new book, <i><a href="http://leanpub.com/teamleader">Notes to a Software Team Leader</a></i>, on a podcast on my way to work this morning. Below is the &#8220;Manifesto&#8221; of the book; upon reading it I feel the book has potential to have insightful and helpful content &#8211; I think it aligns with <a href="http://www.nexusinnovations.com/">Nexus’s</a> values in unique and surprising ways.
<ul>
<li><b>We believe the role of a team leader is to grow the people in their team</b></li>
<ul>
<li>We believe in adjusting the leadership style to the current needs of the team, over a single style of leadership</li>
<li>We believe in challenging ourselves and our teams to always get better, so:</li>
<ul>
<li>We embrace taking risks for our team over staying safe</li>
<li>We embrace fear and discomfort as learning new skills</li>
<li>We embrace experimentation as a daily practice</li>
<ul>
<li>With people</li>
<li>With tools</li>
<li>With processes</li>
<li>With the environment</li>
</ul>
</ul>
<li>We believe team leaders lead people, not machines, so:</li>
<ul>
<li>We embrace spending more time with our team than in meetings</li>
<li>We embrace learning people skills and techniques</li>
</ul>
</ul>
</ul>
<p>This is a unique &#8220;book&#8221; &#8211; at least, it&#8217;s being written in a unique way. It&#8217;s not done yet, and if you feel you have something important to say about software team leadership, you can submit a contribution to the book.</p>
]]></content:encoded>
			<wfw:commentRss>http://jason.pettys.name/2012/04/18/book-notes-to-a-software-team-leader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Giving Yourself a Job</title>
		<link>http://jason.pettys.name/2012/04/11/giving-yourself-a-job/</link>
		<comments>http://jason.pettys.name/2012/04/11/giving-yourself-a-job/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 18:34:21 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Leadership]]></category>

		<guid isPermaLink="false">http://jason.pettys.name/2012/04/11/giving-yourself-a-job/</guid>
		<description><![CDATA[In 1950 in New York, looking for a job consisted of catching a subway at 6:30 to pick up a copy of the New York Times, searching the classifieds, and then pursuing the most promising opportunities. After doing this for &#8230; <a href="http://jason.pettys.name/2012/04/11/giving-yourself-a-job/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In 1950 in New York, looking for a job consisted of catching a subway at 6:30 to pick up a copy of the New York Times, searching the classifieds, and then pursuing the most promising opportunities.</p>
<p>After doing this for forty weeks straight, Bill still didn&#8217;t have a job. Times were tough: meal time would come and there was no food; this lack created tension between Bill&#8217;s parents; the family was under tremendous discouragement.</p>
<p>Coming home after yet another grueling and fruitless day, Bill made a radical change. At the kitchen table with his brother Jerry, Bill said:</p>
<p>&#8220;If no one will give me a job, I&#8217;m going to give myself a job.&#8221;</p>
<p>Jerry thought his brother had finally lost it. There were no jobs to be had. It seemed ridiculous to magically produce one for yourself. But Bill was determined, and so the brothers pulled together all the money they had to start a business: $13.</p>
<p>After deliberating together they decided to start a technical writing company for $13 because you could buy pens and enough paper to get started on that budget. Bill said, &#8220;I&#8217;m going to sell. You&#8217;re going to go to the library and learn how to do technical writing.&#8221; Bill figured he could sell to companies of ten people or less who were doing government work.</p>
<p>In three weeks Bill made his first sale, and Jerry began putting his new tech-writing skills to work. The books were accepted. Within a few years they were able to hire a typist, then an illustrator, then rent an office in downtown New York (prior to that they all worked out of the brothers&#8217; tiny apartment).</p>
<p>Today, sixty-two years later, <a href="http://www.volt.com/">this company</a> has tens of thousands of employees. I had the opportunity to meet Jerry today, sixty-two years after he and his brother struck out on a $13 budget. I was very much impressed with this startup story. Through resourcefulness, fortitude, and hard work, Bill and Jerry created their opportunities. I believe the same opportunities exist today. Jerry had the library, where he could become a competent tech writer for free; today we have the Internet, where you can become a competent almost-anything for free. Your chances of becoming a multi-millionaire are probably low, but the reward for initiative, hard work and perseverance in today&#8217;s world is what is was in 1950: success.</p>
<p>Bill&#8217;s decision that he would not be ultimately dependent on others, but would take responsibility for improving his situation himself, is an admirable attitude. I wonder how many today carry that same attitude: &#8220;If no one will give me a job, I&#8217;m going to give myself a job.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://jason.pettys.name/2012/04/11/giving-yourself-a-job/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>From .NET, Calling REST and getting &quot;dynamic&quot; results</title>
		<link>http://jason.pettys.name/2012/03/30/from-net-calling-rest-and-getting-dynamic-results/</link>
		<comments>http://jason.pettys.name/2012/03/30/from-net-calling-rest-and-getting-dynamic-results/#comments</comments>
		<pubDate>Fri, 30 Mar 2012 21:53:52 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[CodeMinder]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://jason.pettys.name/2012/03/30/from-net-calling-rest-and-getting-dynamic-results/</guid>
		<description><![CDATA[It seems like every time I want to call a RESTful service from my .NET app I have to re-lookup the documentation for either Hammock or RestSharp. Mainly for my own future reference, here&#8217;s the code using Hammock to get &#8230; <a href="http://jason.pettys.name/2012/03/30/from-net-calling-rest-and-getting-dynamic-results/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It seems like every time I want to call a RESTful service from my .NET app I have to re-lookup the documentation for either <a href="https://github.com/danielcrenna/hammock">Hammock</a> or <a href="http://restsharp.org/">RestSharp</a>. Mainly for my own future reference, here&#8217;s the code using Hammock to get a change list from <a href="http://bitbucket.org/">bitbucket.org&#8217;s</a> <a href="http://confluence.atlassian.com/display/BITBUCKET/Using+the+bitbucket+REST+APIs">REST API</a>, then using <a href="https://github.com/jsonfx/jsonfx">JsonFx</a> to deserialize the JSON to a dynamic object (which is pretty sweet).</p>
<pre class="csharpcode">var client = <span class="kwrd">new</span> Hammock.RestClient {
    Authority = <span class="str">"https://api.bitbucket.org"</span>,
    VersionPath = <span class="str">"1.0"</span>,
    Credentials = <span class="kwrd">new</span> BasicAuthCredentials {
        Username = <span class="str">"bitbucket-username"</span>,
        Password = <span class="str">"bitbucket-password"</span>
    }
};

var request = <span class="kwrd">new</span> RestRequest {
     Path = <span class="str">"repositories/[username]/[repo]/changesets"</span>,
     Method = WebMethod.Get
};

dynamic result = <span class="kwrd">new</span> JsonFx.Json.JsonReader().Read(response.Content);
<span class="kwrd">for</span>(<span class="kwrd">int</span> i=0, len=result.changesets.Length; i&lt;len; i++) {
    var date = DateTime.Parse(result.changesets[i].utctimestamp);
    <span class="kwrd">string</span> author = result.changesets[i].raw_author;
    <span class="rem">// do what you want with the results.</span>
}
<font color="#0000ff"></font></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/2012/03/30/from-net-calling-rest-and-getting-dynamic-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Call a web service with PowerShell</title>
		<link>http://jason.pettys.name/2012/03/02/call-a-web-service-with-powershell/</link>
		<comments>http://jason.pettys.name/2012/03/02/call-a-web-service-with-powershell/#comments</comments>
		<pubDate>Fri, 02 Mar 2012 16:37:32 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://jason.pettys.name/2012/03/02/call-a-web-service-with-powershell/</guid>
		<description><![CDATA[I recently used a PowerShell script like the following to troubleshoot the details of a third-party web service our code was using. I thought the script was something worth noting here for future reference. $url = "https://path/to/Service.asmx" $parameters = '&#60;?xml &#8230; <a href="http://jason.pettys.name/2012/03/02/call-a-web-service-with-powershell/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently used a PowerShell script like the following to troubleshoot the details of a third-party web service our code was using. I thought the script was something worth noting here for future reference.</p>
<pre class="csharpcode">$url = <span class="str">"https://path/to/Service.asmx"</span>
$parameters = <span class="str">'&lt;?xml version="1.0" encoding="utf-8"?&gt;'</span> + <span class="str">"`n"</span>
   + <span class="str">'&lt;soap12:Envelope...&gt;<em>(your request body here)</em>&lt;/soap12:Envelope&gt;'</span>

$http_request = New-Object -ComObject Msxml2.XMLHTTP
$http_request.open(<span class="str">'POST'</span>, $url, $<span class="kwrd">false</span>)
$http_request.setRequestHeader(<span class="str">"Content-type"</span>, <span class="str">"application/soap+xml"</span>)
$http_request.setRequestHeader(<span class="str">"Content-length"</span>, $parameters.length)
$http_request.setRequestHeader(<span class="str">"Connection"</span>, <span class="str">"close"</span>)
$http_request.send($parameters)
$http_request.statusText
$http_request.responseText</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>&nbsp;</p>
<p>The <em>(your request body here)</em> part can be obtained easily if the service you’re talking to is running on .NET with the metadata information turned on. If you point your regular web browser at the URL in this case, it will return a list of operations the service supports. Clicking on any operation will show you what to put in for $parameters – something like this – very handy:</p>
<p><a href="http://jason.pettys.name/wp-content/uploads/2012/03/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/2012/03/image_thumb.png" width="512" height="252"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://jason.pettys.name/2012/03/02/call-a-web-service-with-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>
		<category><![CDATA[The Speed of Trust]]></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>6</slash:comments>
		</item>
	</channel>
</rss>

