<?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>Big Dave's Blog</title>
	<atom:link href="http://davedupre.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://davedupre.com</link>
	<description>Some random thoughts - Go big or stay home!</description>
	<lastBuildDate>Mon, 15 Jun 2009 11:00:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Checkout Hoptoad by thoughtbot, inc.</title>
		<link>http://davedupre.com/2009/06/15/checkout-hoptoad-by-thoughtbot-inc/</link>
		<comments>http://davedupre.com/2009/06/15/checkout-hoptoad-by-thoughtbot-inc/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 11:00:12 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[hoptoad]]></category>
		<category><![CDATA[workling]]></category>

		<guid isPermaLink="false">http://davedupre.com/?p=370</guid>
		<description><![CDATA[ I&#8217;ve been using Hoptoad for about two months now, and I&#8217;m sold. Hoptoad is a product by thoughbot, inc. Previously, I&#8217;ve always used the excellent exception_notification plugin. The exception_notification plugin is easy to use, and it works great. However, there are a couple of problems with it.

You could flood your inbox if there is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://hoptoadapp.com/welcome"><img class="alignnone" title="Hoptoad Logo" src="http://hoptoadapp.com/images/logo.png" alt="" width="252" height="94" /></a> I&#8217;ve been using <a href="http://hoptoadapp.com/welcome">Hoptoad</a> for about two months now, and I&#8217;m sold. Hoptoad is a product by <a href="http://www.thoughtbot.com/">thoughbot, inc</a>. Previously, I&#8217;ve always used the excellent <a href="http://github.com/rails/exception_notification/tree/master">exception_notification</a> plugin. The exception_notification plugin is easy to use, and it works great. However, there are a couple of problems with it.</p>
<ol>
<li>You could flood your inbox if there is a bad problem on a popular page.</li>
<li>It&#8217;s difficult to collect all the emails and track errors.</li>
</ol>
<p>Enter Hoptoad. Hoptoad solves both problems, and it is super simple to use and setup. It&#8217;s free for one project and two users. If that isn&#8217;t enough for you, the premium services are very reasonable.</p>
<p>How does it solve both problems? First, Hoptoad will still send you an email when there is an error. However, it won&#8217;t flood your inbox if there are hundreds of the same email. Second, Hoptoad provides a simple web-based system that groups your errors by exception class. That makes it easier to track down problems. Finally, you can mark errors resolved so you don&#8217;t have to wade through noise to solve the real problems.</p>
<p>Hoptoad installation:</p>
<p><strong>REMOVE EXCEPTION_NOTIFIER</strong></p>
<ol>
<li>In your ApplicationController, REMOVE this line:include ExceptionNotifiable</li>
<li>In your config/environment* files, remove all references to ExceptionNotifier.</li>
<li>Remove the vendor/plugins/exception_notifier directory.</li>
</ol>
<p><strong>INSTALL HOPTOAD_NOTIFIER</strong></p>
<p>From your project&#8217;s RAILS_ROOT, run:</p>
<p>script/plugin install git://github.com/thoughtbot/hoptoad_notifier.git</p>
<p><strong>CONFIGURATION</strong></p>
<p>You should have something like this in config/initializers/hoptoad.rb.</p>
<pre>HoptoadNotifier.configure do |config|
  config.api_key = '1234567890abcdef'  # You get your key when you sign up
end</pre>
<p>(Please note that this configuration should be in a global configuration, and is <strong>not</strong> enrivonment-specific. Hoptoad is smart enough to know what errors are caused by what environments, so your staging errors don&#8217;t get mixed in with your production errors.)</p>
<p>Once you do the above, any Exception not caught by your controllers will be sent to Hoptoad where where they can be aggregated, filtered, sorted, analyzed, massaged, and searched.</p>
<p>Now, if you have read anything I&#8217;ve done before, you know I do a lot of asynchronous processing with <a href="http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/">Workling</a>. By default, Hoptoad will not log errors from anything outside of your controllers. Fear not. Hoptoad provides a webservice API to send errors. Here is an example.</p>
<p>In workling/lib/workling/base.rb:</p>
<pre>    # takes care of suppressing remote errors but raising Workling::WorklingNotFoundError
    # where appropriate. swallow workling exceptions so that everything behaves like remote code.
    # otherwise StarlingRunner and SpawnRunner would behave too differently to NotRemoteRunner.
    def dispatch_to_worker_method(method, options)
      begin
        self.send(method, options)
      rescue Exception =&gt; e
        raise e if e.kind_of? Workling::WorklingError
        logger.error "Workling Error: runner could not invoke #{ self.class }:#{ method } with #{ options.inspect }. error was: #{ e.inspect }\n #{ e.backtrace.join("\n") }"
        # DND: Let HopToad know of the issue
        params = options || {}
        HoptoadNotifier.notify(
          :error_class =&gt; "Workling Error - #{e.class.name}",
          :error_message =&gt; "Workling Error(#{e.class.name}): #{e.message}",
          :request =&gt; { :params =&gt; params.merge(:worker_class =&gt; self.class.name, :worker_method =&gt; method) })
        # DND: end of change
      end
    end</pre>
<p>Now, any error not caught by your workers will be sent to Hoptoad for processing. You can use a similar method from Rake tasks or any scripts that run outside of controllers. Remember, Hoptoad will collect errors by :error_class, so you can use different classes to separate errors into bins based on where they came from.</p>
<p>Give Hoptoad a try. You will not be disappointed.</p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2009/06/15/checkout-hoptoad-by-thoughtbot-inc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bargaining for Advantage</title>
		<link>http://davedupre.com/2009/06/14/bargaining-for-advantage/</link>
		<comments>http://davedupre.com/2009/06/14/bargaining-for-advantage/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 13:33:39 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[bargain]]></category>
		<category><![CDATA[negotiation]]></category>

		<guid isPermaLink="false">http://davedupre.com/?p=364</guid>
		<description><![CDATA[It&#8217;s not a programming book, but I recommend &#8220;Bargaining for Advantage&#8221; by G. Richard Shell. You may not be making multi-million or multi-billion dollar deals (yet!), but the techniques described here work just as well when negotiating an architectural detail or project. Plus, it&#8217;s pretty interesting to read about how some of the big players [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.com/Bargaining-Advantage-Negotiation-Strategies-Reasonable/dp/0143036971/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1244985418&amp;sr=8-1"><img class="alignleft size-full wp-image-365" title="Bargaining for Advantage" src="http://davedupre.com/wp-content/uploads/2009/06/bargaining_for_advantage.jpg" alt="Bargaining for Advantage" width="240" height="240" /></a>It&#8217;s not a programming book, but I recommend &#8220;Bargaining for Advantage&#8221; by G. Richard Shell. You may not be making multi-million or multi-billion dollar deals (yet!), but the techniques described here work just as well when negotiating an architectural detail or project. Plus, it&#8217;s pretty interesting to read about how some of the big players made and lost their deals.</p>
<p>Check it out. You may find that you have a different strategy when you negotiate your next deal. Remember, deals are made all the time, and it&#8217;s not always a big business deal.</p>
<p>Good stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2009/06/14/bargaining-for-advantage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>June 6, 2009 &#8211; 65th Anniversary of The Great Crusade</title>
		<link>http://davedupre.com/2009/06/06/june-6-2009-65th-anniversary-of-the-great-crusade/</link>
		<comments>http://davedupre.com/2009/06/06/june-6-2009-65th-anniversary-of-the-great-crusade/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 04:10:55 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[normandy]]></category>
		<category><![CDATA[ww2]]></category>

		<guid isPermaLink="false">http://davedupre.com/?p=329</guid>
		<description><![CDATA[OK, I know I&#8217;m a little off my usual topics again, but today is an anniversary.
In the early morning hours on a Tuesday morning 65 years ago today, D-Day paratroopers began jumping into the French countryside. At first light, six divisions of soldiers from the United States, Britain, and Canada began landing on the beaches [...]]]></description>
			<content:encoded><![CDATA[<p>OK, I know I&#8217;m a little off my usual topics again, but today is an anniversary.</p>
<p>In the early morning hours on a Tuesday morning 65 years ago today, D-Day paratroopers began jumping into the French countryside. At first light, six divisions of soldiers from the United States, Britain, and Canada began landing on the beaches of <a href="http://en.wikipedia.org/wiki/Normandy_Landings">Normandy</a>.  The beaches all had code names Omaha, Utah, Gold, Juno, and Sword. The United States landed on Omaha and Utah. The British took care of Gold and Sword, and the Canadiens landed on Juno.</p>
<p>Just prior to the invasion, General Eisenhower read what is now an historic passage:</p>
<blockquote><p>&#8220;You are about to embark upon the great crusade, toward which we have striven these many months.&#8221;</p></blockquote>
<p>Obviously, you can read about the Normandy invasions everywhere, so I&#8217;m not going to describe all the events again here. I will, however, talk a little bit about my experiences touring the area as well as introduce you to <a href="http://en.wikipedia.org/wiki/Charles_Durning">Charles Durning</a>.</p>
<p>Who is Charles Durning? You probably know him by his movies. His film career began in 1965. Some credits include &#8220;The Sting&#8221;, &#8220;Dog Day Afternnon&#8221;, &#8220;North Dallas Forty&#8221;, &#8220;The Best Little Whorehouse in Texas&#8221;, &#8220;O Brother, Where Art Thou?&#8221;, and dozens of others. What you may not know about Charles Durning is that he survived two most horrific periods in WWII. You wouldn&#8217;t know because like many veterans of that era, he rarely spoke about it until years later when asked.</p>
<p>Durning was awarded the Silver Star and three Purple Hearts. He was among the <a href="http://www.theatlantic.com/doc/196011/omaha">first wave of troops that landed on Omaha Beach</a>. Suffice to say, the nickname of &#8220;Bloody Omaha&#8221; is descriptive because of the more than 2,200 casualties suffered on 6 JUN 1944.</p>
<p>By 17 JUN 1944, Durning was back in England recovering from  shrapnel wounds in the left and right thighs, the right hand, the frontal region of the head, and the anterior left chest wall. He was pronounced fit again on 6 DEC 1944, just in time for the <a href="http://en.wikipedia.org/wiki/Battle_of_the_Bulge">Battle of the Bulge</a> and his second historical experience.</p>
<p>In 2008, Durning received France&#8217;s National Order of the Legion of Honor (each year France honors 100 veterans that served with distinction in France). At the ceremony, he described his experiences during the Battle of the Bulge. Early in the battle, Durning was stabbed 8(!) times during a hand-to-hand fight with a young German soldier. The fight did not end until Durning was able to reach for a rock and bludgeon the German soldier to death. He said when it was over he wept with the dead German soldier in his arms.</p>
<p>Soon after, Durning was taken prisoner and would have been shot on the spot were if not for an english speaking German officer that accepted his surrender and had his wounds tended to (the 8 stab wounds &#8211; one to the chest). As a prisoner now, Durning was led to a small town called Malmedy. It is here that the infamous <a href="http://en.wikipedia.org/wiki/Malmedy_massacre">Malmedy massacre</a> took place. At Malmedy, some 150 prisoners were rounded up and dozens were executed. Durning and two others of his group managed to escape the carnage. There were many incidents in an around Malmedy, resulting in 72 bodies being discovered.</p>
<p>Durning was on the TV show &#8220;Rescue Me&#8221; this year. It was here that I was reminded of his service and felt the urge to talk about it. I&#8217;m thankful for men like Charles Durning and thousands of other&#8217;s like him. Like most veterans, I agree that the true heros are the ones that didn&#8217;t make it back.</p>
<p>I was lucky enough to pay a short visit to Normandy many years ago. The visit was far too short, but I was able to stand on Omaha and Utah beaches and see what men like Durning faced. Think about 2-3 football fields of open beach to cross with an amphitheater of cliffs all around. Unlike what you see in the movies, it&#8217;s not the machine guns right in front of you that are the most dangerous. It&#8217;s those to the side. This is one of the reasons some units saw casualty rates of over 50% in the first few minutes of the landings. Powerful stuff.</p>
<p>In this time of <a href="http://davedupre.com/2009/02/20/navy-says-combat-robots-multiplying-fast-need-battlefield-ethics-pronto/">robots</a> and smart bombs, we will thankfully never again see mass invasions and infantry action. I only hope it isn&#8217;t replaced with something far worse. So today, while you are enjoying a wonderful Saturday, send a &#8220;Thank You&#8221; to those men and women that started the Great Crusade to clear Europe of Nazi tyranny 65 years ago today.</p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2009/06/06/june-6-2009-65th-anniversary-of-the-great-crusade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Platform Engineers or Rock Star Engineers</title>
		<link>http://davedupre.com/2009/06/03/platform-engineers-or-rock-star-engineers/</link>
		<comments>http://davedupre.com/2009/06/03/platform-engineers-or-rock-star-engineers/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 03:14:07 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[engineer]]></category>

		<guid isPermaLink="false">http://davedupre.com/?p=340</guid>
		<description><![CDATA[I&#8217;ve hired a lot of engineers over the years, and one of the first things I&#8217;m always asked to add to the job description is &#8220;must have experience in XXXX platform.&#8221; I sometimes put it on there to make people happy, but I rarely will disregard an engineer because they do not have a lot [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve hired a lot of engineers over the years, and one of the first things I&#8217;m always asked to add to the job description is &#8220;must have experience in XXXX platform.&#8221; I sometimes put it on there to make people happy, but I rarely will disregard an engineer because they do not have a lot of experience in a particular platform. Give me a Rock Star, or even a very good/great engineer, and I guarantee you that person will run circles around the average engineer with platform experience. Now, if you can find the Rock Star <em>with </em>platform experience &#8212; BONUS! The only time I deviate from this plan is if the project calls for someone to &#8220;just get it done and fast.&#8221; Then I need to pay more attention to platform experience because I don&#8217;t have time to wait for the new platform to be learned.</p>
<p>I&#8217;ve lost track of how many times this simple fact has been proven to me. The qualities of a great engineer carry over to any platform, and a great engineer will pick up a new platform quickly &#8212; mostly because they love learning new things. If you&#8217;re starting out in software development, concentrate on being a great engineer. That&#8217;s far more valuable than an engineer that knows a platform.</p>
<p>What makes a great engineer? To me, it&#8217;s pretty simple. You have a passion and ability to craft outstanding, maintainable, and testable code. You know your algorithms, design patterns, and data structures like the back of your hand. Finally, you posses the other skills necessary to round things out &#8212; communication, time management, risk assessment, strategic and detailed design, and quick decision making (and sticking to those decisions). You can write a loop in Java? I don&#8217;t really care. You understand dependency injection or how an outer join works. Now we&#8217;re talking.</p>
<p>What do you think?</p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2009/06/03/platform-engineers-or-rock-star-engineers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bletchley Park Snubbed by British Government</title>
		<link>http://davedupre.com/2009/05/31/bletchley-park-snubbed-by-british-government/</link>
		<comments>http://davedupre.com/2009/05/31/bletchley-park-snubbed-by-british-government/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 01:54:26 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[bletchley park]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[enigma]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[ww2]]></category>

		<guid isPermaLink="false">http://davedupre.com/?p=328</guid>
		<description><![CDATA[
UK Snubs Support for Home of WWII Enigma
Here we go again. Bletchley Park continues to get little love. Here we have what is basically one on of the birthplaces of modern computing. On top of that, the group of people that worked here, along with their US partners in Building 26, did more to shorten [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.boingboing.net/2009/05/22/bletchley-park-snubb.html"></a></p>
<p><a href="http://www.eweekeurope.co.uk/news/uk-snubs-support-for-home-of-wwii-enigma--939">UK Snubs Support for Home of WWII Enigma</a></p>
<p>Here we go again. <a href="http://davedupre.com/2008/11/06/bletchley-park-update/">Bletchley Park</a> continues to get <a href="http://davedupre.com/2008/07/24/neglect-of-bletchley-condemned/">little love</a>. Here we have what is basically one on of the birthplaces of modern computing. On top of that, the group of people that worked here, along with their US partners in <a href="http://davedupre.com/2009/02/05/the-secret-in-building-26/">Building 26</a>, did more to shorten WWII and save countless lives than just about any other group. Makes your life as a military leader a whole lot easier when you know what your counterpart is up to.</p>
<p>It seems now that the UK will not give Bletchley Park the same status as Imperial War Museum.</p>
<blockquote><p>&#8220;We have no plans at present to associate it with the Imperial War Museum,&#8221; Lord Davies said. &#8220;The House is all too well aware of the significance of designating any area in association with a museum of that rank, but I want to give an assurance that Bletchley Park will continue to develop under the resources made available to it.&#8221;</p></blockquote>
<p>OK, I know I&#8217;m a little biased because I&#8217;m a history buff, but I&#8217;m also aware of the history of my profession. Without these two groups of scientists, we might not have the same level of computing we have today. This is where <a href="http://en.wikipedia.org/wiki/Alan_Turing">Alan Turing</a> (of <a href="http://en.wikipedia.org/wiki/Turing_machine">Turing Machine</a> fame) cut his chops.</p>
<p>Let&#8217;s not forget about these people and what they did. I know it was super-secret, but it was almost 70 years ago now. </p>
<p> </p>
<p><a href="http://www.boingboing.net/2009/05/22/bletchley-park-snubb.html"> </a></p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2009/05/31/bletchley-park-snubbed-by-british-government/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Workling Timing Issue</title>
		<link>http://davedupre.com/2009/05/28/workling-timing-issue/</link>
		<comments>http://davedupre.com/2009/05/28/workling-timing-issue/#comments</comments>
		<pubDate>Fri, 29 May 2009 02:28:15 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[workling]]></category>

		<guid isPermaLink="false">http://davedupre.com/?p=333</guid>
		<description><![CDATA[As you probably noticed already, I use Workling a lot, and I wrote about it a few times (Part 1, Part 2, Part 3). One minor gotcha to be aware of is that you need to make sure you handle it when Workling is too fast. A common use of Workling is to make a [...]]]></description>
			<content:encoded><![CDATA[<p>As you probably noticed already, I use <a href="http://playtype.net/past/2008/10/2/workling_version_03_released/">Workling</a> a lot, and I wrote about it a few times (<a href="http://davedupre.com/2008/03/25/ruby-background-tasks-with-starling/">Part 1</a>, <a href="http://davedupre.com/2008/03/29/ruby-background-tasks-with-starling-part-2/">Part 2</a>, <a href="http://davedupre.com/2008/04/01/ruby-background-tasks-with-starling-part-3/">Part 3</a>). One minor gotcha to be aware of is that you need to make sure you handle it when Workling is too fast. A common use of Workling is to make a call in an after_save method. For example:</p>
<pre>class User &lt; ActiveRecord::Base
  def after_save
    MyWorker.asynch_geocode_address(:user_id =&gt; self.id)
  end
end</pre>
<pre>class MyWorker &lt; Workling::Base
  def geocode_address(options = {})
    user = User.find(options[:user_id])
    user.geocode_address
  end
end</pre>
<p>Pretty straight forward, right? Unfortunately, what you will find is that often your worker will get called so fast on create that ActiveRecord hasn&#8217;t committed the transaction yet, and User.find will fail. To get around this, you need to write your workers that could be called from after_save/after_create to handle this condition. Instead of the above, you need to do the following:</p>
<pre>class MyWorker &lt; Workling::Base
  def geocode_address(options = {})
    retries = 3
    begin
      user = User.find(options[:user_id])
      user.geocode_address
    rescue =&gt; err
      if (retries -= 1) &gt; 0
        sleep(0.2)  # Give ActiveRecord a chance to save
        retry
      end
      raise err
    end
  end
end</pre>
<p>Now we catch the exception that ActiveRecord throws when it can&#8217;t find the new user yet. Waiting a short time and trying a few times gives ActiveRecord a chance to commit the record.</p>
<p>Enjoy asynchronous processing&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2009/05/28/workling-timing-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thousand Yard Stares: Ruins and Ghosts of the Battle of Peleliu</title>
		<link>http://davedupre.com/2009/05/26/thousand-yard-stares-ruins-and-ghosts-of-the-battle-of-peleliu/</link>
		<comments>http://davedupre.com/2009/05/26/thousand-yard-stares-ruins-and-ghosts-of-the-battle-of-peleliu/#comments</comments>
		<pubDate>Tue, 26 May 2009 14:41:58 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[peleliu]]></category>
		<category><![CDATA[ww2]]></category>

		<guid isPermaLink="false">http://davedupre.com/?p=310</guid>
		<description><![CDATA[Thousand Yard Stares: Ruins and Ghosts of the Battle of Peleliu, 1944, 2008  « The Wired Jester
In reference to Memorial Day, I came across the above link. More than most battles, Peleliu is one of those that defines sacrifice. The amount of suffering and carnage endured on that small island in the Pacific is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://thewiredjester.co.uk/2009/04/11/thousand-yard-stares-ruins-and-ghosts-of-the-battle-of-peleliu-1944-2008/">Thousand Yard Stares: Ruins and Ghosts of the Battle of Peleliu, 1944, 2008  « The Wired Jester</a></p>
<p>In reference to Memorial Day, I came across the above link. More than most battles, Peleliu is one of those that defines sacrifice. The amount of suffering and carnage endured on that small island in the Pacific is difficult to imagine. This is where the term &#8220;thousand yard stare&#8221; came from.</p>
<div id="attachment_319" class="wp-caption alignnone" style="width: 478px"><img class="size-full wp-image-319 " title="2000yardstare" src="http://davedupre.com/wp-content/uploads/2009/05/2000yardstare.jpg" alt="Thousand Yard Stare, Tom Lea" width="468" height="490" /><p class="wp-caption-text">&quot;Thousand Yard Stare&quot; by Tom Lea</p></div>
<div id="attachment_320" class="wp-caption alignleft" style="width: 250px"><a href="http://www.amazon.com/Old-Breed-At-Peleliu-Okinawa/dp/0891419195/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1243347733&amp;sr=8-1"><img class="size-full wp-image-320" title="withtheoldbreed" src="http://davedupre.com/wp-content/uploads/2009/05/withtheoldbreed.jpg" alt="&quot;With the Old Breed&quot; by Eugene Sledge" width="240" height="240" /></a><p class="wp-caption-text">&quot;With the Old Breed&quot; by Eugene Sledge</p></div>
<p>Prior to going to Peleliu, Lea was known more for &#8216;Go America!&#8217; paintings, but something changed after that. No longer was it a matter of glory. It was survival.</p>
<p>Peleliu is also the subject of what I believe to be one of the finest wartime biographies ever written. If want a real description of combat and sacrifice, you must read &#8220;<a href="http://www.amazon.com/Old-Breed-At-Peleliu-Okinawa/dp/0891419195/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1243347733&amp;sr=8-1">With the Old Breed</a>&#8221; by Eugene Sledge. Sledge was on the island for entire 4 months of fighting. 10,000 Japanese soldiers and about 2000 Americans died on this island 3 Miles Long and 1 mile wide, but that wasn&#8217;t the worst of it. You have to read the book to fully understand his descriptions of living among corpses for days/weeks in 100 degree heat.</p>
<p>Again, thank you to all those that serve and have served. Freedom is not free, and I try to remember every day what it took to create and keep what we have in this wonderful country of ours.</p>
<p>Next post will be back to technical stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2009/05/26/thousand-yard-stares-ruins-and-ghosts-of-the-battle-of-peleliu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gotcha with find_each and find_in_batches</title>
		<link>http://davedupre.com/2009/05/20/gotcha-with-find_each-and-find_in_batches/</link>
		<comments>http://davedupre.com/2009/05/20/gotcha-with-find_each-and-find_in_batches/#comments</comments>
		<pubDate>Thu, 21 May 2009 03:26:26 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[find_each]]></category>
		<category><![CDATA[find_in_batches]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[with_scope]]></category>

		<guid isPermaLink="false">http://davedupre.com/?p=315</guid>
		<description><![CDATA[Rails 2.3 added a couple of nice new methods &#8211; find_each and find_in_batches. Both methods accomplish the same thing in a slightly different way. Unlike a normal finder these methods grab objects in batches instead of all at once. For instance, if you have 500,000 users, you don&#8217;t want to do the following:
User.find(:all).each { &#124;user&#124; [...]]]></description>
			<content:encoded><![CDATA[<p>Rails 2.3 added a couple of nice new methods &#8211; find_each and find_in_batches. Both methods accomplish the same thing in a slightly different way. Unlike a normal finder these methods grab objects in batches instead of all at once. For instance, if you have 500,000 users, you don&#8217;t want to do the following:</p>
<pre>User.find(:all).each { |user| user.some_method }</pre>
<p>The reason is that you just loaded all 500,000 records into memory, and your server is not happy. Instead, you could do:</p>
<pre>User.find_each { |user| user.some_method }</pre>
<p>By default, the above will only load 1,000 User objects into memory, and your server will thank you. If 1,000 is too big/small for you, use the :batch_size option to change it. The find_in_batches method is similar except that it provides the array to the block instead of one object at a time. For example:</p>
<pre>User.find_in_batches do |users|
  users.each { |user| user.some_method }
end</pre>
<p>If you ever used the wonderful <a href="http://github.com/mislav/will_paginate/tree/master">will_paginate</a> gem, you are probably familiar with the concept from the paginated_each method that will_paginate provided.</p>
<p>So, what is the problem? The problem is that you have to aware that unlike paginate_each, find_each and find_in_batches work by setting up a with_scope block. Therefore, if you need to do any other finds on that same model, the scope will apply. Usually this only affects relationships, but it isn&#8217;t hard to forget. Here is an example:</p>
<pre># This is a purely made up example
class User &lt; ActiveRecord::Base
  # There is a last_login_at attribute
  named_scope :recent_login,
              lambda { |*args|
              { :conditions =&gt; ["people.last_login_at &gt;= ?", (args.first || 1.week.ago)] } }
  belongs_to :parent, :class_name =&gt; "User", :foreign_key =&gt; "parent_id"
end </pre>
<pre>User.recent_login.find_each do |user|
  parent = user.parent # This will include the recent_login scope.
end </pre>
<p>It&#8217;s no different than other with_scope issues, but it isn&#8217;t as obvious. You can get around it by doing:</p>
<pre>User.recent_login.find_each do |user|
  # Got use send because with_excusive_scope is protected.
  User.send(:with_exclusive_scope)
    parent = user.parent # This will include the recent_login scope
  end
end</pre>
<p>Now, go and be kind to your server with find_each and find_in_batches &#8211; just remember the scope.</p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2009/05/20/gotcha-with-find_each-and-find_in_batches/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why We Need Audiophiles</title>
		<link>http://davedupre.com/2009/04/16/why-we-need-audiophiles/</link>
		<comments>http://davedupre.com/2009/04/16/why-we-need-audiophiles/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 16:53:02 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://davedupre.com/?p=307</guid>
		<description><![CDATA[Gizmodo &#8211; Why We Need Audiophiles &#8211; Audiophiles
This is a great read for anyone that is interested in great sound. I&#8217;ve said it a few times, I&#8217;m not into expensive audio gear because I like gadgets (although that part is fun too). I&#8217;m into expensive gear because I flat-out love music, and I want to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://i.gizmodo.com/5213042/why-we-need-audiophiles">Gizmodo &#8211; Why We Need Audiophiles &#8211; Audiophiles</a></p>
<p>This is a great read for anyone that is interested in great sound. I&#8217;ve said it a few times, I&#8217;m not into expensive audio gear because I like gadgets (although that part is fun too). I&#8217;m into expensive gear because I flat-out love music, and I want to hear it like the artist meant it to be heard. I will tolerate MP3&#8217;s on my phone, but not when I want to hear some really choice music played like it was meant to. Sadly, between my kids and my schedule, I do not get near enough time for pure listening.</p>
<blockquote><p>This is Michael Fremer. He&#8217;s listening to &#8220;Avalon&#8221; by Roxy Music on his $350,000 stereo system. It sounds <em>excellent</em>. He&#8217;s a bit crazy, but if you love music, you need him.</p></blockquote>
<p>BTW, &#8220;Avalon&#8221; is one of those pieces of music that screams for high quality. My system isn&#8217;t quite in the league of $350k, but it does pretty well.</p>
<p>I think the following quote sums up my thoughts exactly:</p>
<blockquote><p>Because the thing is, Fremer loves music first and foremost. The audiophile I had feared was one who cares far more about the overpriced gadgetry than the actual music. This is not who I ended up meeting. This man listens to music and makes sure it was recorded with the best fidelity, that the intents of the artist have been preserved. And thank God he does, because we certainly don&#8217;t.</p></blockquote>
<p>If you ever get a chance to listen to a favorite, well-recorded piece of music on a choice system, take it. You may be surprised at the subtleties and feeling you are missing. Be careful though. <a href="http://davedupre.com/2009/03/19/music-is-dead-ipods-and-young-people-have-utterly-destroyed-music/">Many recent recordings are mixed for MP3 players</a> and will sound pretty bad on a great system. The really scary part is that some recent &#8220;Remastered&#8221; versions of classic albums were mastered for MP3 players as well. Many times, it is better to stick with the original.</p>
<p>In a future post, I will describe what I built/coded to control my entire media system from one remote. Note, since I have small children, all my equipment is in a locked closet.</p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2009/04/16/why-we-need-audiophiles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Red Sox Opening Day 2009</title>
		<link>http://davedupre.com/2009/04/07/red-sox-opening-day-2009/</link>
		<comments>http://davedupre.com/2009/04/07/red-sox-opening-day-2009/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 01:37:39 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[baseball]]></category>

		<guid isPermaLink="false">http://davedupre.com/?p=283</guid>
		<description><![CDATA[
What an amazing day. Yesterday, my friend Brian sends me a tweet offering a ticket for Opening Day at Fenway Park. Now, I&#8217;ve been a fan of baseball and the Red Sox since I could walk, but I&#8217;ve never had the privilege of seeing Opening Day. On top of that, after I can&#8217;t count how many Red [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-medium wp-image-300" title="fenway_welcome" src="http://davedupre.com/wp-content/uploads/2009/04/fenway_welcome-300x225.jpg" alt="fenway_welcome" width="300" height="225" /></p>
<p>What an amazing day. Yesterday, my friend <a href="http://hybernaut.com/">Brian</a> sends me a tweet offering a ticket for Opening Day at Fenway Park. Now, I&#8217;ve been a fan of baseball and the Red Sox since I could walk, but I&#8217;ve never had the privilege of seeing Opening Day. On top of that, after I can&#8217;t count how many Red Sox games I&#8217;ve been to, I&#8217;ve never seen the Red Sox Ace pitch in a regular season game (only Pedro during the All Star game, but that&#8217;s another story.) Of course, I jumped at the chance.</p>
<p>The tickets were were actually from a friend of Brian&#8217;s. They are season tickets, and we couldn&#8217;t figure out why they wanted us in our seats before 3:20PM for a 4:06PM start (bonus points if you know the significance of the 4:06PM start time.)  So, we get there pretty early, and no one seems to care about whether we go to our seats or not. Of course, that signals we have time to get a beer. A couple of minutes later we find out why the Red Sox wanted our sections in their seats so early. This is where the players were going to come down to the field from! It was hard to tell, but I think they had players coming out from more than one section because it wasn&#8217;t the whole team. Our section had Big Papi, Mike Lowell, J.D. Drew, and a few others.</p>
<p><img class="aligncenter size-medium wp-image-292" title="big_papi" src="http://davedupre.com/wp-content/uploads/2009/04/big_papi-300x225.jpg" alt="big_papi" width="300" height="225" /></p>
<p><img class="size-medium wp-image-293 aligncenter" title="waiting1" src="http://davedupre.com/wp-content/uploads/2009/04/waiting1-300x225.jpg" alt="waiting1" width="300" height="225" /></p>
<p><img class="size-medium wp-image-294 aligncenter" title="waiting2" src="http://davedupre.com/wp-content/uploads/2009/04/waiting2-225x300.jpg" alt="waiting2" width="225" height="300" /></p>
<p>Our seats were great. Check out Ted Kennedy throwing out the first pitch to Jim Rice. I only had my phone, so I didn&#8217;t have any chance of zooming closer.</p>
<p><img class="aligncenter size-medium wp-image-298" title="ted_pitch" src="http://davedupre.com/wp-content/uploads/2009/04/ted_pitch-300x225.jpg" alt="ted_pitch" width="300" height="225" /></p>
<p>Oh, yeah. There actually was a game to be played against the Tampa Bay Rays. It turned out to be a great game. Josh Beckett started for the Red Sox and struck out 10 over 7 strong innings. He looked outstanding! Dustin Pedroia started off 2009 well by hitting the first pitch he saw over the Green Monster. Papelbon struck out 2 in a 1-2-3 ninth to get the save and a 5-3 Sox victory.</p>
<p>Thanks again Brian for the invite.</p>
<p>One more thing, if you ever go to Fenway Park and expect to get any kind of internet access for Twitter or looking up a stat during the game, forget about it. Even the Fenway WiFi couldn&#8217;t handle all those phones trying to do the same thing. Just watch the game and enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://davedupre.com/2009/04/07/red-sox-opening-day-2009/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
