<?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 for Arie de Bonth</title>
	<atom:link href="http://www.bonth.nl/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bonth.nl</link>
	<description>Flash &#38; Actionscript specialist</description>
	<lastBuildDate>Mon, 30 May 2011 09:39:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>Comment on AS3 Object shuffle or randomize by Arie</title>
		<link>http://www.bonth.nl/2011/05/29/as3-object-shuffle-or-randomize/comment-page-1/#comment-2309</link>
		<dc:creator>Arie</dc:creator>
		<pubDate>Mon, 30 May 2011 09:39:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.bonth.nl/?p=485#comment-2309</guid>
		<description>Hi Alistair, thank you for noticing the biased values my function produces. You&#039;re complete right, I tested both functions and your code definitely gives better, unbiased results.

I forgot that the range of items you randomly pick from are the selected item itself and all items that precede it. See this blogpost for a visual explanation: http://www.kirupa.com/flash/shuffling_array.htm

I just updated my code.</description>
		<content:encoded><![CDATA[<p>Hi Alistair, thank you for noticing the biased values my function produces. You&#8217;re complete right, I tested both functions and your code definitely gives better, unbiased results.</p>
<p>I forgot that the range of items you randomly pick from are the selected item itself and all items that precede it. See this blogpost for a visual explanation: <a href="http://www.kirupa.com/flash/shuffling_array.htm" rel="nofollow">http://www.kirupa.com/flash/shuffling_array.htm</a></p>
<p>I just updated my code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on AS3 Object shuffle or randomize by Alistair</title>
		<link>http://www.bonth.nl/2011/05/29/as3-object-shuffle-or-randomize/comment-page-1/#comment-2308</link>
		<dc:creator>Alistair</dc:creator>
		<pubDate>Mon, 30 May 2011 08:32:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.bonth.nl/?p=485#comment-2308</guid>
		<description>Thanks for an interesting blog post. I was just looking into the Fisher-Yates algorithm myself.

I tried running your function multiple times over the array [1,2,3] and it&#039;s displaying a bias towards certain permutations. Here is a sample of the number of each permutation I got over 100000 iterations:

[123] 14846
[132] 18297
[213] 18461
[231] 15008
[312] 18554
[321] 14834

These biased values seem consistent with the naive implementation described here: http://www.codinghorror.com/blog/2007/12/the-danger-of-naivete.html

This code seems to work better:

var i:int = obj.length;
while (i &gt; 0) {
	var j:int = Math.random() * i;
	var temp:* = obj[--i];
	obj[i] = obj[j];
	obj[j] = temp;
}

Rather than taking a random value from the length of the list, you take a random value from the iterator which is decremeted each time the while loop is executed. This means that every time you are picking a random item from a smaller and smaller pool of items. I hope that makes sense!</description>
		<content:encoded><![CDATA[<p>Thanks for an interesting blog post. I was just looking into the Fisher-Yates algorithm myself.</p>
<p>I tried running your function multiple times over the array [1,2,3] and it&#8217;s displaying a bias towards certain permutations. Here is a sample of the number of each permutation I got over 100000 iterations:</p>
<p>[123] 14846<br />
[132] 18297<br />
[213] 18461<br />
[231] 15008<br />
[312] 18554<br />
[321] 14834</p>
<p>These biased values seem consistent with the naive implementation described here: <a href="http://www.codinghorror.com/blog/2007/12/the-danger-of-naivete.html" rel="nofollow">http://www.codinghorror.com/blog/2007/12/the-danger-of-naivete.html</a></p>
<p>This code seems to work better:</p>
<p>var i:int = obj.length;<br />
while (i &gt; 0) {<br />
	var j:int = Math.random() * i;<br />
	var temp:* = obj[--i];<br />
	obj[i] = obj[j];<br />
	obj[j] = temp;<br />
}</p>
<p>Rather than taking a random value from the length of the list, you take a random value from the iterator which is decremeted each time the while loop is executed. This means that every time you are picking a random item from a smaller and smaller pool of items. I hope that makes sense!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SD kaart &#8220;kapot&#8221;, foto&#8217;s gered! by Arie</title>
		<link>http://www.bonth.nl/2010/08/03/sd-kaart-kapot-fotos-gered/comment-page-1/#comment-1773</link>
		<dc:creator>Arie</dc:creator>
		<pubDate>Wed, 12 Jan 2011 19:35:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.bonth.nl/?p=355#comment-1773</guid>
		<description>Melissa, mijn pc en mijn mac konden beide de kaart niet meer lezen (ook computers van collega&#039;s niet). De bestanden waren binnen een week terug uit Duitsland.</description>
		<content:encoded><![CDATA[<p>Melissa, mijn pc en mijn mac konden beide de kaart niet meer lezen (ook computers van collega&#8217;s niet). De bestanden waren binnen een week terug uit Duitsland.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SD kaart &#8220;kapot&#8221;, foto&#8217;s gered! by Arie</title>
		<link>http://www.bonth.nl/2010/08/03/sd-kaart-kapot-fotos-gered/comment-page-1/#comment-1772</link>
		<dc:creator>Arie</dc:creator>
		<pubDate>Wed, 12 Jan 2011 19:34:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.bonth.nl/?p=355#comment-1772</guid>
		<description>Annedien, geen idee of die sd kaart nog te redden is. Je zou contact kunnen opnemen met Recoverfab in Duitsland. Ik heb geen vergelijkbaar bedrijf in Nederland gevonden, de meeste bedrijven in Nederland zijn gespecialiseerd in harddisk recovery en zijn erg prijzig.</description>
		<content:encoded><![CDATA[<p>Annedien, geen idee of die sd kaart nog te redden is. Je zou contact kunnen opnemen met Recoverfab in Duitsland. Ik heb geen vergelijkbaar bedrijf in Nederland gevonden, de meeste bedrijven in Nederland zijn gespecialiseerd in harddisk recovery en zijn erg prijzig.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on AS3 Vector shuffle or randomize by Arie</title>
		<link>http://www.bonth.nl/2010/07/25/as3-vector-shuffle-or-randomize/comment-page-1/#comment-1770</link>
		<dc:creator>Arie</dc:creator>
		<pubDate>Wed, 12 Jan 2011 13:48:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.bonth.nl/?p=325#comment-1770</guid>
		<description>Mike, thanks for noticing my typo. I changed the last line of code like you suggested.</description>
		<content:encoded><![CDATA[<p>Mike, thanks for noticing my typo. I changed the last line of code like you suggested.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SD kaart &#8220;kapot&#8221;, foto&#8217;s gered! by annedien janssen</title>
		<link>http://www.bonth.nl/2010/08/03/sd-kaart-kapot-fotos-gered/comment-page-1/#comment-1664</link>
		<dc:creator>annedien janssen</dc:creator>
		<pubDate>Sat, 01 Jan 2011 12:48:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.bonth.nl/?p=355#comment-1664</guid>
		<description>Hallo, 
Mijn sd kaart is stuk gegaan omdat me broer er op is gaan zitten, maar het zijn fotos van me vader zijn 50ste verjaardag.  Zouden ze  die ook kunnen redden? En ja als ik het opstuur is de kans nog dat hij kwijt raakt.  Heb je ook bedrijven in nederland gevonden? 

Gr annedien janssen</description>
		<content:encoded><![CDATA[<p>Hallo,<br />
Mijn sd kaart is stuk gegaan omdat me broer er op is gaan zitten, maar het zijn fotos van me vader zijn 50ste verjaardag.  Zouden ze  die ook kunnen redden? En ja als ik het opstuur is de kans nog dat hij kwijt raakt.  Heb je ook bedrijven in nederland gevonden? </p>
<p>Gr annedien janssen</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SD kaart &#8220;kapot&#8221;, foto&#8217;s gered! by melissa</title>
		<link>http://www.bonth.nl/2010/08/03/sd-kaart-kapot-fotos-gered/comment-page-1/#comment-1475</link>
		<dc:creator>melissa</dc:creator>
		<pubDate>Fri, 03 Dec 2010 14:55:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.bonth.nl/?p=355#comment-1475</guid>
		<description>hey ik heb hetzelfde aan de hand nu 
mijn kaart je heeft het ook begeven en heb er ook een deel foto&#039;s opstaan die ik wil hebben 
hoelang duurde het vooraleer je de foto&#039;s had 
en kon je pc de kaart ook niet meer lezen?
gr</description>
		<content:encoded><![CDATA[<p>hey ik heb hetzelfde aan de hand nu<br />
mijn kaart je heeft het ook begeven en heb er ook een deel foto&#8217;s opstaan die ik wil hebben<br />
hoelang duurde het vooraleer je de foto&#8217;s had<br />
en kon je pc de kaart ook niet meer lezen?<br />
gr</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on AS3 Vector shuffle or randomize by Joe Billman</title>
		<link>http://www.bonth.nl/2010/07/25/as3-vector-shuffle-or-randomize/comment-page-1/#comment-1433</link>
		<dc:creator>Joe Billman</dc:creator>
		<pubDate>Sun, 21 Nov 2010 05:51:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.bonth.nl/?p=325#comment-1433</guid>
		<description>Thanks for the great code snippet! I was looking for a good way to shuffle a Vector.</description>
		<content:encoded><![CDATA[<p>Thanks for the great code snippet! I was looking for a good way to shuffle a Vector.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on AS3 Vector shuffle or randomize by Mike</title>
		<link>http://www.bonth.nl/2010/07/25/as3-vector-shuffle-or-randomize/comment-page-1/#comment-1173</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Sat, 11 Sep 2010 20:21:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.bonth.nl/?p=325#comment-1173</guid>
		<description>Great article!
I noticed there is a slight typo in the last line of this post.
Math.round(Rndm.random()*(inVector.length-1));
should be
Math.round(Math.random()*(inVector.length-1));</description>
		<content:encoded><![CDATA[<p>Great article!<br />
I noticed there is a slight typo in the last line of this post.<br />
Math.round(Rndm.random()*(inVector.length-1));<br />
should be<br />
Math.round(Math.random()*(inVector.length-1));</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on AS3 Vector shuffle or randomize by Philip Bulley</title>
		<link>http://www.bonth.nl/2010/07/25/as3-vector-shuffle-or-randomize/comment-page-1/#comment-1131</link>
		<dc:creator>Philip Bulley</dc:creator>
		<pubDate>Mon, 23 Aug 2010 15:12:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.bonth.nl/?p=325#comment-1131</guid>
		<description>Hey, I came across the same Vector shuffle issue around the time you did too :) Here&#039;s was my solution:

http://www.milkisevil.com/blog/2010/as3-vector-shuffle-randomize/

In think yours will be more efficient as I&#039;m just hijacking the vector sort method.

By the way, I tried casting a Vector.int to Vector.*, but the vector becomes null within the shuffle method. So did this actually work for you?</description>
		<content:encoded><![CDATA[<p>Hey, I came across the same Vector shuffle issue around the time you did too <img src='http://www.bonth.nl/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Here&#8217;s was my solution:</p>
<p><a href="http://www.milkisevil.com/blog/2010/as3-vector-shuffle-randomize/" rel="nofollow">http://www.milkisevil.com/blog/2010/as3-vector-shuffle-randomize/</a></p>
<p>In think yours will be more efficient as I&#8217;m just hijacking the vector sort method.</p>
<p>By the way, I tried casting a Vector.int to Vector.*, but the vector becomes null within the shuffle method. So did this actually work for you?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

