<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title></title>
    <link>http://www.rahmalconda.com</link>
    <description></description>
    <language>yourLanguage('en')</language>
    <item>
      <title>MapReduce in a Nutshell</title>
      <description>&lt;p&gt;
For the last few weeks 
I've been meaning to start writing in my blog again. It's been more than a year 
since I've updated it regularly, an I wanted to start getting into the habit again.  
When my developer friend asked me about MapReduce it jumped out at it me as 
a good topic to ease back into tech blogging. Not to say there aren't many great 
sources of information on MapReduce already.
&lt;/p&gt;&lt;p&gt;
MapReduce is a simple parallel programming model for for processing large 
amounts of raw data. Created by Google, and inspired by the map and reduce 
combinator methods from functional languages like Lisp, it was developed as a 
mechanism to perform simple computations on massive datasets while hiding 
the details of parallelization, data distribution. In short, MapReduce is an 
abstraction that allows developers to implement scalable parallelism easily.
&lt;/p&gt;&lt;p&gt;
But don't let all that talk about distributed computing scare you. The beauty of 
MapReduce is that it is built to mitigate concurrency issues in our programs, and 
obfuscate the complexities of parallel programming from us.
&lt;/p&gt;&lt;p&gt;
Implementing a application that uses MapReduce is actually quite simple.  I'll go 
over a simple &lt;em&gt;Word Count&lt;/em&gt; example as I explain the basic concepts.
&lt;/p&gt;
&lt;h2&gt;Phase I: Parallel Programming&lt;/h2&gt;
&lt;p&gt;
In Map/Reduce algorithms, the original dataset, usually a large set of records or 
documents, are partitioned into many smaller workable subsets. These subsets 
are then passed along to a pool of workers operating concurrently (most likely 
on some queuing system like Resque or RabbitMQ) to process the data.
&lt;/p&gt;
&lt;img src=&quot;/images/MapReduce-1.png&quot; border=&quot;0&quot;&gt;
&lt;p&gt;
&lt;h2&gt;Phase II: Map&lt;/h2&gt;
&lt;p&gt;
Once partitioned into manageable subsets, the data is given to worker processes 
which invoke map, passing the data as input, to be processed. Map will be 
invoked for each record/document in the original dataset, through multiple 
workers, working in parallel. The map function takes as input a function and a 
sequence of values. It then applies the function to each value in the sequence. 
The job of the function is usually to extract the data required from the 
record/document. Map uses this data to produce a set of intermediate key/value 
pairs. If you've ever used Ruby's map function on an enumerable, then you should have a pretty good idea of how this works.  Map's primary logical operation is to group the data by keys. As it 
groups the data, the map function calls emit. Emit is the function used to feed 
the grouped data to the reduce function. 
&lt;/p&gt;

&lt;strong&gt;Word Count Example:&lt;/strong&gt;&lt;br&gt;
&lt;div class=&quot;code-container&quot;&gt;
  &lt;pre class='brush: ruby'&gt;
key = :page
val = &quot;to be or not to be&quot;
def map(key, val)
  val.split.map do |word|
    emit(word, 1.to_s)     
  end
end
  &lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
&lt;h2&gt;Phase III: Reduce&lt;/h2&gt;
&lt;p&gt;
Reduce will be called once for each unique key value emitted by the map stage, 
in parallel. The reduce function is used to take these groups (individually) and 
execute a function defined by the developer, with the grouped values as input. 
The function processes the values which were grouped together, to calculate a 
final result (Usually some sort of aggregation). Just as with map, as a ruby developer, you have probably used Ruby's reduce in some  kind of accumulative operation (although it is more widely known by its synonym, &lt;em&gt;inject&lt;/em&gt;).  Common operations in reduce 
functions include: Average, Min/Max, and Sum.
&lt;/p&gt;

&lt;strong&gt;Word Count Example:&lt;/strong&gt;&lt;br&gt;

&lt;div class=&quot;code-container&quot;&gt;
  &lt;pre class='brush: ruby'&gt;
