<?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/"
	>

<channel>
	<title>kepo-ing Zz85</title>
	<atom:link href="http://www.lab4games.net/zz85/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lab4games.net/zz85/blog</link>
	<description>Dumping Ground for Diverse Dictus Thoughts of Me</description>
	<pubDate>Mon, 09 Aug 2010 14:26:05 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>[MusicGeekNotes] Creating Music With Graphics, Lights and Smokes.</title>
		<link>http://www.lab4games.net/zz85/blog/2010/08/09/musicgeeknotes-creating-music-with-graphics-lights-and-smokes/</link>
		<comments>http://www.lab4games.net/zz85/blog/2010/08/09/musicgeeknotes-creating-music-with-graphics-lights-and-smokes/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 14:26:05 +0000</pubDate>
		<dc:creator>Zz85</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<category><![CDATA[as3]]></category>

		<category><![CDATA[canvas]]></category>

		<category><![CDATA[graphics]]></category>

		<category><![CDATA[html 5]]></category>

		<category><![CDATA[js]]></category>

		<category><![CDATA[jtenorion]]></category>

		<category><![CDATA[Music]]></category>

		<category><![CDATA[sion]]></category>

		<guid isPermaLink="false">http://www.lab4games.net/zz85/blog/?p=1148</guid>
		<description><![CDATA[Create some music by clicking or dragging @ http://jabtunes.com/labs/jtenorion.html

** Warning: Can be CPU intensive. Safari / Chrome for best results. If you do not have a fast CPU, use less effects in the checkbox options.
Check out a video playing with this.
[Music Notes]
After a while, you may find that you&#8217;re creating some chinese-like, malay-like or javanese [...]]]></description>
			<content:encoded><![CDATA[<p>Create some music by clicking or dragging @ <a href="http://jabtunes.com/labs/jtenorion.htm">http://jabtunes.com/labs/jtenorion.html</a></p>
<p><a href="http://jabtunes.com/labs/jtenorion.html"><img src="http://sphotos.ak.fbcdn.net/hphotos-ak-ash2/hs132.ash2/39922_412352863301_724118301_4729619_7668821_n.jpg" /></a></p>
<p>** Warning: Can be CPU intensive. Safari / Chrome for best results. If you do not have a fast CPU, use less effects in the checkbox options.</p>
<p>Check out a <a href="http://screenr.com/ezO">video playing with this</a>.</p>
<p>[Music Notes]<br />
After a while, you may find that you&#8217;re creating some chinese-like, malay-like or javanese like music. </p>
<p>This is a clone of the fairly expensive electronic but a fairly cheap music instrument call the <a href="http://www.amazon.com/Yamaha-Tenori-On-LED-Performance-Instrument/dp/B0034O46TA/ref=sr_1_2?ie=UTF8&#038;s=musical-instruments&#038;qid=1281200232&#038;sr=8-2">Tenori-On</a> made by Yamaha.</p>
<p>Anyway, this version is closer&#8217;s to Andre&#8217;s implementation call <a href="http://lab.andre-michelle.com/tonematrix">ToneMatrix</a>, a flash implementation using notes of a pentatonic scale, which allows you to pleasant sounding music evening if you click on it randomly. Just <a href="http://www.youtube.com/results?search_query=tonematrix">youtube it</a>, and you can find how many others  have created music with the Tonematrix.</p>
<p>[Geeknotes]<br />
First of all my implementation differs with using a HTML 5 Canvas to render the graphics instead of flash. </p>
<p>I use the the Sion Library for the audio, creating a JS to AS bridge to generate sounds. Howeveer, with the still-in-progress Mozilla Audio Data API, one can easily modify this program to run fully in javascript soon.  </p>
<p>My initial visual effects was less than satisfactory compared to Andre&#8217;s implementation and I got stuck at creating the &#8220;ripple effects&#8221;. I first tried the ripple algorithm used in my previous experiment, but such animation would be almost usuable and very likely to hang the browser.</p>
<p>After a period of rest, while reading on <a href="http://29a.ch/2010/3/31/simulating-fire-using-javascript-and-canvas">perlin noise in canvas</a>, I started having some inspirations for this project again. </p>
<p>Its then struck me that I could implement this with a simple particle system with gradients.<br />
I was also inspired by the use of <a href="http://jsdo.it/matsu4512/mfpp ">gradients, alpha and composites</a> stumped upon this while looking up collaborative programming.</p>
<p>So right now, although its not all perfect, but its a big improvement from the past.</p>
<p>Go ahead, have fun, create some music, hack the code, or provide some suggestions.</p>
<p>p.s. I found the layout look like an iPad after I used curve borders, not that I wanted to replicate the iP* devices.</p>
<p>Other WIP screenshots here.</p>
<p><img src="http://photos-g.ak.fbcdn.net/hphotos-ak-ash2/hs147.ash2/40670_411859098301_724118301_4715602_5116444_a.jpg" /></p>
<p><img src="http://photos-b.ak.fbcdn.net/hphotos-ak-snc4/hs243.snc4/39512_411611368301_724118301_4708681_7402034_a.jpg" /></p>
<p><img src="http://photos-a.ak.fbcdn.net/hphotos-ak-snc4/hs228.snc4/38736_411859118301_724118301_4715603_7463427_a.jpg" /></p>
<p><img src="http://photos-b.ak.fbcdn.net/hphotos-ak-ash2/hs108.ash2/38724_411859183301_724118301_4715607_4532740_a.jpg" /></p>
<p><img src="http://photos-b.ak.fbcdn.net/hphotos-ak-snc4/hs259.snc4/40300_412352843301_724118301_4729618_5847571_a.jpg" /></p>
<p>(a cross post on my facebook note)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lab4games.net/zz85/blog/2010/08/09/musicgeeknotes-creating-music-with-graphics-lights-and-smokes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[geeknotes] Now, Have you met.. Instant QR Codes?</title>
		<link>http://www.lab4games.net/zz85/blog/2010/08/09/geeknotes-now-have-you-met-instant-qr-codes/</link>
		<comments>http://www.lab4games.net/zz85/blog/2010/08/09/geeknotes-now-have-you-met-instant-qr-codes/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 14:19:09 +0000</pubDate>
		<dc:creator>Zz85</dc:creator>
		
		<category><![CDATA[Browsers]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[barcodes]]></category>

		<category><![CDATA[canvas]]></category>

		<category><![CDATA[geeknotes]]></category>

		<category><![CDATA[html 5]]></category>

		<category><![CDATA[jquery]]></category>

		<category><![CDATA[js]]></category>

		<guid isPermaLink="false">http://www.lab4games.net/zz85/blog/?p=1144</guid>
		<description><![CDATA[(Imported from my facebook note dated Monday, 28 June 2010 at 01:37)
This is a follow up to my previous geek note  &#8220;Say Hi to Instant Barcodes&#8221;. The quick story here: nothing too fanciful, just a simple html 5 mashup for instant qrcodes using javascript, jquery, and Kazuhiko Arase qrcode jscode. See http://jabtunes.com/labs/qrcode.html

The advantage for [...]]]></description>
			<content:encoded><![CDATA[<p>(Imported from my facebook note dated Monday, 28 June 2010 at 01:37)</p>
<p>This is a follow up to my previous geek note  <a href="http://www.lab4games.net/zz85/blog/2010/08/09/geeknotes-say-hi-to-instant-barcodes/">&#8220;Say Hi to Instant Barcodes&#8221;</a>. The quick story here: nothing too fanciful, just a simple html 5 mashup for instant qrcodes using javascript, jquery, and Kazuhiko Arase qrcode jscode. See <a href="http://jabtunes.com/labs/qrcode.html">http://jabtunes.com/labs/qrcode.html</a></p>
<p><a href="http://jabtunes.com/labs/qrcode.html"><img src="http://sphotos.ak.fbcdn.net/hphotos-ak-ash2/hs067.ash2/36693_399080813301_724118301_4388904_412216_n.jpg" alt="QRCode" /></a></p>
<p>The advantage for using QRCode over my previous barcode generator is that this 2d barcode packs more information in it, specifically for this mashup implementation, 119 binary characters with 30% recovery rate (using up to QR Code version 10, can be much more if we can implement till version 40). Think of it as maybe, twitter on a picture!</p>
<p><img src="http://sphotos.ak.fbcdn.net/hphotos-ak-snc4/hs086.snc4/35659_399080723301_724118301_4388900_1219465_n.jpg" /><br />
A picture can tell a hundred words, and this tiny qrcode does store a hundred characters.</p>
<p><img src="http://www.facebook.com/photo.php?pid=4388901&#038;op=1&#038;view=all&#038;subj=411992988255&#038;aid=-1&#038;auser=0&#038;oid=411992988255&#038;id=724118301" /><br />
Yes, the barcode scanner on android works with 2d barcodes. </p>
<p><img src="http://sphotos.ak.fbcdn.net/hphotos-ak-ash2/hs060.ash2/36381_399080768301_724118301_4388902_7304189_n.jpg" /><br />
And I think this is also a good way to send urls, telephone numbers and other contact to each other. With a lack of a standard vcard or bluetooth protocol, I think qrcodes should work much better!</p>
<p>Feedbacks would be great! and yes, you can download some codes and send me messages in QR Codes! Goodnight! <img src='http://www.lab4games.net/zz85/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img src="http://sphotos.ak.fbcdn.net/hphotos-ak-snc4/hs146.snc4/36679_399086583301_724118301_4389086_5047632_n.jpg" /></p>
<p>p.s. Tested on all modern browsers (&#038; ie9 beta) except mobile browsers (pls let me know if it works!).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lab4games.net/zz85/blog/2010/08/09/geeknotes-now-have-you-met-instant-qr-codes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[geeknotes] Say Hi to Instant Barcodes</title>
		<link>http://www.lab4games.net/zz85/blog/2010/08/09/geeknotes-say-hi-to-instant-barcodes/</link>
		<comments>http://www.lab4games.net/zz85/blog/2010/08/09/geeknotes-say-hi-to-instant-barcodes/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 14:11:19 +0000</pubDate>
		<dc:creator>Zz85</dc:creator>
		
		<category><![CDATA[Browsers]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[barcodes]]></category>

		<category><![CDATA[canvas]]></category>

		<category><![CDATA[geeknotes]]></category>

		<category><![CDATA[jquery]]></category>

		<category><![CDATA[js]]></category>

		<guid isPermaLink="false">http://www.lab4games.net/zz85/blog/?p=1137</guid>
		<description><![CDATA[(This is repost of my facebook note dated 25 June 2010. Apparently there&#8217;s more notes to be imported, but maybe I&#8217;ll leave that for another time)
It seems to be ages since I last touched javascript but here&#8217;s a latest addition to my html 5 canvas experiments, a really simple (1d) barcode generator.
Type some words or [...]]]></description>
			<content:encoded><![CDATA[<p>(This is repost of my facebook note dated 25 June 2010. Apparently there&#8217;s more notes to be imported, but maybe I&#8217;ll leave that for another time)</p>
<div>It seems to be ages since I last touched javascript but here&#8217;s a latest addition to my html 5 canvas experiments, a really simple (1d) barcode generator.</p>
<p>Type some words or numbers, and a barcode appears immediately (using the simple code 39 implementation without checksum- drawbacks, the not suitable for long data due to low density). Admire the barcodes, save it, otherwise artistically modify it (or have fun writing coded messages to each other).</p>
<p>To skip the talk and get to the action, see <a href="http://jabtunes.com/labs/bars.html"  target="_blank">http://jabtunes.com/labs/bars.html</a></p>
<p><a href="http://jabtunes.com/labs/bars.html"><img class="img" src="http://sphotos.ak.fbcdn.net/hphotos-ak-snc4/hs130.snc4/36870_398283968301_724118301_4367507_1821587_n.jpg" style="width: 460px; "/></a></p>
<p>Barcode scanner on the android is a nifty cool feature.</p>
<div class="photo photo_none">
<div class="photo_img"><a href="http://facebook.com/photo.php?pid=4367597&amp;op=1&amp;view=all&amp;subj=411117303255&amp;aid=-1&amp;auser=0&amp;oid=411117303255&amp;id=724118301"><img class="img" src="http://sphotos.ak.fbcdn.net/hphotos-ak-snc4/hs104.snc4/35581_398289513301_724118301_4367597_4260876_n.jpg"  style="width: 460px; "/></a></div>
</div>
<p>Scanning my name. You could use it for telephone numbers too.</p>
<div class="photo photo_none">
<div class="photo_img"><a href="http://facebook.com/photo.php?pid=4367598&amp;op=1&amp;view=all&amp;subj=411117303255&amp;aid=-1&amp;auser=0&amp;oid=411117303255&amp;id=724118301"><img class="img" src="http://sphotos.ak.fbcdn.net/hphotos-ak-snc4/hs021.snc4/33403_398289528301_724118301_4367598_777407_n.jpg"  style="width: 460px; "/></a></div>
</div>
<p>Yes it works.</p>
<div class="photo photo_none">
<div class="photo_img"><a href="http://facebook.com/photo.php?pid=4367599&amp;op=1&amp;view=all&amp;subj=411117303255&amp;aid=-1&amp;auser=0&amp;oid=411117303255&amp;id=724118301"><img class="img" src="http://sphotos.ak.fbcdn.net/hphotos-ak-snc4/hs014.snc4/34040_398289543301_724118301_4367599_6630431_n.jpg"  style="width: 460px; "/></a></div>
</div>
<p>Lastly here&#8217;s a barcode if you&#8217;d like some practice.</p>
<div class="photo photo_none">
<div class="photo_img"><a href="http://facebook.com/photo.php?pid=4367596&amp;op=1&amp;view=all&amp;subj=411117303255&amp;aid=-1&amp;auser=0&amp;oid=411117303255&amp;id=724118301"><img class="img" src="http://sphotos.ak.fbcdn.net/hphotos-ak-snc4/hs035.snc4/34098_398289503301_724118301_4367596_6672537_n.jpg" /></a></div>
</div>
<p>Goodnight <img src='http://www.lab4games.net/zz85/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>p.s. tested in Chrome, Firefox, Opera (barcodes without text for IE). Javascript lovers, the html file is self contained (except for jquery). Use/hack as you like</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.lab4games.net/zz85/blog/2010/08/09/geeknotes-say-hi-to-instant-barcodes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Really Simple High Defination Youtube Video Downloader</title>
		<link>http://www.lab4games.net/zz85/blog/2010/06/28/really-simple-high-defination-youtube-video-downloader/</link>
		<comments>http://www.lab4games.net/zz85/blog/2010/06/28/really-simple-high-defination-youtube-video-downloader/#comments</comments>
		<pubDate>Sun, 27 Jun 2010 18:01:35 +0000</pubDate>
		<dc:creator>Zz85</dc:creator>
		
		<category><![CDATA[Browsers]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[bookmarklet]]></category>

		<category><![CDATA[js]]></category>

		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://www.lab4games.net/zz85/blog/?p=1123</guid>
		<description><![CDATA[This is a really delayed repost of my &#8220;geeknote&#8221; Really Easy High Defination Youtube Video Downloader. I&#8217;m not sure how happy is Google/Youtube with this, or how soon they would change their site so that this wouldn&#8217;t work, so no warranties and please use this wisely at your own risk.
~~~~~~~~~~~~~~~~~~~~~~
It started as a bookmarklet I [...]]]></description>
			<content:encoded><![CDATA[<p>This is a really delayed repost of my &#8220;geeknote&#8221; <a href=" http://www.facebook.com/note.php?note_id=397587993255">Really Easy High Defination Youtube Video Downloader</a>. I&#8217;m not sure how happy is Google/Youtube with this, or how soon they would change their site so that this wouldn&#8217;t work, so no warranties and please use this wisely at your own risk.<br />
~~~~~~~~~~~~~~~~~~~~~~</p>
<div>It started as a bookmarklet I created to download Vimeo HTML5 MP4 videos easily, but soon others were interested in a youtube version. So read on and I&#8217;ll try to explain this simply and briefly.</p>
<p><b>How can I use it?</b><br />
Go to a youtube video, eg <a href="http://www.youtube.com/watch?v=xEF66GRecQg" onmousedown="UntrustedLink.bootstrap($(this), &quot;b0a4am6WYqew7BYdqHHdsYpCf5w&quot;, event);" rel="nofollow" target="_blank"><span>http://www.youtube.com/wat</span><wbr><span class="word_break"></span>ch?v=xEF66GRecQg</wbr></a> Click on the download bookmark, and the download links will appear under the title. Pick the version you like, and you can watch it in your browser or download them. Usually I use 270p version if I wish to transfer it to my mobile phone for watching. If 720p or 1080p are available, they gives really nice high quality videos.</p>
<div class="photo photo_none">
<div class="photo_img"><a href="http://sphotos.ak.fbcdn.net/hphotos-ak-snc3/hs263.snc3/27788_385870048301_724118301_4042485_7280648_n.jpg"><img src="http://sphotos.ak.fbcdn.net/hphotos-ak-snc3/hs263.snc3/27788_385870048301_724118301_4042485_7280648_n.jpg"  style="width: 460px; "/></a></div>
</div>
<p><b>How can I install this?</b><br />
Create a bookmark in firefox, chrome, safari or opera. For the link, paste the following block of code into the bookmark&#8217;s url.<br />
<br />
<i><code>
<pre>
javascript:(function(){var%20scripts=document.getElementsByTagName('script');for(i=0;i<scripts .length;++i){var%20s=scripts[i].text;var%20source=s.match(/("video_id":%20"\S+".+"t":%20"\S+")|("t":%20"\S+".+"video_id":%20"\S+")/i);if(source!==null){var%20u=(String(source).replace(/(?:(?:"video_id":%20"(\S+)".+"t":%20"(\S+)")|(?:"t":%20"(\S+)".+"video_id":%20"(\S+)"))/i,'http:\/\/www.youtube.com\/get_video?video_id=$1+$4&#038;t=$2+$3'));function%20add(t,u){var%20a=document.createElement("a");var%20t=document.createTextNode(t);a.appendChild(t);a.setAttribute('href',u);var%20b=document.getElementById("watch-headline-user-info");if(b==null)b=document.getElementsByTagName("body").item(0);b.appendChild(a)}add('Download%20[LQ%20FLV]%20',u);add('[270p%20MP4]%20',u+'&#038;fmt=18');add('[360p%20FLV]%20',u+'&#038;fmt=34');add('[480p%20FLV]%20',u+'&#038;fmt=35');add('[720p%20HD%20MP4]%20',u+'&#038;fmt=22');add('[1080p%20HD%20MP4]%20',u+'&#038;fmt=37')}}})()
</pre>
<p></scripts></pre>
<p></code></i><br />
<b>How can I uninstall this?</b><br />
Just delete the bookmark if you have added it. Some users have mentioned you can just run the code pasting the entire block into the url.</p>
<p><b>What&#8217;s so special about this compared to so many other downloaders?</b><br />
This downloader is minimally intrusive and tries to be as unobstructive as possible. It runs only when you click on the bookmarklet. Although it&#8217;s unobstructive, its give you the options on the quality, resolution and format you can download. Its really fast and easy to use.</p>
<p>Compared to other software, plugins, addon etc, the installation requires no downloads or browser restarts. Uninstalling is as simple as deleting a bookmarklet. Not to mention that many other scripts are not working well due to some recent changes made by Youtube/Google.</p>
<p><b>Any updates planned?</b><br />
Only if I have the time, I would parse the parameters to detect the available formats supported in the current video. This can eliminate the links the current versions adds to the site, but this feature is unnecessary if the user observe what formats the video provides in the little box at the bottom right of the screen.</p>
<p><b>Reasons why to download videos rather than streamed live?</b><br />
1. You wish to enjoy more of the video and less of silly comments and the links call ads Google place into the video player. <br />
2. If you are using on a smaller device like a netbook and find that the flash player lags quite a little<br />
3. You think the experience of youtube&#8217;s HTML5 player is really horrible<br />
4. You just bought a new 1 Petrabyte hard disk, and wish to borrow some of Google&#8217;s bandwidth to utilize more of your unlimited mobile internet and relatively empty disk space.</p>
<p><b>This is a great tool! Do you accept donations?</b><br />
I have not tried accepting donations before, but I&#8217;ll leave how you can thank me to your creativity. <img src='http://www.lab4games.net/zz85/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><b>Update!</b><br />
This script have been modified by my friend Ernest who did an all-nighter for automatically detecting video quality (eg. the HD links will not appear if they are not available).</p>
<p><i><code>
<pre>
javascript:(function(){var%20s=document.body.innerHTML.toString();var%20source=s.match(/("video_id":%20"\S+".+"t":%20"\S+")|("t":%20"\S+".+"video_id":%20"\S+")/i);var%20source2=s.match(/("fmt_list":%20\S+")/);var%20residu=String(source2).match(/\d+\.?\d*/g);if(source!==null){var%20u=(String(source).replace(/(?:(?:"video_id":%20"(\S+)".+"t":%20"(\S+)")|(?:"t":%20"(\S+)".+"video_id":%20"(\S+)"))/i,'http:\/\/www.youtube.com\/get_video?video_id=$1+$4&#038;t=$2+$3'));function%20add(t,u){var%20a=document.createElement("a");var%20t=document.createTextNode(t);a.appendChild(t);a.setAttribute('href',u);var%20b=document.getElementById("watch-headline-user-info");if(b==null)b=document.getElementsByTagName("body").item(0);b.appendChild(a)}add('Download%20[LQ%20FLV]%20',u);add('[270p%20MP4]%20',u+'&#038;fmt=18');if(residu.indexOf("34")>=0)add('[360p%20FLV]%20',u+'&#038;fmt=34');if(residu.indexOf("35")>=0)add('[480p%20FLV]%20',u+'&#038;fmt=35');if(residu.indexOf("22")>=0)add('[720p%20HD%20MP4]%20',u+'&#038;fmt=22');if(residu.indexOf("37")>=0)add('[1080p%20HD%20MP4]%20',u+'&#038;fmt=37')}})()</pre>
<p></code><br />
</i></div>
]]></content:encoded>
			<wfw:commentRss>http://www.lab4games.net/zz85/blog/2010/06/28/really-simple-high-defination-youtube-video-downloader/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rain, Water, Ripples with HTML Canvas, Javascript, JQuery</title>
		<link>http://www.lab4games.net/zz85/blog/2010/03/10/rain-water-ripples-with-html-canvas-javascript-jquery/</link>
		<comments>http://www.lab4games.net/zz85/blog/2010/03/10/rain-water-ripples-with-html-canvas-javascript-jquery/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 17:33:18 +0000</pubDate>
		<dc:creator>Zz85</dc:creator>
		
		<category><![CDATA[Browsers]]></category>

		<category><![CDATA[Ideas]]></category>

		<category><![CDATA[Interesting Stuff]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[canvas]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[js]]></category>

		<category><![CDATA[particles]]></category>

		<category><![CDATA[rain]]></category>

		<category><![CDATA[ripples]]></category>

		<category><![CDATA[simulation]]></category>

		<category><![CDATA[water]]></category>

		<guid isPermaLink="false">http://www.lab4games.net/zz85/blog/?p=1110</guid>
		<description><![CDATA[One of the exciting reasons to work with canvas is that you are not only able to create 2d graphics easily with javascript, one can easily do do pixel manipulation on images.
Think about it, in case you don&#8217;t think its cool right now, is that you only need notepad, a recent web browser and a [...]]]></description>
			<content:encoded><![CDATA[<p>One of the exciting reasons to work with canvas is that you are not only able to create 2d graphics easily with javascript, one can easily do do pixel manipulation on images.</p>
<p>Think about it, in case you don&#8217;t think its cool right now, is that you only need notepad, a recent web browser and a few lines of code to do cool stuff work with 2d graphics without compilation. Take an example, you can create a greyscale image from a color photo into without photoshop or other software as see in <a href="http://www.pixastic.com/">pixastic</a>.</p>
<p>In this post, I will outline how easy it is to code with javascript and canvas to simulate water ripples, along with some issues encountered. After I discovered this <a href="http://freespace.virgin.net/hugo.elias/graphics/x_water.htm">old water algorithm</a> (during the DOS era I suspect) on creating waves, I thought why not try this with HTML Canvas, and so I did.</p>
<p><a href="http://jabtunes.com/notation/ripples.html"><img src="http://photos-h.ak.fbcdn.net/hphotos-ak-ash1/hs465.ash1/25525_342125018301_724118301_3594829_1543748_n.jpg" alt="Ripples with Javascript" /></a></p>
<p><strong>STEP 1. Creating a canvas element.</strong><br />
This can created easily with javascript, or just add some html code into the body </p>
<p><code>&lt;canvas id=&quot;jripples&quot;&gt;&lt;/canvas&gt;</code></p>
<p><strong>STEP 2. Load an image with JS when document is loaded for which we can use the jquery $(document).ready</strong></p>
<p><code>$(document).ready(function(){<br />
	init(); // Run stuff when document is ready.<br />
});</code></p>
<p>Here&#8217;s the code to load an image</p>
<p><code><br />
var img = new Image();<br />
img.src = "hello.jpg" // path and filename of image<br />
img.onload = function() {} // run the next portion of code when the image loads<br />
</code></p>
<p><strong>STEP 3. Draw the image onto the canvas</strong></p>
<p><code><br />
canvas = document.getElementById('jripples');<br />
 $('#jripples').width(img.width); // We set the canvas width and height with jquery<br />
$('#jripples').height(img.height);<br />
canvas.style.height = canvas.height = img.height ; // Set the canvas size to the image<br />
canvas.style.width = canvas.width =img.width;</p>
<p>ctx = canvas.getContext("2d"); // Get the 2d drawing context<br />
ctx.clearRect(0,0,canvas.width,canvas.height); // Clear the canvas<br />
ctx.drawImage(img, 0,0,canvas.width,canvas.height); // Draw the image</code></p>
<p>Just a caveat though, to get or manipulate pixels from an image, the image needs to be loaded from the domain or would result in a browser security violation.</p>
<p><strong>STEP 4. Build the data structures behind the wave</strong><br />
<code>orginalData = ctx.getImageData(0,0,canvas.width,canvas.height).data; // The array of pixels for the image<br />
myImageData = ctx.getImageData(0,0,canvas.width,canvas.height); // Modifications of pixels<br />
buffer1 = []; // Create new array for the image buffer<br />
buffer2 = [];<br />
// orginal data length is 4 times the pixel dimensions since they store RGBA (red,green, blue, alpha)<br />
for (var i=0; i<orginaldata .length/4; i++) { // We initialize the wave maps to<br />
	 buffer1[i] = 0;<br />
	 buffer2[i] = 0;<br />
 }</code></p>
<p><strong>STEP 5. Creating ripples (the wave algorithm) function</strong></p>
<p><code> function processWater(source, dest) {<br />
        	for (var i=imagewidth; i< source.length-imagewidth; i++)<br />
		{<br />
			// check for bounds<br />
			var xi = i % imagewidth;<br />
			if ((xi==0) || (xi==imagewidth-1)) continue; </p>
<p>		    dest[i] = (<br />
				((source[i-1]+<br />
				  source[i+1]+<br />
				  source[i-imagewidth]+<br />
				  source[i+imagewidth])  >>1) ) -dest[i];</p>
<p>		    dest[i] -= (dest[i] >> 5); // Damping - Quick divde by 32 (5 bits)</p>
<p>		}<br />
        }</code></p>
<p>while the original article explains how this works, <a href="http://www.neilwallis.com/java/water.htm">this article</a> explains it in another simpler manner</p>
<blockquote><p>Two height maps are used to store the current and previous states of the water.<br />
Each frame you will toggle between state maps.<br />
For each array element in the current state array:-<br />
Look at the neighbouring pixels from the previous state, i.e. above, below, left and right. Take the sum and divide by 2. Because we are dividing by 2 a right-shift will work beautifully.<br />
Now subtract the value in the current state map.<br />
If we left it like that the ripples would never subside so we need to diminish the strength of the ripple every pass. The most realistic way of doing this is to reduce the resulting height by a fraction of itself. Once again we can use right-shift to optimise this.
</p></blockquote>
<p>Note that I ensured the loops avoid any edge bound pixel to prevent wrap arounds.</p>
<p><strong>STEP 6. Render the new image with waves.</strong><br />
<code>function texture(buffer) {<br />
		var xoffset, yoffset;<br />
		for (var i=imagewidth; i<buffer .length-imagewidth; i++)<br />
		{<br />
			// check for bounds<br />
			var xi = i % imagewidth;<br />
			if ((xi==0) || (xi==imagewidth-1)) continue; </p>
<p>		    xoffset = buffer[i-1] - buffer[i+1];<br />
		    yoffset = buffer[i-imagewidth] - buffer [i+imagewidth];</p>
<p>		    var offset = i+xoffset+yoffset*imagewidth;</p>
<p>		    if (offset>0 &#038;&#038; offset</buffer><buffer .length) {</p>
<p>			    for (var x=0;x&lt;3;x++) { //4 for alpha<br />
				    myImageData.data[i*4+x] = orginalData[offset*4+x];<br />
			    }</p>
<p>		    }</p>
<p>		}<br />
		// Draw<br />
		ctx.putImageData(myImageData, 0, 0);</p>
<p>}</code></p>
<p>This estimates the pixel offset due to refraction of water (read more on <a href="http://www.gamedev.net/reference/articles/article915.asp">Transparent Surface Ray-Tracing</a>)  based on height of the wave and copies the pixels from the orginal array into the new imagearray object. This imagedata is returned to the 2d object using putImageData to be drawn.</p>
<p><strong>STEP 7. Call the rippling function in a timer</strong><br />
<code>rippling = setInterval(ripple, 50); // This calls the ripple function every 20 times a second</code></p>
<p><strong>STEP 8</strong><br />
We can calling another timer to add rain<br />
<code>raining = setInterval(function() {					// random rain<br />
				var randomX = Math.round(Math.random() * canvas.width);<br />
				var randomY = Math.round(Math.random() * canvas.height);<br />
				buffer1[randomY*imagewidth+randomX] += Math.round( Math.random()*-500);<br />
			},300);</code></p>
<p><strong>STEP 9. Add more raindrops/ripples reactivity to mouse clicks. We use jquery to add mouse listeners quickly.</strong><br />
<code>$(canvas).mousedown(function(e) {<br />
			var x = e.pageX - $(this).offset().left;<br />
			var y = e.pageY - $(this).offset().top  ;</p>
<p>			buffer1[y*imagewidth+x] = -400;<br />
			clicked.dragged= true;</p>
<p>		}).</code></p>
<p><strong>STEP 10. Provides FPS(Frames per second)</strong><br />
		<code>setInterval(function() {<br />
			$('#jdebug').html(fpsCount + &quot; fps&quot;);<br />
			fpsCount= 0; // recent<br />
		},1000);</code></p>
<p>This isn&#8217;t the most accurate way to calculate FPS, since the callback may not be accurate in itself. Rather, one should try getting the actual time subtracted from the last elapsed time to calculate the fps.</p>
<p><strong>Enjoy. Here&#8217;s the link to <a href="http://jabtunes.com/notation/ripples.html">javascript ripples demo</a></strong><br />
Remember that you may need to upload your html and images to a webserver to test (or change your browser security settings).</p>
<p><strong>Other Considerations.</strong><br />
This run on all modern browsers (Firefox, Safari, Chrome, Opera) except IE due to the lack of support with Canvas. While the Excanvas provides some compatibility, it does not provides get/putImageData calls. Until IE9 releases, <a href="http://flashcanvas.net/">flashcanvas pro</a> may solve this compatibility issue. </p>
<p>From my observations, the bottleneck seems to be when the browser render the image after the putImageData javascript. Right now firefox seems to be able to render 2x faster than chrome, and the self proclaimed fastest browser on earth, Opera, seems to renders about 3 times faster than chrome (to 100fps on small images).</p>
<p>While this wave algorithm may be efficient when there are many waves, this method may not be as efficient when there are few waves on large images/canvases. Even a image of 640 pixels can hang the browser (be warned).</p>
<p>One simple way to speed up the waves is scale down the image.  If putImageData is the bottleneck, then we can hope that  the browser would optimize these soon. (with <a href="http://www.basschouten.com/blog1.php/2010/03/02/presenting-direct2d-hardware-acceleratio">Direct2D just implemented</a> for firefox nighties, maybe soon will be soon!) Other interesting alternatives would be to implement <a href="http://www.khronos.org/webgl/">WEBGL</a> or <a href="http://code.google.com/apis/o3d/">O3D</a> which uses the C++ stack or GPU to speed up the rendering, although these are not widely supported right now. The better idea, I imagine, is to implement another algorithm which renders the ripples from its wave source, which would probably run faster on large images with few waves.</p>
<p>Finally, creating ripples seems to be a classic challenge and if you were to do a simple search, would be able to find implementations for <a href="http://toykeeper.net/programs/water/">DOS graphics</a>, OpenGL or other <a href="http://nylander.wordpress.com/2005/07/29/water-ripple-simulation/">3d Programming</a>, Java graphics, and for the most recent implementations, <a href="http://www.openprocessing.org/visuals/?visualID=4699">Processing</a> <a href="http://www.escapemotions.com/experiments/processing/water_ripples/applet/index.html?KeepThis=true&#038;TB_iframe=true&#038;width=380&#038;height=500">applet</a> and Flash/<a href="http://lab.andre-michelle.com/water">AS3</a>. One can even find this effect on desktops with dreamrender or <a href="http://www.compiz.org/">beryl/compiz fuzion</a>. Still this seems to be the first implementation with javascript/canvas other than one other on the net have seem to created a <a href="http://my.opera.com/edvakf/blog/2009/05/01/ripple-effect-by-canvas">&#8220;ripple effect&#8221; with canvas</a>, which is not really similar.</p>
<p>School work along other commitments is keeping me really busy, besides this is not even part of any computer graphics classes I required to take. So while there are perhaps more enhancements and optimizations that can be done, I&#8217;ll be leaving that up to you readers <img src='http://www.lab4games.net/zz85/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </buffer></code></orginaldata></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lab4games.net/zz85/blog/2010/03/10/rain-water-ripples-with-html-canvas-javascript-jquery/feed/</wfw:commentRss>
		</item>
		<item>
		<title>&#8220;Huh?&#8221; - A Short Piano Composition</title>
		<link>http://www.lab4games.net/zz85/blog/2010/02/24/huh-a-short-piano-composition/</link>
		<comments>http://www.lab4games.net/zz85/blog/2010/02/24/huh-a-short-piano-composition/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 17:21:23 +0000</pubDate>
		<dc:creator>Zz85</dc:creator>
		
		<category><![CDATA[Music]]></category>

		<category><![CDATA[composition]]></category>

		<category><![CDATA[lilypond]]></category>

		<category><![CDATA[midi]]></category>

		<category><![CDATA[musescore]]></category>

		<category><![CDATA[pdf]]></category>

		<guid isPermaLink="false">http://www.lab4games.net/zz85/blog/?p=1104</guid>
		<description><![CDATA[&#8220;Huh?&#8221; is a short piano composition I came out with last week. It is not delicated to anybody in mind but you can view, download or print the score for free or listen to the computer generated midi. 

The long story: I went up to the piano with one day without anything in mind but [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;Huh?&#8221; is a short piano composition I came out with last week. It is not delicated to anybody in mind but you can view, download or print <a href="http://jabtunes.com/music/huh.pdf">the score</a> for free or listen to the <a href=" http://jabtunes.com/music/huh.mid">computer generated midi</a>. </p>
<p><a href="http://musescore.org/sites/musescore.org/files/huh%20-%20score.pdf"><img src="http://photos-d.ak.fbcdn.net/hphotos-ak-snc3/hs412.snc3/24906_316813468301_724118301_3521380_1849453_n.jpg" alt="Huh?" /></a></p>
<p>The long story: I went up to the piano with one day without anything in mind but started playing some tunes when i least expected it. I quickly grab a pen and paper to jot down some notes in case I forgot them and <a href="http://jabtunes.com/music/huh.mp3">recorded this song</a> on my netbook, everything done almost in a sitting.</p>
<p>Of course writing it down and typesetting it actually takes a lot more time. <a href="http://jabtunes.com/music/huh.mscz">typed the piece of music</a> using the software <a href="http://musescore.org/">MuseScore</a> 1.9.6 beta, a great free music notation software. I later <a href="http://jabtunes.com/music/huh.ly">save it as a lilypond format</a> which was more familiar with me for tweaking the nice finishing touches for music scores layouts with the help of jedit <a href="http://lilypondtool.organum.hu/">lilypondtool</a>. </p>
<p>Like several of my songs, I think it sounds a little nostalgia (like <a href="http://www.reubenkee.com/music/singles/Act%20Four%20-%20Who%20Am%20I.mp3">&#8220;Who am I&#8221;</a>  which Reuben Kee arranged and used for his musical). Then again, I wasn&#8217;t really expecting to compose any thing on the piano that day which prompted me to title it &#8220;Huh?&#8221;. </p>
<p>I got a mixed bag of reactions to the piece. Some say its sounds classical, some says pop, some says a mixed. Some thinks it from Chopin Ballet, or Granados Spanish dance - Andaluza, or a little Japanese, Korean, Amelie soundtrack sounding, some feels its too happy, too sad, etc. You get the idea. I think much would be coincidental and subjective to the listeners. </p>
<p>Some suggestions by my friend Gerald - playing the harmony with broken chord pattern instead of the oom-pah bass will make it sound &#8220;more fluid&#8221;, and &#8220;less static&#8221;. He also suggest arranging the melody on the flute with a harp accompaniment in broken chords, in which after I just found out from my harp friends its difficult for lever harps to play keys with 5 flats.</p>
<p>Have fun trying out this piece out and let me know if you have other comments.</p>
<p>p.s. Since I&#8217;m on the topic of music, do let me know if you want to attend the nusso concert on 19 march friday evening 2010 at VCH. Details <a href="http://www.facebook.com/event.php?eid=247182169774&#038;ref=ts">here</a> and <a href="http://nusso.org/event/romantic-fantastique">here</a>.</p>
<p><img src="http://photos-h.ak.fbcdn.net/hphotos-ak-snc3/hs412.snc3/24906_316835633301_724118301_3521389_5715310_n.jpg" alt="Score" /></p>
<p>update: the audio generated by musescore can be heard here. <a href="http://soundcloud.com/zz85nus/huh-1">http://soundcloud.com/zz85nus/huh-1</a><br />
or <a href="http://soundcloud.com/zz85nus/huh-recording">http://soundcloud.com/zz85nus/huh-recording</a> for the original recording.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lab4games.net/zz85/blog/2010/02/24/huh-a-short-piano-composition/feed/</wfw:commentRss>
<enclosure url="http://jabtunes.com/music/huh.mid" length="2729" type="audio/midi" />
<enclosure url="http://jabtunes.com/music/huh.mp3" length="1010070" type="audio/mpeg" />
		</item>
		<item>
		<title>JS 中文笔画输入法 (Javascript Chinese Stroke Input)</title>
		<link>http://www.lab4games.net/zz85/blog/2010/02/17/js-%e4%b8%ad%e6%96%87%e7%ac%94%e7%94%bb%e8%be%93%e5%85%a5%e6%b3%95-javascript-chinese-stroke-input/</link>
		<comments>http://www.lab4games.net/zz85/blog/2010/02/17/js-%e4%b8%ad%e6%96%87%e7%ac%94%e7%94%bb%e8%be%93%e5%85%a5%e6%b3%95-javascript-chinese-stroke-input/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 20:13:21 +0000</pubDate>
		<dc:creator>Zz85</dc:creator>
		
		<category><![CDATA[Browsers]]></category>

		<category><![CDATA[Ideas]]></category>

		<category><![CDATA[Interesting Stuff]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[chinese]]></category>

		<category><![CDATA[ime]]></category>

		<category><![CDATA[js]]></category>

		<guid isPermaLink="false">http://www.lab4games.net/zz85/blog/?p=1098</guid>
		<description><![CDATA[In case the title didn&#8217;t appear correctly, this is a post for another of my javascript experiments. This demonstrate chinese character recognition using stroke based or radicals input, instead of the usual pinyin(romanized mandarin system) method. Although this method is usually slower for typing, it allows beginners to find or input a word he does [...]]]></description>
			<content:encoded><![CDATA[<p>In case the title didn&#8217;t appear correctly, this is a post for another of my javascript experiments. This demonstrate chinese character recognition using stroke based or radicals input, instead of the usual pinyin(romanized mandarin system) method. Although this method is usually slower for typing, it allows beginners to find or input a word he does not recognize or a word whose pronunciation and pinyin is forgotten. I thought what better time could I release this than during the Lunar New Year.</p>
<p><a href="http://jabtunes.com/notation/chinesestroke.html"><img src="http://photos-d.ak.fbcdn.net/hphotos-ak-ash1/hs424.ash1/23467_303776653301_724118301_3474391_2269867_n.jpg" alt="Chinese Stroke Recognition" /></a></p>
<p>To try it, click on the screenshot above. Wait for files to be completed loaded before clicking and dragging to write a chinese character in correct stroke order (top left to bottom right, outer to enclosed), and the suggested words would appear in the right box. Right now the recognition algorithm is pretty rigid, you need to have the exact amount of strokes in an almost perfect sequence and writing to get the correct recognition. As mentioned, its pretty experimental, but it shows how fast javascript can be, character lookups are usually within 1 second, often below 100ms. The biggest bottleneck right now is parsing of the huge data files (usually the case for javascript engines these days), which may be solved with an ajax call to the server instead of caching all locally. Okay, I&#8217;m going into more implementation details so non-technical readers can do some skipping.</p>
<p>So basically this application is a modified and really simplified port of <a href="http://kiang.org/jordan/software/hanzilookup/hanzidict.html">Kiang&#8217;s Hanzi Lookup Java Application</a> to Javascript.<br />
For example, I used my javascript port of shortstraw (<a href="http://www.lab4games.net/zz85/blog/2010/01/21/geeknotes-shortstrawjs-fast-and-simple-corner-detection/">shortstrawJs</a>) for substroke recognition. This works well in many situations and badly for many (when strokes are short, etc). There ought to be better input filtering, and better matching against the database. Right now, all the substrokes are flatten, ignoring the exact strokes the user make. There&#8217;s currently isn&#8217;t fuzzy matching, or partial matches which gives lots of room for improvements. Of course, if you are able to, you can be grab the code by viewing source and trying making changes.</p>
<p><img src="http://photos-b.ak.fbcdn.net/hphotos-ak-snc3/hs384.snc3/23467_303776758301_724118301_3474392_718004_s.jpg" alt="Yi" /><br />
<em>Some traditional words supported. This is the traditional character for my middle character of my chinese name.</em></p>
<p>If I have the time, there are a few features I like to have in the future.<br />
- One is creating a bookmarklet, for which this input method would work with any site - like my <a href="http://www.lab4games.net/zz85/blog/2010/02/06/online-virtual-keyboard-with-canvas-and-javascript/">virtual keyboard bookmarklet</a> released previously. The advantages that bookmarklets have over browsers addon is that the browser like firefox does not need to be restarted, making it a very useful tool for non-home computers. (Gangwen, if you are still finding a online IME, you may like to try <a href="http://pinyin.sogou.com/cloud/">Sogou&#8217;s Cloud Pinyin/启用搜狗云输入法 bookmarklet</a>).<br />
- Another is tying this input to a chinese dictionary, making it a valuable tool for chinese beginners.<br />
- I also hope to implement custom font rendering (For example using <a href="http://www.sino.uni-heidelberg.de/edv/sinopc/chinese_fonts.htm">漢鼎繁舒體</a>) rendered on canvas for computers without these custom chinese fonts installed. Currently this is another of my javascript experiments - I have managed to render a couple of characters, but have yet to figure out the Adobe&#8217;s CID implementation and quirk character mapping that<br />
<a href="http://ttf2pt1.sourceforge.net/">ttf2pt1</a> gives me.<br />
- Another idea is hooking this up to a <a href="http://ccv.nuigroup.com/">DIY Multi-touch pad</a> if I get to built one.</p>
<p>And so I wonder if there&#8217;s a need for this application.<br />
- I heard that Macs already have this input method using their touchpads built into the OS. Windows 7 seems to have pretty good chinese recognition with their stylus input as seen <a href="http://blogs.msdn.com/e7/archive/2009/04/23/ink-input-and-tablet.aspx">from their blog</a><br />
- Newer HTC phones running Android have a HTC custom native input method called Touch Input. See <a href="http://forum.tgbus.com/viewthread.php?tid=148219">HTC_CIME HTC的官方手写输入法</a>. It doesn&#8217;t come with my HTC Magic, and requires some rooting or hacking - something I don&#8217;t have time for now, otherwise I could try writing android applications too. </p>
<p>Some friends may think that I started this experimented because of my inability to read chinese and maybe its true, or indeed its true my chinese language (similar my other verbals and written languages) is pretty weak! So maybe someone might still find this useful. Again, the source code is available for anyone to modify it.</p>
<p>Lastly for those still celebrating the launar new year, happy new year!</p>
<p><a href="http://jabtunes.com/notation/chinesestroke.html"><img src="http://photos-e.ak.fbcdn.net/hphotos-ak-ash1/hs424.ash1/23467_303776903301_724118301_3474394_1205344_n.jpg" alt="Dao Fu" /></a></p>
<p>p.s. I created an easter egg in view of the chinese new year. Double clicking on a suggestion turn the word upside down. Some homes turn their words upside down to symbolize prosperity falling to their homes. This animation is done using Css3 transform properties (supported by the new firefox, opera and webkits- safari, chrome browsers).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lab4games.net/zz85/blog/2010/02/17/js-%e4%b8%ad%e6%96%87%e7%ac%94%e7%94%bb%e8%be%93%e5%85%a5%e6%b3%95-javascript-chinese-stroke-input/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Online Virtual Keyboard With Canvas and Javascript</title>
		<link>http://www.lab4games.net/zz85/blog/2010/02/06/online-virtual-keyboard-with-canvas-and-javascript/</link>
		<comments>http://www.lab4games.net/zz85/blog/2010/02/06/online-virtual-keyboard-with-canvas-and-javascript/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 12:00:34 +0000</pubDate>
		<dc:creator>Zz85</dc:creator>
		
		<category><![CDATA[Browsers]]></category>

		<category><![CDATA[Design]]></category>

		<category><![CDATA[Hobbies]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[canvas]]></category>

		<category><![CDATA[html5]]></category>

		<category><![CDATA[js]]></category>

		<category><![CDATA[virtual keyboard]]></category>

		<guid isPermaLink="false">http://www.lab4games.net/zz85/blog/?p=1083</guid>
		<description><![CDATA[I&#8217;m releasing a HTML Canvas and Javascript based virtual, online, onscreen keyboard for testing and whatever fun you can make out of it. This release is actually dedicated for my friend&#8217;s 25th birthday, but its kind of way overdued. (CH, if you are reading this, happy belated!)

Basically what&#8217;s a virtual keyboard is that its simply [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m releasing a HTML Canvas and Javascript based virtual, online, onscreen keyboard for testing and whatever fun you can make out of it. This release is actually dedicated for my friend&#8217;s 25th birthday, but its kind of way overdued. (CH, if you are reading this, happy belated!)</p>
<p><a href="http://jabtunes.com/notation/keyboardcanvasexamples.html"><img src="http://photos-c.ak.fbcdn.net/hphotos-ak-snc3/hs169.snc3/19632_284413848301_724118301_3407084_7953637_n.jpg" alt="Virtual Keyboard" /></a></p>
<p>Basically what&#8217;s a <a href="http://ignorethecode.net/blog/2009/08/07/virtual-keyboards-on-iphone-and-android/">virtual keyboard</a> is that its simply an input without a physcial keyboard.<br />
If you add this as a <a href="javascript:(function(){var%20e=document.createElement('script');e.type='text/javascript';e.src='http://jabtunes.com/notation/jKeyboard.js.php';document.getElementsByTagName('head')[0].appendChild(e);})();">Keyboard Bookmarklet</a> (Firefox recommended - drag this to your toolbar), you may use this keyboard on various websites buy clicking on your bookmark which launch as translucent, mac like, on screen keyboard.</p>
<p>If you are thinking of projection keyboards, sorry, it isn&#8217;t as cool as that, yet.<br />
<a href="http://palmaddict.typepad.com/palmaddicts/2006/05/review_of_itech.html"><img src="http://palmaddict.typepad.com/palmaddicts/images/virtual_keyboard1.jpg" alt="" /></a></p>
<p>However, you can use this keyboard to enter text into textareas and input field by using your mouse, stylus or touchscreen. If you decide to use your physical keyboard, the virtual keyboard gets &#8220;lighted up&#8221;.</p>
<p>Some have asked me the purpose of this project anyway. <a href="http://lifehacker.com/5137148/virtual-keyboard-interface-dodges-key+loggers">Some sites</a> like <a href="http://designshack.co.uk/articles/javascript/creating-a-virtual-jquery-keyboard">this</a> would say there&#8217;s enhanced security particular from keyloggers. Of course, this isn&#8217;t really true since virtual keyboards may be backdoors themselves so please do not use this or any other bookmarklet, greasemonkey, addons etc you do not trust for sensitive information. </p>
<p>Yes, one reason is that I&#8217;m having playing around with html canvas again. Another is that I have always been interested to with <a href="http://www.lab4games.net/zz85/blog/2007/02/25/2-users-using-a-single-pc-part-i/">multiple inputs/users</a>. Creating custom interfaces with canvas could create the possibility of interfacing 2 users in a browser - imagine 2 users surfing the net together by sharing a wide browser screen on a pc. Fifa 95 (thats over a decade ago!) allowed 2 users to play with or against each other - one with the keyboard, another with the mouse, and this would be possible with a virtual keyboard (for the 2nd user). Whether this is another lame project, or whether there are possible great ideas, I&#8217;ll leave it up to your imagination.</p>
<p>Before ending with the tons of technical details, try out the <a href="http://jabtunes.com/notation/keyboardcanvasexamples.html">demo</a> and let me know of your comments, if any <img src='http://www.lab4games.net/zz85/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://jabtunes.com/notation/keyboardcanvasexamples.html"><img src="http://photos-a.ak.fbcdn.net/hphotos-ak-snc3/hs169.snc3/19632_284476743301_724118301_3407244_6738679_n.jpg" alt="Virtual Keyboard works with Google.com" /></a></p>
<p>More details of this release<br />
+ Uses <a href="http://jquery14.com/day-12/jquery-141-released">jQuery 1.4.1</a> (Loads dynamically in bookmarklet)<br />
+ Virtual Keyboard - Drawned with Javascript and HTML Canvas Element<br />
+ The Mac lookalike Design of the keyboard inspired from this <a href="http://net.tutsplus.com/tutorials/javascript-ajax/creating-a-keyboard-with-css-and-jquery/">NetTuts tutorial</a> which used html, jquery and css instead.<br />
+ Autofire keys &#038; work around for text selection when autofiring in Chrome.<br />
+ Onscreen Keypresses Feedback as you typed - Keybindings aided with plugin <a href="http://code.google.com/p/js-hotkeys/">jHotKeys</a><br />
+ Onscreen Key Highlighting Disabled for Password fields<br />
+ Keyboard is draggable around the screen<br />
+ Works with Textarea and Input fields.<br />
+ Demonstrates a simple drawing framework with JSON<br />
+ Uses <a href="http://www.federated.com/~jim/canvastext/">TextCanvas</a> for canvas rendering of text<br />
+ Bookmarklet - see this interesting <a href="http://coder-zone.blogspot.com/2009/05/jquery-bookmarklet.html">jQuery Bookmarklet boot code</a> </p>
<p>See <a href="http://jabtunes.com/notation/jKeyboard.js.php?src=1">here</a> for source code, and here for <a href="http://jabtunes.com/notation/jKeyboard.js.php">YUI compressed version</a>. </p>
<p>Future improvements I would love to see.<br />
+ 100% Bugs Free<br />
+ IE compatibility<br />
+ Docking<br />
+ API<br />
+ Stay tuned <img src='http://www.lab4games.net/zz85/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.lab4games.net/zz85/blog/2010/02/06/online-virtual-keyboard-with-canvas-and-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[geeknotes] ShortStrawJS - Fast and Simple Corner Detection</title>
		<link>http://www.lab4games.net/zz85/blog/2010/01/21/geeknotes-shortstrawjs-fast-and-simple-corner-detection/</link>
		<comments>http://www.lab4games.net/zz85/blog/2010/01/21/geeknotes-shortstrawjs-fast-and-simple-corner-detection/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 13:49:44 +0000</pubDate>
		<dc:creator>Zz85</dc:creator>
		
		<category><![CDATA[Browsers]]></category>

		<category><![CDATA[as3]]></category>

		<category><![CDATA[canvas]]></category>

		<category><![CDATA[jquery]]></category>

		<category><![CDATA[js]]></category>

		<category><![CDATA[shortstraw]]></category>

		<guid isPermaLink="false">http://www.lab4games.net/zz85/blog/?p=1075</guid>
		<description><![CDATA[One of the challenges dealing with stroke/pen based input systems is finding corners in free form lines created by pen based drawing.
ShortStraw presents a simple yet accurate algorithm described in a recent (2008) paper for detecting corners.
To summarize this paper briefly from my understanding, ShortStraw takes in points of a stroke, resamples them, uses distances [...]]]></description>
			<content:encoded><![CDATA[<p>One of the challenges dealing with stroke/pen based input systems is finding corners in free form lines created by pen based drawing.</p>
<p><a href="http://srlweb.cs.tamu.edu/srlng_media/content/objects/object-1246294647-350817e4b0870da27e16472ed36475db/Wolin_SBIM08.pdf">ShortStraw</a> presents a simple yet accurate algorithm described in a recent (2008) paper for detecting corners.</p>
<p>To summarize this paper briefly from my understanding, ShortStraw takes in points of a stroke, resamples them, uses distances of points to determinate whether the points are from straight lines or corners.  </p>
<p>I learnt about this a method when after stumbling on <a href="http://www.betriebsraum.de/blog/2009/07/21/efficient-gesture-recognition-and-corner-finding-in-as3/">Felix Raab&#8217;s blog post</a>, who created <a href="http://www.betriebsraum.de/projects/gestures/">flex example</a> of the <a href="http://www.betriebsraum.de/projects/gestures/srcview/source/de/betriebsraum/geom/cornerfinder/ShortStraw.as.html">ShortStraw algorithm implemented in actionscript</a>.</p>
<p>This makes implementing a javascript version much easier, since most of the code can be derived heavily from the AS3 implementation. So here&#8217;s an <a href="http://jabtunes.com/notation/shortstraws.html">example</a> and the <a href="http://jabtunes.com/notation/shortstraw.js">source code</a> to my shortstraw.js implementation.</p>
<p><a href="http://jabtunes.com/notation/shortstraws.html"><img src="http://photos-b.ak.fbcdn.net/hphotos-ak-snc3/hs160.snc3/18732_257391738301_724118301_3314082_579631_n.jpg" alt="ShortStrawJS" /></a></p>
<p>As usual, the demo uses html 5 canvas for drawing (sorry IE users, but any other modern browser like firefox, chrome or safari would work), jquery for simple event handling, and of course the shortstraw javascript file for corner detection.</p>
<p>For the daring, you may want to look at the paper <a href="http://portal.acm.org/citation.cfm?id=1572759&#038;dl=GUIDE&#038;coll=GUIDE&#038;CFID=72437283&#038;CFTOKEN=16568700">Revisiting ShortStraw</a> which describes iStraw, a technique which attempts to address the shortcomings of shortstraw, mainly in the area of curved lines.</p>
<p>p.s. The screenshot is in contrast with <a href="http://stevehanov.ca/blog/index.php?id=93">Steve Hanov&#8217;s</a> html 5 canvas <a href="http://www.hanovsolutions.com/webdraw/">Web draw</a>, which creates &#8220;wavy lines&#8221; while Shortstraw helps to &#8220;straighten&#8221; hand drawn lines.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lab4games.net/zz85/blog/2010/01/21/geeknotes-shortstrawjs-fast-and-simple-corner-detection/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[geeknotes] JSON DB</title>
		<link>http://www.lab4games.net/zz85/blog/2010/01/12/geeknotes-json-db/</link>
		<comments>http://www.lab4games.net/zz85/blog/2010/01/12/geeknotes-json-db/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 17:33:42 +0000</pubDate>
		<dc:creator>Zz85</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[json]]></category>

		<guid isPermaLink="false">http://www.lab4games.net/zz85/blog/?p=1072</guid>
		<description><![CDATA[When I first learn&#8217;t about the json format, I thought: &#8220;what a great idea!&#8221;.
All the great things about it- simplicity, leanness, exactly what xml wasn&#8217;t but ought to be. 
Soon I reasoned that the json format can be persisted in storage in its own form. One can build a simple, portable database using json records [...]]]></description>
			<content:encoded><![CDATA[<p>When I first learn&#8217;t about the <a href="http://www.json.org/">json format</a>, I thought: &#8220;what a great idea!&#8221;.</p>
<p>All the great things about it- simplicity, leanness, exactly what xml wasn&#8217;t but ought to be. </p>
<p>Soon I reasoned that the json format can be persisted in storage in its own form. One can build a simple, portable database using json records with minimal code.</p>
<p>&#8220;Why hasn&#8217;t anyone else built it?&#8221; I thought.</p>
<p><img src="http://couchdb.apache.org/img/sketch.png" alt="CouchDb" /><br />
<em>(sketch from couchdb&#8217;s site)</em></p>
<p>Well, now we have <a href="http://couchdb.apache.org/">CouchDB</a>, a <a href="http://kore-nordmann.de/talks/08_04_unconf_document_storage.pdf">document based storage</a> project by <a href="http://www.apache.org/">apache</a> and <a href="http://cloudant.com/">Cloudant</a>, for your couchdb cloud needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lab4games.net/zz85/blog/2010/01/12/geeknotes-json-db/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
