<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lambda &#187; JavaScript</title>
	<atom:link href="http://sroucheray.org/blog/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://sroucheray.org/blog</link>
	<description>Stephane Roucheray's trivial work and thoughts</description>
	<lastBuildDate>Mon, 23 Aug 2010 08:13:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Array.sort() should not be used to shuffle an array</title>
		<link>http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/</link>
		<comments>http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 12:48:43 +0000</pubDate>
		<dc:creator>Stéphane Roucheray</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[Randomize]]></category>
		<category><![CDATA[Sort]]></category>

		<guid isPermaLink="false">http://sroucheray.org/blog/?p=375</guid>
		<description><![CDATA[When a developer searches the web for an algorithm to shuffle an array in JavaScript or ActionScript, he will surely find a way to achieve that using the <samp>Array.sort()</samp> method (see references : <a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/sort">JavaScript</a>, <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/Array.html#sort%28%29">ActionScript 3</a>)...]]></description>
			<content:encoded><![CDATA[When a developer searches the web for an algorithm to shuffle an array in JavaScript or ActionScript, he will surely find a way to achieve that using the <samp>Array.sort()</samp> method (see references : <a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/sort">JavaScript</a>, <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/Array.html#sort%28%29">ActionScript 3</a>). While this method is intended to sort an array, it can also be used to randomize it (!). In general, here and there, the following algorithm comes forth :

<div class="codecolorer-container javascript dawn nowrap" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #006600; font-style: italic;">/**<br />
&nbsp;* Add a randomize method to the Array object prototype<br />
&nbsp;* Usage : <br />
&nbsp;* &nbsp;var tmpArray = [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;d&quot;, &quot;e&quot;];<br />
&nbsp;* &nbsp;tmpArray.randomize();<br />
&nbsp;*/</span><br />
Array.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">randomize</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">sort</span><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>a<span style="color: #339933;">,</span>b<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> Math.<span style="color: #660066;">round</span><span style="color: #009900;">&#40;</span> Math.<span style="color: #660066;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #CC0000;">2</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></div>

The principle of this implementation is simple. It takes advantage of the comparison <samp>Function</samp> that can be passed to the <samp>Array.sort()</samp> method. This function defines the sort order. It will be passed two objects (from the array) <samp>a</samp> and <samp>b</samp>, compare them and return <samp>-1</samp>, <samp>0</samp> or <samp>1</samp> whether <samp>a</samp> is less, equal or greater than <samp>b</samp>. The idea, to shuffle an array, is to randomly output <samp>-1</samp>, <samp>0</samp> or <samp>1</samp>. This is the purpose of the expression <samp>Math.round( Math.random() * 2 ) &#8211; 1</samp>. This idea is bad.

<h2>Shuffling an array with <samp>Array.sort()</samp> results in&#8230; a not so shuffled array</h2>

Implementing a shuffle function on arrays, this way, is bad. At first glance it seems to produce well randomized arrays, but the random distribution is not uniform. I will illustrate this in a minute. Before that, give a look at the table below. It&#8217;s interactive. When you click start, it will run the following process :
<ol>
	<li>
	Create an array with ten letters in alphabetical orders from A to J

<div class="codecolorer-container javascript dawn nowrap" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> simpleArray <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;A&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;B&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;C&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;D&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;E&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;F&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;G&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;H&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;I&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;J&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></div></div>

</li>
	<li>Copy this array in a second array</li>
	<li>Run a shuffle algorithm against the second array</li>
	<li>Look where the letters are in the second array and record their position in the table columns</li>
	<li>Return to the step 2 and start the process again until a certain number of iterations has been reached</li>
</ol>

This repetitive process is pretty simple. It is not intended to give a mathematical evidence of the problem but to illustrate the consequences of a badly implemented shuffle algorithm. Note that the copy at step 2 is always made from the original array (not from the last shuffled array). 

In this first example and to make sure you understand how this table work, step 3 is bypassed. Thus the copied array is always exactly the same as the original one. Click on <em>Start</em> button will launch the process (The number of iterations can be changed).

<div id="noshuffle"></div>

Normally, at the end of the process, you should see a table full of zeros with only the diagonal (top-left / bottom-right) filled with the number of iterations. It means that, at every steps, letters in the second array are at the same position than in the first one. This is what was expected because there is no shuffle.

Let&#8217;s do the same thing but now step 3 uses the shuffle algorithm we have seen before.

<div id="arraysort"></div>

The result is interesting, isn&#8217;t it ? The position of letters has well been set randomly over iterations. Almost every cells in the table are filled with numbers. Let&#8217;s give a closer look. Actually, the nearer a cell is from the diagonal (top-left / bottom-right) the higher its number. Moreover there are still zeros in some cells far from this diagonal. Obviously, it means letters are more likely to be near their original position, after a shuffle.

<h2>How to better shuffle an array with <samp>Array.sort()</samp> ?</h2>

We said the comparison function returned randomly either <samp>-1</samp>, <samp>0</samp> or <samp>1</samp>. What exactly happens in each case ? Let&#8217;s quote the Mozilla developer Center for the <a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/sort#Description"><samp>Array.sort()</samp> comparison function description</a>

<div style="padding:1em 4em; font-size:1.1em;">
If <samp>compareFunction</samp> is supplied, the array elements are sorted according to the return value of the compare function. If a and b are two elements being compared, then:
<ul>
<li>If <samp>compareFunction(a, b)</samp> is less than 0, sort <samp>a</samp> to a lower index than <samp>b</samp>.</li>
<li>If <samp>compareFunction(a, b)</samp> returns 0, leave <samp>a</samp> and <samp>b</samp> unchanged with respect to each other, but sorted with respect to all different elements. Note: the ECMAscript standard does not guarantee this behaviour, and thus not all browsers (e.g. Mozilla versions dating back to at least 2003) respect this.</li>
<li>If <samp>compareFunction(a, b)</samp> is greater than 0, sort <samp>b</samp> to a lower index than <samp>a</samp>.</li>
</ul>
</div>

The <samp>Array.sort()</samp> method uses a <a href="http://en.wikipedia.org/wiki/Bubble_sort">Bubble Sort algorithm</a>. Roughly, it steps through array elements and compare each one with its next adjacent element. It swaps the elements when the comparison function return <samp>1</samp>. What does it do when the comparison function return <samp>0</samp> or <samp>-1</samp> ? Actually nothing and here is the issue ! As the comparison function randomly generate <samp>-1</samp>, <samp>0</samp> or <samp>1</samp>, each of those numbers has the same chance to arise. Unfortunately a letter can change its position only if <samp>1</samp> arises. It means that a letter has twice the chance not to move than to move !

So to resolve the issue the comparison function must not generate 3 numbers randomly but only two : <samp>0</samp> or <samp>1</samp>. Thus a letter has the same chance to move than to stay in place. Below is the new implementation (Note that it is simpler than the previous one).

<div class="codecolorer-container javascript dawn nowrap" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #006600; font-style: italic;">/**<br />
&nbsp;* Add a randomize method to the Array object prototype<br />
&nbsp;* Usage : <br />
&nbsp;* &nbsp;var tmpArray = [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;d&quot;, &quot;e&quot;];<br />
&nbsp;* &nbsp;tmpArray.randomize2();<br />
&nbsp;*/</span><br />
Array.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">randomize2</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">sort</span><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>a<span style="color: #339933;">,</span>b<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> &nbsp;Math.<span style="color: #660066;">round</span><span style="color: #009900;">&#40;</span> Math.<span style="color: #660066;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></div>

The following table shows the result of this new implementation :

<div id="arraysort2"></div>

This result seems much more random than the previous one. There are much less zeros filling the table, however we can still see a kind of diagonal pattern where higher numbers seem much more on the diagonal. It is less obvious than before but still there. The reason for this can be found in the Bubble Sort algorithm and its implementation. Think about if A &lt; B and B &lt; C then not need to compare A and C.Thus, some comparisons are not done and optimization in code results in a greater efficiency to sort but an issue when shuffle.

<em>Update : it seems there are differences between browsers. Notably, the method explained here is more accurate in Firefox but less in IE. Both gives bad uniform random, though. Not tested in other browsers</em>

<h2>Shuffle arrays the good way</h2>
Fortunately it is not required to use <samp>Array.sort()</samp> to shuffle an array. Implement a shuffle function using <a href="http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle">Fisher-Yates algorithm</a> is better and still easy.

Below is the code implementing a shuffle function using the Fisher-Yates algorithm. This algorithm provides uniform random.

<div class="codecolorer-container javascript dawn nowrap" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #006600; font-style: italic;">/*<br />
&nbsp;* Add a shuffle function to Array object prototype<br />
&nbsp;* Usage : <br />
&nbsp;* &nbsp;var tmpArray = [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;d&quot;, &quot;e&quot;];<br />
&nbsp;* &nbsp;tmpArray.shuffle();<br />
&nbsp;*/</span><br />
Array.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">shuffle</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">length</span><span style="color: #339933;">,</span> j<span style="color: #339933;">,</span> temp<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> i <span style="color: #339933;">==</span> <span style="color: #CC0000;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">--</span>i <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; j <span style="color: #339933;">=</span> Math.<span style="color: #660066;">floor</span><span style="color: #009900;">&#40;</span> Math.<span style="color: #660066;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #009900;">&#40;</span> i <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; temp <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> temp<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></div>

To prove the superiority of Fisher-Yates algorithm in <samp>Array.sort()</samp> implementation play with the table below.

<div id="shuffle"></div>

With these results, it is obvious that this algorithm is far more efficient in distributing uniformly the letters in the array over iterations than <samp>Array.sort()</samp> style algorithms. Distribution is much more the same across cells.

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/&amp;title=Array.sort%28%29+should+not+be+used+to+shuffle+an+array" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/&amp;title=Array.sort%28%29+should+not+be+used+to+shuffle+an+array" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/&amp;t=Array.sort%28%29+should+not+be+used+to+shuffle+an+array" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/&amp;title=Array.sort%28%29+should+not+be+used+to+shuffle+an+array&amp;summary=When%20a%20developer%20searches%20the%20web%20for%20an%20algorithm%20to%20shuffle%20an%20array%20in%20JavaScript%20or%20ActionScript%2C%20he%20will%20surely%20find%20a%20way%20to%20achieve%20that%20using%20the%20Array.sort%28%29%20method%20%28see%20references%20%3A%20JavaScript%2C%20ActionScript%203%29...&amp;source=Lambda" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/&amp;title=Array.sort%28%29+should+not+be+used+to+shuffle+an+array" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/&amp;title=Array.sort%28%29+should+not+be+used+to+shuffle+an+array" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Array.sort%28%29+should+not+be+used+to+shuffle+an+array+-+http://bit.ly/diyrW4&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/&amp;submitHeadline=Array.sort%28%29+should+not+be+used+to+shuffle+an+array&amp;submitSummary=When%20a%20developer%20searches%20the%20web%20for%20an%20algorithm%20to%20shuffle%20an%20array%20in%20JavaScript%20or%20ActionScript%2C%20he%20will%20surely%20find%20a%20way%20to%20achieve%20that%20using%20the%20Array.sort%28%29%20method%20%28see%20references%20%3A%20JavaScript%2C%20ActionScript%203%29...&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>How to get a mouse hand over a TextField in AS3 ?</title>
		<link>http://sroucheray.org/blog/2009/11/how-to-get-a-mouse-hand-over-a-textfield-in-as3/</link>
		<comments>http://sroucheray.org/blog/2009/11/how-to-get-a-mouse-hand-over-a-textfield-in-as3/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 09:16:49 +0000</pubDate>
		<dc:creator>Stéphane Roucheray</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Hand]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mouse]]></category>
		<category><![CDATA[MouseOver]]></category>

		<guid isPermaLink="false">http://sroucheray.org/blog/?p=363</guid>
		<description><![CDATA[It's pretty simple...]]></description>
			<content:encoded><![CDATA[It&#8217;s pretty simple, <tt>buttonMode</tt> and <tt>mouseChildren</tt> properties of the <tt><a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/text/TextField.html">TextField</a></tt> parent should be set like that :

<div class="codecolorer-container actionscript dawn nowrap" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">var</span> sprite : Sprite = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">textField</span> : <span style="color: #0066CC;">TextField</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextField</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
sprite.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">textField</span><span style="color: #66cc66;">&#41;</span>;<br />
<br />
sprite.<span style="color: #006600;">buttonMode</span> = <span style="color: #000000; font-weight: bold;">true</span>;<br />
sprite.<span style="color: #006600;">mouseChildren</span> = <span style="color: #000000; font-weight: bold;">false</span>;</div></div>



<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://sroucheray.org/blog/2009/11/how-to-get-a-mouse-hand-over-a-textfield-in-as3/&amp;title=How+to+get+a+mouse+hand+over+a+TextField+in+AS3+%3F" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://sroucheray.org/blog/2009/11/how-to-get-a-mouse-hand-over-a-textfield-in-as3/&amp;title=How+to+get+a+mouse+hand+over+a+TextField+in+AS3+%3F" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://sroucheray.org/blog/2009/11/how-to-get-a-mouse-hand-over-a-textfield-in-as3/&amp;t=How+to+get+a+mouse+hand+over+a+TextField+in+AS3+%3F" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://sroucheray.org/blog/2009/11/how-to-get-a-mouse-hand-over-a-textfield-in-as3/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://sroucheray.org/blog/2009/11/how-to-get-a-mouse-hand-over-a-textfield-in-as3/&amp;title=How+to+get+a+mouse+hand+over+a+TextField+in+AS3+%3F&amp;summary=It%27s%20pretty%20simple...&amp;source=Lambda" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://sroucheray.org/blog/2009/11/how-to-get-a-mouse-hand-over-a-textfield-in-as3/&amp;title=How+to+get+a+mouse+hand+over+a+TextField+in+AS3+%3F" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://sroucheray.org/blog/2009/11/how-to-get-a-mouse-hand-over-a-textfield-in-as3/&amp;title=How+to+get+a+mouse+hand+over+a+TextField+in+AS3+%3F" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+to+get+a+mouse+hand+over+a+TextField+in+AS3+%3F+-+http://bit.ly/96dz7T&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://sroucheray.org/blog/2009/11/how-to-get-a-mouse-hand-over-a-textfield-in-as3/&amp;submitHeadline=How+to+get+a+mouse+hand+over+a+TextField+in+AS3+%3F&amp;submitSummary=It%27s%20pretty%20simple...&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://sroucheray.org/blog/2009/11/how-to-get-a-mouse-hand-over-a-textfield-in-as3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML 5 support workarounds and fallbacks</title>
		<link>http://sroucheray.org/blog/2009/10/html5-support-workarounds-and-fallbacks/</link>
		<comments>http://sroucheray.org/blog/2009/10/html5-support-workarounds-and-fallbacks/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 12:58:42 +0000</pubDate>
		<dc:creator>Stéphane Roucheray</dc:creator>
				<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://sroucheray.org/blog/?p=305</guid>
		<description><![CDATA[HTML 5 is a kind of revolution in Web development nowadays, but is not well supported still. I put together here a list of workarounds and fallbacks you can use to start coding HTML5 while keeping a good cross browsers support. If you have suggestions just drop a comment !]]></description>
			<content:encoded><![CDATA[<em>Last update Thursday, October 8, 2009</em>

HTML 5 is a kind of revolution in Web development nowadays, but is not well supported still. I put together here a list of workarounds and fallbacks you can use to start coding HTML5 while keeping a good cross browsers support. If you have suggestions just drop a comment !

<ul>	
<li><a href="#html5-tags">HTML5 tags and IE</a></li>
<li><a href="#audio">Audio</a></li>
<li><a href="#canvas">Canvas</a></li>
<li><a href="#svg">SVG</a></li>
<li><a href="#video">Video</a></li>
<li><a href="#web-forms">Web forms 2.0</a></li>
<li><a href="#web-workers">Web Workers</a></li>

</ul>

<h2 id="html5-tags">HTML5 tags and IE</h2>
IE will fail to style tags it does not recognize, especially the new HTML5 semantic tags like <tt>section</tt>, <tt>article</tt>, <tt>aside</tt>&#8230; The workaround is to help it identify those tags by using this small piece of JavaScript :

<div class="codecolorer-container javascript dawn nowrap" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;section&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>

Several JavaScript libraries help to detect  <a href="http://www.modernizr.com/">http://www.modernizr.com/</a> or even to fix <a href="http://code.google.com/p/html5shiv/">http://code.google.com/p/html5shiv/</a> HTML5 support in IE.

Source : <a href="http://blog.whatwg.org/supporting-new-elements-in-ie">http://blog.whatwg.org/supporting-new-elements-in-ie</a>

<h2 id="audio">Audio</h2>
A JavaScript exists which tests the <tt>audio</tt> element and the <tt>Audio()</tt> object support :
<a href="http://www.happyworm.com/jquery/jplayer/HTML5.Audio.Support/">http://www.happyworm.com/jquery/jplayer/HTML5.Audio.Support/</a>

<h2 id="canvas">Canvas</h2>
A JavaScript library exists to simulate <tt>canvas</tt> tag in Internet Explorer : <a href="http://code.google.com/p/explorercanvas/">http://code.google.com/p/explorercanvas/</a> 

<h2 id="svg">SVG</h2>
Google has developped a JavaScript library to simulate SVG in browser that does not support it <a href="http://code.google.com/p/svgweb/">http://code.google.com/p/svgweb/</a>

<h2 id="video">Video</h2>
There are several support levels of the HTML 5 <tt>video</tt> tag. Internet Explorer does not support it at all. Firefox, Safari and Chrome, in there last release, support it but with different codecs. As a result the best way to use the video tag is : first, by providing sources with different codecs, second by providing a Flash fallback :

<div class="codecolorer-container html4strict dawn nowrap" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;video controls&gt;</span><br />
<span style="color: #009900;">&lt;source <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;zombie.ogg&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;video/ogg&quot;</span><span style="color: #66cc66;">/</span>&gt;</span><br />
<span style="color: #009900;">&lt;source <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;zombie.mp4&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;video/mp4&quot;</span><span style="color: #66cc66;">/</span>&gt;</span><br />
<span style="color: #009900;">&lt;embed <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://blip.tv/play/AYGLzBmU8hw&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;application/x-shockwave-flash&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;500&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;396&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;allowscriptaccess<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;always&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;allowfullscreen<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #66cc66;">/</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>video&gt;</span></div></div>

This fallback should be supported by all the major browsers. If you require more support for iPhone, Quicktime&#8230; you should give a look at other solutions like : <a href="http://camendesign.com/code/video_for_everybody">Video for everybody</a>

Sources : 
<a href="http://hacks.mozilla.org/2009/06/html5-video-fallbacks-markup/">http://hacks.mozilla.org/2009/06/html5-video-fallbacks-markup/</a>
<a href="https://developer.mozilla.org/En/Using_audio_and_video_in_Firefox">https://developer.mozilla.org/En/Using_audio_and_video_in_Firefox</a>

<h2 id="web-forms">Web Forms 2.0</h2>
A JavaScript library exists to emulate Web Forms 2.0 : <a href="http://code.google.com/p/webforms2/">http://code.google.com/p/webforms2/</a>.
More information on Web Forms 2.0 emulation can be found here : <a href="http://wiki.whatwg.org/wiki/Implementations_in_Web_browsers">http://wiki.whatwg.org/wiki/Implementations_in_Web_browsers</a>

<h2 id="web-workers">Web workers</h2>
The ability to do JavaScript threading is partially emulated by a JavaScript library : <a href="http://code.google.com/p/fakeworker-js/">http://code.google.com/p/fakeworker-js/</a>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://sroucheray.org/blog/2009/10/html5-support-workarounds-and-fallbacks/&amp;title=HTML+5+support+workarounds+and+fallbacks" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://sroucheray.org/blog/2009/10/html5-support-workarounds-and-fallbacks/&amp;title=HTML+5+support+workarounds+and+fallbacks" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://sroucheray.org/blog/2009/10/html5-support-workarounds-and-fallbacks/&amp;t=HTML+5+support+workarounds+and+fallbacks" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://sroucheray.org/blog/2009/10/html5-support-workarounds-and-fallbacks/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://sroucheray.org/blog/2009/10/html5-support-workarounds-and-fallbacks/&amp;title=HTML+5+support+workarounds+and+fallbacks&amp;summary=HTML%205%20is%20a%20kind%20of%20revolution%20in%20Web%20development%20nowadays%2C%20but%20is%20not%20well%20supported%20still.%20I%20put%20together%20here%20a%20list%20of%20workarounds%20and%20fallbacks%20you%20can%20use%20to%20start%20coding%20HTML5%20while%20keeping%20a%20good%20cross%20browsers%20support.%20If%20you%20have%20suggestions%20just%20drop%20a%20comment%20%21&amp;source=Lambda" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://sroucheray.org/blog/2009/10/html5-support-workarounds-and-fallbacks/&amp;title=HTML+5+support+workarounds+and+fallbacks" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://sroucheray.org/blog/2009/10/html5-support-workarounds-and-fallbacks/&amp;title=HTML+5+support+workarounds+and+fallbacks" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=HTML+5+support+workarounds+and+fallbacks+-+http://bit.ly/aVVLHR&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://sroucheray.org/blog/2009/10/html5-support-workarounds-and-fallbacks/&amp;submitHeadline=HTML+5+support+workarounds+and+fallbacks&amp;submitSummary=HTML%205%20is%20a%20kind%20of%20revolution%20in%20Web%20development%20nowadays%2C%20but%20is%20not%20well%20supported%20still.%20I%20put%20together%20here%20a%20list%20of%20workarounds%20and%20fallbacks%20you%20can%20use%20to%20start%20coding%20HTML5%20while%20keeping%20a%20good%20cross%20browsers%20support.%20If%20you%20have%20suggestions%20just%20drop%20a%20comment%20%21&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://sroucheray.org/blog/2009/10/html5-support-workarounds-and-fallbacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Twitter API plugin</title>
		<link>http://sroucheray.org/blog/2009/07/jquery-twitter-api-plugin/</link>
		<comments>http://sroucheray.org/blog/2009/07/jquery-twitter-api-plugin/#comments</comments>
		<pubDate>Sat, 11 Jul 2009 13:02:04 +0000</pubDate>
		<dc:creator>Stéphane Roucheray</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://sroucheray.org/blog/?p=186</guid>
		<description><![CDATA[I have released a simple Twitter public API for jQuery. It's Open Source and available at Google Code.]]></description>
			<content:encoded><![CDATA[I have released a simple Twitter public API for jQuery. Code and examples are open source and can be download here : <a href="http://code.google.com/p/jquery-twitter-api/">http://code.google.com/p/jquery-twitter-api/</a>.

<em>NB : informations requiring authentication are not accessible to JavaScript inside classical Web pages because of the <a href="https://developer.mozilla.org/en/Same_origin_policy_for_JavaScript">same origin policy restriction</a>. Thus this plugin is only intended to access publicly available data.</em>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://sroucheray.org/blog/2009/07/jquery-twitter-api-plugin/&amp;title=jQuery+Twitter+API+plugin" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://sroucheray.org/blog/2009/07/jquery-twitter-api-plugin/&amp;title=jQuery+Twitter+API+plugin" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://sroucheray.org/blog/2009/07/jquery-twitter-api-plugin/&amp;t=jQuery+Twitter+API+plugin" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://sroucheray.org/blog/2009/07/jquery-twitter-api-plugin/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://sroucheray.org/blog/2009/07/jquery-twitter-api-plugin/&amp;title=jQuery+Twitter+API+plugin&amp;summary=I%20have%20released%20a%20simple%20Twitter%20public%20API%20for%20jQuery.%20It%27s%20Open%20Source%20and%20available%20at%20Google%20Code.&amp;source=Lambda" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://sroucheray.org/blog/2009/07/jquery-twitter-api-plugin/&amp;title=jQuery+Twitter+API+plugin" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://sroucheray.org/blog/2009/07/jquery-twitter-api-plugin/&amp;title=jQuery+Twitter+API+plugin" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=jQuery+Twitter+API+plugin+-+http://bit.ly/dt62hr&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://sroucheray.org/blog/2009/07/jquery-twitter-api-plugin/&amp;submitHeadline=jQuery+Twitter+API+plugin&amp;submitSummary=I%20have%20released%20a%20simple%20Twitter%20public%20API%20for%20jQuery.%20It%27s%20Open%20Source%20and%20available%20at%20Google%20Code.&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://sroucheray.org/blog/2009/07/jquery-twitter-api-plugin/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>A JavaScript implementation of the Content Aware Image Resizing algorithm</title>
		<link>http://sroucheray.org/blog/2009/06/a-javascript-implementation-of-the-content-aware-image-resizing-algorithm/</link>
		<comments>http://sroucheray.org/blog/2009/06/a-javascript-implementation-of-the-content-aware-image-resizing-algorithm/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 19:51:38 +0000</pubDate>
		<dc:creator>Stéphane Roucheray</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Pims World]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[canvas]]></category>

		<guid isPermaLink="false">http://sroucheray.org/blog/2009/06/a-javascript-implementation-of-the-content-aware-image-resizing-algorithm/</guid>
		<description><![CDATA[The famous algorithm implemented with JavaScript on Pims World Labs...]]></description>
			<content:encoded><![CDATA[<a href="http://labs.pimsworld.org/2009/05/a-javascript-implementation-of-the-content-aware-image-resizing-algorithm/" target="_self">http://labs.pimsworld.org/2009/05/a-javascript-implementation-of-the-content-aware-image-resizing-algorithm/</a>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://sroucheray.org/blog/2009/06/a-javascript-implementation-of-the-content-aware-image-resizing-algorithm/&amp;title=A+JavaScript+implementation+of+the+Content+Aware+Image+Resizing+algorithm" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://sroucheray.org/blog/2009/06/a-javascript-implementation-of-the-content-aware-image-resizing-algorithm/&amp;title=A+JavaScript+implementation+of+the+Content+Aware+Image+Resizing+algorithm" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://sroucheray.org/blog/2009/06/a-javascript-implementation-of-the-content-aware-image-resizing-algorithm/&amp;t=A+JavaScript+implementation+of+the+Content+Aware+Image+Resizing+algorithm" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://sroucheray.org/blog/2009/06/a-javascript-implementation-of-the-content-aware-image-resizing-algorithm/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://sroucheray.org/blog/2009/06/a-javascript-implementation-of-the-content-aware-image-resizing-algorithm/&amp;title=A+JavaScript+implementation+of+the+Content+Aware+Image+Resizing+algorithm&amp;summary=The%20famous%20algorithm%20implemented%20with%20JavaScript%20on%20Pims%20World%20Labs...&amp;source=Lambda" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://sroucheray.org/blog/2009/06/a-javascript-implementation-of-the-content-aware-image-resizing-algorithm/&amp;title=A+JavaScript+implementation+of+the+Content+Aware+Image+Resizing+algorithm" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://sroucheray.org/blog/2009/06/a-javascript-implementation-of-the-content-aware-image-resizing-algorithm/&amp;title=A+JavaScript+implementation+of+the+Content+Aware+Image+Resizing+algorithm" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=A+JavaScript+implementation+of+the+Content+Aware+Image+Resizing+algorithm+-+http://bit.ly/9CWOLa&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://sroucheray.org/blog/2009/06/a-javascript-implementation-of-the-content-aware-image-resizing-algorithm/&amp;submitHeadline=A+JavaScript+implementation+of+the+Content+Aware+Image+Resizing+algorithm&amp;submitSummary=The%20famous%20algorithm%20implemented%20with%20JavaScript%20on%20Pims%20World%20Labs...&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://sroucheray.org/blog/2009/06/a-javascript-implementation-of-the-content-aware-image-resizing-algorithm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firefox Native Content Aware Image Resizing</title>
		<link>http://sroucheray.org/blog/2009/06/firefox-native-content-aware-image-resizing/</link>
		<comments>http://sroucheray.org/blog/2009/06/firefox-native-content-aware-image-resizing/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 19:51:37 +0000</pubDate>
		<dc:creator>Stéphane Roucheray</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Pims World]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://sroucheray.org/blog/2009/06/firefox-native-content-aware-image-resizing/</guid>
		<description><![CDATA[First attempt to implement the famous algorithm with JavaScript on Pims World Labs...]]></description>
			<content:encoded><![CDATA[<a href="http://labs.pimsworld.org/2009/04/firefox-native-content-aware-image-resizing/" target="_self">http://labs.pimsworld.org/2009/04/firefox-native-content-aware-image-resizing/</a>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://sroucheray.org/blog/2009/06/firefox-native-content-aware-image-resizing/&amp;title=Firefox+Native+Content+Aware+Image+Resizing" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://sroucheray.org/blog/2009/06/firefox-native-content-aware-image-resizing/&amp;title=Firefox+Native+Content+Aware+Image+Resizing" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://sroucheray.org/blog/2009/06/firefox-native-content-aware-image-resizing/&amp;t=Firefox+Native+Content+Aware+Image+Resizing" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://sroucheray.org/blog/2009/06/firefox-native-content-aware-image-resizing/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://sroucheray.org/blog/2009/06/firefox-native-content-aware-image-resizing/&amp;title=Firefox+Native+Content+Aware+Image+Resizing&amp;summary=First%20attempt%20to%20implement%20the%20famous%20algorithm%20with%20JavaScript%20on%20Pims%20World%20Labs...&amp;source=Lambda" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://sroucheray.org/blog/2009/06/firefox-native-content-aware-image-resizing/&amp;title=Firefox+Native+Content+Aware+Image+Resizing" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://sroucheray.org/blog/2009/06/firefox-native-content-aware-image-resizing/&amp;title=Firefox+Native+Content+Aware+Image+Resizing" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Firefox+Native+Content+Aware+Image+Resizing+-+http://bit.ly/ap2rWY&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://sroucheray.org/blog/2009/06/firefox-native-content-aware-image-resizing/&amp;submitHeadline=Firefox+Native+Content+Aware+Image+Resizing&amp;submitSummary=First%20attempt%20to%20implement%20the%20famous%20algorithm%20with%20JavaScript%20on%20Pims%20World%20Labs...&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://sroucheray.org/blog/2009/06/firefox-native-content-aware-image-resizing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript, la bible en vidéo</title>
		<link>http://sroucheray.org/blog/2009/06/javascript-la-bible-en-video/</link>
		<comments>http://sroucheray.org/blog/2009/06/javascript-la-bible-en-video/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 19:51:36 +0000</pubDate>
		<dc:creator>Stéphane Roucheray</dc:creator>
				<category><![CDATA[Pims World]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://sroucheray.org/blog/2009/06/javascript-la-bible-en-video/</guid>
		<description><![CDATA[The JavaScript bible in video on Pims World Labs (French)... ]]></description>
			<content:encoded><![CDATA[<a href="http://labs.pimsworld.org/2009/02/javascript-la-bible-en-video/" target="_self">http://labs.pimsworld.org/2009/02/javascript-la-bible-en-video/</a>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://sroucheray.org/blog/2009/06/javascript-la-bible-en-video/&amp;title=JavaScript%2C+la+bible+en+vid%C3%A9o" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://sroucheray.org/blog/2009/06/javascript-la-bible-en-video/&amp;title=JavaScript%2C+la+bible+en+vid%C3%A9o" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://sroucheray.org/blog/2009/06/javascript-la-bible-en-video/&amp;t=JavaScript%2C+la+bible+en+vid%C3%A9o" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://sroucheray.org/blog/2009/06/javascript-la-bible-en-video/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://sroucheray.org/blog/2009/06/javascript-la-bible-en-video/&amp;title=JavaScript%2C+la+bible+en+vid%C3%A9o&amp;summary=The%20JavaScript%20bible%20in%20video%20on%20Pims%20World%20Labs%20%28French%29...%20&amp;source=Lambda" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://sroucheray.org/blog/2009/06/javascript-la-bible-en-video/&amp;title=JavaScript%2C+la+bible+en+vid%C3%A9o" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://sroucheray.org/blog/2009/06/javascript-la-bible-en-video/&amp;title=JavaScript%2C+la+bible+en+vid%C3%A9o" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=JavaScript%2C+la+bible+en+vid%C3%A9o+-+http://bit.ly/bX0kFt&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://sroucheray.org/blog/2009/06/javascript-la-bible-en-video/&amp;submitHeadline=JavaScript%2C+la+bible+en+vid%C3%A9o&amp;submitSummary=The%20JavaScript%20bible%20in%20video%20on%20Pims%20World%20Labs%20%28French%29...%20&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://sroucheray.org/blog/2009/06/javascript-la-bible-en-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Petite histoire d’une formule mathématique discrète</title>
		<link>http://sroucheray.org/blog/2009/06/petite-histoire-d%e2%80%99une-formule-mathematique-discrete/</link>
		<comments>http://sroucheray.org/blog/2009/06/petite-histoire-d%e2%80%99une-formule-mathematique-discrete/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 19:51:36 +0000</pubDate>
		<dc:creator>Stéphane Roucheray</dc:creator>
				<category><![CDATA[Pims World]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://sroucheray.org/blog/2009/06/petite-histoire-d%e2%80%99une-formule-mathematique-discrete/</guid>
		<description><![CDATA[A little story about a mathematical formula on Pims World Labs (French)]]></description>
			<content:encoded><![CDATA[<a href="http://labs.pimsworld.org/2009/02/petite-histoire-dune-formule-mathematique-discrete/" target="_self">http://labs.pimsworld.org/2009/02/petite-histoire-dune-formule-mathematique-discrete/</a>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://sroucheray.org/blog/2009/06/petite-histoire-d%e2%80%99une-formule-mathematique-discrete/&amp;title=Petite+histoire+d%E2%80%99une+formule+math%C3%A9matique+discr%C3%A8te" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://sroucheray.org/blog/2009/06/petite-histoire-d%e2%80%99une-formule-mathematique-discrete/&amp;title=Petite+histoire+d%E2%80%99une+formule+math%C3%A9matique+discr%C3%A8te" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://sroucheray.org/blog/2009/06/petite-histoire-d%e2%80%99une-formule-mathematique-discrete/&amp;t=Petite+histoire+d%E2%80%99une+formule+math%C3%A9matique+discr%C3%A8te" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://sroucheray.org/blog/2009/06/petite-histoire-d%e2%80%99une-formule-mathematique-discrete/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://sroucheray.org/blog/2009/06/petite-histoire-d%e2%80%99une-formule-mathematique-discrete/&amp;title=Petite+histoire+d%E2%80%99une+formule+math%C3%A9matique+discr%C3%A8te&amp;summary=A%20little%20story%20about%20a%20mathematical%20formula%20on%20Pims%20World%20Labs%20%28French%29&amp;source=Lambda" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://sroucheray.org/blog/2009/06/petite-histoire-d%e2%80%99une-formule-mathematique-discrete/&amp;title=Petite+histoire+d%E2%80%99une+formule+math%C3%A9matique+discr%C3%A8te" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://sroucheray.org/blog/2009/06/petite-histoire-d%e2%80%99une-formule-mathematique-discrete/&amp;title=Petite+histoire+d%E2%80%99une+formule+math%C3%A9matique+discr%C3%A8te" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Petite+histoire+d%E2%80%99une+formule+math%C3%A9matique+discr%C3%A8te+-+http://bit.ly/9TN7xK&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://sroucheray.org/blog/2009/06/petite-histoire-d%e2%80%99une-formule-mathematique-discrete/&amp;submitHeadline=Petite+histoire+d%E2%80%99une+formule+math%C3%A9matique+discr%C3%A8te&amp;submitSummary=A%20little%20story%20about%20a%20mathematical%20formula%20on%20Pims%20World%20Labs%20%28French%29&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://sroucheray.org/blog/2009/06/petite-histoire-d%e2%80%99une-formule-mathematique-discrete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deobfuscateur JavaScript pour Firefox</title>
		<link>http://sroucheray.org/blog/2009/06/deobfuscateur-javascript-pour-firefox/</link>
		<comments>http://sroucheray.org/blog/2009/06/deobfuscateur-javascript-pour-firefox/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 20:41:36 +0000</pubDate>
		<dc:creator>Stéphane Roucheray</dc:creator>
				<category><![CDATA[Pims World]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://sroucheray.org/blog/?p=38</guid>
		<description><![CDATA[A JavaScript deobfuscator extensions for Firefox on Pims World Labs (French)...]]></description>
			<content:encoded><![CDATA[<a href="http://labs.pimsworld.org/2009/01/deobfuscateur-javascript-pour-firefox/" target="_self">http://labs.pimsworld.org/2009/01/deobfuscateur-javascript-pour-firefox/</a>

<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://sroucheray.org/blog/2009/06/deobfuscateur-javascript-pour-firefox/&amp;title=Deobfuscateur+JavaScript+pour+Firefox" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://sroucheray.org/blog/2009/06/deobfuscateur-javascript-pour-firefox/&amp;title=Deobfuscateur+JavaScript+pour+Firefox" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://sroucheray.org/blog/2009/06/deobfuscateur-javascript-pour-firefox/&amp;t=Deobfuscateur+JavaScript+pour+Firefox" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://sroucheray.org/blog/2009/06/deobfuscateur-javascript-pour-firefox/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://sroucheray.org/blog/2009/06/deobfuscateur-javascript-pour-firefox/&amp;title=Deobfuscateur+JavaScript+pour+Firefox&amp;summary=A%20JavaScript%20deobfuscator%20extensions%20for%20Firefox%20on%20Pims%20World%20Labs%20%28French%29...&amp;source=Lambda" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://sroucheray.org/blog/2009/06/deobfuscateur-javascript-pour-firefox/&amp;title=Deobfuscateur+JavaScript+pour+Firefox" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://sroucheray.org/blog/2009/06/deobfuscateur-javascript-pour-firefox/&amp;title=Deobfuscateur+JavaScript+pour+Firefox" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Deobfuscateur+JavaScript+pour+Firefox+-+http://bit.ly/9DlwBl&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://sroucheray.org/blog/2009/06/deobfuscateur-javascript-pour-firefox/&amp;submitHeadline=Deobfuscateur+JavaScript+pour+Firefox&amp;submitSummary=A%20JavaScript%20deobfuscator%20extensions%20for%20Firefox%20on%20Pims%20World%20Labs%20%28French%29...&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://sroucheray.org/blog/2009/06/deobfuscateur-javascript-pour-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