# word - i.e. 'to' or 'be', etc.
# values - intermediate values  =&gt; ['1', '1', '1',...]
def reduce(word, values)
  result = values.inject(0) do |result, count|
    result += count.to_i
  end
  emit(word, result.to_s)
end
  &lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;But since we're talking about reduce, we could also do it like this:&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;code-container&quot;&gt;
  &lt;pre class='brush: ruby'&gt;
def reduce(word, values)
  result = values.reduce(:+) 
  emit(word, result.to_s)
end&lt;/span&gt;
  &lt;/pre&gt;
&lt;/div&gt;
</description>
      <pubDate>Tue, 01 May 2012 00:44:22 +0000</pubDate>
      <link>http://www.rahmalconda.com/blog/view/9</link>
      <guid>9</guid>
    </item>
    <item>
      <title>Raising Gremlins</title>
      <description>&lt;p&gt;
I was watching the old classic 'Gremlins' one lazy Saturday. I hadn't seen it since I was in college, and a lot has changed since then, one of the most important of which is the fact that I've started a family.
&lt;/p&gt;
&lt;p&gt;
The older, slightly fatter version of me was struck with the similarities of raising gremlins (or Mogwai, their pre-pupal persona) and children. People without kids will probably gasp as they read this, shocked by my willingness to compare my own progeny to villainous little demons. But I take heart in the knowledge that my fellow parents will understand completely.
&lt;/p&gt;
&lt;p&gt;
The first, and most obvious similarity is their mischievous nature. I can't speak for everyone, but my children, just like gremlins, are in everything! Touching, exploring, playing, breaking... I've went though 6 DVD players since having children. They climb on everything, and swing off of anything that will support their weight (even if it can't support it for very long, and usually doesn't). My two older sons are geniuses at taking things apart. Most  of the time it's things I'd have preferred stay in one piece.  They also have an uncanny knack for breaking their toys, and re-purposing the refuse into new gadgets the manufacturer never intended.
&lt;/p&gt;
&lt;p&gt;
My kids curious (if sometimes destructive) nature, not withstanding, it was the parenting where I found the most striking resemblance.
It was the rules! The rules that governed the Mogwai, the rules that their owner carelessly disregarded.  It reminded of the discipline and vigilance that all parents must have, and the consequences of laziness. You have to become a parent fully appreciate the pressure of having someone's life in your hands.  
&lt;/p&gt;
&lt;p&gt;
We all want our kids to be cute little Mogwai. Some of us though, don't understand the huge part we play in that.  It's our care and guidance that lead kids to become who they are.
I guess my point is that if your kid is a gremlin, it's probably your fault...
&lt;/p&gt;</description>
      <pubDate>Mon, 01 Nov 2010 04:58:01 +0000</pubDate>
      <link>http://www.rahmalconda.com/blog/view/8</link>
      <guid>8</guid>
    </item>
    <item>
      <title>Event Horizon</title>
      <description>&lt;p&gt;
