<?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: Array.sort() should not be used to shuffle an array</title>
	<atom:link href="http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/feed/" rel="self" type="application/rss+xml" />
	<link>http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/</link>
	<description>Stephane Roucheray's trivial work and thoughts</description>
	<lastBuildDate>Tue, 29 Mar 2011 23:32:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
	<item>
		<title>By: Programmatori del caso &#171; Macworld Online</title>
		<link>http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/comment-page-1/#comment-380</link>
		<dc:creator>Programmatori del caso &#171; Macworld Online</dc:creator>
		<pubDate>Fri, 05 Mar 2010 02:11:28 +0000</pubDate>
		<guid isPermaLink="false">http://sroucheray.org/blog/?p=375#comment-380</guid>
		<description>[...] e spiega ai tecnicamente inclinati come andrebbe evitato. Per superprogrammatori si trova anche una descrizione teorica e pratica della [...]</description>
		<content:encoded><![CDATA[<p>[...] e spiega ai tecnicamente inclinati come andrebbe evitato. Per superprogrammatori si trova anche una descrizione teorica e pratica della [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stéphane Roucheray</title>
		<link>http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/comment-page-1/#comment-373</link>
		<dc:creator>Stéphane Roucheray</dc:creator>
		<pubDate>Sun, 28 Feb 2010 11:11:45 +0000</pubDate>
		<guid isPermaLink="false">http://sroucheray.org/blog/?p=375#comment-373</guid>
		<description>Not at all. The European Commission forces Microsoft to show Windows users a screen asking to choose fro a browser if they still use the one by default. The web site &lt;a href=&quot;http://opentochoice.org&quot; rel=&quot;nofollow&quot;&gt;http://opentochoice.org&lt;/a&gt; is the Mozilla website to help people make a decision. The window which will be displayed to Windows users to ask them to make their choice is a web page developed by and hosted at Microsoft&#039;s : &lt;a href=&quot;http://www.browserchoice.eu&quot; rel=&quot;nofollow&quot;&gt;http://www.browserchoice.eu&lt;/a&gt; (Not to be confused with the previous one). The Microsoft web page at &lt;a href=&quot;http://www.browserchoice.eu&quot; rel=&quot;nofollow&quot;&gt;http://www.browserchoice.eu&lt;/a&gt; should display browsers in random order. This is where they use a bad implementation of a random Algorithm. I don&#039;t think this is for anybody a way to benefit to something. It&#039;s just the result of the web spreading some bad habits and developers to appropriate them. Even those at Microsoft&#039;s.</description>
		<content:encoded><![CDATA[<p>Not at all. The European Commission forces Microsoft to show Windows users a screen asking to choose fro a browser if they still use the one by default. The web site <a href="http://opentochoice.org" rel="nofollow">http://opentochoice.org</a> is the Mozilla website to help people make a decision. The window which will be displayed to Windows users to ask them to make their choice is a web page developed by and hosted at Microsoft&#8217;s : <a href="http://www.browserchoice.eu" rel="nofollow">http://www.browserchoice.eu</a> (Not to be confused with the previous one). The Microsoft web page at <a href="http://www.browserchoice.eu" rel="nofollow">http://www.browserchoice.eu</a> should display browsers in random order. This is where they use a bad implementation of a random Algorithm. I don&#8217;t think this is for anybody a way to benefit to something. It&#8217;s just the result of the web spreading some bad habits and developers to appropriate them. Even those at Microsoft&#8217;s.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: georges</title>
		<link>http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/comment-page-1/#comment-372</link>
		<dc:creator>georges</dc:creator>
		<pubDate>Sun, 28 Feb 2010 08:53:36 +0000</pubDate>
		<guid isPermaLink="false">http://sroucheray.org/blog/?p=375#comment-372</guid>
		<description>Stéphane, on http://opentochoice.org you posted about your page on Array.sort().
It&#039;s not clear to me why.
Are you implying that Mozilla is doing something unfair with it? and how would they benefit from it???</description>
		<content:encoded><![CDATA[<p>Stéphane, on <a href="http://opentochoice.org" rel="nofollow">http://opentochoice.org</a> you posted about your page on Array.sort().<br />
It&#8217;s not clear to me why.<br />
Are you implying that Mozilla is doing something unfair with it? and how would they benefit from it???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stéphane Roucheray</title>
		<link>http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/comment-page-1/#comment-369</link>
		<dc:creator>Stéphane Roucheray</dc:creator>
		<pubDate>Fri, 26 Feb 2010 08:09:18 +0000</pubDate>
		<guid isPermaLink="false">http://sroucheray.org/blog/?p=375#comment-369</guid>
		<description>You right. That&#039;s intellectually weird, but well spread across the web unfortunately.</description>
		<content:encoded><![CDATA[<p>You right. That&#8217;s intellectually weird, but well spread across the web unfortunately.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/comment-page-1/#comment-366</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Thu, 25 Feb 2010 20:03:25 +0000</pubDate>
		<guid isPermaLink="false">http://sroucheray.org/blog/?p=375#comment-366</guid>
		<description>You misunderstand - the user-provided comparison function *is* deliberately broken, returning a random value in order to break the sort algorithm, trying to force it to un-sort the array instead. Even without the statistical demonstration of why it&#039;s invalid, this approach is screaming out &#039;bad idea&#039; to me...</description>
		<content:encoded><![CDATA[<p>You misunderstand &#8211; the user-provided comparison function *is* deliberately broken, returning a random value in order to break the sort algorithm, trying to force it to un-sort the array instead. Even without the statistical demonstration of why it&#8217;s invalid, this approach is screaming out &#8216;bad idea&#8217; to me&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stéphane Roucheray</title>
		<link>http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/comment-page-1/#comment-365</link>
		<dc:creator>Stéphane Roucheray</dc:creator>
		<pubDate>Thu, 25 Feb 2010 08:04:30 +0000</pubDate>
		<guid isPermaLink="false">http://sroucheray.org/blog/?p=375#comment-365</guid>
		<description>It&#039;s always a matter of efficiency. The comparison function is not &quot;deliberately broken&quot;. It is built to be efficient at what it is intended to, ie sort things. Using it to shuffle things is, at a first glance, a clever way to use its built-in speediness but it turns that it&#039;s a bad idea.</description>
		<content:encoded><![CDATA[<p>It&#8217;s always a matter of efficiency. The comparison function is not &#8220;deliberately broken&#8221;. It is built to be efficient at what it is intended to, ie sort things. Using it to shuffle things is, at a first glance, a clever way to use its built-in speediness but it turns that it&#8217;s a bad idea.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/comment-page-1/#comment-364</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Thu, 25 Feb 2010 03:24:21 +0000</pubDate>
		<guid isPermaLink="false">http://sroucheray.org/blog/?p=375#comment-364</guid>
		<description>Perhaps I&#039;m missing something, but this seems an awfully clumsy way of doing things - using a deliberately broken comparison function to make the sort do something other than sort.

If you have access to a sort function and a random generator, why not just assign a large random integer to each item in the set, then sort the resulting pairs by the numeric order?</description>
		<content:encoded><![CDATA[<p>Perhaps I&#8217;m missing something, but this seems an awfully clumsy way of doing things &#8211; using a deliberately broken comparison function to make the sort do something other than sort.</p>
<p>If you have access to a sort function and a random generator, why not just assign a large random integer to each item in the set, then sort the resulting pairs by the numeric order?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gabriel Hautclocq</title>
		<link>http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/comment-page-1/#comment-363</link>
		<dc:creator>Gabriel Hautclocq</dc:creator>
		<pubDate>Wed, 24 Feb 2010 17:12:26 +0000</pubDate>
		<guid isPermaLink="false">http://sroucheray.org/blog/?p=375#comment-363</guid>
		<description>Simply excellent. Great explanation and good algorithms !</description>
		<content:encoded><![CDATA[<p>Simply excellent. Great explanation and good algorithms !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David McFarlane</title>
		<link>http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/comment-page-1/#comment-131</link>
		<dc:creator>David McFarlane</dc:creator>
		<pubDate>Mon, 30 Nov 2009 18:30:43 +0000</pubDate>
		<guid isPermaLink="false">http://sroucheray.org/blog/?p=375#comment-131</guid>
		<description>Very nice explanation and demos!  (Chanced upon this while looking for info on shuffling arrays without consecutive repeats.)</description>
		<content:encoded><![CDATA[<p>Very nice explanation and demos!  (Chanced upon this while looking for info on shuffling arrays without consecutive repeats.)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

