<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Andy Li's Blog</title>
	
	<link>http://blog.onthewings.net</link>
	<description>Blog on haXe, Flash/Flex, web development, design, media art, and my personal life.</description>
	<lastBuildDate>Tue, 03 Aug 2010 15:41:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/AndyLi" /><feedburner:info uri="andyli" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Using jQuery in haXe</title>
		<link>http://feedproxy.google.com/~r/AndyLi/~3/hptL2pY-oLg/</link>
		<comments>http://blog.onthewings.net/2010/08/03/using-jquery-in-haxe/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 15:41:11 +0000</pubDate>
		<dc:creator>liwingho</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Haxe]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://blog.onthewings.net/?p=850</guid>
		<description><![CDATA[It is a kind of pain to code in JS without a proper lib [...]]]></description>
			<content:encoded><![CDATA[<p>It is a kind of pain to code in JS without a proper library like <a href="http://jquery.com/">jQuery</a>. Using plain haXe in JS target is just as pain since haXe does not abstract most of the browser quirks, what it gives is only stricter typing and a little bit better core API (nothing DOM related&#8230;). When there is no solid haXe/JS targeted haxe library come out yet, we have to find some ways to use external JS libraries.</p>
<p>There is a <a href="http://lib.haxe.org/p/jquery">jQuery wrapper</a> appeared on haxelib last year, but I don&#8217;t really like its API, which is too different from the original one, and I&#8217;ve never used to having method names first letter capitalized&#8230; OK, it&#8217;s just personal taste <img src='http://blog.onthewings.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  Anyway I&#8217;ve written a <a href="http://lib.haxe.org/p/jQueryExtern">jQuery extern</a> to replace it, which provides API closer to jQuery and smaller compiled JS file (smaller because the haXe compiler does not generate codes for extern class).</p>
<p>Here I will illustrate a bit on how to use it, requiring you to have some experience on both haXe and jQuery.</p>
<h3>Installing the jQuery extern</h3>
<p>Since its put on haxelib, you can install it using the command:</p>
<pre>haxelib install jQueryExtern</pre>
<p>and then add &#8220;-lib jQueryExtern&#8221; in the hxml.</p>
<p>OR, you can download the cutting edge version from github: <a href="http://github.com/andyli/jQueryExternForHaxe">http://github.com/andyli/jQueryExternForHaxe</a>, extract and place &#8220;JQuery.hx&#8221; (optionally with the &#8220;jQueryPlugins&#8221; folder) into your project source directory.</p>
<h3>Using the jQuery classes</h3>
<p>It should be better to illustrate with example. For a typical JS starting point with jQuery, you write:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">//do your magic</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>If you don&#8217;t know, it&#8217;s a short-hand that bind your magic codes to the document ready event, same as you write:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">//do your magic</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>HaXe does not allow using &#8220;$&#8221; as a class name or a function name, but &#8220;$&#8221; is just a short-hand to &#8220;jQuery&#8221;. However, haXe requires all class names start with capital letter, so it is &#8220;JQuery&#8221; not &#8220;jQuery&#8221;. You start your haXe/JS codes using the jQuery extern as following:</p>

<div class="wp_syntax"><div class="code"><pre class="haxe" style="font-family:monospace;">import JQuery;
&nbsp;
class Main {
	static public function main():Void {
		new JQuery(function():Void {
			//your magic codes
		});
	}
}</pre></div></div>

<p>It seems to be a few lines more than JS, but you should already know, the extra lines are the same for all other haXe targets, its how haXe program starts. The main point is &#8220;new JQuery(&#8230;)&#8221; which is the same as &#8220;$(&#8230;)&#8221; in JS.</p>
<p>So, when you code in JS like:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#myMightyDiv&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>now you do the same in haXe:</p>

<div class="wp_syntax"><div class="code"><pre class="haxe" style="font-family:monospace;">	new JQuery(&quot;#myMightyDiv&quot;).hide();</pre></div></div>

<p>Simple.</p>
<h3>Static functions</h3>
<p>One thing to aware, that is the static methods of jQuery are placed to &#8220;JQueryS&#8221; in the extern. The reason is haXe does not allow using same name for both static and instance methods. For example in the original jQuery, there is &#8220;$.data()&#8221; and &#8220;$(&#8230;).data()&#8221;, they are now in the extern as &#8220;JQueryS.data()&#8221; and &#8220;new JQuery(&#8230;).data()&#8221;.</p>
<h3>Extra methods in the jQuery extern</h3>
<p>And there are some extra methods appears in the extern comparing to the original jQuery. For example, there is &#8220;cssSet()&#8221;, and it is just the same as &#8220;css()&#8221; but limiting you to really setting a css property and it is properly typed as returning a JQuery object, so you can happily chaining the methods with code completion and type checking. All the extra methods are like that and they are all set as &#8220;inline&#8221;, so that the haXe compiler will generate correct codes, that is &#8220;css()&#8221; not &#8220;cssSet()&#8221; in the compiled JS, because &#8220;cssSet()&#8221; is not really existing in jQuery. And because they are not really existing, don&#8217;t try to call the extra methods with Reflect.</p>
<h3>Using plug-ins</h3>
<p>I&#8217;ve included some jQuery plug-in externs. Currently there are <a href="http://flowplayer.org/tools/">jQuery Tools</a>, <a href="http://jquery.malsup.com/media/">jQuery media plug-in</a> and <a href="http://jqueryui.com/">jQuery UI</a> (work-in-progress).</p>
<p>The plug-in architecture is a bit hard to deal with&#8230; To understand how it works, first of all you have to know there is a mighty &#8220;<a href="http://scwn.net/2009/05/23/injecting-methods-into-haxe-classes-with-using/">using</a>&#8221; keyword in haXe, which inject methods into object instance. And the jQuery plug-in in my haXe extern is utilizing both &#8220;using&#8221; and &#8220;inline&#8221;.</p>
<p>Anyway, here is how you use the plug-ins. For example, when using <a href="http://flowplayer.org/tools/">jQuery Tools</a> in JS, you just include its JS file in HTML and you can call the plug-in&#8217;s method on the jQuery object, that is:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.my_overlay_trigger&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">overlay</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>...<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//overlay is from jQuery Tools</span></pre></div></div>

<p>In haXe, with my extern, you have to write:</p>

<div class="wp_syntax"><div class="code"><pre class="haxe" style="font-family:monospace;">import JQuery;
//there are several classes in Overlay.hx, we &quot;using&quot; only the &quot;Overlay&quot; class.
using jQueryPlugins.jQueryTools.Overlay.Overlay;
...
new JQuery(&quot;.my_overlay_trigger&quot;).overlay({...});
...</pre></div></div>

<p>Because this implementation doesn&#8217;t deal with optional parameter very well, in most of the cases I made the optional parameters mandatory. If the method has a optional config parameter, but you just want to use the defaults, simply pass in &#8220;{}&#8221;.</p>
<p>And there are many cases some functions does not fit that well, I&#8217;ve wrap them into classes/methods with &#8220;inline&#8221;. You may have to look at the source file to fully understand how to use.</p>
<p>There will be more plug-ins to come when I need them. Feel free to integrate other plug-ins and let me put them into the extern.</p>
<div class="tweetmeme_button" style="margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.onthewings.net%2F2010%2F08%2F03%2Fusing-jquery-in-haxe%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.onthewings.net%2F2010%2F08%2F03%2Fusing-jquery-in-haxe%2F&amp;source=andy_li&amp;style=compact&amp;service=bit.ly&amp;service_api=andyli%3AR_620a3608de8b1566599766b2ea71c3ba" height="61" width="50" />
			</a>
		</div> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://blog.onthewings.net/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AndyLi?a=hptL2pY-oLg:Z7Dd6P2ZsDA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AndyLi?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyLi?a=hptL2pY-oLg:Z7Dd6P2ZsDA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AndyLi?i=hptL2pY-oLg:Z7Dd6P2ZsDA:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AndyLi/~4/hptL2pY-oLg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.onthewings.net/2010/08/03/using-jquery-in-haxe/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.onthewings.net/2010/08/03/using-jquery-in-haxe/</feedburner:origLink></item>
		<item>
		<title>Augmented Mirror, my latest project</title>
		<link>http://feedproxy.google.com/~r/AndyLi/~3/Ew2MTYv1drg/</link>
		<comments>http://blog.onthewings.net/2010/07/07/augmented-mirror-my-latest-project/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 16:53:44 +0000</pubDate>
		<dc:creator>liwingho</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Art & Design]]></category>
		<category><![CDATA[Augmented Mirror]]></category>
		<category><![CDATA[CityU]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[PLAYFUL MEDIA]]></category>

		<guid isPermaLink="false">http://blog.onthewings.net/?p=813</guid>
		<description><![CDATA[Augmented Mirror is my latest large-scale project. It i [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Augmented Mirror</strong> is my latest large-scale project. It is a development of the technique that uses an one-way mirror to archive augmented reality. You can read more about it at <a href="http://augmented-mirror.onthewings.net/">its web site</a> (still in development).</p>
<p>Using the technique, a sample installation called <strong>Mind-Body Interaction</strong> is made. As the title suggests, it is about <a href="http://en.wikipedia.org/wiki/Philosophy_of_mind">Philosophy of mind</a>. It has just been exhibited in <a href="http://playfulmedia.hk/">Playful Media</a> (SIG Showcase, Exhibition of <a href="http://sweb.cityu.edu.hk/bsccm/">BSc Creative Media</a>) and <a href="http://www.thescmannual.hk/">The SCM Annual</a> (graduation show of <a href="http://www.cityu.edu.hk/scm/">School of Creative Media</a>).</p>
<p>Here below is an interview done in Playful Media:</p>
<p><a href="http://blog.onthewings.net/2010/07/07/augmented-mirror-my-latest-project/"><em>Click here to view the embedded video.</em></a></p>
<p>I&#8217;m glad that the artwork is mentioned in some of the news on the exhibitions:</p>
<table border="0">
<tbody>
<tr valign="top">
<td>
<p><div id="attachment_814" class="wp-caption alignnone" style="width: 245px"><a href="http://wikisites.cityu.edu.hk/sites/newscentre/en/Pages/201006030900.aspx"><img class="size-medium wp-image-814  " title="CityU News" src="http://blog.onthewings.net/wp-content/uploads/2010/06/cityu-news-235x450.png" alt="" width="235" height="450" /></a><p class="wp-caption-text">Augmented Mirror appearing on the CityU News.</p></div></td>
<td>
<p><div id="attachment_815" class="wp-caption alignnone" style="width: 460px"><a href="http://blog.onthewings.net/wp-content/uploads/2010/06/hkheadline.png"><img class="size-medium wp-image-815 " title="HK Headline (頭條日報)" src="http://blog.onthewings.net/wp-content/uploads/2010/06/hkheadline-450x225.png" alt="" width="450" height="225" /></a><p class="wp-caption-text">Augmented Mirror appearing on HK Headline (頭條日報).</p></div></td>
</tr>
</tbody>
</table>
<p>By the way, thanks for my teachers and schoolmates for all the efforts put in the exhibitions!</p>
<div class="tweetmeme_button" style="margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.onthewings.net%2F2010%2F07%2F07%2Faugmented-mirror-my-latest-project%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.onthewings.net%2F2010%2F07%2F07%2Faugmented-mirror-my-latest-project%2F&amp;source=andy_li&amp;style=compact&amp;service=bit.ly&amp;service_api=andyli%3AR_620a3608de8b1566599766b2ea71c3ba" height="61" width="50" />
			</a>
		</div><script type="text/javascript">
var flattr_wp_ver = '0.9.14';
var flattr_uid = '18655';
var flattr_url = 'http://blog.onthewings.net';
var flattr_lng = 'en_GB';
var flattr_cat = 'text';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'Andy Li&#039;s Blog';
var flattr_dsc = 'Blog on haXe, Flash/Flex, web development, design, media art, and my personal life.';
</script>
<script src="https://api.flattr.com/js/0.5.0/load.js?mode=auto" type="text/javascript"></script> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://blog.onthewings.net/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AndyLi?a=Ew2MTYv1drg:-TAVF6iF1wQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AndyLi?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyLi?a=Ew2MTYv1drg:-TAVF6iF1wQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AndyLi?i=Ew2MTYv1drg:-TAVF6iF1wQ:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AndyLi/~4/Ew2MTYv1drg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.onthewings.net/2010/07/07/augmented-mirror-my-latest-project/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://blog.onthewings.net/2010/07/07/augmented-mirror-my-latest-project/</feedburner:origLink></item>
		<item>
		<title>Using multiple PS3Eye cameras with haXe/C++</title>
		<link>http://feedproxy.google.com/~r/AndyLi/~3/yd_6MP38fLw/</link>
		<comments>http://blog.onthewings.net/2010/06/08/using-multiple-ps3eye-cameras-with-haxe-cpp/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 06:57:08 +0000</pubDate>
		<dc:creator>liwingho</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Haxe]]></category>

		<guid isPermaLink="false">http://blog.onthewings.net/?p=821</guid>
		<description><![CDATA[Sony PS3Eye is probably the best web cam for CV stuff [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://peauproductions.com/ps3.html">Sony PS3Eye</a> is probably the best web cam for CV stuff: not expensive, cross platform, high frame rate(up to 120fps), no image compression etc. I&#8217;ve been using it in the past year and my experience is great.</p>
<p>In my final year project, I have been exploring stereo camera, ie. using multiple cameras at the same time. It is not too difficult, just place the cameras side-by-side in the same plane, with <a href="http://opencv.willowgarage.com/">OpenCV</a> you can calibrate them and compute a disparity map to get the depth info of the capture subject. What it means is you can do 3D tracking and probably 3D gesturing like <a href="http://www.xbox.com/en-us/live/projectnatal/">Project Natal</a>. And yes, I use PS3Eyes.</p>
<div style="width:700px;height: 320px;">
<div class="wp-caption alignleft" style="width: 325px"><a href="http://www.flickr.com/photos/andy-li/4681572508/"><img class="  " title="PS3Eyes" src="http://farm5.static.flickr.com/4061/4681572508_07db8a3c62.jpg" alt="" width="315" height="237" /></a><p class="wp-caption-text">4 PS3Eyes combined with their original parts (Front view).</p></div>
<div class="wp-caption alignleft" style="width: 325px"><a href="http://www.flickr.com/photos/andy-li/4681573632/"><img class="  " title="PS3Eyes" src="http://farm5.static.flickr.com/4049/4681573632_d1cfdf5010.jpg" alt="" width="315" height="237" /></a><p class="wp-caption-text">4 PS3Eyes combined with their original parts (Rear view).</p></div>
</div>
<p>I was using Ubuntu and <a href="http://www.openframeworks.cc/">OpenFrameworks</a> for the project and everything is fine. You do not need to install a driver for using PS3Eye, however, to get extra controls, I used <a href="http://bear24rw.blogspot.com/2009/11/ps3-eye-driver-patch.html">a patched driver</a>. But the driver is less stable and sometimes it outputs corrupted frames.</p>
<p>I have a bit more time these few days, so I try move back to Windows and port the code to use <a href="http://haxe.org/">haXe</a>/C++ with <a href="http://codelaboratories.com/">Code Laboratories</a>&#8216;s CLEye SDK. I created a simple binding to the SDK and the result is pretty good. I have again put the code to github (<a href="http://github.com/andyli/hxCLEye">hxCLEye</a>), and there is a sample program(<a href="http://github.com/andyli/hxCLEye/blob/master/Main.hx">Main.hx</a>), which use the not-yet-released <a href="http://code.google.com/p/nekonme/">nme2</a>. It still needs to be optimized for the Bytes=&gt;BitmapData conversion, but it is quite stable I think.</p>
<div class="tweetmeme_button" style="margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.onthewings.net%2F2010%2F06%2F08%2Fusing-multiple-ps3eye-cameras-with-haxe-cpp%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.onthewings.net%2F2010%2F06%2F08%2Fusing-multiple-ps3eye-cameras-with-haxe-cpp%2F&amp;source=andy_li&amp;style=compact&amp;service=bit.ly&amp;service_api=andyli%3AR_620a3608de8b1566599766b2ea71c3ba" height="61" width="50" />
			</a>
		</div> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://blog.onthewings.net/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AndyLi?a=yd_6MP38fLw:YtSZq5-tCnQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AndyLi?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyLi?a=yd_6MP38fLw:YtSZq5-tCnQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AndyLi?i=yd_6MP38fLw:YtSZq5-tCnQ:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AndyLi/~4/yd_6MP38fLw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.onthewings.net/2010/06/08/using-multiple-ps3eye-cameras-with-haxe-cpp/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://blog.onthewings.net/2010/06/08/using-multiple-ps3eye-cameras-with-haxe-cpp/</feedburner:origLink></item>
		<item>
		<title>haXe for interactivity/creative coding</title>
		<link>http://feedproxy.google.com/~r/AndyLi/~3/IgXHx6pCa2Q/</link>
		<comments>http://blog.onthewings.net/2010/05/06/haxe-for-interactivitycreative-coding/#comments</comments>
		<pubDate>Wed, 05 May 2010 16:08:52 +0000</pubDate>
		<dc:creator>liwingho</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Art & Design]]></category>
		<category><![CDATA[Haxe]]></category>

		<guid isPermaLink="false">http://blog.onthewings.net/?p=800</guid>
		<description><![CDATA[haXe fits the gap in interactivity/creative coding


 [...]]]></description>
			<content:encoded><![CDATA[<h3>haXe fits the gap in interactivity/creative coding</h3>
<div id="attachment_802" class="wp-caption alignright" style="width: 370px"><a href="http://processing.org/exhibition/"><img class="size-medium wp-image-802 " title="Processing Webpage" src="http://blog.onthewings.net/wp-content/uploads/2010/05/processing-webpage-450x297.png" alt="" width="360" height="238" /></a><p class="wp-caption-text">Processing, one of the most well-known language/framework for creative coding.</p></div>
<p>For interactivity/creative coding, except the graphical programming platforms like <a href="http://puredata.info/">Pure Data</a>, <a href="http://cycling74.com/products/maxmspjitter/">Max</a> and <a href="http://www.troikatronix.com/isadora.html">Isadora</a>, there are four major languages people are using:</p>
<ol>
<li>C++(<a href="http://www.openframeworks.cc/">OpenFramworks</a>),</li>
<li>Java(<a href="http://processing.org/">Processing</a>),</li>
<li>ActionScript, and</li>
<li>Python.</li>
</ol>
<p>The first two are developed mainly for the high performance nature of the languages, as real-time interaction and fancy visual effect is a main focus in creative coding, but they are somewhat difficult to designer/artist. ActionScript is mostly chosen for the friendliness of its API, tools and easy to distribute on the Internet, but it&#8217;s slow. Python is somewhere in the middle of the C++/Java and ActionScript: For once I heard that, if you want something faster than ActionScript but easier than C++, try Python. However I think programs created in Python are not easy to be distributed on the Internet, I mean, it cannot run in the browser. Also, Python&#8217;s syntax is less similar to the others (although it is still very nice <img src='http://blog.onthewings.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ).</p>
<p>I believe haXe has a very good potential to fit the gap. As we can use the friendly API of Flash to target C++ native code by using <a href="http://code.google.com/p/nekonme/">nme</a>/<a href="http://code.google.com/p/neash/">neash</a>. When we want to put the work on the Internet, simply compile it to swf or to HTML5 canvas with <a href="http://bitbucket.org/grumpytoad/canvas-nme">canvas-nme</a>. We get best of both worlds.</p>
<h3>What haXe is still missing</h3>
<p>After intensively using haXe for a few months, I discovered a few things are missing in haXe. But they are all being improved in progress.</p>
<h4>IDE</h4>
<p>First of all, a real solid IDE. Yes, there are <a href="http://haxe.org/com/ide">several IDEs with haXe plug-in</a> you can choose: On Windows you have <a href="http://www.flashdevelop.org/">FlashDevelop</a>, on Mac you have TextMate(I haven&#8217;t tried) and Linux there is Gedit.</p>
<div id="attachment_810" class="wp-caption alignleft" style="width: 325px"><a href="http://www.flashdevelop.org/"><img class="size-medium wp-image-810  " title="Create haXe project in FlashDevelop" src="http://blog.onthewings.net/wp-content/uploads/2010/05/haXe-FD-450x399.png" alt="" width="315" height="279" /></a><p class="wp-caption-text">FlashDevelop has build in support for haXe as well as ActionScript.</p></div>
<p>But if you want a cross-platform one, no, not yet. Cross-platform is important for creative coding as designers/artistes really love Mac. The amount of them using Mac is the same as those using Windows, if not more than. I myself spends a lot of time in all Windows/Mac/Linux, and I am sticking on Gedit on both Mac and Linux(Ubuntu) and avoiding to code in Windows&#8230; Gedit is usable on Mac but missing a few features like open terminal in the files panel or custom command with hotkey binding. And the UI is a little bit buggy, for example the code completion list can go off-screen&#8230;</p>
<p>There is <a href="http://code.google.com/p/eclihx/">eclihx</a>, the haXe plug-in for eclipse. But it is really really buggy that I cannot get it fully functioning on any OS. Code completion is my minimal requirement for an IDE, but I cannot get that from eclihx, although it says it has this feature&#8230;</p>
<p>The situation is improving. <a href="http://fdt.powerflasher.com/">FDT</a>, which many people prefer it to Flash Builder, will have haXe support in its version 4. Since it is based on eclipse, it will be available on the three main OSes. And it is more feature-complete than all the IDEs I&#8217;ve tried at the moment. Although it is not open source, but <a href="http://www.fdt.powerflasher.com/developer-tools/fdt-3/meta-content/os-request/">open source developers can get a free license from them</a> (hope the program will continue for version 4).</p>
<p>Moreover, <a href="http://lists.motion-twin.com/pipermail/haxe/2010-March/034541.html">discussed on the haXe mailing list</a>, people are investigating the possibility of building a web based IDE, like <a href="https://bespin.mozillalabs.com/">Bespin from Mozilla</a>. There is a <a href="http://groups.google.at/group/hide_haxe">Google group created over there</a> but no actual development has started yet. Join it if you&#8217;re interested.</p>
<h4>Libraries</h4>
<p>Number of libraries that designed exclusively for haXe is still small. There are quite a few pretty good ones though, like the data structure lib and 2D physic engine from <a href="http://lab.polygonal.de/">polygonal lab</a> (<a href="http://lib.haxe.org/p/polygonal">available from haxelib</a>). But for interactivity/creative coding, libraries for vector graphics, image processing, hardware integration etc. are still missing.</p>
<div class="wp-caption alignright" style="width: 326px"><a href="http://arduino.cc/"><img title="Arduino" src="http://arduino.cc/en/uploads/Main/arduino316.jpg" alt="" width="316" height="220" /></a><p class="wp-caption-text">Arduino. Photo by Nicholas Zambetti</p></div>
<p>I&#8217;m working on this area, trying to port some of the libraries from different languages or at least to create a haXe binding. I first <a href="http://blog.onthewings.net/2010/04/06/casahx-casa-lib-for-haxe/">ported Casa Lib</a>, as <a href="http://github.com/andyli/casahx">CasaHx</a>, which is a big collection of small classes. I&#8217;m also <a href="http://blog.onthewings.net/2010/03/18/sandy3d-c-haxe/">working on C++ target of Sandy3D</a>, but still waiting for the next release of <a href="http://code.google.com/p/hxcpp/">hxcpp</a> and the release of <a href="http://code.google.com/p/nekonme/source/browse/#svn/trunk/version2">nme2</a>. <a href="http://github.com/andyli/hxSerial">hxSerial</a> is my latest creation, based on ofSerial in OpenFrameworks, enabling serial port communication from haXe/C++ program, so that you can talk to <a href="http://arduino.cc/">Arduino</a>, for example.</p>
<p>Some ideas I will try later in the future (if I have time) will be:</p>
<ul>
<li>Binding <a href="http://opencv.willowgarage.com/">OpenCV</a> to haXe/C++.</li>
<li>Binding OpenFrameworks to again haXe/C++.</li>
<li>Creating a haXe OSC/TUIO lib.</li>
<li>Porting my <a href="http://code.google.com/p/stk-in-as3/">stk-in-as3</a> to haXe.</li>
<li>Porting AS3 branch of <a href="http://www.degrafa.org/">Degrafa</a> to haXe.</li>
<li>Porting <a href="http://www.libspark.org/wiki/saqoosha/FLARToolKit/en">FLARtoolkit</a> to haXe (<a href="http://saqoosha.net/">saqoosha</a>, the author of FLARtoolkit may have done this before me, since he started to use haXe too).</li>
</ul>
<p>Well, if you&#8217;re interested, feel free to work on those ideas and let me know your result/progress <img src='http://blog.onthewings.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h4>Community</h4>
<p>The last one is a community of interactivity/creative coding in haXe. It is always a good thing if there are more people you can share your creations with and ask question from. Hope the community will grow after the above is improved <img src='http://blog.onthewings.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="tweetmeme_button" style="margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.onthewings.net%2F2010%2F05%2F06%2Fhaxe-for-interactivitycreative-coding%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.onthewings.net%2F2010%2F05%2F06%2Fhaxe-for-interactivitycreative-coding%2F&amp;source=andy_li&amp;style=compact&amp;service=bit.ly&amp;service_api=andyli%3AR_620a3608de8b1566599766b2ea71c3ba" height="61" width="50" />
			</a>
		</div><script type="text/javascript">
var flattr_wp_ver = '0.9.14';
var flattr_uid = '18655';
var flattr_url = 'http://blog.onthewings.net';
var flattr_lng = 'en_GB';
var flattr_cat = 'text';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'Andy Li&#039;s Blog';
var flattr_dsc = 'Blog on haXe, Flash/Flex, web development, design, media art, and my personal life.';
</script>
<script src="https://api.flattr.com/js/0.5.0/load.js?mode=auto" type="text/javascript"></script> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://blog.onthewings.net/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AndyLi?a=IgXHx6pCa2Q:z9_fjCvdLK8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AndyLi?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyLi?a=IgXHx6pCa2Q:z9_fjCvdLK8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AndyLi?i=IgXHx6pCa2Q:z9_fjCvdLK8:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AndyLi/~4/IgXHx6pCa2Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.onthewings.net/2010/05/06/haxe-for-interactivitycreative-coding/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://blog.onthewings.net/2010/05/06/haxe-for-interactivitycreative-coding/</feedburner:origLink></item>
		<item>
		<title>CanvasBlock: a GM script to block canvas tag (should we…or can we?)</title>
		<link>http://feedproxy.google.com/~r/AndyLi/~3/r08Mr4U0KX8/</link>
		<comments>http://blog.onthewings.net/2010/04/13/canvasblock-a-gm-script-to-block-canvas-tag-should-we-or-can-we/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 18:41:49 +0000</pubDate>
		<dc:creator>liwingho</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Haxe]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.onthewings.net/?p=769</guid>
		<description><![CDATA[HTML5 is believed to be the Flash killer and will repla [...]]]></description>
			<content:encoded><![CDATA[<p>HTML5 is believed to be the Flash killer and will replace Flash in the future. Eventually those Flash-haters will become canvas-haters, so a canvas-blocking GreaseMonkey script will be useful (at least they think it will be).</p>
<p>I myself was making it for fun. I don&#8217;t think we should block any HTML5 tags anytime since it is a part of the web, just like I do not agree people blocking Flash. What is interesting is, seems like we cannot effectively block the canvas tag, which will be discussed later in this post.</p>
<h3>Features</h3>
<p>I made the script blocks not only canvas tag but also video tag and audio tag. It is because Flash is going to be replaced by all the three tags but not only canvas. Video and audio can be as annoying as canvas.</p>
<p>Like those Flash-blockers, the blocked contents are replaced by a line of text, &#8220;Click to show xxxx&#8221;. You may click on it to get back the blocked content.</p>
<p>CanvasBlock is tested on FireFox 3.6 on Mac, FireFox 3.5 on Ubuntu and Chrome on Ubuntu. Other platforms should works too.</p>
<h3>Implementing the script</h3>
<p>I used haXe instead of writing pure JS. No big reason here, just to see if it is possible. Turn out there is no big difference from using JS, you just need to copy all the meta data to the compiled JS file. And the events listener need to be assigned by &#8220;addEventListener&#8221; instead of something like &#8220;onclick = function &#8230;&#8221;.</p>
<p>Detecting HTML5 tags is easier than detecting Flash objects. Firstly, the tags are standardized meaning you can simply use &#8220;getElementsByTagName&#8221;. For Flash objects you need to check the params of the &#8220;object&#8221; and the &#8220;embed&#8221; tags, which is a bit troublesome. Secondly, currently no one (at least not much ppl) is creating canvas tags on the fly, unlike for Flash the standard way is to use swfobject. So I can detect the tags once the DOM is ready, no need to wait for the execution of the page&#8217;s JS.</p>
<p>Replacing the tags and saving them for later retrieval is easy too. Using normal JS method will work.</p>
<h3>The tags are blocked but&#8230;</h3>
<p>The script is functional and I went to do some more testing. Blocking video and audio seems ok, but there is some problem of blocking canvas.</p>
<h4>Possibility of Freezing/Crashing</h4>
<p>I went to <a href="http://www.chromeexperiments.com/">ChromeExperiments</a> and randomly picked <a href="http://www.chromeexperiments.com/detail/asteroids-game/">one</a>. You know what? The browser freezed.</p>
<p>So, look like after I blocked the canvas, the JS on the page which is used to draw thing on the canvas originally, is still there trying to work on the canvas. And this become a big problem since I don&#8217;t know exactly which JS function is going to work on canvas, because different web page have different functions, so no way I can work on that. You can completely disable JS, but this is not a CanvasBlock should do.</p>
<div id="attachment_773" class="wp-caption alignleft" style="width: 280px"><a href="http://blog.onthewings.net/wp-content/uploads/2010/04/errorAfterBlockingCanvas.png"><img class="size-medium wp-image-773 " title="Error was shown after blocking canvas" src="http://blog.onthewings.net/wp-content/uploads/2010/04/errorAfterBlockingCanvas-450x281.png" alt="" width="270" height="169" /></a><p class="wp-caption-text">Browser freezed and an timeout message was shown after blocking canvas.</p></div>
<p>However, I have tested some more web page and they are ok with the blocking script. So maybe only some complex JS will have this problem. But anyway the possibility of freezing a browser is not a good thing.</p>
<h4>No significant reduction on CPU usage</h4>
<p>The remaining JS script  problem reminded me to test on the CPU usage. And the result is, blocking canvas does not bring significant reduction on CPU usage. See the following screenshots, which is using <a href="http://www.chromeexperiments.com/detail/aquarium/">another Chrome experiment</a>:</p>
<div id="attachment_775" class="wp-caption alignnone" style="width: 727px"><a href="http://blog.onthewings.net/wp-content/uploads/2010/04/cpuUsage-1.png"><img class="size-large wp-image-775 " title="CPU Usage Screenshot 1" src="http://blog.onthewings.net/wp-content/uploads/2010/04/cpuUsage-1-1024x640.png" alt="" width="717" height="448" /></a><p class="wp-caption-text">Page opened, canvas blocked. However CPU usage still rise to a very high level.</p></div>
<div id="attachment_777" class="wp-caption alignnone" style="width: 727px"><a href="http://blog.onthewings.net/wp-content/uploads/2010/04/cpuUsage-2.png"><img class="size-large wp-image-777 " title="CPU Usage Screenshot 2" src="http://blog.onthewings.net/wp-content/uploads/2010/04/cpuUsage-2-1024x640.png" alt="" width="717" height="448" /></a><p class="wp-caption-text">Clicked to show back the canvas. CPU usage rose even higher, but not much difference.</p></div>
<p>So what&#8217;s that mean? Again if I want to block the real CPU hog, I should block the JS with the canvas. But again, stated above, it is not possible to block the right function without blocking all JS.</p>
<h3>Conclusion</h3>
<p>Blocking canvas can only introduce little benefit on CPU usage but give you possibility of freezing/crashing!</p>
<p>Let&#8217;s look at Flash again. Flash can be blocked easily because ActionScript is included in the swf. Removing the swf from the page automatically removes the associated scripts. Also, usually JS does not control a Flash object so it is pretty safe to kick Flash out without dealing with the remained JS. From this point of view, seems that Flash is more user friendly than canvas, and HTML5 ads will be more annoying than Flash ads&#8230;</p>
<p>If you want to try, you may install the script from <a href="http://userscripts.org/scripts/show/74216">CanvasBlock&#8217;s page on userscripts.org</a>.</p>
<p>You&#8217;re also welcome to get the haXe source from <a href="http://github.com/andyli/CanvasBlock">CanvasBlock&#8217;s github repo</a>.</p>
<div class="tweetmeme_button" style="margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.onthewings.net%2F2010%2F04%2F13%2Fcanvasblock-a-gm-script-to-block-canvas-tag-should-we-or-can-we%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.onthewings.net%2F2010%2F04%2F13%2Fcanvasblock-a-gm-script-to-block-canvas-tag-should-we-or-can-we%2F&amp;source=andy_li&amp;style=compact&amp;service=bit.ly&amp;service_api=andyli%3AR_620a3608de8b1566599766b2ea71c3ba" height="61" width="50" />
			</a>
		</div> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://blog.onthewings.net/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AndyLi?a=r08Mr4U0KX8:Ia8oumGlOJI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AndyLi?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyLi?a=r08Mr4U0KX8:Ia8oumGlOJI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AndyLi?i=r08Mr4U0KX8:Ia8oumGlOJI:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AndyLi/~4/r08Mr4U0KX8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.onthewings.net/2010/04/13/canvasblock-a-gm-script-to-block-canvas-tag-should-we-or-can-we/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.onthewings.net/2010/04/13/canvasblock-a-gm-script-to-block-canvas-tag-should-we-or-can-we/</feedburner:origLink></item>
		<item>
		<title>CasaHx – CASA Lib for haXe</title>
		<link>http://feedproxy.google.com/~r/AndyLi/~3/9YDscbkA8Jw/</link>
		<comments>http://blog.onthewings.net/2010/04/06/casahx-casa-lib-for-haxe/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 13:13:05 +0000</pubDate>
		<dc:creator>liwingho</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Haxe]]></category>

		<guid isPermaLink="false">http://blog.onthewings.net/?p=756</guid>
		<description><![CDATA[I've mentioned that I was porting CASA Lib for AS3 to h [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve mentioned that I was porting <a href="http://casalib.org/">CASA Lib for AS3</a> to haXe in the last blog post. I&#8217;m happy to tell you that it is finished and has been uploaded to <a href="http://lib.haxe.org/p/casalib">haxelib</a>.</p>
<p>If you&#8217;re not familiar with it, it has a set of display object classes that have build in methods for removing all listeners/all children, and a destroy method that do that all in once. There are also simple tweening classes, layout helper and a huge set of utilities.</p>
<p>I try to make all the classes as cross-target as possible so that you can use it in JS/C++/PHP/Neko (some of them need nme/neash/canvas-nme).</p>
<p>With haXe&#8217;s &#8220;using&#8221; keyword, the utility classes are even sweeter than the AS3 version. Let&#8217;s take an example form the official documentation(in AS3):</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> people<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Array</span><span style="color: #000000;">&#40;</span>	<span style="color: #000000;">&#123;</span><span style="color: #004993;">name</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">&quot;Aaron&quot;</span>, sex<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">&quot;Male&quot;</span>, hair<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">&quot;Brown&quot;</span><span style="color: #000000;">&#125;</span>,
				<span style="color: #000000;">&#123;</span><span style="color: #004993;">name</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">&quot;Linda&quot;</span>, sex<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">&quot;Female&quot;</span>, hair<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">&quot;Blonde&quot;</span><span style="color: #000000;">&#125;</span>,
				<span style="color: #000000;">&#123;</span><span style="color: #004993;">name</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">&quot;Katie&quot;</span>, sex<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">&quot;Female&quot;</span>, hair<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">&quot;Brown&quot;</span><span style="color: #000000;">&#125;</span>,
				<span style="color: #000000;">&#123;</span><span style="color: #004993;">name</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">&quot;Nikki&quot;</span>, sex<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">&quot;Female&quot;</span>, hair<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">&quot;Blonde&quot;</span><span style="color: #000000;">&#125;</span>	<span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> person<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Object</span> = ArrayUtil.getItemByKeys<span style="color: #000000;">&#40;</span>people, <span style="color: #000000;">&#123;</span>sex<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">&quot;Female&quot;</span>, hair<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">&quot;Brown&quot;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>person.<span style="color: #004993;">name</span><span style="color: #000000;">&#41;</span>; <span style="color: #009900;">// Traces &quot;Katie&quot;</span></pre></div></div>

<p>Now you can write it in haXe in this way:</p>

<div class="wp_syntax"><div class="code"><pre class="haxe" style="font-family:monospace;">using org.casalib.ArrayUtil;
&nbsp;
var people = [	{name: &quot;Aaron&quot;, sex: &quot;Male&quot;, hair: &quot;Brown&quot;},
		{name: &quot;Linda&quot;, sex: &quot;Female&quot;, hair: &quot;Blonde&quot;},
		{name: &quot;Katie&quot;, sex: &quot;Female&quot;, hair: &quot;Brown&quot;},
		{name: &quot;Nikki&quot;, sex: &quot;Female&quot;, hair: &quot;Blonde&quot;}	];
&nbsp;
var person = people.getItemByKeys({sex: &quot;Female&quot;, hair: &quot;Brown&quot;});
trace(person.name); // Traces &quot;Katie&quot;</pre></div></div>

<p>Note that with &#8220;using&#8221;, auto-completion can also show the added methods (from ArrayUtil, for the above example).</p>
<p>I&#8217;ve also typed all the methods. That means, for ArrayUtil.getItemByKeys() with a Array&lt;Point&gt; input, its output will be typed as Point. Nice feature of haXe isn&#8217;t it?</p>
<p>PS. Aaron Clinger, the author of CASA Lib, has found me some days ago. He is very nice that may put CasaHx as the official branch of CASA Lib when it is mature enough <img src='http://blog.onthewings.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="tweetmeme_button" style="margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.onthewings.net%2F2010%2F04%2F06%2Fcasahx-casa-lib-for-haxe%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.onthewings.net%2F2010%2F04%2F06%2Fcasahx-casa-lib-for-haxe%2F&amp;source=andy_li&amp;style=compact&amp;service=bit.ly&amp;service_api=andyli%3AR_620a3608de8b1566599766b2ea71c3ba" height="61" width="50" />
			</a>
		</div><script type="text/javascript">
var flattr_wp_ver = '0.9.14';
var flattr_uid = '18655';
var flattr_url = 'http://blog.onthewings.net';
var flattr_lng = 'en_GB';
var flattr_cat = 'text';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'Andy Li&#039;s Blog';
var flattr_dsc = 'Blog on haXe, Flash/Flex, web development, design, media art, and my personal life.';
</script>
<script src="https://api.flattr.com/js/0.5.0/load.js?mode=auto" type="text/javascript"></script> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://blog.onthewings.net/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AndyLi?a=9YDscbkA8Jw:Ak6rTiTfjKc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AndyLi?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyLi?a=9YDscbkA8Jw:Ak6rTiTfjKc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AndyLi?i=9YDscbkA8Jw:Ak6rTiTfjKc:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AndyLi/~4/9YDscbkA8Jw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.onthewings.net/2010/04/06/casahx-casa-lib-for-haxe/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.onthewings.net/2010/04/06/casahx-casa-lib-for-haxe/</feedburner:origLink></item>
		<item>
		<title>Sandy3D, C++, Haxe</title>
		<link>http://feedproxy.google.com/~r/AndyLi/~3/UnEIwT7wz2Y/</link>
		<comments>http://blog.onthewings.net/2010/03/18/sandy3d-c-haxe/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 23:39:21 +0000</pubDate>
		<dc:creator>liwingho</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[Haxe]]></category>
		<category><![CDATA[Sandy3D]]></category>

		<guid isPermaLink="false">http://blog.onthewings.net/?p=730</guid>
		<description><![CDATA[I've been learning Haxe since the last few months. Besi [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been learning <a href="http://haxe.org/">Haxe</a> since the last few months. Beside the reason of many Flash guys moved/moving to Haxe because of better performance of compiled swf, I was tempted to try using its C++ target, which runs even faster(at least in theory, in most parts). Its language feature is also very nice, which is quite similar to AS3 but more powerful in many aspects. Check out its <a href="http://haxe.org/doc/features">feature page</a> if you want to know more.</p>
<p>And because of I need to write some 3D stuff in a project, I tried finding a Haxe 3D engine  that can compiled to C++, but who knows, there wasn&#8217;t one. Actually the 3D engines in Haxe are all quite young. There are 3 I found, all targeting only Flash: <a href="http://www.flashsandy.org/">Sandy3D</a>, originally written in AS, has switched its trunk to Haxe; <a href="http://www.away3d.com/">Away3D</a>, again originally written in AS, now has a Haxe branch inside its SVN in active development; <a href="http://code.google.com/p/haxe3d/">Haxe3D</a>, developed by Nicolas(the creator of Haxe), written in Haxe from the very beginng, seems to be very light-weight but I can&#8217;t found much info about it.</p>
<p>So I decide to work on one of them to enable a Haxe C++ 3D engine. Because Sandy3D should be the most complete and stable one(which actually stopped active development&#8230;), I chose it.</p>
<p>In the development of it, some issues are related to <a href="http://code.google.com/p/nekonme/">nme</a>/<a href="http://code.google.com/p/neash/">neash</a>, which are the re-invented cross-platform Haxe version of the Flash API. With the help from <a href="http://gamehaxe.com/">Hugh</a> and Niel, project owner of <a href="http://code.google.com/p/neash/">neash</a> and developer of Sandy3D, most of the problems are solved. However as I can see, re-inventing the Flash API is a hard job as consideration of other target is also needed, eg. JS/Canvas. <a href="http://ideas.adobe.com/ct/ct_a_view_idea.bix?c=975F47A1-B925-4456-89DB-3BEFB1DA7780&amp;idea_id=D62AC800-1BD6-4C79-85A7-6CCCE1C403AC">I really hope Adobe can help this</a>.</p>
<p>Currently some very basic demos of Sandy can be compiled to C++ and it shows that, in OpenGL rendering mode, the performance can goes over 300% of the Flash(Haxe, not AS3) version. However in normal rendering mode, the frame rate may actually be reduced if the window size is large. Anyway, I think the performance is quite depend on hardware/OS, also the 3D scene you&#8217;re showing.</p>
<p>Thanks for the Sandy3D team, they added me as a committer in their official Google project. And I have just committed the changes to the trunk <img src='http://blog.onthewings.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  There should be a new release soon if everything is fine.</p>
<p>A note to the ones can&#8217;t wait for a release:</p>
<p style="padding-left: 30px;">1.Install hxcpp, nme, neash from haxelib.</p>
<p style="padding-left: 30px;">2.Replace contents in neash&#8217;s neash/display/IBitmapDrawable.hx to a simple &#8220;typedef IBitmapDrawable =<br />
nme.display.IBitmapDrawable;&#8221;.</p>
<p style="padding-left: 30px;">3.To make mouse event work, in neash&#8217;s neash/Lib.hx, the code:</p>
<p style="padding-left: 30px;">// Process pending timers &#8230;<br />
neash.Timer.CheckTimers();<br />
// Send frame-enter event<br />
var event = new Event( Event.ENTER_FRAME );<br />
mStage.Broadcast(event);</p>
<p style="padding-left: 30px;">should be moved to the end of the do-while loop, just before the:</p>
<p style="padding-left: 30px;">mStage.RenderAll();</p>
<p style="padding-left: 30px;">4.For mouse event in opengl mode to work, additional fix which required a recompile of nme is needed. I haven&#8217;t tried<br />
yet. Now just ingore this&#8230;</p>
<p style="padding-left: 30px;">5.You should be able to use Sandy3D in C++ without the above patches for the next release of nme/neash. But for now, please do it.</p>
<p>BTW, I am also <del datetime="2010-04-06T07:55:01+00:00">porting</del> ported <a href="http://casalib.org/">casalib</a>, which I often use in AS3 development, to Haxe, see <a href="http://github.com/andyli/casahx">casahx</a>.</p>
<div class="tweetmeme_button" style="margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.onthewings.net%2F2010%2F03%2F18%2Fsandy3d-c-haxe%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.onthewings.net%2F2010%2F03%2F18%2Fsandy3d-c-haxe%2F&amp;source=andy_li&amp;style=compact&amp;service=bit.ly&amp;service_api=andyli%3AR_620a3608de8b1566599766b2ea71c3ba" height="61" width="50" />
			</a>
		</div> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://blog.onthewings.net/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AndyLi?a=UnEIwT7wz2Y:nCZTpfTVldk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AndyLi?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyLi?a=UnEIwT7wz2Y:nCZTpfTVldk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AndyLi?i=UnEIwT7wz2Y:nCZTpfTVldk:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AndyLi/~4/UnEIwT7wz2Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.onthewings.net/2010/03/18/sandy3d-c-haxe/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.onthewings.net/2010/03/18/sandy3d-c-haxe/</feedburner:origLink></item>
		<item>
		<title>Colorblink – An AIR app that simulates how color blind people see Flash and images</title>
		<link>http://feedproxy.google.com/~r/AndyLi/~3/BeCuf42qzDM/</link>
		<comments>http://blog.onthewings.net/2010/02/19/colorblink-an-air-app-that-simulates-how-color-blind-people-see-flash-and-images/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 12:55:31 +0000</pubDate>
		<dc:creator>liwingho</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Pixel Bender]]></category>
		<category><![CDATA[web usability design and engineering]]></category>

		<guid isPermaLink="false">http://blog.onthewings.net/?p=717</guid>
		<description><![CDATA[

Accessibility is a an important part of both web a [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_718" class="wp-caption alignleft" style="width: 460px"><a href="http://blog.onthewings.net/wp-content/uploads/2010/02/colorblink-demo.png"><img class="size-medium wp-image-718" title="Colorblink demo" src="http://blog.onthewings.net/wp-content/uploads/2010/02/colorblink-demo-450x364.png" alt="" width="450" height="364" /></a><p class="wp-caption-text">Select color blind type from the menu.</p></div>
<p>Accessibility is a an important part of both web and game design. And for web and game design, one of the popular tool is Flash. That means very often you need to ensure accessibility in Flash. However there are still not many tools available even for simple things like color blind simulation&#8230; so I write my own:)</p>
<p><a href="http://github.com/andyli/Colorblink/raw/master/Colorblink.air">&gt;&gt; download installer (.air)</a></p>
<p>It&#8217;s a very simple AIR app. You open it, drop a swf file on its window, select the color blind type and that&#8217;s it.</p>
<p>The inner of Colorblink is using a Pixel Bender filter, applying to the whole application. The algorithm is just a color transform matrix, found in <a href="http://homepage.mac.com/lpetrich/ColorBlindnessSim/ColorBlindnessSim.html">a Java Color-Blindness Simulators</a>. That simulator have more simulation config, which I used only the simplest one.</p>
<p>This is also my first time using a git repo. So <a href="http://github.com/andyli/Colorblink">go to have a look</a>, see if you can fork it for more features.</p>
<p><span style="text-decoration:line-through">One thing is, there is problem loading Flex applications into Colorblink&#8230; I don&#8217;t know how to read the loaded app&#8217;s default width and height and then resize it&#8230; So, if you want to test your Flex app, <a href="http://github.com/andyli/Colorblink/tree/master/src/net/onthewings/filters/">get the filter</a> and apply it to your app manually (can&#8217;t be easier).</span><br />
Now you can load Flex swf or even html file! But the app wouldn&#8217;t resize automatically since the size cannot be determined. If Colorblink does not work for you, you can still always <a href="http://github.com/andyli/Colorblink/tree/master/src/net/onthewings/filters/">get the filter</a> and apply it to your app manually (can&#8217;t be easier).</p>
<p>Oh, yes, there is a simulation of what a dog sees&#8230; So, design some game for your dogs in your free time&#8230;</p>
<div class="tweetmeme_button" style="margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.onthewings.net%2F2010%2F02%2F19%2Fcolorblink-an-air-app-that-simulates-how-color-blind-people-see-flash-and-images%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.onthewings.net%2F2010%2F02%2F19%2Fcolorblink-an-air-app-that-simulates-how-color-blind-people-see-flash-and-images%2F&amp;source=andy_li&amp;style=compact&amp;service=bit.ly&amp;service_api=andyli%3AR_620a3608de8b1566599766b2ea71c3ba" height="61" width="50" />
			</a>
		</div><script type="text/javascript">
var flattr_wp_ver = '0.9.14';
var flattr_uid = '18655';
var flattr_url = 'http://blog.onthewings.net';
var flattr_lng = 'en_GB';
var flattr_cat = 'text';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'Andy Li&#039;s Blog';
var flattr_dsc = 'Blog on haXe, Flash/Flex, web development, design, media art, and my personal life.';
</script>
<script src="https://api.flattr.com/js/0.5.0/load.js?mode=auto" type="text/javascript"></script> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://blog.onthewings.net/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AndyLi?a=BeCuf42qzDM:rQxwC2CdO2U:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AndyLi?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyLi?a=BeCuf42qzDM:rQxwC2CdO2U:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AndyLi?i=BeCuf42qzDM:rQxwC2CdO2U:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AndyLi/~4/BeCuf42qzDM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.onthewings.net/2010/02/19/colorblink-an-air-app-that-simulates-how-color-blind-people-see-flash-and-images/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://blog.onthewings.net/2010/02/19/colorblink-an-air-app-that-simulates-how-color-blind-people-see-flash-and-images/</feedburner:origLink></item>
		<item>
		<title>A Greasemonkey script for you to try the “Amazing,Awesome,Great,Incredible…” iPad web experience</title>
		<link>http://feedproxy.google.com/~r/AndyLi/~3/NLScEqyY6cA/</link>
		<comments>http://blog.onthewings.net/2010/02/02/a-greasemonkey-script-for-you-to-try-the-amazingawesomegreatincredible-ipad-web-experience/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 07:58:48 +0000</pubDate>
		<dc:creator>liwingho</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://blog.onthewings.net/?p=701</guid>
		<description><![CDATA[

Steve Jobs says the iPad is "Amazing, Awesome, Beau [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_702" class="wp-caption alignleft" style="width: 324px"><a href="http://blog.onthewings.net/wp-content/uploads/2010/02/Aviary-theflashblog-com-Picture-1.png"><img class="size-full wp-image-702  " title="ultimate browsing experience of iPad" src="http://blog.onthewings.net/wp-content/uploads/2010/02/Aviary-theflashblog-com-Picture-1.png" alt="" width="314" height="243" /></a><p class="wp-caption-text">Concept image from The Flash Blog demostrates iPad&#39;s ultimate browsing experience.</p></div>
<p>Steve Jobs says the iPad is <a href="http://gizmodo.com/5461445/the-apple-ipad-keynote-in-3-minutes-of-adjectives">&#8220;Amazing, Awesome, Beautiful, Great, Incredible, Really Nice and Unbelievable&#8221;</a>. I&#8217;m sure you wanna try it. If you still haven&#8217;t get one to experience by yourself, here I made a little GreaseMonkey script for you to feel it first.</p>
<p>Once you installed the <a href="http://userscripts.org/scripts/show/67828">iPad experience script</a> on FireFox (or any other browser that can use user script), you wouldn&#8217;t see any Flash elements again. No more Flash can hurt you or your children. Instead, all the swfs are replaced with a &#8220;Amazing, Awesome, Beautiful, Great, Incredible, Really Nice and Unbelievable&#8221; blue lego, reminding you the glory of Apple.</p>
<p>Update:<br />
You can use it in Chrome now (if you have extension enabled)!</p>
<div class="tweetmeme_button" style="margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.onthewings.net%2F2010%2F02%2F02%2Fa-greasemonkey-script-for-you-to-try-the-amazingawesomegreatincredible-ipad-web-experience%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.onthewings.net%2F2010%2F02%2F02%2Fa-greasemonkey-script-for-you-to-try-the-amazingawesomegreatincredible-ipad-web-experience%2F&amp;source=andy_li&amp;style=compact&amp;service=bit.ly&amp;service_api=andyli%3AR_620a3608de8b1566599766b2ea71c3ba" height="61" width="50" />
			</a>
		</div> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://blog.onthewings.net/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AndyLi?a=NLScEqyY6cA:L2vG3GuUeOY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AndyLi?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyLi?a=NLScEqyY6cA:L2vG3GuUeOY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AndyLi?i=NLScEqyY6cA:L2vG3GuUeOY:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AndyLi/~4/NLScEqyY6cA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.onthewings.net/2010/02/02/a-greasemonkey-script-for-you-to-try-the-amazingawesomegreatincredible-ipad-web-experience/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.onthewings.net/2010/02/02/a-greasemonkey-script-for-you-to-try-the-amazingawesomegreatincredible-ipad-web-experience/</feedburner:origLink></item>
		<item>
		<title>Possibly the worst lift button arrangement I have ever met</title>
		<link>http://feedproxy.google.com/~r/AndyLi/~3/_NobwEdksbg/</link>
		<comments>http://blog.onthewings.net/2010/01/23/possibly-the-worst-lift-button-arrangement-i-have-ever-met/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 07:54:33 +0000</pubDate>
		<dc:creator>liwingho</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Art & Design]]></category>

		<guid isPermaLink="false">http://blog.onthewings.net/?p=681</guid>
		<description><![CDATA[Here we have many lifts in Hong Kong since we have so m [...]]]></description>
			<content:encoded><![CDATA[<p>Here we have many lifts in Hong Kong since we have so many tall buildings. One of the lift I am using very often is the one inside Festival Walk(a shopping mall). Here are its buttons:</p>
						<div class="flickr-gallery image none"><a href="http://www.flickr.com/photos/andy-li/4297220330"><img class="flickr medium" title="Buttons in the lift of Festival Walk" alt="Buttons in the lift of Festival Walk" src="http://farm3.static.flickr.com/2714/4297220330_e87d036e51.jpg" /></a></div>
					
<p>First of all, the mixed use of letters and numbers (also an icon) to name floor is confusing. I have seen many people had difficulty finding the right floor at first sight. If there were tens of floors which goes from lower-ground 5 to upper-ground 25, grouping the floors with something like &#8220;UG&#8221; and &#8220;LG&#8221; would be meaningful. But as you can see in the photo, there are only seven floors&#8230; So actually I cannot really tell it is some kind of grouping as the group has at most two members only&#8230; And for &#8220;UG&#8221;, I really don&#8217;t know why they&#8217;re not naming the &#8220;1&#8243; and &#8220;2&#8243; with &#8220;UG&#8221; as &#8220;UG1&#8243;,&#8221;UG2&#8243;,&#8221;UG3&#8243;. Or simply use &#8220;1&#8243;,&#8221;2&#8243;,&#8221;3&#8243;? You also need to think if &#8220;LG2&#8243; or &#8220;LG1&#8243; is upper floor.</p>
<p>Secondly, not all Hong Kong people know &#8220;LG&#8221; and &#8220;UG&#8221; stand for &#8220;lower-ground&#8221; and &#8220;upper-ground&#8221;. I have some friends misunderstood &#8220;UG&#8221; as underground&#8230; The users are mostly Hong Kong people which are not having English as native language. Anyway I don&#8217;t see a point why not use &#8220;-1&#8243;, &#8220;0&#8243;, &#8220;1&#8243;, &#8220;2&#8243;&#8230;</p>
<p>Lastly, the arrangement of the grid is confusing. The arrangement is different from written English(left to right, top to bottom) or traditional Chinese(top to bottom, right to left). See below:</p>
<p><a href="http://blog.onthewings.net/wp-content/uploads/2010/01/arrangments.png"><img class="alignnone size-full wp-image-684" title="arrangments" src="http://blog.onthewings.net/wp-content/uploads/2010/01/arrangments.png" alt="" width="720" height="192" /></a></p>
<p>Not only Festival Walk, but also City University of Hong Kong has this arrangment:</p>
						<div class="flickr-gallery image none"><a href="http://www.flickr.com/photos/andy-li/4296473837"><img class="flickr medium" title="Buttons in the lift of City University of Hong Kong" alt="Buttons in the lift of City University of Hong Kong" src="http://farm3.static.flickr.com/2709/4296473837_c11e29626a.jpg" /></a></div>
					
<p>Is that only Hong Kong has these kind of lift? If so, maybe that&#8217;s because we Hong Kong people are proud to have both Western and Chinese culture which expressed in lift button arrangement?</p>
<p>Update:<br />
I finally have found another example of the arrangement, that is&#8230; Japanese comic?!</p>
<div class="tweetmeme_button" style="margin: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.onthewings.net%2F2010%2F01%2F23%2Fpossibly-the-worst-lift-button-arrangement-i-have-ever-met%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.onthewings.net%2F2010%2F01%2F23%2Fpossibly-the-worst-lift-button-arrangement-i-have-ever-met%2F&amp;source=andy_li&amp;style=compact&amp;service=bit.ly&amp;service_api=andyli%3AR_620a3608de8b1566599766b2ea71c3ba" height="61" width="50" />
			</a>
		</div><script type="text/javascript">
var flattr_wp_ver = '0.9.14';
var flattr_uid = '18655';
var flattr_url = 'http://blog.onthewings.net';
var flattr_lng = 'en_GB';
var flattr_cat = 'text';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'Andy Li&#039;s Blog';
var flattr_dsc = 'Blog on haXe, Flash/Flex, web development, design, media art, and my personal life.';
</script>
<script src="https://api.flattr.com/js/0.5.0/load.js?mode=auto" type="text/javascript"></script> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://blog.onthewings.net/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AndyLi?a=_NobwEdksbg:2rUkO5-Unkg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AndyLi?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AndyLi?a=_NobwEdksbg:2rUkO5-Unkg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AndyLi?i=_NobwEdksbg:2rUkO5-Unkg:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AndyLi/~4/_NobwEdksbg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.onthewings.net/2010/01/23/possibly-the-worst-lift-button-arrangement-i-have-ever-met/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.onthewings.net/2010/01/23/possibly-the-worst-lift-button-arrangement-i-have-ever-met/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 1.366 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-09-05 11:34:50 -->