Having just recently moved my family from Chicago, the city where I spent most of my life, to the Bay Area, a place I barely knew before deciding to resettle here, I've been giving a lot thought to the forces that drive us to do what we do.  You see, when I made up my mind to move, I didn't really know what I wanted, I just knew I had to find a better quality of life than the one I had.  And once I decided to find that, there seemed to be something pulling my here to the Bay. Some unseen gravitational force seemed to guide my decisions and clear my path of any obstacles that kept me from here.  And now, having settled in a town on the East Bay near Oakland, I feel it still. As if even though I have found a place to call home, my journey continues.  That feeling has caused me to wonder lately, where is the destination?  I recently read an article written by Michael Rubin, the CEO of the company I just started with.  The article, &lt;a href=&quot;http://droidmaker.blogspot.com/2010/02/serendipity-vs-act-of-will.html&quot; target=&quot;_blank&quot;&gt;Serendipity vs. the Act of Will&lt;/a&gt;, got me thinking a lot about the energies that move us through life, and how we relate to those energies, whether it be just allowing them to carry us from one event to the next, pushing against them, in a futile attempt to control our own fates, or trying to capitalize on them by reacting at the right time.  How am I interacting with the force I've felt lately? Am I allowing it to carry me aimlessly, or am I harnessing it, like sailors harness the wind to take them where they want to go?
&lt;/p&gt;&lt;p&gt;
Answering that question has lead me to categorize this time in my life as an Event Horizon.  In relativity, an event horizon is a boundary in space-time (most often an area surrounding a black hole) beyond which events cannot affect an outside observer. Light emitted from beyond the horizon can never reach the observer.  I know, what? Hold on a second, I'm going somewhere with this.  You see, I feel like this gravitational force has been pulling me to some point I need to reach in my life, and while I can see (or maybe feel) a basic direction, I can't quite see the destination I'm trying to reach.  My &quot;Event Horizon&quot; is allowing me to feel the pull of something important, something that will profoundly affect me. At this stage in my life however, while the strength of it's gravity belies its significance, I as the outside observer, cannot fully comprehend it.  In much the same way one might approach a blackhole.  The event horizon prevents the outside observer from seeing beyond the blackhole, nevertheless it's gravitational pull is inescapable.
&lt;/p&gt;&lt;p&gt;
General relativity also explains that any object that approaches the horizon from the observer's side appears to slow down and never quite pass through the horizon, The traveling object, however, experiences no strange effects and does, in fact, pass through the horizon in a finite amount of proper time.  In much the same way, wheresoever my journey is taking me, I can't know how close or how far I am from it, nor can I tell at what pace I approach it.  I nevertheless, move closer to it each day, and time passes in spite of me.  I have come to the conclusion that my new job is part of my journey. When I was approached about starting at PlaceBook, I had my reservations.  But the same feeling that led me to California seemed to speak to me again.  There was something about PlaceBook and the people involved that spoke to me.  I don't know if my journey ends here, or is just beginning.  What I do know, is that we're building something special.
&lt;/p&gt; </description>
      <pubDate>Wed, 16 Jun 2010 08:33:17 +0000</pubDate>
      <link>http://www.rahmalconda.com/blog/view/7</link>
      <guid>7</guid>
    </item>
    <item>
      <title>Prince of Persia My A$$</title>
      <description>&lt;p&gt;
