<?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>Jmchen11&#039;s Blog</title>
	<atom:link href="http://jmchen11.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jmchen11.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sat, 23 Apr 2011 01:45:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='jmchen11.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Jmchen11&#039;s Blog</title>
		<link>http://jmchen11.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://jmchen11.wordpress.com/osd.xml" title="Jmchen11&#039;s Blog" />
	<atom:link rel='hub' href='http://jmchen11.wordpress.com/?pushpress=hub'/>
		<item>
		<title>textAlign() continue</title>
		<link>http://jmchen11.wordpress.com/2010/04/14/textalign-continue/</link>
		<comments>http://jmchen11.wordpress.com/2010/04/14/textalign-continue/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 20:34:48 +0000</pubDate>
		<dc:creator>jmchen11</dc:creator>
				<category><![CDATA[feed]]></category>

		<guid isPermaLink="false">http://jmchen11.wordpress.com/?p=138</guid>
		<description><![CDATA[Refer my previous post, when you pass a string that hasn&#8217;t been quote in a double quote, the  javaScript doesn&#8217;t know the type, so you will get an error &#8220;undefined&#8221;. However, Processing.js has deal with this problem. It declared a global variable like &#8220;p.LEFT= 39&#8243;. When you use &#8216;LEFT&#8217; as a parameter, javaScript convert it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jmchen11.wordpress.com&amp;blog=11541056&amp;post=138&amp;subd=jmchen11&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Refer my previous post, when you pass a string that hasn&#8217;t been quote in a double quote, the  javaScript doesn&#8217;t know the type, so you will get an error &#8220;undefined&#8221;. However, Processing.js has deal with this problem. It declared a global variable like &#8220;p.LEFT= 39&#8243;. When you use &#8216;LEFT&#8217; as a parameter, javaScript convert it to the number &#8217;39&#8242;. That why I got number &#8217;39&#8242;, when I use &#8216;textAlign(LEFT)&#8217; in my test example. This confuses me for long time, at last I found there are many those kind of global variables in processing.js. <a href="http://github.com/jmchen4/processing-js/commit/258c88c59b8eda6bc097254f2702a7051ec8b530">Here</a> is my git commit. You can see I also declare three variables p.TOP, p.BOTTOM, and p.BASELINE. Because those variables do not relate to the keyboard, they can be any number.</p>
<p>text example:</p>
<pre>void setup() {
size(200, 200);
background(100);
PFont fontA = loadFont("Times New Roman");
textFont(fontA,32);
}
void draw() {
textAlign(LEFT,TOP);
text("word", 100, 30);
textAlign(CENTER,CENTER);
text("word", 100, 70);
textAlign(RIGHT,BOTTOM);
text("word", 100, 110);
}<strong>
</strong></pre>
<h3><span style="color:#ff0000;"><strong><a href="http://matrix.senecac.on.ca/~jmchen4/OSD600/textAlign/alignTest.html">output</a></strong></span></h3>
<p>At last, thank you to <a href="http://zbhuang1.blogspot.com/">Zhibin</a> reminding me that out of the border is not my fault.</p>
<br />Filed under: <a href='http://jmchen11.wordpress.com/category/feed/'>feed</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jmchen11.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jmchen11.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jmchen11.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jmchen11.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jmchen11.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jmchen11.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jmchen11.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jmchen11.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jmchen11.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jmchen11.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jmchen11.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jmchen11.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jmchen11.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jmchen11.wordpress.com/138/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jmchen11.wordpress.com&amp;blog=11541056&amp;post=138&amp;subd=jmchen11&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jmchen11.wordpress.com/2010/04/14/textalign-continue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ea15b0129688515ad20d1332f97b5a20?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jmchen11</media:title>
		</media:content>
	</item>
		<item>
		<title>Processing.js textAlign() method</title>
		<link>http://jmchen11.wordpress.com/2010/04/14/processing-js-textalign-method/</link>
		<comments>http://jmchen11.wordpress.com/2010/04/14/processing-js-textalign-method/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 02:38:53 +0000</pubDate>
		<dc:creator>jmchen11</dc:creator>
				<category><![CDATA[feed]]></category>

		<guid isPermaLink="false">http://jmchen11.wordpress.com/?p=126</guid>
		<description><![CDATA[In processing, textAlign() does not pass a string as a parameter, they do like &#8220;textAlign(RIGHT)&#8221;. In my case, I don&#8217;t why I can&#8217;t use &#8220;toString()&#8221;  to get a string.  Here is my test example: void setup() { size(200, 200); background(100); PFont fontA = loadFont("Times New Roman"); textFont(fontA,32); } void draw() { textAlign(RIGHT); text("word", 50, 30); [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jmchen11.wordpress.com&amp;blog=11541056&amp;post=126&amp;subd=jmchen11&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://processing.org/reference/textAlign_.html">processing</a>, textAlign() does not pass a string as a parameter, they do like &#8220;textAlign(RIGHT)&#8221;. In my case, I don&#8217;t why I can&#8217;t use &#8220;toString()&#8221;  to get a string.  Here is my test example:</p>
<pre>void setup() {
size(200, 200);
background(100);
PFont fontA = loadFont("Times New Roman");
textFont(fontA,32);
}
void draw() {
textAlign(RIGHT);
text("word", 50, 30);
textAlign(CENTER);
text("word", 50, 70);
textAlign(LEFT);
text("word", 50, 110);
}</pre>
<p>In processing.js, if I define :</p>
<pre> p.textAlign = function textAlign() {
    alert(arguments[0].toString());
    curContext.textAlign = arguments[0].toLowerCase();
 };</pre>
<p>I got a number like 39;<a href="http://jmchen11.files.wordpress.com/2010/04/39.jpg"><img class="alignnone size-thumbnail wp-image-130" title="39" src="http://jmchen11.files.wordpress.com/2010/04/39.jpg?w=150&#038;h=43" alt="" width="150" height="43" /></a></p>
<p>I don&#8217;t know how to cast a parameter to a string except toString() method.  I have no choice. I change the test case using a string as a parameter, and comment out alert statement:</p>
<pre>
<pre>void draw() {
textAlign("RIGHT");
text("word", 50, 30);
textAlign("CENTER");
text("word", 50, 70);
textAlign("LEFT");
text("word", 50, 110);
}
</pre>
</pre>
<p>Then, I got:<a href="http://jmchen11.files.wordpress.com/2010/04/textalign.jpg"></a></p>
<p><a href="http://jmchen11.files.wordpress.com/2010/04/textalign.jpg"><img class="alignnone size-full wp-image-128" title="textAlign" src="http://jmchen11.files.wordpress.com/2010/04/textalign.jpg?w=450" alt=""   /></a></p>
<p>The words become out of  border. I believe the main reason is I did not consider the font size that is similar with my textWidth() case. However, this time &#8220;curContext.font = curContext.mozTextStyle = curTextSize + &#8220;px &#8221; + curTextFont.name;&#8221; does not work here. I need to find out another way to finish this.</p>
<br />Filed under: <a href='http://jmchen11.wordpress.com/category/feed/'>feed</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jmchen11.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jmchen11.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jmchen11.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jmchen11.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jmchen11.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jmchen11.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jmchen11.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jmchen11.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jmchen11.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jmchen11.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jmchen11.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jmchen11.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jmchen11.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jmchen11.wordpress.com/126/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jmchen11.wordpress.com&amp;blog=11541056&amp;post=126&amp;subd=jmchen11&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jmchen11.wordpress.com/2010/04/14/processing-js-textalign-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ea15b0129688515ad20d1332f97b5a20?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jmchen11</media:title>
		</media:content>

		<media:content url="http://jmchen11.files.wordpress.com/2010/04/39.jpg?w=150" medium="image">
			<media:title type="html">39</media:title>
		</media:content>

		<media:content url="http://jmchen11.files.wordpress.com/2010/04/textalign.jpg" medium="image">
			<media:title type="html">textAlign</media:title>
		</media:content>
	</item>
		<item>
		<title>TextWidth() function</title>
		<link>http://jmchen11.wordpress.com/2010/04/11/textwidth-function/</link>
		<comments>http://jmchen11.wordpress.com/2010/04/11/textwidth-function/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 18:00:39 +0000</pubDate>
		<dc:creator>jmchen11</dc:creator>
				<category><![CDATA[feed]]></category>

		<guid isPermaLink="false">http://jmchen11.wordpress.com/?p=123</guid>
		<description><![CDATA[Today,  I test my textWidth() function. However, I got a &#8220;TEST SUMMARY: 1310 passed, 1 failed (77known),  1388 total.  I searched the test-failed, I found : When I deleted _11.pde in file KNOWN-FAILURES. I passed the test, I got &#8220;TEST SUMMARY: 1311 passed, 0 failed (78 known), 1389 total&#8221;. So, I think I pass the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jmchen11.wordpress.com&amp;blog=11541056&amp;post=123&amp;subd=jmchen11&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today,  I test my textWidth() function. However, I got a &#8220;TEST SUMMARY: 1310 passed, 1 failed (77known),  1388 total.  I searched the test-failed, I found :</p>
<p><a href="http://jmchen11.files.wordpress.com/2010/04/textwidth-test.jpg"><img class="alignnone size-full wp-image-124" title="textWidth-test" src="http://jmchen11.files.wordpress.com/2010/04/textwidth-test.jpg?w=450&#038;h=32" alt="" width="450" height="32" /></a></p>
<p>When I deleted _11.pde in file KNOWN-FAILURES. I passed the test, I got &#8220;TEST SUMMARY: 1311 passed, 0 failed (78 known), 1389 total&#8221;. So, I think I pass the test. I will update my ticket.</p>
<br />Filed under: <a href='http://jmchen11.wordpress.com/category/feed/'>feed</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jmchen11.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jmchen11.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jmchen11.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jmchen11.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jmchen11.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jmchen11.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jmchen11.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jmchen11.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jmchen11.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jmchen11.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jmchen11.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jmchen11.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jmchen11.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jmchen11.wordpress.com/123/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jmchen11.wordpress.com&amp;blog=11541056&amp;post=123&amp;subd=jmchen11&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jmchen11.wordpress.com/2010/04/11/textwidth-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ea15b0129688515ad20d1332f97b5a20?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jmchen11</media:title>
		</media:content>

		<media:content url="http://jmchen11.files.wordpress.com/2010/04/textwidth-test.jpg" medium="image">
			<media:title type="html">textWidth-test</media:title>
		</media:content>
	</item>
		<item>
		<title>Processing.js textWidth function</title>
		<link>http://jmchen11.wordpress.com/2010/04/11/processing-js-textwidth-function/</link>
		<comments>http://jmchen11.wordpress.com/2010/04/11/processing-js-textwidth-function/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 03:13:43 +0000</pubDate>
		<dc:creator>jmchen11</dc:creator>
				<category><![CDATA[feed]]></category>

		<guid isPermaLink="false">http://jmchen11.wordpress.com/?p=117</guid>
		<description><![CDATA[With the help of Zhibin. I fixed the bug. He suggest me to consider the text font size. I learn from his code. I change my textWidth function: p.textWidth = function textWidth(str) { curContext.font = curTextSize + "px " + curTextFont.name; if (curContext.fillText) { return curContext.measureText(str).width; } else if (curContext.mozDrawText) { return curContext.mozMeasureText(str); } }; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jmchen11.wordpress.com&amp;blog=11541056&amp;post=117&amp;subd=jmchen11&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>With the help of <a href="http://zbhuang1.blogspot.com/">Zhibin</a>. I fixed the bug. He suggest me to consider the text font size. I learn from his code. I change my textWidth function:</p>
<pre> p.textWidth = function textWidth(str) {
 curContext.font = curTextSize + "px " + curTextFont.name;
 if (curContext.fillText) {
 return curContext.measureText(str).width;
 } else if (curContext.mozDrawText) {
 return curContext.mozMeasureText(str);
 }
 };</pre>
<p>Then it works perfectly!</p>
<p><a href="http://jmchen11.files.wordpress.com/2010/04/textwidth6.jpg"><img class="alignnone size-full wp-image-119" title="textWidth" src="http://jmchen11.files.wordpress.com/2010/04/textwidth6.jpg?w=450" alt=""   /></a></p>
<p>Now, I can work on my <a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/451-textalign">textAlign() </a> function.</p>
<br />Filed under: <a href='http://jmchen11.wordpress.com/category/feed/'>feed</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jmchen11.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jmchen11.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jmchen11.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jmchen11.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jmchen11.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jmchen11.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jmchen11.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jmchen11.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jmchen11.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jmchen11.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jmchen11.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jmchen11.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jmchen11.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jmchen11.wordpress.com/117/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jmchen11.wordpress.com&amp;blog=11541056&amp;post=117&amp;subd=jmchen11&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jmchen11.wordpress.com/2010/04/11/processing-js-textwidth-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ea15b0129688515ad20d1332f97b5a20?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jmchen11</media:title>
		</media:content>

		<media:content url="http://jmchen11.files.wordpress.com/2010/04/textwidth6.jpg" medium="image">
			<media:title type="html">textWidth</media:title>
		</media:content>
	</item>
		<item>
		<title>Processing.js project</title>
		<link>http://jmchen11.wordpress.com/2010/04/09/processing-js-project-4/</link>
		<comments>http://jmchen11.wordpress.com/2010/04/09/processing-js-project-4/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 19:32:39 +0000</pubDate>
		<dc:creator>jmchen11</dc:creator>
				<category><![CDATA[feed]]></category>

		<guid isPermaLink="false">http://jmchen11.wordpress.com/?p=99</guid>
		<description><![CDATA[For my processing.js project, It&#8217;s not easy that I had thought of  before. I met lots of problems when I do my tickets. For my processing.js ticket #455, I build a function: p.textWidth = function textWidth(str) { if (curContext.fillText) { return curContext.measureText(str).width; } else if (curContext.mozDrawText) { return curContext.mozMeasureText(str); } }; It looks working, but [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jmchen11.wordpress.com&amp;blog=11541056&amp;post=99&amp;subd=jmchen11&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For my processing.js project, It&#8217;s not easy that I had thought of  before. I met lots of problems when I do my tickets.</p>
<p>For my processing.js<a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/455-textwidth"> ticket #455</a>, I build a function:</p>
<pre> p.textWidth = function textWidth(str) {
 if (curContext.fillText) {
 return curContext.measureText(str).width;
 } else if (curContext.mozDrawText) {
 return curContext.mozMeasureText(str);
 }
 };</pre>
<p>It looks working, but not perfect. I think I maybe need to measure the pixels of the each of letter. And then multiply the string&#8217;s width.</p>
<p><a href="http://jmchen11.files.wordpress.com/2010/04/textwidth2.jpg"></a><a href="http://jmchen11.files.wordpress.com/2010/04/textwidth5.jpg"><img class="alignnone size-full wp-image-110" title="textWidth" src="http://jmchen11.files.wordpress.com/2010/04/textwidth5.jpg?w=450" alt=""   /></a><br />
For the<a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/451-textalign"> ticket #451</a>, because Canvas drawing text has two attributes (textAlign, <code>textBaseline). I think I can build a function like:</code></p>
<pre>p.textAlign = function textAlign() {
 curContext.textAlign = arguments[0].toLowseCase();
if(arguments.length === 2)
   curContext.<code>textBaseline</code> = arguments[1].toLowseCase();
 };</pre>
<p>However, it does not work at all. The attributes textAlign and <code>textBaseline are working in canvas.But, </code>curContext.textAlign<code> looks like configure the whole canvas and tricky. If I do </code>curContext.textAlign<code> = "left", all words align to a little right. </code>curContext.textAlign<code> = "center", it does not align to the center of the canvas. The same with </code><code>textBaseline. It's hard to control.</code></p>
<p>To do: I still need to work on html 5.0 canvas and the text() method. <code>Maybe <a href="http://zbhuang1.blogspot.com/">Zhibin</a> can help me to understand how the  text() works because he made the text() method.<br />
</code></p>
<p><a href="http://jmchen11.files.wordpress.com/2010/04/textwidth1.jpg"> </a></p>
<br />Filed under: <a href='http://jmchen11.wordpress.com/category/feed/'>feed</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jmchen11.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jmchen11.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jmchen11.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jmchen11.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jmchen11.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jmchen11.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jmchen11.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jmchen11.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jmchen11.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jmchen11.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jmchen11.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jmchen11.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jmchen11.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jmchen11.wordpress.com/99/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jmchen11.wordpress.com&amp;blog=11541056&amp;post=99&amp;subd=jmchen11&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jmchen11.wordpress.com/2010/04/09/processing-js-project-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ea15b0129688515ad20d1332f97b5a20?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jmchen11</media:title>
		</media:content>

		<media:content url="http://jmchen11.files.wordpress.com/2010/04/textwidth5.jpg" medium="image">
			<media:title type="html">textWidth</media:title>
		</media:content>
	</item>
		<item>
		<title>Scripting languages</title>
		<link>http://jmchen11.wordpress.com/2010/04/06/scripting-languages/</link>
		<comments>http://jmchen11.wordpress.com/2010/04/06/scripting-languages/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 03:21:43 +0000</pubDate>
		<dc:creator>jmchen11</dc:creator>
				<category><![CDATA[feed]]></category>

		<guid isPermaLink="false">http://jmchen11.wordpress.com/?p=95</guid>
		<description><![CDATA[Last week, Zhibin has talked about JavaScript and ActionScript. Also, in my another course INT522, there mentioned ECMAScript language.  I found there are many scripting languages, such as JavaScript, ActionScript, JScript, QtScript, DMDScript, InScript . Scripting language is mainly used to design a client-side web page like JavaScript. Actually, most of  Scripting language is similar. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jmchen11.wordpress.com&amp;blog=11541056&amp;post=95&amp;subd=jmchen11&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last week, <a href="http://zbhuang1.blogspot.com/search/label/open%20source">Zhibin</a> has talked about <a href="http://zbhuang1.blogspot.com/2010/03/javascript-and-actionscript.html">JavaScript  and ActionScript</a>. Also, in my another course INT522, there mentioned <a href="http://en.wikipedia.org/wiki/ECMAScript">ECMAScript</a> language.  I found there are many scripting languages, such as <a title="JavaScript" href="http://en.wikipedia.org/wiki/JavaScript">JavaScript</a>,  <a title="ActionScript" href="http://en.wikipedia.org/wiki/ActionScript">ActionScript</a>, <a title="JScript" href="http://en.wikipedia.org/wiki/JScript">JScript</a>,  <a title="QtScript" href="http://en.wikipedia.org/wiki/QtScript">QtScript</a>,  <a title="DMDScript (page does not exist)" href="http://en.wikipedia.org/w/index.php?title=DMDScript&amp;action=edit&amp;redlink=1">DMDScript</a>,<a href="http://en.wikipedia.org/wiki/InScript"> InScript</a> . Scripting language is mainly used to design a client-side web page like JavaScript. Actually, most of  Scripting language is similar. However, the most widespread software will become a standard and control the world, like Windows become a PC operating system standard and control the PC operating system. This make me think of the open source. Maybe the open source will become the software world  standard, because it can make a software become widespread and flexible. However, if all the software become open source and free, who pay our salary?:)</p>
<table style="height:33px;" cellspacing="5" width="19">
<tbody>
<tr>
<th></th>
<td><a title="InScript" href="http://en.wikipedia.org/wiki/InScript"><br />
</a></td>
</tr>
</tbody>
</table>
<br />Filed under: <a href='http://jmchen11.wordpress.com/category/feed/'>feed</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jmchen11.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jmchen11.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jmchen11.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jmchen11.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jmchen11.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jmchen11.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jmchen11.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jmchen11.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jmchen11.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jmchen11.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jmchen11.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jmchen11.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jmchen11.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jmchen11.wordpress.com/95/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jmchen11.wordpress.com&amp;blog=11541056&amp;post=95&amp;subd=jmchen11&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jmchen11.wordpress.com/2010/04/06/scripting-languages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ea15b0129688515ad20d1332f97b5a20?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jmchen11</media:title>
		</media:content>
	</item>
		<item>
		<title>Processing.js Project</title>
		<link>http://jmchen11.wordpress.com/2010/03/31/processing-js-project-3/</link>
		<comments>http://jmchen11.wordpress.com/2010/03/31/processing-js-project-3/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 02:03:58 +0000</pubDate>
		<dc:creator>jmchen11</dc:creator>
				<category><![CDATA[feed]]></category>

		<guid isPermaLink="false">http://jmchen11.wordpress.com/?p=87</guid>
		<description><![CDATA[Now, I work for tickets :#451,#452, #453, #454, #455, and #457 . Because those tickets all is about drawing text, I took all of them. First of all , I need to  be familiar with how those text functions work. For those functions : textWidth(), textLeading(),textDescent(),textAscent(),textAlign(), textMode(),  I believe it is not hard to fulfill. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jmchen11.wordpress.com&amp;blog=11541056&amp;post=87&amp;subd=jmchen11&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Now, I work for tickets :<a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/451-textalign">#451</a>,<a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/452-textascent">#452</a>, <a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/453-textdescent">#453</a>, <a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/454-textleading">#454</a>, <a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/455-textleading">#455</a>, and <a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/457-textmode">#457</a> . Because those tickets all is about drawing text, I took all of them. First of all , I need to  be familiar with how those <a href="http://processing.org/reference/text_.html">text</a> functions work. For those functions : <a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/455-textwidth">textWidth()</a>,<a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/454-textleading"> textLeading(),</a><a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/453-textdescent">textDescent(),</a><a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/452-textascent">textAscent(),</a><a href="http://processing.org/reference/textAlign_.html">textAlign(), </a><a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/457-textmode">textMode()</a>,  I believe it is not hard to fulfill. Thank <a href="http://zbhuang1.blogspot.com/2010/03/javascript-and-actionscript.html">ZhiBin</a> offer me some details about drawing text. He is working <a href="https://processing-js.lighthouseapp.com/projects/41284-processingjs/tickets/213-text-implementation-incomplete#ticket-213-6">text()</a> 3D function. He suggest me learn <a href="https://developer.mozilla.org/en/Drawing_text_using_a_canvas">canvas <code>textBaseline</code></a> function.However,  I don&#8217;t understand how those functions work very much. The <a href="https://developer.mozilla.org/En">developer.mozilla.org</a> is a very good place to learn programming. I also find that the canvas text already has <code><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-textalign">textAlign</a> </code>attribute.</p>
<dl>
<dt><var>context</var> . <code><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-textalign">textAlign</a></code> [ = <var>value</var> ]</dt>
<dd>Returns the current text alignment settings.</p>
<p>Can be set, to change the alignment. The possible values are     <code>start</code>, <code>end</code>, <code>left</code>, <code>right</code>, and <code>center</code>.  Other values are ignored. The default is     <code>start</code>.</p>
<p>So, I think I can use that function in Processing.js. I make function like<br />
p.textAlign = function textAlign(position) {<br />
if (position==&#8221;LEFT&#8221;)<br />
textAlign=&#8221;left&#8221;;<br />
};</p>
<p>This does not work. I will continue learning text stuff, prepare my knowledge to do my tickets.</p>
</dd>
</dl>
<br />Filed under: <a href='http://jmchen11.wordpress.com/category/feed/'>feed</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jmchen11.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jmchen11.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jmchen11.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jmchen11.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jmchen11.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jmchen11.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jmchen11.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jmchen11.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jmchen11.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jmchen11.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jmchen11.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jmchen11.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jmchen11.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jmchen11.wordpress.com/87/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jmchen11.wordpress.com&amp;blog=11541056&amp;post=87&amp;subd=jmchen11&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jmchen11.wordpress.com/2010/03/31/processing-js-project-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ea15b0129688515ad20d1332f97b5a20?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jmchen11</media:title>
		</media:content>
	</item>
		<item>
		<title>JavaScript Lecture</title>
		<link>http://jmchen11.wordpress.com/2010/03/25/javascript-lecture/</link>
		<comments>http://jmchen11.wordpress.com/2010/03/25/javascript-lecture/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 02:16:57 +0000</pubDate>
		<dc:creator>jmchen11</dc:creator>
				<category><![CDATA[feed]]></category>

		<guid isPermaLink="false">http://jmchen11.wordpress.com/?p=83</guid>
		<description><![CDATA[Because Processing.js is a JavaScript project. Last week, our professor taught us  JavaScript. Because I have learned it at INT222, at the beginning, I thought it would be easy. JavaScript looks quite simple. You can see the examples inW3C School that all  are just several lines. However, JavaScript can be very complex. Something like: Var [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jmchen11.wordpress.com&amp;blog=11541056&amp;post=83&amp;subd=jmchen11&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Because Processing.js is a JavaScript project. Last week, our professor taught us  JavaScript. Because I have learned it at INT222, at the beginning, I thought it would be easy. JavaScript looks quite simple. You can see the <a href="http://www.w3schools.com/js/js_examples.asp">examples inW3C School </a>that all  are just several lines. However, JavaScript can be very complex. Something like:</p>
<pre>Var Counter = (function(){ var C=arguments[0];
  return {
     increase: function(){
         ct = arguments[1];
     },
     getValue: function(){
         return c:
     }
  };
})(1,2);</pre>
<p>When you see so many brackets and commas, you will have a headache. In the Processing.js, there are lots of  this kind of codes. So, I believe it looks simple when you learn a language. But, when you use it in the real work, it become complex, because you need to deal with a complex task.</p>
<p>For my Processing.js project, my<a href="https://processing-js.lighthouseapp.com/projects/41284-processingjs/tickets/bins/112143"> two ticke</a>t is going to Super review, I will find another ticket. This time, I plan to work on a missing feature ticket.</p>
<br />Filed under: <a href='http://jmchen11.wordpress.com/category/feed/'>feed</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jmchen11.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jmchen11.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jmchen11.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jmchen11.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jmchen11.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jmchen11.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jmchen11.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jmchen11.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jmchen11.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jmchen11.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jmchen11.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jmchen11.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jmchen11.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jmchen11.wordpress.com/83/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jmchen11.wordpress.com&amp;blog=11541056&amp;post=83&amp;subd=jmchen11&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jmchen11.wordpress.com/2010/03/25/javascript-lecture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ea15b0129688515ad20d1332f97b5a20?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jmchen11</media:title>
		</media:content>
	</item>
		<item>
		<title>Processing.js Project &#8211; Can&#8217;t deal with multiple catch blocks bug</title>
		<link>http://jmchen11.wordpress.com/2010/03/16/processing-js-project-cant-deal-with-multiple-catch-blocks-bug/</link>
		<comments>http://jmchen11.wordpress.com/2010/03/16/processing-js-project-cant-deal-with-multiple-catch-blocks-bug/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 02:45:33 +0000</pubDate>
		<dc:creator>jmchen11</dc:creator>
				<category><![CDATA[feed]]></category>

		<guid isPermaLink="false">http://jmchen11.wordpress.com/?p=78</guid>
		<description><![CDATA[I have worked on Can&#8217;t deal with multiple catch blocks for several weeks. The idea is easy. Using JavaScript RegExp to translate the aCode. First, I try to remain multiple catch blocks, and just change the exception var name. Building the regexp statement is hard, because there is several var name in the catch block. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jmchen11.wordpress.com&amp;blog=11541056&amp;post=78&amp;subd=jmchen11&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have worked on<a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/236-cant-deal-with-multiple-catch-blocks"> Can&#8217;t deal with multiple catch blocks</a> for several weeks. The idea is easy. Using JavaScript RegExp to translate the aCode. First, I try to remain multiple catch blocks, and just change the exception var name. Building the regexp statement is hard, because there is several var name in the catch block. Fortunately, I can find lots of sample in the file <a href="http://github.com/jmchen4/processing-js/blob/trycatch/processing.js">processing.js</a> . This is a interesting thing that you can learn from that you are fixing. However, at last, it doesn&#8217;t work because JavaScript just can handle single unconditional catch. With the instruction of  <a href="http://vocamus.net/dave/">my profession</a>, I turn multiple catch blocks into one and discard the other multiple catch block. I have learned lots of from fixing this bug.</p>
<br />Filed under: <a href='http://jmchen11.wordpress.com/category/feed/'>feed</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jmchen11.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jmchen11.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jmchen11.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jmchen11.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jmchen11.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jmchen11.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jmchen11.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jmchen11.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jmchen11.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jmchen11.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jmchen11.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jmchen11.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jmchen11.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jmchen11.wordpress.com/78/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jmchen11.wordpress.com&amp;blog=11541056&amp;post=78&amp;subd=jmchen11&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jmchen11.wordpress.com/2010/03/16/processing-js-project-cant-deal-with-multiple-catch-blocks-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ea15b0129688515ad20d1332f97b5a20?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jmchen11</media:title>
		</media:content>
	</item>
		<item>
		<title>Processing.js for ticket #236</title>
		<link>http://jmchen11.wordpress.com/2010/03/13/processing-js-for-ticket-236/</link>
		<comments>http://jmchen11.wordpress.com/2010/03/13/processing-js-for-ticket-236/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 03:44:34 +0000</pubDate>
		<dc:creator>jmchen11</dc:creator>
				<category><![CDATA[feed]]></category>

		<guid isPermaLink="false">http://jmchen11.wordpress.com/?p=72</guid>
		<description><![CDATA[I change my regexp statement to aCode = aCode.replace(/catch\s*\(\W*(\w*)\s+(\w*)\W*\)[^\{]*\{([^\}]*)\}/g,function(all,expName,name,blockCode){ blockCode = blockCode.replace(RegExp(&#8220;\(\\W\)&#8221;+name+&#8221;\(\\W\)&#8221;,&#8221;g&#8221;),&#8221;$1&#8243;+name+expName+&#8221;$2&#8243;); return (&#8220;catch \( &#8220;+name+expName+&#8221; \)\{&#8220;+blockCode+&#8221;\}&#8221;); }); Now, it works perfectly! However, I can&#8217;t pass the test. the test example is processing-js\test\parser\Processing-Book-001\Extensions\Network\_03\_03.pde . I believe that changing var name can&#8217;t fix this bug. But, I have no any other idea.  Also, my  Automated Test [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jmchen11.wordpress.com&amp;blog=11541056&amp;post=72&amp;subd=jmchen11&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I change my regexp statement to</p>
<p>aCode = aCode.replace(/catch\s*\(\W*(\w*)\s+(\w*)\W*\)[^\{]*\{([^\}]*)\}/g,function(all,expName,name,blockCode){<br />
blockCode = blockCode.replace(RegExp(&#8220;\(\\W\)&#8221;+name+&#8221;\(\\W\)&#8221;,&#8221;g&#8221;),&#8221;$1&#8243;+name+expName+&#8221;$2&#8243;);<br />
return (&#8220;catch \( &#8220;+name+expName+&#8221; \)\{&#8220;+blockCode+&#8221;\}&#8221;);<br />
});</p>
<p>Now, it works perfectly! However, I can&#8217;t pass the test. the test example is processing-js\test\parser\Processing-Book-001\Extensions\Network\_03\_03.pde . I believe that changing var name can&#8217;t fix this bug. But, I have no any other idea.  Also, my  Automated Test and git still have some problem.  Tomorrow, I will delete all my repository, and refork again. hope it will fix my problem. And, I will work on my <a href="https://processing-js.lighthouseapp.com/projects/41284/tickets/363-link-doesnt-respect-target">other ticket</a>.</p>
<br />Filed under: <a href='http://jmchen11.wordpress.com/category/feed/'>feed</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jmchen11.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jmchen11.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jmchen11.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jmchen11.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jmchen11.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jmchen11.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jmchen11.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jmchen11.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jmchen11.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jmchen11.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jmchen11.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jmchen11.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jmchen11.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jmchen11.wordpress.com/72/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jmchen11.wordpress.com&amp;blog=11541056&amp;post=72&amp;subd=jmchen11&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jmchen11.wordpress.com/2010/03/13/processing-js-for-ticket-236/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ea15b0129688515ad20d1332f97b5a20?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jmchen11</media:title>
		</media:content>
	</item>
	</channel>
</rss>
