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

<channel>
	<title>Geeknizer &#187; Web languages</title>
	<atom:link href="http://geeknizer.com/tag/web-languages/feed/" rel="self" type="application/rss+xml" />
	<link>http://geeknizer.com</link>
	<description>iPhone, Android, mobile, Technology news</description>
	<lastBuildDate>Wed, 08 Feb 2012 16:55:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Edge &#8211; HTML5 Visual Editor</title>
		<link>http://geeknizer.com/html5-visual-editor/</link>
		<comments>http://geeknizer.com/html5-visual-editor/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 06:32:41 +0000</pubDate>
		<dc:creator>Tarandeep Singh</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Web languages]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://geeknizer.com/?p=8466</guid>
		<description><![CDATA[Flash vs HTML5 war is far from over, both are here to stay for years. But HTML 5 is getting more and more adoption and anticipation. Adobe realizes the fact... <span class="meta-more"><a href="http://geeknizer.com/html5-visual-editor/">Read more &#187;</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://geeknizer.com/what-is-html-5-and-faq-will-it-kill-flash"></a><a rel="attachment wp-att-8470" href="http://geeknizer.com/html5-visual-editor/edge-html5/"><img class="alignright size-full wp-image-8470" title="edge-html5" src="http://geeknizer.com/wp-content/uploads/2011/08/edge-html5.jpg" alt="" width="229" height="211" /></a>Flash vs HTML5 war is far from over, both are here to stay for years. But HTML 5 is getting more and more adoption and anticipation. Adobe realizes the fact and that&#8217;s after releasign a tool to <a href="http://geeknizer.com/converttranslate-flash-to-html5/">convert flash to hmtl5</a>, now the are here with program with a Visual Editor/ development tool for HTML 5 called <strong><a href="http://labs.adobe.com/technologies/edge/" target="_blank">Edge</a></strong>.</p>
<p>Edge brings a Flash-like development environment to HTML5. With timeline and direct scripting, developers can dig into HTML5 features without having to play much with the code.</p>
<p><strong>Edge </strong><strong>Features:</strong></p>
<p><strong> </strong><strong> </strong>It is a comprehensive HTML5 Visual Editor</p>
<ul>
<li>Edge provides <strong>visual drawing</strong> and <strong>text tools, image importing</strong>, and a <strong>Flash-style timeline</strong>.</li>
<li>Create animations of HTML content.</li>
</ul>
<p>Eventualy, Adobe would bring more to the platform, especially on the canvas side of things. What&#8217;s coming more is the support for <a href="http://geeknizer.com/html-5-client-storage/">local storage</a>, using which you would be able to create superb HTML5 web applications, within minutes.</p>
<p>This is the first HTML5 editor of this kind. Adobe sees the future, and won&#8217;t leave a chance of letting RIA web development go into another hands. Whatever, happens, consumers and developers are gain.</p>
<p>Watch an overview of Edge:</p>
<p>&nbsp;</p>
<p><object width="640" height="390"><param name="movie" value="http://www.youtube.com/v/neSFy1hs-G4&amp;hl=en_US&amp;feature=player_embedded&amp;version=3" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><embed type="application/x-shockwave-flash" width="640" height="390" src="http://www.youtube.com/v/neSFy1hs-G4&amp;hl=en_US&amp;feature=player_embedded&amp;version=3" allowfullscreen="true" allowscriptaccess="always"></embed></object></p>
<p>You can <a rel="nofollow" href="http://labs.adobe.com/technologies/edge/">download the Edge beta</a> right now, or just check out <a rel="nofollow" href="http://labs.adobe.com/technologies/edge/resources/">a few sample animations</a>.</p>
<p>We write latest and greatest in <a href="http://geeknizer.com/tag/guide">Tech Guides</a>, <a href="http://geeknizer.com/tag/apple">Apple</a>, <a href="http://geeknizer.com/tag/iphone">iPhone</a>, <a href="http://geeknizer.com/tag/tablet">Tablets</a>, <a href="http://geeknizer.com/tag/android">Android</a>,  <a href="http://geeknizer.com/tag/open-source">Open Source</a>, Latest in Tech, subscribe to us <a href="http://twitter.com/geeknizer"><strong>@geeknizer </strong>on Twitter</a> OR on <a href="https://www.facebook.com/geeknizer">Facebook Fanpage</a>:</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://geeknizer.com/html5-visual-editor/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Optimize HTML5, CSS3, DOM Performance [video]</title>
		<link>http://geeknizer.com/optimize-html5-css3-dom-performance/</link>
		<comments>http://geeknizer.com/optimize-html5-css3-dom-performance/#comments</comments>
		<pubDate>Sat, 23 Apr 2011 21:07:55 +0000</pubDate>
		<dc:creator>Tarandeep Singh</dc:creator>
				<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[Web languages]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[web standard]]></category>

		<guid isPermaLink="false">http://geeknizer.com/?p=7459</guid>
		<description><![CDATA[The future of web is with the modern web languages and its not hard to anticipate the adoption rate. Over the last year, 20% of the Top websites have moved... <span class="meta-more"><a href="http://geeknizer.com/optimize-html5-css3-dom-performance/">Read more &#187;</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://geeknizer.com/wp-content/uploads/html5-css3.jpg"><img class="alignright size-full wp-image-7461" title="html5-css3" src="http://geeknizer.com/wp-content/uploads/html5-css3.jpg" alt="" width="230" height="144" /></a>The future of web is with the modern web languages and its not hard to anticipate the adoption rate. Over the last year, 20% of the Top websites have moved to modern web languages such as HTML5, CSS3 and use DOM extensively for various transitions, and rendering techniques.</p>
<p>Your HTML5 webapp can be powerful enough to compete with the desktop version, but you might be limited byt eh performance advantages as your app runs in the browser, instead of native code. But good web development practices can definitely help you reach there.</p>
<p>Pau irish, a Google Employee, gets into details on how you can cut down the processing required for creating common things in Webapps: HTML5, CSS. He concentrates on CSS reflows, taking benefits of hardware aceclerated CSS, optimiations for Animations, and benchmarking techniques.</p>
<p><object style="height: 390px; width: 640px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100" height="100" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.youtube.com/v/q_O9_C2ZjoA?version=3" /><param name="allowfullscreen" value="true" /><embed style="height: 390px; width: 640px;" type="application/x-shockwave-flash" width="100" height="100" src="http://www.youtube.com/v/q_O9_C2ZjoA?version=3" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>You can also checkout the full series of Microsoft&#8217;s presentation from MIX10 about HTML5 High-Performance best practices:</p>
<p><object style="height: 390px; width: 640px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100" height="100" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.youtube.com/v/6Rz3ETB-8Ac?version=3" /><param name="allowfullscreen" value="true" /><embed style="height: 390px; width: 640px;" type="application/x-shockwave-flash" width="100" height="100" src="http://www.youtube.com/v/6Rz3ETB-8Ac?version=3" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>We write latest and greatest in <a href="http://geeknizer.com/tag/guide">Tech Guides</a>, <a href="http://geeknizer.com/tag/apple">Apple</a>, <a href="http://geeknizer.com/tag/iphone">iPhone</a>, <a href="http://geeknizer.com/tag/tablet">Tablets</a>, <a href="http://geeknizer.com/tag/android">Android</a>,  <a href="http://geeknizer.com/tag/open-source">Open Source</a>, Latest in Tech, subscribe to us<a href="http://twitter.com/taranfx">@taranfx on Twitter</a> OR on <a href="http://facebook.com/taranfx">Facebook Fanpage</a>:</p>
]]></content:encoded>
			<wfw:commentRss>http://geeknizer.com/optimize-html5-css3-dom-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE9 vs Chrome 10 vs Firefox 4 Benchmarks</title>
		<link>http://geeknizer.com/ie9-vs-chrome-10-vs-firefox-4/</link>
		<comments>http://geeknizer.com/ie9-vs-chrome-10-vs-firefox-4/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 18:08:51 +0000</pubDate>
		<dc:creator>Tarandeep Singh</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Web languages]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[firefox 4]]></category>
		<category><![CDATA[IE9]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web standard]]></category>

		<guid isPermaLink="false">http://geeknizer.com/ie9-vs-chrome-10-vs-firefox-4</guid>
		<description><![CDATA[The browser wars has always brought good stuff for us: All new set of features and significant speed improvements. And when we talk about speed, we trust Benchmarks more than... <span class="meta-more"><a href="http://geeknizer.com/ie9-vs-chrome-10-vs-firefox-4/">Read more &#187;</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://geeknizer.com/wp-content/uploads/chrome-ie-firefox1.jpg"><img class="alignleft size-full wp-image-7264" title="chrome-ie-firefox" src="http://geeknizer.com/wp-content/uploads/chrome-ie-firefox1.jpg" alt="" width="230" height="158" /></a>The browser wars has always brought good stuff for us: All new set of features and significant speed improvements. And when we talk about speed, we trust Benchmarks more than anything else. But relying a single benchmarking technique is risky, and that&#8217;s why we execute all popular <a href="http://geeknizer.com/ie9-vs-chrome-vs-firefox-vs-opera">benchmarking</a> tools before declaring a winner.</p>
<p><strong>IE9 vs Chrome 10 vs Firefox 4 Benchmark</strong></p>
<p><strong>Platform</strong>: Windows 7 32bit on a Intel i7 Macbook Pro, 4GB RAM.</p>
<p><em>We are not testing 64bit since IE9 has poor performance on 64bit as it still uses older javascript engine,</em> <span style="font-family: Verdana, sans-serif; color: #252525; line-height: 18px;"><em>while IE 9 32-bit is using the newer, more efficient</em> <a style="font-weight: inherit; font-size: 12px; font-family: inherit; vertical-align: baseline; color: #005399; cursor: pointer; text-decoration: none; padding: 0px; margin: 0px; border: 0px initial initial;" href="http://blogs.msdn.com/b/ie/archive/2010/03/18/the-new-javascript-engine-in-internet-explorer-9.aspx"><em>Chakra JIT</em></a><em>.</em></span></p>
<p><span style="font-family: Verdana, sans-serif; color: #252525; line-height: 18px;"><strong>Benchmark Results:</strong></span></p>
<p><strong>V8 Benchmark results</strong><br />
<em><img src="http://geeknizer.com/wp-content/uploads/V8-ie9-chrome10-firefox4.png" alt="V8-ie9-chrome10-firefox4.png" width="480" height="270" /></em></p>
<p><strong>Sunspider Benchmark Results:</strong></p>
<p><em><img src="http://geeknizer.com/wp-content/uploads/Sunspider-ie9-chrome10-firefox4.png" alt="Sunspider-ie9-chrome10-firefox4.png" width="480" height="278" /></em></p>
<p><strong>Kraken Benchmark Results</strong></p>
<p><em><span style="font-style: normal;"><em><img src="http://geeknizer.com/wp-content/uploads/kraken-ie9-chrome10-firefox4.png" alt="kraken-ie9-chrome10-firefox4.png" width="480" height="264" /></em></span></em></p>
<p><span style="font-style: normal;"><strong>Peacekeeper Benchmark:</strong></span></p>
<p><em><span style="font-style: normal;"><em><img src="http://geeknizer.com/wp-content/uploads/peacekeeper-ie9-chrome10-firefox4.png" alt="peacekeeper-ie9-chrome10-firefox4.png" width="480" height="264" /></em></span><br />
</em></p>
<p><em><span style="font-style: normal;"><em><br />
</em></span></em></p>
<p>Chrome 10 wins in 2 tests and Firefox 4 does in one, and IE &amp; Chrome tie in sunspider test.</p>
<p><strong>Browser Verdict</strong></p>
<p>I really don’t think that JavaScript performance is an issue any more, its fairly fast enough to be handled by users. What matters more is better support for <a href="http://people.mozilla.com/~prouget/ie9/" target="_blank">modern technologies like HTML5</a>. When it comes to the support for modern technologies, <a href="http://people.mozilla.com/~prouget/ie9/" target="_blank">Firefox &amp; Chrome beat IE9</a> out of the scene. There is a huge set of features tha IE9 needs to learn from Chrome 10 &amp; Firefox 4:</p>
<p>Application Cache (offline), Web Workers (threads in JavaScript), HTML5 Forms (validation mechanism, CSS3 selectors), JavaScript Strict Mode , ForeignObject (embed external content in SVG), SMIL Animations (SVG animations), File API, WebGL (3D), CSS3 Transitions (for animations), CSS3 Text Shadow, CSS3 Gradients, CSS3 Border Image, CSS3 Flex box model, ClassList APIs, FormData, HTML5 History API, Drag&#8217;n Drop from Desktop.</p>
<p>We write latest and greatest in <a href="http://geeknizer.com/tag/browsers">Browsers</a>: <a href="http://geeknizer.com/tag/chrome">Chrome</a>, <a href="http://geeknizer.com/tag/opera">Opera</a>, <a href="http://geeknizer.com/tag/firefox">Firefox</a>, <a href="http://geeknizer.com/tag/ie">IE</a>, and latest in Tech <a href="http://twitter.com/taranfx" target="_blank">@<strong>taranfx</strong></a><strong> </strong>and <a href="http://facebook.com/taranfx" target="_blank"><strong>Facebook</strong></a>:</p>
]]></content:encoded>
			<wfw:commentRss>http://geeknizer.com/ie9-vs-chrome-10-vs-firefox-4/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Convert/Translate Adobe Flash to HTML5 [Wallaby]</title>
		<link>http://geeknizer.com/converttranslate-flash-to-html5/</link>
		<comments>http://geeknizer.com/converttranslate-flash-to-html5/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 15:55:00 +0000</pubDate>
		<dc:creator>Tarandeep Singh</dc:creator>
				<category><![CDATA[Guide]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Web languages]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://geeknizer.com/converttranslate-flash-to-html5</guid>
		<description><![CDATA[Flash is everywhere, and we don&#8217;t expect it to be gone anytime soon. Flash vs. HTML5 is still a debate left for the critics, what we know is HTML5 is... <span class="meta-more"><a href="http://geeknizer.com/converttranslate-flash-to-html5/">Read more &#187;</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://geeknizer.com/wp-content/uploads/flash-html5.jpg"><img class="alignleft size-full wp-image-7202" title="flash-html5" src="http://geeknizer.com/wp-content/uploads/flash-html5.jpg" alt="" width="200" height="200" /></a>Flash is everywhere, and we don&#8217;t expect it to be gone anytime soon. <a href="http://geeknizer.com/what-is-html-5-and-faq-will-it-kill-flash">Flash vs. HTML5</a> is still a debate left for the critics, what we know is <a href="http://geeknizer.com/tag/html5">HTML5 </a>is an innovative technology that would change the face of the web.</p>
<p>Adobe acknowledges this value and that&#8217;s why they have launched a product called &#8220;<a href="http://labs.adobe.com/technologies/wallaby/" target="_blank">Wallaby</a>&#8221; an experimental<strong> Flash-to-HTML 5 converter tool</strong>. Wallaby is a cross-platform Adobe AIR application that allows users to instantly<strong> convert Flash output (FLA files) to HTML5</strong> via a simple drag and drop. It is available free for download.</p>
<p>Wallaby, which was first previewed last fall at <a href="http://2010.max.adobe.com/">Adobe&#8217;s Max 2010</a> developer conference, is a great tool.</p>
<p>Watch the demonstration from Adobe:</p>
<p><object style="height: 390px; width: 640px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100" height="100" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.youtube.com/v/ryZP00_KhYE?version=3" /><param name="allowfullscreen" value="true" /><embed style="height: 390px; width: 640px;" type="application/x-shockwave-flash" width="100" height="100" src="http://www.youtube.com/v/ryZP00_KhYE?version=3" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<blockquote><p>&#8220;We are making this available free on Adobe Labs as experimental technology; it&#8217;s something we hope to continue to iterate and get feedback on from customers,&#8221; said Tom Barclay, senior product manager for Flash Professional. &#8220;I&#8217;m interested in how useful this output is, what people intend to use it for, and whether this is something we should be supporting longer term in Flash Professional as another output option or publish setting.&#8221;</p></blockquote>
<p>Since apple has always banged Adobe on flash, its actually a good tool to counter all those concerns. Now all the existing Flash apps, animations/content can be run on iOS devices like iPhone, iPad and iPod Touch, without any pain.</p>
<p>However, not all elements from the Flash files will translate into HTML5. But users would get the benefit of the overall design and motion graphic animations. What will not get translated would be the dynamic part like blend modes, filters, audio, video, and even ActionScript.</p>
<p>The output from HTML5 converter tool is essentially a combination of HTML, SVG (Scalable Vector Graphics), and CSS. The tool is mart enough to translate Vector graphics into SVG &amp; bitmaps into JPEG files. Text can optionally be converted to SVG text, which is converted to plain text, otherwise. The Flash timeline is converted to a group of CSS animations. Scripting allows for batch processing of multiple FLA files.</p>
<p>To summarize:</p>
<p><strong>Supported Flash Professional features</strong>: vector art and images; classic text; keyframes; MovieClips and graphics; classic, motion, and shape tweens; rollover buttons; and instance names.</p>
<p><strong>Unsupported Flash Professional features</strong>: filters (except simple alpha); blend modes; dynamic masks; some TLF (Text Layout Framework) text; 3D transforms and 3D tween; audio and video; and ActionScript.</p>
<p>Wallaby is believed to work perfectly with Webkit based browsers: Safari, Chrome, iOS devices, Android, blacberry devices.</p>
<p>Adoobe says that by usign this tool you can get your baseline and get the animations, additional actionscript like features using Jquery in Dreamweaver.</p>
<p>In any case, this a great tool, and a great initiation from adobe which shows Adobe&#8217;s enthusiasm to develop better and richer web. Will this tool support full Flash Professional features in the future? We&#8217;ll know.</p>
<p>Related: <a title="Permanent Link to Html5 Video Player that works on All Browsers, compatible with Flash" rel="bookmark" href="http://geeknizer.com/html5-video-player-code">Html5 Video Player that works on All Browsers, compatible with Flash</a></p>
<p>We write about <a href="http://geeknizer.com/tag/open-source">Open Source</a>, <a href="http://geeknizer.com/tag/programming">Programming</a>, <a href="http://geeknizer.com/">Web</a>, <a href="http://geeknizer.com/tag/apple">Apple</a>, <a href="http://geeknizer.com/tag/iphone">iPhone</a>, <a href="http://geeknizer.com/tag/android">Android</a> and latest in Tech <a href="http://twitter.com/taranfx">@taranfxon Twitter</a> or subscribe below:</p>
]]></content:encoded>
			<wfw:commentRss>http://geeknizer.com/converttranslate-flash-to-html5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 does P2P Video/Audio/FileSharing Communications, b/w any devices</title>
		<link>http://geeknizer.com/html5-p2p-video-communications/</link>
		<comments>http://geeknizer.com/html5-p2p-video-communications/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 15:15:39 +0000</pubDate>
		<dc:creator>Tarandeep Singh</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[Web languages]]></category>

		<guid isPermaLink="false">http://geeknizer.com/html5-p2p-video-communications</guid>
		<description><![CDATA[Adobe made it possible to initiate Peer-to-peer video chat among two users, without need of a server in-between with use of Adobe flash &#38; AIR platform alone. Same p2p communications... <span class="meta-more"><a href="http://geeknizer.com/html5-p2p-video-communications/">Read more &#187;</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://geeknizer.com/wp-content/uploads/html-5-p2p.jpg"><img class="alignleft size-full wp-image-7174" title="html-5-p2p" src="http://geeknizer.com/wp-content/uploads/html-5-p2p.jpg" alt="" width="220" height="157" /></a>Adobe made it possible to initiate <a href="http://geeknizer.com/flashtime-video-chat-android">Peer-to-peer video chat among two users</a>, without need of a server in-between with use of Adobe flash &amp; AIR platform alone. Same p2p communications are possible with <a href="http://geeknizer.com/tag/html5">HTML5</a>, and it just gets easier.</p>
<p>Peer-to-peer streaming i.e.  voice/video frames are streamed directly between peers, without any server in between is actually possible with HTML5 specification. The result is lower latency and optimal network utilization.</p>
<p>Checkout the demo of <strong>HTML5 P2p communications</strong> below by <a rel="nofollow" href="https://labs.ericsson.com/developer-community/blog/beyond-html5-peer-peer-conversational-video" target="_blank">ericsson</a>:</p>
<p><object style="height: 390px; width: 640px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100" height="100" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.youtube.com/v/kM2EFWpTWc8?version=3" /><param name="allowfullscreen" value="true" /><embed style="height: 390px; width: 640px;" type="application/x-shockwave-flash" width="100" height="100" src="http://www.youtube.com/v/kM2EFWpTWc8?version=3" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><strong>ConnectionPeer API</strong></p>
<p>ConnectionPeer API is under works for establishing direct connection between two peers, which is web browsers in this case. ConnectionPeer is a very thin protocol as it shunts out signaling and connection stuff to traditional HTTP.</p>
<p><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#peer-to-peer-connections" target="_blank">ConnectionPeer</a> establishes peer-to-peer connectivity, using the following steps:</p>
<ol>
<li>Each peer sends out its own reachability information using the <em>getLocalConfiguration</em> method.</li>
<li>Next, they add the information about the other peer (obtained typically over HTTPS from the chat server) using <em>addRemoteConfiguration</em> method.</li>
<li>Next, p2p connection is established, allowing for streaming data to be exchanged between the peers. When established, an <em>onConnect</em> event is generated and allows the application to respond with the data it wants to send out. ConnectionPeer includes methods for streaming data over the connection. These are used to add real-time voice and video streams and even HTML5 p2p file transfers.</li>
</ol>
<p>The ConnectionPeer works almost everywhere, whether you are behind proxy, NAT or firewall. Whether you are on a desktop browser or a mobile (Android, iPhone, Blackberry), it doesn&#8217;t care, works on all WebKit browsers.</p>
<p>The good part of the whole story is that  IETF and W3C are standardizing this peer-to-peer support in browsers to enable real-time voice and video communication without plug-ins.</p>
<p>Code snippet:</p>
<p><a href="http://geeknizer.com/wp-content/uploads/html5-p2p.jpg"><img class="alignnone size-full wp-image-7173" title="html5-p2p" src="http://geeknizer.com/wp-content/uploads/html5-p2p.jpg" alt="" width="629" height="712" /></a></p>
<p><a href="http://swarmplayer.p2p-next.org/#dev.html" target="_blank">Swarmplayer</a> is one of the examples of doing HTML5 p2p video. It adds a P2P transport protocol to Firefox that allows &lt;video src=&#8221;p2p://&#8221; &gt; functionality. P2P transport is BitTorrent compatible.</p>
<p><a href="http://geeknizer.com/wp-content/uploads/swarmplayer.jpg"><img class="alignnone size-full wp-image-7175" title="swarmplayer" src="http://geeknizer.com/wp-content/uploads/swarmplayer.jpg" alt="" width="660" height="333" /></a></p>
<p>More to come on <a href="http://geeknizer.com/tag/">HTML5</a>, <a href="http://geeknizer.com/tag/open-source">Open Source</a>, <a href="http://geeknizer.com/tag/youtube">Youtube</a>, <a href="http://geeknizer.com/tag/google">Google </a>via <a href="http://twitter.com/taranfx" target="_blank"><strong>@taranfx</strong> on Twitter</a> or <a href="http://facebook.com/taranfx" target="_blank">Facebook Fanpage</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://geeknizer.com/html5-p2p-video-communications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cache Images with HTML5 local storage for Faster Page loading</title>
		<link>http://geeknizer.com/cache-images-with-html5-local-storage/</link>
		<comments>http://geeknizer.com/cache-images-with-html5-local-storage/#comments</comments>
		<pubDate>Sun, 27 Feb 2011 17:42:30 +0000</pubDate>
		<dc:creator>Tarandeep Singh</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[Tips N Tricks]]></category>
		<category><![CDATA[Web languages]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web standard]]></category>

		<guid isPermaLink="false">http://geeknizer.com/cache-images-with-html5-local-storage</guid>
		<description><![CDATA[There are several ways by which you can increase site loading speeds. Among the most popular ones is lazy load and dynamic async javascript are first. Typically these methods are... <span class="meta-more"><a href="http://geeknizer.com/cache-images-with-html5-local-storage/">Read more &#187;</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://geeknizer.com/wp-content/uploads/html-5.jpg"><img class="alignleft size-full wp-image-7132" title="html-5" src="http://geeknizer.com/wp-content/uploads/html-5.jpg" alt="" width="220" height="220" /></a>There are several ways by which you can increase site loading speeds. Among the most popular ones is lazy load and dynamic async javascript are first. Typically these methods are used to control and prioritize the rendering of primary web page elements to the benefit of the overall user experience.</p>
<p>HTML5 is the most beautiful that that happened to the web. <a href="http://geeknizer.com/what-is-html-5-and-faq-will-it-kill-flash">HTML 5</a> would eventually make webapps powerful and as capable as native apps, with Chrome&#8217;s Native client.</p>
<p><a href="http://geeknizer.com/html-5-client-storage">HTML5 Client-side Local Storage</a> provides a great solution for database storage on the client side. There are some other interesting things that can  be done on the client side.</p>
<p><strong>Improving site performance by caching in HTML5 Client storage</strong></p>
<p>By intelligently storing web page CSS, Javascript files or Images locally, you can avail benefit of reduced network and server usage, resulting in page loading time improvements.</p>
<p>The HTML5 localStorage provides a basic client-side key-value database, storing only String objects, which does fine for Javascript and CSS, however it would not store binary data like Images.</p>
<p>The first step to achieve this is to encode binary image data into base64 ascii. Using <a href="http://www.opinionatedgeek.com/dotnet/tools/base64encode/" target="_blank">OpinionatedGeek</a>, you can base 64 encode your images. Once done, you would have to implement the Javascript and localStorage API to read &amp; write your Images from the local client:</p>
<blockquote><p>source: <a rel="nofollow" href="https://www.ibm.com/developerworks/mydeveloperworks/blogs/bobleah/entry/html5_code_example_store_images_using_localstorage57" target="_blank">developerWorks</a><br />
&lt;script&gt;<br />
var hero;<br />
if ( localStorage.getItem(&#8216;heroImg&#8217;)) {<br />
hero = localStorage.getItem(&#8216;heroImg&#8217;);<br />
}<br />
else {<br />
hero = &#8216;/9j/4AAQSkZJRgABAgAAZABkAAD/7    /&#8230;/    6p+3dIR//9k=&#8217;;<br />
localStorage.setItem(&#8216;heroImg&#8217;,hero);<br />
}<br />
document.getElementById(&#8220;hero-graphic&#8221;).src=&#8217;data:image/png;base64,&#8217; + hero;<br />
&lt;/script&gt;</p></blockquote>
<p><strong>The corresponding HTML Image element:</strong></p>
<blockquote><p>&lt;img id=&#8221;hero-graphic&#8221; alt=&#8221;Blog Hero Image&#8221; src=&#8221;" /&gt;</p></blockquote>
<p>The caching in HTML5 local client storage is way more effective than browser&#8217;s caching.</p>
<p>However, through the implementation of HTML5 Local Storage, the browser now provides a mechanism to permanently store large chunks of data, while giving server side applications control and intelligence over the data store itself.</p>
<p>The possibilities of speeding webapps are just endless with this style of local storage for web components. You can save swf, css, js, anything that can be heavy for your website.</p>
<p>Refer toHTML5 localStorage API, visit the W3C specification page for <a href="http://dev.w3.org/html5/webstorage/">Web Storage</a>.</p>
<p><strong>Download complete HTML of this example:</strong> <a href="http://geeknizer.com/download/html5-image-caching.html.txt" target="_blank">HTML 5 Image caching</a>.</p>
<p>p.s. there are certain <a href="http://geeknizer.com/pros-cons-of-html-5-local-database-storage-and-future-of-web-apps">Vulnerabilites in HTML 5</a> implementation with certain browser, watchout!</p>
<p>More to come on <a href="http://geeknizer.com/tag/">HTML5</a>, <a href="http://geeknizer.com/tag/open-source">Open Source</a>, <a href="http://geeknizer.com/tag/youtube">Youtube</a>, <a href="http://geeknizer.com/tag/google">Google </a>via <a href="http://twitter.com/taranfx" target="_blank"><strong>@taranfx</strong> on Twitter</a> or <a href="http://facebook.com/taranfx" target="_blank">Facebook Fanpage</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://geeknizer.com/cache-images-with-html5-local-storage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Edit, Test JavaScript, CSS, HTML Online</title>
		<link>http://geeknizer.com/edit-test-javascript-css-online/</link>
		<comments>http://geeknizer.com/edit-test-javascript-css-online/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 16:34:46 +0000</pubDate>
		<dc:creator>Tarandeep Singh</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[Web languages]]></category>
		<category><![CDATA[webapp]]></category>

		<guid isPermaLink="false">http://geeknizer.com/edit-test-javascript-css-online</guid>
		<description><![CDATA[A number of times I have felt need of an online JavaScript editor specially when I&#8217;m away from my PC, or on the move. jsFiddle is a great webapp that... <span class="meta-more"><a href="http://geeknizer.com/edit-test-javascript-css-online/">Read more &#187;</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://geeknizer.com/wp-content/uploads/2010/02/editjavascriptcssonline.jpg"><img class="alignleft" title="edit-javascript-css-online" src="http://geeknizer.com/wp-content/uploads/2010/02/editjavascriptcssonline_thumb.jpg" border="0" alt="edit-javascript-css-online" width="245" height="209" /></a> A number of times I have felt need of an online JavaScript editor specially when I&#8217;m away from my PC, or on the move.</p>
<p><a rel="nofollow" href="http://jsfiddle.net/" target="_blank">jsFiddle</a> is a great <a href="http://geeknizer.com/tag/webapp">webapp</a> that lets you edit HTML, <a href="http://geeknizer.com/tag/javascript">JavaScript</a>, CSS just like a normal IDE like Dreamweaver would do, all the syntax highlighting. The screen gets divided into 4 sections: <a href="http://geeknizer.com/tag/web-languages">HTML</a>, CSS, Javascript and Result (Preview) as show below:</p>
<p><a href="http://geeknizer.com/wp-content/uploads/2010/02/jsfiddle.jpg"><img style="display: inline; border-width: 0px;" title="jsfiddle" src="http://geeknizer.com/wp-content/uploads/2010/02/jsfiddle_thumb.jpg" border="0" alt="jsfiddle" width="604" height="332" /></a></p>
<p>You can also add resources, an Ajax echo backend, and auto load from a slew of JavaScript frameworks. It also includes some built-in  examples that you can use to see the great stuff such as Processing in action.</p>
<p>Lot of hard and good work has been put into the project using CodeMirror and MooTools. Kudos!</p>
<p>We write Latest Tech updates in <a href="http://geeknizer.com/tag/open-source">Open Source</a>, <a href="http://geeknizer.com/tag/programming">Programming</a>, <a href="http://geeknizer.com/tag/java">Java</a>, Tech News find us on <a>Twitter <strong>@taranfx</strong></a><strong> </strong>or subscribe below:</p>
]]></content:encoded>
			<wfw:commentRss>http://geeknizer.com/edit-test-javascript-css-online/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HTML5 Paint WebApp</title>
		<link>http://geeknizer.com/html5-paint/</link>
		<comments>http://geeknizer.com/html5-paint/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 13:54:19 +0000</pubDate>
		<dc:creator>Tarandeep Singh</dc:creator>
				<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[Web languages]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[webapps]]></category>

		<guid isPermaLink="false">http://geeknizer.com/html5-paint</guid>
		<description><![CDATA[It was predicted long back that RIA (Rich internet Applications) no longer needs Flash&#8217;s domination. AJAX/ JQuery, HTML 5, CSS will together form the best army against the closed Flash... <span class="meta-more"><a href="http://geeknizer.com/html5-paint/">Read more &#187;</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://geeknizer.com/wp-content/uploads/2010/02/html5.jpg"><img class="alignleft size-full wp-image-3687" title="html5" src="http://geeknizer.com/wp-content/uploads/2010/02/html5.jpg" alt="" width="200" height="200" /></a>It was <a href="http://geeknizer.com/what-is-html-5-and-faq-will-it-kill-flash">predicted long back</a> that RIA (Rich internet Applications) no longer needs Flash&#8217;s domination. AJAX/ JQuery, <a href="http://geeknizer.com/tag/html-5">HTML 5</a>, CSS will together form the best army against the closed Flash (which can&#8217;t be <a href="http://geeknizer.com/tag/open-source">open source</a>d).</p>
<p>Though few predict that <a href="http://geeknizer.com/what-is-html-5-and-faq-will-it-kill-flash">HTML5 would kill Flash</a>, it&#8217;s more evident that <a href="http://geeknizer.com/tag/html-5">HTML5 </a>will innovate new web applications co-existing with <a href="http://geeknizer.com/tag/flash">flash</a>.</p>
<p>The Latest web application &#8220;SketchPad&#8221; let&#8217;s you do a lot in your web browser. I&#8217;m deeply impressed by the capability of this app.</p>
<p><a href="http://mugtug.com/sketchpad/">Sketchpad</a> by Mugtug is a Pixelmator-like application that has desktop like tools, colour selection, patterns, swatches, all built using <a href="http://geeknizer.com/tag/html-5">HTML5 </a>and CSS. The performance is pretty good even on <a href="http://geeknizer.com/tag/firefox">Firefox</a>. And on <a href="http://geeknizer.com/chrome-5">Chrome 5</a> it was as good as any Desktop app, perhaps faster than Photoshop.</p>
<p><a href="http://geeknizer.com/wp-content/uploads/2010/02/paint-html5.png"><img class="alignnone size-full wp-image-3686" title="paint-html5" src="http://geeknizer.com/wp-content/uploads/2010/02/paint-html5.png" alt="" width="650" height="468" /></a></p>
<p>However, The <a href="http://geeknizer.com/tag/ui">UI </a>doesn’t seem to take input from touchscreen, I couldn&#8217;t get it to run on <a href="http://geeknizer.com/tag/iphone">iPhone </a>or Android. But it would be one killer app.</p>
<p>It will not replace your current desktop image editor,  but it’s a tool you must check out and admire for what it is.</p>
<p>We write about <a href="http://geeknizer.com/tag/open-source">Open Source</a>, <a href="http://geeknizer.com/tag/programming">Programming</a>, <a href="http://geeknizer.com/">Web</a>, <a href="http://geeknizer.com/tag/apple">Apple</a>, <a href="http://geeknizer.com/tag/iphone">iPhone</a>, <a href="http://geeknizer.com/tag/android">Android</a> and latest in Tech <a href="http://twitter.com/taranfx"><strong>@taranfx</strong>on Twitter</a> or subscribe below:</p>
]]></content:encoded>
			<wfw:commentRss>http://geeknizer.com/html5-paint/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Facebook&#8217;s PHP Runtime HipHop, now Open Source</title>
		<link>http://geeknizer.com/facebook-php-hiphop-open-source/</link>
		<comments>http://geeknizer.com/facebook-php-hiphop-open-source/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 19:40:13 +0000</pubDate>
		<dc:creator>Tarandeep Singh</dc:creator>
				<category><![CDATA[Open source]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[Web languages]]></category>

		<guid isPermaLink="false">http://geeknizer.com/facebook-php-hiphop-open-source</guid>
		<description><![CDATA[In the need for speed, Facebook had been working under the hood to boost PHP runtime to crazy levels which were not possible before. Facebook has now Open sourced the... <span class="meta-more"><a href="http://geeknizer.com/facebook-php-hiphop-open-source/">Read more &#187;</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://geeknizer.com/wp-content/uploads/2010/01/phpfacebook_thumb.jpg"><img class="alignleft size-full wp-image-3555" title="phpfacebook_thumb.jpg" src="http://geeknizer.com/wp-content/uploads/2010/01/phpfacebook_thumb.jpg" alt="" width="230" height="226" /></a>In the need for speed, Facebook had been working under the hood <a href="http://geeknizer.com/facebook-speed-up-php">to boost PHP runtime</a> to crazy levels which were not possible before. Facebook has now Open sourced the underlying code, <a href="http://geeknizer.com/facebook-speed-up-php">as predicted</a>.</p>
<p>The PHP runtime has in fact been rewritten, but it comes with an extra effort: The PHP is translated to C++ (which is of course more efficient) which is then compiled with g++. The project is called HipHop and has been in development under great secrecy at Facebook for the past 2+ years.</p>
<p>With HipHop, Facebook <a href="http://developers.facebook.com/news.php?blog=1&amp;story=358" target="_blank">claims</a> to have reduced the <a href="http://geeknizer.com/tag/cpu" target="_blank">CPU</a> usage on average by about 50%. HipHop for PHP isn&#8217;t technically a compiler itself, rather a source code transformer. HipHop automatically transforms  PHP source code into highly optimized C++ and then uses g++ to compile it.</p>
<p>Apart from this, They have discussed the challenges faced while scaling a PHP application. Scripting languages like PHP, perl, etc are known to be far less efficient when it comes to CPU and memory usage than interpreted, compiled languages like C++, Java. All this creates it even harder to scale an application written in PHP.</p>
<blockquote><p>Scaling Facebook is particularly challenging because almost every page view is a logged-in user with a<img class="alignright" title="HipHop" src="http://wiki.developers.facebook.com/images/a/ac/HipHop_logo_white.png" alt="" width="183" height="248" />customized experience. When you view your home page we need to look up all of your friends, query their most relevant updates (from a custom service we&#8217;ve built called Multifeed), filter the results based on your privacy settings, then fill out the stories with comments, photos, likes, and all the rich data that people love about Facebook. All of this in just under a second. HipHop allows us to write the logic that does the final page assembly in PHP and iterate it quickly while relying on custom back-end services in C++, Erlang, Java, or Python to service the News Feed, search, Chat, and other core parts of the site.</p>
<p>Finding new ways to improve PHP <a href="http://geeknizer.com/tag/perfromance" target="_blank">performance</a> isn&#8217;t a new concept. At run time the Zend Engine turns your PHP source into opcodes which are then run through the Zend Virtual Machine. Open source projects such as <a href="http://pecl.php.net/package/APC">APC</a> and <a href="http://eaccelerator.net/">eAccelerator</a> cache this output and are used by the majority of PHP powered websites. There&#8217;s also <a href="http://en.wikipedia.org/wiki/Zend_Server">Zend Server</a>, a commercial product which makes PHP faster via opcode optimization and caching. Even compiling PHP isn&#8217;t a new idea, open source projects like <a href="http://www.roadsend.com/">Roadsend</a> and <a href="http://www.phpcompiler.org/">phc</a> compile PHP to C, <a href="http://www.caucho.com/resin-3.0/quercus/">Quercus</a>compiles PHP to Java, and <a href="http://www.php-compiler.net/">Phalanger</a> compiles PHP to .Net.</p></blockquote>
<p><img class="alignnone" src="http://wiki.developers.facebook.com/images/2/23/HipHop_transformation_process.png" alt="" width="491" height="307" /></p>
<p>There&#8217;s in-depth discussion about <a href="http://developers.facebook.com/news.php?blog=1&amp;story=358" target="_blank">how it works, at the source</a>.</p>
<p>PHP is currently used by popular and large, dynamic web sites such as <a id="divz" title="Facebook" href="http://facebook.com/">Facebook</a>, <a id="w130" title="WordPress.com" href="http://wordpress.com/">WordPress.com</a> and <a href="http://digg.com/">Digg</a>.  It was viewed as one of the hottest new technologies in 2005, when venture capitalist Marc Andreessen, founder of Netscape and current Facebook board member, told the Wall Street Journal that “PHP is to 2005 what Java was to 1995.”</p>
<p>What is notable now is &#8211; This new effort from <a href="http://geeknizer.com/tag/facebook" target="_blank">Facebook</a> could mold into acceleration for the industry adoption of PHP. The biggest bottleneck is now gone for good.</p>
<p>We write about <a href="http://geeknizer.com/tag/open-source">Open Source</a>, <a href="http://geeknizer.com/tag/programming">Programming</a>, <a href="http://geeknizer.com/">Web</a>, <a href="http://geeknizer.com/tag/apple">Apple</a>, <a href="http://geeknizer.com/tag/iphone">iPhone</a>, <a href="http://geeknizer.com/tag/android">Android</a> and latest in Tech <a href="http://twitter.com/taranfx"><strong>@taranfx</strong> on Twitter.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://geeknizer.com/facebook-php-hiphop-open-source/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Facebook Speeds up PHP</title>
		<link>http://geeknizer.com/facebook-speed-up-php/</link>
		<comments>http://geeknizer.com/facebook-speed-up-php/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 17:40:20 +0000</pubDate>
		<dc:creator>Tarandeep Singh</dc:creator>
				<category><![CDATA[Open source]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Social networks]]></category>
		<category><![CDATA[Web languages]]></category>
		<category><![CDATA[facebook]]></category>

		<guid isPermaLink="false">http://geeknizer.com/facebook-speed-up-php</guid>
		<description><![CDATA[PHP offers a light-weight runtime for small-to-medium sized webapps. If you are not a PHP developer, you will be surprised to know that PHP doesn&#8217;t support multithreading natively, though there... <span class="meta-more"><a href="http://geeknizer.com/facebook-speed-up-php/">Read more &#187;</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://geeknizer.com/wp-content/uploads/2010/01/phpfacebook.jpg"><img class="alignleft" style="display: inline; border-width: 0px;" title="php-facebook" src="http://geeknizer.com/wp-content/uploads/2010/01/phpfacebook_thumb.jpg" border="0" alt="php-facebook" width="230" height="226" /></a></p>
<p>PHP offers a light-weight runtime for small-to-medium sized <a href="http://geeknizer.com/tag/webapps">webapps</a>. If you are not a PHP developer, you will be surprised to know that PHP doesn&#8217;t support multithreading natively, though there are ways to make it possible. People have often come up with solutions to mock multithreading but still PHP sucks at performance as far as large applications are concerned.</p>
<p>Update: <a href="http://geeknizer.com/facebook-php-hiphop-open-source">Facebook&#8217;s PHP Runtime HipHop, now Open Source</a></p>
<p>Most industry applications fallback to either <a href="http://geeknizer.com/tag/java">Java</a>/J2ee or .NET when they are designing inherently-scalable, responsive in high-load, resilient applications.</p>
<p>However, big companies who had the PHP as base right from the start complain to ZEND for such a poorly performing runtime. And <a href="http://geeknizer.com/tag/facebook" target="_blank">Facebook</a> is the one who is in the deepest pains caused by all this.</p>
<p>After years of struggle, they have finally have rewritten the runtime to achieve the level of performance way beyond than what it does today. It took them approximately 2 years with some senior level programmers.</p>
<p>As SDTimes <a href="http://www.sdtimes.com/blog/post/2010/01/30/Facebook-rewrites-PHP-runtime.aspx" target="_blank">reports</a>,</p>
<blockquote><p>Core PHP team had been brought to <a href="http://geeknizer.com/tag/facebook">Facebook</a>&#8216;s main campus. That team were forced to sign NDA&#8217;s, and taken to a very quiet, secluded meeting room where some cool new Facebook-backed open source project was described.</p>
<p>Well, I was able to put all the pieces together on this one, finally, and I now understand exactly what is up: <strong>Facebook has rewritten the PHP runtime from scratch</strong>.</p></blockquote>
<p>Now, that sounds like a good work. But what is even better is that they are planning to make a big announcement of  open source-ing the new runtime on this Tuesday. In addition, it makes alot more sense that Facebook would release it&#8217;s own version of Compiler to accompany the runtime improvements.</p>
<p>Well, this is not something new for PHP. Zend has time and again ignored performance issues with PHP.  Evidence comes from <a href="http://geeknizer.com/tag/yahoo">Yahoo</a>!, who had to take a similar step to make it possible to continue using PHP to power it&#8217;s apps.</p>
<p>Now this new effort from Facebook could mold into acceleration  for industry adoption for PHP. Well, I don&#8217;t have the numbers to conclude anything solid but it sure would be a good step.</p>
<p>We write about <a href="http://geeknizer.com/tag/open-source">Open Source</a>, <a href="http://geeknizer.com/tag/programming">Programming</a>, <a href="http://geeknizer.com/">Web</a>, <a href="http://geeknizer.com/tag/apple">Apple</a>, <a href="http://geeknizer.com/tag/iphone">iPhone</a>, <a href="http://geeknizer.com/tag/android">Android</a> and latest in Tech <a href="http://twitter.com/taranfx" target="_blank"><strong>@taranfx</strong> on Twitter.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://geeknizer.com/facebook-speed-up-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTML5 Client-side Local Storage</title>
		<link>http://geeknizer.com/html-5-client-storage/</link>
		<comments>http://geeknizer.com/html-5-client-storage/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 21:44:40 +0000</pubDate>
		<dc:creator>Tarandeep Singh</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[Web languages]]></category>
		<category><![CDATA[webapps]]></category>

		<guid isPermaLink="false">http://geeknizer.com/html-5-client-storage</guid>
		<description><![CDATA[From practical apps like Google Wave, Gmail (mobile), we&#8217;ve seen that minimal client caching can be a good idea for most web applications. However, faster internet fades away half of... <span class="meta-more"><a href="http://geeknizer.com/html-5-client-storage/">Read more &#187;</a></span>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" title="HTML5 " src="http://farm3.static.flickr.com/2477/3915246870_0fbc0277af.jpg" alt="" width="137" height="236" />From practical apps like <a href="http://geeknizer.com/tag/google-wave">Google Wave</a>, <a href="http://geeknizer.com/tag/gmail">Gmail </a>(<a href="http://geeknizer.com/tag/mobile">mobile</a>), we&#8217;ve seen that minimal client caching can be a good idea for most <a href="http://geeknizer.com/tag/webapps">web applications</a>. However, faster internet fades away half of the value. But for the mobile, the growing contender of the internet, it still makes a lot of sense.</p>
<p>Till now, the most popular method for local storage had been limited potential HTTP cookies or <a href="http://geeknizer.com/tag/google">Google </a>Gears for a few. All Cookies can do is key-value pairs of strings that are stored locally in a text file of 4KB max. We definitely need a smarter solution that an industry wide standard can solve.</p>
<p>Out of all that <a href="http://geeknizer.com/what-is-html-5-and-faq-will-it-kill-flash">comes bundled in HTML5</a>, Client-side storage is probably one of the most talked about features: Both +ve and -ve &#8212; lot of criticism of it&#8217;s <a href="http://geeknizer.com/tag/security">security</a>, and +ve <a href="http://geeknizer.com/tag/innovation">innovation</a>.</p>
<p>Client-side storage is divided into 3 methodologies:</p>
<ol>
<li>Session storage.</li>
<li>Local storage</li>
<li>Database storage</li>
</ol>
<p>Let&#8217;s get into each one of them:</p>
<p><strong>1. Session Storage</strong></p>
<p>Session storage is way better than what cookies have to offer. With different implementations the max limit can be something sufficient of the order of few MBs.</p>
<p>Unlike Cookies Session data is not sent with every request. The advantage: request payload is minimal.<br />
So how exatly do we write it? Here goes an example:</p>
<pre>sessionStorage.setItem('userName', 'taranfx');              // defining the session variable
alert("Your user is: " + sessionStorage.getItem('userName'));// accessing it
alert("Hello " + sessionStorage.userName);                   // another way of accessing the variable
sessionStorage.removeItem('userName');                       // finally unset it</pre>
<p><strong>2. Local Storage</strong></p>
<p><em><span style="font-style: normal;">The localStorage JavaScript object is functionally identical to the sessionStorage object. They only differ in persistence and scope. Scope: localStorage data is accessible across all browser windows while sessionStorage data is confined to the browser window that it was created in.</span></em></p>
<p><em>Global Storage</em> is a memory space given by the browser that websites can use to store persistent data that doesn&#8217;t need to be sent to the server. The data is accessible by JavaScript/<a href="http://geeknizer.com/tag/ajax">AJAX </a>and hence by <a href="http://geeknizer.com/tag/flash">Flash</a>. this could be really handy for Flash Games:</p>
<pre>globalStorage[''].foo = 'bar';               // foo will be accessible by any website
globalStorage['com'].foo1 = 'bar1';          // foo1 will be accessible by websites ending in '.com'
globalStorage['taranfx.com'].foo2 = 'bar2';  // foo2 will be accessible by taranfx.com</pre>
<p>The specification was more insecure what different browsers implemented. They replaced global storage with local storage where you cannot specify domains; the data you store is automatically associated with the domain under which the script is running. This means strictly we will disallow XSS which is very important.</p>
<p><em>Persistence</em>: The choice for Local Storage is obvious &#8212; the data persistence &#8212; data remains there even when the browser Window/Tab closes. Here&#8217;s how this can be done:</p>
<pre>localStorage.setItem('userName', 'taranfx');                 // defining the localStorage variable
alert("Your user is: " + localStorage.getItem('userName'));  // accessing it
alert("Hello " + localStorage.userName);                     // another way of accessing the variable
localStorage.removeItem('userName');                         // finally unset it</pre>
<p><strong>3. Database Storage</strong></p>
<p>Till now what we have discussed is limited to key-value pairs. But when you are dealing with a larger amount of data, database is the weapon of choice. So far, I think Safari is the only browser (correct me if wrong) to have implemented this feature. It uses SQLite database, which is light and fast with few limitations like lack of foreign key constraints.</p>
<p>Here is example code for accessing the local database:</p>
<pre>var db = openDatabase("Database_Name", "Database_Version");
database.executeSql("SELECT * FROM taranfx", function(result1) {
  // do something with the resultset, there could be n no. of things
  database.executeSql("DROP TABLE taranfx", function(result2) {
    // do some more cleanup or blah
    alert("My second database query finished executing!");
   });
});</pre>
<p>You can get a demo of this local database storage <a href="webkit.org/misc/DatabaseExample.html">here </a>(needs webkit nightly)Apart from the limited functionalities, it has some serious vulnerabilities Detailed in <a href="http://geeknizer.com/pros-cons-of-html-5-local-database-storage-and-future-of-web-apps">Vulnerabilities in HTML 5 and Future</a>.</p>
<p>I believe, as <a href="http://geeknizer.com/tag/html-5">HTML 5</a> finds its destiny in more and more <a href="http://geeknizer.com/tag/webapps">web applications</a>, they would become more powerful and capable. You can check our other Programming articles and Subscribe to us, discuss Technology, programming via <a href="http://twitter.com/taranfx" target="_blank">Twitter </a><strong><a href="http://twitter.com/taranfx" target="_blank">@Taranfx</a> </strong>- Join the dialogue.</p>
<p>Related:</p>
<ul>
<li><a title="Permanent Link to Vulnerabilities in HTML 5 and  Future" rel="bookmark" href="http://geeknizer.com/pros-cons-of-html-5-local-database-storage-and-future-of-web-apps">Vulnerabilities in HTML 5 and Future</a></li>
<li><a title="Permanent Link to HTML 5 drops most awaited open  source Video codec" rel="bookmark" href="http://geeknizer.com/html-5-drops-most-awaited-open-source-video-codec">HTML 5 drops most awaited open source Video codec</a></li>
<li><a title="Permanent Link to What is HTML 5 and FAQ. Will it  kill Flash?" rel="bookmark" href="http://geeknizer.com/what-is-html-5-and-faq-will-it-kill-flash">What is HTML 5 and FAQ. Will it kill Flash?</a></li>
<li><a title="Permanent Link to Why choose JavaFX. How to Code.  Benchmark Graphics, CPU, Memory" rel="bookmark" href="http://geeknizer.com/why-choose-javafx-how-to-code-benchmark-graphics-cpu-memory">Why choose JavaFX. How to Code.  Benchmark Graphics, CPU, Memory</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://geeknizer.com/html-5-client-storage/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Vulnerabilities in HTML 5 and Future</title>
		<link>http://geeknizer.com/pros-cons-of-html-5-local-database-storage-and-future-of-web-apps/</link>
		<comments>http://geeknizer.com/pros-cons-of-html-5-local-database-storage-and-future-of-web-apps/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 09:34:46 +0000</pubDate>
		<dc:creator>Tarandeep Singh</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Web languages]]></category>
		<category><![CDATA[developers]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[vulnerable]]></category>
		<category><![CDATA[web standard]]></category>

		<guid isPermaLink="false">http://geeknizer.com/blog/?p=1902</guid>
		<description><![CDATA[HTML 5 comes with alot of promise for the web.  It has lot of new features that could make Web Browsers and Apps much more powerful than they ever were.... <span class="meta-more"><a href="http://geeknizer.com/pros-cons-of-html-5-local-database-storage-and-future-of-web-apps/">Read more &#187;</a></span>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" src="http://farm3.static.flickr.com/2477/3915246870_0fbc0277af.jpg" alt="" width="202" height="350" />HTML 5 comes with alot of promise for the web.  It has <a href="http://geeknizer.com/blog/?p=1212" target="_blank">lot of new features</a> that could make Web Browsers and Apps much more powerful than they ever were.</p>
<p>Let&#8217;s go by an example. Try accessing <a href="http://geeknizer.com/blog/?tag=gmail" target="_blank">Gmail </a>on <a href="http://geeknizer.com/blog/?tag=iphone" target="_blank">iPhone </a>or <a href="http://geeknizer.com/blog/?tag=android" target="_blank">Android </a> phone,  you will have notice some differences from what it used to be a month ago. The new thing worth noticing is the introduction of the <em>offline access</em>.</p>
<p><a href="http://geeknizer.com/blog/what-made-gmail-go-down-google-explains" target="_blank">Gmail went down, offline</a> in September, but credits to Gears, Gmail was still up and running with select Browsers. On the other side, iPhone Safari doesn&#8217;t have a Gears plugin, so how was it still running?</p>
<p>The answer lies with the <a href="http://geeknizer.com/blog/?p=1212" target="_blank">HTML 5</a> standard, more specifically: <em>the local database storage</em>. Though HTML 5 is still in-progress, WebKit powered browsers, such as Safari, Mobile Safari, (and <a href="http://geeknizer.com/blog/?tag=firefox" target="_blank">Firefox</a>) have already adopted local database storage. This opens a new door of opportunities for developers to create and innovate subsequently to read from/write to a fully capable: Locally stored, Relational SQL database via the web browser itself.</p>
<p>Current Gmail&#8217;s iPhone release is the first web app that I&#8217;ve seen using the technology.</p>
<p>I foresee offline-access as an important feature for NextGen web applications: for speed and availability. Like <a href="http://geeknizer.com/blog/?tag=google" target="_blank">Google</a> believes with <a href="http://geeknizer.com/blog/?tag=chrome-os" target="_blank">Chrome OS</a> , we have, practically, continued to decrease the gap between desktop apps and their web  counterparts using t<span style="background-color: #ffffff;">echnologies such as AJAX, Flash, <a href="http://geeknizer.com/blog/?tag=javafx" target="_blank">JavaFX</a>, Silverlight, etc. which have continued to push the hard limits.</span></p>
<p>But, despite all of the added functionality, web apps suffer from inherited old limitation &#8211; They don&#8217;t exist when you go off the line. Well, that&#8217;s about to change with HTML 5.</p>
<p><strong>HTML 5 App with Local Storage:  Gmail</strong></p>
<p>The iPhone doesn&#8217;t allow raw file access(I&#8217;m talking of Virgin iPhone), I&#8217;ll demonstrate Gmail&#8217;s use of HTML 5 via Safari on a standard OS X platform. First thing first, in order to get Google to serve the HTML 5 version of Gmail, we&#8217;ll change the User-Agent of our PC to match that used by the iPhone.</p>
<p>To fake iPhone’s Safari using Safari in Windows or Mac,  In Safari, click on Preferences, then go to <em>Advanced </em>tab. Check the checkbox for <em>Show Develop menu in menu ba</em>r option. <span style="background-color: #ffffff;">Exit from the Preference dialog window, a new “Develop” menu will show in the menu bar. Click on <em>Develop</em>, and then select <em>User Agent</em> in the pull down menu. Click to select <em>Mobile Safari 3.0 – iPhone. </em>Here is the resultant User-Agent:</span></p>
<blockquote><p>Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0_0 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5H11 Safari/525.20</p></blockquote>
<p>Now next time we visit Gmail, the iPhone specific version of the app opens. And, the local database storage is automatically setup.</p>
<p>One thing that raises concern here is that the end-user is NOT informed of this. Data is being stored locally in plain text, and user is un-aware.  On the other side, Gears will at least mandate the end-user to acknowledge before it actually makes a copy of data, offline. The phone will carry a local copy of their email, which could be accessible to just anyone, if the phone was ever lost.</p>
<p>Now let&#8217;s see exactly what has been stored locally. The database is set up in the following location:</p>
<blockquote><p><strong>Windows:</strong> C:\Users\taranfx\AppData\Local\Apple Computer\Safari\Databases\https_mail.google.com_0\000000000000000<strong>1</strong>.db</p>
<p><strong>Mac: </strong>/Users/taranfx/Library/Safari/Databases/http_mail.google.com_0/000000000000000<strong>1</strong>.db</p></blockquote>
<p>New databases will be created for each separate Gmail account logged-in, each one gets an incremented number instead of &#8220;1&#8243; that you see over there.  Now you might be thinking Which Database is that? It&#8217;s SQLite database. Surprisingly, there is no encryption, no protection, the database content can be viewed with any SQLLite compatible app: I used SQLite Browser. And the Results were alarming:</p>
<blockquote>
<ol>
<li><span style="background-color: #ffffff;"><em>cached_contacts </em>- Top 20 frequent contacts, including email address, names</span></li>
<li><span style="background-color: #ffffff;"><em>cached_conversation_headers </em>- Abbreviated content from email messages including the full subject, sender&#8217;s name and first sentence or two of the message.</span></li>
<li><span style="background-color: #ffffff;"><em>cached_labels </em>- User defined labels which can be assigned to emails.</span></li>
<li><span style="background-color: #ffffff;"><em>cached_messages </em>- Similar <em><span style="font-style: normal;">to </span>cached_conversation_headers</em></span></li>
<li><span style="background-color: #ffffff;"><em>cached_queries &#8211; </em>Certain queries</span></li>
<li><span style="background-color: #ffffff;"><em>unclearconfig_table</em><strong> </strong>- Application version number</span></li>
<li><span style="background-color: #ffffff;"><em>hit_to_data &#8211; ??</em></span></li>
<li><span style="background-color: #ffffff;"><em>log_store &#8211; </em>Some logging info.</span></li>
</ol>
<p><span style="background-color: #ffffff;">All are  shown in the screenshot below:</span></p></blockquote>
<p><img class="aligncenter" src="http://farm3.static.flickr.com/2674/3914496987_eb08485144_o.jpg" alt="" width="522" height="485" /><img class="aligncenter" src="http://farm3.static.flickr.com/2426/3915280924_ca8a182ee3_o.jpg" alt="" width="517" height="489" />Now if someone gets access to your machine or mobile, you can guess the level of risk you are under.</p>
<p><strong>Verdict:</strong></p>
<p>Gears and HTML 5 represent great technologies, but  poorly implemented, and hence result in increased security risk.</p>
<p>Applications interface with local data storage via JavaScript API calls.  The calls, as per the specification,  are  restricted by the same origin policy to ensure that only the application which originally created the data, can then subsequently access it. When sites are vulnerable to XSS vulnerabilities, a remote attacker could gain access to local database storage and perform any type of  client-side SQL injection attacks.</p>
<p>Gmail might be currently suffering from any XSS <a href="http://geeknizer.com/blog/?tag=vulnerable" target="_blank">vulnerabilities</a>, as they had numerous times in the past. What&#8217;s more critical is the fact that XSS remains a too-common vulnerability and as developers adopt local database storage via <a href="http://geeknizer.com/blog/?tag=html-5" target="_blank">HTML 5</a>, we are sure to see plenty of vulnerable sites, which will place everyone at risk.  It is not just a <a href="http://geeknizer.com/blog/?tag=privacy" target="_blank">privacy </a>concern, it&#8217;s also a data integrity concern: <strong>What</strong> <strong>if an attacker can manage to write to the database just as easily as they can read from it?</strong></p>
<p>Nothing more or less, I feel that the HTML 5 specification has a great deal to offer and it&#8217;s good to see it&#8217;s early adoption. But the fate of the game lies in the hands of the <a href="http://geeknizer.com/blog/?tag=developers" target="_blank">developers </a>, who will have to ensure that powerful features such as local database storage do not expose end-users to increased threat.</p>
]]></content:encoded>
			<wfw:commentRss>http://geeknizer.com/pros-cons-of-html-5-local-database-storage-and-future-of-web-apps/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>REST vs. SOAP &#8211; The Right WebService</title>
		<link>http://geeknizer.com/rest-vs-soap-using-http-choosing-the-right-webservice-protocol/</link>
		<comments>http://geeknizer.com/rest-vs-soap-using-http-choosing-the-right-webservice-protocol/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 16:49:38 +0000</pubDate>
		<dc:creator>Tarandeep Singh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web languages]]></category>
		<category><![CDATA[developers]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[web services]]></category>

		<guid isPermaLink="false">http://geeknizer.com/blog/?p=1715</guid>
		<description><![CDATA[Web Services are the key point of Integration for different applications belonging to different Platforms, Languages, systems. It wouldn&#8217;t be wrong if you call Web-services as the &#8220;Rendezvous point of... <span class="meta-more"><a href="http://geeknizer.com/rest-vs-soap-using-http-choosing-the-right-webservice-protocol/">Read more &#187;</a></span>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" src="http://farm4.static.flickr.com/3514/3852280189_71842c2a3b_d.jpg" alt="" width="270" height="225" />Web Services are the key point of Integration for different applications belonging to different Platforms, Languages, systems. It wouldn&#8217;t be wrong if you call Web-services as the &#8220;Rendezvous point of the Business&#8221;.</p>
<p>I&#8217;ve been using HTTP and SOAP since several years new. REST is rather new. SOAP revolutionized RPC and loose coupling  beyond the restrictions posed by  earlier protocols. However off late I have been giving APIs and interfaces considerable thought and am leaning a lot more towards simple HTTP based APIs with an XML or JSON response format as opposed to SOAP. Let&#8217;s try to discuss all the aspects one by one.</p>
<p>Before we start, Let&#8217;s do a basic terminology headsup -</p>
<li><a href="http://www.w3.org/TR/SOAP/" target="_blank">SOAP </a>refers to Simple Object Access Protocol</li>
<li>HTTP based APIs refer to APIs that are exposed as one or more HTTP URIs and typical responses are in XML / JSON. Response schemas are custom per object</li>
<li>REST on the other hand adds an element of using standrdized URIs, and also giving importance to the HTTP verb used (ie GET / POST / PUT etc)</li>
<p>Although, in alst ffew years we saw growth of large no.  of Web Services, despite that the hype surrounding the SOAP has barely reduced. Internet architects have come up with a  surprisingly good argument for pushing SOAP aside: there&#8217;s a better  method for building Web services in the form of Representational State  Transfer (<a href="http://www.ics.uci.edu/~fielding/talks/webarch_9805/" target="_blank">REST</a>).</p>
<p>REST is more of an old philosophy than a new technology. But a realization that came later in technology. Whereas SOAP looks  to jump-start the next phase of Internet development with a host of new  specifications, the REST philosophy espouses that the existing  principles and protocols of the Web are enough to create robust Web  services. This means that developers who understand HTTP and XML can  start building Web services right away, without needing any toolkits  beyond what they normally use for Internet application development.</p>
<p>In a RESTful architecture, the key resources are identified &#8212; Can  be entities, collections, or anything else the designer seems worthy of  having its own URI. The standard methods — in this case, the HTTP verbs —  are mapped to resource-specific semantics. All resources implement the  same uniform interface. The  dimension of content-types, which allows for different representations  of resources (e.g. in both XML, HTML, and plain text), as well as the  possibility of links to resources in resource representations. Use your  imagination — e.g. the GET on /customer/4711 would return a document  that contains a link to a specific /order/xyz.</p>
<p>I am seeing a lot of new web services are implemented using a <strong>REST</strong> style architecture these days rather than a SOAP one. Lets step back a second and put some light on what REST is.</p>
<p><strong>What is a REST Web Service</strong></p>
<p><em>Representational State Transfer or REST</em> basically means that each unique URL is a representation of some object. You can get the contents of that object using an HTTP GET, to delete it, you then might use a POST, PUT, or DELETE to modify the object (in practice most of the services use a POST for this).</p>
<p><strong>How Popular is REST?</strong></p>
<p>All of the major webservices on the Internet now use REST: Twitter, Yahoo&#8217;s web services use REST, others include Flickr, del.icio.us, pubsub, bloglines, technorati, and several others. Both eBay and Amazon have web services for both REST and SOAP.</p>
<p><strong>and  SOAP?</strong></p>
<p>SOAP is mostly used for Enterprise applications to integrate wide types and no. of applications and another trend is to integrate with legacy systems, etc. On the Internet side of things &#8212; Google is consistent in implementing their web services using SOAP, with the exception of Blogger, which uses XML-RPC.</p>
<p><strong>REST vs SOAP</strong></p>
<p>The companies that use REST APIs haven&#8217;t been around for very long, and their APIs came out this year or last year mostly. So REST is definitely In-Vogue  for creating a web service.  But, lets face it &#8212; Use SOAP to wash, and you REST when your tired). The main advantages of REST web services are:</p>
<ul>
<li>Lightweight &#8211; not a lot of extra xml markup</li>
<li>Human Readable Results</li>
<li>Easy to build &#8211; no toolkits required</li>
</ul>
<p>SOAP also has some advantages:</p>
<ul>
<li>Easy to consume &#8211; sometimes</li>
<li>Rigid &#8211; type checking, adheres to a contract</li>
<li>Development tools</li>
</ul>
<p>Is SOAP Simple Object access really that  simple ? I guess a misnomer!</p>
<p>Let&#8217;s discuss all the point of comparisons &#8211;</p>
<p><strong>API Flexibility &amp; Simplicity</strong><br />
The key to the REST methodology is to write Web services using an interface that is already well known and widely used: the URI. For example, exposing a currency converter service, in which a user enters a currency quote symbol to return a real-time target currency price, could be as simple as making a script accessible on a Web server via the following URI: http://www.ExampleCurrencyBrokerage.com/convert?=us-dollar&amp;value=100&amp;target=pound</p>
<p>Any client or server application with HTTP support could easily call that service with an HTTP GET command. Depending on how the service provider wrote the script, the resulting HTTP response might be as simple as some standard headers and a text string containing the current price for the given ticker symbol. Or, it might be an XML document.</p>
<p>This interface method has significant benefits over SOAP-based services. Any developer can figure out how to create and modify a URI to access different Web resources. SOAP, on the other hand, requires specific knowledge of a new XML specification, and most developers will need a SOAP toolkit to form requests and parse the results.</p>
<p><strong>Bandwidth Usage &#8211; REST is Lighter</strong></p>
<p>Another benefit of the RESTful interface is that requests and responses  can be short. SOAP requires an XML wrapper around every request and  response. Once namespaces and typing are declared, a four- or five-digit  stock quote in a SOAP response could require more than 10 times as many  bytes as would the same response in REST.</p>
<p>SOAP proponents argue that strong typing is a necessary feature for  distributed applications. In practice, though, both the requesting  application and the service know the data types ahead of time; thus,  transferring that information in the requests and responses is  gratuitous.</p>
<p>How does one know the data types—and their locations in the  response—ahead of time? Like SOAP, REST still needs a corresponding  document that outlines input parameters and output data. The good part  is that REST is flexible enough that developers could write WSDL files  for their services if such a formal declaration was necessary.  Otherwise, the declaration could be as simple as a human-readable Web  page that says, &#8220;Give this service an input of some stock ticker symbol,  in the format q=symbol, and it will return the current price of one  share of stock as a text string.&#8221;</p>
<p><strong>Security</strong><br />
Probably the most interesting aspect of the REST vs. SOAP debate is the  security perspective. Although the SOAP camp insists that sending remote  procedure calls (RPC) through standard HTTP ports is a good way to ensure Web  services support across organizational boundaries. However,  REST followers argue  that the practice is a major design flaw that compromises network  safety. REST calls also go over HTTP or HTTPS, but with REST the  administrator (or firewall) can discern the intent of each message by  analyzing the HTTP command used in the request. For example, a GET  request can always be considered safe because it can&#8217;t, by definition,  modify any data. It can only query data.</p>
<p>A typical SOAP request, on the other hand, will use POST to communicate  with a given service. And without looking into the SOAP envelope—a task  that is both resource-consuming and not built into most  firewalls—there&#8217;s no way to know whether that request simply wants to  query data or delete entire tables from the database.</p>
<p>As for authentication and authorization, SOAP places the burden in the  hands of the application developer. The REST methodology instead takes  into account the fact that Web servers already have support for these  tasks. Through the use of industry-standard certificates and a common  identity management system, such as an LDAP server, developers can make  the network layer do all the heavy lifting.</p>
<p>This is not only helpful to developers, but it eases the burden on  administrators, who can use something as simple as ACL files to manage  their Web services the same way they would any other URI.</p>
<p><strong>REST ain&#8217;t Perfect</strong><br />
To be wise, REST ain&#8217;t perfect. It isn&#8217;t the best solution for every Web service. Data  that needs to be secure should never be sent as parameters in URIs. And  large amounts of data, like that in detailed purchase orders (POs), can  quickly become cumbersome or even out of bounds within a URI.</p>
<p>And when It comes to attachments, SOAP is a solid winner. SOAP can transport your all text adn BINaries without a glitch. In such cases, SOAP is indeed a solid solution. But it&#8217;s important to try REST  first and resort to SOAP only when necessary. This helps keep  application development simple and accessible.</p>
<p>Fortunately, the REST philosophy is catching on with developers of Web  services. The latest version of the SOAP specification now allows  certain types services to be exposed through URIs (although the response  is still a SOAP message). Similarly, users of Microsoft .NET platform  can publish services so that they use GET requests. All this signifies a  shift in thinking about how best to interface Web services.</p>
<p>Developers need to understand that sending and receiving a SOAP message  isn&#8217;t always the best way for applications to communicate. Sometimes a  simple REST interface and a plain text response does the trick—and saves  time and resources in the process.</p>
<p><strong>Type Handling</strong><br />
SOAP provides relatively stronger typing since it has a fixed set of supported data types. It therefore guarantees that a return value will be available directly in the corresponding native type in a particular platform. Incase of HTTP based APIs the return value needs to be de-serialized from XML, and then type-casted. This may not represent much effort, especially for dynamic languages. Infact, even incase of copmlex objects, traversing an object is very similar to traversing an XML tree, so there is no definitive advantage in terms of ease of client-side coding.</p>
<p><strong>Client-side Complexity (Thinner Clients)</strong><br />
Making calls to an HTTP API is significantly easier than making calls to a SOAP API. The latter requires a client library, a stub and a learning curve. The former is native to all programming languages and simply involves constructing an HTTP request with appropriate parameters appended to it. Even psychologically the former seems like much less effort.</p>
<p><strong>Testing and Troubleshooting</strong><br />
It is also easy to test and troubleshoot an HTTP API since one can construct a call with nothing more than a browser and check the response inside the browser window itself. No troubleshooting tools are required to generate a request / response cycle. In this lies the primary power of HTTP based APIs</p>
<p><strong>Server-side Complexity</strong><br />
Most Programming languages make it extremely easy to expose a method using SOAP. The serialization and deserialization is handled by the SOAP Server library. To expose an object’s methods as an HTTP API can be relatively more challenging since it may require serialization of output to XML. Making the API Rest-y involves additional work to map URI paths to specific handlers and to import the meaning of the HTTP request in the scheme of things. Offcourse many frameworks exist to make this task easier. Nevertheless, as of today, it is still easier to expose a set of methods using SOAP than it is to expose them using regular HTTP.</p>
<p><strong>Caching</strong><br />
Since HTTP based / Rest-ful APIs can be consumed using simple GET requests, intermediate proxy servers / reverse-proxies can cache their response very easily. On the other hand, SOAP requests use POST and require a complex XML request to be created which makes response-caching difficult</p>
<p><strong>VERDICT<img class="alignright" src="http://www.cbssolutions.co.uk/images/wwwroad_large.jpg" alt="" width="300" height="190" /><br />
</strong></p>
<p>In the end I believe SOAP isn&#8217;t that simple, it requires greater implementation effort and  understanding on the client side while HTTP based or REST based APIs  require greater implementation effort on the server side. API adoption  can increase considerably if a HTTP based interface is provided. Infact,  an HTTP-based API with XML/JSON responses represents the best of both  breeds and is easy to implement on the server as well as easy to consume  from a client.</p>
<p>For consuming web services, its sometimes a toss up between which is easier. For instance Google&#8217;s AdWords web service is really hard to consume (in CF anyways), it uses SOAP headers, and a number of other things that make it kind of difficult. On the converse, Amazon&#8217;s REST web service can sometimes be tricky to parse because it can be highly nested, and the result schema can vary quite a bit based on what you search for.</p>
<p>Which ever architecture you choose make sure its easy for developers to access it, and well documented. In the end when you host Web-service for the internet, it&#8217;s the client side complexity that matters most in attracting them to use your service. Choose wisely.</p>
]]></content:encoded>
			<wfw:commentRss>http://geeknizer.com/rest-vs-soap-using-http-choosing-the-right-webservice-protocol/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>HTML 5 drops most awaited open source Video codec</title>
		<link>http://geeknizer.com/html-5-drops-most-awaited-open-source-video-codec/</link>
		<comments>http://geeknizer.com/html-5-drops-most-awaited-open-source-video-codec/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 16:41:13 +0000</pubDate>
		<dc:creator>Tarandeep Singh</dc:creator>
				<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[Web languages]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[web standard]]></category>

		<guid isPermaLink="false">http://geeknizer.com/blog/?p=1340</guid>
		<description><![CDATA[Earlier in my article about HTML 5, we were excited to mention addition of open source video codec. But the bad news is here. HTML 5 will no longer specify... <span class="meta-more"><a href="http://geeknizer.com/html-5-drops-most-awaited-open-source-video-codec/">Read more &#187;</a></span>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" src="http://a.images.blip.tv/Chrisblizzard-connectingHtml5VideoToTheWeb494-542.jpg" alt="" width="256" height="192" /><strong>Earlier in my article about <a href="http://geeknizer.com/blog/?p=121" target="_blank">HTML 5</a>, we were excited to mention addition of open source video codec. But the bad news is here. HTML 5 will no longer specify Ogg Theora as its video codec, the Google employee who maintains the burgeoning web-coding standard has announced.</strong></p>
<p>Ian Hickson wrote that he was reluctantly dropping the open standard due to opposition from Apple, and said the rival H.264 codec could also not be specified due to opposition from other browser vendors. This means HTML 5 will not specify a single codec for web development.</p>
<p>One of the key features of HTML 5 is its native handling of rich media such as video and audio. However, &#8220;there is no suitable codec that all vendors are willing to implement and ship&#8221;, Hickson wrote on the website of the Web Hypertext Application Technology (WHAT) Working Group, the coalition of companies working to develop HTML 5.</p>
<blockquote><p>&#8220;I have therefore removed the two subsections in the HTML 5 spec in which codecs would have been required, and have instead left the matter undefined, as has in the past been done with other features like IMG and image formats,  and plugin APIs, or web fonts and font formats,&#8221; Hickson wrote.</p></blockquote>
<p>Hickson said that Apple will not implement Ogg Theora for Quicktime video due to &#8220;lack of hardware support and an uncertain patent landscape&#8221;, although he acknowledged that he may have oversimplified the situation in that assessment.</p>
<p>Google has implemented both H.264 and Ogg Theora in Chrome. However, Google cannot provide the H.264 codec license to third-party distributors of Chromium, the Linux version of Chrome, and has indicated a belief that Ogg Theora&#8217;s quality-per-bit is not yet suitable for the volume handled by YouTube, according to Hickson.</p>
<p>Opera and Mozilla — the latter of whom has built Ogg Theora support into its recently released Firefox 3.5 — will not implement H.264 due to patent and licensing issues, and Microsoft has &#8220;not commented on their intent to support  at all&#8221;, Hickson wrote.</p>
<p>Hickson suggested two future scenarios: one where Ogg Theora support and use increases to the point where Apple&#8217;s concern regarding patents is reduced, in which case Theora becomes the de facto codec for the web; and one where the relevant H.264 patents expire and that standard becomes freely available, in which case H.264 becomes the de facto technology.</p>
<p>&#8220;The situation for audio codecs is similar, but less critical, as there are more formats,&#8221; Hickson wrote. &#8220;Since audio has a much lower profile than video, I propose to observe the audio feature and see if any common codecs surface, instead of specifically requiring any. I will revisit this particular topic in the future when common codecs emerge.&#8221;</p>
<p>Hickson noted in his post that he was &#8220;incredibly sorry&#8221; about the state of video codecs in HTML 5. &#8220;This is a terrible situation for the spec to be in,&#8221; he wrote. &#8220;I wish we had good answers instead of this quagmirish deadlock.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://geeknizer.com/html-5-drops-most-awaited-open-source-video-codec/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Why choose JavaFX. How to Code. Benchmark Graphics, CPU, Memory</title>
		<link>http://geeknizer.com/why-choose-javafx-how-to-code-benchmark-graphics-cpu-memory/</link>
		<comments>http://geeknizer.com/why-choose-javafx-how-to-code-benchmark-graphics-cpu-memory/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 23:00:01 +0000</pubDate>
		<dc:creator>Tarandeep Singh</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[benchmarks]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[javafx]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[Sun]]></category>
		<category><![CDATA[visualvm]]></category>
		<category><![CDATA[Web languages]]></category>

		<guid isPermaLink="false">http://geeknizer.com/blog/?p=1173</guid>
		<description><![CDATA[JavaFX meets TaranFX. JavaFX is built on top of a mature Runtime that gives developer&#8217;s amazing features. Java being in market since several years, they now have a more sophisticated... <span class="meta-more"><a href="http://geeknizer.com/why-choose-javafx-how-to-code-benchmark-graphics-cpu-memory/">Read more &#187;</a></span>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" style="margin:5px;" src="http://farm3.static.flickr.com/2574/3676841702_13442c7d62_o_d.jpg" alt="" width="238" height="136" /><strong>JavaFX meets TaranFX. </strong></p>
<p>JavaFX is built on top of a mature Runtime that gives developer&#8217;s amazing features. Java being in market since several years, they now have a more sophisticated API.</p>
<p><em>Update: This Blog post is Winner of <a href="http://javafx.com/blogcontest/" target="_blank">Java Blogging Contest</a>.</em></p>
<p><strong>So what is JavaFX Hype all about?</strong></p>
<p>I first got to hear about JavaFX more than a year back when I attended Sun Tech days. It wasn&#8217;t very mature at that time and failed to catch my attention. It was this year in Feb, when I saw a momentum and maturity in this platform, which encouraged me to take my steps further.</p>
<p>JavaFX gives developers an amazing feature-Rich API which will help them build scalable, fully integrated, Rich  Graphics, Animated applications for the web. The beauty of JavaFX lies in the fact that its base (JVM) is already installed on all computers(90%).</p>
<p>When I first saw the API, I was amazed that it had so much pre-built into the API. e.g. All the common transitions like fading, scrolling, perspective animations are built-in. All you need is the idea and you can be all set to make the most powerful web application.</p>
<p>Being a Java at heart, you can always integrate it with existing java applications. Imagine a Live graphic Rich market-watch client talks directly to a EJB server to fetch live quotes and prepare animated graphs of statistical data and analytics to help you invest for future.</p>
<p>The feature I loved the most was, &#8220;applications are draggable to desktop&#8221;. Since apps run in JVM of local machine, though they open in browser, they can be dragged and dropped to desktop without interrupting any operation or performance.</p>
<p>Here is What I intend to Cover:</p>
<p>1. Example: How to Code Web Gallery in Javafx</p>
<p style="padding-left: 30px;">i. Basic Overview</p>
<p style="padding-left: 30px;">ii. The Code</p>
<p style="padding-left: 60px;">a. Brief on animation Terminologies</p>
<p style="padding-left: 60px;">b. Basic Code.</p>
<p style="padding-left: 60px;">c. Transitions.</p>
<p>2. Benchmarking</p>
<p style="padding-left: 30px;">i. Hardware used.</p>
<p style="padding-left: 30px;">ii. Invocation and Startup</p>
<p style="padding-left: 60px;">a. Observations</p>
<p style="padding-left: 60px;">b. JavaFX vs. Flash</p>
<p style="padding-left: 60px;">c. Conclusion</p>
<p style="padding-left: 30px;">iii. Animated Transitions and Full Image load:</p>
<p style="padding-left: 60px;">a. Key Observations</p>
<p style="padding-left: 60px;">b. Conclusion</p>
<p>3. Verdict</p>
<p style="padding-left: 30px;">i. Pros and Cons.</p>
<p style="padding-left: 60px;">
<p style="padding-left: 60px;">
<p>Let&#8217;s start with an example.</p>
<p><strong>1. Example: How to Code Web Gallery in JavaFX</strong></p>
<p>Before we start, you can have a Quick look at what we are going to achieve over <a href="http://geeknizer.com/gallery">here</a>. It&#8217;s a decent web gallery inspired by one of them demoed on <a href="http://www.javafx.com" target="_blank">Javafx site</a>. I took that gallery and re-wrote most of it to achieve the following:</p>
<p style="padding-left: 30px;">1. Redesign UI to match my taste and site&#8217;s theme.</p>
<p style="padding-left: 30px;">2. Optimize the code to max possible.</p>
<p>I did the latter to Benchmark JavaFX&#8217;s capabilities, as described in a later section. For now let&#8217;s look at the basics of JavaFX application design. Before we start, Let&#8217;s look at what did I make.</p>
<p style="text-align: center;"><a title="JavaFX gallery by TaranFX" href="http://geeknizer.com/gallery" target="_blank"><img class="aligncenter" title="Javafx Gallery Taranfx.com" src="http://farm4.static.flickr.com/3258/3675429271_e2dbee38a2_o_d.jpg" alt="" width="649" height="389" /></a></p>
<p>The Gallery is a JavaFX Frontend GUI with a backend supported by java <a href="http://www.flickr.com/services/api/" target="_blank">Flickr API</a>. On Load, Flickr is queried with REST API as <em>http://api.flickr.com/services/rest/?method=flickr.people.getPublicPhotos&amp;user_id=24847938@N07&amp;api_key={apiKey}&amp;per_page={</em><em>thunbLayout</em><em>.count}</em></p>
<p>HereI am sending request to Flickr to return me all public Photos for the user_id specified and per page show me {<em>thunbLayout</em>.<em>count</em>} many results per page using my unique API key.</p>
<p>This metaData when loaded, loads the 1st page of thumbnails. On selection via keyboard or mouse click on a pic, it opens for medium size and fizes the aspect ratio on load. While image is loaded, it is animated with Fade transition effect built into JavaFx. Let&#8217;s look at the code and things will get more clearer.</p>
<p><strong>ii. The Code</strong></p>
<p>Before we start, lets get you familiar with Jargons.</p>
<p><strong>a. Basic Animation Terminologies:</strong></p>
<p>Like Flash, JavaFX uses the generalized concept of Animations by using standard animation industry jargons. The First thing to learn is using <strong>Stages</strong> and <strong>Scenes</strong>. <strong>Stage</strong> is the main/core Placeholder for your JavaFX application. <strong>Scene</strong> is an independent widget which fits into Stage. Multiple Scenes can be put inside stage but there will be only one stage per application.</p>
<p><strong>b. The Basic Code:</strong></p>
<p>JavaFX made it really easy to code. Here is the code syntax:</p>
<p>[code lang="javascript"]<br />
var stage = Stage {<br />
title: "Taranfx Gallery"<br />
width: 840<br />
height: 520<br />
visible: false<br />
style: StageStyle.TRANSPARENT<br />
scene: bind scene<br />
}</p>
<p>function run() {<br />
initUI();<br />
stage.visible = true;<br />
// Set focus to background by default<br />
bgRect.requestFocus();<br />
}</p>
<p>[/code]</p>
<p>Here, run() Method is the default main method inside Main.fx class. So setting stage to visible, and getting the focus, does the job!</p>
<p>Now Let&#8217;s create scene for our thumbnails:</p>
<p>[code lang="javascript"]</p>
<p>var scene : Scene = Scene {<br />
width: 840<br />
height: 520<br />
content: Group {<br />
content: bind stageContent //defined below inside initUI()<br />
clip: Rectangle {<br />
width: bind layout.width<br />
height: bind layout.height<br />
arcWidth: 20<br />
arcHeight: 20<br />
}<br />
}<br />
fill: Color.TRANSPARENT<br />
}; [/code]</p>
<p>And Instantiate the UI components:</p>
<p>[code lang="javascript"]</p>
<p>function initFrontUI() {</p>
<p>descTxt = Text {<br />
x: bind layout.thumbX<br />
y: bind layout.descTxtY<br />
font: bind layout.descFont<br />
wrappingWidth: bind (layout.thumbGroupW - 10)<br />
content: bind description<br />
fill: Color.WHITE<br />
smooth: true<br />
textOrigin: TextOrigin.TOP<br />
clip: Rectangle {    // calculations for layout<br />
x: bind descText.x<br />
y: bind (descText.y - 2)<br />
width: bind (layout.width - 20)<br />
height: bind ( layout.thumbGroupY - descTxt.y - 17)<br />
}<br />
}</p>
<p>stageContent = [<br />
backRect, titleBar, nxtButton, bckButton, exitButton,<br />
descTxt, thumbGroup, pageBttnGroup,<br />
fullView, progressBar,fiv.saveBttn    //names are self explanatory, last one is save button inside Scene Full Image view.<br />
];</p>
<p>getImageData();  // Call Flickr REST API using standard Java Flickr API. Loads list of thumb image src, description, etc.<br />
}[/code]</p>
<p><strong>c. Transitions:</strong></p>
<p>Now look at how Transitions are created. To achieve the animation effect, you have to play with the javafx.animation.<strong>Timeline</strong>, javafx.animation.<strong>KeyFrame</strong>. Again, these are generic words used in animation industry (same with Flash). If you are new to animation, let me define it for you. <strong>Timeline </strong>is the time scale of the animation which consists of number of frames through which animation will move. <strong>KeyFrame </strong>is the frame with concrete data i.e. Initial or final state of the animation and in-between the frames happens the transition that creates animated illusion. The animation used, when you select a thumbnail to view fullImage, is demonstrated below:</p>
<p>[code lang="javascript"]</p>
<p>var tL:Timeline = Timeline {<br />
rate: bind tLRate with inverse<br />
keyFrames: [<br />
KeyFrame {<br />
time: 1s<br />
values: [ opacity =&gt; 1.0 tween Interpolator.LINEAR ]<br />
canSkip: true<br />
}<br />
]<br />
};</p>
<p>...</p>
<p>function fadeEffect() {</p>
<p>if(visible) {       // javafx.scene.Node.visible, if current stage is visible, its set true.<br />
tL.time = 0s;<br />
tLRate = 1.0;<br />
opacity = 0.2;<br />
visible = true;<br />
} else {<br />
tL.time = 2s;<br />
tLRate = -2.0;<br />
opacity = 1.0;<br />
}<br />
tL.play();<br />
}</p>
<p>[/code]</p>
<p>Animations are so easy to code. I just loved it.</p>
<p>I don&#8217;t trust any hypes, statistics till I test them on my own. Proceed with the next section and you will know what convinced me here.</p>
<p>.</p>
<p><span><span style="font-family: Verdana;"><strong>2. Benchmarking the JavaFX</strong> (Gallery example):</span></span></p>
<p><strong>i. Hardware used:</strong></p>
<p>Notebook: Dell XPS</p>
<p>Processor: Intel Core 2 Duo 2.2Ghz @800Mhz FSB</p>
<p>RAM:<em> </em>2.5GB</p>
<p>Graphics: Standard Intel extreme</p>
<p>(I have a Nvidia notebook as well but I wanted to test it on the onboard graphics to check how bad can it get.)</p>
<p>Tools: Netbeans 6.5, <a href="http://geeknizer.com/blog/?p=930" target="_blank">VisualVM</a> 1.1</p>
<p><strong>ii. Invocation &amp; Startup:</strong></p>
<p>JavaFX startup is pretty heavy for initial 10 seconds. During this interval, It is supposed to load a large number of underlying classes.</p>
<p>The main loader is <strong>com.sun.javafx.runtime.main.Main.class</strong>, packaged inside the distributable Jar. In a web browser, actual invocation starts from the javascript from URL &#8220;http://dl.javafx.com/1.2/dtfx.js&#8221;.<br />
This Javascript looks for &#8220;Javafx&#8221; method inside the HTML &lt;script&gt; tag. In this tag, information about the &#8220;JAR to load&#8221; is present. JAVAFX runtime Main.class takes over the control and loads the Projectname_browser.jnlp which invokes the actual jar user classes i.e. com.taranfx.* in this case.<br />
Before loading your Main class i.e. com.taranfx.Main.fx, it loads all the base underlying classes to support the Javafx features.</p>
<p><img class="alignleft" style="margin:10px;" title="Javafx profiling CPU, Memory" src="http://farm3.static.flickr.com/2570/3676241004_28b0c003f4_o_d.jpg" alt="" width="717" height="504" /></p>
<p style="text-align: left;"><strong>a. Observations:</strong></p>
<p style="text-align: left;">My application had import for around 200 classes and 20 classes were defined under com.taranfx.*. The Total classes loaded after the start-up was nearing 4000.<br />
If you look at the graph above, loaded classes for first peek was 2500. This is the point where JavaFX started reading my com.taranfx.* package. This means, at all times for JavaFX to start empty, it will need 2500 runtime classes. During this time, (almost 6 seconds), CPU utilization is max. On my Dual core it was able to eat upto 70% CPU though it was using only 7mb of heap.<br />
If you look at the CPU graph, the second peek was incurred when my classes started executing. This was the time when Request for Flickr REST API was being generated. During this, CPU utilization of 27%, Heap size of 12mb was observed. The third CPU peek came when response from Flickr was received, and images were starting to appear. Loading of 50 images (10in a row x 5 in a column) took peek utilization of 25.5%. As clear from Memory utilization graph, Images were being loaded and heap size was increasing in steps till 20mb of which roughly 13mb was being used. Immediately after this, a substantially GC call reduced the memory overhead. (after this watever memory increase you see is because of my further operations in GUI, we will consider them in next section)
</p>
<p style="text-align: left;"><img class="aligncenter" src="http://farm3.static.flickr.com/2539/3675428237_0c74dd7b3e_o_d.jpg" alt="" width="723" height="501" /></p>
<p>.</p>
<p><strong>b. JavaFX vs. Flash</strong><br />
Now, I had a similar application in Flash ofcourse pretty different in layout, etc but similar functionality. Let&#8217;s compare those statistics with JavaFX.</p>
<p>It was roughly 40% at first peak with RAM usage of 4mb, and then 20% second peek with 10mb, and 3rd peek 29% with 19mb RAM.</p>
<p><strong>c . Conclusion:</strong><br />
All the performance statistics were pretty close to Adobe Flash but were mostly on the higher side which is but obvious because its VM <img src='http://geeknizer.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>.</p>
<p><strong>iii. Animated Transitions </strong><strong>and Full Image load</strong><strong>:<br />
</strong>So after loading of thumbnails is over, next comes the main application. Navigating quickly between images as it prepares requests for each of the image to be downloaded for preview. Let&#8217;s discuss the Performance of the application during power user usage. Since the application has lots of animations specially Fade transitions, We will compare how well are those can run on our machines.</p>
<p>Please note, I have chosen animation mainly as fade as it needs alot of CPU juice to run smoothly. Infact, smooth fading was far from reality in Swing. So let&#8217;s see how well JavaFX handles this in new refined JVM.</p>
<p>Let&#8217;s now look at the profiling:</p>
<p style="text-align: left;"><img class="aligncenter" src="http://farm4.static.flickr.com/3012/3675428551_0a335e63d8_o_d.jpg" alt="" width="723" height="533" /></p>
<p style="text-align: left;"><strong>a. Key Observations:</strong></p>
<p style="text-align: left;">Refer to the CPU, the first wave peek you see is at approx. 15 seconds from when all thumbs were loaded. This peek was incurred due to my first click, which triggered the very first transitioning of fading all 50 thumbnails screen to Full Image preview (class ). Fading was very smooth and what a surprise it took just 19% of my CPU. Are you kidding me JavaFX ? Fading involves a number of interpolated frames during the transition time (set to 2 seconds) and frame rate of decent <em>20 fps</em> was observed (I used a screen capture tool that auto-detects frame rate of the screen, it gave 20.3 fps)</p>
<p>Moving on, I became a power user (clicking madly on all images and then returning back) at full pace. Clicked images were being loaded in background threads while new images being licked were having fading transitions, one by one  being put to backround thread queue to load images from flickr. As expected, it resulted in good CPU utilization, though transitions still remained smooth as before. CPU wasn&#8217;t kicked much it ranged between 30 to 60% which is pretty expected, no surprises. But one thing impressed me, Heap Usage. It didn&#8217;t eat much of the Heap. At start, Heap size was 20MB (15mb used), it then raised only to 25mb after 40 seconds of power user activity. GC wasn&#8217;t kicked more than once and it reduced Used heap from 20 to 15mb making it less hungry for more Heap. I must admit, memory management was pretty good.</p>
<p style="text-align: left;">Now let&#8217;s look at the other part, the most active Threads.</p>
<p style="text-align: left;"><img class="aligncenter" src="http://farm4.static.flickr.com/3619/3675428897_f573df61c8_o_d.jpg" alt="" width="740" height="371" /></p>
<p>Java.util.concurrent.<strong>FutureTask.run</strong>() ate most of the CPU. Because of high number of requests, large no of threads got created, and for obvious reasons, this had to be the highest usage. Second highest is javax.swing.<strong>SystemEventQueueUtitlities</strong>, which is a old class from the generation of swings exposing some generic UI utilities. This involves the fading, and other graphical operations. Third was sun.rmi.transport.tcp.TCPTransport, this was for TCP connection to Flickr. The CPU usage for this thread is during translation of TCP requests from Java to right to your OS protocol stack.</p>
<p><strong>b. Conclusion</strong></p>
<p>I&#8217;m still left astonished if this was possible inside VM! The Ability of Graphics (atleast for 2D) is brilliant. Later on when I took the same test to Nvidia platform, I did see noticeable differences. The Fade effect had risen from bare 20fps to 28fps.</p>
<p><strong>3. The VERDICT!</strong></p>
<p><strong>The Pros:</strong></p>
<p>- Solid API with bundled inbuilt features for almost anything you will need.</p>
<p>- Brilliant Graphics Rendering (2D)</p>
<p>- Low on CPU usage than previous generation of JavaVMs.</p>
<p>- Comparble performance for generic RIA.</p>
<p>- Excellent memory management. (it&#8217;s not just standard VM memory management, there&#8217;s more to it.)</p>
<p>- OpenSource: A More open approach to RIA in the industry as compared to Flash, Silverlight like AJAX.</p>
<p>- Universal Language for Desktop, mobiles, other portables.</p>
<p><strong>The Cons:</strong></p>
<p>Nothing in the world is without Cons, even JavaFX has it:</p>
<p>- <strong>Graphics and multimedia</strong> are powerful on JavaFX, but it runs in JVM and not the real system, hence graphics can never be as powerful as native applications like Adobe Flash. The <strong>high complexity advanced 2D, 3D graphics</strong> will suffer significant performance hits inside VM. Such aplications will have more floating point calculations and More frequent memory allocation/de-allocations which will choke VM. (Though, for low complexity 2D, jaavaFX might beat Flash)</p>
<p>- Another -ve is for <strong>Video and High definition</strong>: The mediaplayer (via API) in JavaFX is able to attain a decent framerate of 24/25fps and CPU utilization goes to peak during this playback over SD (Standard definition). Now if you are looking for HD content to go via JavaFX, it&#8217;s not possible at this time. I used the same hardware as in the benchamark. CPU utilization goes to peak to achieve that framerate for SD.</p>
<p>For Playing 720p and 1080p HD content, VM came to the knees, failed to provide any tolerable frame rates. Definitely, needs lot of improvement in this sector. May be Sun can develop native APIs to interact for each Nvidia CUDA, ATI graphics Kernel for each platform to accelerate this. This could encourage 3d gaming in  JavaFX. (though this is very hard to do and maintain keepin platform independence in mind.).</p>
<p>- A big challenge awaits javafx to reduce <strong>Load times</strong>. To load startup classes, it takes 10-20 seconds depending upon the application and CPU you are using. Flash is much faster at this.</p>
<p>Definitely I found my effort worth while after days of playing with JavaFX. I can proudly say it will stand as a clear challenger to Flash (provided few things improve, specially load times). From the past trend of Sun, it has innovated in every field of Java and will continue to do so. And now that It&#8217;s with <a href="http://geeknizer.com/blog/?p=1014" target="_blank">Oracle and Larry Ellison</a>, I don&#8217;t have a doubt about its future.</p>
<p><img class="alignright" src="http://techblog.gr/wp-content/uploads/2008/12/javafx.jpg" alt="" width="530" height="139" /></p>
<p>Future could be JavaFX. Are you Ready?</p>
<p>Get Started <a href="http://www.javafx.com" target="_blank">www.Javafx.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://geeknizer.com/why-choose-javafx-how-to-code-benchmark-graphics-cpu-memory/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
	</channel>
</rss>

