<?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: Shuffling</title>
	<atom:link href="http://code.scrapcrap.org/shuffling/feed" rel="self" type="application/rss+xml" />
	<link>http://code.scrapcrap.org/shuffling</link>
	<description>Ruby, Programming, Technology, Fun</description>
	<lastBuildDate>Wed, 13 Oct 2010 13:01:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: kitallis</title>
		<link>http://code.scrapcrap.org/shuffling/comment-page-1#comment-21</link>
		<dc:creator>kitallis</dc:creator>
		<pubDate>Sat, 24 Jan 2009 13:31:09 +0000</pubDate>
		<guid isPermaLink="false">http://code.scrapcrap.org/?p=44#comment-21</guid>
		<description>&lt;blockquote&gt;
Googling around turned out that sorting it by using UUID’s as a source of random numbers was more easier to implement
&lt;/blockquote&gt;

To make it clear. Sorting is just putting a set of elements in a particular order. So, by using randomly generated UUID&#039;S we are simply sorting the array by random numbers.

Probably something like this in Ruby :
&lt;code&gt;
deck.sort! { #random_guid }
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<blockquote><p>
Googling around turned out that sorting it by using UUID’s as a source of random numbers was more easier to implement
</p></blockquote>
<p>To make it clear. Sorting is just putting a set of elements in a particular order. So, by using randomly generated UUID&#8217;S we are simply sorting the array by random numbers.</p>
<p>Probably something like this in Ruby :<br />
<code><br />
deck.sort! { #random_guid }<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Naveen</title>
		<link>http://code.scrapcrap.org/shuffling/comment-page-1#comment-20</link>
		<dc:creator>Naveen</dc:creator>
		<pubDate>Fri, 23 Jan 2009 22:44:18 +0000</pubDate>
		<guid isPermaLink="false">http://code.scrapcrap.org/?p=44#comment-20</guid>
		<description>What do you mean by sort UUIDs?</description>
		<content:encoded><![CDATA[<p>What do you mean by sort UUIDs?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Implementing a Chat Server in Ruby &#124; Nine Mohs</title>
		<link>http://code.scrapcrap.org/shuffling/comment-page-1#comment-11</link>
		<dc:creator>Implementing a Chat Server in Ruby &#124; Nine Mohs</dc:creator>
		<pubDate>Tue, 13 Jan 2009 19:26:24 +0000</pubDate>
		<guid isPermaLink="false">http://code.scrapcrap.org/?p=44#comment-11</guid>
		<description>[...] little toy Chat Program reads a single input from the client, shuffles it and sends it [...]</description>
		<content:encoded><![CDATA[<p>[...] little toy Chat Program reads a single input from the client, shuffles it and sends it [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kitallis</title>
		<link>http://code.scrapcrap.org/shuffling/comment-page-1#comment-9</link>
		<dc:creator>kitallis</dc:creator>
		<pubDate>Mon, 12 Jan 2009 18:23:31 +0000</pubDate>
		<guid isPermaLink="false">http://code.scrapcrap.org/?p=44#comment-9</guid>
		<description>&lt;blockquote&gt;Finally, “more easier” is redundant.&lt;/blockquote&gt;

Well, that is beacause my main objective was to find a solution for an Interview question. I needed to find something easy and quick to implement. Probably, I&#039;ll just remove one of it :)


&lt;blockquote&gt;Modulus isn’t an alternative to random numbers&lt;/blockquote&gt;
Thanks. Fixed.</description>
		<content:encoded><![CDATA[<blockquote><p>Finally, “more easier” is redundant.</p></blockquote>
<p>Well, that is beacause my main objective was to find a solution for an Interview question. I needed to find something easy and quick to implement. Probably, I&#8217;ll just remove one of it <img src='http://kitallis.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<blockquote><p>Modulus isn’t an alternative to random numbers</p></blockquote>
<p>Thanks. Fixed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: josh</title>
		<link>http://code.scrapcrap.org/shuffling/comment-page-1#comment-6</link>
		<dc:creator>josh</dc:creator>
		<pubDate>Mon, 12 Jan 2009 17:07:29 +0000</pubDate>
		<guid isPermaLink="false">http://code.scrapcrap.org/?p=44#comment-6</guid>
		<description>Modulus isn&#039;t an alternative to random numbers, if your random number generator has a fixed range you need *something* to adjust it for Fisher-Yates.  Modulus is usually the fastest way, but it won&#039;t give you the random numbers to begin with.

And if you&#039;re worried about the predictability of rand(), use a different RNG (or seed it; presumably you can do that in Ruby).  A GUID is basically another random number generator, convert that to a number if nothing else.  Usually there are faster generators that work well enough, though, because the GUID enforces additional properties that you don&#039;t care about here and has way too many bits.

Finally, &quot;more easier&quot; is redundant.</description>
		<content:encoded><![CDATA[<p>Modulus isn&#8217;t an alternative to random numbers, if your random number generator has a fixed range you need *something* to adjust it for Fisher-Yates.  Modulus is usually the fastest way, but it won&#8217;t give you the random numbers to begin with.</p>
<p>And if you&#8217;re worried about the predictability of rand(), use a different RNG (or seed it; presumably you can do that in Ruby).  A GUID is basically another random number generator, convert that to a number if nothing else.  Usually there are faster generators that work well enough, though, because the GUID enforces additional properties that you don&#8217;t care about here and has way too many bits.</p>
<p>Finally, &#8220;more easier&#8221; is redundant.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kitallis</title>
		<link>http://code.scrapcrap.org/shuffling/comment-page-1#comment-5</link>
		<dc:creator>kitallis</dc:creator>
		<pubDate>Mon, 12 Jan 2009 06:47:19 +0000</pubDate>
		<guid isPermaLink="false">http://code.scrapcrap.org/?p=44#comment-5</guid>
		<description>Automated Spam? Prank?
Sigh. Comment.</description>
		<content:encoded><![CDATA[<p>Automated Spam? Prank?<br />
Sigh. Comment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesse Goodin</title>
		<link>http://code.scrapcrap.org/shuffling/comment-page-1#comment-4</link>
		<dc:creator>Jesse Goodin</dc:creator>
		<pubDate>Sun, 11 Jan 2009 18:30:44 +0000</pubDate>
		<guid isPermaLink="false">http://code.scrapcrap.org/?p=44#comment-4</guid>
		<description>You know, I have to tell you, I really enjoy this blog and the insight from everyone who participates. I find it to be refreshing and very informative. I wish there were more blogs like it. Anyway, I felt it was about time I posted.</description>
		<content:encoded><![CDATA[<p>You know, I have to tell you, I really enjoy this blog and the insight from everyone who participates. I find it to be refreshing and very informative. I wish there were more blogs like it. Anyway, I felt it was about time I posted.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

