<?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>Ajaxian</title>
	<atom:link href="http://ajaxian.com/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Tue, 09 Feb 2010 15:07:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Rotating maps with CSS3 and jQuery</title>
		<link>http://ajaxian.com/archives/rotating-maps-with-css3-and-jquery</link>
		<comments>http://ajaxian.com/archives/rotating-maps-with-css3-and-jquery#comments</comments>
		<pubDate>Tue, 09 Feb 2010 15:07:48 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Geo]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[rotation]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8582</guid>
		<description><![CDATA[One of the things I always want to do with online maps is rotate them &#8211; I am used to that with real, physical maps. As physical maps become a lot more clever these days (for example have you seen the zoomable map?) it is time we can do this with the online ones, too. [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things I always want to do with online maps is rotate them &#8211; I am used to that with real, physical maps. As physical maps become a lot more clever these days (for example have you seen the <a href="http://www.thezoomablemap.com/">zoomable map</a>?) it is time we can do this with the online ones, too. </p>
<p>Whilst Google supports this in the satellite and hybrid maps, the basic ones still can&#8217;t be turned. Which is why I took CSS3 transformations (wrapped in <a href="http://www.zachstronaut.com/posts/2009/08/07/jquery-animate-css-rotate-scale.html">a very useful jQuery plugin</a>)  and voila &#8211; rotating is possible:</p>
<p><a href="http://isithackday.com/hacks/map-rotate/"><img src="http://farm5.static.flickr.com/4054/4343637312_69930f7b0f.jpg" alt="Rotating a map with CSS3 and jQuery by  you."/></a></p>
<p>Read more about the implementation and some of the things that need fixing <a href="http://www.wait-till-i.com/2010/02/09/rotating-maps-with-css3-and-jquery/">in the original blog post about map rotation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/rotating-maps-with-css3-and-jquery/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Faye: Bayeaux protocol Comet server for Node.js</title>
		<link>http://ajaxian.com/archives/faye-bayeaux-protocol-comet-server-for-node-js</link>
		<comments>http://ajaxian.com/archives/faye-bayeaux-protocol-comet-server-for-node-js#comments</comments>
		<pubDate>Tue, 09 Feb 2010 11:24:22 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Comet]]></category>
		<category><![CDATA[Front Page]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8570</guid>
		<description><![CDATA[James Coglan has ported a Ruby/EventMachine Comet server to offer a new Node.js server on the Bayeux protocol. The project is Faye and you can check out the code on GitHub.
On the client side:
PLAIN TEXT
HTML:




&#160;


&#60;script type="text/javascript" src="/comet.js"&#62;&#60;/script&#62;


&#160;


&#60;script type="text/javascript"&#62;


&#160; &#160; CometClient = new Faye.Client('/comet');


&#160; &#160; CometClient.connect();


&#60;/script&#62;


&#160;





PLAIN TEXT
JAVASCRIPT:




&#160;


&#160; CometClient.subscribe&#40;'/path/to/channel', function&#40;message&#41; &#123;


&#160; &#160; // process received message object


&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>James Coglan has ported a Ruby/EventMachine Comet server to offer a new Node.js server on the Bayeux protocol. The project is <a href="http://blog.jcoglan.com/2010/02/02/faye-a-comet-client-and-server-for-node-js-and-rack/">Faye</a> and you can check out the code on <a href="http://github.com/jcoglan/faye">GitHub</a>.</p>
<p>On the client side:</p>
<div class="igBar"><a href="javascript:showCodeTxt('html-4');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">HTML:</span>
<div id="html-4">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/javascript"</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"/comet.js"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/javascript"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; CometClient = new Faye.Client('/comet');</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; CometClient.connect();</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-5');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-5">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; CometClient.<span style="color: #006600;">subscribe</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'/path/to/channel'</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>message<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// process received message object</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; CometClient.<span style="color: #006600;">publish</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'/some/other/channel'</span>, <span style="color:#006600; font-weight:bold;">&#123;</span>foo: <span style="color: #3366CC;">'bar'</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>And the backend....</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-6');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-6">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> http&nbsp; = require<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'http'</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; faye&nbsp; = require<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'./faye'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> comet = <span style="color: #003366; font-weight: bold;">new</span> faye.<span style="color: #006600;">NodeAdapter</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span>mount: <span style="color: #3366CC;">'/comet'</span>, timeout: <span style="color:#800000;">45</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; http.<span style="color: #006600;">createServer</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>request, response<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>comet.<span style="color: #006600;">call</span><span style="color:#006600; font-weight:bold;">&#40;</span>request, response<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; response.<span style="color: #006600;">sendHeader</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">200</span>, <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color: #3366CC;">'Content-Type'</span>: <span style="color: #3366CC;">'text/plain'</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; response.<span style="color: #006600;">sendBody</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'Hello, non-Comet request!'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; response.<span style="color: #006600;">finish</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">listen</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;">9292</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>Nice!</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/faye-bayeaux-protocol-comet-server-for-node-js/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Think You Know Javascript? Try this Quiz!</title>
		<link>http://ajaxian.com/archives/think-you-know-javascript-try-this-quiz</link>
		<comments>http://ajaxian.com/archives/think-you-know-javascript-try-this-quiz#comments</comments>
		<pubDate>Tue, 09 Feb 2010 08:49:31 +0000</pubDate>
		<dc:creator>Michael Mahemoff</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8578</guid>
		<description><![CDATA[If you know you think you know your objects from your arrays and your null from your undefined, here's a quiz for you from Perfection Kills.

I was recently reminded about  Dmitry Baranovsky&#8217;s Javascript test, when N. Zakas answered and explained it in a blog post. First time I saw those questions explained was by [...]]]></description>
			<content:encoded><![CDATA[<p>If you know you think you know your objects from your arrays and your <tt>null</tt> from your <tt>undefined</tt>, here's <a href="http://perfectionkills.com/javascript-quiz/">a quiz for you</a> from Perfection Kills.</p>
<blockquote>
<p>I was recently reminded about <a href="http://dmitry.baranovskiy.com/post/91403200"> Dmitry Baranovsky&#8217;s Javascript test</a>, when N. Zakas answered and <a href="http://www.nczonline.net/blog/2010/01/26/answering-baranovskiys-javascript-quiz/">explained it in a blog post</a>. First time I saw those questions explained was by <a href="http://groups.google.com/group/comp.lang.javascript/msg/ae4d0d92361497f6">Richard Cornford in comp.lang.javascript</a>, although not as thoroughly as by Nicholas.</p>
<p>I decided to come up with my own little quiz. I wanted to keep question not very obscure, practical, yet challenging. They would also cover wider range of topics.</p>
</blockquote>
<p>There are fourteen questions in all, starting here:</p>
<blockquote><p>
<code>
<pre>
    (function(){
      return typeof arguments;
    })();
</pre>
<p></code></p>
<li> “object”
    </li>
<li> “array”
    </li>
<li> “arguments”
    </li>
<li> “undefined”
</li>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/think-you-know-javascript-try-this-quiz/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Javascript ePub Readers</title>
		<link>http://ajaxian.com/archives/javascript-epub-readers</link>
		<comments>http://ajaxian.com/archives/javascript-epub-readers#comments</comments>
		<pubDate>Tue, 09 Feb 2010 08:34:33 +0000</pubDate>
		<dc:creator>Michael Mahemoff</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Showcase]]></category>
		<category><![CDATA[eBooks]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8572</guid>
		<description><![CDATA[
eBooks have gone mainstream, and right now the open ePub format is getting a lot of attention, being the iPad's book format of choice. Often overlooked in gadget-centric media is the fact that ePub is based on web standards, and therefore amenable to being rendered in the browser, sans plugins. Pure Javascript ePub readers are [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://romeda.org/republish"><img src="http://ajaxian.com/wp-content/images/republish2.png" alt="republish2" title="republish2" width="470" height="330" class="alignnone size-full wp-image-8574" /></a></p>
<p>eBooks have gone mainstream, and right now the open ePub format is getting a lot of attention, being the iPad's book format of choice. Often overlooked in gadget-centric media is the fact that ePub is based on web standards, and therefore amenable to being rendered in the browser, sans plugins. Pure Javascript ePub readers are starting to crop up, and Keith Fahlgren has written about <a href="http://blog.threepress.org/2010/02/06/three-javascript-epub-readers/">several of them</a>:</p>
<blockquote>
<p>Just in the last few days, details emerged of two new JavaScript ePub readers, <a href="http://romeda.org/rePublish/">rePublish</a> from <a href="http://twitter.com/blaine/status/8733522914">Blaine Cook (@blaine)</a> and <a href="http://github.com/augustl/js-epub">JSEpub</a> (<a href="http://s3.amazonaws.com/augustl-stuff/epub-is-getting-there-95.png">screenshot</a>) from <a href="http://twitter.com/augustl/status/8700582603">August Lilleaas (@augustl)</a>. These two new readers join <a href="http://twitter.com/liza">@liza</a>’s <a href="http://blog.threepress.org/2009/02/09/introducing-epubjs/">epubjs</a>, which will be a year old on Tuesday. An improved version of epubjs powers the <a href="http://epubzengarden.com">ePub Zen Garden</a>, which helps “dispel the myth that digital books can&#8217;t also be crafted works of visual design.”</p>
</blockquote>
<p>All are open source, and as Keith notes in the comments, there's also the commercial <a href="http://www.bookglutton.com/reader/unbound?group_id=0&#038;id=3160&#038;view=ub#href(cover.html#!0p:0)">BookGlutton project</a>. BookGlutton (which we <a href="http://ajaxian.com/archives/bookglutton">covered earlier</a>) shows the promise of browser-based eBooks: it lets you embed books as lightbox-powered widgets, and supports annotation.</p>
<p>The underlying structure of ePub is <a href="http://en.wikipedia.org/wiki/EPUB">described on wikipedia</a>:</p>
<blockquote><p>
EPUB consists of three specifications:<br />
Open Publication Structure (OPS) 2.0, contains the formatting of its content.[5]<br />
Open Packaging Format (OPF) 2.0, describes the structure of the .epub file in XML.[6]<br />
OEBPS Container Format (OCF) 1.0, collects all files as a ZIP archive.[7]<br />
Basically, EPUB internally uses XHTML or DTBook (an XML standard provided by the DAISY Consortium) to represent the text and structure of the content document, and a subset of CSS to provide layout and formatting. XML is used to create the document manifest, table of contents, and EPUB metadata. Finally, the files are bundled in a zip file as a packaging format.
</p></blockquote>
<p>In the case of unzipping, Keith points out the <a href="http://www.onicos.com/staff/iz/amuse/javascript/expert/inflate.txt">inflate library</a> has been around since 1999. One can imagine other applications for zip too; for example, it's often used as a format for bundling code (Java JARs, Python Eggs, Firefox and Chrome extensions), so reliable unzipping makes it possible to build browser-based IDEs and exploration tools against such archives.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/javascript-epub-readers/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pseudo 3D tricks from old computer games for all your Canvas needs</title>
		<link>http://ajaxian.com/archives/pseudo-3d-tricks-from-old-computer-games-for-all-your-canvas-needs</link>
		<comments>http://ajaxian.com/archives/pseudo-3d-tricks-from-old-computer-games-for-all-your-canvas-needs#comments</comments>
		<pubDate>Mon, 08 Feb 2010 12:04:24 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[8bit]]></category>
		<category><![CDATA[pseudo3d]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8563</guid>
		<description><![CDATA[It is quite interesting to see how technology moves in circles. With canvas being the new fun toy to play with for creating browser-based games we have to find solutions to fake a 3D environment to be really fast (sure there is Canvas 3D but it is overkill for most games). The trick is to [...]]]></description>
			<content:encoded><![CDATA[<p>It is quite interesting to see how technology moves in circles. With canvas being the new fun toy to play with for creating browser-based games we have to find solutions to fake a 3D environment to be really fast (sure there is Canvas 3D but it is overkill for most games). The trick is to dig into the tricks arsenal of old-school game development on machines full of win like the Commodore 64 or Amiga. </p>
<p>Louis Gorenfeld <a href="http://www.gorenfeld.net/lou/pseudo/">some very detailed explanations on how to fake 3D</a> including some of the formulas used in the days of 8 bit.</p>
<p>He is also working on some demo code which you can help him with by providing some JS/Canvas demos:</p>
<p><img src="http://ajaxian.com/wp-content/images/fake3d.png" alt="Fake 3D" title="Fake 3D" width="353" height="600" /></p>
<div class="igBar"><a href="javascript:showCodeTxt('code-8');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">CODE:</span>
<div id="code-8">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">current_x = <span style="color:#800000;">160</span> <span style="color:#FF9933; font-style:italic;">// Half of a 320 width screen</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">dx = <span style="color:#800000;">0</span> <span style="color:#FF9933; font-style:italic;">// Curve amount, constant per segment</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">ddx = <span style="color:#800000;">0</span> <span style="color:#FF9933; font-style:italic;">// Curve amount, changes per line</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">for each line of the screen from the bottom to the top:</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; if line of screen<span style="color:#CC0000;">'s Z Map position is below segment.position:</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; dx = bottom_segment.dx</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; else if line of screen'</span>s Z Map position is above segment.<span style="">position</span>:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; dx = segment.<span style="">dx</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; end if</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; ddx += dx</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; current_x += ddx</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; this_line.<span style="">x</span> = current_x</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">end for</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Move segments</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">segment_y += constant * speed <span style="color:#FF9933; font-style:italic;">// Constant makes sure the segment doesn't move too fast</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">if segment.<span style="">position</span> &lt;<span style="color:#800000;">0</span> <span style="color:#FF9933; font-style:italic;">// 0 is nearest</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; bottom_segment = segment</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; segment.<span style="">position</span> = zmap.<span style="">length</span> - <span style="color:#800000;">1</span> <span style="color:#FF9933; font-style:italic;">// Send segment position to farthest distance</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; segment.<span style="">dx</span> = GetNextDxFromTrack<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#FF9933; font-style:italic;">// Fetch next curve amount from track data</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">end if </div>
</li>
</ol>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/pseudo-3d-tricks-from-old-computer-games-for-all-your-canvas-needs/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Román Cortés and Ajaxian make up with amazing CSS demos</title>
		<link>http://ajaxian.com/archives/roman-cortes-and-ajaxian-make-up-with-amazing-css-demos</link>
		<comments>http://ajaxian.com/archives/roman-cortes-and-ajaxian-make-up-with-amazing-css-demos#comments</comments>
		<pubDate>Mon, 08 Feb 2010 11:52:58 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Front Page]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8550</guid>
		<description><![CDATA[We have been long term fans of Román and the fantastic demos and samples that he puts together, usually involving CSS goodness. We messed up the other week though when we linked to his work on a scrolling coke can. I do these postings as a labor of love, and since Ajaxian isn't my day [...]]]></description>
			<content:encoded><![CDATA[<p>We have been long term fans of Román and the fantastic demos and samples that he puts together, usually involving CSS goodness. We messed up the other week though when we <a href="http://ajaxian.com/archives/rolling-a-coke-can-around-with-pure-css">linked to his work on a scrolling coke can</a>. I do these postings as a labor of love, and since Ajaxian isn't my day job, that means that the labor often happens at 2am. In this case I made the rookie mistake of grabbing an iframe to his demo so it would run inline. Román then looked up to see his servers getting pummeled and a bill is associated with that traffic. He quickly rick rolled us (thank you for not going for something much worse ;) and Christian Heilman (who is in Europe along with Román) saw it and kindly switched in an image of the code can effect.</p>
<p>I woke up the next morning to learn about this all and see a post that Román did talking about our hot linking. I immediately responded saying how sorry I am. I aim to highlight the great work that is done, not cause an issue.</p>
<p>Román is a great guy and kindly offered to collaborate and show friendship with Ajaxian (and myself) by putting together more amazing demos to share on the blog. Inline. Not hot-linking. :)</p>
<p><b>Here they are</b></p>
<p>These effects are CSS level 1 and 2.1 only. There is no javascript, css3 or whatever, just html and css.</p>
<p>They are all based on the CSS 2D displacement map technique that Román Cortés discovered when he created the infamous CSS Coke Can effect. Since displacement maps are very versatile, Román Cortés wanted to show us more and different applications of these.</p>
<p><a href="http://ajaxian.com/romancortes/ajaxian.html">The Ajaxian Prism</a></p>
<p>This is simple displacement map usage to distort the borders of the prism, with a transparent .png image on top to add the shadows, orange semi-transparent bg and the Ajaxian's "a" logo. The background painting is an original artwork by Román Cortés. Move the area around to see the effect the prism has on the underlying painting.</p>
<p><img src="http://ajaxian.com/wp-content/images/ajaxianprism.png" alt="ajaxianprism" title="ajaxianprism" width="441" height="326" class="alignnone size-full wp-image-8554"/></p>
<p><a href="http://ajaxian.com/romancortes/starry.html">Van Gogh's Starry Night</a></p>
<p>Van Gogh's Starry Night separated in 3 layers and displacement map sinusoidal distortions applied to two of them.</p>
<p><img src="http://ajaxian.com/wp-content/images/starrynight.png" alt="starrynight" title="starrynight" width="449" height="345" class="alignnone size-full wp-image-8555"/></p>
<p><a href="http://ajaxian.com/romancortes/romajaxian.html">Sliding and Slicing</a></p>
<p>A really simple displacement map + rearranged image makes this effect possible. Watch the window blinds do their thing as you move the scollbar.</p>
<p><img src="http://ajaxian.com/wp-content/images/romajaxian.png" alt="romajaxian" title="romajaxian" width="428" height="300" class="alignnone size-full wp-image-8551"/></p>
<p><a href="http://ajaxian.com/romancortes/reverse-spinning-coke-can.html">The Coke Can spinning in the opposite direction of the original</a></p>
<p>There some comments in the original code can posting that the spinning direction was unnatural. So, here he did spin as the commenters wanted it. To make it possible, he had to mirror the label texture and adapt the source code.</p>
<p><img src="http://ajaxian.com/romancortes/coke-label.jpg"/></p>
<p><a href="http://ajaxian.com/romancortes/coke_v3.html">The smashed can</a></p>
<p>By using several cylindrical displacement map layers with a growing radius and png transparent textures, it is possible to do voxel surface rotations like this one.</p>
<p><img src="http://ajaxian.com/wp-content/images/crashedcokecan.png" alt="crashedcokecan" title="crashedcokecan" width="449" height="276" class="alignnone size-full wp-image-8556"/></p>
<p>Thanks for Román for being so reasonable, and for creating such fun examples for us all. We hope to go deeper on the implementation of some of these examples in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/roman-cortes-and-ajaxian-make-up-with-amazing-css-demos/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Mozilla Labs&#8217; Weave can become a platform for us</title>
		<link>http://ajaxian.com/archives/mozilla-labs-weave-can-become-a-platform-for-us</link>
		<comments>http://ajaxian.com/archives/mozilla-labs-weave-can-become-a-platform-for-us#comments</comments>
		<pubDate>Sun, 07 Feb 2010 17:08:51 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8558</guid>
		<description><![CDATA[
Mozilla Labs has released the magical 1.0 version of Weave and the doors are now open for developers.
When I was a part of Mozilla Labs day to day, I always loved the vision and team behind Weave. I kept wanting the implementation to match the vision, but it is a tough problem and it takes [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://ajaxian.com/wp-content/images/weaveitup.png" alt="weaveitup" title="weaveitup" width="480" height="186" class="alignnone size-full wp-image-8559"/></p>
<p>Mozilla Labs has released the magical 1.0 version of <a href="http://mozillalabs.com/weave/">Weave</a> and the doors are <a href="http://gigaom.com/2010/02/06/mozilla-weave-developers/">now open for developers</a>.</p>
<p>When I was a part of Mozilla Labs day to day, I always loved the vision and team behind Weave. I kept wanting the implementation to match the vision, but it is a tough problem and it takes time to bake. Well, it is getting there now.</p>
<p>Weave is special because it offers a series of back-end services (more than just sync) that are build with users (and their privacy) in mind, rather than business models. I have talked to a couple of entrepreneurs recently and thought that there ideas could be implemented nicely on top of Weave.</p>
<p>It is still early days, but I am jazzed to see the platform getting opened up. I am hoping to get clients for Safari, Chrome, and IE.... and look forward to a <a href="http://www.precentral.net/mozilla-weave-sync-coming-webos">webOS client</a> too :)</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/mozilla-labs-weave-can-become-a-platform-for-us/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>AT AT Walking with CSS</title>
		<link>http://ajaxian.com/archives/at-at-walking-with-css</link>
		<comments>http://ajaxian.com/archives/at-at-walking-with-css#comments</comments>
		<pubDate>Fri, 05 Feb 2010 11:17:52 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Examples]]></category>
		<category><![CDATA[Front Page]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8530</guid>
		<description><![CDATA[
Anthony Calzadilla has a fun Friday example for us. He has a tutorial on how he animated an AT AT using CSS.
He goes over the different areas and how he uses animation and transforms.
For example, the head of the beast:
PLAIN TEXT
CSS:




&#160;


@-webkit-keyframes rotate-head{


&#160; 0% &#123;-webkit-transform:rotate&#40;0deg&#41; translate&#40;0px,0px&#41;;&#125;


&#160; 40% &#123;-webkit-transform:rotate&#40;10deg&#41; translate&#40;15px,5px&#41;;&#125;


&#160; 80% &#123;-webkit-transform:rotate&#40;-5deg&#41; translate&#40;8px,5px&#41;;&#125;


&#160; 100% &#123;-webkit-transform:rotate&#40;0deg&#41; translate&#40;0px,0px&#41;;&#125;


&#125;


#atat #head [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.optimum7.com/internet-marketing/wp-content/uploads/2010/02/article-atat.jpg"/></p>
<p>Anthony Calzadilla has a fun Friday example for us. He has a tutorial on how he <a href="http://anthonycalzadilla.com/css3-ATAT/index.html">animated an AT AT using CSS</a>.</p>
<p>He goes over the different areas and how he uses animation and transforms.</p>
<p>For example, the head of the beast:</p>
<div class="igBar"><a href="javascript:showCodeTxt('css-10');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">CSS:</span>
<div id="css-10">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">@-webkit-keyframes rotate-head{</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#800000;">0</span>% <span style="color:#006600; font-weight:bold;">&#123;</span>-webkit-transform:rotate<span style="color:#006600; font-weight:bold;">&#40;</span>0deg<span style="color:#006600; font-weight:bold;">&#41;</span> translate<span style="color:#006600; font-weight:bold;">&#40;</span>0px,0px<span style="color:#006600; font-weight:bold;">&#41;</span>;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#800000;">40</span>% <span style="color:#006600; font-weight:bold;">&#123;</span>-webkit-transform:rotate<span style="color:#006600; font-weight:bold;">&#40;</span>10deg<span style="color:#006600; font-weight:bold;">&#41;</span> translate<span style="color:#006600; font-weight:bold;">&#40;</span>15px,5px<span style="color:#006600; font-weight:bold;">&#41;</span>;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#800000;">80</span>% <span style="color:#006600; font-weight:bold;">&#123;</span>-webkit-transform:rotate<span style="color:#006600; font-weight:bold;">&#40;</span>-5deg<span style="color:#006600; font-weight:bold;">&#41;</span> translate<span style="color:#006600; font-weight:bold;">&#40;</span>8px,5px<span style="color:#006600; font-weight:bold;">&#41;</span>;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#800000;">100</span>% <span style="color:#006600; font-weight:bold;">&#123;</span>-webkit-transform:rotate<span style="color:#006600; font-weight:bold;">&#40;</span>0deg<span style="color:#006600; font-weight:bold;">&#41;</span> translate<span style="color:#006600; font-weight:bold;">&#40;</span>0px,0px<span style="color:#006600; font-weight:bold;">&#41;</span>;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">#atat <span style="color: #cc00cc;">#head <span style="color:#006600; font-weight:bold;">&#123;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; -webkit-animation-name: rotate-head;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; -webkit-animation-duration: 7s;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; -webkit-animation-iteration-count: infinite; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; -webkit-transform-origin: <span style="color:#800000;">0</span> <span style="color:#800000;">50</span>%;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/at-at-walking-with-css/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>jsContract: Design by Contract library</title>
		<link>http://ajaxian.com/archives/jscontract</link>
		<comments>http://ajaxian.com/archives/jscontract#comments</comments>
		<pubDate>Thu, 04 Feb 2010 11:07:31 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8528</guid>
		<description><![CDATA[Fan of Eiffel or the design by contract pattern that it espouses?
Øyvind Kinsey is, and he just created jsContract an alpha library to give you some pre and post condition abilities.
Here is an example:
PLAIN TEXT
JAVASCRIPT:




&#160;


function _internalMethod&#40;a, b&#41;&#123;


&#160; &#160; Contract.expectNumber&#40;a&#41;;


&#160; &#160; Contract.expectNumber&#40;b&#41;;


&#160; &#160; Contract.expectWhen&#40;config.mode === "divide", b&#62; 0, "Divisor cannot be 0"&#41;;


&#160; &#160; Contract.expectWhen&#40;config.mode === "multiply", [...]]]></description>
			<content:encoded><![CDATA[<p>Fan of <a href="http://www.eiffel.com/">Eiffel</a> or the <a href="http://en.wikipedia.org/wiki/Design_by_contract">design by contract</a> pattern that it espouses?</p>
<p>Øyvind Kinsey is, and he just created <a href="http://kinsey.no/blog/index.php/2010/02/03/jscontract-code-contracts-for-javascript/">jsContract</a> an alpha library to give you some pre and post condition abilities.</p>
<p>Here is an example:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-13');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-13">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> _internalMethod<span style="color:#006600; font-weight:bold;">&#40;</span>a, b<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Contract.<span style="color: #006600;">expectNumber</span><span style="color:#006600; font-weight:bold;">&#40;</span>a<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Contract.<span style="color: #006600;">expectNumber</span><span style="color:#006600; font-weight:bold;">&#40;</span>b<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Contract.<span style="color: #006600;">expectWhen</span><span style="color:#006600; font-weight:bold;">&#40;</span>config.<span style="color: #006600;">mode</span> === <span style="color: #3366CC;">"divide"</span>, b&gt; <span style="color:#800000;">0</span>, <span style="color: #3366CC;">"Divisor cannot be 0"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Contract.<span style="color: #006600;">expectWhen</span><span style="color:#006600; font-weight:bold;">&#40;</span>config.<span style="color: #006600;">mode</span> === <span style="color: #3366CC;">"multiply"</span>, a&gt; <span style="color:#800000;">0</span> &amp;&amp; b&gt; <span style="color:#800000;">0</span>, <span style="color: #3366CC;">"The multiplicands cannot be 0"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Contract.<span style="color: #006600;">guaranteesNumber</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Contract.<span style="color: #006600;">guarantees</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>result<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> result&gt; <span style="color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>, <span style="color: #3366CC;">"Result must be&gt; 0"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>config.<span style="color: #006600;">mode</span> == <span style="color: #3366CC;">"divide"</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> a / b;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// At this point config.mode must be &quot;multiply&quot;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> a * b;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>A lot of contract code for little functionality.... good old contracts ;)</p>
<p>It is interesting to read how Øyvind instruments the code. Run a <a href="http://kinsey.no/projects/jsContract/test.html">test</a> through the <a href="http://kinsey.no/projects/jsContract/">translator tool</a> and you get:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-14');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-14">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> _internalMethod<span style="color:#006600; font-weight:bold;">&#40;</span>a, b<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; arguments.<span style="color: #006600;">callee</span>.<span style="color: #006600;">isInstrumented</span> = <span style="color: #003366; font-weight: bold;">true</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">/*preconditions*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Contract.<span style="color: #006600;">expectNumber</span><span style="color:#006600; font-weight:bold;">&#40;</span>a<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Contract.<span style="color: #006600;">expectNumber</span><span style="color:#006600; font-weight:bold;">&#40;</span>b<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Contract.<span style="color: #006600;">expectWhen</span><span style="color:#006600; font-weight:bold;">&#40;</span>config.<span style="color: #006600;">mode</span> === <span style="color: #3366CC;">"divide"</span>, b&gt; <span style="color:#800000;">0</span>, <span style="color: #3366CC;">"Divisor cannot be 0"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Contract.<span style="color: #006600;">expectWhen</span><span style="color:#006600; font-weight:bold;">&#40;</span>config.<span style="color: #006600;">mode</span> === <span style="color: #3366CC;">"multiply"</span>, a&gt; <span style="color:#800000;">0</span> &amp;&amp; b&gt; <span style="color:#800000;">0</span>, <span style="color: #3366CC;">"The multiplicands cannot be 0"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> __return = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>a, b<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>config.<span style="color: #006600;">mode</span> == <span style="color: #3366CC;">"divide"</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> a / b;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// At this point config.mode must be &quot;multiply&quot;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> a * b;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#40;</span>a, b<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">/*postconditions*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Contract.<span style="color: #006600;">guaranteesNumber</span><span style="color:#006600; font-weight:bold;">&#40;</span>__return<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Contract.<span style="color: #006600;">guarantees</span><span style="color:#006600; font-weight:bold;">&#40;</span>__return, <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>result<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> result&gt; <span style="color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>, <span style="color: #3366CC;">"Result must be&gt; 0"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> __return;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/jscontract/feed</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>User scripts becoming more portable with Greasemonkey support in Chrome</title>
		<link>http://ajaxian.com/archives/user-scripts-becoming-more-portable-with-greasemonkey-support-in-chrome</link>
		<comments>http://ajaxian.com/archives/user-scripts-becoming-more-portable-with-greasemonkey-support-in-chrome#comments</comments>
		<pubDate>Wed, 03 Feb 2010 09:38:40 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8522</guid>
		<description><![CDATA[Aaron Boodman created Greasemonkey back in the day. He also worked on Gears. And most recently he created Chrome Extensions. I have a funny feeling that folks were pinging him daily "hey, when ya gunna give me Greasemonkey on Chrome" and he just delivered:

One thing that got lost in the commotion of the extensions launch [...]]]></description>
			<content:encoded><![CDATA[<p>Aaron Boodman created <a href="http://en.wikipedia.org/wiki/Greasemonkey">Greasemonkey</a> back in the day. He also worked on Gears. And most recently he created Chrome Extensions. I have a funny feeling that folks were pinging him daily "hey, when ya gunna give me Greasemonkey on Chrome" and <a href="http://blog.chromium.org/2010/02/40000-more-extensions.html">he just delivered</a>:</p>
<blockquote><p>
One thing that got lost in the commotion of the extensions launch is a feature that is near and dear to my heart: Google Chrome 4 now natively supports Greasemonkey user scripts. Greasemonkey is a Firefox extension I wrote in 2004 that allows developers to customize web pages using simple JavaScript and it was the inspiration for some important parts of our extension system.</p>
<p>Ever since the beginning of the Chromium project, friends and coworkers have been asking me to add support for user scripts in Google Chrome. I'm happy to report that as of the last Google Chrome release, you can install any user script with a single click. So, now you can use emoticons on blogger. Or, you can browse Google Image Search with a fancy lightbox. In fact, there's over 40,000 scripts on <a href="http://www.userscripts.org/">userscripts.org</a> alone.
</p></blockquote>
<p>Not all of the scripts will work. The deeper the integration, the less chance of success. We now have user scripts supported in a variety of browsers, and hopefully they get more and more portable.</p>
<p>If browsers could surface the functionality to mainstream users, good things could happen beyond us power users.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/user-scripts-becoming-more-portable-with-greasemonkey-support-in-chrome/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>LunaScript: A new language and platform to take your Web 2.0 apps to the moon?</title>
		<link>http://ajaxian.com/archives/lunascript-a-new-language-and-platform-to-take-your-web-2-0-apps-to-the-moon</link>
		<comments>http://ajaxian.com/archives/lunascript-a-new-language-and-platform-to-take-your-web-2-0-apps-to-the-moon#comments</comments>
		<pubDate>Tue, 02 Feb 2010 14:46:05 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[Front Page]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8524</guid>
		<description><![CDATA[A Googler and a Facebooker were in a pub discussing the complexities of building out a rich modern Web application. There are a ton of dependencies, and you need to be proficient in multiple languages and tools (JavaScript, HTML, CSS, SQL/NoSQL, backend languages, build tools, etc).
Well, they may not have been in a pub.... but [...]]]></description>
			<content:encoded><![CDATA[<p>A Googler and a Facebooker were in a pub discussing the complexities of building out a rich modern Web application. There are a ton of dependencies, and you need to be proficient in multiple languages and tools (JavaScript, HTML, CSS, SQL/NoSQL, backend languages, build tools, etc).</p>
<p>Well, they may not have been in a pub.... but a deadly duo did get together to try to solve this problem.</p>
<p>Dustin Moskovitz (Facebook co-founder and former CTO) and former-Googler/Facebooker Justin Rosenstein decided to try something different when they started to implement a Collaborative Information Manager tool at their new startup <a href="http://asana.com/">. They have created a new high level language that is part JavaScript, part Protocol Buffers. The language is </a><a href="http://asana.com/luna">LunaScript</a>.</p>
<p>What was their motivation?</p>
<blockquote><p>
 All of us on the Asana team have deep backgrounds writing rich web applications at companies like Google and Facebook. We've been continually frustrated by how long it takes to write software, and by a nagging feeling that in some deep sense we've been writing the same code over and over. Even when using the latest and greatest frameworks and disciplines, writing fast, highly interacting web applications involves a lot of accidental complexity:</p>
<p>First you need server code to figure out what data the browser needs. Hopefully you have an ORM layer, but you still need to carefully structure your code to minimize your backend dispatches, and you need to carefully keep that in sync with your front-end code lest you don't fetch enough data or hurt performance by fetching too much. If it's a Web 2.0-style app, you re-implement a ton of that server-side code in JavaScript, once for creating the page and then again as controller code for keeping it up to date and consistent. And when the user changes something, you bottle that up -- typically in a custom over-the-wire format -- and send it as an XHR to the server. The server has to de-serialize it into different data structures in a different language, notify the persistence store, figure out what other clients care about the change, and send them a notification over your Comet pipe, which is handled by yet more JavaScript controller code. Offline support? More code.</p>
<p>This is not a one-off task: it's rote work that adds complexity to every feature that you build in every application. By the time that you are done with all this, the important and novel parts of your application are only around 10% of your code. We wondered whether we could build a programming system in which we just wrote that 10% -- the essential complexity -- and a compiler handled the other 90%.
</p></blockquote>
<p>And this lead them to their solution:</p>
<blockquote><p>
Inspired by <a href="http://en.wikipedia.org/wiki/Incremental_computing">incremental computing</a>, we're building Lunascript as a simple way to write modern web applications.  Lunascript has a syntax and easy of use reminiscent of JavaScript, but a powerful pure-functional lazily-evaluated semantics historically confined to academic languages.</p>
<p>
A Lunascript application specifes a data model and a function from the model to the view or user interface, annotated with handler functions from user inputs to model mutations. From this the Lunascript compiler produces a functioning Web2.0 application -- the client-side JavaScript, the server-side SQL, and everything in between -- complete with real-time bidirectional data synchronization.  There's no need to write separate code to help the server figure out which values need to be sent to the client: the server can do this by simulating the UI. Because a LunaScript application only specifies how the UI should look given the current data (rather than how the UI should be updated as changes happen) it's impossible to write a UI that loads correctly but does not stay correct as changes are made.
</p>
</blockquote>
<p>"What does it look like?" I hear you cry. Time for a hello world, and since Comet is in the mix, that means a chat server:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-16');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-16">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// Some of our currently implemented syntax isn't quite this clean, but it's</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// fairly close and this is the direction we're going.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">class</span> World <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900; font-style: italic;">// &quot;1.&quot; serves the same purpose as &quot;= 1&quot; does in Google protocol buffer syntax.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#800000;">1</span>. <span style="color: #006600;">ChatMessage</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> messages;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">class</span> ChatMessage <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#800000;">1</span>. <span style="color: #006600;">User</span> user;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#800000;">2</span>. <span style="color: #006600;">string</span> text;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">class</span> Session <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#800000;">1</span>. <span style="color: #006600;">User</span> user;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#800000;">2</span>. <span style="color: #006600;">String</span> new_comment;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">return</span> fn<span style="color:#006600; font-weight:bold;">&#40;</span>world, browser, session<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> renderMessage = fn<span style="color:#006600; font-weight:bold;">&#40;</span>message<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// Most style information omitted to improve readability.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> bubble_style = <span style="color:#006600; font-weight:bold;">&#123;</span> background: <span style="color: #3366CC;">'#b7e0ff'</span>, padding: <span style="color:#800000;">7</span>, ... <span style="color:#006600; font-weight:bold;">&#125;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> &lt;div&gt;&nbsp; &nbsp;<span style="color: #009900; font-style: italic;">// XML literals are first-class primitives.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &lt;img src=message.<span style="color: #006600;">user</span>.<span style="color: #006600;">small_pic_url</span> /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &lt;div style=bubble_style&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;b&gt; message.<span style="color: #006600;">user</span>.<span style="color: #006600;">name</span>, <span style="color: #3366CC;">': '</span> &lt;/b&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;div&gt; message.<span style="color: #006600;">text</span> &lt;/div&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &lt;/div&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;/div&gt;;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> postMessage = fn<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// Only handler functions can request data mutations.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; messages += ChatMessage <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; user: session.<span style="color: #006600;">user</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; text: session.<span style="color: #006600;">new_comment</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; session.<span style="color: #006600;">new_comment</span> := <span style="color: #3366CC;">''</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066; font-weight: bold;">return</span> &lt;table&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;tr&gt;&lt;td&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; messages.<span style="color: #006600;">map</span><span style="color:#006600; font-weight:bold;">&#40;</span>renderMessage<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;<span style="color: #0066FF;">/td&gt;&lt;/</span>tr&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;tr&gt;&lt;td&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &lt;img src=<span style="color:#006600; font-weight:bold;">&#40;</span>session.<span style="color: #006600;">user</span>.<span style="color: #006600;">small_pic_url</span><span style="color:#006600; font-weight:bold;">&#41;</span> /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &lt;div&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;input data=session.<span style="color: #006600;">user</span>.<span style="color: #006600;">name</span> /&gt; &lt;b&gt;<span style="color: #3366CC;">' (your nickname)'</span>&lt;/b&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;form onsubmit=postMessage&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input data=session.<span style="color: #006600;">new_comment</span> hasFocus=<span style="color: #003366; font-weight: bold;">true</span> /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/form&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &lt;/div&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;<span style="color: #0066FF;">/td&gt;&lt;/</span>tr&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;/table&gt;;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>You will notice the protobufferness at the top, and the <code>fn</code> of less characters, and E4X-like.</p>
<p>To learn more, let's listen in to Dustin as he gives us a walk through the world of LunaScript:</p>
<p><object id="csSWF" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="374" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0"><param name="src" value="http://asana.com/luna/demo/demo_controller.swf"/><param name="bgcolor" value="#1a1a1a"/><param name="quality" value="best"/><param name="allowScriptAccess" value="always"/><param name="allowFullScreen" value="true"/><param name="scale" value="showall"/><param name="flashVars" value="autostart=false"/><embed name="csSWF" src="http://asana.com/luna/demo/demo_controller.swf" width="480" height="374" bgcolor="#1a1a1a" quality="best" allowScriptAccess="always" allowFullScreen="true" scale="showall" flashVars="autostart=false&#038;thumb=FirstFrame.png&#038;thumbscale=45&#038;color=0x000000,0x000000" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></object></p>
<p>I talked to the guys and asked a few questions which they answered..... what questions do you have for them though? Are you excited about what a higher level abstraction could give you? Or do you like to be close to the metal?</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/lunascript-a-new-language-and-platform-to-take-your-web-2-0-apps-to-the-moon/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>New Version of SVG-Edit</title>
		<link>http://ajaxian.com/archives/new-version-of-svg-edit</link>
		<comments>http://ajaxian.com/archives/new-version-of-svg-edit#comments</comments>
		<pubDate>Tue, 02 Feb 2010 10:30:35 +0000</pubDate>
		<dc:creator>Brad Neuberg</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[SVG]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8517</guid>
		<description><![CDATA[SVG-Edit is a nifty open source editing web app that uses SVG and doesn't need a server-side:

The SVG-Edit team recently announced SVG-Edit 2.4, code named Arbelos. New features include:
- Raster Images
- Group/Ungroup
- Zoom
- Layers
- Curved Paths
- UI Localization
- Wireframe Mode
- Change Background
- Draggable Dialogs
- Resizable UI (SVG icons)
- Convert Shapes to Path
Try out the demo [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">SVG-Edit is a nifty open source editing web app that uses SVG and doesn't need a server-side:</p>
<p style="text-align: left;"><img class="aligncenter size-full wp-image-8518" title="svg-edit-screenshot1" src="http://ajaxian.com/wp-content/images/svg-edit-screenshot1.png" alt="svg-edit-screenshot1" width="556" height="262" /></p>
<p style="text-align: left;">The SVG-Edit team recently announced SVG-Edit 2.4, code named Arbelos. New features include:</p>
<p>- Raster Images<br />
- Group/Ungroup<br />
- Zoom<br />
- Layers<br />
- Curved Paths<br />
- UI Localization<br />
- Wireframe Mode<br />
- Change Background<br />
- Draggable Dialogs<br />
- Resizable UI (SVG icons)<br />
- Convert Shapes to Path</p>
<p>Try out the demo here:<br />
<a href="http://svg-edit.googlecode.com/svn/branches/2.4/editor/svg-editor.html">http://svg-edit.googlecode.com/svn/branches/2.4/editor/svg-editor.html</a></p>
<p>Check out the project page:<br />
<a href="http://svg-edit.googlecode.com">http://svg-edit.googlecode.com</a></p>
<p>Read the release notes:<br />
<a href="http://code.google.com/p/svg-edit/wiki/VersionHistory">http://code.google.com/p/svg-edit/wiki/VersionHistory</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/new-version-of-svg-edit/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Google isn&#8217;t Evil. Flash isn&#8217;t Dead; Thank god the Open Web doesn&#8217;t have a single vendor</title>
		<link>http://ajaxian.com/archives/google-isnt-evil-flash-isnt-dead-thank-god-the-open-web-doesnt-have-a-single-vendor</link>
		<comments>http://ajaxian.com/archives/google-isnt-evil-flash-isnt-dead-thank-god-the-open-web-doesnt-have-a-single-vendor#comments</comments>
		<pubDate>Tue, 02 Feb 2010 02:38:27 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Editorial]]></category>
		<category><![CDATA[Front Page]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8520</guid>
		<description><![CDATA[The following post is a reprint from my personal blog. It is editorial in nature and even delves into random politics. I apologise. You can deal with it though :)

Steve Jobs didn't hold back when talking about Google and Adobe. That is great. Life is so much more fun when people speak their mind. I [...]]]></description>
			<content:encoded><![CDATA[<p><em>The following post is a <a href="http://almaer.com/blog/google-isnt-evil-flash-isnt-dead-thank-god-the-open-web-doesnt-have-a-single-vendor">reprint from my personal blog</a>. It is editorial in nature and even delves into random politics. I apologise. You can deal with it though :)</em></p>
<p><img src="http://almaer.com/blog/uploads/openclosed.jpg" alt="openclosed" title="openclosed" width="480" height="480" class="alignnone size-full wp-image-2620" /></p>
<p>Steve Jobs didn't hold back when <a href="http://iphoneroot.com/jobs-about-google-and-adobe/">talking about Google and Adobe</a>. That is great. Life is so much more fun when people speak their mind. I remember hearing a story when Sir Steve was asked why mac keyboards where the way they were. He grabbed a PC keyboard and started to rip out "stupid keys" (print screen, F keys, and the like) and swore a lot.</p>
<p>We love to paint with broad black and white brushes these days don't we? Whenever I hear people talking about Google being "evil" or not.... I sit back and think about how interesting it is that companies become "people", especially in this country.</p>
<p>It makes sense when you look up <a href="http://en.wikipedia.org/wiki/Corporation">Corporation</a>:</p>
<blockquote cite="http://en.wikipedia.org/wiki/Corporation"><p>
Corporations are recognized by the law to have rights and responsibilities like actual people.</p>
<p>That may have been a convenient (and often almost genius) abstraction by lawyers, but it is screwed up. It feels like the times when you use inheritence in a way that isn't a ISA relationship, but it does kinda make the code nice. We have all done that, until we learned to favor composition. Corporations ISA Person? No. They are composed of them though.</p>
<p>I have been thinking about this ever since the recently surprise court decision the other day that "allows corporations and unions to pour unprecedented amounts of money into elections."</p>
<p>Lawrence Lessig had some interesting commentary:</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/87YOBDzxwj4&#038;rel=0&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/87YOBDzxwj4&#038;rel=0&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></embed></object></p>
<p>The court decision does feel totally wonky to me. Right now, $ has a direct bearing on elections, and allowing multi-nationals (who have the money) to rain it down makes no sense.</p>
<p><b>Fun aside</b></p>
<p>My renaissance friend Graham Glass talks about how corporations can be considered a single conscious in his series on "the mind".</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/_qTI_jrEmXg&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/_qTI_jrEmXg&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></embed></object></p>
<p>The issue with the vast number of corporations is that they are profit driven entities whose charter is to bring financial reward to shareholders. While you could argue that <a href="http://en.wikipedia.org/wiki/The_Selfish_Gene">we as a species are driven by the selfish gene</a>, corporations are driven by profits. Duh. Capitalism.</p>
<p>Google is a company. It is driven by this same goal. Now, there are various paths to a particular goal to make profits. Some companies sell things that kill people (weapons, cigarettes, etc). Others offer medical devices. All companies are not equal. Having spent time at Google, I do feel like the place isn't just an evil cult. The people that make up the consciousness were very driven strong willed people that cared about the company mission (universal access to information and all that) more than just the $. Sure some folks are focused on that. Also, although the wool could be placed over your eyes, the guys at the top of the chain have their hearts in the right place. While Larry and Sergey are there, decisions will be made that aren't solely based on profit. They want to create a different kind of legacy and company.</p>
<p>That being said, I think it is quite easy to fall into a trap such as:</p>
<blockquote><p>
If we do something here to block competition, we can make more $ and since we are Good Guys we can do better things with that money!
</p></blockquote>
<p>Google will sometimes do things that could be considered "evil" by some. That is life.</p>
<p>The good news with Google is that their search and ads business deals in a trust economy. It doesn't take much to switch from Google to Bing. Google knows that. Even though they have some HUGE advantages (technical [data centers, talent], brand, etc) the low barrier to change is huge.</p>
<p><b>Not all corporations are profit driven</b></p>
<p>I had the huge pleasure of working for Mozilla, which is a mission based corporation. Wow does that make life different. While you have to sustain yourself, it does mean that you think of the world very differently. You would rather go out in a blaze of glory doing something great for the mission, than just slowly die not doing much. Every choice you make .... you think of the mission.</p>
<p>It was interesting to work there knowing that I actually wouldn't want Firefox to be a 90% browser. You can fall into the similar trap as above and think:</p>
<blockquote><p>
We are mission based! If we had that domination we would use it for good!
</p></blockquote>
<p>But, not having that power in one hand is even better. Imagine working somewhere thinking "in my wildest dreams, the market would be shared somewhat evenly with the competition." The Open Web is amazing in that there is NO SINGLE VENDOR. If we are able to keep a decent balance between browsers (and thus the platform as we know it) then we have a balance of powers. Sure, in some ways you can't move as fast as a dictatorship, but there is a reason we don't want dictatorships in our government (even if the trains run on time!)</p>
<p>And, this brings me to the Adobe half of the Steve Jobs equation. Flash isn't dead. HTML5 is slowly going to put a dent into it if we ever get some of the use cases just right (e.g. video), but Adobe has a good penetration and can move at the speed of a dictatorship. The iPhone/iPad combo not shipping Flash will have an interesting dynamic here too, hopefully helping the HTML5 video cause. There is still much more work to be done. Flash and browser plugins have had a long history at forging new paths, and the Web can come in behind them and standardize. May that continue.</p>
<p>I do watch for single-owned platforms such as Flash, Silverlight, or now the Apple platform (even though they do great work on the HTML5 side of the house). I don't want any of those vendors to have too much power. The thought of a Web that required the use of their technology makes me shudder (we have a piece of that with Flash video). Right now I can turn off those plugins and life moves on. Sure I can't Hulu or Netflix, but that will change. I would miss some of the Flash sites that my kids use, but they could even be partially ported over to HTML5 these days.</p>
<p>I don't want to "kill" these other platforms as they offer competition and spur on the industry. I just don't want any one of them to take over. It may seem like the world would be better if we all just used Macs and iPhones and iPads, but would it? Do you think Steve would be a benevolent dictator? </p>
<p><img src="http://iphoneroot.com/wp-content/uploads/2010/01/steve_jobs_630x-400x210.jpg"/></p>
<p>Erm, no.</p>
<p>And thus I find myself torn. I really want to go out and by that iPad....... but when is it "too late". Surely I have a few years right? I can enjoy the shiny new toy? :)</p>
<p>Faruk Ate? also has a nice post <a href="http://farukat.es/journal/2010/02/385-so-long-and-thanks-for-all-the-flash">on where he see's Flash going</a> which is bolder than mine :)</p>
<p>What do you think?</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/google-isnt-evil-flash-isnt-dead-thank-god-the-open-web-doesnt-have-a-single-vendor/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>fullscreen API coming to browsers near you?</title>
		<link>http://ajaxian.com/archives/fullscreen-api-coming-to-browsers-near-you</link>
		<comments>http://ajaxian.com/archives/fullscreen-api-coming-to-browsers-near-you#comments</comments>
		<pubDate>Mon, 01 Feb 2010 11:26:49 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Front Page]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8514</guid>
		<description><![CDATA[What can you do if you want to enable a fullscreen experience on the Web? You can't. Or, use Flash. Some claim that you shouldn't offer this ability as it is a security liability. Someone can put a fullscreen view that tricks the user into giving it information.
However, as much as I think user security [...]]]></description>
			<content:encoded><![CDATA[<p>What can you do if you want to enable a fullscreen experience on the Web? You can't. Or, use Flash. Some claim that you shouldn't offer this ability as it is a security liability. Someone can put a fullscreen view that tricks the user into giving it information.</p>
<p>However, as much as I think user security is important, it doesn't seem like we can punt and not do anything because of this. A user agent can do a lot of things to help out.</p>
<p>Some (majority?) of the use cases revolve around full screen video. Eric Carlson has a <a href="http://trac.webkit.org/changeset/50893">WebKit checkin</a> that enables that one case. You can <code>webkitEnterFullScreen()</code> on a HTML5 video element and be on your way.</p>
<p>You can see this in action on the <a href="http://jilion.com/sublime/video">SublimeVideo HTML5 player</a>. Play the video in WebKit nightly and alt-click the "full size" arrows.</p>
<p><img src="http://ajaxian.com/wp-content/images/html5sublimevideo.png" alt="html5sublimevideo" title="html5sublimevideo" width="480" height="375" class="alignnone size-full wp-image-8515"/></p>
<p>Video is great, but what about general purpose? What if you could fullscreen any element? Robert O'Callahan threw up a strawman:</p>
<blockquote>
<ol>
<li>Should be convenient for authors to make any element in a page display fullscreen
</li>
<li>Should support in-page activation UI for discoverability
</li>
<li>Should support changing the layout of the element when you enter/exit fullscreen mode. For example, authors probably want some controls to be fixed size while other content fills the screen.
</li>
<li>Should accommodate potential UA security concerns, e.g. by allowing the transition to fullscreen mode to happen asynchronously after the user has confirmed permission</li>
</ol>
<p>New API for all elements:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-18');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-18">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">void</span> enterFullscreen<span style="color:#006600; font-weight:bold;">&#40;</span>optional DOMElement element, optional Screen, optional boolean enableKeys<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">void</span> exitFullscreen<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">boolean attribute supportsFullscreen;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">boolean attribute displayingFullscreen;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">//&quot;beginfullscreen&quot; and &quot;endfullscreen&quot; events</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>While an element is fullscreen, the UA imposes CSS style "position:fixed; left:0; top:0; right:0; bottom:0" on the element and aligns the viewport of its DOM window with the screen. Only the element and its children are rendered, as a single CSS stacking context.</p>
<p>enterFullscreen always returns immediately. If fullscreen mode is currently supported and permitted, enterFullscreen dispatches a task that a) imposes the fullscreen style, b) fires the beginfullscreen event on the element and c) actually initiates fullscreen display of the element. The UA may asynchronously display confirmation UI and dispatch the task when the user has confirmed (or never).</p>
<p>The enableKeys parameter to enterFullscreen is a hint to the UA that the application would like to be able to receive arbitrary keyboard input. Otherwise the UA is likely to disable alphanumeric keyboard input. If enableKeys is specified, the UA might require more severe confirmation UI.</p>
<p>In principle a UA could support multiple elements in fullscreen mode at the same time (e.g., if the user has multiple screens).</p>
<p>enterFullscreen would throw an exception if fullscreen was definitely not going to happen for this element due to not being supported or currently permitted, or if all screens are already occupied.
</p></blockquote>
<p>Much talking of exact API issues and more security.... but hopefully inertia does it job and we get something.</p>
<p>Would you like a fullscreen API?</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/fullscreen-api-coming-to-browsers-near-you/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Addmap.js &#8211; automatically analyse a text for geo locations and add a map</title>
		<link>http://ajaxian.com/archives/addmap-js-automatically-analyse-a-text-for-geo-locations-and-add-a-map</link>
		<comments>http://ajaxian.com/archives/addmap-js-automatically-analyse-a-text-for-geo-locations-and-add-a-map#comments</comments>
		<pubDate>Fri, 29 Jan 2010 15:17:47 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Geo]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mapping]]></category>
		<category><![CDATA[Yahoo!]]></category>
		<category><![CDATA[analisys]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[placemaker]]></category>
		<category><![CDATA[yql]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8503</guid>
		<description><![CDATA[As part of an upcoming article on geo location I am putting together a few Geo Toys for myself and here is the first one. Addmap.js is a JavaScript that analyses an elements text content, finds geographical locations and links them to Google Maps. It also adds a map preview and a list of the [...]]]></description>
			<content:encoded><![CDATA[<p>As part of an upcoming article on geo location I am putting together a few <a href="http://github.com/codepo8/geotoys">Geo Toys</a> for myself and here is the first one. Addmap.js is a JavaScript that analyses an elements text content, finds geographical locations and links them to Google Maps. It also adds a map preview and a list of the found locations to the element.</p>
<p>See addmap.js in action below - all the content in the green box is generated from the paragraph of text above it. You can try it out for yourself by clicking the screenshot.</p>
<p><a href="http://isithackday.com/hacks/geo/addmap.html"><img src="http://ajaxian.com/wp-content/images/textandmap.png" alt="Demonstration screenshot of addmap.js" title="Demo of addmap.js" width="557" height="282" class="size-full wp-image-8502" /></a></p>
<p>Using addmap.js is easy - sign up for a <a href="http://code.google.com/apis/maps/signup.html">Google Maps Key</a> and provide it as a configuration parameter. Then call the analyse function with the ID of the element to analyse as the parameter:</p>
<div class="igBar"><a href="javascript:showCodeTxt('xml-20');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">XML:</span>
<div id="xml-20">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;script</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"http://github.com/codepo8/geotoys/raw/master/addmap.js"</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/script<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;script<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">addmap.config.mapkey = 'YOUR_API_KEY';</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">addmap.analyse('content');</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/script<span style="font-weight: bold; color: black;">&gt;</span></span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>The script uses <a href="http://developer.yahoo.com/yql">YQL</a> and <a href="http://developer.yahoo.com/geo/placemaker">Yahoo PlaceMaker</a> under the hood, for more info and updates on this, <a href="http://www.wait-till-i.com/2010/01/29/adding-map-links-and-a-small-map-to-any-text-using-javascript-addmap-js/">check the blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/addmap-js-automatically-analyse-a-text-for-geo-locations-and-add-a-map/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Canvas Benchmark</title>
		<link>http://ajaxian.com/archives/canvas-benchmark</link>
		<comments>http://ajaxian.com/archives/canvas-benchmark#comments</comments>
		<pubDate>Thu, 28 Jan 2010 11:09:10 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8499</guid>
		<description><![CDATA[
The Freeciv.net crew has benchmarked a path in their canvas game. It is one data point, and tests more than just Canvas itself because a lot of code is running in the game. Thus, it ends up testing the union of a particular JavaScript path and the rendering of the canvas.
Here are the results:

With Bespin [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://freeciv.net/images/screenshot1.jpg"/></p>
<p>The Freeciv.net crew has <a href="http://code.google.com/p/freeciv-forever/wiki/FreecivBenchmarkResults">benchmarked a path in their canvas game</a>. It is one data point, and tests more than just Canvas itself because a lot of code is running in the game. Thus, it ends up testing the union of a particular JavaScript path and the rendering of the canvas.</p>
<p>Here are the results:</p>
<p><img src="http://ajaxian.com/wp-content/images/canvasbenchmark.png" alt="canvasbenchmark" title="canvasbenchmark" width="480" height="451" class="alignnone size-full wp-image-8500"/></p>
<p>With Bespin we had slightly different results, and the bulk of the bottleneck was in the blitting of the canvas. Optimizations were made to canvas over the initial phase of Bespin so the various browsers would leap frog each other. Good times :)</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/canvas-benchmark/feed</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Rolling a coke can around with pure CSS</title>
		<link>http://ajaxian.com/archives/rolling-a-coke-can-around-with-pure-css</link>
		<comments>http://ajaxian.com/archives/rolling-a-coke-can-around-with-pure-css#comments</comments>
		<pubDate>Wed, 27 Jan 2010 11:33:58 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Showcase]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8496</guid>
		<description><![CDATA[Román Cortés is having a lot of fun with CSS tricks these days. He just built an example rolling CSS coke can that uses background-attachment, background-position, and a few other tricks to get the effect. No fancy CSS3 needed here!

The key pieces used:
PLAIN TEXT
CSS:




&#160;


p &#123;


&#160; &#160; &#160; &#160; background-image: url&#40;coke-label.jpg&#41;;


&#160; &#160; &#160; &#160; background-attachment: fixed;


&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Román Cortés is having a lot of fun with CSS tricks these days. He just built an example <a href="http://www.romancortes.com/blog/pure-css-coke-can/">rolling CSS coke can</a> that uses background-attachment, background-position, and a few other tricks to get the effect. No fancy CSS3 needed here!</p>
<p><a href="http://www.romancortes.com/blog/pure-css-coke-can/"><img src="http://ajaxian.com/wp-content/images/Pure-CSS-Coke-Can-by-Román-Cortés.png" alt="Pure CSS Coke Can by Román Cortés" title="Pure CSS Coke Can by Román Cortés" width="509" height="400" class="aligncenter size-full wp-image-8508" /></a></p>
<p>The key pieces used:</p>
<div class="igBar"><a href="javascript:showCodeTxt('css-22');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">CSS:</span>
<div id="css-22">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">p <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-image</span>: <span style="color: #993333;">url</span><span style="color:#006600; font-weight:bold;">&#40;</span>coke-label.jpg<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-attachment</span>: <span style="color: #993333;">fixed</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-repeat</span>: <span style="color: #993333;">repeat-x</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span>: 1px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #cc00cc;">#x1 <span style="color:#006600; font-weight:bold;">&#123;</span></span>background-<span style="color: #000000; font-weight: bold;">position</span>: 5px 30px;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #cc00cc;">#x2 <span style="color:#006600; font-weight:bold;">&#123;</span></span>background-<span style="color: #000000; font-weight: bold;">position</span>: 0px 30px;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #cc00cc;">#x3 <span style="color:#006600; font-weight:bold;">&#123;</span></span>background-<span style="color: #000000; font-weight: bold;">position</span>: -3px 30px;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #cc00cc;">#x4 <span style="color:#006600; font-weight:bold;">&#123;</span></span>background-<span style="color: #000000; font-weight: bold;">position</span>: -6px 30px;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #cc00cc;">#x5 <span style="color:#006600; font-weight:bold;">&#123;</span></span>background-<span style="color: #000000; font-weight: bold;">position</span>: -8px 30px;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
<p>It helps to see the can and the wrapper that is placed around it.</p>
<p><img src="http://ajaxian.com/wp-content/images/coke-can.png" alt="coke-can" title="coke-can" width="194" height="336" class="aligncenter size-full wp-image-8509" /></p>
<p><img src="http://ajaxian.com/wp-content/images/coke-label.jpg" alt="coke-label" title="coke-label" width="537" height="280" class="aligncenter size-full wp-image-8510" /></p>
<p>[Edit: Fixed the hotlinking - well played Román - he <a href="http://www.flickr.com/photos/codepo8/4313258909/">Rick-rolled us</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/rolling-a-coke-can-around-with-pure-css/feed</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>JavaScript running on the GPU</title>
		<link>http://ajaxian.com/archives/javascript-running-on-the-gpu</link>
		<comments>http://ajaxian.com/archives/javascript-running-on-the-gpu#comments</comments>
		<pubDate>Tue, 26 Jan 2010 17:07:37 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8494</guid>
		<description><![CDATA[I love programmers like Alex Miltsev. He won the Jetpack 0.5 content by prototyping access to the GPU from JavaScript!

Alex’s work is an alpha-prototype that shows the feasibility of the project and it requires a custom build of Firefox to use — it’s not easy to demo. However, the code sample below shows how the [...]]]></description>
			<content:encoded><![CDATA[<p>I love programmers like Alex Miltsev. He <a href="http://mozillalabs.com/jetpack/2009/11/10/jetpack-0-5-contest-a-winner/">won the Jetpack 0.5 content</a> by prototyping access to the GPU from JavaScript!</p>
<blockquote><p>
Alex’s work is <a href="http://groups.google.com/group/jetpack-to-cuda/">an alpha-prototype</a> that shows the feasibility of the project and it requires a custom build of Firefox to use — it’s not easy to demo. However, the code sample below shows how the technology works. In this example, we are transposing a matrix at lightening speed:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-24');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-24">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">jetpack.<span style="color: #006600;">statusBar</span>.<span style="color: #006600;">append</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; html: <span style="color: #3366CC;">"Transpose!"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; onReady: <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>widget<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; $<span style="color:#006600; font-weight:bold;">&#40;</span>widget<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">click</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> myStorage = jetpack.<span style="color: #006600;">cuda</span>-storage;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> matrix = <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> size = <span style="color:#800000;">32</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">for</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i=<span style="color:#800000;">0</span>; i&lt;size *size; ++i<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; array<span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span> = i;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> transposedMatrix = myStorage.<span style="color: #006600;">transpose</span><span style="color:#006600; font-weight:bold;">&#40;</span>size, matrix<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; transposedMatrix.<span style="color: #006600;">forEach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color:#006600; font-weight:bold;">&#40;</span>v<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> console.<span style="color: #006600;">log</span><span style="color:#006600; font-weight:bold;">&#40;</span> v <span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
</div>
</div>
</blockquote>
<p>Alex discussed <a href="http://mozillalabs.com/blog/2010/01/elevating-javascript-performance-through-gpu-power/">why this matters</a>:</p>
<blockquote><p>
People are using the internet to collaborate more than ever before. Collaboration on the internet has been evolving at a rapid pace, and the applications and technology that will drive the next wave of internet collaboration will require even greater technical complexity and more significant computing resources than is currently available through the browser environment today. While text documents, videos, music, and image-base forms of collaboration are now common place, there are many needs require a level of compute performace beyond the web platform as it exists today, such as:</p>
<ul>
<li>consumption of high-quality digital video or music streams,
</li>
<li>complex image or speech recognition,
</li>
<li>manipulation and processing large pictures of nature or space,
</li>
<li>processing large sets of tabular data locally in the browser,
</li>
<li>complex animations with DOM elements (via DirectX or OpenGL),
</li>
<li>exploring 3D worlds, such as SecondLife or an OpenSim Grid,
</li>
<li>real-time audio and video editing,
</li>
<li>having an integrated development environment that runs entirely in the browser</li>
</ul>
<p>There are endless examples of such complex uses of the internet platform that are just not feasible with the status quo web platform. Developers have tried to overcome such barriers in the past with client-side enhancements like ActiveX, Netscape Plugins, Java Applets, but each in its own way was flawed and failed to gain mass adoption. It is possible that the Native Client project will change all this, but standardization of such initiatives across the browser landscape is a lengthy endeavor. For the near future the tools that the developer uses to provide a rich user experience remain JavaScript and ActionScript, plug-ins, such as the ones previously mentioned, are significantly limited by the architectural mismatch of performance requirements they place on the CPU.
</p></blockquote>
<p>Ben tends to get a little giddy when he hears about GPU access :)</size></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/javascript-running-on-the-gpu/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>A Titanium Tablet?</title>
		<link>http://ajaxian.com/archives/a-titanium-tablet</link>
		<comments>http://ajaxian.com/archives/a-titanium-tablet#comments</comments>
		<pubDate>Tue, 26 Jan 2010 08:01:51 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Appcelerator]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Front Page]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8488</guid>
		<description><![CDATA[Appcelerator has published an interesting study on the Apple Tablet. You know, the iPhone OS based one that we will Steve will show us on Wednesday.
The study asks some interesting questions revolving around the development side of the tablet. Are developers going to develop for it? What are they looking for? What are they excited [...]]]></description>
			<content:encoded><![CDATA[<p>Appcelerator has <a href="http://www.appcelerator.com/tabletappwave">published an interesting study on the Apple Tablet</a>. You know, the iPhone OS based one that we will Steve will show us on Wednesday.</p>
<p>The study asks some interesting questions revolving around the development side of the tablet. Are developers going to develop for it? What are they looking for? What are they excited about from a technology perspective?</p>
<p>I found it interesting to see the type of companies looking to build apps:</p>
<p><img src="http://ajaxian.com/wp-content/images/Appcelerator_survey_tablet_category_ranking.png" alt="Appcelerator_survey_tablet_category_ranking" title="Appcelerator_survey_tablet_category_ranking" width="480" class="alignnone size-full wp-image-8489"/></p>
<p>Games will still probably be huge on the device, but it is great to see other types of apps at the ready.</p>
<p>Then we have the feature requests:</p>
<p><img src="http://ajaxian.com/wp-content/images/Appcelerator_survey_top_anticipated_features.png" alt="Appcelerator_survey_top_anticipated_features" title="Appcelerator_survey_top_anticipated_features" width="480" class="alignnone size-full wp-image-8490"/></p>
<p>Even if there is a way to run iPhone apps, it is clear that people will be spending effort creating truly native experiences. There are core differences beyond screen size here. Very different capabilities to take into account.</p>
<p><img src="http://almaer.com/blog/uploads/devices.png"/></p>
<p>We are seeing an increase in consumer devices. I recently talked about <a href="http://almaer.com/blog/the-table-stakes-of-2010-and-beyond">the table stakes of 2010 and beyond</a>. As a consumer it is exciting to see the vision of connected devices become real. As a developer, although there is new opportunity, it is incredibly daunting. How many proprietary SDKs can one learn and fund development on?</p>
<p>This is where the Web comes in. The Web has the potential to become the unifying platform across devices. This isn't about write once run anywhere, but it is about offering advanced solutions to deliver experiences across the devices using shared code, services, and APIs.</p>
<p>Back to Appcelerator. They publish this study right before the tablet launch. Hmm.... something tells me that Titanium (now in mobile and desktop versions) will support Tablet. As companies struggle with the pull of delivering functionality to many devices, Titanium has an opportunity of helping developers out. We have heard that Titanium is going to GA some time soon (probably in March) and we will then see pricing plans and some new products (probably around analytics and metrics). Apparently more desktop and mobile applications will be developed using Titanium than Adobe AIR this year. That would be quite a feat.</p>
<p>What are your thoughts on the Tablet and the Web? What did you <a href="http://www.appcelerator.com/tabletappwave">get out of the survey</a>?</p>
<p>Here is Jeff talking about their work with Scoble:</p>
<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/Y-mv6_YVqto&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Y-mv6_YVqto&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/a-titanium-tablet/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Taking a stance: Comparing video codec issue (H.264) to ActiveX</title>
		<link>http://ajaxian.com/archives/h264-activex</link>
		<comments>http://ajaxian.com/archives/h264-activex#comments</comments>
		<pubDate>Mon, 25 Jan 2010 12:01:33 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=8484</guid>
		<description><![CDATA[Sometimes you need to compromise, but at others you need to lead and take a stance. Our politicians do far too much via polls, and I often find myself wishing for more leadership. I could start talking about Obama and the healthcare issue in the US..... but this is a technical blog so I won't [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you need to compromise, but at others you need to lead and take a stance. Our politicians do far too much via polls, and I often find myself wishing for more leadership. I could start talking about Obama and the healthcare issue in the US..... but this is a technical blog so I won't put you through that.</p>
<p>Robert O'Callahan (moz layout guru) shares why he thinks Mozilla should stand firm on the H.264 issue <a href="http://weblogs.mozillazine.org/roc/archives/2010/01/activex_all_ove.html">comparing it to the ActiveX issue from the past</a>.</p>
<p>With Chrome and Safari supporting H.264 (and not open video formats such as Ogg Theora) some users and developers have asked for Mozilla to support it too in Firefox. Mozilla is certainly a user-centric group (which is how they have gotten so far with Firefox) but remember that they are mission based: to keep the Internet open.</p>
<p>Here is some of RoCs opinion. I am glad he shared it:</p>
<blockquote><p>
Taking such positions is nothing new for Mozilla and history has proved us right for doing so, in particular regarding ActiveX and Web standards in general.</p>
<p>Perhaps it's not widely known, but Gecko has had code to support hosting ActiveX controls, dating back as far as 1999. ActiveX controls are very much like system video codecs. ActiveX support would have been very useful to users ever since 1999, and still would be now --- certainly in corporate intranets, and everywhere in China and South Korea. Enabling ActiveX support would probably boost our market share significantly. Most users have useful ActiveX controls on their machines. But for the last ten years, even during Mozilla's most desperate days, we have consistently refused to turn this feature on, because we believe that ActiveX is not good for the Web.</p>
<p>I'm not suggesting that the consequences of exposing system codecs to the Web would be identical to exposing ActiveX. That's unlikely, and unknowable. But favouring our principles over short-term gains for users is nothing new for Mozilla, and when we've done it in the past, history shows it was the right thing to do.
</p></blockquote>
<p>Chris Blizzard has a <a href="http://www.0xdeadbeef.com/weblog/2010/01/html5-video-and-h-264-what-history-tells-us-and-why-were-standing-with-the-web/">very detailed perspective too</a>, linking up the history of GIF, MP3, and On2 :)</p>
]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/h264-activex/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>
