<?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/"
xmlns:series="http://unfoldingneurons.com/"
> <channel><title>Comments on: Implement Array Shuffling in&#160;MooTools</title> <atom:link href="http://davidwalsh.name/array-shuffling-mootools/feed" rel="self" type="application/rss+xml" /><link>http://davidwalsh.name/array-shuffling-mootools</link> <description>Legendary scribbles about JavaScript, HTML5, AJAX, PHP, CSS, and ∞.</description> <lastBuildDate>Mon, 21 May 2012 07:46:19 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>By: Jonas Raoni</title><link>http://davidwalsh.name/array-shuffling-mootools#comment-10180</link> <dc:creator>Jonas Raoni</dc:creator> <pubDate>Sun, 05 Jul 2009 19:38:15 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=1416#comment-10180</guid> <description>Hehe although the original idea is older than my mom (probably no one here knows the creator of this...), I would be glad if people could copy my things keeping the credits ^^http://jsfromhell.com/array/shuffle</description> <content:encoded><![CDATA[<p>Hehe although the original idea is older than my mom (probably no one here knows the creator of this&#8230;), I would be glad if people could copy my things keeping the credits ^^</p><p><a
href="http://jsfromhell.com/array/shuffle" rel="nofollow">http://jsfromhell.com/array/shuffle</a></p> ]]></content:encoded> </item> <item><title>By: tyler Havener</title><link>http://davidwalsh.name/array-shuffling-mootools#comment-9399</link> <dc:creator>tyler Havener</dc:creator> <pubDate>Mon, 25 May 2009 19:49:36 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=1416#comment-9399</guid> <description>I&#039;m trying to learn mootools (both in a general sense, and all over again with 1.2), and javascript OOP at the same time. How I use this to shuffle the order of some list elements on a webpage?And, if you don&#039;t mind, how would I do this in 1.1 vs. 1.2?</description> <content:encoded><![CDATA[<p>I&#8217;m trying to learn mootools (both in a general sense, and all over again with 1.2), and javascript OOP at the same time. How I use this to shuffle the order of some list elements on a webpage?</p><p>And, if you don&#8217;t mind, how would I do this in 1.1 vs. 1.2?</p> ]]></content:encoded> </item> <item><title>By: olivier</title><link>http://davidwalsh.name/array-shuffling-mootools#comment-7975</link> <dc:creator>olivier</dc:creator> <pubDate>Sun, 01 Mar 2009 17:43:19 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=1416#comment-7975</guid> <description>I&#039;ve tested both Elad and David script on a 27 lenght array... the shuffling is far better using David&#039;s one....
Anyone for the best of both world : efficiency and elegance ?
Anyway thank you so much for the tip !</description> <content:encoded><![CDATA[<p>I&#8217;ve tested both Elad and David script on a 27 lenght array&#8230; the shuffling is far better using David&#8217;s one&#8230;.<br
/> Anyone for the best of both world : efficiency and elegance ?<br
/> Anyway thank you so much for the tip !</p> ]]></content:encoded> </item> <item><title>By: Jeremy Parrish</title><link>http://davidwalsh.name/array-shuffling-mootools#comment-7713</link> <dc:creator>Jeremy Parrish</dc:creator> <pubDate>Tue, 10 Feb 2009 15:23:56 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=1416#comment-7713</guid> <description>I&#039;ll point out that @David&#039;s example is guaranteed to not require any additional storage space (it shuffles in place), is unbiased toward permutations, and runs in O(n) time. @Elad&#039;s shuffle depends on the browser&#039;s implementation of sort(). It may require more storage space, it may be biased to certain permutations, and it will run in O(n log n) time or worse due to the nature of sorting. However, I&#039;m guessing that anything shuffled in JS is going to be small and no one will care if it is biased as long as it &quot;seems&quot; random.</description> <content:encoded><![CDATA[<p>I&#8217;ll point out that @David&#8217;s example is guaranteed to not require any additional storage space (it shuffles in place), is unbiased toward permutations, and runs in O(n) time. @Elad&#8217;s shuffle depends on the browser&#8217;s implementation of sort(). It may require more storage space, it may be biased to certain permutations, and it will run in O(n log n) time or worse due to the nature of sorting. However, I&#8217;m guessing that anything shuffled in JS is going to be small and no one will care if it is biased as long as it &#8220;seems&#8221; random.</p> ]]></content:encoded> </item> <item><title>By: david</title><link>http://davidwalsh.name/array-shuffling-mootools#comment-7710</link> <dc:creator>david</dc:creator> <pubDate>Tue, 10 Feb 2009 01:48:50 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=1416#comment-7710</guid> <description>&lt;p&gt;@Lim Chee Aun:  Awesome!&lt;/p&gt;</description> <content:encoded><![CDATA[<p>@Lim Chee Aun:  Awesome!</p> ]]></content:encoded> </item> <item><title>By: Lim Chee Aun</title><link>http://davidwalsh.name/array-shuffling-mootools#comment-7709</link> <dc:creator>Lim Chee Aun</dc:creator> <pubDate>Tue, 10 Feb 2009 00:36:44 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=1416#comment-7709</guid> <description>Just a note that you can do cool stuff like &lt;a href=&quot;http://cheeaun.com/projects/shuffletext/&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; with Array Shuffling. :)</description> <content:encoded><![CDATA[<p>Just a note that you can do cool stuff like <a
href="http://cheeaun.com/projects/shuffletext/" rel="nofollow">this</a> with Array Shuffling. :)</p> ]]></content:encoded> </item> <item><title>By: david</title><link>http://davidwalsh.name/array-shuffling-mootools#comment-7708</link> <dc:creator>david</dc:creator> <pubDate>Mon, 09 Feb 2009 23:37:43 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=1416#comment-7708</guid> <description>&lt;p&gt;@Elad:  Awesome!  Nice work.  Definitely more elegant.&lt;/p&gt;</description> <content:encoded><![CDATA[<p>@Elad:  Awesome!  Nice work.  Definitely more elegant.</p> ]]></content:encoded> </item> <item><title>By: Elad Ossadon</title><link>http://davidwalsh.name/array-shuffling-mootools#comment-7707</link> <dc:creator>Elad Ossadon</dc:creator> <pubDate>Mon, 09 Feb 2009 23:27:17 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=1416#comment-7707</guid> <description>Another way (more elegant in my opinion):Array.implement({
shuffle:function() {
this.sort(function (x,y) { return Math.floor(Math.random()*3)-1; });
return this;
}});alert([1,2,3,4,5,6,7,8].shuffle()); </description> <content:encoded><![CDATA[<p>Another way (more elegant in my opinion):</p><p>Array.implement({<br
/> shuffle:function() {<br
/> this.sort(function (x,y) { return Math.floor(Math.random()*3)-1; });<br
/> return this;<br
/> }</p><p>});</p><p>alert([1,2,3,4,5,6,7,8].shuffle());</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 3/7 queries in 0.010 seconds using disk: basic
Object Caching 687/687 objects using disk: basic

Served from: davidwalsh.name @ 2012-05-21 03:54:45 -->