I went to see &lt;span style=&quot;text-decoration:underline;&quot;&gt;Prince of Persia&lt;/span&gt; this evening. Not bad. A little escapist fantasy to take the edge off of a long, stressful week. But as I do at the end of all movies, I began to analyze.  The gift (and curse) of an engineer's mind.  If a movie is really good, I spend hours analyzing the characters, the plot, and the plot twists.  But for a movie of this caliber, it's usually the choices made by the creators that occupies my mind.  It was on the drive home that I asked myself the question: What is it about non-white leading characters that Hollywood power brokers find so grotesque? I can't figure it out. Jake Gyllenhaal is a good actor, but a white kid flipping through the slums of an ancient Persian capitol? Come on! Why is that not ridiculous to these Hollywood types.  They can picture all the peasants and village people as dark-skinned, middle-eastern people, but royalty and heroes without blue eyes is unimaginable? 
&lt;/p&gt;&lt;p&gt;
There's another summer popcorn flick coming out soon called &lt;span style=&quot;text-decoration:underline;&quot;&gt;The Last Air Bender&lt;/span&gt;.  It's based on my son's favorite cartoon, so he's really looking forward to it.  All the main characters in the cartoon version are of Asian decent, but in the movie version, they are all portrayed by white actors. It wouldn't bother me so much, except that this seems to be the rule, not the exception.  Part of me says to just let it go, but the more I think about it, the more it vexes me.  Not the act itself; it's the &lt;i&gt;thinking&lt;/i&gt; behind it.  &lt;i&gt;Why?&lt;/i&gt; I just want to know &lt;i&gt;why?&lt;/i&gt; Is it racism? Is it a money thing? Do they believe a movie won't make money because the main character isn't white?
&lt;/p&gt;&lt;p&gt;
Racism seems like the most obvious answer. But I can't believe every producer and director in the movie business is racist! So once you eliminate the impossible... Money? Could this all really be about money? Is it possible that the powers that be, in the movie industry subscribe to the insane notion that non-Caucasian main characters result in poor box office results? It couldn't be that! 20 years ago, they'd have an argument.  But NOW?! In 2010?! This is the age of President Obama and Will f#(%ing Smith!! 
&lt;/p&gt;&lt;p&gt;
I mean come on! Think about it! They can't possibly believe that the people who elected a black president, would have a problem with a olive-skinned Persian prince, rescuing a dark-skinned Arab princess. If minority leads result in poor box office showings, then how do they explain Will Smith, and Denzel Washington? Two box office titans, and the highest paid leading men in the business today. Even if you write off Mr. Smith and Mr. Washington as flukes, you'd still have &lt;span style=&quot;text-decoration:underline;&quot;&gt;Slum-Dog Millionaire&lt;/span&gt; and Tyler Perry's &lt;span style=&quot;text-decoration:underline;&quot;&gt;Why Did I Get Married?&lt;/span&gt;. 
&lt;p&gt;&lt;/p&gt;
Still not convinced?  Here's a fluke for you: &lt;span style=&quot;text-decoration:underline;&quot;&gt;Ninja Assassin&lt;/span&gt;. An American-made Ninja movie with an actual Japanese lead! Most U.S. Ninja movies feature a white guy in a Ninja costume, fighting a hundred Asian extras (beating them all, of course.  Because we all know that it takes a white man to really master the Ancient Japanese art of Jujitsu). It goes without saying that most of those flicks sucked and didn't make a nickel.  But here we are with a &lt;i&gt;good&lt;/i&gt; Ninja flick, with a Japanese lead, and you know what? It did pretty well.  There are those that would say that's progress.  It is to them that I say this: &lt;strong&gt;Kiss my Ass!! Persians ain't White!!&lt;/strong&gt;
&lt;/p&gt;</description>
      <pubDate>Sat, 29 May 2010 09:37:28 +0000</pubDate>
      <link>http://www.rahmalconda.com/blog/view/6</link>
      <guid>6</guid>
    </item>
    <item>
      <title>My Thoughts On Interviewing</title>
      <description>&lt;p&gt;As an experienced software developer having served in junior, senior-level, and even lead roles, I have found myself on both sides of the interviewing table. I'd like to think that on my best days (and I've had some bad days, to be sure), I'm a fairly good interviewer. And since I've had my share of jobs, I assume that I must be an decent interviewee as well.
