<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Labs @ Jam3 - Toronto Web Development Reseach Blog &#187; Category==Null</title>
	<atom:link href="http://labs.jam3.ca/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://labs.jam3.ca</link>
	<description></description>
	<lastBuildDate>Thu, 05 Jan 2012 18:53:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Zip Through The Load</title>
		<link>http://labs.jam3.ca/2011/10/zip-through-the-load/</link>
		<comments>http://labs.jam3.ca/2011/10/zip-through-the-load/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 09:00:58 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Category==Null]]></category>

		<guid isPermaLink="false">http://labs.jam3.ca/?p=1012</guid>
		<description><![CDATA[Load times are a Flash Developer&#8217;s nemesis. Even today with download speeds measured in megabits per second, a good developer has to be wary of how slow things are loading. A popular way of speeding up load times are to use a CDN like Cachefly or Amazon. However, these services do cost money and often [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://labs.jam3.ca/wp-content/uploads/2011/08/the_load.jpg"><img src="http://labs.jam3.ca/wp-content/uploads/2011/08/the_load.jpg" alt="" title="the_load" width="537" height="296" class="alignnone size-full wp-image-1052" /></a>Load times are a Flash Developer&#8217;s nemesis. Even today with download speeds measured in megabits per second, a good developer has to be wary of how slow things are loading. A popular way of speeding up load times are to use a CDN like Cachefly or Amazon. However, these services do cost money and often charge by bandwidth used.  An alternative way to speed up loading is to compress your files into a zip file.<br />
<span id="more-1012"></span><br />
This can help load times in a variety of ways. Firstly, downloading a compressed file means less data needs to be transmitted. For example, to build the main voxel model for our site (<a href="http://www.jam3.com">www.jam3.com</a>) we download a file that is roughly 2MB uncompressed. If we zip it, we can get it down to 25KB. While 2MB will only take a few seconds to download on a high end connection, it is a lot to download on slow one.   Secondly, if you compress multiple files in the same zip file you can limit the amount of requests the client and server have to deal with which adds a lot of overhead.   If you are downloading lots of little files these small handshakes can add up to a lot of time and every bit helps. </p>
<p>There are different ways to handle compression for the web but here we&#8217;ll be looking at unzipping using Flash.</p>
<p>Flash doesn&#8217;t handle zip files natively but there are a few libraries available that will add support. The one we&#8217;ll be using here can be found at <a href="http://nochump.com/blog/archives/15">nochump.com</a></p>
<p>First off we need to actually load our zip file:</p>
<pre>
<code>
private function loadZip():void{
    var loader:URLLoader = new URLLoader();
    //since flash doesn't know what to do with a .zip
    //we need to make sure it just loads it as a
    //binary file so it doesn't try to cast it as text.
    loader.dataFormat = URLLoaderDataFormat.BINARY
    loader.addEventListener(Event.COMPLETE, onLoadComplete);
    loader.load(new URLRequest("main.zip"));
}
private function onLoadComplete(e:Event):void{
     //do stuff here
}
</code>
</pre>
<p>Once we have our zip file loaded we can begin to manipulate it to get at the delicious compressed data it contains. </p>
<pre>
<code>
private function onLoadComplete(e:Event):void{
        // get our data from our loader
        var loader:URLLoader = URLLoader(e.target);
        //create a new Zipfile and pass it our data to decode
	var myzip:ZipFile = new ZipFile(loader.data);
}
</code>
</pre>
<p>Each ZipFile has a property called entries which is an array of ZipEntrys. Each file in the zip has a corresponding ZipEntry. A ZipEntry is basically a data object that contains the file name, size, last modified date and a couple of other properties about the file. To trace the first file name we could just do this  <code> trace(myzip.entries[0]);</code><br />
To actually get at the data we need to use the method ZipFile.getInput(entry) which returns a bytearray of our file.</p>
<pre>
<code>
var entry:ZipEntry = myzip.entries[0];
var data:ByteArray = myzip.getInput(entry);
</code>
</pre>
<p>Once we have a byte array there a few different ways to decode our data. For this example, my zip contains an xml file.  We need to convert our data to an XML object. This is surprisingly easy. </p>
<pre>
<code>
var myXml:XML = XML(myByteArray.toString());
trace(myXml);
</code>
</pre>
<p>If our zip contains images it slightly more complicated. The easiest way is to use a Loader&#8217;s loadBytes method. This loads a bytearray and decodes it into the correct type (<a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Loader.html?filter_flash=cs5&#038;filter_flashplayer=10.2&#038;filter_air=2.6#loadBytes%28%29">ASDocs</a>). In this case, jpg. </p>
<pre>
<code>
var myLoader:Loader = new Loader();
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onBytesComplete);
myLoader.loadBytes(myByteArray);				

private function onBytesComplete(e:Event):void{
	var loader:Loader = Loader(e.target.loader);
	addChild(loader.content);
}
</code>
</pre>
<p>One major caveat to loading a zip of images is that its quite CPU intensive. While you do save time on load you can end up waiting for Flash to decode your images for you. Also, zipping a bunch of images doesn&#8217;t save much space. It does however cut down on the amount of requests you are making to the server. </p>
<p>And that&#8217;s all there is too it. Loading compressed files is a great way to compress your load times and make sure your user can zip on through!</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.jam3.ca/2011/10/zip-through-the-load/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paper.js: Vector meets Canvas</title>
		<link>http://labs.jam3.ca/2011/08/paper-js-vector-meets-canvas/</link>
		<comments>http://labs.jam3.ca/2011/08/paper-js-vector-meets-canvas/#comments</comments>
		<pubDate>Tue, 09 Aug 2011 13:41:20 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Category==Null]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[paper.js]]></category>

		<guid isPermaLink="false">http://labs.jam3.ca/?p=947</guid>
		<description><![CDATA[
I know I&#8217;m not the first to delve into the world of Paper.js, but being such a new technology, i figured it was worth a look. Not to mention that you can do some pretty neat stuff with it on any canvas enabled browser.
See these quick examples:
cubes
lines
starfield

First off, if you don&#8217;t know about Paper.js, definitely [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://labs.jam3.ca/wp-content/uploads/2011/08/paperjs_5.jpg"><img src="http://labs.jam3.ca/wp-content/uploads/2011/08/paperjs_5.jpg" alt="" title="paperjs_5" width="537" height="296" class="alignnone size-full wp-image-1004" /></a><br />
I know I&#8217;m not the first to delve into the world of Paper.js, but being such a new technology, i figured it was worth a look. Not to mention that you can do some pretty neat stuff with it on any canvas enabled browser.</p>
<p>See these quick examples:<br />
<a href="http://labs.jam3.ca/paper/?id=0" target="_blank">cubes</a><br />
<a href="http://labs.jam3.ca/paper/?id=1" target="_blank">lines</a><br />
<a href="http://labs.jam3.ca/paper/?id=2" target="_blank">starfield</a></p>
<p><span id="more-947"></span></p>
<p>First off, if you don&#8217;t know about Paper.js, definitely <a href="http://paperjs.org/">check it out</a>, its a vector graphics framework built on top of Javascript and the HTML 5 Canvas element. It gives you the ability to easily draw some pretty neat things, and performance seems pretty great as well (usually runs about 60fps). It takes a bit getting used to, but its an interesting approach to the normal javascript development process. Here is the basic setup.</p>
<pre><code>
&lt;script src="js/paper.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="js/main.js" type="text/paperscript"&gt;&lt;/script&gt;
&lt;canvas id="draw" width="100%" height="100%" resize="true"&gt;&lt;/canvas&gt;
</code></pre>
<p>As you can see, first you include the Paper.js source file, then you include your code file with the type as text/paperscript. This will setup your basic events and also provide your script with the extra functionality and classes that Paper.js uses. You also pass the id of the canvas element you want to draw to with the canvas parameter. That&#8217;s pretty much all you need to get you started. Paper.js adds a lot of new classes to use for drawing and also hooks up your events for you so you can get right to the creative part. A complete api reference is available <a href="http://paperjs.org/reference/">here</a>. My template file usually starts off with some of the more common events, as seen below.</p>
<pre><code>
function onFrame(e) {
	e.time // Time in seconds since the app started
}
function onResize(e) {
	view.size // The current canvas size, in a Size object.
}
function onMouseMove(e) {
	e.point; // The current mouse position, in a Point object.
}
</code></pre>
<p>I won&#8217;t go into too much detail about the basic javascript code, but i will go over some of the basic drawing techniques I&#8217;ve used. Path is your basic drawing class, allowing you to draw lines and shapes similar to the flash graphics engine. To control the look of your Path you set fillColor and and strokeColor (they accept CSS values or the colour classes provided by Paper.js like RGBColor). Once a path has been created, it is in the display list unless you specifically call remove(). You can also add your paths to a Group which allows you to control them all with a single function call. I&#8217;ll go over how i drew the shapes in each example.</p>
<p><a href="http://labs.jam3.ca/paper/?id=1">Lines</a> / <a href="http://labs.jam3.ca/paper/js/lines.js">Source</a></p>
<p>Lines are one of the easiest things to draw in Paper.js. Simply create a Path, add points to the line by sending a Point object to the add() function. If you would like your line to be curved instead of jagged, simply call smooth() on the Path. To change the thickness and colour, simply set the strokeColor and strokeWidth properties. Note: the smooth() function must be called any time the points change.</p>
<pre><code>
path = new Path();
path.strokeWidth = Math.round(Math.random()*4)+2;
path.strokeColor = STROKE_COLOR;
for (var n=0; n&lt;POINTS; n++) {
	path.add(new Point(width/(POINTS-1)*n,start+i*SPACING));
}
</code></pre>
<p>The animation of this is a simple sin wave with a multiplier based off mouse position.</p>
<p><a href="http://labs.jam3.ca/paper/?id=2">Stars</a> / <a href="http://labs.jam3.ca/paper/js/stars.js">Source</a></p>
<p>Stars is also a simple application.</p>
<pre><code>
new Path.Circle(new Point(0,0),values.size);
initial.fillColor = 'white';

var symbol = new Symbol(initial);
for (var i=0; i&lt;values.stars; i++) {
	var item = symbol.place(Point.random()*view.size);
}
</code></pre>
<p>We create an initial circle using the Path.Circle function passing in the center point and the radius. This time, we create a Symbol out of the circle which basically turns our circle into a stamp. We call the function place() on the Symbol and pass in a Point object to create a copy of the item at that location. Since we do not keep track of each item in this project, we can simply loop through the children of the activeLayer which is a property of the project variable (available by default without having to declare it).</p>
<pre><code>
var layer = project.activeLayer;
for (var i = 0; i &lt; layer.children.length; i++) {
	layer.children[i].x += values.speed*item.data.scale;
}
</code></pre>
<p>The speed of the particles in this example is controlled by mouse position.</p>
<p><a href="http://labs.jam3.ca/paper/?id=0">Cubes</a> / <a href="http://labs.jam3.ca/paper/js/cubes.js">Source</a></p>
<p>The cube creating part of this example was taken from the Paper.js examples, but i&#8217;ll try to explain whats going on:</p>
<pre><code>Path.RegularPolygon(view.center, 6, 30);</code></pre>
<p>This function creates a 6 sided polygon that has a radius of 30, simple enough, but to create the 3d colouring effect, we have to parse each segment (each segment being a triangle for each side of the shape) into its own Path. To do this, we run through the segments array and clone() each segment into a path and colour them appropriately. This only needs to happen once, as we are then able to simply clone() the Cube that we have created and stored when we want to make another.</p>
<p>The animation of this is just a simple spring effect with a mouse based rotation applied to the container.</p>
<p>I hope these examples have given you a good primer to get started with Paper.js. Now that you have the basics, you are good to go, let your creativity fly. Paper.js allows you to easily create shapes, lines, and even work with loaded images. There is still a lot of unexplored terrain left for me to explore, but here are a few of the examples i came up with after taking a look through the examples posted on the Paper.js website. I&#8217;ve also provided the links to the source so you can see how its done.</p>
<p><a href="http://labs.jam3.ca/paper/">View Examples</a></p>
<p>You can check out the official examples <a href="http://paperjs.org/examples/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.jam3.ca/2011/08/paper-js-vector-meets-canvas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Splitificating Copy: Kicking Textfields&#8217; Ass, One Letter at a Time</title>
		<link>http://labs.jam3.ca/2011/06/splitificating-copy-kicking-textfields-ass-one-letter-at-a-time/</link>
		<comments>http://labs.jam3.ca/2011/06/splitificating-copy-kicking-textfields-ass-one-letter-at-a-time/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 20:31:04 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Category==Null]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[splitify]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://labs.jam3.ca/?p=836</guid>
		<description><![CDATA[
Text and typography effects are all the rage right now. This example shows you what you can do when you can manually animate each individual letter. Manually splitting text fields for animations can be pretty annoying though. In this post I’ll show you how to split your text fields for use in animations.

First off, you’ll [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://labs.jam3.ca/wp-content/uploads/2011/06/splitification1.jpg"><img src="http://labs.jam3.ca/wp-content/uploads/2011/06/splitification1.jpg" alt="Title graphic for Splitificating Copy: Kicking Textfields' Ass, One Letter at a Time" title="Splitificating Copy: Kicking Textfields' Ass, One Letter at a Time" width="537" height="296" class="aligncenter size-full wp-image-871" /></a></p>
<p>Text and typography effects are all the rage right now. <a href="http://labs.jam3.ca/wp-content/uploads/2011/06/RandomText.swf"  target="_blank">This example</a> shows you what you can do when you can manually animate each individual letter. Manually splitting text fields for animations can be pretty annoying though. In this post I’ll show you how to split your text fields for use in animations.<br />
<span id="more-836"></span><br />
First off, you’ll need a text field. I prefer to have my TextField in place and added to the displaylist already so that you can replace it later with your individual fields.</p>
<p>To split our fields we’re going to create a class that will split our text up for us, store references to the fields it creates and replace our single TextField with many fields. This class should also provide methods for accessing our newly created fields.</p>
<p><code><br />
package {</p>
<p>   public class SplitText<br />
   {<br />
       private var _fields:Vector.&lt;TextField&gt; = new Vector.&lt;TextField&gt;();<br />
       private var originalField:TextField;<br />
       private var origParent:DisplayObjectContainer;<br />
       private var _numFields:int = 0;</p>
<p>       public function SplitText()<br />
       {<br />
       }</p>
<p>       public function splitify(textField:TextField):void{</p>
<p>       }</p>
<p>        public function get textFields():Vector.&lt;TextField&gt;{<br />
           return _fields;<br />
       }<br />
       public function get numFields():int{<br />
           return _numFields;</p>
<p>      }<br />
  }<br />
}<br />
</code><br />
So now we have our class structure flushed out. As you can see we have a Vector for storing our fields, as well as places to store references to both our original field and its parent.</p>
<p>We would use this new class like this:<br />
<code><br />
var splitText:SplitText = new SplitText();<br />
splitText.splitify(myField);</p>
<p>//do something here to the new fields!<br />
</code></p>
<p>But wait! our split method doesn’t do anything yet! Lets fix that.</p>
<p>Lets build our function:<br />
<code><br />
public function  splitify(textField:TextField):void{</p>
<p>//store a reference to the original field<br />
           originalField = textField;</p>
<p>           //we want to be able to add our new fields in the same place as the old field. In order to do this we need to make sure that our old field has a parent.<br />
           if(originalField.parent ==null) {<br />
               throw new Error("Please add your textfield to the displaylist before attempting to split it. This will replace your feild in place");<br />
           }</p>
<p>           //store the parent<br />
           origParent = originalField.parent;</p>
<p>           //remove our feild from its parent<br />
           origParent.removeChild(textField);</p>
<p>           //store how many letters are in our textField<br />
           var numLetters:int = originalField.length</p>
<p>          //the text format includes all the important properties we’ll need to  duplicate our feild over and over<br />
          var tf:TextFormat = originalField.getTextFormat(); </p>
<p>         //loops through every letter<br />
         for(var i:int = 0;i&lt;numLetters;i++){</p>
<p>         //skips to the next letter if the current one is a space<br />
         if(originalField.text.charAt(i)==" ") continue;</p>
<p>         //creates a new textfield<br />
         var t:TextField = new TextField();</p>
<p>        //since we want our new field to have the same font we’ll have to make sure it will embed it.<br />
        t.embedFonts =true;</p>
<p>        //apply the textformat to the new feild<br />
        t.defaultTextFormat = tf;<br />
        t.setTextFormat(tf);               </p>
<p>       //since our text is going to be only one letter we want to make sure its single line and resizes correctly<br />
       t.multiline = false;<br />
       t.wordWrap = false;</p>
<p>       //this gives us a rectangle for the bounds of the indivual letter. Lets us place the new field in the same spot.<br />
       var rect:Rectangle = originalField.getCharBoundaries(i);          </p>
<p>       //the rect is relative to the text field, but we want our fields to be relative to the  to the original fields parent so we had its own x,y to our new field<br />
       t.x = rect.x+originalField.x<br />
       t.y = rect.y+originalField.y;<br />
       t.width = rect.width;<br />
       t.height = rect.height;</p>
<p>       //put our letter in the field<br />
       t.text = originalField.text.charAt(i);  </p>
<p>       //add  our new next field to the parent of the<br />
       origParent.addChild(t);                </p>
<p>       //store our new field in our vector/array<br />
       _fields.push(t);    </p>
<p>       //we increment our counter like this because using myArray.length() is actually very very slow.<br />
           _numFields++;<br />
       }<br />
}<br />
</code></p>
<p>Done! we now have our fields in place and ready to be animated!<br />
As <a href="http://labs.jam3.ca/wp-content/uploads/2011/06/RandColor.swf" target="_blank">an example</a> of what we can do, this next chunk will change the color of each letter to something random.</p>
<p><code><br />
	for(var i:int = 0; i&lt; splitText.numFields;i++){<br />
			var tf:TextFormat =    splitText.textFields[i].getTextFormat();<br />
			tf.color  =  0xFFFFFF * Math.random();<br />
			splitText.textFields[i].setTextFormat( tf);<br />
	}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.jam3.ca/2011/06/splitificating-copy-kicking-textfields-ass-one-letter-at-a-time/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JQuery vs. Mootools</title>
		<link>http://labs.jam3.ca/2011/06/jquery-vs-mootools/</link>
		<comments>http://labs.jam3.ca/2011/06/jquery-vs-mootools/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 14:28:30 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Category==Null]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[debate]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[mootools]]></category>

		<guid isPermaLink="false">http://labs.jam3.ca/?p=718</guid>
		<description><![CDATA[
Now i know javascript frameworks are nothing new, and these two have been around for awhile now, but the JQuery vs Mootools debate still comes up quite often so I&#8217;d figure I&#8217;d share my reasoning for picking one over the other. It also seems like lately there has been a bit of a shift away [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://labs.jam3.ca/wp-content/uploads/2011/05/Moo_vs_Jquery.jpg"><img class="size-full wp-image-808" title="Moo_vs_Jquery" src="http://labs.jam3.ca/wp-content/uploads/2011/05/Moo_vs_Jquery.jpg" alt="JQuery vs. Mootools" width="537" height="296" /></a></p>
<p>Now i know javascript frameworks are nothing new, and these two have been around for awhile now, but the JQuery vs Mootools debate still comes up quite often so I&#8217;d figure I&#8217;d share my reasoning for picking one over the other. It also seems like lately there has been a bit of a shift away from flash so javascript has become a more popular topic as of late. Another factor is the misconceptions of HTML5, a lot of what clients think HTML5 brings too the table, has already been possible with javascript frameworks. So lets get right into it shall we.<br />
<span id="more-718"></span></p>
<p>Right off the bat, I&#8217;ll mention that i prefer to use Mootools, so you may think there is bias but i have used both and i know some of the strengths and weaknesses of both, so bare with me. I am also the only developer at the office that likes Mootools, the other 2 experienced javascript developers both use JQuery, so you know there are different opinions floating around.</p>
<p>First thing we should get out of the way is where the libraries are comparable.</p>
<ul>
<li>Size: both libraries are roughly 80kb without being gzipped, so no real winner there.</li>
<li>Speed: There are multiple tests out there comparing the speed, seems generally even, with each library excelling in different areas. (<a href="http://mootools.net/slickspeed/" target="_blank">http://mootools.net/slickspeed/</a>, i know its old, but it looks the most comprehensive)</li>
<li>Selectors: Both use $ to select dom elements, JQuery uses it as a css selector, MooTools as an id selector, with $$ for your css selections, so not a whole lot of difference there.</li>
</ul>
<p>Now for the differences, I&#8217;ll just focus on the main ones that I&#8217;ve encountered and happen to be opinionated about.</p>
<ul>
<li>Syntax: Here is one of the places i think MooTools has the upper hand. JQuery&#8217;s main method of programming involves chaining (function&#8217;s returning the original object so that another function can be called. i.e. MyObject.dothis().thenthis().thenthat(); ). I know many people like this way of coding, but coming from more object oriented languages, it seems like a process to make code messy and confusing. I know it is possible to write cleaner code in JQuery but chaining is the generally approved syntax so it&#8217;s what i see most often. Also the shorthand methods such as hover() which attaches function&#8217;s to rollover events. This seems like just another way to make it harder for others to work with your code, generally i&#8217;ll look for an addEventListener function call to check for rollover events, but now i also have to worry about all the extra shorthands and when combined with chaining, this can get really messy really quick.</li>
<li>O.O.P: Here is where i think a lot of people will agree with me. Coming from Object Oriented Languages, i realize how important this style of coding is to me, which is also why i generally choose MooTools for my projects. It is one of the more comprehensive implementations of the O.O.P syntax that i have seen, it even includes inheritance. While the JQuery plugin syntax leaves something to be desired, at least in the realm of O.O.P.</li>
<li>Community: This is where JQuery stands out. The community that stands behind JQuery is quite large, with many plugins being created and shared daily. MooTools can&#8217;t really say the same, there are definitely coders out there making scripts to share with the world, but it simply isn&#8217;t as big or as in depth as the JQuery community. One day MooTools may catch up, but i doubt it, i feel that JQuery simply targets a larger market than MooTools.</li>
</ul>
<p>So there you have it, the reasons i choose MooTools over JQuery. You may not agree, heck, even people at my office don&#8217;t agree, but if you agree with any of the points i have made, i say give MooTools a try, i doubt you will be disappointed.</p>
<p>A great site that takes this debate much further is <a href="http://jqueryvsmootools.com/" target="_blank">http://jqueryvsmootools.com/</a>. It even includes comprehensive examples of each point. So if you want to know more information about these two libraries, definitely check it out.</p>
<p>P.S. I didn&#8217;t mention the other libraries out there because frankly, i haven&#8217;t used them (other than prototype/scriptaculous, but that was a while ago), so i can&#8217;t speak about them. I&#8217;m not trying to take anything away from them, i just don&#8217;t know enough about them.</p>
<p>P.P.S. MooTools can extend flash objects to call functions on them, which we do a lot around here. And last i checked, JQuery wasn&#8217;t able to.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.jam3.ca/2011/06/jquery-vs-mootools/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Making of bj&#246;rk.com pt. 1</title>
		<link>http://labs.jam3.ca/2011/05/making-of-bjrk-com-pt-1/</link>
		<comments>http://labs.jam3.ca/2011/05/making-of-bjrk-com-pt-1/#comments</comments>
		<pubDate>Wed, 25 May 2011 15:01:31 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Category==Null]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://labs.jam3.ca/?p=713</guid>
		<description><![CDATA[About 6 months ago we were contacted by a company in the uk because of this blog post. They were particularly interested in creating an html5 experience for the Bjork&#8217;s new web site. Who wasn&#8217;t? After Steve had this to say, and experiments like 100-tweets drummed up interest, the interwebs were ready to critically acclaim [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://labs.jam3.ca/wp-content/uploads/2011/05/bjork_blogpost.jpg"><img class="alignnone size-full wp-image-793" title="bjork_blogpost" src="http://labs.jam3.ca/wp-content/uploads/2011/05/bjork_blogpost.jpg" alt="" width="537" height="296" /></a>About 6 months ago we were contacted by a company in the uk because of <a href="http://labs.jam3.ca/2010/02/html5-3d-canvas-no-way/">this blog post</a>. They were particularly interested in creating an html5 experience for the <a href="http://www.bjork.com">Bjork&#8217;s new web site</a>. Who wasn&#8217;t? After Steve had <a href="http://www.apple.com/hotnews/thoughts-on-flash/">this to say</a>, and experiments like <a href="http://9elements.com/io/projects/html5/canvas/">100-tweets</a> drummed up interest, the interwebs were ready to critically acclaim an html web experience and that&#8217;s when the <a href="http://thewildernessdowntown.com/">wilderness downtown</a> came onto the scene. It captured awards at the highest levels, and solidified the technology as a serious contender to deliver the highest quality web experiences &#8211; at least the marketing punch. When we saw the designs from <a href="http://mmparis.com/">m/m (paris)</a>, we got really excited. The mission: make it in &#8216;html5&#8242; and it had to play nice on the iPad and iPhone. We knew this was going to be one of the most challenging projects we had worked on to date.<br />
<span id="more-713"></span><br />
<a href="http://labs.jam3.ca/wp-content/uploads/2011/05/bjork_css31.jpg"><img class="alignnone size-full wp-image-797" title="bjork_css3" src="http://labs.jam3.ca/wp-content/uploads/2011/05/bjork_css31.jpg" alt="" width="537" height="327" /></a><br />
<strong>The first stab</strong><br />
We knew from the previous experiments that the iPad did not like to do thousands of draw commands on the canvas so we thought we would entertain a <a href="http://labs.jam3.ca/bjork/">pure css3 solution</a>. While the results (albeit really rough) were promising  from a performance perspective (w/ z-transforms) there were two big problems: 1. Chrome wan&#8217;t going to show the z-space and the Chrome roadmap was unclear as to when it would be supported. 2. Stylistically, flat planes in space were distorting the geometry &#8211; lines were disappearing &#8211; of course! They&#8217;re planes! A lot of work would have to go into a hybrid solution of some kind. It became clear that this was a dead end for this creative.</p>
<p><a href="http://labs.jam3.ca/wp-content/uploads/2011/05/bjork_sketchup.jpg"><img class="alignnone size-full wp-image-799" title="bjork_sketchup" src="http://labs.jam3.ca/wp-content/uploads/2011/05/bjork_sketchup.jpg" alt="" width="537" height="382" /></a><br />
<strong>Working with Google Sketch-up<br />
</strong>For whatever reason, the creative team had chosen Google Sketch-up to design the galaxy. This proved to be a bit of a curveball. With thousands of lines and 3D spheres in the model, we scratched our heads wondering how we would get the data out of Sketchup and into some kind of format we could use in the browser. We spent hours googling, searching for a proven method to get the data out. We tried  <a title="Three.js" href="http://mrdoob.com/blog/post/693">three.js</a> but there wasn&#8217;t a way to make it work &#8211; managing optimization was a big concern. Our focus turned to the file types that Sketchup exported.<br />
<a href="http://labs.jam3.ca/wp-content/uploads/2011/05/bjorkinthreejs.jpg"><img class="alignnone size-full wp-image-803" title="bjorkinthreejs" src="http://labs.jam3.ca/wp-content/uploads/2011/05/bjorkinthreejs.jpg" alt="" width="537" height="335" /></a></p>
<p>We eliminated all but one sphere and one line in the galaxy and exported the file in every format possible. After a bit of poking around, the .xsi file format showed the most promise. Once opened in a text editor, we were pleased to discover we could clearly see what line data looked like and what made up a sphere. Lines had a start x,y,z and end point x,y,z. Sphere data was a bit more complicated, with a single the 3d object comprised of hundreds of mesh positions defining faces of the spherical body. A flash application was written to parse the lines and php was used to parse the sphere data, average the position in space and calculate the radius. We finally had our data.</p>
<p><strong>Drawing the galaxy</strong><br />
We had seen some promising work done by <a href="http://www.giuseppesicari.it/">Giuseppe Sicari</a> which bolstered our expectation that what we were going to attempt would work.. he was just missing a Camera you could control. It was now time to write our very own javascript 3D engine and in only a few days Mikko had made <a href="http://labs.jam3.ca/bjork3/">this</a>. There still was no camera object and we still needed to create &#8216;the compass&#8217; indicator but it was a start. High-fives were had.<br />
<a href="http://labs.jam3.ca/wp-content/uploads/2011/05/svgs.jpg"><img class="alignnone size-full wp-image-801" title="svgs" src="http://labs.jam3.ca/wp-content/uploads/2011/05/svgs.jpg" alt="" width="537" height="319" /></a><br />
<strong>Illustrator to HTML5</strong><br />
One of the key design elements in the site is the compass indicator that orients the user experience in the site. The compass is again re-used for the mobile version of the site. These design assets were provided as Illustrator files and we needed a way to express them as line data we could plot on the canvas. After hours of poking around we stumbled upon <a href="http://code.google.com/p/lindenb/wiki/SVGToCanvas">Pierre Lindenbaum&#8217;s library </a>that could convert svg to html canvas drawing commands&#8230; but of course this was not ready for us to use out of the box because our data was different. Another php script was needed to convert this drawing commands into the paths we use in our native JAM3d.js. And since the compass is comprised of two planes that intersect, the second set of paths needed to be offset onto another axis and the values painstakingly shifted to make the model symmetrically join. The fun was just starting..</p>
<p><strong>In Part 2</strong>, Mikko will explain the challenges we faced writing Jam3D.js, Camera3D and more!</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.jam3.ca/2011/05/making-of-bjrk-com-pt-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flash 10 3D: Still not Ready for the Primetime</title>
		<link>http://labs.jam3.ca/2011/05/flash-10-3d-still-not-ready-for-the-primetime/</link>
		<comments>http://labs.jam3.ca/2011/05/flash-10-3d-still-not-ready-for-the-primetime/#comments</comments>
		<pubDate>Thu, 05 May 2011 20:35:46 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Category==Null]]></category>
		<category><![CDATA[2.5d]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[Away3d]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[MoleHill]]></category>
		<category><![CDATA[papervision3d]]></category>

		<guid isPermaLink="false">http://labs.jam3.ca/?p=683</guid>
		<description><![CDATA[3D is all the rage right now in the web. WebGL is finally becoming a reality and Adobe has also just released the low level 3d API, Molehill. However, both of these technologies are quite involved and aren&#8217;t really suited to quick and dirty 3d effects. This is where the flash10 3D, or maybe more [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://labs.jam3.ca/wp-content/uploads/2011/04/blurry_text_main.jpg"><img src="http://labs.jam3.ca/wp-content/uploads/2011/04/blurry_text_main.jpg" alt="" title="Flash 10 3d" width="537" height="296" class="aligncenter size-full wp-image-703" /></a>3D is all the rage right now in the web. WebGL is finally becoming a reality and Adobe has also just released the low level 3d API, Molehill. However, both of these technologies are quite involved and aren&#8217;t really suited to quick and dirty 3d effects. This is where the flash10 3D, or maybe more accurately 2.5D, features came in. The idea here was to give developers the ability to do simple 3D effects by simply manipulating the properties of an object without having to resort to complicated and time consuming math.<br />
<span id="more-683"></span><br />
However, these API&#8217;s have been in the wild for over a year and are still very buggy.One very common issues that once you start transforming an object with the 3d api it becomes something like a 3d object and takes on special characteristics. One the most annoying is that vectors start to be rendered like a bitmap. This can make for blurry text and graphics.<br />
<a href="http://labs.jam3.ca/wp-content/uploads/2011/05/blurry_text_example1.png"><img src="http://labs.jam3.ca/wp-content/uploads/2011/05/blurry_text_example1.png" alt="" title="blurry text example" width="165" height="47" class="aligncenter size-full wp-image-706" /></a><br />
In the above example the two fields have identical fonts, size, colors etc&#8230; but the top line&#8217;s z property is set to 0.  This instantly causes the text to become blurry. You can unblur the TextField by setting its transform.matrix3D to null but this would remove any 3d transformations that have been previously applied which may be undesirable. </p>
<p>Flash, as you are probably aware, has a limit of how big an object can be before it won&#8217;t be rendered. In flash 10, this limit is 4096*4096. Normally this isn&#8217;t an issue but when you try to apply a 3d transform to a large bitmap, especially if you are changing the Z,  it can make it appear to flash to be much much larger than it is. For example, in one instance flash was reporting to me a height of 329435294 which is obviously not correct.  My solution was the break up the image into 2 and put them in a container and transform the container. That doesn&#8217;t seem to make sense since the container is now the same size as the previous object but I don&#8217;t ask questions. </p>
<p>Lastly, I had another issue where doing these transformations in a loaded SWF caused my SWF to behave as though mouseEnabled was set to false and no amount of =true seemed to fix it. Again the solution here was to transform the container. I&#8217;m Lucky I had that option here. </p>
<p>You would think that after all this time and new player updates that these issues would have been ironed out and we&#8217;d have fast, easy 3D for the masses but it&#8217;s still not ready. I would suggest biting the bullet and going with something like Papervision3D or away3d even though it may seem like overkill. </p>
]]></content:encoded>
			<wfw:commentRss>http://labs.jam3.ca/2011/05/flash-10-3d-still-not-ready-for-the-primetime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Great Time To Be a Web Developer In An App Store Economy</title>
		<link>http://labs.jam3.ca/2011/02/great-time-to-be-a-web-developer-in-an-app-store-economy/</link>
		<comments>http://labs.jam3.ca/2011/02/great-time-to-be-a-web-developer-in-an-app-store-economy/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 17:51:57 +0000</pubDate>
		<dc:creator>Mikko</dc:creator>
				<category><![CDATA[Category==Null]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://labs.jam3.ca/?p=507</guid>
		<description><![CDATA[
There are two main problems that developers have face:

How to get people to see your app
How to make money off that app

App stores really solve both of these issues. One of the coolest things as a web developer is the fact that there are ways to create &#8220;native&#8221; apps for these app stores using the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://labs.jam3.ca/wp-content/uploads/2011/02/appstores_snapshot.jpg"><img src="http://labs.jam3.ca/wp-content/uploads/2011/02/appstores_snapshot.jpg" alt="" title="appstores_snapshot" width="500"  class="alignnone size-full wp-image-542" /></a><br />
There are two main problems that developers have face:</p>
<ol>
<li><strong>How to get people to see your app</strong></li>
<li><strong>How to make money off that app</strong></li>
</ol>
<p>App stores really solve both of these issues. One of the coolest things as a web developer is the fact that there are ways to create &#8220;native&#8221; apps for these app stores using the standard languages we use: <strong>html</strong>, <strong>js</strong>, <strong>css</strong>, and <strong>AS3</strong>.<br />
<span id="more-507"></span></p>
<p>Here are some platforms web developers can deploy to using the languages noted above: </p>
<style>
.appstoretable{ margin:5px;border:solid 1px #F90; font-size:10px; width:400px;} .appstoretitle { font-weight:bold; background-color:#F90; padding:4px; color:#000; } .appstoretable tr.item { background-color: #333;text-align:center; } .appstoretable tr.item2 { background-color:#000;text-align:center; } .appstoretable th { font-weight:bold; background-color:#F90; padding:8px; color:#000; } .winner {background-color:#0F0;color:#000;} .looser {background-color:#F00;color:#000;}
</style>
<table class="appstoretable">
<tr class="item">
<th>App Store</th>
<th>Platforms</th>
<th>Monetization Methods</th>
<th>Revenue</th>
<th>Payment Cycle</th>
<th>Cost</th>
<th>Minimum App Price</th>
<th>Approval Process</th>
</tr>
<tr class="item2">
<td>iOs App Store</td>
<td>iPod, iPhone, iPad</td>
<td>App Sales, In App Adds, In App Sales, Subscriptions (soon)</td>
<td>70% store 70% For App Sales 60% For Adds</td>
<td class="looser">Monthly when $150 is reached</td>
<td>$99 per year</td>
<td>$0.99</td>
<td>Yes</td>
</tr>
<tr class="item">
<td>Mac App Store</td>
<td class="looser">Apple Computers</td>
<td class="looser">App Sales</td>
<td>70%</td>
<td>Monthly</td>
<td>$99 per year</td>
<td>$0.99</td>
<td>Yes</td>
</tr>
<tr class="item2">
<td>Blackberry App World</td>
<td>Many Blackberry Phones: Blackberry Playbook</td>
<td class="winner">App Sales, In App Sales, In App Adds, Subscriptions</td>
<td>70% For App Sales 60% For Adds</td>
<td>When using Carrier Based Billing- Monthly when $50 earned. Paypal- Monthly when $100 is reached</td>
<td class="looser">$200 per 10 credits. Credits are charged on submitting an app (even if it doesnt pass the Approval process)</td>
<td>$0.99</td>
<td>Yes</td>
</tr>
<tr class="item">
<td>Chrome Web Store</td>
<td>Chrome Browsers and Chrome OS Based Devices</td>
<td>App Sales, Subscription, In App Sales, Adds (of course since its a web app you can use in app adds from AdSense or elsewhere)</td>
<td class="winner">95%-30 cent processing fee</td>
<td class="winner">2 days after a successful sale if the payout is more than $1</td>
<td>$5 one time</td>
<td>$1.99</td>
<td>Yes</td>
</tr>
<tr class="item2">
<td>Android Market</td>
<td>Android Based Devices</td>
<td>App Sales, In App Sales</td>
<td>70%</td>
<td class="winner">Changes based on country and bank but $1 must be reached</td>
<td>$25 one time + $20 to enroll for payment service</td>
<td>$0.99</td>
<td class="winner">No</td>
</tr>
<tr class="item">
<td>Nokia Ovi</td>
<td class="winner">Nokia Devices</td>
<td class="looser">App Sales</td>
<td>70%</td>
<td>Monthly when 100 euros is reached</td>
<td class="winner">1 euro one time</td>
<td>1 euro</td>
<td>Yes</td>
</tr>
</table>
<p><strong>Conclusions:</strong><br />
If you are a developer and want to start developing with minimal overhead and with <strong>huge reach</strong> the <a href="http://store.ovi.com/">Nokia Ovi store</a> is the way to go. The Apple iDevices are extremely popular in North America but worldwide Nokia is still a HUGE player with bigger reach.</p>
<p>The <a href="https://chrome.google.com/webstore">Chrome web store</a> is the most <strong>straightforward</strong> option for web developers. The sign up fee is very minimal and there are no other tools you need to learn (or buy) to deploy apps. Out of all the stores the Chrome web store takes the <strong>smallest cut</strong> however it&#8217;s a very new platform and doesn&#8217;t have the same user counts the other platforms can boast. The $1.99 minimum app price point is interesting in that as a developer you will not be competing against $0.99 apps however it being a new platform it could deter users.</p>
<p>Even though neither of the <a href="http://itunes.apple.com/us/genre/ios/">Apple</a> <a href="http://www.apple.com/mac/app-store/">stores</a> won in any of the columns they are obviously still a great option to develop for. They were the first platform to have an app store and so the other app stores are definitely trying to compete against Apple&#8217;s stores and with good reason. The iOs store still <strong>sells the most apps</strong> out of any store.</p>
<p>The <a href="https://market.android.com/">Android market</a> shouldn&#8217;t be forgotten as it is currently the biggest competitor in app sales vs the Apple store. Enrollment fees are quite a bit lower than the Apple store&#8217;s and it&#8217;s nice that they <strong>payout developers quite often</strong>.</p>
<p><a href="http://appworld.blackberry.com/webstore/">Blackberry App World</a> is an interesting underdog. Currently it&#8217;s receiving A LOT of developer support especially from the Flash Platform community because of the <a href="http://us.blackberry.com/playbook-tablet/">Blackberry Playbook</a> and <a href="http://devblog.blackberry.com/2010/10/blackberry-playbook-developer-promotion-information/">this promotion</a>. It&#8217;s very cool that they&#8217;ve been working on app monetization strategies more than anyone else. This gives the most avenues for developers to make money. Cost for being a App World developer is much too high though. (although currently the initial $200 fee is waved) Unlike the other stores where you pay a one time fee or anually in the App World developers pay <strong>$200 to receive 10 credits</strong>. One credit is used per app you submit. You will not receive your credit back if your application fails the QA process. You will also have to use one credit to update your app. This to me is <strong>ridiculous!</strong> In order to maintain quality of applications developers should not be penalized.</p>
<p>Overall the great news is that using the languages you know with some new tools you can target most, if not all of these platforms. (more on these tools in a future post)</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.jam3.ca/2011/02/great-time-to-be-a-web-developer-in-an-app-store-economy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Safari beats Chrome &#8211; HTML5 Canvas drawing method performance</title>
		<link>http://labs.jam3.ca/2011/02/safari-beats-chrome-html5-canvas-drawing-method-performance/</link>
		<comments>http://labs.jam3.ca/2011/02/safari-beats-chrome-html5-canvas-drawing-method-performance/#comments</comments>
		<pubDate>Sat, 05 Feb 2011 04:10:22 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Category==Null]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[canvas3d]]></category>
		<category><![CDATA[google sketchup]]></category>
		<category><![CDATA[jam3d]]></category>

		<guid isPermaLink="false">http://labs.jam3.ca/?p=468</guid>
		<description><![CDATA[Recently we were engaged by a company in the UK and some designers based out of Paris, to bring a 3D model designed in Google SketchUp to life online. This would hardly be noteworthy had we been allowed to use Flash to deliver an interactive experience. But for this project, we were specifically tasked to [...]]]></description>
			<content:encoded><![CDATA[<p>Recently we were engaged by a company in the UK and some designers based out of Paris, to bring a 3D model designed in Google <a href="http://sketchup.google.com/">SketchUp</a> to life online. This would hardly be noteworthy had we been allowed to use Flash to deliver an interactive experience. But for this project, we were specifically tasked to use HTML5 friendly techniques.  Thank you Mr. Jobs. Unfortunately, we can&#8217;t share any links at this time but we promise we will share once we launch. So what happens when you try to draw 8000+ lines on a canvas?</p>
<div id="attachment_469" class="wp-caption alignnone" style="width: 602px"><a href="http://labs.jam3.ca/wp-content/uploads/2011/02/constellation_snapshot.jpg"><img style="border: solid 1px #FFF;" class="size-full wp-image-469" title="constellation_snapshot" src="http://labs.jam3.ca/wp-content/uploads/2011/02/constellation_snapshot.jpg" alt="" width="530" /></a><p class="wp-caption-text">...snapshot of the &quot;constellation&quot; of lines and &#39;spheres&#39;</p></div>
<p><span id="more-468"></span><br />
The model, aka the &#8220;constellation&#8221; pictured above, had over 8000 lines and over 300 spheres. The designer, thankfully, had used a monochromatic palette. This was a good thing because it meant that we would not have to worry about z-sorting the lines and circles. Our mission was to render this puppy, fly around and cull what we couldn&#8217;t see.</p>
<p>Once we had parsed the data (that&#8217;s a future post and a half), we were ecstatic, it was nearly imperceptibly different from what we were seeing in SketchUp&#8230; but.. then we glanced at our frame rate stats and we were only getting 9fps. As we moved our camera in and out we saw the fps hover between 4-9fps. We thought, ok, maybe Safari on mac is not as fast as Chrome. Alas! Chrome was performing slighly worse, with a lower bottom end at 3-6fps.</p>
<p>Where was our sweet spot? How many lines and spheres can one draw on the canvas and achieve acceptable frame rates? What is more taxing, lines or spheres? We would be happy with 20fps. We broke out the lab coats and went to work creating versions of the constellation with decreasing amounts of lines and spheres. We also separated the lines from the spheres and ran some tests independently. Keep in mind, that this is not uniform test since, as you can see in the screenshot above, the lines are not spread evenly in x,y or z space nor are the total number of lines and circles drawn on screen at any given time. So this is also a test of pure javascript performance, looping through the arrays and deciding if a line should be drawn.</p>
<p><strong>The Tests</strong></p>
<p>We ran 3 tests. For our 1st test, we took every third, then fourth line etc. from the original 8847 lines in the array. The second and third test gave us insight into how much overhead the circles were adding to the drawing methods.</p>
<p>We wanted to share our findings with respect to the performance (measured in fps) we recorded in FireFox, Chrome and Safari on the Mac and their counterparts on the PC. All tests were conducted at 1200&#215;800. We were also very interested in seeing how  the HTML5 canvas performed on the iPad because part of the end project is to produce similar results in the browser on the iPhone and iPad. All of these browsers <a title="Find me by IP" href="http://www.findmebyip.com/litmus" target="_blank">support the canvas</a> and some browsers have even fashioned <a title="Chrome Speed Test" href="http://www.youtube.com/watch?v=nCgQDjiotG0">marketing campaigns</a> around their performance. But what we found surprising was the chasm separating the slowest from the fastest frame rates.</p>
<p>As you will see in the tables below, Firefox was pathetically slow at rendering the model on both mac and pc. Safari was better than Chrome for some reason, as it is widely believed Chrome owns the distinction of being the fastest browser.</p>
<p>In Test 2 and 3, you can see that drawing the circles was not an insignificant overhead, representing  a 2-5 frame jump at the lower end of the range.</p>
<style>
.benchtable{ margin:5px;border:solid 1px #F90; font-size:10px; } .benchtitle { font-weight:bold; background-color:#F90; padding:4px; color:#000; } .benchtable th.item { background-color:#666; } .benchtable th.item2 { background-color:#888; } .benchtable th { font-weight:bold; background-color:#999; padding:4px; color:#000; } .winner {background-color:#0F0;color:#000;}
</style>
<table class="benchtable">
<tbody>
<tr>
<td class="benchtitle" colspan="6">Test 1: All, Every 3rd, 4th, 5th , 6th and 7th line element</td>
</tr>
<tr>
<td></td>
<th>Chrome (mac)</th>
<th class="winner">Safari (mac)</th>
<th>Safari 5.0.3 (pc)</th>
<th>Chrome 5.0.375 (pc)</th>
<th>Firefox 3.6.2 (pc)</th>
</tr>
<tr>
<th class="item">8847 lines</th>
<td>2-5fps</td>
<td>4-7fps</td>
<td class="winner">4-9fps</td>
<td>3-6fps</td>
<td>2-3fps</td>
</tr>
<tr>
<th class="item2">2949 lines</th>
<td>8-14fps</td>
<td>9-19fps</td>
<td class="winner">10-15fps</td>
<td>7-12fps</td>
<td>2-13fps</td>
</tr>
<tr>
<th class="item">2212 lines</th>
<td>9-16fps</td>
<td class="winner">12-23fps</td>
<td>11-17fps</td>
<td>10-17fps</td>
<td>6-16fps</td>
</tr>
<tr>
<th class="item2">1770 lines</th>
<td>12-19fps</td>
<td class="winner">14-24fps</td>
<td>13-20fps</td>
<td>11-20fps</td>
<td>1-19fps</td>
</tr>
<tr>
<th class="item">1475 lines</th>
<td>12-21fps</td>
<td class="winner">15-25fps</td>
<td>14-19fps</td>
<td>12-21fps</td>
<td>9-21fps</td>
</tr>
<tr>
<th class="item2">1264 lines</th>
<td>15-23fps</td>
<td class="winner">16-26fps</td>
<td>15-20fps</td>
<td>12-16fps</td>
<td>9-21fps</td>
</tr>
<tr>
<td class="benchtitle" colspan="6">Test 2: Lines and Circles</td>
</tr>
<tr>
<td></td>
<th>iPad (gen1)</th>
<th>Safari (mac)</th>
<th>Safari 5.0.3 (pc)</th>
<th>Chrome 5.0.375 (pc)</th>
<th>Firefox 3.6.2 (pc)</th>
</tr>
<tr>
<th class="item">1000 Lines 263 Circles</th>
<td>3-9fps</td>
<td class="winner">25-49fps</td>
<td>17-24fps</td>
<td>12-18fps</td>
<td>13-18fps</td>
</tr>
<tr>
<th class="item2">800 Lines 263 Circles</th>
<td>3-10fps</td>
<td class="winner">28-50fps</td>
<td>18-21fps</td>
<td>14-29fps</td>
<td>11-24fps</td>
</tr>
<tr>
<th class="item">600 Lines 263 Circles</th>
<td>4-12fps</td>
<td class="winner">34-57fps</td>
<td>17-23fps</td>
<td>15-22fps</td>
<td>18-29fps</td>
</tr>
<tr>
<th class="item2">400 Lines 263 Circles</th>
<td>6-13fps</td>
<td class="winner">34-58fps</td>
<td>18-24fps</td>
<td>16-22fps</td>
<td>18-29fps</td>
</tr>
<tr>
<th class="item">200 Lines 263 Circles</th>
<td>5-13fps</td>
<td class="winner">49-91fps</td>
<td>22-25fps</td>
<td>11-22fps</td>
<td>27-35fps</td>
</tr>
<tr>
<td class="benchtitle" colspan="6">Test 3: No Circles</td>
</tr>
<tr>
<td></td>
<th>iPad (gen1)</th>
<th>Safari (mac)</th>
<th>Safari 5.0.3 (pc)</th>
<th>Chrome 5.0.375 (pc)</th>
<th>Firefox 3.6.2 (pc)</th>
</tr>
<tr>
<th class="item2">1000 Lines 0 Circles</th>
<td>4-11fps</td>
<td class="winner">29-48fps</td>
<td>21-37fps</td>
<td>18-30fps</td>
<td>18-33fps</td>
</tr>
<tr>
<th class="item">800 Lines 0 Circles</th>
<td>4-12fps</td>
<td class="winner">34-52fps</td>
<td>27-39fps</td>
<td>20-32fps</td>
<td>22-34fps</td>
</tr>
<tr>
<th class="item2">600 Lines 0 Circles</th>
<td>4-13fps</td>
<td class="winner">38-71fps</td>
<td>28-41fps</td>
<td>24-43fps</td>
<td>22-42fps</td>
</tr>
<tr>
<th class="item">400 Lines 0 Circles</th>
<td>7-14fps</td>
<td class="winner">54-89fps</td>
<td>36-42fps</td>
<td>28-36fps</td>
<td>34-43fps</td>
</tr>
<tr>
<th class="item2">200 Lines 0 Circles</th>
<td>10-27fps</td>
<td class="winner">82-135fps</td>
<td>27-52fps</td>
<td>42-64fps</td>
<td>38-57fps</td>
</tr>
</tbody>
</table>
<p>While we acknowledge this isn&#8217;t completely a fair test, it shows you that Chrome is not necessarily king, and that there is serious room for improvement from Firefox. We look forward to updating this post with some numbers run against FF4 and Chrome 9. Perhaps the best news was that Safari performed well for us, and is considered the target browser for the project. We will update this post in the coming weeks with greater detail about this project as this data has more to tell us about the performance of canvas drawing methods across the browsers.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.jam3.ca/2011/02/safari-beats-chrome-html5-canvas-drawing-method-performance/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Learning from the Digital Media Zone</title>
		<link>http://labs.jam3.ca/2010/11/learning-from-the-digital-media-zone/</link>
		<comments>http://labs.jam3.ca/2010/11/learning-from-the-digital-media-zone/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 17:05:16 +0000</pubDate>
		<dc:creator>Salpy</dc:creator>
				<category><![CDATA[Category==Null]]></category>
		<category><![CDATA[context aware]]></category>
		<category><![CDATA[digital media zone]]></category>
		<category><![CDATA[dmz]]></category>
		<category><![CDATA[Ghazal]]></category>
		<category><![CDATA[interactive developer]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[neural network]]></category>
		<category><![CDATA[Rahnama]]></category>
		<category><![CDATA[ryerson]]></category>
		<category><![CDATA[social network]]></category>

		<guid isPermaLink="false">http://labs.jam3.ca/?p=462</guid>
		<description><![CDATA[On November 27th I was one of the attendees for the first ever TedxRyersonU, an independently held TED event at Ryerson University. There were two talks that day that I felt directly related to what we as interactive content developers do. Both speakers work at the Digital Media Zone (DMZ) at Ryerson, a place Ryerson [...]]]></description>
			<content:encoded><![CDATA[<p><!-- p { margin-bottom: 0.21cm; }a:link {  } -->On November 27<sup>th</sup> I was one of the attendees for the first ever <a title="tedxryersonu" href="http://tedxryersonu.ca/" target="_blank">TedxRyersonU</a>, an independently held TED event at Ryerson University. There were two talks that day that I felt directly related to what we as interactive content developers do. Both speakers work at the <a title="DMZ" href="http://digitalmediazone.ryerson.ca/" target="_blank">Digital Media Zone (DMZ)</a> at Ryerson, a place Ryerson president Sheldon Levy calls “the next MIT”.</p>
<p><a title="Hecham Ghazal Profile" href="http://digitalmediazone.ryerson.ca/people/hecham-ghazal" target="_blank">Hecham Ghazal</a> was up first with <em>Parallel Human Processing</em>. I wondered what Ghazal meant by this title, but it soon became clear that he sees the internet as a socio-cognitive network &#8211; one that can solve complex tasks/problems better and faster than any artificial intelligence (AI). As Ghazal pointed out, the best AI still can&#8217;t tell you if a joke is funny but people on the internet can.<br />
<span id="more-462"></span><br />
Since the start up of social networks Ghazal realized that they resembled a neural network where each neuron was represented by a human being and the axons were represented by internet connections. The  problem is how do we harness the power of social networks to solve complex problems that require cognitive intelligence? One solution is Ghazal&#8217;s company <a title="Hecham Ghazal Profile" href="http://www.leanin.com/tour" target="_blank">LeanIn</a> which allows users to create social networks to filter through the massive amounts of online video so that you can easily find videos you want to watch and even which section of a video everyone thinks you should watch.</p>
<p>Ghazal&#8217;s solution deals with organization and filtering of video content, but what else can we do with social networks? I think that this is an area that we can definitely focus on and perhaps show clients that social networks can do more than generate buzz around a product.</p>
<p>Next up was <a title="Dr. Hossein Rahnama Profile" href="http://digitalmediazone.ryerson.ca/people/hossein-rahnama" target="_blank">Dr. Hossein Rahnama</a> <a href="http://digitalmediazone.ryerson.ca/people/hossein-rahnama"></a>with <em>Business Models for Mobile Applications</em>. Rahnama&#8217;s research focusses on context-aware computing and he&#8217;s best known for his involvement in the <a title="Paris Metro App Article" href="http://www.newswise.com/articles/there-s-an-app-for-that-north-american-technology-assists-paris-metro-passengers-with-special-needs" target="_blank">Paris Metro Application</a><a href="http://www.newswise.com/articles/there-s-an-app-for-that-north-american-technology-assists-paris-metro-passengers-with-special-needs"></a>.</p>
<p>What I found extremely interesting about the application was how well it automatically adapts to the context it&#8217;s in – whether that be ambient noise levels or recognizing broad swipe gestures for users with impaired vision. This type of adaptation brought to mind that we usually talk about applications degrading nicely, in which case we&#8217;re typically thinking about system capabilities. In Rahnama&#8217;s talk I learned that it&#8217;s not just about the system your application is running on but also about the external environment. For example, his application would automatically switch to a minimal interface if the surrounding bandwidth couldn&#8217;t support the regular graphically rich interface. As someone who has waited countless times for Google maps to render I can definitely appreciate this feature.</p>
<p>Much of Rahnama&#8217;s talk focussed on context-aware applications that were developed by both graduate and undergraduate computer science students. One of these is an on campus application that will populate lecture notes based on which building the user is currently in. As part of the application&#8217;s services, some lectures are recorded and can be accessed from a user&#8217;s phone allowing students to sit back and pay attention instead of the typical mad scribbling of notes.</p>
<p>Another application, RAIMA (<a title="RAIMA Abstract" href="http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=5557752" target="_blank">RAIMA publication abstract</a>), dealt with multi-context visualization to allow users to network easily at conferences. Rahnama joked that he was known as the guy who researched dating applications, and I can see why after hearing about the eight dimension matching involved in this application. Essentially users build a profile specific for their work interests which then plots distances to other users based on similarities. The application displays a graph with icons of other users along with their similarity distance so that you know who to talk to. You could then message users directly without ever having to hunt them down in person.</p>
<p>Applications aside*, Rahnama focussed his talk on methods for how to approach application development. Though being context-aware is highly important in current mobile development he also pointed out the importance of being platform agnostic now that browsers on most mobiles support technology that can handle highly interactive applications.  Other points he touched on in terms of a design model were harnessing collective intelligence, using data as the driving force, and lightweight programming models. For developers these concepts can be viewed in terms of building a core which you build tools and APIs for. Users can then use your tools to create novel content. A great example of users creating content is the <a title="AudioTool" href="http://www.audiotool.com" target="_blank">Audiotool</a> application where users can generate their own music and share with others – all within the browser, and with tools developed by people in our industry.</p>
<p>What I took from Rahnama&#8217;s talk was that as mobile computing grows, we as developers need to step back from trying to keep the visual appearance of an application or a site the exact same. Instead we should be focusing on how to create experiences that can adapt to both the system and the real time environment they&#8217;re in.</p>
<p>I believe that as interactive developers we are in the right place to create some really amazing things with the concepts from these talks. We already use social networks in many of the sites or applications we build. How about we go one step further? For example, why not let users help a game evolve into something better? Maybe the game could aggregate various ways users win levels and create a smarter AI. What about creating applications that are so context-aware they almost seem intelligent? Granted we have many applications that use geo location but we can go even further. Let&#8217;s think about concepts like ambient sound, current bandwidth, or how the user is interacting with the screen.</p>
<p>Yes, trying to create highly adaptable sites and applications is a lot more work but interactive developers have a history of pulling off the impossible. We&#8217;re already seeing the evolution of products that allow us to be somewhat platform agnostic with our development (e.g. <a title="Adobe Air" href="http://blogs.adobe.com/air/2010/11/max-session-highlight-introduction-to-adobe-air-for-mobile.html" target="_blank">Adobe AIR for almost everything</a><a href="http://blogs.adobe.com/air/2010/11/max-session-highlight-introduction-to-adobe-air-for-mobile.html"></a>), making the process of multi platform development just a little easier. Perhaps one day we can look forward to mobile browsers that have direct hooks to system hardware. To quote Rahnama “Innovation should be fun and social” and I think that we tend to follow that motto. It&#8217;s just a matter of seeing how much further we can go with it.</p>
<p>*There were so many applications that Rahnama went through. Here are the highlights on some more:</p>
<ul>
<li>A TTC version 	of the Paris Metro application that can automatically synch with 	your calendar and notify people you have a meeting with on how late 	you&#8217;re going to be. If you&#8217;re wondering about reception, this does 	require installing hardware throughout the subway.</li>
<li>Automated 	interactive blogging that generates a comic strip at the end of the 	day based on phone usage that day. You can also invite friends to 	modify the comic strip if you&#8217;d like.</li>
<li>A social table 	using the Microsoft Surface to suggest conversation topics based on 	your barcoded profile stuck to the bottom of your glass.</li>
<li>Augmented 	reality at the ROM which allows you to use your phone or special 	eyewear to look at artifacts around you and receive information 	about them. The application also opens up a stereoscopic map of the 	museum to help you find your way around.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://labs.jam3.ca/2010/11/learning-from-the-digital-media-zone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2 hour game development &#8211; continued</title>
		<link>http://labs.jam3.ca/2010/07/2-hour-game-development-continued/</link>
		<comments>http://labs.jam3.ca/2010/07/2-hour-game-development-continued/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 18:18:14 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Category==Null]]></category>

		<guid isPermaLink="false">http://labs.jam3.ca/?p=411</guid>
		<description><![CDATA[As planned last week, the team turned our regular code review session into a 2 hr game development challenge. Basically we wanted to give team members the opportunity to flex some classes they don&#8217;t necessarily see on a regular basis. Deliberately we assigned developers with tasks they would have the least familiarity with. Another important [...]]]></description>
			<content:encoded><![CDATA[<p>As planned last week, the team turned our regular code review session into a 2 hr game development challenge. Basically we wanted to give team members the opportunity to flex some classes they don&#8217;t necessarily see on a regular basis. Deliberately we assigned developers with tasks they would have the least familiarity with. Another important goal of the exercise was focused on team communication. When working in tight deadlines within a team environment fluid communication between team members is paramount.</p>
<p><a href="http://labs.jam3.ca/wp-content/uploads/2010/07/labsjam3_2hrTeam2.jpg"><img class="alignnone size-full wp-image-418" title="labsjam3_2hrTeam" src="http://labs.jam3.ca/wp-content/uploads/2010/07/labsjam3_2hrTeam2.jpg" alt="" width="554" height="190" /></a></p>
<p>The timer had been set and the team broke into pairs. The paired teammates discussed their approach and generally speaking one team member per pair was at the keyboard while the other observed what was on screen.</p>
<p>Aaron and Sunil were charged with the sea mines. Nick and Mikko were working on the dock and general game framework. While Salpy and Michael worked on the sea itself.</p>
<p>What resulted after just a little over 2 hrs of development was a functional prototype that was tracing key game events. Really the game was less polished then everyone wanted to see it but in truth the objective had been met in a little over the allotted time. As much as i wanted to blow a whistle and pull the plug on the workstations a la Top Chef, a terrific vibe was present that felt too good to arrest.</p>
<p>The team is working on a tight deadline this week and probably into the next but there is a collective will to post the game once we&#8217;ve had a chance to give it that little TLC it needs.</p>
<p>Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.jam3.ca/2010/07/2-hour-game-development-continued/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

