<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Ajaxian » Front Page</title>
	
	<link>http://ajaxian.com</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Sat, 21 Nov 2009 15:33:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://ajaxian.com/index.xml" type="application/rss+xml" /><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site, subject to copyright and fair use.</feedburner:browserFriendly><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Full Frontal ‘09: Simon Willison on Server-Side Javascript and Node.js</title>
		<link>http://feedproxy.google.com/~r/ajaxian/~3/VN66xaxsy9U/full-frontal-09-simon-willison-on-server-side-javascript-and-node-js</link>
		<comments>http://ajaxian.com/archives/full-frontal-09-simon-willison-on-server-side-javascript-and-node-js#comments</comments>
		<pubDate>Fri, 20 Nov 2009 17:41:12 +0000</pubDate>
		<dc:creator>Michael Mahemoff</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7981</guid>
		<description><![CDATA[Simon Willison snuck in a last-minute topic change, and is now going to give the server-side Javascript talk.
The news of the past 24 hours is ChromeOS. For the first time in years, someone's re-thinking how an OS should work. With Chrome, you turn on your computer and you're in the browser. What's really interesting is [...]]]></description>
			<content:encoded><![CDATA[<p>Simon Willison snuck in a last-minute topic change, and is now going to give the server-side Javascript talk.</p>
<p>The news of the past 24 hours is ChromeOS. For the first time in years, someone's re-thinking how an OS should work. With Chrome, you turn on your computer and you're in the browser. What's really interesting is to contrast it to the introduction of the iPhone, where Apple's apps used native APIs while they expected developers to write web apps running in the browser with limited abilities. Here, Google's apps are using the same web platform...it's a level playing field.</p>
<p>Javascript combined with JSONP makes it real easy to write quick and dirty apps. An example of a quick app is Tweetersation Simon wrote with Natalie Downe. Simple app, 200 lines, written in an afternoon. At a larger system level, there's Google Moderator, which is essentially a pure-Javascript solution with a no-op in the noscript tag.</p>
<p>These pure Javascript apps are great for experimenting and prototyping. The problem with this style of development, though, is you're completely breaking web standards. The web Simon "felll in love with" is one where you point to a URL and you get content coming back.</p>
<p>With server-side Javascript, we can get the benefits of the things we like about Javascript, but without throwing away with the things we like about the web. Simon has been playing with <a href="http://nodejs.org/">node.js</a>, and evidently the results were important enough to throw out the old talk and make this new one.</p>
<p>Take a step back and look at the interaction patterns with a web server. The conventional model is straightforward request-response, where the server tries to respond and disconnect as quickly as possible. But ... there's also the event loop model. As in Comet; it's generally considered to be more efficient, so why do web developers avoid it? Simon says traditional server-side languages aren't designed to deal with event-driven programming. It's more like "do A, do B, do C, exit".  Javascript, on the other hand, <strong>is</strong> well suited to do callback-driven event programming.</p>
<p>Brave Simon now proceeds to live code with node.js. He shows a "Hello World" daemon, where the code looks like Ajax in reverse, and runs extremely fast. But where it gets really interesting - and useful - is with Comet. Another demo. The code is tiny and the benchmark looks good.</p>
<p>Simon's built his own framework on top of node.js: <a href="http://github.com/simonw/djangode">Djangode</a> takes the best features from Django and sticks them on the server.</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-2');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-2">
<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;">var</span> dj = require<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'./djangode'</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;">dj.<span style="color: #006600;">serve</span><span style="color:#006600; font-weight:bold;">&#40;</span>dj.<span style="color: #006600;">makeApp</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</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;">&#91;</span><span style="color: #3366CC;">'^/$'</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>req, res<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>&nbsp; &nbsp; &nbsp; &nbsp; dj.<span style="color: #006600;">respond</span><span style="color:#006600; font-weight:bold;">&#40;</span>res, <span style="color: #3366CC;">'&lt;h1&gt;Homepage&lt;/h1&gt;'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#93;</span>,&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color: #3366CC;">'^/other$'</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>req, res<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; dj.<span style="color: #006600;">respond</span><span style="color:#006600; font-weight:bold;">&#40;</span>res, <span style="color: #3366CC;">'&lt;h1&gt;Other page&lt;/h1&gt;'</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:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#93;</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;">&#91;</span><span style="color: #3366CC;">'^/page/(<span style="color: #000099; font-weight: bold;">\\</span>d+)$'</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>req, res, page<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; dj.<span style="color: #006600;">respond</span><span style="color:#006600; font-weight:bold;">&#40;</span>res, <span style="color: #3366CC;">'&lt;h1&gt;Page '</span> + page + <span style="color: #3366CC;">'&lt;/h1&gt;'</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;">&#93;</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;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#800000;">8008</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color: #009900; font-style: italic;">// Serves on port 8008</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>The more interesting example is Comet, which he's demo'd here.</p>
<p>Moving on to persistence, there's the NOSQL trend of the past 18 months, and he shows how simple it is to write CouchDB queries from node. It's easy to talk to CouchDB from Node.js apps. Redis is another interesting database, which could lead to pages being rendered very quickly, given its performance benchmarks.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ajaxian?a=VN66xaxsy9U:E37442oGLkk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=VN66xaxsy9U:E37442oGLkk:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=VN66xaxsy9U:E37442oGLkk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ajaxian?i=VN66xaxsy9U:E37442oGLkk:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/full-frontal-09-simon-willison-on-server-side-javascript-and-node-js/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://ajaxian.com/archives/full-frontal-09-simon-willison-on-server-side-javascript-and-node-js</feedburner:origLink></item>
		<item>
		<title>Full Frontal ‘09: Jake Archibald on Performance Optimisation</title>
		<link>http://feedproxy.google.com/~r/ajaxian/~3/jMSznGOYIf0/full-frontal-09-jake-archibald-on-performance-optimisation</link>
		<comments>http://ajaxian.com/archives/full-frontal-09-jake-archibald-on-performance-optimisation#comments</comments>
		<pubDate>Fri, 20 Nov 2009 17:11:11 +0000</pubDate>
		<dc:creator>Michael Mahemoff</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7979</guid>
		<description><![CDATA[Jake explains no-one likes waiting, and people are multi-threaded (except when they have to sneeze). Yet, we're stuck with a single-threaded language for the most part; and we still face the legacy of a DOM standard from another era (DOM Level 1 - 1997). This talk provides some optimisation tips, backed by Jake's cross-browser experiments.
Jake's [...]]]></description>
			<content:encoded><![CDATA[<p>Jake explains no-one likes waiting, and people are multi-threaded (except when they have to sneeze). Yet, we're stuck with a single-threaded language for the most part; and we still face the legacy of a DOM standard from another era (DOM Level 1 - 1997). This talk provides some optimisation tips, backed by Jake's cross-browser experiments.</p>
<p><a href="http://jakearchibald.co.uk/jsperformance/">Jake's slides and research are online.</a></p>
<h3>Optimise Where it Matters</h3>
<p>Jake explains the importance of speeding things up where it really matters.</p>
<p>Doug Crockford has pointed out that in Javascript, bitwise operations aren't close to the hardware, which stands in contrast to other languages. In fact, if you look at it, bitwise operations can still be faster than alternative operations; Jake shows an example where bitwise parsing of hex codes is faster than bitwise. The question is, how much faster? In many cases, such as this example, your energy is better spent on optimising big things.</p>
<h3>Avoid eval() Where Possible</h3>
<p>Jake says avoid eval() where possible. Thinking about what functions eval, here's a brain teaser: what will the following output?</p>
<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;"><span style="color: #003366; font-weight: bold;">var</span> msg = <span style="color: #3366CC;">"spatchcock"</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: #003366; font-weight: bold;">function</span> doStuff<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; <span style="color: #000066;">alert</span><span style="color:#006600; font-weight:bold;">&#40;</span>msg<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; <span style="color: #000066; font-weight: bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">false</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; <span style="color: #003366; font-weight: bold;">var</span> msg=<span style="color: #3366CC;">"spotted dick"</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;"><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;">doStuff<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;</div>
</li>
</ol>
</div>
</div>
</div>
<p>Wait for it ... the answer is "undefined". Javascript does look ahead and create space for the local variable. So during the running of the function, there's no need to allocate space for the variable and the browser can optimise for that, but if you use "eval", the optimisation goes away. So avoid eval().</p>
<h3>Prefer innerHTML to DOM</h3>
<p>Jake shows a comparison of innerHTML versus DOM Level 1. In IE, DOM manipulation is much slower, because of the sync process between the two. The differential gets even worse when creating elements. Webkit has optimised sync between HTML and DOM, hence less difference, so it's not as bad, but create example is still slower with DOM. So from a performance perspective, best practice is construct the HTML and use innerHTML.</p>
<h3>Selectors</h3>
<p>It's educational to look at the implementation of selector libraries. Jake shows a comparison - IE7 is vastly more slow in this case. It doesn't support getElementsByClassName, querySelectorAll, evaluate; and it does support getElementById, but that's not used by sizzle for this query. So getElementsByTagName is all that's left; and if you knew that, and the implications, you could have made the query much faster.</p>
<h3>Benchmarking</h3>
<p>Pretty simple.</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;"><span style="color: #003366; font-weight: bold;">var</span> duration;</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;">start = <span style="color: #003366; font-weight: bold;">new</span> Date<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;">thingToTest<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;">duration = <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> - start;</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>However, timing isn't so accurate, so stick it in a function and run it many times.</p>
<p>Too easy ... so go benchmark and report your findings.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ajaxian?a=jMSznGOYIf0:ITlKP3pLJGk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=jMSznGOYIf0:ITlKP3pLJGk:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=jMSznGOYIf0:ITlKP3pLJGk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ajaxian?i=jMSznGOYIf0:ITlKP3pLJGk:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/full-frontal-09-jake-archibald-on-performance-optimisation/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		<feedburner:origLink>http://ajaxian.com/archives/full-frontal-09-jake-archibald-on-performance-optimisation</feedburner:origLink></item>
		<item>
		<title>Full Frontal ‘09: Todd Kloots on ARIA and Acessibility</title>
		<link>http://feedproxy.google.com/~r/ajaxian/~3/3dPeepb8y-Q/full-frontal-09-todd-kloots-on-aria-and-acessibility</link>
		<comments>http://ajaxian.com/archives/full-frontal-09-todd-kloots-on-aria-and-acessibility#comments</comments>
		<pubDate>Fri, 20 Nov 2009 16:10:28 +0000</pubDate>
		<dc:creator>Michael Mahemoff</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7976</guid>
		<description><![CDATA[Todd Kloots is talking accessibility and ARIA, with examples showing how YUI nicely supports these techniques. He explains how to improve in three areas: perception, usability, discoverability.
Can We Do ARIA Today?
Yes.
Firefox and IE (he didn't say which version) have really good support for ARIA. And Opera, Chrome, and Safari. Likewise for the screenreaders - JAWS, [...]]]></description>
			<content:encoded><![CDATA[<p>Todd Kloots is talking accessibility and ARIA, with examples showing how YUI nicely supports these techniques. He explains how to improve in three areas: perception, usability, discoverability.</p>
<h3>Can We Do ARIA Today?</h3>
<p>Yes.</p>
<p>Firefox and IE (he didn't say which version) have really good support for ARIA. And Opera, Chrome, and Safari. Likewise for the screenreaders - JAWS, Windows Eyes, NVDA - also have good support. An the libraries - YUI, Dojo, JQuery-UI - all have good support baked in, one of the benefits of using ARIA is automatic support.</p>
<h3>Improving Perception - ARIA and Screenreaders</h3>
<p>Websites can have problems in perception when rendered with a screenreader; it's hard to get the big picture about what the words refer to. With ARIA, we can close the gap in perception. This is another example of progressive enhancement - augment the item by adding properties, markup or Javascript if required:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-9');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-9">
<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;">node.<span style="color: #006600;">setAttribute</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"role"</span>, <span style="color: #3366CC;">"menu"</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;">node.<span style="color: #006600;">role</span> = <span style="color: #3366CC;">"menu"</span> <span style="color: #009900; font-style: italic;">// alternative introduced by IE8. IE-only, so don't use!</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>
<h3>Improving Usability - Keyboard Focus, ARIA, and YUI support</h3>
<p>Keyboard access. For some people, it's a necessity, and for others it's still an option or preference (think Vim). To support it, you must be able to tab to the element to get focus, so you should control tabbing with tabindex. A good application of controlling tabbing is, amazingly enough, moving through tabs. Another is modal dialogs; the browser doesn't "know" it's modal, so we have to control focus to make sure it doesn't slip out of the thing that's the only thing users should be able to click on!</p>
<p>Todd shows us just how many steps are required to perform a task in a complex application like Yahoo! mail, using just tabs to navigate through - 19 steps in this example, walking through the toolbar; and even more, when you consider the wider picture of entering the app in the first place. To help with this, he introduces a pattern whereby tabIndexes are updated dynamically to control what comes next, as you move through a toolbar. A negative tabIndex will ensure the element is skipped over.</p>
<p>You can also use the "focus" pseudoclass to ensure focus appearance is consistent for all elements. But, and it's a big one, it's not very well supported; even IE8 doesn't support :focus on &lt;a&gt;, for example. Doing it manually with Javascript has problems, in particular performance. Fortunately, PPK has worked out how to handle focus and blur with <a href="http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html">event delegation</a>, so that it's much more performant, and the resulting technique is built into YUI3.</p>
<p>Device-independence with markup was also advocated to further improve accessibility:</p>
<div class="igBar"><a href="javascript:showCodeTxt('html-10');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">HTML:</span>
<div id="html-10">
<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/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> role=<span style="color: #ff0000;">"menuitem"</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/&gt;</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></div>
</li>
</ol>
</div>
</div>
</div>
<h3>Improving Discoverability - ARIA</h3>
<p>Essentially, this is about "random access" and keyboard shortcuts; jumping straight to areas in this page and activating them. The key ARIA feature here is "landmark roles" to identify particular points on the page. This is still something where users aren't aware of the feature, and Todd points out it's not surprising as most screen reader users are self-taught (just under 75% according to the study he showed). Also, not every user is a geek, and the same applies to screen-reader users.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ajaxian?a=3dPeepb8y-Q:19qaQDm9txE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=3dPeepb8y-Q:19qaQDm9txE:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=3dPeepb8y-Q:19qaQDm9txE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ajaxian?i=3dPeepb8y-Q:19qaQDm9txE:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/full-frontal-09-todd-kloots-on-aria-and-acessibility/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://ajaxian.com/archives/full-frontal-09-todd-kloots-on-aria-and-acessibility</feedburner:origLink></item>
		<item>
		<title>Full Frontal ‘09: Stuart Langridge on HTML5 Features</title>
		<link>http://feedproxy.google.com/~r/ajaxian/~3/9BMd_k4Xdcg/full-frontal-09-stuart-langridge-on-html5-features</link>
		<comments>http://ajaxian.com/archives/full-frontal-09-stuart-langridge-on-html5-features#comments</comments>
		<pubDate>Fri, 20 Nov 2009 15:52:24 +0000</pubDate>
		<dc:creator>Michael Mahemoff</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Presentation]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7972</guid>
		<description><![CDATA[Stuart Langridge introduces us to some of the up-and-coming features we're getting with current and future browsers, a nice complement to Robert Nyman's talk, which covered the advanced features of "mainstream" (IE6-compatible) Javascript. After introducing the features that are there today, he also talks about how we can deal with the browser many of us [...]]]></description>
			<content:encoded><![CDATA[<p>Stuart Langridge introduces us to some of the up-and-coming features we're getting with current and future browsers, a nice complement to Robert Nyman's talk, which covered the advanced features of "mainstream" (IE6-compatible) Javascript. After introducing the features that are there today, he also talks about how we can deal with the browser many of us are still having to support.</p>
<h3>The Goodies</h3>
<p>Here are some of the things we can look forward to. (Having been part of the large crowd who charged the pub across the road at lunch, I was a bit late getting back, so I missed one or two of these.)</p>
<h4>Lists</h4>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-15');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-15">
<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:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;">1</span>,<span style="color:#800000;">2</span>,<span style="color:#800000;">3</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color: #006600;">every</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;">&#41;</span> <span style="color: #009900; font-style: italic;">// run for all items</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;">list.<span style="color: #006600;">filter</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color: #009900; font-style: italic;">// find elements in the list that pass the function</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">list.<span style="color: #006600;">map</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color: #009900; font-style: italic;">// apply function to each item</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>It takes a mental shift to start taking advantage of features like this. "Certain browsers" *cough* don't yet provide these conveniences, but you can take advantage of them straight away. Or another example is the base2 library - use it now and you'll be ready for the time when it's present in all browsers.</p>
<h4>Getters and Setters</h4>
<p>As our Javascript apps get increasingly bigger and more complex, we need to borrow principles, patterns, and techniques from "real programming". Getters and setters are the kind of thing we'll need more of. More generally, we'll need to be in the mindset that we're building APIs to components, which others might use; not just an individual making a one-off web app. Stuart shows a couple of techniques for getters and setters: (a) manually defined; (b) using </p>
<h4>Storage</h4>
<p>We can now do global storage - <tt>globalStorage</tt> works similarly to cookies. "Like cookies turned up to 11".</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;">&nbsp; globalStorage<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color: #3366CC;">"kryogenix.org"</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color: #006600;">visits</span> = visits+<span style="color:#800000;">1</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>He notes that like XHR, Microsoft did it a long time ago with <tt>userdata</tt>.</p>
<p>There is also the possibility of SQL and a consistent database API, somewhat supported today but not yet standardised.</p>
<h4>Server-Sent Events</h4>
<div class="igBar"><a href="javascript:showCodeTxt('html-17');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">HTML:</span>
<div id="html-17">
<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;">&lt;event -source <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"getTime.php"</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;</div>
</li>
</ol>
</div>
</div>
</div>
<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;">document.<span style="color: #006600;">getElementsByTagName</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"event-source"</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color: #006600;">addEventListener</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"server-time"</span>, eventHandler, <span style="color: #003366; font-weight: bold;">false</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;"><span style="color: #003366; font-weight: bold;">function</span> eventHandler<span style="color:#006600; font-weight:bold;">&#40;</span>event<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; <span style="color: #000066;">alert</span><span style="color:#006600; font-weight:bold;">&#40;</span>event.<span style="color: #006600;">data</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;"><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>Only in Opera right now.</p>
<h3>Great. So Do We, Can We, Use it Now or Later?</h3>
<p>You can use these features now if you're in a single-browser environment that supports them: app for one mobile; Air app; intranet app (where you've amazingly got Firefox exlcusively on your intranet); HTA. This isn't the sinful act of coding to weird proprietary APIs; it's coding to browsers that happen to support the technologies of tomorrow, today.</p>
<p>The libraries help us get to the future today, as long as they can support APIs compatibly across all the browsers. But it's all a little difficult when the market leader doesn't play ball. Hopefully, Dean Edwards will continue working on Base2 to plug the gaps, but we still have the problem. Around a year ago, it felt like the anti-IE6 might be at a tipping point, but that's died down a bit, and it's not clear how much longer we'll be held back.</p>
<p>What can you do then with IE6? If a number of major websites really held back and stopped supporting IE6, Stuart reckons corporations would upgrade. Imagine what would happen if Google stopped working on IE6...immediate upgrades. Show of hands indicates perhaps 20% of the audience would agree to mass dropping IE6 on their public sites. In Q&#038;A, Stuart later clarifies he's not really proposing an IE6 shutdown switch, more like a helpful suggestion to upgrade.</p>
<p>Silverlight and Flash. Proprietary, not open. If everyone started using Flash, the future is Adobe's future. Let's make it our future instead - we're building the open web. A call to arms for showing strength in numbers.<br />
</event></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ajaxian?a=9BMd_k4Xdcg:0vOIYe57pLc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=9BMd_k4Xdcg:0vOIYe57pLc:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=9BMd_k4Xdcg:0vOIYe57pLc:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ajaxian?i=9BMd_k4Xdcg:0vOIYe57pLc:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/full-frontal-09-stuart-langridge-on-html5-features/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://ajaxian.com/archives/full-frontal-09-stuart-langridge-on-html5-features</feedburner:origLink></item>
		<item>
		<title>Full Frontal ‘09: PPK on Mobile Quirks and Practices</title>
		<link>http://feedproxy.google.com/~r/ajaxian/~3/cazxHLq3ZBc/full-frontal-09-ppk-on-mobile-quirks-and-practices</link>
		<comments>http://ajaxian.com/archives/full-frontal-09-ppk-on-mobile-quirks-and-practices#comments</comments>
		<pubDate>Fri, 20 Nov 2009 12:58:38 +0000</pubDate>
		<dc:creator>Michael Mahemoff</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7968</guid>
		<description><![CDATA[PPK talks up the excitement of mobile web development, then brings the mood down a notch by listing the overwhelming array of browsers to be targeted! Quirksmode says it all. This talk is about quirks in mobile development, and some of the solutions out there.
Mobile CSS Quirks
So many platforms. Take just WebKit; there's iPhone Safari, [...]]]></description>
			<content:encoded><![CDATA[<p>PPK talks up the excitement of mobile web development, then brings the mood down a notch by listing the overwhelming array of browsers to be targeted! <a href="http://quirksmode.org/m/table.html">Quirksmode says it all</a>. This talk is about quirks in mobile development, and some of the solutions out there.</p>
<h3>Mobile CSS Quirks</h3>
<p>So many platforms. Take just WebKit; there's iPhone Safari, Android WebKit, Bolt, Iris, different versions, etc.  "If someone says my 'app should work in WebKit', laugh in their face. There are just too many versions of WebKit, so as PPK says it, there really is no "WebKit for mobile".</p>
<p>That said, it's good that things are starting to converge towards WebKit. As for the others: Blackberry browser "is dead" as they'll be switching to WebKit; Mozilla is very late to the game; NetFront "is not very good". Windows Mobile 6.5 is a big improvement on 6.1, and with an improved browser, but it's still IE6 based. ('Nuff said.) </p>
<p>There's also a large legacy share, and if users are used to it already, that may be what they want to keep using.</p>
<p>Landscape versus profile mode is an interesting one for those of us desktop developers whose users don't flip their heads around on a regular basis. NetFront has some very surprising and idiosyncratic ways of dealing with it.</p>
<p>The modes don't stop there. There is also mobile versus desktop mode in some browsers; sometimes users can switch these in some obscure corner of their mobile browser preferences. Again, some surprising things happen in Opera and Android. Perhaps of more concern is the difficulty he had diagnosing the situation at first, when Android was showing three divs of the same width in one mode, and not in the other.</p>
<h3>@media to the Rescue</h3>
<p>Okay, what can we do about all this? <a href="http://www.w3.org/TR/css3-mediaqueries/">Media queries</a> are extremely useful and fairly well supported in modern mobile browsers.</p>
<div class="igBar"><a href="javascript:showCodeTxt('css-20');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">CSS:</span>
<div id="css-20">
<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;">div<span style="color: #6666ff;">.sidebar </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: #000000; font-weight: bold;">width</span>: 300px;</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: #000000; font-weight: bold;">float</span>: <span style="color: #000000; font-weight: bold;">right</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>
<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: #a1a100;">@media all and (max-width: 400px) {</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<span style="color: #6666ff;">.sidebar </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: #000000; font-weight: bold;">width</span>: <span style="color: #993333;">auto</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: #000000; font-weight: bold;">float</span>: <span style="color: #993333;">none</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;"><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>
<p><tt>max-width</tt> and <tt>min-width</tt> have subtle issues which PPK is currently researching, but <tt>max-device-width</tt> and <tt>min-device-width</tt> give more reliable results. <tt>orientation</tt>, <tt>aspect-ratio</tt>, and <tt>dpi</tt> (also needs research).</p>
<h3>Mobile Javascript</h3>
<p>Performance-wise, IE Mobile and Blackberry extremely slow. iPhone is middle ground. The really fast browsers are Opera on Samsung and N97, and S60 on Nokia E71 and N97. The bottom line is take your time with mobile Javascript development; you generally can't expect it to "just work"; you'll have to optimise. Also, don't use iframes - they're major performance hogs.</p>
<h3>Mobile Connections</h3>
<p>Tempting fate, PPK informs us that if someone in the room starts downloading movies, the network gets slower for the rest of us.</p>
<p>Fortunately, browsers give us events to determine when user is going online and offline. Unfortunately, they're doing it wrong. Only Firefox automatically detects offline; all the others require the user to explicitly say "I'm offline now"!</p>
<h3>W3C Widgets</h3>
<p>In general mobile development, best practice is to put all the core files on the moble phone, and only download the data. But how can we do that with web apps, where the code comes down with the data? <a href="http://www.quirksmode.org/blog/archives/2009/04/introduction_to.html">W3C widgets offer a solution</a>. You just create a single HTML page with the CSS, Javascript, and images you need; add an icon and config; zip it up; and deploy. PPK reports it works in practice, and works in a "write once, run many" fashion. There are still problems to be sure, but he says it's the best interoperable solution we have today. But still many outstanding platforms: Blackberry (already talking about it), Nokia Maemo, Palm Pre, Android, and of course, iPhone.</p>
<h3>Device APIs</h3>
<p>Security risks mean critical device APIs will generally remain off limits to general websites for a while. Widgets have a better model, because they're more self-contained and can be verified, although not perfect either.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ajaxian?a=cazxHLq3ZBc:-JgGPmJsB3w:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=cazxHLq3ZBc:-JgGPmJsB3w:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=cazxHLq3ZBc:-JgGPmJsB3w:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ajaxian?i=cazxHLq3ZBc:-JgGPmJsB3w:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/full-frontal-09-ppk-on-mobile-quirks-and-practices/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://ajaxian.com/archives/full-frontal-09-ppk-on-mobile-quirks-and-practices</feedburner:origLink></item>
		<item>
		<title>Friday Fun; Scroll Clock</title>
		<link>http://feedproxy.google.com/~r/ajaxian/~3/0u2qh0fdHiM/friday-fun-scroll-clock</link>
		<comments>http://ajaxian.com/archives/friday-fun-scroll-clock#comments</comments>
		<pubDate>Fri, 20 Nov 2009 12:35:51 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7956</guid>
		<description><![CDATA[This is in the crazy but fun category, so I had to post this on a Friday. Toki Woki Scroll Clock:

Amazing what folks do with div overflows :)
All in a few lines of MooTools-used-JS:
PLAIN TEXT
JAVASCRIPT:




&#160;


var h1, h2, m1, m2, s1, s2;


window.addEvent&#40;'domready', function&#40;&#41; &#123;


&#160; &#160; &#160; &#160; h1=new Digit&#40;&#41;;


&#160; &#160; &#160; &#160; h2=new Digit&#40;&#41;;


&#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>This is in the crazy but fun category, so I had to post this on a Friday. <a href="http://toki-woki.net/p/scroll-clock/">Toki Woki Scroll Clock</a>:</p>
<p><img src="http://ajaxian.com/wp-content/images/scrollclock.png" alt="scrollclock" title="scrollclock" width="500" height="150" class="alignnone size-full wp-image-7957" /></p>
<p>Amazing what folks do with div overflows :)</p>
<p>All in a few lines of MooTools-used-JS:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-22');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-22">
<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;">var</span> h1, h2, m1, m2, s1, s2;</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;">window.<span style="color: #006600;">addEvent</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'domready'</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; &nbsp; h1=<span style="color: #003366; font-weight: bold;">new</span> Digit<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; &nbsp; &nbsp; &nbsp; h2=<span style="color: #003366; font-weight: bold;">new</span> Digit<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; &nbsp; m1=<span style="color: #003366; font-weight: bold;">new</span> Digit<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; &nbsp; &nbsp; &nbsp; m1.<span style="color: #006600;">pushRight</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; &nbsp; &nbsp; m2=<span style="color: #003366; font-weight: bold;">new</span> Digit<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; &nbsp; &nbsp; &nbsp; s1=<span style="color: #003366; font-weight: bold;">new</span> Digit<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; &nbsp; s1.<span style="color: #006600;">pushRight</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; &nbsp; &nbsp; &nbsp; s2=<span style="color: #003366; font-weight: bold;">new</span> Digit<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; &nbsp; $<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'main'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #006600;">adopt</span><span style="color:#006600; font-weight:bold;">&#40;</span>h1.<span style="color: #006600;">getElement</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, h2.<span style="color: #006600;">getElement</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, m1.<span style="color: #006600;">getElement</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, m2.<span style="color: #006600;">getElement</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, s1.<span style="color: #006600;">getElement</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, s2.<span style="color: #006600;">getElement</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;">&#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; &nbsp; showTime<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; &nbsp; setInterval<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'showTime()'</span>, <span style="color:#800000;">1000</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;"><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: #003366; font-weight: bold;">function</span> showTime<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; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> now=<span style="color: #003366; font-weight: bold;">new</span> Date<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; &nbsp; h1.<span style="color: #006600;">show</span><span style="color:#006600; font-weight:bold;">&#40;</span>now.<span style="color: #006600;">getHours</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>/<span style="color:#800000;">10</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; &nbsp; h2.<span style="color: #006600;">show</span><span style="color:#006600; font-weight:bold;">&#40;</span>now.<span style="color: #006600;">getHours</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;">&#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; m1.<span style="color: #006600;">show</span><span style="color:#006600; font-weight:bold;">&#40;</span>now.<span style="color: #006600;">getMinutes</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>/<span style="color:#800000;">10</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; &nbsp; m2.<span style="color: #006600;">show</span><span style="color:#006600; font-weight:bold;">&#40;</span>now.<span style="color: #006600;">getMinutes</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;">&#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; s1.<span style="color: #006600;">show</span><span style="color:#006600; font-weight:bold;">&#40;</span>now.<span style="color: #006600;">getSeconds</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>/<span style="color:#800000;">10</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; &nbsp; s2.<span style="color: #006600;">show</span><span style="color:#006600; font-weight:bold;">&#40;</span>now.<span style="color: #006600;">getSeconds</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;">&#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></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;">var</span> barDim=<span style="color:#800000;">120</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: #003366; font-weight: bold;">var</span> sbDim=<span style="color:#800000;">18</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: #003366; font-weight: bold;">var</span> Bar = <span style="color: #003366; font-weight: bold;">new</span> <span style="color: #003366; font-weight: bold;">Class</span><span style="color:#006600; font-weight:bold;">&#40;</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; initialize: <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>dir<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; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">dir</span> = dir;</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; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> dim=dir==<span style="color: #3366CC;">'v'</span> ? barDim : <span style="color:#006600; font-weight:bold;">&#40;</span>Browser.<span style="color: #006600;">Engine</span>.<span style="color: #006600;">gecko</span> ? barDim : barDim+sbDim<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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">holder</span>=<span style="color: #003366; font-weight: bold;">new</span> Element<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'div'</span>, <span style="color:#006600; font-weight:bold;">&#123;</span>styles:<span style="color:#006600; font-weight:bold;">&#123;</span>width:dir==<span style="color: #3366CC;">'h'</span> ? dim : sbDim, height:dir==<span style="color: #3366CC;">'h'</span> ? sbDim : dim, overflow:<span style="color: #3366CC;">'auto'</span>, float:<span style="color: #3366CC;">'left'</span><span style="color:#006600; font-weight:bold;">&#125;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">content</span>=<span style="color: #003366; font-weight: bold;">new</span> Element<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'div'</span>, <span style="color:#006600; font-weight:bold;">&#123;</span>html:<span style="color: #3366CC;">'&amp;nbsp;'</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">activate</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span>, <span style="color: #003366; font-weight: bold;">true</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">holder</span>.<span style="color: #006600;">adopt</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">content</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; &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; &nbsp; &nbsp; activate:<span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>b, now<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; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> side=<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">dir</span>==<span style="color: #3366CC;">'h'</span> ? <span style="color: #3366CC;">'width'</span> : <span style="color: #3366CC;">'height'</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; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>now<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">content</span>.<span style="color: #006600;">setStyle</span><span style="color:#006600; font-weight:bold;">&#40;</span>side, b ? barDim+sbDim : barDim/<span style="color:#800000;">2</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">content</span>.<span style="color: #006600;">tween</span><span style="color:#006600; font-weight:bold;">&#40;</span>side, b ? barDim*<span style="color:#800000;">2</span> : barDim/<span style="color:#800000;">2</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; &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; getElement:<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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">holder</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:#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:#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;"><span style="color: #003366; font-weight: bold;">var</span> HBar = <span style="color: #003366; font-weight: bold;">new</span> <span style="color: #003366; font-weight: bold;">Class</span><span style="color:#006600; font-weight:bold;">&#40;</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: #003366; font-weight: bold;">Extends</span>: Bar,</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; initialize: <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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">parent</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'h'</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">holder</span>.<span style="color: #006600;">setStyles</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color: #3366CC;">'margin-left'</span>: sbDim, <span style="color: #3366CC;">'margin-right'</span>: sbDim<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; &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;"><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: #003366; font-weight: bold;">var</span> VBar = <span style="color: #003366; font-weight: bold;">new</span> <span style="color: #003366; font-weight: bold;">Class</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; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">Extends</span>: Bar,</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; initialize: <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-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; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">parent</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'v'</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; &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; pushRight:<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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">holder</span>.<span style="color: #006600;">setStyle</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'margin-left'</span>, barDim<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; &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;"><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;"><span style="color: #003366; font-weight: bold;">var</span> Digit=<span style="color: #003366; font-weight: bold;">new</span> <span style="color: #003366; font-weight: bold;">Class</span><span style="color:#006600; font-weight:bold;">&#40;</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; initialize: <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-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; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> holder=<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">holder</span>=<span style="color: #003366; font-weight: bold;">new</span> Element<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'div'</span>, <span style="color:#006600; font-weight:bold;">&#123;</span>styles:<span style="color:#006600; font-weight:bold;">&#123;</span>width: barDim+<span style="color:#800000;">2</span>*sbDim, float:<span style="color: #3366CC;">'left'</span>, <span style="color: #3366CC;">'margin-right'</span>:<span style="color:#800000;">20</span><span style="color:#006600; font-weight:bold;">&#125;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">bars</span>=<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color: #003366; font-weight: bold;">new</span> HBar<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color: #003366; font-weight: bold;">new</span> VBar<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color: #003366; font-weight: bold;">new</span> VBar<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color: #003366; font-weight: bold;">new</span> HBar<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color: #003366; font-weight: bold;">new</span> VBar<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color: #003366; font-weight: bold;">new</span> VBar<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color: #003366; font-weight: bold;">new</span> HBar<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;">&#93;</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; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">bars</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color: #006600;">pushRight</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">bars</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;">5</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color: #006600;">pushRight</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">bars</span>.<span style="color: #006600;">each</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>it<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>holder.<span style="color: #006600;">adopt</span><span style="color:#006600; font-weight:bold;">&#40;</span>it.<span style="color: #006600;">getElement</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;">&#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-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">lights</span>=<span style="color:#006600; font-weight:bold;">&#91;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;">1</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">0</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<span style="color: #009900; font-style: italic;">//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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;">0</span>, <span style="color:#800000;">0</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">0</span>, <span style="color:#800000;">0</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<span style="color: #009900; font-style: italic;">//1</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;">1</span>, <span style="color:#800000;">0</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">0</span>, <span style="color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<span style="color: #009900; font-style: italic;">//2</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;">1</span>, <span style="color:#800000;">0</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">0</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<span style="color: #009900; font-style: italic;">//3</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;">0</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">0</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<span style="color: #009900; font-style: italic;">//4</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;">1</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">0</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">0</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<span style="color: #009900; font-style: italic;">//5</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;">1</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">0</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<span style="color: #009900; font-style: italic;">//6</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;">1</span>, <span style="color:#800000;">0</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">0</span>, <span style="color:#800000;">0</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<span style="color: #009900; font-style: italic;">//7</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;">1</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<span style="color: #009900; font-style: italic;">//8</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;">1</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">0</span>, <span style="color:#800000;">1</span>, <span style="color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color: #009900; font-style: italic;">//9</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; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#93;</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:#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; show: <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>n<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; &nbsp; &nbsp; &nbsp; &nbsp; n=Math.<span style="color: #006600;">floor</span><span style="color:#006600; font-weight:bold;">&#40;</span>n<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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; n=n%<span style="color:#800000;">10</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; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> light=<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">lights</span><span style="color:#006600; font-weight:bold;">&#91;</span>n<span style="color:#006600; font-weight:bold;">&#93;</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; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">bars</span>.<span style="color: #006600;">each</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>it, index<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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; it.<span style="color: #006600;">activate</span><span style="color:#006600; font-weight:bold;">&#40;</span>light<span style="color:#006600; font-weight:bold;">&#91;</span>index<span style="color:#006600; font-weight:bold;">&#93;</span>==<span style="color:#800000;">1</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; &nbsp; &nbsp; &nbsp; &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;">&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; pushRight:<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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">holder</span>.<span style="color: #006600;">setStyle</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'margin-left'</span>, <span style="color: #3366CC;">'50px'</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; &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; &nbsp; &nbsp; getElement:<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-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; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">holder</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:#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><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>
</ol>
</div>
</div>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ajaxian?a=0u2qh0fdHiM:ls7hLpZjy7o:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=0u2qh0fdHiM:ls7hLpZjy7o:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=0u2qh0fdHiM:ls7hLpZjy7o:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ajaxian?i=0u2qh0fdHiM:ls7hLpZjy7o:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/friday-fun-scroll-clock/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://ajaxian.com/archives/friday-fun-scroll-clock</feedburner:origLink></item>
		<item>
		<title>Full Frontal ‘09: Robert Nyman on the Javascript Language</title>
		<link>http://feedproxy.google.com/~r/ajaxian/~3/yk8fNtNzIAc/full-frontal-09-robert-nyman-on-the-javascript-language</link>
		<comments>http://ajaxian.com/archives/full-frontal-09-robert-nyman-on-the-javascript-language#comments</comments>
		<pubDate>Fri, 20 Nov 2009 12:06:32 +0000</pubDate>
		<dc:creator>Michael Mahemoff</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Presentation]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7964</guid>
		<description><![CDATA[Robert Nyman walks through some of the more subtle low-level features of Javascript, and some of the idioms that have emerged.
Comparisons: Understanding identity (===) versus equality (==).
Boolean expressions: Understanding how short-circuit logic (if a &#038;&#038; b won't eval b if a is false);
Types: Type coercion ("1"+2+3); "falsey" (false, null, 0) versus "truthy"; the importance of [...]]]></description>
			<content:encoded><![CDATA[<p>Robert Nyman walks through some of the more subtle low-level features of Javascript, and some of the idioms that have emerged.</p>
<p>Comparisons: Understanding identity (===) versus equality (==).</p>
<p>Boolean expressions: Understanding how short-circuit logic (<tt>if a &#038;& b</tt> won't eval b if a is false);</p>
<p>Types: Type coercion ("1"+2+3); "falsey" (false, null, 0) versus "truthy"; the importance of using operators like parseInt and instanceof.</p>
<p>Functions: Anonymous functions; self-invoking functions - <tt>function() { })()</tt> ; using the <tt>arguments</tt> collection to get all arguments to the current function, important to note it's not a real array with all the array methods, and using arguments to overload arguments.</p>
<p>Objects: Using object literal notation { a:b, c:d } instead of setting up properties individually; equivalence of <tt>ben.arms</tt> and <tt>ben["arms"]</tt>, and how useful it can be to use the latter in conjunction with a function  argument, ie let the caller pass in a variable which will be set; using "in" to check if a property exists (<tt>if "arms" in ben</tt>).</p>
<p>Inheritance: Using the prototype chain for inheritance from subclass to superclasses up to Object. There are various implementations - e.g. Resig, Edward's Base, Dan Webb; if you understand these implementations, then you understand Javascript. However, Robert's arguing for the native way of doing it - as Doug Crockford says, "I now see my early attempts to support the classical model in Javascript as a mistake".</p>
<p>Global scope: Avoid using global scope where you can. For example, nesting functions. R<br />
obert later points to <a href="http://yuiblog.com/blog/2007/06/12/module-pattern/">the Yahoo! module pattern</a>.</p>
<p>Binding <tt>this</tt>: Using <tt>call</tt> and <tt>apply</tt>; these are useful for setting <tt>this</tt> and also can pass arguments through from the current function to another one without having to manually copy them out.</p>
<p>Sugaring: Adding syntax sugar, e.g. extending String.prototype.</p>
<p>Currying: As illustrated by Doug Crockford's <tt>curry</tt> implementation.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ajaxian?a=yk8fNtNzIAc:p9CXlPKmIiw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=yk8fNtNzIAc:p9CXlPKmIiw:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=yk8fNtNzIAc:p9CXlPKmIiw:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ajaxian?i=yk8fNtNzIAc:p9CXlPKmIiw:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/full-frontal-09-robert-nyman-on-the-javascript-language/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://ajaxian.com/archives/full-frontal-09-robert-nyman-on-the-javascript-language</feedburner:origLink></item>
		<item>
		<title>Full Frontal ‘09: Chris Heilmann on Javascript Security</title>
		<link>http://feedproxy.google.com/~r/ajaxian/~3/NppMhl0nNao/full-frontal-09-chris-heilmann-on-javascript-security</link>
		<comments>http://ajaxian.com/archives/full-frontal-09-chris-heilmann-on-javascript-security#comments</comments>
		<pubDate>Fri, 20 Nov 2009 11:00:15 +0000</pubDate>
		<dc:creator>Michael Mahemoff</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7959</guid>
		<description><![CDATA[It's another Javascript conference! Full Frontal has kicked off in Brighton this morning (fullfrontal09 on twitter). First up is Ajaxian and Yahoo Chris Heilmann on Javascript security. The main theme is let's use Javascript sensibly and don't just blame the language when other things are creating the risks too.
Chris walks us through the history of [...]]]></description>
			<content:encoded><![CDATA[<p>It's another Javascript conference! <a href="http://2009.full-frontal.org/">Full Frontal</a> has kicked off in Brighton this morning (<a href="http://twitter.com/#search?q=fullfrontal09">fullfrontal09 on twitter</a>). First up is Ajaxian and Yahoo Chris Heilmann on Javascript security. The main theme is let's use Javascript sensibly and don't just blame the language when other things are creating the risks too.</p>
<p>Chris walks us through the history of javascript. The days of building complex systems with document.write() are over thankfully, though some people still think that's what it's all about. Having annoyed people with all the js bling, Ajax came around and suddenly javascript is seen as a tool for useful stuff. But...a little too much Ajax perhaps? People using it where it didn't need to be and how it shouldn't be used, hence the security fears.</p>
<p>According to a pie chart Chris presents, browser problems are responsible for only 8% of vilnerabilties; the biggest problems are SQL injection and XSS, where the server should be locking down.</p>
<p>Don't judge the language by its implementation. it does have intrinsic issues like global variables, but the right implementation can keep things secure. As well as poor practice, the browsers bear responsibility. And the cool kids - safari and firefox - are the most vulnerable according to this survey. And it gets a lot worse when you start playing with browser extensions.</p>
<p>So do we turn javascript off? No, the experience of google maps etc is just too good. We don't have to learn just by "View Source" anymore. There are plenty of resources out there to learn how to do it and how to do it properly (not just with a magic code-gen tool). Use javascript for the right things, not all things. e.g. Slicker UI, data validation warnings, UI controls not native to HTML, visual effects not native to CSS.</p>
<p>What if you're sharing content from third parties, as the yahoo homepage now allows? Caja is presently the only way to do sandboxing in the browser. It doesn't output pretty code right now, but it does cut out many risks. Caja prohibits eval(), iframes, * and _ hacks, an many other dangerous features. The latest YUI is caja-compliant code, and Chris reports John Resig is open to the same thing for jQuery, if it turns out there is demand out there.</p>
<p>Chris presents various examples of Javascript outside the browser - Air, web widgets, server side, even TV sets. It's a very useful tool here, and shows it doesn't have to be limited to the browser and the security risks that come with browsers.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ajaxian?a=NppMhl0nNao:uE11Yf1gfTA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=NppMhl0nNao:uE11Yf1gfTA:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=NppMhl0nNao:uE11Yf1gfTA:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ajaxian?i=NppMhl0nNao:uE11Yf1gfTA:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/full-frontal-09-chris-heilmann-on-javascript-security/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://ajaxian.com/archives/full-frontal-09-chris-heilmann-on-javascript-security</feedburner:origLink></item>
		<item>
		<title>NGiNX HTTP Push Module</title>
		<link>http://feedproxy.google.com/~r/ajaxian/~3/PgnJwm8Socg/nginx-http-push-module</link>
		<comments>http://ajaxian.com/archives/nginx-http-push-module#comments</comments>
		<pubDate>Thu, 19 Nov 2009 11:15:48 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Comet]]></category>
		<category><![CDATA[Front Page]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7938</guid>
		<description><![CDATA[
Even PHP developers can write web applications that use all sorts of fancy long-polling.

That is what Leo said about his NGiNX HTTP push module:

This module turns Nginx into an adept HTTP Push and Comet server. It takes care of all the connection juggling, and exposes a simple interface to broadcast messages to clients via plain [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>
Even PHP developers can write web applications that use all sorts of fancy long-polling.
</p></blockquote>
<p>That is what Leo said about his <a href="http://pushmodule.slact.net/">NGiNX HTTP push module</a>:</p>
<blockquote><p>
This module turns Nginx into an adept HTTP Push and Comet server. It takes care of all the connection juggling, and exposes a simple interface to broadcast messages to clients via plain old HTTP requests. This lets you write live-updating asynchronous web applications as easily as their old-school classic counterparts, since your code does not need to manage requests with delayed responses.</p>
<p>NHPM fully implements the Basic HTTP Push Relay Protocol, a no-frills publisher/subscriber protocol centered on uniquely identifiable channels. It it an order of magnitude simpler and more basic than similar protocols (such as Bayeux). However, this basic functionality together with the flexibility of the server configuration make it possible to reformulate most HTTP Push use cases in Basic HTTP Push Relay Protocol language with very little application- and client-side programming overhead.
</p></blockquote>
<p>Configure NGiNX and write some <a href="http://pushmodule.slact.net/js/dumbchat.js">code to talk to it</a>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ajaxian?a=PgnJwm8Socg:W6W_OUCPoXk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=PgnJwm8Socg:W6W_OUCPoXk:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=PgnJwm8Socg:W6W_OUCPoXk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ajaxian?i=PgnJwm8Socg:W6W_OUCPoXk:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/nginx-http-push-module/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://ajaxian.com/archives/nginx-http-push-module</feedburner:origLink></item>
		<item>
		<title>Vienna; Ruby in the browser again?</title>
		<link>http://feedproxy.google.com/~r/ajaxian/~3/x9ExxGp-Dx4/vienna-ruby-in-the-browser-again</link>
		<comments>http://ajaxian.com/archives/vienna-ruby-in-the-browser-again#comments</comments>
		<pubDate>Thu, 19 Nov 2009 10:17:04 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7954</guid>
		<description><![CDATA[Whether you love JavaScript or not, folks are diverse and want to use a range of languages to code the client. I have played with ruby in the browser via JRuby back in the day, and there have been lots of experiments much beyond that.
Adam Beynon just released Vienna and we were very excited to [...]]]></description>
			<content:encoded><![CDATA[<p>Whether you love JavaScript or not, folks are diverse and want to use a range of languages to code the client. I have played with ruby in the browser via JRuby back in the day, and there have been lots of experiments much beyond that.</p>
<p>Adam Beynon just released <a href="http://github.com/adambeynon/vienna">Vienna</a> and we were very excited to hear from him:</p>
<blockquote><p>
Over the last few months I have been developing a ruby compiler directly targeting Javascript, to run more advanced applications in the browser. Blocks, classes, modules, symbols etc are all included in the runtime. More specifically, the runtime is HEAVILY inspired by macruby. My aim with the project is to bring rich app development to the browser, with the open source framework. I am porting Cocoa to ruby, just as Cappuccino, and to a lesser extent Sproutcore have, by directly targeting ruby developers who wish to program for the browser. The project is still very much in experimental stage, but I think its worth a look for any ruby and cocoa developers.
</p></blockquote>
<p>It's out there, but fun. I look forward to seeing more docs and info on it.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ajaxian?a=x9ExxGp-Dx4:jP3WIAJuTLI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=x9ExxGp-Dx4:jP3WIAJuTLI:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=x9ExxGp-Dx4:jP3WIAJuTLI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ajaxian?i=x9ExxGp-Dx4:jP3WIAJuTLI:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/vienna-ruby-in-the-browser-again/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://ajaxian.com/archives/vienna-ruby-in-the-browser-again</feedburner:origLink></item>
		<item>
		<title>IE 9: Hardware rendering, new JS engine, CSS, standards, and more</title>
		<link>http://feedproxy.google.com/~r/ajaxian/~3/j9xPxrN1MAo/ie-9-hardware-rendering-new-js-engine-css-standards-and-more</link>
		<comments>http://ajaxian.com/archives/ie-9-hardware-rendering-new-js-engine-css-standards-and-more#comments</comments>
		<pubDate>Wed, 18 Nov 2009 18:20:12 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7951</guid>
		<description><![CDATA[With PDC going on, we get a glimpse at the early stage of IE 9. There is some promise, albeit with omissions!
Dean Hachamovitch, IE general manager, gives us an early look whirlwind that discusses:
Performance Progress

The JavaScript engine team members John Montgomery, Steve Lucco and Shanku Niyogi give us an early look at the new JS [...]]]></description>
			<content:encoded><![CDATA[<p>With PDC going on, we get a glimpse at the early stage of IE 9. There is some promise, albeit with omissions!</p>
<p>Dean Hachamovitch, IE general manager, gives us <a href="http://blogs.msdn.com/ie/archive/2009/11/18/an-early-look-at-ie9-for-developers.aspx">an early look whirlwind</a> that discusses:</p>
<p><b>Performance Progress</b></p>
<p><img src="http://ieblog.members.winisp.net/images/Dean_PDC_1.png"/></p>
<p>The JavaScript engine team members John Montgomery, Steve Lucco and Shanku Niyogi give us an early look at the <a href="http://channel9.msdn.com/posts/Charles/IE-9-First-look-at-the-new-JS-Engine/">new JS engine that will ship with IE 9</a>.</p>
<p><b>Standards / CSS</b></p>
<p>Although the Acid test score is low:</p>
<p><img src="http://ieblog.members.winisp.net/images/Dean_PDC_3.png"/></p>
<p>It is early days, and we do have rounded corners and CSS selectors!</p>
<p><img src="http://ieblog.members.winisp.net/images/Dean_PDC_4.png"/></p>
<p>Dean and his team <a href="http://channel9.msdn.com/posts/Charles/IE-9-Standards-and-Interoperability/">talk over the work they are doing wrt standards</a>.</p>
<p><b>Hardware acceleration</b></p>
<p>Finally, <a href="http://channel9.msdn.com/posts/Charles/IE-9-Surfing-on-the-GPU-with-D2D/">IE 9 will surf on the GPU</a> using DirectX/D2D. As well as speeding up performance all around, setting the platform up for CSS transforms etc, we also see side benefits such as nicer fonts.</p>
<p><img src="http://ajaxian.com/wp-content/images/ie9fonts.png" alt="ie9fonts" title="ie9fonts" width="553" height="302" class="alignnone size-full wp-image-7952" /></p>
<p>What else have you heard from PDC?</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ajaxian?a=j9xPxrN1MAo:D2MGsAEe-Y4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=j9xPxrN1MAo:D2MGsAEe-Y4:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=j9xPxrN1MAo:D2MGsAEe-Y4:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ajaxian?i=j9xPxrN1MAo:D2MGsAEe-Y4:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/ie-9-hardware-rendering-new-js-engine-css-standards-and-more/feed</wfw:commentRss>
		<slash:comments>40</slash:comments>
		<feedburner:origLink>http://ajaxian.com/archives/ie-9-hardware-rendering-new-js-engine-css-standards-and-more</feedburner:origLink></item>
		<item>
		<title>Simply Buttons</title>
		<link>http://feedproxy.google.com/~r/ajaxian/~3/-Fo4oEKdZHw/simply-buttons</link>
		<comments>http://ajaxian.com/archives/simply-buttons#comments</comments>
		<pubDate>Wed, 18 Nov 2009 11:38:43 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Library]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7941</guid>
		<description><![CDATA[Kevin Miller has updated his simply buttons library to use the button element. This library offers better looking and behaving buttons across all browsers. It does not need a javascript framework and is very easy to install and use.

It is all the rage to build a perfect button and you can get some nice ones [...]]]></description>
			<content:encoded><![CDATA[<p>Kevin Miller has updated his <a href="http://www.p51labs.com/simply-buttons-v2/">simply buttons library</a> to use the button element. This library offers better looking and behaving buttons across all browsers. It does not need a javascript framework and is very easy to install and use.</p>
<p><img src="http://ajaxian.com/wp-content/images/simplybuttons.png" alt="simplybuttons" title="simplybuttons" width="449" height="85" class="alignnone size-full wp-image-7942" /></p>
<p>It is all the rage to <a href="http://ajaxian.com/archives/how-many-engineers-does-it-take-to-create-a-cross-browser-button">build a perfect button</a> and you can get some nice ones via <code>SimplyButtons.init()</code></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ajaxian?a=-Fo4oEKdZHw:XiIetcajaw0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=-Fo4oEKdZHw:XiIetcajaw0:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=-Fo4oEKdZHw:XiIetcajaw0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ajaxian?i=-Fo4oEKdZHw:XiIetcajaw0:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/simply-buttons/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		<feedburner:origLink>http://ajaxian.com/archives/simply-buttons</feedburner:origLink></item>
		<item>
		<title>Resource Packages; Making a faster Web via packaging</title>
		<link>http://feedproxy.google.com/~r/ajaxian/~3/JjU6019rSsc/resource-packages-making-a-faster-web-via-packaging</link>
		<comments>http://ajaxian.com/archives/resource-packages-making-a-faster-web-via-packaging#comments</comments>
		<pubDate>Tue, 17 Nov 2009 11:23:55 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7948</guid>
		<description><![CDATA[PLAIN TEXT
HTML:




&#160;


&#60;link rel="resource-package" href="site-resources.zip" /&#62;


&#160;





What if we could agree on a simple backwards compatible approach to packaging Web resources so the browser could suck down the puppies in one go?
Alexander Limi (of Plone and Firefox UX fame) has been thinking about this for awhile, and has gotten his latest proposal out there which defines a [...]]]></description>
			<content:encoded><![CDATA[<div class="igBar"><a href="javascript:showCodeTxt('html-24');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">HTML:</span>
<div id="html-24">
<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/link.html"><span style="color: #000000; font-weight: bold;">&lt;link</span></a> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">"resource-package"</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">"site-resources.zip"</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;</div>
</li>
</ol>
</div>
</div>
</div>
<p>What if we could agree on a simple backwards compatible approach to packaging Web resources so the browser could suck down the puppies in one go?</p>
<p>Alexander Limi (of Plone and Firefox UX fame) has been thinking about this for awhile, and has <a href="http://limi.net/articles/resource-packages/">gotten his latest proposal out there</a> which defines a simple way to package things.</p>
<p>It builds on existing tech: zip, manifests, and the like.... and degrades nicely.</p>
<p>This is so much nicer than spriting hacks, but does have its own issues:</p>
<ul>
<li>In theory the browser could sometimes render faster by grabbing items in parallel
</li>
<li>Mobile caches may be messed up (as larger than a cache size, like say iPhone's 256k)
</li>
<li>What if the zip gets out of date with the other resources?
</li>
<li>Ideally tools (and in fact even web server modules) would auto generate this stuff
</li>
</ul>
<p>Although not perfect, for the majority case this could be a real boon to performance. What do you say <a href="http://twitter.com/souders">Steve</a>?</p>
<p>Oh, and it sounds like Firefox will implement this in 3.7!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ajaxian?a=JjU6019rSsc:91FR_9z3_8c:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=JjU6019rSsc:91FR_9z3_8c:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=JjU6019rSsc:91FR_9z3_8c:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ajaxian?i=JjU6019rSsc:91FR_9z3_8c:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/resource-packages-making-a-faster-web-via-packaging/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		<feedburner:origLink>http://ajaxian.com/archives/resource-packages-making-a-faster-web-via-packaging</feedburner:origLink></item>
		<item>
		<title>Persevere comes to a 1.0 release</title>
		<link>http://feedproxy.google.com/~r/ajaxian/~3/ryr6JJR1M3U/persevere-comes-to-a-1-0-release</link>
		<comments>http://ajaxian.com/archives/persevere-comes-to-a-1-0-release#comments</comments>
		<pubDate>Mon, 16 Nov 2009 11:53:53 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7929</guid>
		<description><![CDATA[Ah the magical 1.0 release. It can feel so illusive :)
Kris Zyp has announced the 1.0 of his Persevere uber-server:

Persevere is JavaScript storage and application server that uses standards-based interface of HTTP/REST, JSON-RPC, JSONPath, and REST Channels. Persevere is designed for rich clients application and can be used with any framework or client. The Persevere [...]]]></description>
			<content:encoded><![CDATA[<p>Ah the magical 1.0 release. It can feel so illusive :)</p>
<p>Kris Zyp has <a href="http://www.sitepen.com/blog/2009/11/13/persevere-1-0/">announced the 1.0 of his Persevere uber-server</a>:</p>
<blockquote><p>
<a href="http://www.persvr.org/">Persevere</a> is JavaScript storage and application server that uses standards-based interface of HTTP/REST, JSON-RPC, JSONPath, and REST Channels. Persevere is designed for rich clients application and can be used with any framework or client. The Persevere Server runs on Rhino and provides persistent data storage of dynamic JSON data in an interactive server side JavaScript environment
</p></blockquote>
<p>No sooner than it is released than we hear about the next generation version that goes behind Rhino at the low level:</p>
<blockquote><p>
With Persevere 1.0 finished, we are already working on the next version which will be based on the new Pintura architecture. <a href="http://github.com/kriszyp/pintura">Pintura</a> is the new JavaScript core for the Persevere HTTP interface that is based on the CommonJS and JSGI API. Pintura will run on any CommonJS/JSGI capable JavaScript engine (support for V8, JSCore, and Spidermonkey coming).
</p></blockquote>
<p>Learn more:</p>
<ul>
<li><a href="http://docs.persvr.org/">Persevere Documentation</a></li>
<li><a href="http://code.google.com/p/persevere-framework/">Download Persevere</a></li>
<li><a href="http://www.sitepen.com/support">SitePen Persevere Support</a></li>
<li><a href="http://www.sitepen.com/blog/category/persevere/">SitePen Persevere Blog</a></li>
<li><a href="http://www.sitepen.com/blog/2008/07/23/getting-started-with-persevere-using-dojo/">Getting Started with Persevere Using Dojo</a></li>
<li><a href="http://groups.google.com/group/persevere-framework" _blank="">Persevere Mailing List</a></li>
<li><a href="http://www.persvr.org/examples/customer.html" target="_blank">Persevere + Dojo (using Comet) demonstration</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ajaxian?a=ryr6JJR1M3U:knpTpK2wHx0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=ryr6JJR1M3U:knpTpK2wHx0:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=ryr6JJR1M3U:knpTpK2wHx0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ajaxian?i=ryr6JJR1M3U:knpTpK2wHx0:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/persevere-comes-to-a-1-0-release/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://ajaxian.com/archives/persevere-comes-to-a-1-0-release</feedburner:origLink></item>
		<item>
		<title>280Atlas: Paid Beta Available</title>
		<link>http://feedproxy.google.com/~r/ajaxian/~3/IQ2EzKK7b2M/280atlas-paid-beta-available</link>
		<comments>http://ajaxian.com/archives/280atlas-paid-beta-available#comments</comments>
		<pubDate>Mon, 16 Nov 2009 06:19:49 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Cappuccino]]></category>
		<category><![CDATA[Front Page]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7944</guid>
		<description><![CDATA[
The long awaited 280Atlas keeps marching on to its full release. The milestone that the awesome 280North team have accomplished this weekend was paid beta.
The tool is Mac only right now and the team interestingly created their own framework for taking a Web app and making it run on the desktop. Note the scrollbars and [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://ajaxian.com/wp-content/images/atlasbetaview.png" alt="atlasbetaview" title="atlasbetaview" width="500" height="339" class="alignnone size-full wp-image-7945" /></p>
<p>The long awaited <a href="http://280atlas.com/">280Atlas</a> keeps marching on to its full release. The milestone that the awesome <a href="http://280north.com/">280North</a> team have accomplished this weekend was <a href="https://atlas-beta.heroku.com/users/new">paid beta</a>.</p>
<p>The tool is Mac only right now and the team interestingly created their own framework for taking a Web app and making it run on the desktop. Note the scrollbars and feel of the application when you run it. Tom talks about the architecture on the beta blog:</p>
<blockquote><p>
At first glance Atlas appears to be a typical desktop application. However, under the hood it’s actually a Cappuccino application. This article talks a little bit about how and why we took this approach.</p>
<p>When we set out to build Atlas, using Cappuccino to create a web application was the obvious choice. However, most developers prefer to work with files on their local filesystem for many good reasons, including convenience, security, and offline access.</p>
<p>We considered a number of solutions, including syncing with the local filesystem or integrating with source control, but packaging the Atlas application as a downloadable desktop app was the easiest solution for everyone.</p>
<p>So how does it work? Atlas functions remarkably like a typical Cappuccino web application.</p>
<p>Instead of a web browser Atlas uses a custom (though generic) native application built around WebKit to bridge to Cappuccino. The application handles things like creating native windows instead of the “inner” windows you see when loading a Cappuccino application in a normal web browser, and using the native menu bar.</p>
<p>Atlas spawns a small web server, which serves the Atlas application, Objective-J and Cappuccino, and other static resources, as well as an application server to handle backend functionality, such as reading and writing to the filesystem.</p>
<p>The “backend” (actually running on user’s computer) is built on <a href="http://narwhaljs.org/">Narwhal</a>, a general purpose JavaScript platform, which implements the <a href="http://commonjs.org/">CommonJS</a> standard APIs. Narwhal provides an environment to run JavaScript (and Objective-J, of course) outside the browser, in our case as part of a desktop application.</p>
<p>On top of Narwhal we have <a href="http://jackjs.org/">Jack</a>, a web application platform modeled after Ruby’s Rack. Jack implements the JSGI portion of the CommonJS specification, and a lot more. To handle communication with the filesystem we use a Jack-based WebDAV server, called <a href="http://github.com/tlrobinson/jack-dav">JackDAV</a>. Atlas uses Cappuccino’s CPWebDAVManager class to talk to JackDAV.
</p></blockquote>
<p>Congrats to the entire 280 North team. They are all fantastic blokes and I wish them great success as they help Web developers with great and fun tools.</p>
<p><img src="http://ajaxian.com/wp-content/images/atlasbetacode.png" alt="atlasbetacode" title="atlasbetacode" width="500" height="353" class="alignnone size-full wp-image-7946" /></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ajaxian?a=IQ2EzKK7b2M:Ne1Co-1ksJw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=IQ2EzKK7b2M:Ne1Co-1ksJw:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=IQ2EzKK7b2M:Ne1Co-1ksJw:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ajaxian?i=IQ2EzKK7b2M:Ne1Co-1ksJw:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/280atlas-paid-beta-available/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://ajaxian.com/archives/280atlas-paid-beta-available</feedburner:origLink></item>
		<item>
		<title>Javascript Inheritance Patterns: Learning from Closure</title>
		<link>http://feedproxy.google.com/~r/ajaxian/~3/GFoFV_mAuhQ/javascript-inheritance-patterns-learning-from-closure</link>
		<comments>http://ajaxian.com/archives/javascript-inheritance-patterns-learning-from-closure#comments</comments>
		<pubDate>Fri, 13 Nov 2009 22:04:01 +0000</pubDate>
		<dc:creator>Michael Mahemoff</dc:creator>
				<category><![CDATA[Closure]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7928</guid>
		<description><![CDATA[The library portion of Google's Closure not only gives us a new API to work with, but also adds another piece of mature code to the public domain, where it can be studied and scrutinized. Something we might normally have done with View Source if not for the compression techniques in effect.
A new article by [...]]]></description>
			<content:encoded><![CDATA[<p>The library portion of Google's <a href="http://code.google.com/closure/">Closure</a> not only gives us a new API to work with, but also adds another piece of mature code to the public domain, where it can be <a href="http://webreflection.blogspot.com/2009/11/google-closure-im-not-impressed.html">studied</a> and <a href="http://www.sitepoint.com/blogs/2009/11/12/google-closure-how-not-to-write-javascript/#">scrutinized</a>. Something we might normally have done with View Source if not for the compression techniques in effect.</p>
<p>A new article by Michael Bolin looks at <a href="http://bolinfest.com/javascript/inheritance.php">inheritance patterns in Javascript</a>, with a special focus on Closure. He does a thorough job of weighing up Closure's use of the pseudoclassical inheritance pattern against what Doug Crockford labels the functional pattern.</p>
<p>Pseudoclassical inheritance (Closure):</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-27');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-27">
<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;">/**</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;"> * @param {string} phoneNumber</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; font-style: italic;"> * @param {string=} signature</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;"> * @constructor</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; font-style: italic;"> * @extends {Phone}</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;"> */</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="color:#000000; font-family: 'Courier New', Courier, monospace; font-weight: normal;">SmartPhone = <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>phoneNumber, signature<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; Phone.<span style="color: #006600;">call</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>, phoneNumber<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: #009900; font-style: italic;">/**</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; font-style: italic;">&nbsp; &nbsp;* @type {string}</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;">&nbsp; &nbsp;* @private</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; font-style: italic;">&nbsp; &nbsp;*/</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: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">signature_</span> = signature || <span style="color: #3366CC;">'sent from '</span> + <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">getPhoneNumber</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;"><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;">goog.<span style="color: #006600;">inherits</span><span style="color:#006600; font-weight:bold;">&#40;</span>SmartPhone, Phone<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;"><span style="color: #009900; font-style: italic;">/**</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; font-style: italic;"> * @param {string} emailAddress</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;"> * @param {string} message</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; font-style: italic;"> */</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;">SmartPhone.<span style="color: #006600;">prototype</span>.<span style="color: #006600;">sendEmail</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>emailAddress, 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; <span style="color: #009900; font-style: italic;">// Assume sendMessage() is globally available.</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; sendMessage<span style="color:#006600; font-weight:bold;">&#40;</span>emailAddress, message + <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span> + <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">signature_</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>;</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; font-style: italic;">/** @override */</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;">SmartPhone.<span style="color: #006600;">prototype</span>.<span style="color: #006600;">getDescription</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</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; <span style="color: #000066; font-weight: bold;">return</span> SmartPhone.<span style="color: #006600;">superClass_</span>.<span style="color: #006600;">getDescription</span>.<span style="color: #006600;">call</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000066; font-weight: bold;">this</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; <span style="color: #3366CC;">' It can also send email messages.'</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>;</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;">var</span> smartPhone = <span style="color: #003366; font-weight: bold;">new</span> SmartPhone<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'5555555'</span>, <span style="color: #3366CC;">'Adios'</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;</div>
</li>
</ol>
</div>
</div>
</div>
<p>Functional inheritance:</p>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-28');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-28">
<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;">var</span> smartPhone = <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>spec<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> that = phone<span style="color:#006600; font-weight:bold;">&#40;</span>spec<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; spec.<span style="color: #006600;">signature</span> = spec.<span style="color: #006600;">signature</span> || <span style="color: #3366CC;">"sent from "</span> + that.<span style="color: #006600;">getPhoneNumber</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; that.<span style="color: #006600;">sendEmail</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color:#006600; font-weight:bold;">&#40;</span>emailAddress, 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;">// Assume sendMessage() is globally available.</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; sendMessage<span style="color:#006600; font-weight:bold;">&#40;</span>emailAddress, message + <span style="color: #3366CC;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span> + spec.<span style="color: #006600;">signature</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; <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: #003366; font-weight: bold;">var</span> super_getDescription = that.<span style="color: #006600;">superior</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">"getDescription"</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; that.<span style="color: #006600;">getDescription</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-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> super_getDescription<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> + <span style="color: #3366CC;">" It can also send email messages."</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>;</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: #000066; font-weight: bold;">return</span> that;</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;">var</span> mySmartPhone = smartPhone<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color: #3366CC;">"phoneNumber"</span>: <span style="color: #3366CC;">"5555555"</span>, <span style="color: #3366CC;">"signature"</span>: <span style="color: #3366CC;">"Adios"</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>
</ol>
</div>
</div>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ajaxian?a=GFoFV_mAuhQ:-ovu_IdEH50:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=GFoFV_mAuhQ:-ovu_IdEH50:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=GFoFV_mAuhQ:-ovu_IdEH50:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ajaxian?i=GFoFV_mAuhQ:-ovu_IdEH50:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/javascript-inheritance-patterns-learning-from-closure/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://ajaxian.com/archives/javascript-inheritance-patterns-learning-from-closure</feedburner:origLink></item>
		<item>
		<title>Lunascape Orion: Cross browser extensions</title>
		<link>http://feedproxy.google.com/~r/ajaxian/~3/HZy-MCqqadg/lunascape-orion</link>
		<comments>http://ajaxian.com/archives/lunascape-orion#comments</comments>
		<pubDate>Fri, 13 Nov 2009 11:37:46 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Front Page]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7924</guid>
		<description><![CDATA[
Lunascape 6.0 Orion is the latest version of the "triple engine" browser that lets you select between Gecko, WebKit, and Trident on Windows:

The latest version supports Firefox Add-ons as well as IE plugins, and they are quite bullish on their performance:

]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.lunascape.tv/Lunascape6b/images/6b_img_browser.png" style="float:right; padding:8px"/></p>
<p><a href="http://www.lunascape.tv/Lunascape6b/">Lunascape 6.0 Orion</a> is the latest version of the "triple engine" browser that lets you select between Gecko, WebKit, and Trident on Windows:</p>
<p><img src="http://www.lunascape.tv/Lunascape6b/images/6a_img_cp03.png"/></p>
<p>The latest version supports Firefox Add-ons as well as IE plugins, and they are quite bullish on their performance:</p>
<p><img src="http://www.lunascape.tv/Lunascape6b/images/6a_img_cp05.png"/></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ajaxian?a=HZy-MCqqadg:XyV7rkhDkQI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=HZy-MCqqadg:XyV7rkhDkQI:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=HZy-MCqqadg:XyV7rkhDkQI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ajaxian?i=HZy-MCqqadg:XyV7rkhDkQI:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/lunascape-orion/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		<feedburner:origLink>http://ajaxian.com/archives/lunascape-orion</feedburner:origLink></item>
		<item>
		<title>SPDY: Make HTTP chatter a lot faster</title>
		<link>http://feedproxy.google.com/~r/ajaxian/~3/1xAiPCwQk9s/spdy-make-http-chatter-a-lot-faster</link>
		<comments>http://ajaxian.com/archives/spdy-make-http-chatter-a-lot-faster#comments</comments>
		<pubDate>Thu, 12 Nov 2009 18:54:36 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7922</guid>
		<description><![CDATA[Mike Belshe of Google has been working on SPDY an optimized use of HTTP:

 It is designed specifically for minimizing latency through features such as multiplexed streams, request prioritization and HTTP header compression.
We started working on SPDY while exploring ways to optimize the way browsers and servers communicate. Today, web clients and servers speak HTTP. [...]]]></description>
			<content:encoded><![CDATA[<p>Mike Belshe of Google has been working on <a href="http://blog.chromium.org/2009/11/2x-faster-web.html">SPDY</a> an optimized use of HTTP:</p>
<blockquote><p>
 It is designed specifically for minimizing latency through features such as multiplexed streams, request prioritization and HTTP header compression.</p>
<p>We started working on SPDY while exploring ways to optimize the way browsers and servers communicate. Today, web clients and servers speak HTTP. HTTP is an elegantly simple protocol that emerged as a web standard in 1996 after a series of experiments. HTTP has served the web incredibly well. We want to continue building on the web's tradition of experimentation and optimization, to further support the evolution of websites and browsers. So over the last few months, a few of us here at Google have been experimenting with new ways for web browsers and servers to speak to each other, resulting in a prototype web server and Google Chrome client with SPDY support.</p>
<p>So far we have only tested SPDY in lab conditions. The initial results are very encouraging: when we download the top 25 websites over simulated home network connections, we see a significant improvement in performance - pages loaded up to 55% faster. There is still a lot of work we need to do to evaluate the performance of SPDY in real-world conditions. However, we believe that we have reached the stage where our small team could benefit from the active participation, feedback and assistance of the web community.
</p></blockquote>
<p>It is great to see this in the wild. We have seen delta compression from Google before (used in Google Toolbar but not talked about too much) but I am glad to see this getting out there early stage, which gives all browsers/servers a chance to participate and play.</p>
<p>However, I have an issue with <a href="http://src.chromium.org/viewvc/chrome/trunk/src/net/flip/">one line of code....</a> ;)</p>
<p>Great write-ups here:</p>
<ul>
<li>Alex Russell: <a href="http://alex.dojotoolkit.org/2009/11/spdy-the-web-only-faster/">SPDY: The Web, Only Faster</a>
</li>
<li>Mark Nottingham: <a href="http://www.mnot.net/blog/2009/11/13/flip">Will HTTP/2.0 Happen After All?</a>
</li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ajaxian?a=1xAiPCwQk9s:ddGQ5h7Zfkk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=1xAiPCwQk9s:ddGQ5h7Zfkk:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=1xAiPCwQk9s:ddGQ5h7Zfkk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ajaxian?i=1xAiPCwQk9s:ddGQ5h7Zfkk:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/spdy-make-http-chatter-a-lot-faster/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://ajaxian.com/archives/spdy-make-http-chatter-a-lot-faster</feedburner:origLink></item>
		<item>
		<title>WebGL Musical Solar System</title>
		<link>http://feedproxy.google.com/~r/ajaxian/~3/-ASNGPl8O-g/webgl-musical-solar-system</link>
		<comments>http://ajaxian.com/archives/webgl-musical-solar-system#comments</comments>
		<pubDate>Thu, 12 Nov 2009 11:20:55 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7920</guid>
		<description><![CDATA[
Jacob Seidelin has brought us amazing Canvas work in the past. Now he gets into WebGL:

In my quest to get to know WebGL better, I've gradually been building my way up from the standard "paint one triangle" tests to more and more advanced things. Never having touched OpenGL before, this is all a nice learning [...]]]></description>
			<content:encoded><![CDATA[<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/XsZM7ghFbqM&#038;hl=en&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/XsZM7ghFbqM&#038;hl=en&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>Jacob Seidelin has brought us amazing Canvas work in the past. Now he <a href="http://blog.nihilogic.dk/2009/11/webgl-musical-solar-system.html">gets into WebGL</a>:</p>
<blockquote><p>
In my quest to get to know WebGL better, I've gradually been building my way up from the standard "paint one triangle" tests to more and more advanced things. Never having touched OpenGL before, this is all a nice learning experience for me and I can now render not only one but two triangles at once as well as cubes, spheres and what have you. There's been some nice progress around the web as well, most recently with Yohei Shimomae's <a href="http://blogs.nitobi.com/yohei/?p=62">Cube Defense</a>, a tower defense like game built with JavaScript and WebGL - probably the first WebGL game ever but hopefully many will follow!</p>
<p>Without further ado, here's my own first, small pet project: <a href="http://www.nihilogic.dk/labs/webgl_musical_solar_system/">A solar system of dancing planets</a>.
</p></blockquote>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ajaxian?a=-ASNGPl8O-g:bm6YUb_jlMw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=-ASNGPl8O-g:bm6YUb_jlMw:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=-ASNGPl8O-g:bm6YUb_jlMw:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ajaxian?i=-ASNGPl8O-g:bm6YUb_jlMw:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/webgl-musical-solar-system/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://ajaxian.com/archives/webgl-musical-solar-system</feedburner:origLink></item>
		<item>
		<title>Evidence; that your code will work</title>
		<link>http://feedproxy.google.com/~r/ajaxian/~3/1wicqSuQfZU/evidence-that-your-code-will-work</link>
		<comments>http://ajaxian.com/archives/evidence-that-your-code-will-work#comments</comments>
		<pubDate>Wed, 11 Nov 2009 11:53:00 +0000</pubDate>
		<dc:creator>Dion Almaer</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://ajaxian.com/?p=7901</guid>
		<description><![CDATA[Tobie Langel of Prototype fame has created another unit testing library for JavaScript. Another one I hear you say? Well, if Tobie did it.... it is worth checking out. Time to get some Evidence.
I found out about it over dinner in Berlin at the great JSConf.EU. At the table were 6 people from 6 different [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://tobielangel.com">Tobie Langel</a> of Prototype fame has created another unit testing library for JavaScript. Another one I hear you say? Well, if Tobie did it.... it is worth checking out. Time to get some <a href="http://github.com/tobie/evidence">Evidence</a>.</p>
<p>I found out about it over dinner in Berlin at the great JSConf.EU. At the table were 6 people from 6 different countries. Go JavaScript diversity :)  I first asked "BDD?" and Tobie spat out "No, I friggin hate BDD, especially for JS" before I had even finished the question.</p>
<p>Tobie gave a <a href="http://www.slideshare.net/tobielangel/unittesting-javascript-with-evidence">talk on Evidence</a> at the show, and explained the focus of the library:</p>
<ul>
<li>Library agnostic (the scripty based one in Prototype was based on Prototype which is weird when you test yourself)
</li>
<li>Environment agnostic (e.g. not just in the browser)
</li>
<li>Self contained (no global pollution)
</li>
<li>Built with async in mind (in JS / client server / anything real, you gotta do async)
</li>
<li>Easy to automate
</li>
</ul>
<div class="igBar"><a href="javascript:showCodeTxt('javascript-30');">PLAIN TEXT</a></div>
<div class="syntax_hilite"><span style="color:#000000; font-weight:bold;">JAVASCRIPT:</span>
<div id="javascript-30">
<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;">Evidence.<span style="color: #006600;">TestCase</span>.<span style="color: #006600;">extend</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'ArrayTest'</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; setUp: <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; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">array</span> = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color: #3366CC;">'foo'</span>, <span style="color: #3366CC;">'bar'</span>, <span style="color: #3366CC;">'baz'</span><span style="color:#006600; font-weight:bold;">&#93;</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; testFirst: <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; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">assertEqual</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'foo'</span>, _.<span style="color: #006600;">first</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">array</span><span style="color:#006600; font-weight:bold;">&#41;</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;">this</span>.<span style="color: #006600;">assertUndefined</span><span style="color:#006600; font-weight:bold;">&#40;</span>_.<span style="color: #006600;">first</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span><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; <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; testLast: <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-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;">this</span>.<span style="color: #006600;">assertEqual</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #3366CC;">'bar'</span>, _.<span style="color: #006600;">last</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">array</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: #3366CC;">'Failed to grab the last element of the array.'</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;">this</span>.<span style="color: #006600;">assertUndefined</span><span style="color:#006600; font-weight:bold;">&#40;</span>_.<span style="color: #006600;">last</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span><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; <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><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>
</ol>
</div>
</div>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ajaxian?a=1wicqSuQfZU:477wVcYzvDw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=1wicqSuQfZU:477wVcYzvDw:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/ajaxian?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ajaxian?a=1wicqSuQfZU:477wVcYzvDw:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/ajaxian?i=1wicqSuQfZU:477wVcYzvDw:D7DqB2pKExk" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://ajaxian.com/archives/evidence-that-your-code-will-work/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://ajaxian.com/archives/evidence-that-your-code-will-work</feedburner:origLink></item>
	</channel>
</rss>