&lt;/p&gt;&lt;p&gt;
Over the years I've developed a few opinions on the particular interview strategies used to gauge whether someone will make a good addition to a software development team.  Following are my feelings regarding those techniques.
&lt;/p&gt;
&lt;br /&gt;
&lt;p&gt;
&lt;b&gt;1. Logic Puzzles&lt;/b&gt;
&lt;/p&gt;&lt;p&gt;
A lot of people I've worked with swear by these obscure gems to determine a candidates ability to solve intricate problems.  I however don't think these puzzles are worth all the effort. For one, most of them have these incredibly over-thought &quot;AHA!&quot; solutions.  Most of the time, I'm not interested in whether the candidate can come up with the solution to some odd conundrum.  I am more interested in their grasp of and experience with well known, proven development methodologies, since those will be tools he's expected to use on a day-to-day basis.  I can discern his reasoning abilities by watching him analyze actual code, rather than inferring his coding skills from his ability solve brain-teasers.
&lt;/p&gt;
&lt;br /&gt;
&lt;p&gt;
&lt;b&gt;2. Text Book Talk&lt;/b&gt;
&lt;/p&gt;&lt;p&gt;
Judging candidates on their ability to recite obscure theory, rather than finding solutions to real-world problems.  I've seen way too many interviewers put candidates (including myself) through these tedious exercises that ask O-notation for old sort algorithms.  These are useful at companies like Google, where that knowledge may be pertinent.  But not every company requires that kind of expertise.  I've seen good candidates, with all the right skills and experience for the task at hand, get passed over because they didn't know some obscure fact that was irrelevant to doing the job to begin with.
&lt;/p&gt;
&lt;br /&gt;
&lt;p&gt;
&lt;b&gt;3. Buzzword Bonanza&lt;/b&gt;
&lt;/p&gt;&lt;p&gt;
Lastly, I've watched interviewers, pass on seemingly knowledgeable candidates (usually in the initial phone screen) because they misspoke some new Web 2.0 term, or didn't know the latest tech acronym.  If a candidate can show that they understand the concept you're asking about, then a misspeaking a term or buzzword should &lt;i&gt;NOT&lt;/i&gt; be a deal breaker.
&lt;/p&gt;</description>
      <pubDate>Mon, 24 May 2010 04:30:26 +0000</pubDate>
      <link>http://www.rahmalconda.com/blog/view/5</link>
      <guid>5</guid>
    </item>
    <item>
      <title>To Be or not to Be: Understanding Ruby Nil</title>
      <description>&lt;p&gt;As all Rubyists know, &lt;strong&gt;everything in Ruby is an object&lt;/strong&gt;, including true, false, and the integer 1.  But what about the absence of a value?  Does 'nothing' constitute an object in Ruby? Well as a matter of fact, it does.  Unlike languages like Java and C-sharp, where null is a keyword that represents a void reference (i.e. a pointer that points to nothing), the nil keyword in Ruby evaluates to a predefined global object.  That object is the one and only instance of the NilClass.&lt;/p&gt;
&lt;p&gt;Like all objects you can call methods on nil (assuming it responds to called method).  Nil also has an object id. It's object id is always 4. Right behind true and false which have object id's of 2 and 0 consecutively. They have even object ids because odd numbers are used for integers.&lt;/p&gt; 

&lt;div class=&quot;code-container&quot;&gt;
  &lt;pre class=&quot;brush: ruby&quot;&gt;
  &gt;&gt; nil.class
  =&gt; NilClass
  &gt;&gt; nil.object_id
  =&gt; 4
  &lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;As an object, ruby pre-defines nil with a few convenience methods to avoid non-critical situations that maybe complicated by an unexpected nil object. In Java, since null is NOT an object, any method call would result in a NullPointerException.  In C-sharp, similarly, calling a method on a null reference would result in a thrown exception.&lt;/p&gt;
&lt;div class=&quot;code-container&quot;&gt;
  &lt;pre class=&quot;brush: ruby&quot;&gt;
  &gt;&gt; nil.to_s
  =&gt; &quot;&quot;
  &gt;&gt; nil.to_i
  =&gt; 0
  &lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
  Another convenience method in ruby is &quot;nil?&quot;.  For all objects except for nil itself, this method returns false. As you've probably guessed, it returns true when called on nil.
&lt;/p&gt;

&lt;div class=&quot;code-container&quot;&gt;
  &lt;pre class=&quot;brush: ruby&quot;&gt;
  &gt;&gt; nil.nil?
  =&gt; true
  &gt;&gt; Object.new.nil?
  =&gt; false
  &lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
Rails provides two other methods: &quot;blank?&quot; and &quot;present?&quot;.  In the case of &quot;blank?&quot;, it returns true for nil or for empty strings and arrays.  The method &quot;present?&quot;, is just the opposite of &quot;blank?&quot;.
&lt;/p&gt;

