<?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>Web Developer</description>
	<lastBuildDate>Thu, 16 Feb 2012 13:19:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Ruby Generators &#124; Tweetegy</title>
		<link>http://anthonylewis.com/2007/11/09/ruby-generators/comment-page-1/#comment-452</link>
		<dc:creator>Ruby Generators &#124; Tweetegy</dc:creator>
		<pubDate>Thu, 16 Feb 2012 13:19:43 +0000</pubDate>
		<guid isPermaLink="false">http://anthonylewis.com/2007/11/09/ruby-generators/#comment-452</guid>
		<description>[...] modified example (to use Ruby 1.9.2 Enumerator class instead of the Ruby 1.8.7 Generator) from Anthony Lewis&#8217;s blog. This example generates a set of Prime [...]</description>
		<content:encoded><![CDATA[<p>[...] modified example (to use Ruby 1.9.2 Enumerator class instead of the Ruby 1.8.7 Generator) from Anthony Lewis&#8217;s blog. This example generates a set of Prime [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam Watkins</title>
		<link>http://anthonylewis.com/2007/11/09/ruby-generators/comment-page-1/#comment-433</link>
		<dc:creator>Sam Watkins</dc:creator>
		<pubDate>Tue, 22 Nov 2011 02:25:02 +0000</pubDate>
		<guid isPermaLink="false">http://anthonylewis.com/2007/11/09/ruby-generators/#comment-433</guid>
		<description>The proof is valid.  Ah, why argue such things on a web forum?  I must be crazy.

It is possible to come up with arguments, statements and predicates that are self-contradictory or ill defined, such as the riddle about &quot;who shaves the barber?&quot; (google it) and the corresponding attack on set theory...  Such are neither true nor false, and could be used to create a confusing, false proof.

This is not specifically to do with infinite series, or set theory, as the &quot;barber paradox&quot; illustrates.  This particular proof about prime numbers is well known, and you won&#039;t find a sane and educated mathematician to doubt it!</description>
		<content:encoded><![CDATA[<p>The proof is valid.  Ah, why argue such things on a web forum?  I must be crazy.</p>
<p>It is possible to come up with arguments, statements and predicates that are self-contradictory or ill defined, such as the riddle about &#8220;who shaves the barber?&#8221; (google it) and the corresponding attack on set theory&#8230;  Such are neither true nor false, and could be used to create a confusing, false proof.</p>
<p>This is not specifically to do with infinite series, or set theory, as the &#8220;barber paradox&#8221; illustrates.  This particular proof about prime numbers is well known, and you won&#8217;t find a sane and educated mathematician to doubt it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam Watkins</title>
		<link>http://anthonylewis.com/2007/11/09/ruby-generators/comment-page-1/#comment-432</link>
		<dc:creator>Sam Watkins</dc:creator>
		<pubDate>Tue, 22 Nov 2011 02:14:35 +0000</pubDate>
		<guid isPermaLink="false">http://anthonylewis.com/2007/11/09/ruby-generators/#comment-432</guid>
		<description>The proof given by Joshua is correct and well known, Gavin&#039;s addition is not needed.</description>
		<content:encoded><![CDATA[<p>The proof given by Joshua is correct and well known, Gavin&#8217;s addition is not needed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: infinite proof</title>
		<link>http://anthonylewis.com/2007/11/09/ruby-generators/comment-page-1/#comment-309</link>
		<dc:creator>infinite proof</dc:creator>
		<pubDate>Thu, 10 Feb 2011 23:44:59 +0000</pubDate>
		<guid isPermaLink="false">http://anthonylewis.com/2007/11/09/ruby-generators/#comment-309</guid>
		<description>The fundamental assumption behind these &quot;proofs&#039; is that contradictions cannot co-exist. However that may not be true in the realm of infinity. Philosophically this is a FAIL.</description>
		<content:encoded><![CDATA[<p>The fundamental assumption behind these &#8220;proofs&#8217; is that contradictions cannot co-exist. However that may not be true in the realm of infinity. Philosophically this is a FAIL.</p>
]]></content:encoded>
	</item>
	<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>
</channel>
</rss>

