<?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"
	>

<channel>
	<title>csummers.org</title>
	<atom:link href="http://www.csummers.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csummers.org</link>
	<description>Curtis Summers' blog about life, family, code, and music.</description>
	<pubDate>Wed, 02 Apr 2008 15:02:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>New development blog</title>
		<link>http://www.csummers.org/2007/11/12/new-development-blog/</link>
		<comments>http://www.csummers.org/2007/11/12/new-development-blog/#comments</comments>
		<pubDate>Mon, 12 Nov 2007 12:34:40 +0000</pubDate>
		<dc:creator>curt</dc:creator>
		
		<category><![CDATA[programming]]></category>

		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.csummers.org/index.php/2007/11/12/new-development-blog/</guid>
		<description><![CDATA[I&#039;m making an effort to separate my software development-related posts into a new blog: Curt&#039;s Software Blog.  In addition to new posts, I&#039;ll be dusting off some of my older posts here and porting them over.
]]></description>
			<content:encoded><![CDATA[<p>I&#039;m making an effort to separate my software development-related posts into a new blog: <a href="http://www.csummers.com/">Curt&#039;s Software Blog</a>.  In addition to new posts, I&#039;ll be dusting off some of my older posts here and porting them over.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csummers.org/2007/11/12/new-development-blog/feed/</wfw:commentRss>
		</item>
		<item>
		<title>40 Day Fast</title>
		<link>http://www.csummers.org/2007/06/23/40-day-fast/</link>
		<comments>http://www.csummers.org/2007/06/23/40-day-fast/#comments</comments>
		<pubDate>Sat, 23 Jun 2007 13:14:07 +0000</pubDate>
		<dc:creator>curt</dc:creator>
		
		<category><![CDATA[faith]]></category>

		<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://www.csummers.org/index.php/2007/06/23/40-day-fast/</guid>
		<description><![CDATA[ 
Blogger extraordianaire Kat launched a blogosphere-based fast yesterday.  Each day a designated blogger will fast and blog about it and an area of need in the world.  Shaun Groves and Andrew Osenga are in the line up.
If, like me, you missed the boat on this, you can still participate by spreading the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.thesecretlifeofkat.com/pages/40dayfast"><img src="http://www.thesecretlifeofkat.com/40logo.jpg" / ></a> </p>
<p>Blogger extraordianaire <a href="http://www.thesecretlifeofkat.com/">Kat</a> launched a blogosphere-based fast yesterday.  Each day a designated blogger will fast and blog about it and an area of need in the world.  <a href="http://www.shaungroves.com/">Shaun Groves</a> and <a href="http://www.andrewosenga.com">Andrew Osenga</a> are in the line up.</p>
<p>If, like me, you missed the boat on this, you can still participate by spreading the word and fasting on the 40th day: July 31st.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csummers.org/2007/06/23/40-day-fast/feed/</wfw:commentRss>
		</item>
		<item>
		<title>God and farts</title>
		<link>http://www.csummers.org/2007/06/09/god-and-farts/</link>
		<comments>http://www.csummers.org/2007/06/09/god-and-farts/#comments</comments>
		<pubDate>Sat, 09 Jun 2007 20:29:44 +0000</pubDate>
		<dc:creator>curt</dc:creator>
		
		<category><![CDATA[faith]]></category>

		<category><![CDATA[fun]]></category>

		<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://www.csummers.org/index.php/2007/06/09/god-and-farts/</guid>
		<description><![CDATA[Good friends are hard to find.  We visited some of these hard-to-find friends this week and had a great time.  In our conversation about what makes a good friend, our friend hit the nail on the head:
God and farts.
When you can seamlessly transition from your faith to poo, then you&#039;ve reached a level [...]]]></description>
			<content:encoded><![CDATA[<p>Good friends are hard to find.  We visited <a href="http://www.luchauer.com/">some of these hard-to-find friends</a> this week and had a great time.  In our conversation about what makes a good friend, our friend hit the nail on the head:</p>
<p>God and farts.</p>
<p>When you can seamlessly transition from your faith to poo, then you&#039;ve reached a level of intimacy unrivaled by other friends.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csummers.org/2007/06/09/god-and-farts/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Inspired</title>
		<link>http://www.csummers.org/2007/05/07/inspired/</link>
		<comments>http://www.csummers.org/2007/05/07/inspired/#comments</comments>
		<pubDate>Mon, 07 May 2007 21:33:45 +0000</pubDate>
		<dc:creator>curt</dc:creator>
		
		<category><![CDATA[faith]]></category>

		<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://www.csummers.org/index.php/2007/05/07/inspired/</guid>
		<description><![CDATA[This past weekend was senior recognition weekend at my church.  The youth band and choir led worship and several of the seniors gave testimonies.  
I got to sit in with the band (they needed an electric guitarist&#8212;you know, so they could rock out), and I was so impressed.  The youth put in [...]]]></description>
			<content:encoded><![CDATA[<p>This past weekend was senior recognition weekend at <a href="http://www.cottonwoodcreek.org">my church</a>.  The youth band and choir led worship and several of the seniors gave testimonies.  </p>
<p>I got to sit in with the band (they needed an electric guitarist&#8212;you know, so they could rock out), and I was so impressed.  The youth put in lots of extra hours this past week striving towards excellence, and their hard work and diligence was met with success.  </p>
<p>Here&#039;s the catch:  all of this hard work was not to make themselves look good&#8212;rather, it was a genuine effort to glorify and worship the Lord with their talents.  This focus on the Lord is so rare that when you do actually see it, it shines like a bright light in contrast to the world around us.  Thanks, guys and gals.  You inspired me.</p>
<p>As I&#039;m raising two young daughters, this kind of experience gives me hope.  A hope that my girls will have a strong group of peers that aren&#039;t afraid to stand in their beliefs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csummers.org/2007/05/07/inspired/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dave Barnes</title>
		<link>http://www.csummers.org/2007/05/04/dave-barnes/</link>
		<comments>http://www.csummers.org/2007/05/04/dave-barnes/#comments</comments>
		<pubDate>Sat, 05 May 2007 04:41:53 +0000</pubDate>
		<dc:creator>curt</dc:creator>
		
		<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://www.csummers.org/index.php/2007/05/04/dave-barnes/</guid>
		<description><![CDATA[I feel like I&#039;ve been in a music coma the last three or four years.  (This timeline roughly corresponds with the birth of my first child followed by a second 18 months later.)  I think I&#039;m coming out of that coma, though, and Dave Barnes is helping to wake me up.
I bought Brother, [...]]]></description>
			<content:encoded><![CDATA[<p>I feel like I&#039;ve been in a music coma the last three or four years.  (This timeline roughly corresponds with the birth of my first child followed by a second 18 months later.)  I think I&#039;m coming out of that coma, though, and <a href="http://www.davebarnes.com">Dave Barnes</a> is helping to wake me up.</p>
<p>I bought <em>Brother, Bring the Sun</em> and <em>Chasing Mississippi</em> after <a href="http://thesecretlifeofkat.com/site/comments/silly_dave_barnes_vs_serious_dave_barnes/">Kat mentioned Dave</a> on her blog.  I <a href="http://flac.sourceforge.net/">ripped</a> them and forgot about them until the other day when I saw his name on the credits for <a href="http://www.bethanydillon.com/">Bethany Dillon</a>&#039;s &#034;All I Need&#034;.  I thought, &#034;Hmm, is that the same Dave Barnes?&#034;  Yep, <a href="http://www.bonnaroo.com/dave-barnes">sure is</a>.</p>
<p>Dave&#039;s music is a refreshing treat with an amazing grasp of classic sounds across several different styles.  Go <a href="http://www.davebarnes.com/">check him out</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csummers.org/2007/05/04/dave-barnes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dallas.rb</title>
		<link>http://www.csummers.org/2007/02/28/dallasrb/</link>
		<comments>http://www.csummers.org/2007/02/28/dallasrb/#comments</comments>
		<pubDate>Wed, 28 Feb 2007 17:40:08 +0000</pubDate>
		<dc:creator>curt</dc:creator>
		
		<category><![CDATA[ruby]]></category>

		<category><![CDATA[rubyonrails]]></category>

		<guid isPermaLink="false">http://www.csummers.org/index.php/2007/02/28/dallasrb/</guid>
		<description><![CDATA[The Dallas Ruby scene is heating up, and the Dallas Ruby Brigade is leading the way.  The March 6th meeting will feature the Dave Thomas speaking on Metaprogramming Ruby.
I&#039;m happy to see such a thriving Ruby community here in the DFW area.  Come be a part of the fun:  Dallas Ruby Brigade.
]]></description>
			<content:encoded><![CDATA[<p>The Dallas Ruby scene is heating up, and the <a href="http://dallasrb.stikipad.com/wiki/">Dallas Ruby Brigade</a> is leading the way.  The March 6th meeting will feature <i>the</i> <a href="http://pragdave.pragprog.com/pragdave/">Dave Thomas</a> speaking on Metaprogramming Ruby.</p>
<p>I&#039;m happy to see such a thriving Ruby community here in the DFW area.  Come be a part of the fun:  <a href="http://dallasrb.stikipad.com/wiki/">Dallas Ruby Brigade</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csummers.org/2007/02/28/dallasrb/feed/</wfw:commentRss>
		</item>
		<item>
		<title>she knows what we do</title>
		<link>http://www.csummers.org/2007/01/21/she-knows-what-we-do/</link>
		<comments>http://www.csummers.org/2007/01/21/she-knows-what-we-do/#comments</comments>
		<pubDate>Mon, 22 Jan 2007 03:15:17 +0000</pubDate>
		<dc:creator>curt</dc:creator>
		
		<category><![CDATA[family]]></category>

		<category><![CDATA[fun]]></category>

		<guid isPermaLink="false">http://www.csummers.org/index.php/2007/01/21/she-knows-what-we-do/</guid>
		<description><![CDATA[My two year old knows what my wife and I do in the night.  
NO, not that&#8230;
She knows we eat ice cream after she goes to bed!  The other morning she saw a bowl left sitting out from the night before with a tiny hint of mint chocolate chip.  Her exact words [...]]]></description>
			<content:encoded><![CDATA[<p>My two year old knows what my wife and I do in the night.  </p>
<p>NO, not that&#8230;</p>
<p>She knows we eat ice cream after she goes to bed!  The other morning she saw a bowl left sitting out from the night before with a tiny hint of mint chocolate chip.  Her exact words were, &#034;Mom and Dad eat green ice cream in the night.&#034;  She&#039;s a smart one.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csummers.org/2007/01/21/she-knows-what-we-do/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ruby: Recursive send</title>
		<link>http://www.csummers.org/2007/01/18/ruby-recursive-send/</link>
		<comments>http://www.csummers.org/2007/01/18/ruby-recursive-send/#comments</comments>
		<pubDate>Thu, 18 Jan 2007 20:02:25 +0000</pubDate>
		<dc:creator>curt</dc:creator>
		
		<category><![CDATA[programming]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[rubyonrails]]></category>

		<guid isPermaLink="false">http://www.csummers.org/index.php/2007/01/18/ruby-recursive-send/</guid>
		<description><![CDATA[Ruby&#039;s Object#send allows dynamic calling of a method.  This is very useful, but what if we wanted to call several levels deep on an object?  For instance:


# Normal call chain
post.comments.first.commented_at

# Dynamically with send?  Have to call three times.
post.send(:comments).send(:first).send(:commented_at)

  [Show Styled Code]


# Normal call chain
post.comments.first.commented_at
# Dynamically with send?&#160; Have to call three [...]]]></description>
			<content:encoded><![CDATA[<p>Ruby&#039;s Object#send allows dynamic calling of a method.  This is very useful, but what if we wanted to call several levels deep on an object?  For instance:</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4925508aa8056">
<pre style="width:100%;overflow:auto;">
# Normal call chain
post.comments.first.commented_at

# Dynamically with send?  Have to call three times.
post.send(:comments).send(:first).send(:commented_at)
</pre>
<div class="synthi_header" style="font-weight:bold;">  <span  class="synthi_button"style="font-weight:lighter;font-size:70%;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4925508aa8056').style.display='block';document.getElementById('plain_synthi_4925508aa8056').style.display='none';return false">Show Styled Code</a>]</span></div>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4925508aa8056">
<div class="ruby" style="font-family: monospace;"><span style="color:#008000; font-style:italic;"># Normal call chain</span><br />
post.<span style="color:#9900CC;">comments</span>.<span style="color:#9900CC;">first</span>.<span style="color:#9900CC;">commented_at</span></p>
<p><span style="color:#008000; font-style:italic;"># Dynamically with send?&nbsp; Have to call three times.</span><br />
post.<span style="color:#9900CC;">send</span><span style="color:#006600; font-weight:bold;">&#40;</span>:comments<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">send</span><span style="color:#006600; font-weight:bold;">&#40;</span>:first<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">send</span><span style="color:#006600; font-weight:bold;">&#40;</span>:commented_at<span style="color:#006600; font-weight:bold;">&#41;</span></div>
<div class="synthi_header" style="font-weight:bold;">  <span  class="synthi_button"style="font-weight:lighter;font-size:70%;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4925508aa8056').style.display='block';document.getElementById('styled_synthi_4925508aa8056').style.display='none';return false">Show Plain Code</a>]</span></div>
</div>
<p>What if the number of calls to send is variable depending on what we&#039;re trying to show?  In one case we might need <span style="font-family: mono">post.posted_at</span> for the date, and in another case we might need <span style="font-family: mono">post.comments.first.commented_at</span> for the date.</p>
<p>How could we dynamically craft the definition of the methods to send if we don&#039;t know how many calls to Object#send we&#039;ll have?  We need a way to define an arbitrary number of method calls.</p>
<p>Behold, a recursive send:  Object#rsend</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4925508aaa7a3">
<pre style="width:100%;overflow:auto;">
class Object
  def rsend(*args, &#038;block)
    obj = self
    args.each do |a|
      b = (a.is_a?(Array) &#038;&#038; a.last.is_a?(Proc) ? a.pop : block)
      obj = obj.__send__(*a, &#038;b)
    end
    obj
  end
  alias_method :__rsend__, :rsend
end
</pre>
<div class="synthi_header" style="font-weight:bold;">  <span  class="synthi_button"style="font-weight:lighter;font-size:70%;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4925508aaa7a3').style.display='block';document.getElementById('plain_synthi_4925508aaa7a3').style.display='none';return false">Show Styled Code</a>]</span></div>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4925508aaa7a3">
<div class="ruby" style="font-family: monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> Object<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> rsend<span style="color:#006600; font-weight:bold;">&#40;</span>*args, &amp;block<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; obj = <span style="color:#0000FF; font-weight:bold;">self</span><br />
&nbsp; &nbsp; args.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> |a| <br />
&nbsp; &nbsp; &nbsp; b = <span style="color:#006600; font-weight:bold;">&#40;</span>a.<span style="color:#9900CC;">is_a</span>?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0066; font-weight:bold;">Array</span><span style="color:#006600; font-weight:bold;">&#41;</span> &amp;&amp; a.<span style="color:#9900CC;">last</span>.<span style="color:#9900CC;">is_a</span>?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0066; font-weight:bold;">Proc</span><span style="color:#006600; font-weight:bold;">&#41;</span> ? a.<span style="color:#9900CC;">pop</span> : block<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; obj = obj.__send__<span style="color:#006600; font-weight:bold;">&#40;</span>*a, &amp;b<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; obj<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; alias_method :__rsend__, :rsend<br />
<span style="color:#9966CC; font-weight:bold;">end</span></div>
<div class="synthi_header" style="font-weight:bold;">  <span  class="synthi_button"style="font-weight:lighter;font-size:70%;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4925508aaa7a3').style.display='block';document.getElementById('styled_synthi_4925508aaa7a3').style.display='none';return false">Show Plain Code</a>]</span></div>
</div>
<p>Each argument passed to Object#rsend is an array with the symbols and arguments that will be passed on to Object#send:</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4925508aace58">
<pre style="width:100%;overflow:auto;">
post.rsend([:comments],[:first],[:commented_at])
</pre>
<div class="synthi_header" style="font-weight:bold;">  <span  class="synthi_button"style="font-weight:lighter;font-size:70%;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4925508aace58').style.display='block';document.getElementById('plain_synthi_4925508aace58').style.display='none';return false">Show Styled Code</a>]</span></div>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4925508aace58">
<div class="ruby" style="font-family: monospace;">post.<span style="color:#9900CC;">rsend</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span>:comments<span style="color:#006600; font-weight:bold;">&#93;</span>,<span style="color:#006600; font-weight:bold;">&#91;</span>:first<span style="color:#006600; font-weight:bold;">&#93;</span>,<span style="color:#006600; font-weight:bold;">&#91;</span>:commented_at<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
<div class="synthi_header" style="font-weight:bold;">  <span  class="synthi_button"style="font-weight:lighter;font-size:70%;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4925508aace58').style.display='block';document.getElementById('styled_synthi_4925508aace58').style.display='none';return false">Show Plain Code</a>]</span></div>
</div>
<p>If there are no arguments to be passed on to send, the array brackets can be omitted:</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4925508aaf573">
<pre style="width:100%;overflow:auto;">
post.rsend(:comments, :first, :commented_at)
</pre>
<div class="synthi_header" style="font-weight:bold;">  <span  class="synthi_button"style="font-weight:lighter;font-size:70%;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4925508aaf573').style.display='block';document.getElementById('plain_synthi_4925508aaf573').style.display='none';return false">Show Styled Code</a>]</span></div>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4925508aaf573">
<div class="ruby" style="font-family: monospace;">post.<span style="color:#9900CC;">rsend</span><span style="color:#006600; font-weight:bold;">&#40;</span>:comments, :first, :commented_at<span style="color:#006600; font-weight:bold;">&#41;</span></div>
<div class="synthi_header" style="font-weight:bold;">  <span  class="synthi_button"style="font-weight:lighter;font-size:70%;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4925508aaf573').style.display='block';document.getElementById('styled_synthi_4925508aaf573').style.display='none';return false">Show Plain Code</a>]</span></div>
</div>
<p>Of course, in practice you&#039;ll probably be defining your method call chain in one part of your code, putting it in a variable, and sending it to rsend with a splat*:</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4925508ab1c73">
<pre style="width:100%;overflow:auto;">
the_date = [:comments, :first, :commented_at]

#...somewhere else in your code you've passed the_date along:
post.rsend(*the_date)
</pre>
<div class="synthi_header" style="font-weight:bold;">  <span  class="synthi_button"style="font-weight:lighter;font-size:70%;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4925508ab1c73').style.display='block';document.getElementById('plain_synthi_4925508ab1c73').style.display='none';return false">Show Styled Code</a>]</span></div>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4925508ab1c73">
<div class="ruby" style="font-family: monospace;">the_date = <span style="color:#006600; font-weight:bold;">&#91;</span>:comments, :first, :commented_at<span style="color:#006600; font-weight:bold;">&#93;</span></p>
<p><span style="color:#008000; font-style:italic;">#&#8230;somewhere else in your code you&#039;ve passed the_date along:</span><br />
post.<span style="color:#9900CC;">rsend</span><span style="color:#006600; font-weight:bold;">&#40;</span>*the_date<span style="color:#006600; font-weight:bold;">&#41;</span></div>
<div class="synthi_header" style="font-weight:bold;">  <span  class="synthi_button"style="font-weight:lighter;font-size:70%;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4925508ab1c73').style.display='block';document.getElementById('styled_synthi_4925508ab1c73').style.display='none';return false">Show Plain Code</a>]</span></div>
</div>
<p>With arguments:</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4925508ab4392">
<pre style="width:100%;overflow:auto;">
a = [0,1,2,3,4,5,6,7,8,9]

a.rsend([:slice, 2, 8]) #=> [2, 3, 4, 5, 6, 7, 8, 9]

a.rsend([:slice, 2, 8], [:slice, 1, 3]) #=> [3, 4, 5]
</pre>
<div class="synthi_header" style="font-weight:bold;">  <span  class="synthi_button"style="font-weight:lighter;font-size:70%;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4925508ab4392').style.display='block';document.getElementById('plain_synthi_4925508ab4392').style.display='none';return false">Show Styled Code</a>]</span></div>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4925508ab4392">
<div class="ruby" style="font-family: monospace;">a = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span>,<span style="color:#006666;">1</span>,<span style="color:#006666;">2</span>,<span style="color:#006666;">3</span>,<span style="color:#006666;">4</span>,<span style="color:#006666;">5</span>,<span style="color:#006666;">6</span>,<span style="color:#006666;">7</span>,<span style="color:#006666;">8</span>,<span style="color:#006666;">9</span><span style="color:#006600; font-weight:bold;">&#93;</span></p>
<p>a.<span style="color:#9900CC;">rsend</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span>:slice, <span style="color:#006666;">2</span>, <span style="color:#006666;">8</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#008000; font-style:italic;">#=&gt; [2, 3, 4, 5, 6, 7, 8, 9]</span></p>
<p>a.<span style="color:#9900CC;">rsend</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span>:slice, <span style="color:#006666;">2</span>, <span style="color:#006666;">8</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span>:slice, <span style="color:#006666;">1</span>, <span style="color:#006666;">3</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#008000; font-style:italic;">#=&gt; [3, 4, 5] </span></div>
<div class="synthi_header" style="font-weight:bold;">  <span  class="synthi_button"style="font-weight:lighter;font-size:70%;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4925508ab4392').style.display='block';document.getElementById('styled_synthi_4925508ab4392').style.display='none';return false">Show Plain Code</a>]</span></div>
</div>
<p>Object#send accepts a block.  What about blocks?  Pass in a proc:</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4925508ab6abd">
<pre style="width:100%;overflow:auto;">
a.rsend([:map, (proc { |x| x*2 })])
  #=> [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]

a.rsend([:map, (proc { |x| x*2 })],
        [:select, (proc { |x| x % 4 == 0})])
  #=> [0, 4, 8, 12, 16]
</pre>
<div class="synthi_header" style="font-weight:bold;">  <span  class="synthi_button"style="font-weight:lighter;font-size:70%;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4925508ab6abd').style.display='block';document.getElementById('plain_synthi_4925508ab6abd').style.display='none';return false">Show Styled Code</a>]</span></div>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4925508ab6abd">
<div class="ruby" style="font-family: monospace;">a.<span style="color:#9900CC;">rsend</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span>:map, <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0066; font-weight:bold;">proc</span> <span style="color:#006600; font-weight:bold;">&#123;</span> |x| x*<span style="color:#006666;">2</span> <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; <span style="color:#008000; font-style:italic;">#=&gt; [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]</span><br />
&nbsp; <br />
a.<span style="color:#9900CC;">rsend</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span>:map, <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0066; font-weight:bold;">proc</span> <span style="color:#006600; font-weight:bold;">&#123;</span> |x| x*<span style="color:#006666;">2</span> <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#91;</span>:<span style="color:#CC0066; font-weight:bold;">select</span>, <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0066; font-weight:bold;">proc</span> <span style="color:#006600; font-weight:bold;">&#123;</span> |x| x % <span style="color:#006666;">4</span> == <span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; <span style="color:#008000; font-style:italic;">#=&gt; [0, 4, 8, 12, 16] </span></div>
<div class="synthi_header" style="font-weight:bold;">  <span  class="synthi_button"style="font-weight:lighter;font-size:70%;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4925508ab6abd').style.display='block';document.getElementById('styled_synthi_4925508ab6abd').style.display='none';return false">Show Plain Code</a>]</span></div>
</div>
<p>And, in an effort to make Object#rsend behave like Object#send for the simple case, you can send a regular block:</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4925508ab91af">
<pre style="width:100%;overflow:auto;">
a.rsend(:map) { |x| x*2 }
  #=> [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
</pre>
<div class="synthi_header" style="font-weight:bold;">  <span  class="synthi_button"style="font-weight:lighter;font-size:70%;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4925508ab91af').style.display='block';document.getElementById('plain_synthi_4925508ab91af').style.display='none';return false">Show Styled Code</a>]</span></div>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4925508ab91af">
<div class="ruby" style="font-family: monospace;">a.<span style="color:#9900CC;">rsend</span><span style="color:#006600; font-weight:bold;">&#40;</span>:map<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> |x| x*<span style="color:#006666;">2</span> <span style="color:#006600; font-weight:bold;">&#125;</span><br />
&nbsp; <span style="color:#008000; font-style:italic;">#=&gt; [0, 2, 4, 6, 8, 10, 12, 14, 16, 18] </span></div>
<div class="synthi_header" style="font-weight:bold;">  <span  class="synthi_button"style="font-weight:lighter;font-size:70%;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4925508ab91af').style.display='block';document.getElementById('styled_synthi_4925508ab91af').style.display='none';return false">Show Plain Code</a>]</span></div>
</div>
<p>Caveat:  For the case needing parameters, Object#rsend does require an array, so:</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4925508abb8b6">
<pre style="width:100%;overflow:auto;">
a.rsend(:slice, 2, <img src='http://www.csummers.org/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> # wrong, does not work like Object#send

a.rsend([:slice, 2, 8]) # right
</pre>
<div class="synthi_header" style="font-weight:bold;">  <span  class="synthi_button"style="font-weight:lighter;font-size:70%;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4925508abb8b6').style.display='block';document.getElementById('plain_synthi_4925508abb8b6').style.display='none';return false">Show Styled Code</a>]</span></div>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4925508abb8b6">
<div class="ruby" style="font-family: monospace;">a.<span style="color:#9900CC;">rsend</span><span style="color:#006600; font-weight:bold;">&#40;</span>:slice, <span style="color:#006666;">2</span>, <span style="color:#006666;">8</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#008000; font-style:italic;"># wrong, does not work like Object#send</span></p>
<p>a.<span style="color:#9900CC;">rsend</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span>:slice, <span style="color:#006666;">2</span>, <span style="color:#006666;">8</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#008000; font-style:italic;"># right </span></div>
<div class="synthi_header" style="font-weight:bold;">  <span  class="synthi_button"style="font-weight:lighter;font-size:70%;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4925508abb8b6').style.display='block';document.getElementById('styled_synthi_4925508abb8b6').style.display='none';return false">Show Plain Code</a>]</span></div>
</div>
<p>A quirk that I&#039;ve left in for fun, but it might (and maybe should) change:  If providing a single block, that block will be called on every call unless you&#039;ve already passed in a proc:</p>
<div class="synthi_code" style="display:none;" id ="plain_synthi_4925508abe015">
<pre style="width:100%;overflow:auto;">
a.rsend(:map, :map) { |x| x*2 }
  #=> [0, 4, 8, 12, 16, 20, 24, 28, 32, 36]

a.rsend(:map, [:map, (proc { |x| x+5 })], :map) { |x| x*2 }
  #=> [10, 14, 18, 22, 26, 30, 34, 38, 42, 46]
  #outer block was called on first and third :map
</pre>
<div class="synthi_header" style="font-weight:bold;">  <span  class="synthi_button"style="font-weight:lighter;font-size:70%;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4925508abe015').style.display='block';document.getElementById('plain_synthi_4925508abe015').style.display='none';return false">Show Styled Code</a>]</span></div>
</div>
<div class="synthi_code" style="display:block;" id ="styled_synthi_4925508abe015">
<div class="ruby" style="font-family: monospace;">a.<span style="color:#9900CC;">rsend</span><span style="color:#006600; font-weight:bold;">&#40;</span>:map, :map<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> |x| x*<span style="color:#006666;">2</span> <span style="color:#006600; font-weight:bold;">&#125;</span><br />
&nbsp; <span style="color:#008000; font-style:italic;">#=&gt; [0, 4, 8, 12, 16, 20, 24, 28, 32, 36]</span><br />
&nbsp; <br />
a.<span style="color:#9900CC;">rsend</span><span style="color:#006600; font-weight:bold;">&#40;</span>:map, <span style="color:#006600; font-weight:bold;">&#91;</span>:map, <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0066; font-weight:bold;">proc</span> <span style="color:#006600; font-weight:bold;">&#123;</span> |x| x<span style="color:#006666;">+5</span> <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, :map<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> |x| x*<span style="color:#006666;">2</span> <span style="color:#006600; font-weight:bold;">&#125;</span><br />
&nbsp; <span style="color:#008000; font-style:italic;">#=&gt; [10, 14, 18, 22, 26, 30, 34, 38, 42, 46]</span><br />
&nbsp; <span style="color:#008000; font-style:italic;">#outer block was called on first and third :map </span></div>
<div class="synthi_header" style="font-weight:bold;">  <span  class="synthi_button"style="font-weight:lighter;font-size:70%;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4925508abe015').style.display='block';document.getElementById('styled_synthi_4925508abe015').style.display='none';return false">Show Plain Code</a>]</span></div>
</div>
<p>Can anyone come up with a good use for this call-the-block-each-time behavior?</p>
<p>Has anyone done this already?  I searched for such a thing and came up empty.  Maybe this method should be called something else?  I named it based on each call recursing down the chain of methods with a new object being returned for the next method to be sent to.</p>
<p>Suggestions and comments are welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csummers.org/2007/01/18/ruby-recursive-send/feed/</wfw:commentRss>
		</item>
		<item>
		<title>If you give a frog a burrito</title>
		<link>http://www.csummers.org/2007/01/09/if-you-give-a-frog-a-burrito/</link>
		<comments>http://www.csummers.org/2007/01/09/if-you-give-a-frog-a-burrito/#comments</comments>
		<pubDate>Tue, 09 Jan 2007 15:40:03 +0000</pubDate>
		<dc:creator>curt</dc:creator>
		
		<category><![CDATA[family]]></category>

		<category><![CDATA[fun]]></category>

		<guid isPermaLink="false">http://www.csummers.org/index.php/2007/01/09/if-you-give-a-frog-a-burrito/</guid>
		<description><![CDATA[Those of you with small children may be familiar with the &#034;If You Give a&#8230;&#034; books by Laura Joffe Numeroff (e.g., &#034;If You Give a Mouse a Cookie&#034; and &#034;If You Give a Pig a Party&#034;).  Here&#039;s a silly story with the same feel:

If you give a frog a burrito,
he&#039;s probably going to ask [...]]]></description>
			<content:encoded><![CDATA[<p>Those of you with small children may be familiar with the &#034;If You Give a&#8230;&#034; books by Laura Joffe Numeroff (e.g., &#034;If You Give a Mouse a Cookie&#034; and &#034;If You Give a Pig a Party&#034;).  Here&#039;s a silly story with the same feel:</p>
<p><img src="http://www.csummers.org/wp-content/images/frog_a_burrito.jpg" /></p>
<p>If you give a frog a burrito,<br />
he&#039;s probably going to ask you for some hot sauce.<br />
When he sees the joke on the hot sauce packet,<br />
he&#039;ll want to see them all.<br />
You&#039;ll have to dig through the condiment bucket to<br />
find as many sayings as you can.</p>
<p>When he&#039;s finished with the burrito,<br />
he&#039;s going to ask you for some Rolaids.<br />
You&#039;ll go together to the drugstore to buy them.<br />
While you&#039;re at the drugstore,<br />
he&#039;ll want to take his blood pressure<br />
on one of those sit down, arm clamp machines.<br />
He&#039;ll take his blood pressure and eat his Rolaids.</p>
<p>On your way out of the drugstore, he&#039;ll remember that<br />
his pictures are waiting at the photo counter.<br />
You go back inside to get the photos.<br />
He&#039;ll want you to see them right away,<br />
so you&#039;ll sit in the car and flip through the photos.<br />
It&#039;s cold outside, so he&#039;ll want you to keep the car running<br />
with the heat on while you browse all 432 photos.<br />
He got double prints, so he&#039;ll want you to help him separate<br />
the pictures into two nice stacks.</p>
<p>One of the photos is a picture of the frog&#039;s house.<br />
Now that you&#039;ve seen his house, he&#039;ll want to see yours.<br />
You&#039;ll drive home.<br />
When you get home, you&#039;ll empty your pockets on the counter.<br />
The frog will see one of the funny hot sauce packets<br />
that stowed away in your pocket.<br />
He&#039;ll ask for the hot sauce packet.<br />
And, chances are, if you give him the hot sauce,<br />
he&#039;s going to ask for a burrito.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csummers.org/2007/01/09/if-you-give-a-frog-a-burrito/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Our third child</title>
		<link>http://www.csummers.org/2006/12/25/our-third-child/</link>
		<comments>http://www.csummers.org/2006/12/25/our-third-child/#comments</comments>
		<pubDate>Mon, 25 Dec 2006 21:27:51 +0000</pubDate>
		<dc:creator>curt</dc:creator>
		
		<category><![CDATA[fun]]></category>

		<category><![CDATA[life]]></category>

		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.csummers.org/index.php/2006/12/25/our-third-child/</guid>
		<description><![CDATA[So we launched BuzzFever.com the other day, and that night my wife says to me:
Is this going to be our third child?
I have to admit there are some similarities.  I&#039;ve not gotten regular sleep.  Though it&#039;s not because &#034;the baby&#034; is crying&#8211;she is relatively quite (especially with the holiday weekend).  Rather, I [...]]]></description>
			<content:encoded><![CDATA[<p>So we launched <a href="http://www.buzzfever.com/">BuzzFever.com</a> the other day, and that night my wife says to me:</p>
<blockquote><p>Is this going to be our third child?</p></blockquote>
<p>I have to admit there are some similarities.  I&#039;ve not gotten regular sleep.  Though it&#039;s not because &#034;the baby&#034; is crying&#8211;she is relatively quite (especially with the holiday weekend).  Rather, I lie awake listening, excited about this new little one.  Every page hit, new user, new product.  She&#039;s so cute.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csummers.org/2006/12/25/our-third-child/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