&lt;div class=&quot;code-container&quot;&gt;
  &lt;pre class=&quot;brush: rails&quot;&gt;
  &gt;&gt; nil.blank?
  =&gt; true
  &gt;&gt; &quot;&quot;.blank?
  =&gt; true
  &gt;&gt; [].blank?
  =&gt; true
  &gt;&gt; Object.new.blank?
  =&gt; false
  &gt;&gt; str = &quot;str&quot;
  &gt;&gt; str.blank?
  =&gt; false
  &gt;&gt; str.present?
  =&gt; true
  &gt;&gt; arr = [1]
  &gt;&gt; arr.blank?
  =&gt; false
  &gt;&gt; arr.present?
  =&gt; true
  &lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
  Another cool trick provided in Rails is the &quot;try&quot; method.  This method is a shorthand for testing if an object is nil before calling a method on the object. So asuming you have a user object, and your're unsure if the object is nil or not.  You may do something like this...
&lt;/p&gt;

&lt;div class=&quot;code-container&quot;&gt;
  &lt;pre class=&quot;brush: rails&quot;&gt;
    name = user.name unless user.nil?
  &lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
Well, you could use the &quot;try&quot; method to do the same thing. Like so...
&lt;/p&gt;

&lt;div class=&quot;code-container&quot;&gt;
  &lt;pre class=&quot;brush: rails&quot;&gt;
    name = user.try(:name)
  &lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
On most objects, the &quot;try&quot; method is just an alias for &quot;send&quot;.  But on the Nil class, it simply returns nil. Remember, however, that if the object is not nil, and the method does not exist, the MethodNotFound error will be raised as expected.
&lt;/p&gt;
</description>
      <pubDate>Mon, 12 Apr 2010 06:01:03 +0000</pubDate>
      <link>http://www.rahmalconda.com/blog/view/4</link>
      <guid>4</guid>
    </item>
    <item>
      <title>Understanding Ruby Procs and Lambdas</title>
      <description>&lt;p&gt;
