<?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"
	>
<channel>
	<title>Comments on: isPrime in One Line of Perl</title>
	<atom:link href="http://3monkeyweb.com/3monkeys/2007/07/17/isprime-in-one-line-of-perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://3monkeyweb.com/3monkeys/2007/07/17/isprime-in-one-line-of-perl/</link>
	<description>They say if you have a 1000 monkeys at a 1000 keyboards, eventually they will produce the works of Shakespeare. This is what happens when you put 3Monkeys at one keyboard...</description>
	<pubDate>Wed, 19 Nov 2008 23:29:53 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Daniel Spiewak</title>
		<link>http://3monkeyweb.com/3monkeys/2007/07/17/isprime-in-one-line-of-perl/#comment-1721</link>
		<dc:creator>Daniel Spiewak</dc:creator>
		<pubDate>Wed, 18 Jul 2007 17:59:31 +0000</pubDate>
		<guid isPermaLink="false">http://3monkeyweb.com/3monkeys/2007/07/17/isprime-in-one-line-of-perl/#comment-1721</guid>
		<description>http://www.dzone.com/links/isprime_in_one_line_of_groovy.html</description>
		<content:encoded><![CDATA[<p><a href="http://www.dzone.com/links/isprime_in_one_line_of_groovy.html" rel="nofollow">http://www.dzone.com/links/isprime_in_one_line_of_groovy.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikhail Sayapin</title>
		<link>http://3monkeyweb.com/3monkeys/2007/07/17/isprime-in-one-line-of-perl/#comment-1719</link>
		<dc:creator>Mikhail Sayapin</dc:creator>
		<pubDate>Wed, 18 Jul 2007 06:18:08 +0000</pubDate>
		<guid isPermaLink="false">http://3monkeyweb.com/3monkeys/2007/07/17/isprime-in-one-line-of-perl/#comment-1719</guid>
		<description>Well, I see. The same "functionality" Python code is: not re.match('^1?$&#124;^(11+?)\\1+$','1'*target_number) and is 38 chars. Prints "True" if the target_number is prime. However, it doesnt work with long integers and string integers. Definitely good way is to use SciPy library.</description>
		<content:encoded><![CDATA[<p>Well, I see. The same &#8220;functionality&#8221; Python code is: not re.match(&#8217;^1?$|^(11+?)\\1+$&#8217;,'1&#8242;*target_number) and is 38 chars. Prints &#8220;True&#8221; if the target_number is prime. However, it doesnt work with long integers and string integers. Definitely good way is to use SciPy library.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 3Monkeys</title>
		<link>http://3monkeyweb.com/3monkeys/2007/07/17/isprime-in-one-line-of-perl/#comment-1718</link>
		<dc:creator>3Monkeys</dc:creator>
		<pubDate>Tue, 17 Jul 2007 19:52:10 +0000</pubDate>
		<guid isPermaLink="false">http://3monkeyweb.com/3monkeys/2007/07/17/isprime-in-one-line-of-perl/#comment-1718</guid>
		<description>@Mikhail, that is why I added the "should be able to be replaced with any reasonable number" caveat in the "rules". You are correct though about perl being able to handle extremely  large numbers. I was hoping for a python shot at it as it should be able to handle it.</description>
		<content:encoded><![CDATA[<p>@Mikhail, that is why I added the &#8220;should be able to be replaced with any reasonable number&#8221; caveat in the &#8220;rules&#8221;. You are correct though about perl being able to handle extremely  large numbers. I was hoping for a python shot at it as it should be able to handle it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikhail Sayapin</title>
		<link>http://3monkeyweb.com/3monkeys/2007/07/17/isprime-in-one-line-of-perl/#comment-1717</link>
		<dc:creator>Mikhail Sayapin</dc:creator>
		<pubDate>Tue, 17 Jul 2007 19:27:49 +0000</pubDate>
		<guid isPermaLink="false">http://3monkeyweb.com/3monkeys/2007/07/17/isprime-in-one-line-of-perl/#comment-1717</guid>
		<description>Unfortunately, the code doesn't work: perl -wle 'print(1)if(1x(2E+32582657-1))!~/^1?$&#124;^(11+?)\1+$/' outs nothing. But 2E+32582657-1 IS prime. In fact it's the largest prime ever found. Well, 2E+32582657-1 is "inf" in Perl, but it's a fault of Perl, not us fellow programmers. Perl is just not suitable for this kind of tasks. Or prove us it is. Anyway, the idea and syntax are very, very cool. *bows*</description>
		<content:encoded><![CDATA[<p>Unfortunately, the code doesn&#8217;t work: perl -wle &#8216;print(1)if(1x(2E+32582657-1))!~/^1?$|^(11+?)\1+$/&#8217; outs nothing. But 2E+32582657-1 IS prime. In fact it&#8217;s the largest prime ever found. Well, 2E+32582657-1 is &#8220;inf&#8221; in Perl, but it&#8217;s a fault of Perl, not us fellow programmers. Perl is just not suitable for this kind of tasks. Or prove us it is. Anyway, the idea and syntax are very, very cool. *bows*</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 3Monkeys</title>
		<link>http://3monkeyweb.com/3monkeys/2007/07/17/isprime-in-one-line-of-perl/#comment-1715</link>
		<dc:creator>3Monkeys</dc:creator>
		<pubDate>Tue, 17 Jul 2007 17:20:33 +0000</pubDate>
		<guid isPermaLink="false">http://3monkeyweb.com/3monkeys/2007/07/17/isprime-in-one-line-of-perl/#comment-1715</guid>
		<description>@Bloid, I think that's where I first found this one. I have several of these tucked away for study.</description>
		<content:encoded><![CDATA[<p>@Bloid, I think that&#8217;s where I first found this one. I have several of these tucked away for study.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 3Monkeys</title>
		<link>http://3monkeyweb.com/3monkeys/2007/07/17/isprime-in-one-line-of-perl/#comment-1714</link>
		<dc:creator>3Monkeys</dc:creator>
		<pubDate>Tue, 17 Jul 2007 15:19:12 +0000</pubDate>
		<guid isPermaLink="false">http://3monkeyweb.com/3monkeys/2007/07/17/isprime-in-one-line-of-perl/#comment-1714</guid>
		<description>Finally got the &apos; correct :) It should work now as a copy/paste.</description>
		<content:encoded><![CDATA[<p>Finally got the &apos; correct <img src='http://3monkeyweb.com/3monkeys/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> It should work now as a copy/paste.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bloid</title>
		<link>http://3monkeyweb.com/3monkeys/2007/07/17/isprime-in-one-line-of-perl/#comment-1708</link>
		<dc:creator>bloid</dc:creator>
		<pubDate>Tue, 17 Jul 2007 08:32:37 +0000</pubDate>
		<guid isPermaLink="false">http://3monkeyweb.com/3monkeys/2007/07/17/isprime-in-one-line-of-perl/#comment-1708</guid>
		<description>The quote at the end of your one line is the wrong type, copy-pasting it doesn't work (it's early and it took me a while to spot that)

And for people who want to see how and why this works, have a look here:

http://montreal.pm.org/tech/neil_kandalgaonkar.shtml</description>
		<content:encoded><![CDATA[<p>The quote at the end of your one line is the wrong type, copy-pasting it doesn&#8217;t work (it&#8217;s early and it took me a while to spot that)</p>
<p>And for people who want to see how and why this works, have a look here:</p>
<p><a href="http://montreal.pm.org/tech/neil_kandalgaonkar.shtml" rel="nofollow">http://montreal.pm.org/tech/neil_kandalgaonkar.shtml</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
