<?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 on: Ruby Generators</title>
	<atom:link href="http://anthonylewis.com/2007/11/09/ruby-generators/feed/" rel="self" type="application/rss+xml" />
	<link>http://anthonylewis.com/2007/11/09/ruby-generators/</link>
	<description>Just Another Geek</description>
	<lastBuildDate>Mon, 23 Nov 2009 11:35:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Gavin</title>
		<link>http://anthonylewis.com/2007/11/09/ruby-generators/comment-page-1/#comment-264</link>
		<dc:creator>Gavin</dc:creator>
		<pubDate>Mon, 23 Nov 2009 11:35:41 +0000</pubDate>
		<guid isPermaLink="false">http://anthonylewis.com/2007/11/09/ruby-generators/#comment-264</guid>
		<description>The above proof is nearly complete.  Instead of &quot;Hence this number is prime...&quot; it should say &quot;This number is prime or composite.  If it&#039;s prime, that&#039;s a contraction; QED.  If it&#039;s composite, it can be factored into primes, none of which we previously knew about; contradiction; QED.&quot;

In short, given any finite list of primes, it&#039;s always possible to find a new one.  Therefore the list is infinite.  This proof goes back to Euclid&#039;s time.</description>
		<content:encoded><![CDATA[<p>The above proof is nearly complete.  Instead of &#8220;Hence this number is prime&#8230;&#8221; it should say &#8220;This number is prime or composite.  If it&#8217;s prime, that&#8217;s a contraction; QED.  If it&#8217;s composite, it can be factored into primes, none of which we previously knew about; contradiction; QED.&#8221;</p>
<p>In short, given any finite list of primes, it&#8217;s always possible to find a new one.  Therefore the list is infinite.  This proof goes back to Euclid&#8217;s time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua Cheek</title>
		<link>http://anthonylewis.com/2007/11/09/ruby-generators/comment-page-1/#comment-254</link>
		<dc:creator>Joshua Cheek</dc:creator>
		<pubDate>Sat, 03 Oct 2009 14:03:13 +0000</pubDate>
		<guid isPermaLink="false">http://anthonylewis.com/2007/11/09/ruby-generators/#comment-254</guid>
		<description>Montana says &quot;there are not a finite number of primes.&quot;

Anthony says &quot;Prove it&quot;


Assume there are a finite number of primes. If you multiply them all together, you will have a number for which every prime is a multiple. Add one to this number, and you will have a new number which no prime divides. Hence this new number is prime. This is a contradiction, since it is not in the finite set of all primes, so the assumption is wrong and there are an infinite number of primes.

Or, in haiku http://xkcd.com/622/</description>
		<content:encoded><![CDATA[<p>Montana says &#8220;there are not a finite number of primes.&#8221;</p>
<p>Anthony says &#8220;Prove it&#8221;</p>
<p>Assume there are a finite number of primes. If you multiply them all together, you will have a number for which every prime is a multiple. Add one to this number, and you will have a new number which no prime divides. Hence this new number is prime. This is a contradiction, since it is not in the finite set of all primes, so the assumption is wrong and there are an infinite number of primes.</p>
<p>Or, in haiku <a href="http://xkcd.com/622/" rel="nofollow">http://xkcd.com/622/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shot</title>
		<link>http://anthonylewis.com/2007/11/09/ruby-generators/comment-page-1/#comment-253</link>
		<dc:creator>Shot</dc:creator>
		<pubDate>Sat, 03 Oct 2009 11:39:07 +0000</pubDate>
		<guid isPermaLink="false">http://anthonylewis.com/2007/11/09/ruby-generators/#comment-253</guid>
		<description>If you’re after code similarity, you can use Enumerable#any? instead of Enumerable#all?:

if p.any? { &#124;f&#124; n % f == 0 }

or

if p.any? { &#124;f&#124; (n % f).zero? }

(IMHO using positive checks like the above is also simpler to read and parse by humans).</description>
		<content:encoded><![CDATA[<p>If you’re after code similarity, you can use Enumerable#any? instead of Enumerable#all?:</p>
<p>if p.any? { |f| n % f == 0 }</p>
<p>or</p>
<p>if p.any? { |f| (n % f).zero? }</p>
<p>(IMHO using positive checks like the above is also simpler to read and parse by humans).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: roger rubygems</title>
		<link>http://anthonylewis.com/2007/11/09/ruby-generators/comment-page-1/#comment-236</link>
		<dc:creator>roger rubygems</dc:creator>
		<pubDate>Thu, 03 Sep 2009 22:29:11 +0000</pubDate>
		<guid isPermaLink="false">http://anthonylewis.com/2007/11/09/ruby-generators/#comment-236</guid>
		<description>Checkout fibers, too, I suppose :)
-r</description>
		<content:encoded><![CDATA[<p>Checkout fibers, too, I suppose :)<br />
-r</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A</title>
		<link>http://anthonylewis.com/2007/11/09/ruby-generators/comment-page-1/#comment-172</link>
		<dc:creator>A</dc:creator>
		<pubDate>Wed, 27 May 2009 13:10:36 +0000</pubDate>
		<guid isPermaLink="false">http://anthonylewis.com/2007/11/09/ruby-generators/#comment-172</guid>
		<description>Love this. I was hunting for the exact solution to chain more than one &quot;filter&quot; on a large list. Perfect fit for me.</description>
		<content:encoded><![CDATA[<p>Love this. I was hunting for the exact solution to chain more than one &#8220;filter&#8221; on a large list. Perfect fit for me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anthony</title>
		<link>http://anthonylewis.com/2007/11/09/ruby-generators/comment-page-1/#comment-120</link>
		<dc:creator>Anthony</dc:creator>
		<pubDate>Sat, 18 Apr 2009 01:28:05 +0000</pubDate>
		<guid isPermaLink="false">http://anthonylewis.com/2007/11/09/ruby-generators/#comment-120</guid>
		<description>Prove it :-)</description>
		<content:encoded><![CDATA[<p>Prove it :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Montana</title>
		<link>http://anthonylewis.com/2007/11/09/ruby-generators/comment-page-1/#comment-119</link>
		<dc:creator>Montana</dc:creator>
		<pubDate>Fri, 17 Apr 2009 22:57:43 +0000</pubDate>
		<guid isPermaLink="false">http://anthonylewis.com/2007/11/09/ruby-generators/#comment-119</guid>
		<description>Just to note, there are not a finite number of primes. :)</description>
		<content:encoded><![CDATA[<p>Just to note, there are not a finite number of primes. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kemiisto</title>
		<link>http://anthonylewis.com/2007/11/09/ruby-generators/comment-page-1/#comment-115</link>
		<dc:creator>kemiisto</dc:creator>
		<pubDate>Fri, 26 Dec 2008 14:08:35 +0000</pubDate>
		<guid isPermaLink="false">http://anthonylewis.com/2007/11/09/ruby-generators/#comment-115</guid>
		<description>Thanks. Today it was very useful during the Python vs Ruby &quot;holy war&quot; on one russian programmers forum! ;-)</description>
		<content:encoded><![CDATA[<p>Thanks. Today it was very useful during the Python vs Ruby &#8220;holy war&#8221; on one russian programmers forum! ;-)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