Earlier this year, I was searching for a job in the Bay Area.  That search eventually lead me to my
StrongMail, my current job where I hold the position of Principal Software Developer.  But before
finding this job, I was interviewing a lot.  being the die-hard Rubyist that I am, I limited my 
search to companies with Rails shops. So, as you imagine, I got a lot of Ruby questions.  After a 
few of interviews, I noticed a small selection of questions that seemed  to be interviewer favorites.
The 'Proc vs Lambda' question stuck out immediately because it was asked in every interview. Which 
brings me to the reason for this post.  If you are considering applying for a job as a Ruby Developer,
you're very likely to hear this question.  If you're already a Ruby Developer, but you were never
sure about differences between these two Ruby paradigms, this'll benefit you as well.
&lt;/p&gt;
&lt;p&gt;
So on with it then! What is the difference between a Proc and a Lambda? Well, a Proc is an object 
that represents a reusable code block, while a lambda is essentially a method, albeit an anonymous 
one.  If you understand that, then you're half-way there.  But hold on, don't leave just yet, here's
more... So what behavior does the aforementioned distinction suggest? To answer that, you have to 
think about how Ruby handles procedures and methods. 
&lt;/p&gt;
&lt;p&gt;
The first notable difference in behavior is that lambdas, like all ruby methods check the number
of arguments it is passed, but Proc implicitly sets missing args to nil.
&lt;/p&gt;
&lt;div class=&quot;code-container&quot;&gt;
  &lt;pre class=&quot;brush: ruby&quot;&gt;
  &gt;&gt; block = lambda {|a, b, c| &quot;arg1: #{a.inspect}, arg2: #{b.inspect}, arg3: #{c.inspect}&quot;}
  &gt;&gt; block.call(:x, :y)
  =&gt; ArgumentError: wrong number of arguments (2 for 3)

  &gt;&gt; block = Proc.new {|a, b, c| &quot;arg1: #{a.inspect}, arg2: #{b.inspect}, arg3: #{c.inspect}&quot;}
  &gt;&gt; block.call(:x, :y)
  =&gt; &quot;arg1: x, arg2: y, arg3: nil&quot;
  &lt;/pre&gt;  
&lt;/div&gt;
&lt;p&gt;
Another difference in behavior is in returns.  A Proc return stops the method and return the 
generated value, lambdas return their value to the method and lets the method continue on. &lt;i&gt;Why?&lt;/i&gt;
Because a Proc is an object that represents a snippet of code, with no scope or context of its own.
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;So this...&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;code-container&quot;&gt;
  &lt;pre class=&quot;brush: ruby&quot;&gt;
def foo
  x = 'foo'
  Proc.new { 
    y = 'bar'
    return y
  }.call
  return x
end

&gt;&gt; foo
=&gt; 'bar'
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Is equivalent to this...&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;code-container&quot;&gt;
  &lt;pre class=&quot;brush: ruby&quot;&gt;
def foo
  x = 'foo'
  y = 'bar'
  return y
  return x
end

&gt;&gt; foo
=&gt; 'bar'
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
In this example foo will always return 'bar', return x is never reached, because proc is simply a 
block of code within foo, so the proc's return is the method's return. Lambda's on the other hand, 
are methods with their own return, so just like any other method within the class or module, it 
returns the value to the caller.
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;So this...&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;code-container&quot;&gt;
  &lt;pre class=&quot;brush: ruby&quot;&gt;
def foo
     x = 'foo'
     lambda { 
       y = 'bar'
       return y
     }.call
     return x
   end

&gt;&gt; foo
=&gt; 'foo'
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Is equivalent to this...&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;code-container&quot;&gt;
  &lt;pre class=&quot;brush: ruby&quot;&gt;
def&lt;/span&gt; foo
  x = 'foo'
  bar
  return x
end

def bar
  y = 'bar'
  return y          
end

&gt;&gt; foo
=&gt; 'foo'
&lt;/pre&gt;           
&lt;/div&gt;
&lt;p&gt;
In the above example a lambda behaves as any other method, so the method always returns 'foo', since 
the return value of 'bar', is never assigned, or referenced outside of the original method call.
&lt;/p&gt;
&lt;br /&gt;
  </description>
      <pubDate>Thu, 11 Mar 2010 23:18:22 +0000</pubDate>
      <link>http://www.rahmalconda.com/blog/view/3</link>
      <guid>3</guid>
    </item>
    <item>
      <title>Life After Death</title>
      <description>  For all you Rails heads waiting for the development posts, just hold your horses, they're comin'.  I just got a lot of stuff I want to say first... 
  Anyway, It was just over a year ago, that I almost died.  Yep, that's right. Died. I laid in a coma for 9 days with a pneumonia the docs didn't think I could beat.  They were preparing my wife for the worst.  But since you're reading this, you already know that I don't, so I'll skip all the melodrama.  The point is, you're not promised anything.  You have live while you got the chance.  And speaking of living, for a while, after the illness, I'd given up.  I lived only to watch my best friend die... but that's another post.  But for that and other reasons, I wasn't thankful for the new lease on life that I'd been given.  It took time, but I came out of it.  And I'm back!  I'm celebrating everyday now! Cuz I won!  That's right, I'm still here, and I'm still standing!</description>
      <pubDate>Wed, 17 Feb 2010 23:49:00 +0000</pubDate>
      <link>http://www.rahmalconda.com/blog/view/2</link>
      <guid>2</guid>
    </item>
    <item>
      <title>Blog Init</title>
      <description>Wow, after spending the last few nights coding, my personal blog is finally ready for it's first post. If you're reading ths, you most likely already know that I'm Rahmal Conda, Software Developer, Ladies Man... and if you're wondering if you should continue reading, or of you should comeback for the next post, then by all means continue if you're interested in Ruby, Ruby on Rails, or Software Development in general, or just find my personal musings, observations and rants amusing, then by all means, stop by anytime. </description>
      <pubDate>Tue, 16 Feb 2010 14:26:00 +0000</pubDate>
      <link>http://www.rahmalconda.com/blog/view/1</link>
      <guid>1</guid>
    </item>
  </channel>
</rss>

