<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for X-Combinator</title>
	<atom:link href="http://www.xcombinator.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xcombinator.com</link>
	<description>making the human scalable</description>
	<lastBuildDate>Tue, 02 Mar 2010 17:04:37 -0800</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Mac OS X color showing ESC[whatever for git-diff colors (and more) by Gopala Krishna A</title>
		<link>http://www.xcombinator.com/2008/07/23/mac-os-x-color-showing-escwhatever-for-git-diff-colors-and-more/comment-page-1/#comment-30838</link>
		<dc:creator>Gopala Krishna A</dc:creator>
		<pubDate>Tue, 02 Mar 2010 17:04:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/07/23/mac-os-x-color-showing-escwhatever-for-git-diff-colors-and-more/#comment-30838</guid>
		<description>Thanks a lot!! This really proved helpful on opensuse 11.2 :)</description>
		<content:encoded><![CDATA[<p>Thanks a lot!! This really proved helpful on opensuse 11.2 <img src='http://www.xcombinator.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Mac OS X color showing ESC[whatever for git-diff colors (and more) by Silly Avatar</title>
		<link>http://www.xcombinator.com/2008/07/23/mac-os-x-color-showing-escwhatever-for-git-diff-colors-and-more/comment-page-1/#comment-30549</link>
		<dc:creator>Silly Avatar</dc:creator>
		<pubDate>Sun, 21 Feb 2010 21:39:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/07/23/mac-os-x-color-showing-escwhatever-for-git-diff-colors-and-more/#comment-30549</guid>
		<description>Thanx for this blog entry.
Was having this problem while ssh-ing to a linux vps w/Putty. Thought it was a faulty terminal emulation causing the problem. Nope, just the goofy default LESS options in OpenSuSe on the vps. I&#039;ve run linux boxen for years off and on. Never had so much problem with raw ESC character output til it was highlighted by git.</description>
		<content:encoded><![CDATA[<p>Thanx for this blog entry.<br />
Was having this problem while ssh-ing to a linux vps w/Putty. Thought it was a faulty terminal emulation causing the problem. Nope, just the goofy default LESS options in OpenSuSe on the vps. I&#8217;ve run linux boxen for years off and on. Never had so much problem with raw ESC character output til it was highlighted by git.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on ActiveRecord from_xml (and from_json) part 2 by Billy Kimble</title>
		<link>http://www.xcombinator.com/2008/08/11/activerecord-from_xml-and-from_json-part-2/comment-page-1/#comment-30280</link>
		<dc:creator>Billy Kimble</dc:creator>
		<pubDate>Thu, 11 Feb 2010 00:24:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/08/11/activerecord-from_xml-and-from_json-part-2/#comment-30280</guid>
		<description>Thanks for the snippet of code -- it has helped me out tremendously. Unfortunately it did not work out of the box in Rails 2.3.5  Here is my slightly modified fix for it:

module ActiveRecord
  class Base 
    def self.from_hash(hash)
      h = hash.dup
      h.each do &#124;key,value&#124;        
        h[key].map! { &#124;e&#124; reflect_on_association(key.to_sym ).klass.from_hash e } if value.is_a?(Array)
        h[key] = reflect_on_association(key.to_sym).klass.from_hash(value) if value.is_a?(Hash)
      end
      new h
    end
 
    def from_json( json )
      self.class.from_hash(ActiveSupport::JSON.safe_json_decode(json))
    end
 
    # The xml has a surrounding class tag (e.g. ship-to),
    # but the hash has no counterpart (e.g. &#039;ship_to&#039; =&gt; {} )
    def from_xml( xml )
      from_hash begin
        Hash.from_xml(xml)[to_s.demodulize.underscore]
      rescue ; {} end
    end 
  end # class Base
end # module ActiveRecord

module ActiveSupport
  module JSON
    def self.safe_json_decode(json)
      return {} if !json
      begin
        decode(json)
      rescue ; {} end
    end    
  end
end</description>
		<content:encoded><![CDATA[<p>Thanks for the snippet of code &#8212; it has helped me out tremendously. Unfortunately it did not work out of the box in Rails 2.3.5  Here is my slightly modified fix for it:</p>
<p>module ActiveRecord<br />
  class Base<br />
    def self.from_hash(hash)<br />
      h = hash.dup<br />
      h.each do |key,value|<br />
        h[key].map! { |e| reflect_on_association(key.to_sym ).klass.from_hash e } if value.is_a?(Array)<br />
        h[key] = reflect_on_association(key.to_sym).klass.from_hash(value) if value.is_a?(Hash)<br />
      end<br />
      new h<br />
    end</p>
<p>    def from_json( json )<br />
      self.class.from_hash(ActiveSupport::JSON.safe_json_decode(json))<br />
    end</p>
<p>    # The xml has a surrounding class tag (e.g. ship-to),<br />
    # but the hash has no counterpart (e.g. &#8217;ship_to&#8217; =&gt; {} )<br />
    def from_xml( xml )<br />
      from_hash begin<br />
        Hash.from_xml(xml)[to_s.demodulize.underscore]<br />
      rescue ; {} end<br />
    end<br />
  end # class Base<br />
end # module ActiveRecord</p>
<p>module ActiveSupport<br />
  module JSON<br />
    def self.safe_json_decode(json)<br />
      return {} if !json<br />
      begin<br />
        decode(json)<br />
      rescue ; {} end<br />
    end<br />
  end<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Mac OS X color showing ESC[whatever for git-diff colors (and more) by Girish KS</title>
		<link>http://www.xcombinator.com/2008/07/23/mac-os-x-color-showing-escwhatever-for-git-diff-colors-and-more/comment-page-1/#comment-29186</link>
		<dc:creator>Girish KS</dc:creator>
		<pubDate>Mon, 04 Jan 2010 04:37:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/07/23/mac-os-x-color-showing-escwhatever-for-git-diff-colors-and-more/#comment-29186</guid>
		<description>Thanks for the post Nate and thanks pablitostar for your suggestion. I started using git few days back and was totally annoyed by ESC chars in diff !</description>
		<content:encoded><![CDATA[<p>Thanks for the post Nate and thanks pablitostar for your suggestion. I started using git few days back and was totally annoyed by ESC chars in diff !</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Mac OS X color showing ESC[whatever for git-diff colors (and more) by pablitostar</title>
		<link>http://www.xcombinator.com/2008/07/23/mac-os-x-color-showing-escwhatever-for-git-diff-colors-and-more/comment-page-1/#comment-28435</link>
		<dc:creator>pablitostar</dc:creator>
		<pubDate>Fri, 04 Dec 2009 18:07:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/07/23/mac-os-x-color-showing-escwhatever-for-git-diff-colors-and-more/#comment-28435</guid>
		<description>I found using the -r flag did fix git-diff, but it broke something else in less. Specifically, searching in files using less. The token would be found, but some of the matching lines would be hidden. Not very useful, that. I changed the less flag from -r to -R and both git-diff and less search works. Here&#039;s a snippet from the less man page, which is very apropos to git-diff:
       -R or --RAW-CONTROL-CHARS
	      Like -r, but only ANSI &quot;color&quot; escape sequences  are  output  in
	      &quot;raw&quot; form.  Unlike -r, the screen appearance is maintained cor-
	      rectly  in  most	cases.	 ANSI  &quot;color&quot;	escape	sequences  are
	      sequences of the form:

		   ESC [ ... m</description>
		<content:encoded><![CDATA[<p>I found using the -r flag did fix git-diff, but it broke something else in less. Specifically, searching in files using less. The token would be found, but some of the matching lines would be hidden. Not very useful, that. I changed the less flag from -r to -R and both git-diff and less search works. Here&#8217;s a snippet from the less man page, which is very apropos to git-diff:<br />
       -R or &#8211;RAW-CONTROL-CHARS<br />
	      Like -r, but only ANSI &#8220;color&#8221; escape sequences  are  output  in<br />
	      &#8220;raw&#8221; form.  Unlike -r, the screen appearance is maintained cor-<br />
	      rectly  in  most	cases.	 ANSI  &#8220;color&#8221;	escape	sequences  are<br />
	      sequences of the form:</p>
<p>		   ESC [ &#8230; m</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Mac OS X color showing ESC[whatever for git-diff colors (and more) by Rohit Garg</title>
		<link>http://www.xcombinator.com/2008/07/23/mac-os-x-color-showing-escwhatever-for-git-diff-colors-and-more/comment-page-1/#comment-27913</link>
		<dc:creator>Rohit Garg</dc:creator>
		<pubDate>Fri, 16 Oct 2009 11:00:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/07/23/mac-os-x-color-showing-escwhatever-for-git-diff-colors-and-more/#comment-27913</guid>
		<description>Hi, 

Thanks for your googling and your blog. I was having the same issues on opensuse 11.1.  

http://rpg-314.blogspot.com/2009/10/getting-colors-i-git-output-on-opensuse.html

This post helped me fix it. Thanks a lot.</description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>Thanks for your googling and your blog. I was having the same issues on opensuse 11.1.  </p>
<p><a href="http://rpg-314.blogspot.com/2009/10/getting-colors-i-git-output-on-opensuse.html" rel="nofollow">http://rpg-314.blogspot.com/2009/10/getting-colors-i-git-output-on-opensuse.html</a></p>
<p>This post helped me fix it. Thanks a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Mac OS X color showing ESC[whatever for git-diff colors (and more) by Lantrix</title>
		<link>http://www.xcombinator.com/2008/07/23/mac-os-x-color-showing-escwhatever-for-git-diff-colors-and-more/comment-page-1/#comment-27692</link>
		<dc:creator>Lantrix</dc:creator>
		<pubDate>Tue, 06 Oct 2009 08:37:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/07/23/mac-os-x-color-showing-escwhatever-for-git-diff-colors-and-more/#comment-27692</guid>
		<description>Looks like this is fixed under Snow Leopard. I get colours with my config set correctly in ~/.gitconfig and I _did not_ need to have the less switches in my ~/.profile</description>
		<content:encoded><![CDATA[<p>Looks like this is fixed under Snow Leopard. I get colours with my config set correctly in ~/.gitconfig and I _did not_ need to have the less switches in my ~/.profile</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on ActiveRecord from_json and from_xml by S Woodside</title>
		<link>http://www.xcombinator.com/2008/07/06/activerecord-from_json-and-from_xml/comment-page-1/#comment-26733</link>
		<dc:creator>S Woodside</dc:creator>
		<pubDate>Wed, 02 Sep 2009 20:43:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/07/06/activerecord-from_json-and-from_xml/#comment-26733</guid>
		<description>If you need to de-serialize from XML that contains an array of objects you can also use this: http://gist.github.com/179530</description>
		<content:encoded><![CDATA[<p>If you need to de-serialize from XML that contains an array of objects you can also use this: <a href="http://gist.github.com/179530" rel="nofollow">http://gist.github.com/179530</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Mac OS X color showing ESC[whatever for git-diff colors (and more) by Giorgio Gonnella</title>
		<link>http://www.xcombinator.com/2008/07/23/mac-os-x-color-showing-escwhatever-for-git-diff-colors-and-more/comment-page-1/#comment-26049</link>
		<dc:creator>Giorgio Gonnella</dc:creator>
		<pubDate>Sun, 09 Aug 2009 12:30:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/07/23/mac-os-x-color-showing-escwhatever-for-git-diff-colors-and-more/#comment-26049</guid>
		<description>Thank you very much! I had exactly the same problem, now is solved. I wish this was documented in git tutorials, although is not directly git related...</description>
		<content:encoded><![CDATA[<p>Thank you very much! I had exactly the same problem, now is solved. I wish this was documented in git tutorials, although is not directly git related&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on starting screen as a login shell by brian</title>
		<link>http://www.xcombinator.com/2009/04/14/starting-screen-as-a-login-shell/comment-page-1/#comment-25692</link>
		<dc:creator>brian</dc:creator>
		<pubDate>Mon, 27 Jul 2009 15:39:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2009/04/14/starting-screen-as-a-login-shell/#comment-25692</guid>
		<description>Thanks Axel, I also learned the other day that you can change the CWD anytime in screen by typing `chdir&lt;path&gt;&#039; at the command prompt ( C-a : )</description>
		<content:encoded><![CDATA[<p>Thanks Axel, I also learned the other day that you can change the CWD anytime in screen by typing `chdir
<path>&#8216; at the command prompt ( C-a : )</path></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on starting screen as a login shell by Axel Scheepers</title>
		<link>http://www.xcombinator.com/2009/04/14/starting-screen-as-a-login-shell/comment-page-1/#comment-25686</link>
		<dc:creator>Axel Scheepers</dc:creator>
		<pubDate>Mon, 27 Jul 2009 10:51:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2009/04/14/starting-screen-as-a-login-shell/#comment-25686</guid>
		<description>Most shells run as a login shell when you create an alias to it with a minus in front of it. In my case I had the same trouble with ksh which I had to install in my home directory. 
It&#039;s installed in ~/sfw/bin/ksh, to make it start as a login shell under screen I created a softlink like so;
cd ~/sfw/bin &amp;&amp; ln -s ksh -ksh
and then used &#039;shell -$SHELL&#039; in my .screenrc et voila.</description>
		<content:encoded><![CDATA[<p>Most shells run as a login shell when you create an alias to it with a minus in front of it. In my case I had the same trouble with ksh which I had to install in my home directory.<br />
It&#8217;s installed in ~/sfw/bin/ksh, to make it start as a login shell under screen I created a softlink like so;<br />
cd ~/sfw/bin &amp;&amp; ln -s ksh -ksh<br />
and then used &#8217;shell -$SHELL&#8217; in my .screenrc et voila.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on &#8220;Easily&#8221; setup a monitored Hadoop / Hive Cluster in EC2 with PoolParty by BotchagalupeMarks for July 8th - 12:56 &#124; IT Management and Cloud Blog</title>
		<link>http://www.xcombinator.com/2009/07/08/easily-setup-a-monitored-hadoop-hive-cluster-in-ec2-with-poolparty/comment-page-1/#comment-25003</link>
		<dc:creator>BotchagalupeMarks for July 8th - 12:56 &#124; IT Management and Cloud Blog</dc:creator>
		<pubDate>Thu, 09 Jul 2009 02:09:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2009/07/08/easily-setup-a-monitored-hadoop-hive-cluster-in-ec2-with-poolparty/#comment-25003</guid>
		<description>[...] &#8220;Easily&#8221; setup a monitored Hadoop / Hive Cluster in EC2 with PoolParty - Setting up a scalable Hadoop cluster isn&#8217;t easy, but PoolParty makes it easier and manageable. [...]</description>
		<content:encoded><![CDATA[<p>[...] &ldquo;Easily&rdquo; setup a monitored Hadoop / Hive Cluster in EC2 with PoolParty &#8211; Setting up a scalable Hadoop cluster isn&rsquo;t easy, but PoolParty makes it easier and manageable. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on adding macruby to multiruby versions by Adding Ruby Enterprise Edition to multiruby versions &#8211; Search &#38; Refactoring</title>
		<link>http://www.xcombinator.com/2009/05/22/adding-macruby-to-multiruby-versions/comment-page-1/#comment-24036</link>
		<dc:creator>Adding Ruby Enterprise Edition to multiruby versions &#8211; Search &#38; Refactoring</dc:creator>
		<pubDate>Mon, 15 Jun 2009 06:58:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2009/05/22/adding-macruby-to-multiruby-versions/#comment-24036</guid>
		<description>[...] tutorial is largely inspired by Nate Murray&#8217;s blog post about Adding MacRuby to multiruby. Checkout his tutorial to install MacRuby and don&#8217;t forget to read Rob Seaman&#8217;s blog [...]</description>
		<content:encoded><![CDATA[<p>[...] tutorial is largely inspired by Nate Murray&#8217;s blog post about Adding MacRuby to multiruby. Checkout his tutorial to install MacRuby and don&#8217;t forget to read Rob Seaman&#8217;s blog [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on ruby inject and the Mandelbrot set by Javi Fontan</title>
		<link>http://www.xcombinator.com/2008/02/22/ruby-inject-and-the-mandelbrot-set/comment-page-1/#comment-23451</link>
		<dc:creator>Javi Fontan</dc:creator>
		<pubDate>Wed, 27 May 2009 01:12:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/02/22/ruby-inject-and-the-mandelbrot-set/#comment-23451</guid>
		<description>Simply lovely.

And now for some performance wars I changed the number of iterations from 50 to 1000 and ran it using ruby 1.8.6 (the one that comes with Leopard), ruby 1.9.1p0 (2009-01-30 revision 21907) and MacRuby 0.4:

ruby 1.8.6
real	0m54.405s
user	0m54.209s
sys	0m0.083s

ruby 1.9.1p0
real	0m10.758s
user	0m8.756s
sys	0m0.133s

MacRuby 0.4
real	1m7.342s
user	1m19.255s
sys	0m2.261s</description>
		<content:encoded><![CDATA[<p>Simply lovely.</p>
<p>And now for some performance wars I changed the number of iterations from 50 to 1000 and ran it using ruby 1.8.6 (the one that comes with Leopard), ruby 1.9.1p0 (2009-01-30 revision 21907) and MacRuby 0.4:</p>
<p>ruby 1.8.6<br />
real	0m54.405s<br />
user	0m54.209s<br />
sys	0m0.083s</p>
<p>ruby 1.9.1p0<br />
real	0m10.758s<br />
user	0m8.756s<br />
sys	0m0.133s</p>
<p>MacRuby 0.4<br />
real	1m7.342s<br />
user	1m19.255s<br />
sys	0m2.261s</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on ruby inject and the Mandelbrot set by Michael Fairchild</title>
		<link>http://www.xcombinator.com/2008/02/22/ruby-inject-and-the-mandelbrot-set/comment-page-1/#comment-23447</link>
		<dc:creator>Michael Fairchild</dc:creator>
		<pubDate>Tue, 26 May 2009 23:02:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/02/22/ruby-inject-and-the-mandelbrot-set/#comment-23447</guid>
		<description>This is awesome.  Mad props.
Here is a screenshot from a run of the code.
http://img.skitch.com/20090526-jdss7n6f8hssmmywnsyiam3ycb.jpg</description>
		<content:encoded><![CDATA[<p>This is awesome.  Mad props.<br />
Here is a screenshot from a run of the code.<br />
<a href="http://img.skitch.com/20090526-jdss7n6f8hssmmywnsyiam3ycb.jpg" rel="nofollow">http://img.skitch.com/20090526-jdss7n6f8hssmmywnsyiam3ycb.jpg</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on ruby inject and the Mandelbrot set by Matt Pulver</title>
		<link>http://www.xcombinator.com/2008/02/22/ruby-inject-and-the-mandelbrot-set/comment-page-1/#comment-23439</link>
		<dc:creator>Matt Pulver</dc:creator>
		<pubDate>Tue, 26 May 2009 17:47:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/02/22/ruby-inject-and-the-mandelbrot-set/#comment-23439</guid>
		<description>@Arya: The meaning of the word &quot;appropriate&quot; depends upon what the goals are. The first goal here is to illustrate use of ruby&#039;s inject function. If you can suggest a nearly equally succinct way to write the function

def mandelbrot(a)
  Array.new(50,a).inject(a) { &#124;z,c&#124; z*z+c }
end

which illustrates use of the inject function that doesn&#039;t use a 50-element array of identical values, then I would consider your nit pick &quot;appropriate&quot;.</description>
		<content:encoded><![CDATA[<p>@Arya: The meaning of the word &#8220;appropriate&#8221; depends upon what the goals are. The first goal here is to illustrate use of ruby&#8217;s inject function. If you can suggest a nearly equally succinct way to write the function</p>
<p>def mandelbrot(a)<br />
  Array.new(50,a).inject(a) { |z,c| z*z+c }<br />
end</p>
<p>which illustrates use of the inject function that doesn&#8217;t use a 50-element array of identical values, then I would consider your nit pick &#8220;appropriate&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on ruby inject and the Mandelbrot set by Arya Asemanfar</title>
		<link>http://www.xcombinator.com/2008/02/22/ruby-inject-and-the-mandelbrot-set/comment-page-1/#comment-23435</link>
		<dc:creator>Arya Asemanfar</dc:creator>
		<pubDate>Tue, 26 May 2009 15:51:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/02/22/ruby-inject-and-the-mandelbrot-set/#comment-23435</guid>
		<description>That&#039;s pretty cool output! :)

One nit pick though, it seems your usage of inject isn&#039;t appropriate because you&#039;re creating an array of size 50 just to iterate over something 50 times.

It might be more appropriate to do something like:

&lt;pre&gt;
def mandelbrot(a)
  z = 0
  50.times { z = z * z + a }
  z
end
&lt;/pre&gt;

That way, if you want to do some large number of iterations, you don&#039;t end up creating and destroying huge arrays. But I guess it&#039;s just preference :)</description>
		<content:encoded><![CDATA[<p>That&#8217;s pretty cool output! <img src='http://www.xcombinator.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>One nit pick though, it seems your usage of inject isn&#8217;t appropriate because you&#8217;re creating an array of size 50 just to iterate over something 50 times.</p>
<p>It might be more appropriate to do something like:</p>
<pre>
def mandelbrot(a)
  z = 0
  50.times { z = z * z + a }
  z
end
</pre>
<p>That way, if you want to do some large number of iterations, you don&#8217;t end up creating and destroying huge arrays. But I guess it&#8217;s just preference <img src='http://www.xcombinator.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on ruby inject and the Mandelbrot set by Eimantas</title>
		<link>http://www.xcombinator.com/2008/02/22/ruby-inject-and-the-mandelbrot-set/comment-page-1/#comment-23403</link>
		<dc:creator>Eimantas</dc:creator>
		<pubDate>Mon, 25 May 2009 17:58:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/02/22/ruby-inject-and-the-mandelbrot-set/#comment-23403</guid>
		<description>awsomeness at it&#039;s best! one can expand it to use colors in console ,)</description>
		<content:encoded><![CDATA[<p>awsomeness at it&#8217;s best! one can expand it to use colors in console ,)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on ruby inject and the Mandelbrot set by Dave Nolan</title>
		<link>http://www.xcombinator.com/2008/02/22/ruby-inject-and-the-mandelbrot-set/comment-page-1/#comment-23398</link>
		<dc:creator>Dave Nolan</dc:creator>
		<pubDate>Mon, 25 May 2009 15:34:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/02/22/ruby-inject-and-the-mandelbrot-set/#comment-23398</guid>
		<description>That is a thing of beauty. Cheers!</description>
		<content:encoded><![CDATA[<p>That is a thing of beauty. Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on String interpolation is faster than printf in Ruby by John</title>
		<link>http://www.xcombinator.com/2008/08/13/string-interpolation-is-faster-than-printf-in-ruby/comment-page-1/#comment-21952</link>
		<dc:creator>John</dc:creator>
		<pubDate>Fri, 01 May 2009 21:46:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/08/13/string-interpolation-is-faster-than-printf-in-ruby/#comment-21952</guid>
		<description>on my machine I see that a good portion of that difference is due to putting the string in an array

1. Baseline:
   Benchmark.measure { 100000.times {&quot;hello world&quot;}}.total
   anywhere from .016 to  .032
2. printf style 
  Benchmark.measure {100000.times {&quot;%s&quot; % [&quot;hello world&quot;] }}.total
  consistent at 0.25
3. interpolation 
   Benchmark.measure {100000.times {&quot;#{&#039;hello world&#039;}&quot;}}.total
   .031

So at this point the difference between  #2 and #3 is 0.219, but if you take out the [] ie
#4 Benchmark.measure {100000.times {&quot;%s&quot; % &quot;hello world&quot;}}.total
the number is closer to 0.19 and the difference between #4 and #3 is 0.159

meaning that about 24% of the difference you were seeing was due to the []. (which doesn&#039;t invalidate your observation at all, interpolation is still way faster than the printf style)</description>
		<content:encoded><![CDATA[<p>on my machine I see that a good portion of that difference is due to putting the string in an array</p>
<p>1. Baseline:<br />
   Benchmark.measure { 100000.times {&#8221;hello world&#8221;}}.total<br />
   anywhere from .016 to  .032<br />
2. printf style<br />
  Benchmark.measure {100000.times {&#8221;%s&#8221; % ["hello world"] }}.total<br />
  consistent at 0.25<br />
3. interpolation<br />
   Benchmark.measure {100000.times {&#8221;#{&#8217;hello world&#8217;}&#8221;}}.total<br />
   .031</p>
<p>So at this point the difference between  #2 and #3 is 0.219, but if you take out the [] ie<br />
#4 Benchmark.measure {100000.times {&#8221;%s&#8221; % &#8220;hello world&#8221;}}.total<br />
the number is closer to 0.19 and the difference between #4 and #3 is 0.159</p>
<p>meaning that about 24% of the difference you were seeing was due to the []. (which doesn&#8217;t invalidate your observation at all, interpolation is still way faster than the printf style)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on ActiveRecord from_xml (and from_json) part 2 by Tiberiu Motoc</title>
		<link>http://www.xcombinator.com/2008/08/11/activerecord-from_xml-and-from_json-part-2/comment-page-1/#comment-21528</link>
		<dc:creator>Tiberiu Motoc</dc:creator>
		<pubDate>Tue, 21 Apr 2009 01:32:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/08/11/activerecord-from_xml-and-from_json-part-2/#comment-21528</guid>
		<description>Hi Matt,

Thanks so much for this code. There is one modification that I had to do to make it work with my setup: I was trying to import from xml deep object associations exported with to_xml. For example, I could import something like:


  ...
  ...
  
    apples
    3
  
  
    oranges
    9
  
  ...


But, an order with many items would be exported as:

  ...
  ...
  
    
      apples
      3
    
    
      oranges
      9
    
    ...
  


Here&#039;s the modifications that I had to do. Let me know if you spot any issues.

  def self.from_hash( hash )
      h = hash.dup
      h.each do &#124;key,value&#124;

        next if reflect_on_association(key.to_sym).nil?

        if reflect_on_association(key.to_sym).macro == :has_many
          h[key] = h[key][key.singularize].map! { &#124;e&#124;
            reflect_on_association(key.to_sym).klass.from_hash e
          }
        else
          h[key] = reflect_on_association(
             key.to_sym ).klass.from_hash value
        end
      end

      new h
    end

Again, thanks for the code.

Tiberiu Motoc</description>
		<content:encoded><![CDATA[<p>Hi Matt,</p>
<p>Thanks so much for this code. There is one modification that I had to do to make it work with my setup: I was trying to import from xml deep object associations exported with to_xml. For example, I could import something like:</p>
<p>  &#8230;<br />
  &#8230;</p>
<p>    apples<br />
    3</p>
<p>    oranges<br />
    9</p>
<p>  &#8230;</p>
<p>But, an order with many items would be exported as:</p>
<p>  &#8230;<br />
  &#8230;</p>
<p>      apples<br />
      3</p>
<p>      oranges<br />
      9</p>
<p>    &#8230;</p>
<p>Here&#8217;s the modifications that I had to do. Let me know if you spot any issues.</p>
<p>  def self.from_hash( hash )<br />
      h = hash.dup<br />
      h.each do |key,value|</p>
<p>        next if reflect_on_association(key.to_sym).nil?</p>
<p>        if reflect_on_association(key.to_sym).macro == :has_many<br />
          h[key] = h[key][key.singularize].map! { |e|<br />
            reflect_on_association(key.to_sym).klass.from_hash e<br />
          }<br />
        else<br />
          h[key] = reflect_on_association(<br />
             key.to_sym ).klass.from_hash value<br />
        end<br />
      end</p>
<p>      new h<br />
    end</p>
<p>Again, thanks for the code.</p>
<p>Tiberiu Motoc</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Mac OS X color showing ESC[whatever for git-diff colors (and more) by Björn Skoglund</title>
		<link>http://www.xcombinator.com/2008/07/23/mac-os-x-color-showing-escwhatever-for-git-diff-colors-and-more/comment-page-1/#comment-21283</link>
		<dc:creator>Björn Skoglund</dc:creator>
		<pubDate>Fri, 17 Apr 2009 09:48:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/07/23/mac-os-x-color-showing-escwhatever-for-git-diff-colors-and-more/#comment-21283</guid>
		<description>Weird stuff, your post fixed my colors on OpenSuSE at work but strangely enough I have had no problems on my Leopard iMac at home.</description>
		<content:encoded><![CDATA[<p>Weird stuff, your post fixed my colors on OpenSuSE at work but strangely enough I have had no problems on my Leopard iMac at home.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on renaming (lots of) files in bash by Adam Avilla</title>
		<link>http://www.xcombinator.com/2009/01/09/renaming-lots-of-files-in-bash/comment-page-1/#comment-14416</link>
		<dc:creator>Adam Avilla</dc:creator>
		<pubDate>Thu, 05 Mar 2009 21:41:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2009/01/09/renaming-lots-of-files-in-bash/#comment-14416</guid>
		<description>you can use find using find instead of ls -1</description>
		<content:encoded><![CDATA[<p>you can use find using find instead of ls -1</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Mac OS X color showing ESC[whatever for git-diff colors (and more) by binOr</title>
		<link>http://www.xcombinator.com/2008/07/23/mac-os-x-color-showing-escwhatever-for-git-diff-colors-and-more/comment-page-1/#comment-11840</link>
		<dc:creator>binOr</dc:creator>
		<pubDate>Tue, 24 Feb 2009 09:24:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/07/23/mac-os-x-color-showing-escwhatever-for-git-diff-colors-and-more/#comment-11840</guid>
		<description>Thank you so much! I was annoyed by &quot;^M&quot; &#039;s  at the end of the diff lines. Now they are gone!</description>
		<content:encoded><![CDATA[<p>Thank you so much! I was annoyed by &#8220;^M&#8221; &#8217;s  at the end of the diff lines. Now they are gone!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ruby&#8217;s #each_with_index for Erlang by Nate Murray</title>
		<link>http://www.xcombinator.com/2009/02/10/rubys-each_with_index-for-erlang/comment-page-1/#comment-7687</link>
		<dc:creator>Nate Murray</dc:creator>
		<pubDate>Wed, 11 Feb 2009 19:14:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2009/02/10/rubys-each_with_index-for-erlang/#comment-7687</guid>
		<description>Re: Ivan. Interesting, they are being converted by something to &lt;PIPE&gt; in the markup. I&#039;ll look into this and fix it.</description>
		<content:encoded><![CDATA[<p>Re: Ivan. Interesting, they are being converted by something to <pipe> in the markup. I&#8217;ll look into this and fix it.</pipe></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ruby&#8217;s #each_with_index for Erlang by Ivan</title>
		<link>http://www.xcombinator.com/2009/02/10/rubys-each_with_index-for-erlang/comment-page-1/#comment-7681</link>
		<dc:creator>Ivan</dc:creator>
		<pubDate>Wed, 11 Feb 2009 18:51:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2009/02/10/rubys-each_with_index-for-erlang/#comment-7681</guid>
		<description>In all list comprehensions you forgot to put &#124;&#124;</description>
		<content:encoded><![CDATA[<p>In all list comprehensions you forgot to put ||</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Mac OS X color showing ESC[whatever for git-diff colors (and more) by Sir Bode Rafael</title>
		<link>http://www.xcombinator.com/2008/07/23/mac-os-x-color-showing-escwhatever-for-git-diff-colors-and-more/comment-page-1/#comment-5664</link>
		<dc:creator>Sir Bode Rafael</dc:creator>
		<pubDate>Tue, 03 Feb 2009 00:59:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/07/23/mac-os-x-color-showing-escwhatever-for-git-diff-colors-and-more/#comment-5664</guid>
		<description>Hi!

Thanks for this Post!

I was experiencing this kind of trouble since I&#039;ve started working on git!

Best Brazilian Regards!</description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>Thanks for this Post!</p>
<p>I was experiencing this kind of trouble since I&#8217;ve started working on git!</p>
<p>Best Brazilian Regards!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on renaming (lots of) files in bash by Nate Murray</title>
		<link>http://www.xcombinator.com/2009/01/09/renaming-lots-of-files-in-bash/comment-page-1/#comment-970</link>
		<dc:creator>Nate Murray</dc:creator>
		<pubDate>Fri, 09 Jan 2009 23:08:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2009/01/09/renaming-lots-of-files-in-bash/#comment-970</guid>
		<description>I also really like Robin Barker&#039;s perl rename script:

http://tips.webdesign10.com/files/rename.pl.txt</description>
		<content:encoded><![CDATA[<p>I also really like Robin Barker&#8217;s perl rename script:</p>
<p><a href="http://tips.webdesign10.com/files/rename.pl.txt" rel="nofollow">http://tips.webdesign10.com/files/rename.pl.txt</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on another reason to love vim by Joao Trindade</title>
		<link>http://www.xcombinator.com/2008/03/26/another-reason-to-love-vim/comment-page-1/#comment-806</link>
		<dc:creator>Joao Trindade</dc:creator>
		<pubDate>Thu, 01 Jan 2009 12:06:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/03/26/another-reason-to-love-vim/#comment-806</guid>
		<description>Great tip. Thanks!</description>
		<content:encoded><![CDATA[<p>Great tip. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on fixing do_mysql hanging or install problems on mac os x by John</title>
		<link>http://www.xcombinator.com/2008/11/20/fixing-do_mysql-hanging-or-install-problems-on-mac-os-x/comment-page-1/#comment-691</link>
		<dc:creator>John</dc:creator>
		<pubDate>Sun, 14 Dec 2008 23:30:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.xcombinator.com/2008/11/20/fixing-do_mysql-hanging-or-install-problems-on-mac-os-x/#comment-691</guid>
		<description>Thank God you wrote this!</description>
		<content:encoded><![CDATA[<p>Thank God you wrote this!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.087 seconds -->
<!-- Cached page served by WP-Cache -->
