<?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>Joe Crotty &#187; Tech</title>
	<atom:link href="http://joecrotty.com/category/tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://joecrotty.com</link>
	<description>Joe Crotty</description>
	<lastBuildDate>Sun, 06 Nov 2011 18:12:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>ETL Pipe Process Metrics</title>
		<link>http://joecrotty.com/2011/09/etl-pipe-metrics/</link>
		<comments>http://joecrotty.com/2011/09/etl-pipe-metrics/#comments</comments>
		<pubDate>Sun, 11 Sep 2011 21:07:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://joecrotty.com/?p=931</guid>
		<description><![CDATA[About a week ago at work I was looking at a support email about a latent process that parses large volumes of email. During the ensuing investigation it dawned on me we had no metrics around the process. I am &#8230; <a href="http://joecrotty.com/2011/09/etl-pipe-metrics/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>About a week ago at work I was looking at a support email about a latent process that parses large volumes of email. During the ensuing investigation it dawned on me we had no metrics around the process. I am not a fan of  crap shot guesses.</p>
<p>I purposed we spec a data base (AKA DB) table and code out a change to an upstream process that feed the troubled process so we could start gathering some basic metrics: filename, hostname, size_bytes, and count_msgs.</p>
<p>I hastily began cobbling the idea together and about a day and a half in it dawned on me in a quite moment &#8211; the initial design was inept.</p>
<p>For starters the DB table would only store data for one process. But the message data being parsed was part of a broader data pipeline.  The make up of the pipeline was a bit vague like the developing wave below, but a it has the hallmarks of an ETL system.</p>
<p><img class="alignnone size-large wp-image-933" title="wavepipesurfer" src="http://joecrotty.com/wp-content/uploads/2011/09/wavepipesurfer-490x322.jpg" alt="" width="490" height="322" /></p>
<p><span id="more-931"></span></p>
<p>The solution would need a few tweaks:</p>
<ol>
<li>Three data base tables &#8211; note: host table already exists
<ol>
<li>msg_master
<ol>
<li>file_id</li>
<li>file_name</li>
<li>file_dt</li>
<li>start_dt</li>
<li>end_dt</li>
<li>created_dt</li>
<li>updated_dt</li>
</ol>
</li>
<li>msg_proc_metrics
<ol>
<li>proc_id</li>
<li>host_id</li>
<li>file_id</li>
<li> size_bytes</li>
<li>count_msgs</li>
<li>runtime</li>
<li>version</li>
<li>created_dt</li>
</ol>
</li>
<li>msg_procs
<ol>
<li>proc_id</li>
<li>procname</li>
</ol>
</li>
</ol>
</li>
<li>Directory for all processes in the ETL system to write metrics files to.</li>
<li>A script, cron scheduled, to load metrics files to the data base.</li>
</ol>
<p>The new DB model would enable any process to store metrics and normalizes fairly well. Writing metrics to JSON files in a directory insulates  ETL processes from DB latency. I am a big fan of JSON as the data is more portable and readable with a size cost.  However, were only dealing with ~25,000 records/day which is ideal for JSON.  Avro would be a good data serialization solution if the records numbers were a few order of magnitude larger.</p>
<p>With a better functional framework designed  the bit rot front line troops may be getting some better weapons soon.</p>
<ol>
<li>Monitoring</li>
<li>Alerting</li>
<li>Performance Analysis</li>
<li>Trending</li>
<li>Quantitative Analysis</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://joecrotty.com/2011/09/etl-pipe-metrics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dear WordPress</title>
		<link>http://joecrotty.com/2010/11/dear-wordpress/</link>
		<comments>http://joecrotty.com/2010/11/dear-wordpress/#comments</comments>
		<pubDate>Sun, 21 Nov 2010 20:13:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://joecrotty.com/?p=893</guid>
		<description><![CDATA[You are starting to annoy me.  I knew you had flaws when I first put my blog on your CMS, but I went in with eyes fully open. Over the last two years you have proven easy to upgrade, simple &#8230; <a href="http://joecrotty.com/2010/11/dear-wordpress/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>You are starting to annoy me.  I knew you had flaws when I first put my blog on your <a title="Wiki CMS" href="http://en.wikipedia.org/wiki/Content_management_system">CMS</a>, but I went in with eyes fully open. Over the last two years you have proven easy to upgrade, simple to edit, and feature friendly in a way that non-tech people can truly appreciate. However, despite your very slick <a title="Wiki UI" href="http://en.wikipedia.org/wiki/User_interface">UI</a>, I am coming to really dislike your editor.  Seriously, why can&#8217;t I easily insert computer programming code examples into a blog post.  Additionally, I have seen enough of your internals to be officially scared. <a title="Drupal CMS" href="http://drupal.org/"> Drupal</a> 7 will be out soon and I plan to jump ship if the grass has any hint of being greener.</p>
]]></content:encoded>
			<wfw:commentRss>http://joecrotty.com/2010/11/dear-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git Remote Repository Setup</title>
		<link>http://joecrotty.com/2010/08/git-remote-repository-setup/</link>
		<comments>http://joecrotty.com/2010/08/git-remote-repository-setup/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 20:34:00 +0000</pubDate>
		<dc:creator>Joseph Crotty</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://joecrotty.com/?p=838</guid>
		<description><![CDATA[Today I was trying to get the hang of setting up a remote git repository for shared ssh use by several developers at my day job.  I wanted anyone with ssh access to be able to check out the repository, &#8230; <a href="http://joecrotty.com/2010/08/git-remote-repository-setup/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today I was trying to get the hang of setting up a remote git repository for shared ssh use by several developers at my day job.  I wanted anyone with ssh access to be able to check out the repository, but only those in a specific group to have write access (i.e., a commit bit if you will).  So, let&#8217;s dive right in using language most folks likely to read this article would associate with classic SCM tools like cvs and svn.  Assume two machines with ssh already configured correctly for the users devlord and devserf.</p>
<ol>
<li>repo &#8211; machine that will hold the master remote repository</li>
<li>local &#8211; local machine that will hold the checked out repository</li>
</ol>
<p>devlord is in the git group, but devserf is not. Assuming we already have a code base on local let&#8217;s get that checked into a new git repository.</p>
<pre>
<pre class="brush: bash; title: ; toolbar: true; notranslate">cd /var/www/myproj git init</pre>
</pre>
<p> </p>
<p>Now configure repo machine.</p>
<pre>
<pre class="brush: bash; title: ; toolbar: true; notranslate">su - root&lt;br /&gt;adduser git&lt;br /&gt;mkdir -p /var/git&lt;br /&gt;chmod 775 /var/git&lt;br /&gt;su git&lt;br /&gt;cd /var/git&lt;br /&gt;mkdir -p myproj&lt;br /&gt;cd myproj&lt;br /&gt;git init --bare --shared=0664&lt;br /&gt;</pre>
</pre>
<p>The &#8211;bare tells git that it will only hold file deltas and binary information for future checkout.  It&#8217;s the master repository not an actual working repository.</p>
<p>Let&#8217;s head back to local and finish up getting our myproj code base into the master repository on repo.</p>
<p>cd /var/www/myproj</p>
<p>git remote add origin ssh://devlord@repo/var/git/myproj</p>
<p>git push origin master</p>
<p>I don&#8217;t fully understand origin yet, but it&#8217;s akin to a local branch and the master is elsewhere &#8211; in this case on repo. The second command pushed local myproj over to the master myproj repo.</p>
<p>Now devserf can checkout a copy of myproj on local.</p>
<p>cd /home/devserf</p>
<p>git clone ssh://devserf@repo/var/git/myproj</p>
<p>However, if devserf modifies myproj and wants to push their changes back to master myproj at repo it will fail because they are not in the git group on repo.  Only users in the git group on repo, like devlord, are allowed to make commits back to the master.</p>
]]></content:encoded>
			<wfw:commentRss>http://joecrotty.com/2010/08/git-remote-repository-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Whose world order?</title>
		<link>http://joecrotty.com/2010/06/whose-world-order/</link>
		<comments>http://joecrotty.com/2010/06/whose-world-order/#comments</comments>
		<pubDate>Sun, 27 Jun 2010 17:03:24 +0000</pubDate>
		<dc:creator>Joseph Crotty</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://joecrotty.com/?p=702</guid>
		<description><![CDATA[    Warning, this is a an article by a software geek for said geeks. Rapid boredom will probably ensue even for the target audience. Most of us at one time or another have worked on a Big Ball of &#8230; <a href="http://joecrotty.com/2010/06/whose-world-order/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p> </p>
<p><div id="attachment_727" class="wp-caption alignnone" style="width: 500px"><img class="size-full wp-image-727" title="Gulliver and Phones" src="http://joecrotty.com/wp-content/uploads/2010/03/gulliver_and_phones.jpg" alt="" width="490" height="213" /><p class="wp-caption-text">Gulliver, as the system, washes ashore to be tamed by the custodians.</p></div>
<p> </p>
<p>Warning, this is a an article by a software geek for said geeks. Rapid boredom will probably ensue even for the target audience. Most of us at one time or another have worked on a <a title="Big Ball of Mud" href="http://www.laputan.org/mud/">Big Ball of Mud</a>. For a less seasoned hacker the first tour or two of such a haphazard system may go unnoticed due to a number of circumstances the least of which being naivety. But, over time, the imprints of sloppy, duct tape, spaghetti code jungles come to be recognizable. By no means complete a few standout examples from my career:</p>
<p><span id="more-702"></span></p>
<ol>
<li>Code is not stored in an <a title="Wiki Source Code Management" href="http://en.wikipedia.org/wiki/Source_Code_Management">SCM</a>.</li>
<li>Bug fires rage 24/7 consuming all resources perpetually.</li>
<li>Poor code abounds with total disregard for any <a title="GNU Coding Standards" href="http://www.gnu.org/prep/standards/">standards</a> (e.g., wheel is reinvented regularly, 10 screen shot methods, classes with 100&#8242;s of members, etc.).</li>
<li>Duplicate data and functionality throughout including &#8220;clone&#8221; systems.</li>
<li>Management, via ignorance, insists things are basal or worse are in complete denial.</li>
</ol>
<p>Once one can identify a subset of ailments it&#8217;s tempting to run from these helter-skelter systems in haste. Knowledge arms us not to repeat them &#8211; maybe. Yet <a title="Brian Foote" href="http://www.laputan.org/index.html">Foote</a> and <a title="Joseph Yoder" href="http://www.joeyoder.com/">Yoder</a> make clear in <a title="Big Ball of Mud" href="http://www.laputan.org/mud/">BBOM</a> many profitable such systems exist. Profitability aside the fact is they abound! Having designed, developed, and maintained such systems myself the temptation is to disparage. What is it about these hastily crafted boomtown&#8217;s that irk us? Is it the simple fact that the architects and custodians are all to comfortable with a level of expediency we are uncomfortable with?</p>
<p>I am poorly equipped to answer from my limited exposure. Both <a title="Big Ball of Mud" href="http://www.laputan.org/mud/">BBOM</a>s I worked on were absolutely driven by a perceived fleeting window of business opportunity. Design marathons, repositories, code standards, pair coding, QC, test harnesses, continuous integration, etc. where all pushed aside in the rush to launch. Once there and stably afloat i.e.,  profitable, did the realization often slowly set in that the system was ineptly fashioned. Once built management forever demands hastily cobbled features to increase ROI almost always at the cost of sane design &#8211; the &#8220;structure&#8221; worsens. Of course, as engineers we fight to avert such quagmires whether through evangelization and/or example.  However, we all have to eat &#8211; to deny human nature is foolhardy.</p>
<p>An inverse universe exists where architecture, means and process are king. Laugh if you will but it&#8217;s well known that <a title="Microsoft" href="http://www.microsoft.com/en/us/default.aspx">Microsoft</a> runs one of the most process driven engineering shops the world over. For them sheer scale dictates a process rooted approach. However, for the average web business outlet day to day operation is about finding the middle ground between launch mentality and design nirvana.</p>
<p>So, whose world order should prevail in software engineering? The one that works.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="500" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/LH_e8NfNV-c&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="500" height="344" src="http://www.youtube.com/v/LH_e8NfNV-c&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://joecrotty.com/2010/06/whose-world-order/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quote Panel</title>
		<link>http://joecrotty.com/2010/03/quote-panel/</link>
		<comments>http://joecrotty.com/2010/03/quote-panel/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 19:19:35 +0000</pubDate>
		<dc:creator>Joseph Crotty</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://joecrotty.com/?p=674</guid>
		<description><![CDATA[Yesterday while looking at the new blog header I decided to have a hand at adding a quote mechanism. I have always been fond of the hilarious tongue in check The Tao Of Programming series &#8211; the first self titled &#8230; <a href="http://joecrotty.com/2010/03/quote-panel/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Yesterday while looking at the <a title="Nothing to Say" href="http://joecrotty.com/2010/03/nothing-to-say/">new blog header</a> I decided to have a hand at adding a quote mechanism. I have always been fond of the hilarious tongue in check <a title="The Tao Of Programming series" href="http://tal.forum2.org/tao">The Tao Of Programming series</a> &#8211; the first self titled book being best by far. My initial notion was to put it in the footer which seemed vacuous. Puzzled I gave up for a few hours and wandered to a tangential stream of thought. Later, while talking with my wife just before bed an idea hit me like a ton of bricks.  Why not put a sliding quote panel in the header animated by <a title="jQuery" href="http://jquery.com/">jQuery</a>? Nearly sick with excitement I &#8220;uhm&#8221;-ed my way through the rest of the talk with my wife and then stole off the first chance to get to a computer to hammer out some initial code before the ephemeral concept evaporated from my mind.</p>
<p><span id="more-674"></span><a title="Quotes Collection WordPress plugin" href="http://wordpress.org/extend/plugins/quotes-collection/">Quotes Collection</a>, a <a title="WordPress plugin" href="http://wordpress.org/extend/plugins/">WordPress plugin</a>, looked great but after playing with it for five minutes warts appeared. For starters it smartly used a database table, but there were no tools baked in for bulk import.  Secondly, the plugin <a title="UI Wiki" href="http://en.wikipedia.org/wiki/User_interface">UI</a> was badly munging anything I bothered to manually insert into the database. However, the plugin provided an easy to use and feature rich <a title="PHP" href="http://php.net/index.php">PHP</a> function for dropping the quotes into <a title="HTML Wiki" href="http://en.wikipedia.org/wiki/HTML">HTML</a>. I decided to keep the plugin for displaying the quotes and hack a <a title="Perl" href="http://www.perl.org/">perl</a> script to do the bulk database quote insert.</p>
<p>Fortunately, the <a title="The Tao Of Programming" href="http://www.canonical.org/~kragen/tao-of-programming.html">quotes  themselves were easy enough to obtain</a> and due to a lapsed copyright  available for the taking. After copy and pasting them into <a title="Vim" href="http://www.vim.org/">vim</a> and staring at one line for nearly three minutes fatigue settled in. I made a few conceptual mental notes for the morrow and went to bed.</p>
<p>Early today I finished the edit of the quotes file, ttop.dat, in a vim editor. The tedium of manually stripping poor double quote characters, blank lines, and extra spaces raced by with a rested mind. I settled on using &#8216;&#8212;&#8217; as a delimiter between all quotes as most contained multiple lines knowing that perl&#8217;s <a title="Perl Input Record Separator" href="http://perldoc.perl.org/perlvar.html#$/">input record separator</a> would permit parsing pliability. Once the quote file edit was complete I hacked up the perl script to slurp and parse the file and insert each quote to the database. After a few trail runs to ferret out the bugs the quotes were neatly tucked away in the database.</p>
<pre class="brush: perl; title: ; toolbar: true; notranslate">
#!/usr/bin/perl

use strict;
use warnings;

use DBI;

# insert the new uirs into the db
sub db_insert_quotes {
    my $quote_sref = shift;
    my $dbh = shift;

    my $sql = &quot;INSERT INTO wp_quotescollection (quote, author, source, tags, visible, time_added, time_updated)
               VALUES (?, 'Geoffrey James', 'The Tao Of Programming', 'TTOP', 'yes', NOW(), NOW())&quot;;
    my $sth = $$dbh-&gt;prepare($sql);
    $sth-&gt;bind_param(1, $$quote_sref);
    $sth-&gt;execute;
}

# Connect to the database.
my $dbh = DBI-&gt;connect(&quot;DBI:mysql:database=DATABASE;host=localhost&quot;,
                       &quot;USER&quot;, &quot;PASSWORD&quot;,
                       {'RaiseError' =&gt; 1});

$/ = &quot;---\n&quot;;
while (&lt;&gt;) {
    chomp;
    chop;
    my $quote = $_;
    #db_insert_quotes(\$quote, \$dbh);
}

exit;
</pre>
<p>A few months back I vaguely recalled reading a <a title="WebDesinger Wall" href="http://www.webdesignerwall.com/tutorials/jquery-tutorials-for-designers/">jQuery article</a> with a great <a title="Simple Sliding Panel Demo" href="http://www.webdesignerwall.com/demo/jquery/simple-slide-panel.html">simple sliding panel demo</a>. After grabbing a few images and applying a dollop or two of CSS, Javascript, and HTML my panel was functional. <a title="Kuler" href="http://kuler.adobe.com/">Kuler</a>&#8216;s color insights came to the rescue again saving site visitors from my train wreck artistic spasms.</p>
<p>This site enhancement was a joy to work on. I hope visitors are enthused about it as I am.</p>
]]></content:encoded>
			<wfw:commentRss>http://joecrotty.com/2010/03/quote-panel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nothing to Say</title>
		<link>http://joecrotty.com/2010/03/nothing-to-say/</link>
		<comments>http://joecrotty.com/2010/03/nothing-to-say/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 22:54:28 +0000</pubDate>
		<dc:creator>Joseph Crotty</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://joecrotty.com/?p=666</guid>
		<description><![CDATA[It was an arid posting week here at the blog trying to come up with something fresh to say. In the process of looking around at the ship shape of the blog the realization that the header and logo look &#8230; <a href="http://joecrotty.com/2010/03/nothing-to-say/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It was an arid posting week here at the blog trying to come up with something fresh to say. In the process of looking around at the ship shape of the blog the realization that the header and logo look squirrelly occurred. So I fired up <a title="Adobe Photoshop" href="http://www.adobe.com/products/photoshop/photoshop/">Photoshop</a>, <a title="Vim" href="http://www.vim.org/">vim</a> and <a title="Git" href="http://git-scm.com/">git</a> and changed things around to a more streamlined, recognizable and social/web 2.0 header area.  Also, the <a title="Archive Layout Issue Blog Post" href="http://joecrotty.com/2010/03/design-tweaks/">archive layout issue</a> was fixed yet again. Now if I could only come up with a good idea to blog about.</p>
]]></content:encoded>
			<wfw:commentRss>http://joecrotty.com/2010/03/nothing-to-say/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nikon D90 Learning Tools</title>
		<link>http://joecrotty.com/2010/03/nikon-d90-learn-tools/</link>
		<comments>http://joecrotty.com/2010/03/nikon-d90-learn-tools/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 15:00:19 +0000</pubDate>
		<dc:creator>Joseph Crotty</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://joecrotty.com/?p=630</guid>
		<description><![CDATA[In have been eying the Nikon D90 DSLR for the better part of three months. At the start of March, 2010 Nikon Rumors reported some deep online discounts were in the works and with my birthday pending at the end &#8230; <a href="http://joecrotty.com/2010/03/nikon-d90-learn-tools/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In have been eying the <a title="Nikon D90" href="http://www.nikonusa.com/Find-Your-Nikon/Product/Digital-SLR/25446/D90.html">Nikon D90</a> <a title="DSLR Wiki" href="http://en.wikipedia.org/wiki/Digital_single-lens_reflex_camera">DSLR</a> for the better part of three months. At the start of March, 2010 <a title="Nikon Rumors" href="http://nikonrumors.com/">Nikon Rumors</a> reported some <a title="Nikon Rumors discount roundup" href="http://nikonrumors.com/2010/03/03/the-latest-nikon-instant-rebates-list.aspx">deep online discounts</a> were in the works and with my birthday pending at the end of the month I pulled the trigger and purchased a D90 camera kit including a <a title="Nikkor Lenses" href="http://www.nikonusa.com/Find-Your-Nikon/Product/Camera-Lenses/2192/AF-S-DX-NIKKOR-18-200mm-f%252F3.5-5.6G-ED-VR-II.html">Nikkor 18-200mm f/3.5-5.6G ED VRII</a> all around lens from <a title="B&amp;H Photo Video" href="http://www.bhphotovideo.com/">B&amp;H Photo Video</a>. Much to my joy even my wife approved the purchase. Now that the easy part is done it&#8217;s time to learn how to use this interface monster.</p>
<p><span id="more-630"></span>Set up with a 16G <a title="SDHC Wiki" href="http://en.wikipedia.org/wiki/Secure_Digital#SDHC">SDHC</a> memory card and a decent <a title="Schneider Optics" href="http://www.schneideroptics.com/">B+W</a> lens filter I spent my first day poking around for D90 learning tools and culled the following list:</p>
<ul>
<li>Nikon D90 <a title="Nikon D90 manual" href="http://www.nikonusa.com/pdf/manuals/noprint/D90_ennoprint.pdf">manual</a></li>
<li>Nikon D90 <a title="Digitutor videos" href="http://www.nikondigitutor.com/eng/d90/index.shtml">Digitutor</a> videos</li>
<li>Ken Rockwell&#8217;s Nikon D90 <a title="Ken Rockwell's Nikon D90 User's Guide" href="http://www.kenrockwell.com/nikon/d90/users-guide/index.htm">Users&#8217;s Guide</a></li>
</ul>
<p>This probably sounds trite but reading parts of the manual, especially the camera body layout and control panel diagrams, taught me a great deal. After shooting some pictures around the apartment I drove to one of my favorite outdoor haunts, <a title="Eldorado Canyon State Park" href="http://parks.state.co.us/parks/eldoradocanyon/Pages/EldoradoCanyonHome.aspx">Eldorado Canyon State Park</a>, for an afternoon of milling around the trails with an itchy trigger finger.</p>
<div class="wp-caption alignnone" style="width: 500px"><a href="http://i168.photobucket.com/albums/u196/joecrotty/joecrottycom/2010-03-13_15-40-58.jpg"><img class="noborder" title="Fowler Trail Hikers" src="http://i168.photobucket.com/albums/u196/joecrotty/joecrottycom/2010-03-13_15-40-58_webjc.jpg" alt="" width="490" height="325" /></a><p class="wp-caption-text">Fowler Trail Hikers</p></div>
<div class="wp-caption alignnone" style="width: 500px"><a href="http://i168.photobucket.com/albums/u196/joecrotty/joecrottycom/2010-03-13_15-54-44.jpg"><img title="One dream begins as another ends" src="http://i168.photobucket.com/albums/u196/joecrotty/joecrottycom/2010-03-13_15-54-44_webjc.jpg" alt="" width="490" height="738" /></a><p class="wp-caption-text">One dream begins as another ends</p></div>
]]></content:encoded>
			<wfw:commentRss>http://joecrotty.com/2010/03/nikon-d90-learn-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GoF Design Patterns</title>
		<link>http://joecrotty.com/2010/03/gof-design-patterns/</link>
		<comments>http://joecrotty.com/2010/03/gof-design-patterns/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 19:56:21 +0000</pubDate>
		<dc:creator>Joseph Crotty</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Featured Content]]></category>

		<guid isPermaLink="false">http://joecrotty.com/?p=618</guid>
		<description><![CDATA[As a programmer and all around nerd dating back to my teen years I have covered a fair bit of computing terrain. However, at a recent job interview requiring Java skills I completely floundered when asked, "Talk to us about design patterns and illustrate some instances where you have applied them?" <a href="http://joecrotty.com/2010/03/gof-design-patterns/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As a programmer and all around nerd dating back to my teen years I have covered a fair bit of computing terrain. However, at a recent job interview requiring Java skills I completely floundered when asked, &#8220;Talk to us about design patterns and illustrate some instances where you have applied them?&#8221;  Baffled and not one to beat around the bush I admitted my naivety immediatley. In a gesture of kindness the interview panel threw a few classic design patterns at me like singleton and abstract factory both of which I was aware of, but only had a vague grasp of. One guy on the panel suggested I read up on a famous engineering design pattern book by a group referred to as the Gang of Four. I took him up on that offer a few days later and ordered a used copy of <a title="Design Patterns Wiki" href="http://en.wikipedia.org/wiki/Design_Patterns"><em>Design Patterns: Elements of Reusable Object-Oriented Software</em></a> from <a title="Buy Design Patterns at Amazon" href="http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612">Amazon</a>.</p>
<p><span id="more-618"></span></p>
<div id="attachment_623" class="wp-caption alignnone" style="width: 500px"><img class="size-large wp-image-623" title="Design Patterns Front Cover" src="http://joecrotty.com/wp-content/uploads/2010/03/design_patterns_bookfc-490x490.jpg" alt="" width="490" height="490" /><p class="wp-caption-text">Design Patterns Front Cover</p></div>
<p>The book arrived two days ago and I have been busy poring over it in my spare time. I am using a <a title="GoF/Gamma Patterns" href="http://mahemoff.com/paper/software/learningGoFPatterns/">study guide</a> that groups the patterns by difficulty ranging from easy to advanced. Can&#8217;t wait to finish reading and possibly start applying these new nuggets of knowledge to my current AJAX charting application project.</p>
]]></content:encoded>
			<wfw:commentRss>http://joecrotty.com/2010/03/gof-design-patterns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Math Combinations, RDBMS and Perl</title>
		<link>http://joecrotty.com/2010/03/math-combinations-rdbms-and-perl/</link>
		<comments>http://joecrotty.com/2010/03/math-combinations-rdbms-and-perl/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 15:00:46 +0000</pubDate>
		<dc:creator>Joseph Crotty</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://joecrotty.com/?p=507</guid>
		<description><![CDATA[Recently, while developing a web charting application I ran into a problem involving combinations and permutations. The application mimics an existing paper charting method with it&#8217;s own meta language to describe certain visual biological markers.  One subset of the meta &#8230; <a href="http://joecrotty.com/2010/03/math-combinations-rdbms-and-perl/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently, while developing a web charting application I ran into a problem involving <a title="Combinations and Permutations Mathfun" href="http://www.mathsisfun.com/combinatorics/combinations-permutations.html">combinations and permutations</a>. The application mimics an existing paper charting method with it&#8217;s own meta language to describe certain visual biological markers.  One subset of the meta language defines eight shorthand notation character codes:</p>
<ul>
<li>B = Brown (or Black) Bleeding</li>
<li>C = Cloudy (white)</li>
<li>C/K = Cloudy/Clear</li>
<li>G = Gummy (gluey)</li>
<li>K = Clear</li>
<li>L = Lubricative</li>
<li>P = Pasty (creamy)</li>
<li>Y = Yellow (even pale yellow)</li>
</ul>
<p>Each code can be selected once with any other combination of codes.  Some examples of possible code string combinations with dash separator(s):</p>
<p><span id="more-507"></span></p>
<ol>
<li>B &#8211; C</li>
<li>C/K &#8211; K &#8211; P &#8211; Y</li>
<li>K &#8211; P &#8211; Y &#8211; C/K</li>
<li>L &#8211; L &#8211; Y Note, not valid due to duplicate L code</li>
</ol>
<p>Eventually, these code strings are stored in a <a title="RDBMS Wiki" href="http://en.wikipedia.org/wiki/Relational_database_management_system">RDBMS</a>.  The question is how to store them efficiently? We could store them as a string datatype (e.g.,  VARCHAR), but this would be inefficient because on average a code string would take up more bytes then a number datatype (e.g., INT) used to represent the code string.  This implies a look up table of code strings with related numbers and a <a title="Foreign Key Wiki" href="http://en.wikipedia.org/wiki/Foreign_key">foreign key</a> on the main storage table(s) <a title="Referential Integrity Wiki" href="http://en.wikipedia.org/wiki/Referential_integrity">referentially constrained</a> to the look up table.</p>
<div id="attachment_611" class="wp-caption alignnone" style="width: 392px"><img class="size-full wp-image-611 " title="Entity Relationship Diagram" src="http://joecrotty.com/wp-content/uploads/2010/03/er_codes.png" alt="" width="382" height="114" /><p class="wp-caption-text">Entity Relationship Diagram</p></div>
<p>Further, consider the third string code example above. Semantically it&#8217;s the same as example two, but is ordered differently (AKA permutation). To properly <a title="RDBMS Data Normilization Wiki" href="http://en.wikipedia.org/wiki/Database_normalization">normalize</a> the data we should alphabetically arrange the permutations so that order does not matter which will vastly reduce the number of possible string code combinations.</p>
<p>Now that we know how the data should be modeled we must populate the string code look up table. The first obvious question is how many combinations are possible when order doesn&#8217;t matter? Use the formula below where <em><strong>n</strong></em> is the number of things to choose from, and you  choose <em><strong>r</strong></em> of them (No repetition, order doesn&#8217;t  matter). ! means <a title="Factorial Wiki" href="http://en.wikipedia.org/wiki/Factorial">factorial</a>.</p>
<p><img class="alignnone size-full wp-image-537 noborder" title="Formula Combinations No Repeat" src="http://joecrotty.com/wp-content/uploads/2010/03/combinations-no-repeat.png" alt="" width="150" height="53" /></p>
<p>For example, for the eight possible codes if we select four then there are 70 possible code combinations where order doesn&#8217;t matter.  However, we need to know the number of non repeating combinations possible for our set of eight codes given we can select between one to eight codes. I&#8217;ll leave that simple exercise as reader homework, but excluding the possibility of selecting no codes the answer is 255.</p>
<p>Now the crux of the matter. Insert the 255 non repeating combinations, alphabetically arranged, with a unique number for each into the RDBMS lookup table. Assuming you managed the math part and have made it this far you can now go and gently beat your head against a wall for a few minutes &#8211; then return, please.  <a title="The Perl Programming Language" href="http://www.perl.org/">Perl</a> to the rescue! With it&#8217;s ease of extensions via <a title="Comprehensive Perl Archive Network" href="http://www.cpan.org/">CPAN</a> modules and high level programming abstractions it is the ideal glue language to tackle what looks to be a formidable problem.</p>
<p>Our first order is to google CPAN and see what, if any, perl modules are available to deal with math combinations.  Ah, the <a title="Math Combinatorics Module" href="http://search.cpan.org/~allenday/Math-Combinatorics-0.09/lib/Math/Combinatorics.pm">Math::Combinatorics</a> module should fit the bill nicely. Second, we need to install the Math::Combinatorics module locally. While we are at we also need to install <a title="DBI CPAN" href="http://search.cpan.org/~TIMB/DBI/DBI.pm">DBI</a> and <a title="DBD::mysql CPAN" href="http://search.cpan.org/~capttofu/DBD-mysql-4.013/lib/DBD/mysql.pm">DBD::mysql</a> modules to enable perl access to our <a title="MySQL" href="http://www.mysql.com/">MySQL</a> RDBMS so we can insert the combinations into our look up table. Most default perl installs come with a handy tool called <a title="Cpan for CPAN" href="http://search.cpan.org/~andk/CPAN-1.9402/lib/CPAN.pm">cpan</a> which gives command line access to the CPAN online module repository to ease searching and installing locally.</p>
<pre class="brush: bash; title: ; toolbar: true; notranslate">
joecrotty@macpro:~ $ sudo cpan
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.9402)
Enter 'h' for help.

cpan[1]&amp;gt; install Math::Combinatorics
...

cpan[2]&amp;gt; q
Terminal does not support GetHistory.
Lockfile removed.
</pre>
<p>With the modules in place our finished perl script is below. Note, the actual database inserts are commented out on lines 29 and 30.</p>
<pre class="brush: perl; title: ; toolbar: true; notranslate">
#!/opt/local/bin/perl

use strict;
use warnings;

use Math::Combinatorics;
use DBI;

$| = 1; # disable buffering
my @codes = ('B', 'C', 'C/K', 'G',
             'K', 'L', 'P', 'Y');

# Connect to the database.
my $dbh = DBI-&amp;gt;connect(&amp;quot;DBI:mysql:database=DB;host=HOST&amp;quot;,
                       &amp;quot;USER&amp;quot;, &amp;quot;PASSWD&amp;quot;,
                      {'RaiseError' =&amp;gt; 1});
my $sql = 'INSERT INTO wp_nt_sec_combos (description)
           VALUES (?)';
my $sth = $dbh-&amp;gt;prepare($sql);

for ( 1 .. 8 ) {
    my $combinat = Math::Combinatorics-&amp;gt;new(count =&amp;gt; $_,
                                             data =&amp;gt; [@codes]);

    while(my @combo = $combinat-&amp;gt;next_combination){
        @combo = sort @combo;
        my $combi = join('-', @combo);
        print $combi, &amp;quot;\n&amp;quot;;
        #$sth-&amp;gt;bind_param(1, $combi);
        #$sth-&amp;gt;execute;
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://joecrotty.com/2010/03/math-combinations-rdbms-and-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design tweaks</title>
		<link>http://joecrotty.com/2010/03/design-tweaks/</link>
		<comments>http://joecrotty.com/2010/03/design-tweaks/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 02:06:10 +0000</pubDate>
		<dc:creator>Joseph Crotty</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://joecrotty.com/?p=468</guid>
		<description><![CDATA[About a month ago I revised the website look.  Today I fixed a few subtle things: &#8216;Featured Posts&#8217; widget images in the sidebar now link directly to the post. Padding between all the sidebar widgets (e.g., &#8216;Featured Posts&#8217;, &#8216;Recent Posts&#8217;, &#8230; <a href="http://joecrotty.com/2010/03/design-tweaks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>About a month ago I <a title="Website Redesign" href="/2010/01/design-reload/">revised</a> the website look.  Today I fixed a few subtle things:</p>
<ol>
<li>&#8216;Featured Posts&#8217; widget images in the sidebar now link directly to the post.</li>
<li>Padding between all the sidebar widgets (e.g., &#8216;Featured Posts&#8217;, &#8216;Recent Posts&#8217;, etc.) is now even.</li>
<li>&#8216;Archives&#8217; sidebar widget is now collapsible. Note, there is a bug in IE6-8 and I am not sure when I&#8217;ll have time to fix it. My recommendation is to switch your browser to <a title="FireFox" href="http://www.mozilla.com/en-US/firefox/personal.html">Firefox</a>, <a title="Chrome" href="http://www.google.com/chrome">Chrome</a>, or <a title="Safari" href="http://www.apple.com/safari/">Safari</a>.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://joecrotty.com/2010/03/design-tweaks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

