<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>kenxu99 &#187; open source</title>
	<atom:link href="http://kenxu99.wordpress.com/category/open-source/feed/" rel="self" type="application/rss+xml" />
	<link>http://kenxu99.wordpress.com</link>
	<description>Technical skills and profile for Ken Xu</description>
	<lastBuildDate>Fri, 16 Dec 2011 01:09:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='kenxu99.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>kenxu99 &#187; open source</title>
		<link>http://kenxu99.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://kenxu99.wordpress.com/osd.xml" title="kenxu99" />
	<atom:link rel='hub' href='http://kenxu99.wordpress.com/?pushpress=hub'/>
		<item>
		<title>mouselock &#8211; Synthetic Mouse Test</title>
		<link>http://kenxu99.wordpress.com/2011/12/09/mouselock-synthetic-mouse-test/</link>
		<comments>http://kenxu99.wordpress.com/2011/12/09/mouselock-synthetic-mouse-test/#comments</comments>
		<pubDate>Fri, 09 Dec 2011 09:24:49 +0000</pubDate>
		<dc:creator>Ken Xu</dc:creator>
				<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://kenxu99.wordpress.com/?p=59</guid>
		<description><![CDATA[This test case is suppose test to see if Synthetic Mouse behave the same regardless of mouse lock state. The test was actually done on last Friday. But today, the Full_ScreenHarness was added to the test. A few things first, in order to run the tests, it would take about 20-30 mins of building. What [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenxu99.wordpress.com&#038;blog=27108368&#038;post=59&#038;subd=kenxu99&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This test case is suppose test to see if Synthetic Mouse behave the same regardless of mouse lock state.<br />
The test was actually done on last Friday. But today, the Full_ScreenHarness was added to the test.<br />
A few things first, in order to run the tests, it would take about 20-30 mins of building. What it means is everytime a line of code is changed, I would have to wait around for 30mins, before I can know if it worked or not. This work flow is very time consuming.</p>
<p>First thing about the test, it covers all mouse event except for mousemove, and mouseover, then those 2 events are combined with other events seem to be a problem in the EventUtil.js even when the mouse isnt locked. I might have to add those two events in later, but for now all the other events test out ok. The problem I have with those 2 events are they are fired twice, when mouse isnt lock, so I think it has something to do with bubbling or when mousemoves or when mouse is over an element it might be confusing with mousemove to mouseover. So I plan to run thsoe 2 test independently. But for now all the other events passed.</p>
<p>Now for the harness part.<br />
I have build it in 2 machine, one for windows, and the other on a mac.<br />
For some reason the tests work fine on windows, but when it is ran on a mac it runs twice. the test i ran was test_FullScreenHarness.html<br />
Here is a screen shot of the result on MAC<a href="http://kenxu99.files.wordpress.com/2011/12/screen-shot-2011-12-09-at-2-25-02-am1.png"><img class="aligncenter size-full wp-image-63" title="Screen Shot 2011-12-09 at 2.25.02 AM" src="http://kenxu99.files.wordpress.com/2011/12/screen-shot-2011-12-09-at-2-25-02-am1.png?w=630" alt=""   /></a></p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kenxu99.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kenxu99.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kenxu99.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kenxu99.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kenxu99.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kenxu99.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kenxu99.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kenxu99.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kenxu99.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kenxu99.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kenxu99.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kenxu99.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kenxu99.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kenxu99.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenxu99.wordpress.com&#038;blog=27108368&#038;post=59&#038;subd=kenxu99&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kenxu99.wordpress.com/2011/12/09/mouselock-synthetic-mouse-test/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/06d899466aec78d668e01f0403fb23fd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tentaclepentacle</media:title>
		</media:content>

		<media:content url="http://kenxu99.files.wordpress.com/2011/12/screen-shot-2011-12-09-at-2-25-02-am1.png" medium="image">
			<media:title type="html">Screen Shot 2011-12-09 at 2.25.02 AM</media:title>
		</media:content>
	</item>
		<item>
		<title>mouselock Synthetic Mouse Event test</title>
		<link>http://kenxu99.wordpress.com/2011/12/01/mouselock-synthetic-mouse-event-test/</link>
		<comments>http://kenxu99.wordpress.com/2011/12/01/mouselock-synthetic-mouse-event-test/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 07:25:13 +0000</pubDate>
		<dc:creator>Ken Xu</dc:creator>
				<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://kenxu99.wordpress.com/?p=49</guid>
		<description><![CDATA[Here is my synthetic mouse event test for the mouselock function. This is my first draft and I have not ran the test yet, but It should work. Now I just gotta figure out where to place my test file. here is a link to the test on github Syn Test<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenxu99.wordpress.com&#038;blog=27108368&#038;post=49&#038;subd=kenxu99&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is my synthetic mouse event test for the mouselock function.</p>
<p>This is my first draft and I have not ran the test yet, but It should work. Now I just gotta figure out where to place my test file.</p>
<p>here is a link to the test on github <a href="https://github.com/TentaclePentacle/mozilla-central/commit/0150852c71df8e94719c4855fa96f6891dfa76db">Syn Test</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kenxu99.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kenxu99.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kenxu99.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kenxu99.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kenxu99.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kenxu99.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kenxu99.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kenxu99.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kenxu99.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kenxu99.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kenxu99.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kenxu99.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kenxu99.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kenxu99.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenxu99.wordpress.com&#038;blog=27108368&#038;post=49&#038;subd=kenxu99&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kenxu99.wordpress.com/2011/12/01/mouselock-synthetic-mouse-event-test/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/06d899466aec78d668e01f0403fb23fd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tentaclepentacle</media:title>
		</media:content>
	</item>
		<item>
		<title>Final Report on Processing.js bug#1557</title>
		<link>http://kenxu99.wordpress.com/2011/11/22/final-report-on-processing-js-bug1557/</link>
		<comments>http://kenxu99.wordpress.com/2011/11/22/final-report-on-processing-js-bug1557/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 00:36:51 +0000</pubDate>
		<dc:creator>Ken Xu</dc:creator>
				<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://kenxu99.wordpress.com/?p=26</guid>
		<description><![CDATA[I have been working on this bug for a while now, and I have been hesitant to blog about it because of the lack of things to report. So this post is going to be rather long as it details the process taken to track down this bug. This bug consists of learning processing.js and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenxu99.wordpress.com&#038;blog=27108368&#038;post=26&#038;subd=kenxu99&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have been working on this bug for a while now, and I have been hesitant to blog about it because of the lack of things to report. So this post is going to be rather long as it details the process taken to track down this bug.</p>
<p>This bug consists of learning processing.js and learning javascript, and finally learning advance linear algebra.</p>
<p>First thing first, I have been trying to run processing.js with a simple html file and a canvas tag. What I discovered is that running it is not as simple. Simply opening the html file in a browser does not work on most browsers. I have tried chrome, opera, safari, IE. They all failed to run the sample test file (all I get is a blank screen). The file only works in firefox, but it runs with errors.</p>
<p style="padding-left:30px;">Error in parsing value for &#8216;image-rendering&#8217;.  Declaration dropped. @ file:///C:/processing-js/test/unit/ticket1557.html</p>
<p>This is due to the fact that processing.js requires a webserver running. Running the processing.js file in file violates some kind of browser access policy. This could be some security policy added in the newer versions of the browser. To by pass this problem, I used the virtual web server inside visual studio. So in essence I am running processing.js in an IIS server. However, the outlining in visual studio for javascript is none existent, so to make things easier working with a huge javascript file, I am currently using eclipse IDE, which provides me with a decent outlining of javascript. Here is what the outlining in  Eclipse looks like.</p>
<p><a href="http://kenxu99.files.wordpress.com/2011/11/eclipse_js_outline.jpg"><img class="aligncenter size-full wp-image-39" title="eclipse_js_outline" src="http://kenxu99.files.wordpress.com/2011/11/eclipse_js_outline.jpg?w=630" alt=""   /></a></p>
<p>After I solved the development environment issue. I had thought the problem with <a href="https://processing-js.lighthouseapp.com/projects/41284-processingjs/tickets/1557-printmatrix-prints-negative-zeros">bug 1557</a> was with the rotate function within the PMatrix2D object itself. At first glance of the rotate code below</p>
<blockquote>
<p style="text-align:left;">rotate: function(angle) {<br />
var c = Math.cos(angle);<br />
var s = Math.sin(angle);<br />
var temp1 = this.elements[0];<br />
var temp2 = this.elements[1];<br />
this.elements[0] = c * temp1 + s * temp2;<br />
this.elements[1] = -s * temp1 + c * temp2;<br />
temp1 = this.elements[3];<br />
temp2 = this.elements[4];<br />
this.elements[3] = c * temp1 + s * temp2;<br />
this.elements[4] = -s * temp1 + c * temp2;<br />
},</p>
</blockquote>
<p style="text-align:left;">where a (2X3) 2D matrix is depicted by</p>
<address>element[0], element[1], element[2]</address>
<address>element[3], element[4], element[5]</address>
<p>and since this is a 2D matrix only elements[0][1][3][4] are used.</p>
<p>First thing I did was to insert few console.log statements into the functions, and I found out for some reason the rotate function was being called twice, after only calling rotate() once in my pde file. This had me baffled for a while, so I changed my pde file to include more functions such as translate(), and inserted console.log into the translate function. I have found that the translate function is being called twice as well. At this point I wish I had a stack trace debugger with step by step functions that will allow me to find out what&#8217;s going on. But lacking such capabilities I was forced to dig through the massive javascript file blind.</p>
<p>After some digging I found a prototype function within the Drawing2D object that calls the rotate function of the PMatrix2D object. Thanks to the open source class&#8217;s discussion on javascript prototype, without it I would not have been able to figure this out. (code below)</p>
<blockquote><p>Drawing2D.prototype.rotate = function(angleInRadians) {<br />
modelView.rotateZ(angleInRadians);<br />
modelViewInv.invRotateZ(angleInRadians);<br />
curContext.rotate(angleInRadians);<br />
};</p></blockquote>
<p>This is why the rotate function within PMatrix2D is ran twice. (Note: the same is true for the translate function).</p>
<p>Well the above revelation does not explain <a href="https://processing-js.lighthouseapp.com/projects/41284-processingjs/tickets/1557-printmatrix-prints-negative-zeros">bug 1557</a> nor does it explain why the result from processing.js is different from processing.org&#8217;s code. So I went back to the rotate function with in PMatrix2D. Looking at the formula for calculating rotation, it seems to be wrong.</p>
<blockquote><p>rotate: function(angle) {<br />
var c = Math.cos(angle);<br />
var s = Math.sin(angle);<br />
var temp1 = this.elements[0];<br />
var temp2 = this.elements[1];<br />
this.elements[0] = c * temp1 + s * temp2;<br />
this.elements[1] = -s * temp1 + c * temp2;<br />
temp1 = this.elements[3];<br />
temp2 = this.elements[4];<br />
this.elements[3] = c * temp1 + s * temp2;<br />
this.elements[4] = -s * temp1 + c * temp2;<br />
},</p></blockquote>
<p>Notice the negative sin, that throw me off. Comparing to the algebra method of rotating matrix, the method for calculating the result of a rotational matrix should be something like the below formula.</p>
<p>In two dimensions every rotation matrix has the following form:</p>
<dl>
<dd><img src="http://upload.wikimedia.org/wikipedia/en/math/3/8/f/38f4b1b17056c57ea7cb7f2188c9a81a.png" alt="&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
R(\theta) = \begin{bmatrix}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
\cos \theta &amp; -\sin \theta \\&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
\sin \theta &amp; \cos \theta \\&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
\end{bmatrix}&#8221; />.</dd>
</dl>
<p>This rotates <a title="Column vector" href="http://en.wikipedia.org/wiki/Column_vector">column vectors</a> by means of the following <a title="Matrix multiplication" href="http://en.wikipedia.org/wiki/Matrix_multiplication">matrix multiplication</a>:</p>
<dl>
<dd><img src="http://upload.wikimedia.org/wikipedia/en/math/7/5/2/752fd6396a9c9d026f10eccb39ddca15.png" alt="&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
\begin{bmatrix}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
x&#8217; \\&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
y&#8217; \\&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
\end{bmatrix} = \begin{bmatrix}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
\cos \theta &amp; -\sin \theta \\&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
\sin \theta &amp; \cos \theta \\&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
\end{bmatrix}\begin{bmatrix}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
x \\&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
y \\&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
\end{bmatrix}&#8221; />.</dd>
</dl>
<p>So the coordinates (x&#8217;,y&#8217;) of the point (x,y) after rotation are:</p>
<dl>
<dd><img src="http://upload.wikimedia.org/wikipedia/en/math/1/d/9/1d9a9eb59b0f60941af8aa9b09aa5a41.png" alt="x' = x \cos \theta - y \sin \theta\," />,</dd>
<dd><img src="http://upload.wikimedia.org/wikipedia/en/math/6/7/9/6794b4de87caedcc56ae6b759bb33c88.png" alt="y' = x \sin \theta + y \cos \theta\," />.</dd>
</dl>
<p>The direction of vector rotation is counterclockwise if θ is positive (e.g. 90°), and clockwise if θ is negative (e.g. -90°).</p>
<dl>
<dd><img src="http://upload.wikimedia.org/wikipedia/en/math/f/3/3/f338c036c7b38d2541d15ca1601e8803.png" alt="&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
R(-\theta) = \begin{bmatrix}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
\cos \theta &amp; \sin \theta \\&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
-\sin \theta &amp; \cos \theta \\&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;<br />
\end{bmatrix}\,&#8221; />.</dd>
</dl>
<p>So I rewrote the rotate code to match the formula of</p>
<p><img src="http://upload.wikimedia.org/wikipedia/en/math/1/d/9/1d9a9eb59b0f60941af8aa9b09aa5a41.png" alt="x' = x \cos \theta - y \sin \theta\," />,</p>
<p><img src="http://upload.wikimedia.org/wikipedia/en/math/6/7/9/6794b4de87caedcc56ae6b759bb33c88.png" alt="y' = x \sin \theta + y \cos \theta\," />.</p>
<p>the code below is following the above formula for calculating rotation.</p>
<blockquote><p>var c = Math.cos(angle);<br />
var s = Math.sin(angle);<br />
var temp1 = this.elements[0];<br />
var temp2 = this.elements[3];<br />
this.elements[0] = c * temp1 &#8211; s * temp2;<br />
this.elements[3] = s * temp1 + c * temp2;<br />
temp1 = this.elements[1];<br />
temp2 = this.elements[4];<br />
this.elements[1] = c * temp1 &#8211; s * temp2;<br />
this.elements[4] = s * temp1 + c * temp2;</p></blockquote>
<p>Well after comparing the results, it seems that the two different code segments gives exactly the same result. So in summary, the original code for calculating matrix rotation was correct.</p>
<p>Inorder to answer the question why the rotation result differs between processing.js and processing itself, I had to go and look at the source code for <a href="http://www.google.com/codesearch#Ej56LtI_pY0/trunk/processing/core/src/processing/core/PMatrix2D.java&amp;q=pmatrix%20package:http://processing%5C.googlecode%5C.com">processing.org</a>. I found the rotate function for processing is almost identical to the processing.js&#8217; rotate function.</p>
<p>So why the difference? After some print statements and running a few test files, I found that the way the java version of processing calculates PI, and sin, cos yields different results from javascript.</p>
<p>The reason for this is because the java version uses float to calculate all of its numbers, and javascript uses double. Even with the value of PI, javascript version is more accurate. So the error of -0.000 is cause by the inaccuracy of PI due to the datatype used in calculating sin of PI.</p>
<p>Compare the results of processing.js in a browser on the left to the result of P5 on the right.</p>
<p><a href="http://kenxu99.files.wordpress.com/2011/11/ticket15571.jpg"><img class="aligncenter size-full wp-image-45" title="ticket1557" src="http://kenxu99.files.wordpress.com/2011/11/ticket15571.jpg?w=630" alt=""   /></a></p>
<p>The sin of PI is positive for the javascript version, and negative for the java version. This inconsistency is due to the fact that the value of PI is different in the two versions resulting in a slight difference in the result of sin.</p>
<p>In conclusion the javascript version is the correct answer as it has more precision, but to solve this confusion over negative values, it is best just to round off the values that are close to 0, and consider them effectively having a value of 0. To this end the my original 0.1 version of the solution to this bug is correct. And here is a link to <a href="https://github.com/TentaclePentacle/processing-js/commit/8153e66e04c3e3c07b14e117b1ae6460f3679fcb">solution to bug 1557</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kenxu99.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kenxu99.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kenxu99.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kenxu99.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kenxu99.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kenxu99.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kenxu99.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kenxu99.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kenxu99.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kenxu99.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kenxu99.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kenxu99.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kenxu99.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kenxu99.wordpress.com/26/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenxu99.wordpress.com&#038;blog=27108368&#038;post=26&#038;subd=kenxu99&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kenxu99.wordpress.com/2011/11/22/final-report-on-processing-js-bug1557/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/06d899466aec78d668e01f0403fb23fd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tentaclepentacle</media:title>
		</media:content>

		<media:content url="http://kenxu99.files.wordpress.com/2011/11/eclipse_js_outline.jpg" medium="image">
			<media:title type="html">eclipse_js_outline</media:title>
		</media:content>

		<media:content url="http://upload.wikimedia.org/wikipedia/en/math/1/d/9/1d9a9eb59b0f60941af8aa9b09aa5a41.png" medium="image">
			<media:title type="html">x&#039; = x \cos \theta - y \sin \theta\,</media:title>
		</media:content>

		<media:content url="http://upload.wikimedia.org/wikipedia/en/math/6/7/9/6794b4de87caedcc56ae6b759bb33c88.png" medium="image">
			<media:title type="html">y&#039; = x \sin \theta + y \cos \theta\,</media:title>
		</media:content>

		<media:content url="http://upload.wikimedia.org/wikipedia/en/math/1/d/9/1d9a9eb59b0f60941af8aa9b09aa5a41.png" medium="image">
			<media:title type="html">x&#039; = x \cos \theta - y \sin \theta\,</media:title>
		</media:content>

		<media:content url="http://upload.wikimedia.org/wikipedia/en/math/6/7/9/6794b4de87caedcc56ae6b759bb33c88.png" medium="image">
			<media:title type="html">y&#039; = x \sin \theta + y \cos \theta\,</media:title>
		</media:content>

		<media:content url="http://kenxu99.files.wordpress.com/2011/11/ticket15571.jpg" medium="image">
			<media:title type="html">ticket1557</media:title>
		</media:content>
	</item>
		<item>
		<title>Successful FireFox Build</title>
		<link>http://kenxu99.wordpress.com/2011/11/12/successful-firefox-build/</link>
		<comments>http://kenxu99.wordpress.com/2011/11/12/successful-firefox-build/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 04:13:48 +0000</pubDate>
		<dc:creator>Ken Xu</dc:creator>
				<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://kenxu99.wordpress.com/?p=33</guid>
		<description><![CDATA[After my first build failure, and guessing that it had something to do with the the fact that the parallel compilation under a windows environment is unstable. So I removed the follow from the mozconfig file mk_add_options MOZ_MAKE_FLAGS=&#8221;-j4&#8243; without this command the default is a single core compilation.  Alternative I should investigate  Pymake, it claims [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenxu99.wordpress.com&#038;blog=27108368&#038;post=33&#038;subd=kenxu99&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After my first build failure, and guessing that it had something to do with the the fact that the parallel compilation under a windows environment is unstable.</p>
<p>So I removed the follow from the mozconfig file</p>
<p>mk_add_options MOZ_MAKE_FLAGS=&#8221;-j4&#8243;</p>
<p>without this command the default is a single core compilation.  Alternative I should investigate  <a href="https://developer.mozilla.org/en/pymake" target="_blank">Pymake</a>, it claims to be stable when using parallel compilation under windows.</p>
<p>However after making the changes to my mozconfig, the build still failed, although it did get farther than my first attempt. The Error message I got was</p>
<p style="text-align:left;"><em>&#8220;LINK : fatal error LNK1210: exceeded internal ILK size limit; link with /INCREMENTAL:NO&#8221;</em></p>
<p>here is a screen shot of the last message that it failed on. (got something call build error 2)</p>
<p><a href="http://kenxu99.files.wordpress.com/2011/11/firefox-builderror2.jpg"><img class="aligncenter size-full wp-image-34" title="firefox-builderror2" src="http://kenxu99.files.wordpress.com/2011/11/firefox-builderror2.jpg?w=630" alt="Build Error 2"   /></a>After some digging this error is due to visual studio&#8217;s compiler have a hard coded limit for the ILK size limit that&#8217;s needed for incremental linking. (the ILK file was generated for xul.dll)</p>
<p>To fix this problem I had to disable incremental linking.</p>
<p>To disable incremental linking find the file <strong>config.in</strong> in your root directory. Around line #2505</p>
<p>Add in the following code that&#8217;s in bold.</p>
<p>if test $_MSC_VER -ge 1400; then</p>
<p>dnl Modified the line below add in the option <strong>-INCREMENTAL:NO</strong><br />
LDFLAGS=&#8221;$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT <strong>-INCREMENTAL:NO</strong>&#8220;<br />
dnl For profile-guided optimization<br />
PROFILE_GEN_CFLAGS=&#8221;-GL&#8221;<br />
PROFILE_GEN_LDFLAGS=&#8221;-LTCG:PGINSTRUMENT&#8221;<br />
dnl XXX: PGO builds can fail with warnings treated as errors,<br />
dnl specifically &#8220;no profile data available&#8221; appears to be<br />
dnl treated as an error sometimes. This might be a consequence<br />
dnl of using WARNINGS_AS_ERRORS in some modules, combined<br />
dnl with the linker doing most of the work in the whole-program<br />
dnl optimization/PGO case. I think it&#8217;s probably a compiler bug,<br />
dnl but we work around it here.<br />
PROFILE_USE_CFLAGS=&#8221;-GL -wd4624 -wd4952&#8243;<br />
dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.<br />
dnl Probably also a compiler bug, but what can you do?<br />
PROFILE_USE_LDFLAGS=&#8221;-LTCG:PGUPDATE&#8221;<br />
LDFLAGS=&#8221;$LDFLAGS -DYNAMICBASE&#8221;</p>
<p>After all of that modifications the build was a success, even though it did take more than 2 hours per build.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kenxu99.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kenxu99.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kenxu99.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kenxu99.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kenxu99.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kenxu99.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kenxu99.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kenxu99.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kenxu99.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kenxu99.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kenxu99.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kenxu99.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kenxu99.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kenxu99.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenxu99.wordpress.com&#038;blog=27108368&#038;post=33&#038;subd=kenxu99&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kenxu99.wordpress.com/2011/11/12/successful-firefox-build/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/06d899466aec78d668e01f0403fb23fd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tentaclepentacle</media:title>
		</media:content>

		<media:content url="http://kenxu99.files.wordpress.com/2011/11/firefox-builderror2.jpg" medium="image">
			<media:title type="html">firefox-builderror2</media:title>
		</media:content>
	</item>
		<item>
		<title>Building FireFox and crossing my fingers</title>
		<link>http://kenxu99.wordpress.com/2011/11/10/building-firefox-and-crossing-my-fingers/</link>
		<comments>http://kenxu99.wordpress.com/2011/11/10/building-firefox-and-crossing-my-fingers/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 10:42:32 +0000</pubDate>
		<dc:creator>Ken Xu</dc:creator>
				<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://kenxu99.wordpress.com/?p=28</guid>
		<description><![CDATA[I am trying to build firefox on windows. So far, I have clone the firefox repo twice, first time, the clone was using a windows new line command, and it turns out I need a unix line character. I have installed visual studios 2010, and directx sdk, windows sdk for vista, apparently there are some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenxu99.wordpress.com&#038;blog=27108368&#038;post=28&#038;subd=kenxu99&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I am trying to build firefox on windows.</p>
<p>So far, I have clone the firefox repo twice, first time, the clone was using a windows new line command, and it turns out I need a unix line character.</p>
<p>I have installed visual studios 2010, and directx sdk, windows sdk for vista, apparently there are some issues with windows 7 sdk.</p>
<p>I have also created .mozconfig file and added it into the working directory of the cloned repo. Couldn&#8217;t find any documentation on where to put that file, here is hoping that I made the right guess.</p>
<p>The following options are present in the .mozconfig file</p>
<p>mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@</p>
<p>mk_add_options MOZ_MAKE_FLAGS=&#8221;-j4&#8243;</p>
<p>ac_add_options &#8211;enable-debug</p>
<p>ac_add_options &#8211;disable-optimize</p>
<p>You will notice that I have set the parallel build flag to 4, from the documentation that I have read, suggests that setting the flag to multiple parallel builds might be unstable in windows. I hope the build does not crash and I would have to start all over again.</p>
<p>Here is a screen shot of the build process.</p>
<p><a href="http://kenxu99.files.wordpress.com/2011/11/firefox_build_screen1.jpg"><img class="aligncenter size-full wp-image-30" title="firefox_build_screen" src="http://kenxu99.files.wordpress.com/2011/11/firefox_build_screen1.jpg?w=630" alt=""   /></a>Look at the cpu cooking</p>
<p><a href="http://kenxu99.files.wordpress.com/2011/11/firefox_build_cpu.jpg"><img class="aligncenter size-full wp-image-31" title="firefox_build_cpu" src="http://kenxu99.files.wordpress.com/2011/11/firefox_build_cpu.jpg?w=630" alt=""   /></a>This is going to take a while, currently this is still running, but the screen seem to have stopped for a while, at a line saying leaving directory. And the screen have not updated for a while now. I just hope the system has not crashed.</p>
<p>It would be nice to have a progress bar or some kind of hint saying its still running.  I also wonder is there a silent build that I could run that does not scroll a wall of text at you?  Cause that display must slow down the process.</p>
<p>Well here is keeping my finger crossed, and hoping that the process is still going and not crashing.</p>
<p>I wonder how long will this take, so far its been 2 hours and counting.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kenxu99.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kenxu99.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kenxu99.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kenxu99.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kenxu99.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kenxu99.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kenxu99.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kenxu99.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kenxu99.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kenxu99.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kenxu99.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kenxu99.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kenxu99.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kenxu99.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenxu99.wordpress.com&#038;blog=27108368&#038;post=28&#038;subd=kenxu99&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kenxu99.wordpress.com/2011/11/10/building-firefox-and-crossing-my-fingers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/06d899466aec78d668e01f0403fb23fd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tentaclepentacle</media:title>
		</media:content>

		<media:content url="http://kenxu99.files.wordpress.com/2011/11/firefox_build_screen1.jpg" medium="image">
			<media:title type="html">firefox_build_screen</media:title>
		</media:content>

		<media:content url="http://kenxu99.files.wordpress.com/2011/11/firefox_build_cpu.jpg" medium="image">
			<media:title type="html">firefox_build_cpu</media:title>
		</media:content>
	</item>
		<item>
		<title>Using your browser as a javascript IDE</title>
		<link>http://kenxu99.wordpress.com/2011/09/30/using-your-browser-as-a-javascript-ide/</link>
		<comments>http://kenxu99.wordpress.com/2011/09/30/using-your-browser-as-a-javascript-ide/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 05:37:20 +0000</pubDate>
		<dc:creator>Ken Xu</dc:creator>
				<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://kenxu99.wordpress.com/?p=22</guid>
		<description><![CDATA[Up until now I have always used notepad++ to write my javascript. But after working on the processing.js project which requires me to work with one huge file with about 20k lines of javascript code, notepad++ just isn&#8217;t gonna cut it anymore. Just scrolling from one functions to another requires extreme stroking of the mouse [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenxu99.wordpress.com&#038;blog=27108368&#038;post=22&#038;subd=kenxu99&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Up until now I have always used <a href="http://notepad-plus-plus.org/" target="_blank">notepad++</a> to write my javascript. But after working on the <a href="http://processingjs.org/" target="_blank">processing.js</a> project which requires me to work with one huge file with about 20k lines of javascript code, <a href="http://notepad-plus-plus.org/" target="_blank">notepad++</a> just isn&#8217;t gonna cut it anymore. Just scrolling from one functions to another requires extreme stroking of the mouse that would bring PETA breathing down my neck for molestation of rodents.</p>
<p>While I am aware <a href="http://netbeans.org/" target="_blank">NetBeans</a> or <a href="http://www.eclipse.org/" target="_blank">Eclipse</a> or even <a href="http://www.springsource.org/" target="_blank">SpringSource</a> can provide an IDE (with intellisense) for javascript. Those tools require the IDE be installed onto a local computer. Since I don&#8217;t fancy lugging around a laptop with me everytime, so most of the time I am relying on the lab computers, which might not necessary have the IDE installed.</p>
<p>While searching for a solution to my predicament, I was introduce to a project headed up by the folks that brought you <a href="http://www.eclipse.org/" target="_blank">Eclipse</a>, named <a href="http://www.eclipse.org/orion/" target="_blank">Orion</a></p>
<p>Orion is an webeditor right in your browser. What makes Orion stand out is that the website <a href="http://orionhub.org/" target="_blank">http://orionhub.org/</a> host your files for you on the web. This way you no longer need to carry a laptop, or an usb stick with you all the time. All you need is a browser and an internet connection and you are ready to code. What&#8217;s even amazing is that <a href="http://orionhub.org/" target="_blank">http://orionhub.org/</a> even supports git functions. You can clone a repo from github and hosts on your orionhub site and work with your clone repo right on your browser. Once you finish making your changes, you can push your commits back to github, and its all done in a GUI interface. No more struggling with git command lines.</p>
<p><strong>Here is a quick tutorial on Orion</strong></p>
<span style="text-align:center; display: block;"><a href="http://kenxu99.wordpress.com/2011/09/30/using-your-browser-as-a-javascript-ide/"><img src="http://img.youtube.com/vi/gOZWCCvItdU/2.jpg" alt="" /></a></span>
<p>Unfortunately Orion is still in Beta stage, so <a href="http://orionhub.org/" target="_blank">http://orionhub.org/</a> &#8216;s signup process isn&#8217;t working correctly when I try it. But you can however download and install the Orion on your local machine or on your own server. <a href="http://wiki.eclipse.org/Orion/How_Tos/Install_Orion_on_Localhost" target="_blank">here is a link that shows your how</a>.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kenxu99.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kenxu99.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kenxu99.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kenxu99.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kenxu99.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kenxu99.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kenxu99.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kenxu99.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kenxu99.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kenxu99.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kenxu99.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kenxu99.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kenxu99.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kenxu99.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenxu99.wordpress.com&#038;blog=27108368&#038;post=22&#038;subd=kenxu99&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kenxu99.wordpress.com/2011/09/30/using-your-browser-as-a-javascript-ide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/06d899466aec78d668e01f0403fb23fd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tentaclepentacle</media:title>
		</media:content>
	</item>
		<item>
		<title>Processing-js Bug (1557) Release 0.1 &#8211; Getting my feet wet</title>
		<link>http://kenxu99.wordpress.com/2011/09/29/processing-js-bug-1557-release-0-1-getting-my-feet-wet/</link>
		<comments>http://kenxu99.wordpress.com/2011/09/29/processing-js-bug-1557-release-0-1-getting-my-feet-wet/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 01:48:25 +0000</pubDate>
		<dc:creator>Ken Xu</dc:creator>
				<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://kenxu99.wordpress.com/?p=13</guid>
		<description><![CDATA[Having used processing.js to create a few simple web animations before, I was keen on working with processing.js. After days of digging though processing.js @ lighthouse I have finally found a simple bug that I could get my feet wet with, or so I thought. Bug: printMatrix prints negative zeros  (Link) After cloning the processing.js&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenxu99.wordpress.com&#038;blog=27108368&#038;post=13&#038;subd=kenxu99&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Having used <a href="http://processingjs.org/" target="_blank">processing.js</a> to create a few simple web animations before, I was keen on working with <a href="http://processingjs.org/" target="_blank">processing.js</a>. After days of digging though <a href="https://processing-js.lighthouseapp.com/projects/41284-processingjs/overview" target="_blank">processing.js @ lighthouse</a> I have finally found a simple <a href="https://processing-js.lighthouseapp.com/projects/41284-processingjs/tickets/1557-printmatrix-prints-negative-zeros" target="_blank">bug</a> that I could get my feet wet with, or so I thought.</p>
<p>Bug: <strong>printMatrix prints negative zeros</strong>  (<a href="https://processing-js.lighthouseapp.com/projects/41284-processingjs/tickets/1557-printmatrix-prints-negative-zeros" target="_blank">Link</a>)</p>
<p>After cloning the <a href="https://github.com/jeresig/processing-js" target="_blank">processing.js&#8217;s git repo</a></p>
<p>At first glance the bug seems to be a simple formatting problem, a zero is formatted with a negative sign.</p>
<p>After running a few test sketches with the following code</p>
<p><code>size(500, 500); rotate(PI); printMatrix();</code></p>
<p>I have discovered the negative zero happens when the rotate(PI) function is called. This function is suppose to rotate the matrix by 180 degrees given the input value is PI. Without getting into the algebra of matrix rotations and transformations, simply put each of the element of the 2&#215;3 matrix is multiplied by a transformation matrix, and when that calculation is done some of the element have that -0.0000 is not actually 0. Its a rounded number, the actually value is -1.2246467991473532e-16.<code></code></p>
<p>So when the print function formats that number into 4 decimal digits (without rounding), its is shown as -0.0000</p>
<p>Well at first I thought this is easily fixable, all I have to do is round the number and then format it into 4 decimal digits. To that end I have upload my fix as my release 0.1 to my <a href="https://github.com/TentaclePentacle/processing-js/commit/0459e5915ad3d5b9c00346c9e8ef13a4a5337681" target="_blank">git repo under branch t1557</a></p>
<p>But here is when things get interesting. After further examination the <a href="http://www.processing.org/" target="_blank">P5</a> code shows the negative zero in the (1,0) position in the matrix while the PJS code shows the negative zero at (0,1) position. So either the P5&#8242;s rotation calculation is wrong or the PJS&#8217;s rotation function is wrong.</p>
<p>My next step is:</p>
<ol>
<li>brush up on my matrix algebra (so I can calculate the values by hand if need be)</li>
<li>download the latest P5 code (to see if P5 have fixed the problem in the latest beta release)</li>
<li>compare the P5 rotate function with PJS&#8217;s</li>
<li>if the rotate in PJS is wrong then fix it.</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kenxu99.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kenxu99.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kenxu99.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kenxu99.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kenxu99.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kenxu99.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kenxu99.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kenxu99.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kenxu99.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kenxu99.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kenxu99.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kenxu99.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kenxu99.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kenxu99.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenxu99.wordpress.com&#038;blog=27108368&#038;post=13&#038;subd=kenxu99&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kenxu99.wordpress.com/2011/09/29/processing-js-bug-1557-release-0-1-getting-my-feet-wet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/06d899466aec78d668e01f0403fb23fd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tentaclepentacle</media:title>
		</media:content>
	</item>
		<item>
		<title>svn vs git</title>
		<link>http://kenxu99.wordpress.com/2011/09/22/svn-vs-git/</link>
		<comments>http://kenxu99.wordpress.com/2011/09/22/svn-vs-git/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 17:44:10 +0000</pubDate>
		<dc:creator>Ken Xu</dc:creator>
				<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://kenxu99.wordpress.com/?p=10</guid>
		<description><![CDATA[I have had a lot of experience with svn in the pass, but only heard of git in passing. Having only worked in small groups, there is never a need to use git, svn seem to serve a small group really well. git utilizes a distributed model, where there is no centralized server, and everyone [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenxu99.wordpress.com&#038;blog=27108368&#038;post=10&#038;subd=kenxu99&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have had a lot of experience with svn in the pass, but only heard of git in passing. Having only worked in small groups, there is never a need to use git, svn seem to serve a small group really well.</p>
<p>git utilizes a distributed model, where there is no centralized server, and everyone clones the repository. People would just work with their cloned repos, and then later sync the repos back to a node.  And it would be the responsibility of the owner of the repos to sync the changes to the primary repo.</p>
<p>At first glance it seems this would be a nightmare to merge all the repos together. But as I dig deeper into git, I realized that its actually delegating the merging process to the individual repo owners. So in essence the merging process is distributed as well.  For examples if I want to sync the changes I made to my repo to another repo (usually the repo that I first cloned from, lets call it repo B).  I would be my responsible to  push my changes to repo B. And if I run into conflict with repo B, it would be up to me to figuer out how merge those changes. Reversely if the owner of repo B wants my new changes it would be the responsibility of B to pull the changes I made and integrate them into B.</p>
<p>So this process is all delegated between the 2 owners of the repos, it is up to the owners to merge their repos.</p>
<p>Although this process could be very messy especially if the 2 repos are far out of sync.<br />
But this method of &#8220;distributed merging&#8221; (meaning all the responsibility of merging is off loaded to the individual repos) might be the only workable approach, when dealing with a lot of developers, and away from a centralized model.</p>
<p>Having said all of that the best practices of working with svn still applies to git.</p>
<p>Such as sync as often as possible. In git this means always try to pull changes from your source repo often. And push your changes to your source repo often as well.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kenxu99.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kenxu99.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kenxu99.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kenxu99.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kenxu99.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kenxu99.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kenxu99.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kenxu99.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kenxu99.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kenxu99.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kenxu99.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kenxu99.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kenxu99.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kenxu99.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenxu99.wordpress.com&#038;blog=27108368&#038;post=10&#038;subd=kenxu99&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kenxu99.wordpress.com/2011/09/22/svn-vs-git/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/06d899466aec78d668e01f0403fb23fd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tentaclepentacle</media:title>
		</media:content>
	</item>
		<item>
		<title>open license vs closed</title>
		<link>http://kenxu99.wordpress.com/2011/09/14/open-license-vs-closed/</link>
		<comments>http://kenxu99.wordpress.com/2011/09/14/open-license-vs-closed/#comments</comments>
		<pubDate>Wed, 14 Sep 2011 17:17:27 +0000</pubDate>
		<dc:creator>Ken Xu</dc:creator>
				<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://kenxu99.wordpress.com/?p=5</guid>
		<description><![CDATA[After reading through the GPL license and apple&#8217;s iphone4 software usage license, one thing stands out in my mind; The apple&#8217;s software license agreement (closed license) is main a document stating what you can not do with the software. Its a document designed to limit user&#8217;s rights. Here are some quotes from the license that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenxu99.wordpress.com&#038;blog=27108368&#038;post=5&#038;subd=kenxu99&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After reading through the <a href="http://opensource.org/licenses/GPL-3.0" target="_blank">GPL</a> license and <a href="http://images.apple.com/legal/sla/docs/iphone4.pdf" target="_blank">apple&#8217;s iphone4 software usage license</a>, one thing stands out in my mind; The apple&#8217;s software license agreement (closed license) is main a document stating what you can not do with the software. Its a document designed to limit user&#8217;s rights.</p>
<p>Here are some quotes from the license that surprised me:</p>
<p style="text-align:left;font-size:12px;"><em><strong>4. Consent to Use of Data.</strong></em></p>
<p style="text-align:left;font-size:12px;"><em>(a) Anonymous Diagnostic and Usage Data. You agree that Apple and its subsidiaries and agents may collect, maintain, process and use diagnostic, technical, usage and related information,</em><br />
<em>including but not limited to information about your iPhone, computer, system and application software, and peripherals, that is gathered periodically to facilitate the provision of software updates,</em><br />
<em>product support and other services to you (if any) related to the iPhone Software, and to verify compliance with the terms of this License. Apple may use this information, as long as it is collected</em><br />
<em>anonymously in a form that does not personally identify you, to improve our products or to provide services or technologies to you.</em></p>
<p style="text-align:left;">So in order to use apple&#8217;s software you are basically signing away your rights to private data.  Apple can collect any information they want from your iPhone.</p>
<p style="text-align:left;">Below is another quote that is very comical:</p>
<p style="text-align:left;font-size:12px;"><em>(d) Interest-Based Advertising. Apple may provide mobile, interest-based advertising to you. If you do not want to receive relevant ads on your iPhone, you can opt out by going to this link on</em><br />
<em>your iPhone: http://oo.apple.com. If you opt out, you will continue to receive the same number of mobile ads, but they may be less relevant because they will not be based on your interests. You</em><br />
<em>may still see ads related to the content on a web page or in an application or based on other non-personal information. This opt-out applies only to Apple advertising services and does not affect</em><br />
<em>interest-based advertising from other advertising networks.</em></p>
<p style="text-align:left;">This clause basically allows apple to send you any advertisement apple chooses. Even if you select the opt out option, apple will still send you advertisement, its just the advertisement will not be tailored to target you.</p>
<p style="text-align:left;">On the other hand the <a href="http://opensource.org/licenses/GPL-3.0" target="_blank">GPL</a> (open license) license reads like a document of rights, not limitations. The GPL basically stats what you can do with the software, it guarantees basi rights a user have if they chose to use this software.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kenxu99.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kenxu99.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kenxu99.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kenxu99.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kenxu99.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kenxu99.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kenxu99.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kenxu99.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kenxu99.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kenxu99.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kenxu99.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kenxu99.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kenxu99.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kenxu99.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kenxu99.wordpress.com&#038;blog=27108368&#038;post=5&#038;subd=kenxu99&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kenxu99.wordpress.com/2011/09/14/open-license-vs-closed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/06d899466aec78d668e01f0403fb23fd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tentaclepentacle</media:title>
		</media:content>
	</item>
	</channel>
</rss>
