<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>SOS</title>
	<atom:link href="http://shaneosullivan.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://shaneosullivan.wordpress.com</link>
	<description>Shane O&#039;Sullivan&#039;s technical blog... really ties the room together</description>
	<lastBuildDate>Tue, 18 Jun 2013 03:56:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='shaneosullivan.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>SOS</title>
		<link>http://shaneosullivan.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://shaneosullivan.wordpress.com/osd.xml" title="SOS" />
	<atom:link rel='hub' href='http://shaneosullivan.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Edgeconf 2012 Web Performance Panel</title>
		<link>http://shaneosullivan.wordpress.com/2013/02/12/edgeconf-2012-web-performance-panel/</link>
		<comments>http://shaneosullivan.wordpress.com/2013/02/12/edgeconf-2012-web-performance-panel/#comments</comments>
		<pubDate>Tue, 12 Feb 2013 03:12:28 +0000</pubDate>
		<dc:creator>Shane O'Sullivan</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://shaneosullivan.wordpress.com/?p=613</guid>
		<description><![CDATA[Edgeconf 2012 Web Performance Panel I had a great time at Edgeconf, taking part in the Web Performance panel. We got to discuss many of the common issues that web developers face when building complex web apps, such as avoiding reflow, repaints and avoiding garbage collection. The full video is available now HERE. The slides [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=613&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a title="Edgeconf 2012 Web Performance Panel" href="http://m.youtube.com/#/watch?v=3-WYu_p5rdU&amp;feature=plpp">Edgeconf 2012 Web Performance Panel</a></p>
<p>I had a great time at Edgeconf, taking part in the Web Performance panel. We got to discuss many of the common issues that web developers face when building complex web apps, such as avoiding reflow, repaints and avoiding garbage collection.</p>
<p>The full video is available now <a href="http://www.youtube.com/watch?v=3-WYu_p5rdU&amp;list=SPNYkxOF6rcICCU_UD67Ga0qLvMjnBBwft&amp;index=3">HERE</a>.</p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/3-WYu_p5rdU?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span>
<p>The slides are available here<br />
<iframe src='http://www.slideshare.net/slideshow/embed_code/16478709' width='425' height='348'></iframe></p>
<p>All other panel videos are available <a href="http://www.youtube.com/playlist?list=PLNYkxOF6rcICCU_UD67Ga0qLvMjnBBwft">HERE</a>, or will be soon if not yet uploaded.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shaneosullivan.wordpress.com/613/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shaneosullivan.wordpress.com/613/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=613&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shaneosullivan.wordpress.com/2013/02/12/edgeconf-2012-web-performance-panel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abaeb4f7149a11600f472c23652ae7db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shaneosullivan</media:title>
		</media:content>
	</item>
		<item>
		<title>Click, change then animate: My self imposed rule for a fast &amp; smooth UI</title>
		<link>http://shaneosullivan.wordpress.com/2012/10/14/click-change-then-animate-my-self-imposed-rule-for-a-fast-smooth-ui/</link>
		<comments>http://shaneosullivan.wordpress.com/2012/10/14/click-change-then-animate-my-self-imposed-rule-for-a-fast-smooth-ui/#comments</comments>
		<pubDate>Sun, 14 Oct 2012 19:35:03 +0000</pubDate>
		<dc:creator>Shane O'Sullivan</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://shaneosullivan.wordpress.com/?p=581</guid>
		<description><![CDATA[A few months ago I joined the Ads Interfaces team at Facebook, after almost two years on the mobile team, and am very proud of being part of the group that shipped a full rewrite of the Ads Create Flow (http://www.facebook.com/ads/create) last week.  The application is highly complex, with many varying user interface elements, lots [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=581&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>A few months ago I joined the Ads Interfaces team at Facebook, after almost two years on the mobile team, and am very proud of being part of the group that shipped a full rewrite of the Ads Create Flow (<a title="Create an Ad on Facebook" href="http://www.facebook.com/ads/create" target="_blank">http://www.facebook.com/ads/create</a>) last week.  The application is highly complex, with many varying user interface elements, lots of data floating around, validations and so forth, so it made sense to write it 100% client side in JavaScript. </p>
<p>In many ways it&#8217;s a standard MVC application with</p>
<ul>
<li>declarative view definitions, so you can easily relate the code to what you see in the Web Inspector</li>
<li>well defined data models which can be observed for changes</li>
<li>bidirectional bindings between views and models to keep the UI in sync with the data.  That is, if a piece of data changes, the UI should just update itself.  Of course, it is also possible to add code in between any binding if some more complex processing is needed.  For example, when changing the top level objective (clicking one of the huge buttons), I wanted it to animate the change, so rather the transference of the data update is delayed.</li>
</ul>
<p><strong>My New Rule</strong></p>
<p>One of the primary lessons I took away from this is that asynchronous data fetching is one of the leading causes of users feeling like a UI is &#8220;webby&#8221;.  That feeling where the interface suddenly, with a jerk, jumps around and changes size.</p>
<p>This is often caused by images loading, or by an API call returning, resulting in the UI being redrawn.</p>
<p>I decided on a new rule to apply to interfaces I work on:</p>
<blockquote><p><strong>The UI can change suddenly when the user interacts with it.  All other changes should be smooth.</strong></p>
</blockquote>
<p>What this means is if the user clicks a link or a button, it&#8217;s OK to immediately change the UI, since they can see the causation.  However if new data comes back, or a large image loads shifting the entire UI up or down, this should be smoothly animated. </p>
<p>I&#8217;ve found that this both gives an interface a more polished feel, but also draws the users eye to important information.  In addition, if they were already reading something, trying to make a choice of what to click next, if that jumps even a couple of centimeters they have to start searching for it again &#8211; it may have gone below the bottom of the screen.  However if it smoothly moves there over 300ms, they continue without much interruption.</p>
<p>It&#8217;s important to not go overboard with this of course.  Don&#8217;t animate everything, as it&#8217;ll feel gratuitous.  I&#8217;ve found that sticking to animating only asynchronous operations leads to an application feeling both fast and professional.</p>
<p style="text-align:center;"><a title="Create an Ad on Facebook" href="http://www.facebook.com/ads/create" target="_blank"><img id="i-598" class=" wp-image aligncenter" alt="Image" src="http://shaneosullivan.files.wordpress.com/2012/10/createflowscreenshot.png?w=975&#038;h=960" height="960" width="975" /></a></p>
<p>Some examples in the Ads Create Flow are the large image that loads for Sponsored Stories (the bottom picture), and the entire Ad preview that loads as a result of a data callback (under Right Hand Column Preview).</p>
<p style="text-align:center;"><a href="http://shaneosullivan.files.wordpress.com/2012/10/ie_bad_time.png"><img id="i-609" class="size-full wp-image aligncenter" alt="Image" src="http://shaneosullivan.files.wordpress.com/2012/10/ie_bad_time.png?w=150&#038;h=150" height="150" width="150" /></a></p>
<p>One caveat is that on IE 8 &amp; 9, you&#8217;re going to have a bad time.  I chose to not bother with janky timer based animation solutions, both in the interest of saving time, and from a healthy disdain for legacy browsers.  So, I advise to stick with CSS3 animations, and let the users of old browsers have a working but less attractive application.  </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shaneosullivan.wordpress.com/581/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shaneosullivan.wordpress.com/581/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=581&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shaneosullivan.wordpress.com/2012/10/14/click-change-then-animate-my-self-imposed-rule-for-a-fast-smooth-ui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abaeb4f7149a11600f472c23652ae7db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shaneosullivan</media:title>
		</media:content>

		<media:content url="http://shaneosullivan.files.wordpress.com/2012/10/createflowscreenshot.png?w=975" medium="image">
			<media:title type="html">Image</media:title>
		</media:content>

		<media:content url="http://shaneosullivan.files.wordpress.com/2012/10/ie_bad_time.png?w=150" medium="image">
			<media:title type="html">Image</media:title>
		</media:content>
	</item>
		<item>
		<title>What Git branch was I working on again?</title>
		<link>http://shaneosullivan.wordpress.com/2012/06/16/what-git-branch-was-i-working-on/</link>
		<comments>http://shaneosullivan.wordpress.com/2012/06/16/what-git-branch-was-i-working-on/#comments</comments>
		<pubDate>Sat, 16 Jun 2012 00:48:08 +0000</pubDate>
		<dc:creator>Shane O'Sullivan</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[branch]]></category>
		<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://shaneosullivan.wordpress.com/2012/06/16/what-git-branch-was-i-working-on-again-2/</guid>
		<description><![CDATA[A situation I often find myself is remembering what Git branch I was working a few hours ago.  Partially this is my own fault, since I tend to name Git branches after task IDs, e.g. &#8220;12345&#8243;, in order to easily find them, but also just my brain has limited space and can&#8217;t remember more than [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=574&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>A situation I often find myself is remembering what Git branch I was working a few hours ago.  Partially this is my own fault, since I tend to name Git branches after task IDs, e.g. &#8220;12345&#8243;, in order to easily find them, but also just my brain has limited space and can&#8217;t remember more than three things at any one time.</p>
<p>A useful command I&#8217;ve found (for the Mac and probably Linux) is the following</p>
<p><code>for k in `git branch|perl -pe s/^..//`;do echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k|head -n 1`\\t$k;done|sort -r</code></p>
<p>This prints out a list of your branches, and the length of time since you last checked them out.  It makes it really easy to find that unmemorable branch.</p>
<p>Of course, it&#8217;s easier if you put that command in a reusable function, e.g.</p>
<p><code></p>
<pre>function listGitBranchesByMod() {
    for k in `git branch|perl -pe s/^..//`;do echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k|head -n 1`\\t$k;done|sort -r
}</pre>
<p></code></p>
<p>inside some *.sh file on your PATH.</p>
<p>
I found this somewhere on the web, and cannot find it again.  If it was you, please let me know so I can link to the original.  Oh, and thanks!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shaneosullivan.wordpress.com/574/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shaneosullivan.wordpress.com/574/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=574&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shaneosullivan.wordpress.com/2012/06/16/what-git-branch-was-i-working-on/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abaeb4f7149a11600f472c23652ae7db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shaneosullivan</media:title>
		</media:content>
	</item>
		<item>
		<title>Caching Events in Mobile Safari is a bad idea</title>
		<link>http://shaneosullivan.wordpress.com/2012/05/03/caching-events-in-mobile-safari-is-a-bad-idea/</link>
		<comments>http://shaneosullivan.wordpress.com/2012/05/03/caching-events-in-mobile-safari-is-a-bad-idea/#comments</comments>
		<pubDate>Thu, 03 May 2012 15:59:57 +0000</pubDate>
		<dc:creator>Shane O'Sullivan</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://shaneosullivan.wordpress.com/?p=556</guid>
		<description><![CDATA[A recent issue with JavaScript devlopment that I&#8217;ve come across on Mobile Safari (note: not desktop Safari) is that if you add an event listener to a DOM node and for whatever reason keep a reference to the Event object you receive, you&#8217;ll run into errors. This is because the same Event object is reused,  [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=556&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>A recent issue with JavaScript devlopment that I&#8217;ve come across on Mobile Safari (note: not desktop Safari) is that if you add an event listener to a DOM node and for whatever reason keep a reference to the Event object you receive, you&#8217;ll run into errors.</p>
<p>This is because the same Event object is reused,  with its properties being updated every time.  I presume this is to conserve memory on mobile devices, as it is both in short supply and causes too much garbage collection, the enemy of responsive UIs.</p>
<p>The simple solution is, rather than caching the Event object (a bad idea any as it prevents it being garbage collected on other platforms), take what information you need from it, such as touch coordinates, and cache those instead.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shaneosullivan.wordpress.com/556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shaneosullivan.wordpress.com/556/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=556&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shaneosullivan.wordpress.com/2012/05/03/caching-events-in-mobile-safari-is-a-bad-idea/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abaeb4f7149a11600f472c23652ae7db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shaneosullivan</media:title>
		</media:content>
	</item>
		<item>
		<title>Dynamically change deviceDpi on iOS</title>
		<link>http://shaneosullivan.wordpress.com/2011/12/13/dynamically-change-devicedpi-on-ios/</link>
		<comments>http://shaneosullivan.wordpress.com/2011/12/13/dynamically-change-devicedpi-on-ios/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 17:26:26 +0000</pubDate>
		<dc:creator>Shane O'Sullivan</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://shaneosullivan.wordpress.com/2011/12/13/dynamically-change-devicedpi-on-ios/</guid>
		<description><![CDATA[When Apple released the iPhone 4 with a retina display, they quadrupled the pixel density.  This caused problems for websites, as all their assets would now look tiny.  To solve this, Apple made it so that websites would keep the old low density rather than the retina display, and would allow sites to opt in [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=553&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>When Apple released the iPhone 4 with a retina display, they quadrupled the pixel density.  This caused problems for websites, as all their assets would now look tiny.  To solve this, Apple made it so that websites would keep the old low density rather than the retina display, and would allow sites to opt in to using the hi-res display.</p>
<p>This is done by adding a &lt;meta&gt; tag to the header, like</p>
<p>  &lt;meta name=&#8221;viewport&#8221; content=&#8221;initial-scale=0.5,maximum-scale=0.5,user-scalable=no,width=device-width,height=device-height,target-densityDpi=device-dpi&#8221; /&gt;</p>
<p>Note the 0.5 for the scale values.  This resizes the screen to take advantage of the full retina display.  Pretty.  To use the low-res version, the scale parameters are 1.</p>
<p>However, if you&#8217;re writing a static HTML based web app, with no backend, you can&#8217;t go sniffing the user agent to figure out whether to set the scale to 0.5 or 1 before generating the page, so you&#8217;ll have to do it in JavaScript.</p>
<p>Code!!</p>
<p>Here&#8217;s a simple script to do that, from my colleagues on the JSGameBench project at Facebook.  To use this, first put the meta tag above into the &lt;head&gt; of your document, with scale values of 1.</p>
<p>  if (window == window.top) {<br />        var meta_viewport = document.querySelector &amp;&amp;<br />          document.querySelector(&#8220;meta[name=viewport]&#8220;);<br />        if (meta_viewport &amp;&amp; window.devicePixelRatio &gt;= 2 ) {<br />          meta_viewport.setAttribute(&#8216;content&#8217;, &#8216;user-scalable=no, width=device-width, height=device-height, initial-scale=0.5, maximum-scale=0.5&#8242;);<br />        }<br />  }</p>
<p>The script looks for the meta tag, checks if you have a hi-res Apple display, and switches the device screen scale to use all the pixels, not just one in four.</p>
<p><strong>One more thing&#8230;..</strong></p>
<p>If your web app uses CSS like</p>
<p>html, body {<br />  width: 100%;<br />  height: 100%;<br />}</p>
<p>to fit the app to the screen dimensions, and inside perhaps you have some JS based scroller, then you&#8217;ll need two further lines.  The script then becomes</p>
<p>if (window == window.top) {<br />  var meta_viewport = document.querySelector &amp;&amp; <br />    document.querySelector(&#8220;meta[name=viewport]&#8220;);<br />  if (meta_viewport &amp;&amp; window.devicePixelRatio &gt;= 2 ) {<br />    meta_viewport.setAttribute(&#8216;content&#8217;, &#8216;user-scalable=no, width=device-width, height=device-height, initial-scale=0.5, maximum-scale=0.5&#8242;);<br />    document.body.style.width = &#8217;200%&#8217;;<br />    document.body.style.height = &#8217;200%&#8217;;<br />  }<br />}:</p>
<p>Without these extra lines, the page will only occupy one quarter of the screen, rather than all of it.</p>
<p>Now you have an app that looks right on older iOS devices, but still uses the hi-res screen of the iPhone4 for really sharp fonts and more.</p>
<p><strong>Finally</strong></p>
<p><strong></strong>Make sure that when designing your borders and other screen elements to use multiples of two.  E.g. have your borders be 2px, not 3px, so that when the phone divides them by two it&#8217;ll look right.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shaneosullivan.wordpress.com/553/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shaneosullivan.wordpress.com/553/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=553&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shaneosullivan.wordpress.com/2011/12/13/dynamically-change-devicedpi-on-ios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abaeb4f7149a11600f472c23652ae7db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shaneosullivan</media:title>
		</media:content>
	</item>
		<item>
		<title>Tracking memory usage on WebOS with GnuPlot</title>
		<link>http://shaneosullivan.wordpress.com/2011/10/16/tracking-memory-usage-on-webos-with-gnuplot/</link>
		<comments>http://shaneosullivan.wordpress.com/2011/10/16/tracking-memory-usage-on-webos-with-gnuplot/#comments</comments>
		<pubDate>Sun, 16 Oct 2011 01:47:48 +0000</pubDate>
		<dc:creator>Shane O'Sullivan</dc:creator>
				<category><![CDATA[performance]]></category>
		<category><![CDATA[WebOS]]></category>

		<guid isPermaLink="false">http://shaneosullivan.wordpress.com/?p=546</guid>
		<description><![CDATA[I&#8217;ve been fighting against a serious memory leak in a WebOS app I&#8217;m developing, and unfortunately the tools available for WebOS are no help whatsoever for these kinds of problems. There is a program available for WebOS called JsTop, but the data that it tracks doesn&#8217;t show that my app is using lots of memory, [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=546&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been fighting against a serious memory leak in a WebOS app I&#8217;m developing, and unfortunately the tools available for WebOS are no help whatsoever for these kinds of problems. There is a program available for WebOS called JsTop, but the data that it tracks doesn&#8217;t show that my app is using lots of memory, while at the same time the Touchpad is crashing with the infamous &#8220;Too Many Cards&#8221; error, with just one card on the screen.</p>
<p>So, I decided to see what I can do about it. A little fiddling with novaterm, grep, awk and GnuPlot has helped me a lot, and hopefully it can help you too.</p>
<p><a href="http://shaneosullivan.files.wordpress.com/2011/10/webos_gnuplot.png"><img class="alignnone size-full wp-image-547" title="WebOS GnuPlot" src="http://shaneosullivan.files.wordpress.com/2011/10/webos_gnuplot.png?w=560&#038;h=468" alt="" width="560" height="468" /></a></p>
<p>The image above shows the percentage memory (red) and CPU (green) usage over time of the WebAppMgr process in WebOS, which is essentially where all the apps are executed.  To get a graph like this, download the following two scripts (Mac/Linux/Cygwin only):</p>
<p><a href="http://chofter.com/random/scripts/plotWebOS.sh">plotWebOS.sh</a></p>
<p><a href="http://chofter.com/random/scripts/driveGnuPlotStreams.pl">driveGnuPlotStreams.pl</a> [<a href="http://www.lysium.de/blog/index.php?/archives/234-Plotting-data-with-gnuplot-in-real-time.html" target="_blank">Source</a>]</p>
<p>You&#8217;ll probably have to make them executable, so do:<br />
<code><br />
chmod +x plotWebOS.sh<br />
chmod +x driveGnuPlotStreams.pl<br />
</code></p>
<p>Then plug in your WebOS phone or TouchPad via USB, and run<br />
<code><br />
./plotWebOS.sh<br />
</code><br />
and you should see a graph like the one above.  If you don&#8217;t see it, it&#8217;s likely that you don&#8217;t have <a href="http://www.gnuplot.info/">GnuPlot</a> installed, so Google how to do that for your system, it should be trivial.</p>
<p>For what it&#8217;s worth, I get a &#8220;Too Many Cards&#8221; error just before the process hits 60%, meaning that the other running processes are taking up the remaining ~40% of memory.</p>
<p>If you feel like playing around with this script and doing something else cool, let me know!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shaneosullivan.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shaneosullivan.wordpress.com/546/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=546&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shaneosullivan.wordpress.com/2011/10/16/tracking-memory-usage-on-webos-with-gnuplot/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abaeb4f7149a11600f472c23652ae7db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shaneosullivan</media:title>
		</media:content>

		<media:content url="http://shaneosullivan.files.wordpress.com/2011/10/webos_gnuplot.png" medium="image">
			<media:title type="html">WebOS GnuPlot</media:title>
		</media:content>
	</item>
		<item>
		<title>How to easily check a WebOS app version</title>
		<link>http://shaneosullivan.wordpress.com/2011/10/07/how-to-easily-check-a-webos-app-version/</link>
		<comments>http://shaneosullivan.wordpress.com/2011/10/07/how-to-easily-check-a-webos-app-version/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 15:19:09 +0000</pubDate>
		<dc:creator>Shane O'Sullivan</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[WebOS]]></category>
		<category><![CDATA[yql]]></category>

		<guid isPermaLink="false">http://shaneosullivan.wordpress.com/?p=539</guid>
		<description><![CDATA[If you&#8217;re a WebOS developer and would like to be able to notify your users when a new version of your app is available, a very efficient way to do that is to use the Yahoo Query Language. Take a look at this page: It shows a YQL query to select the version of the [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=539&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;re a WebOS developer and would like to be able to notify your users when a new version of your app is available, a very efficient way to do that is to use the Yahoo Query Language.</p>
<p>Take a look at <a href="http://developer.yahoo.com/yql/console/#h=select%20*%20from%20html%20where%20url%3D%22https%3A//developer.palm.com/appredirect/%3Fpackageid%3Dcom.chofter.palmdevutils%22%20and%0A%20%20%20%20%20%20xpath%3D%27//div%5B@id%3D%22app-price-system-version%22%5D/p%5B3%5D%27">this page</a>:</p>
<p>It shows a YQL query to select the version of the app com.chofter.palmdevutils, giving the following result</p>
<p><code>
<pre>{
 "query": {
  "count": 1,
  "created": "2011-10-07T14:58:53Z",
  "lang": "en-US",
  "results": {
   "p": "Version: 1.3.0"
  }
 }
}</pre>
<p></code></p>
<p>Fetching this JSON object requires far less data that reading the entire HTML page and parsing it yourself.  To see the final link that you would use, copy the link from the bottom of the Yahoo page, like this one <a href="http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22https%3A%2F%2Fdeveloper.palm.com%2Fappredirect%2F%3Fpackageid%3Dcom.chofter.palmdevutils%22%20and%0A%20%20%20%20%20%20xpath%3D'%2F%2Fdiv%5B%40id%3D%22app-price-system-version%22%5D%2Fp%5B3%5D'&amp;format=json&amp;callback=">http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22https%3A%2F%2Fdeveloper.palm.com%2Fappredirect%2F%3Fpackageid%3Dcom.chofter.palmdevutils%22%20and%0A%20%20%20%20%20%20xpath%3D&#8217;%2F%2Fdiv%5B%40id%3D%22app-price-system-version%22%5D%2Fp%5B3%5D&#8217;&amp;format=json&amp;callback=</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shaneosullivan.wordpress.com/539/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shaneosullivan.wordpress.com/539/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=539&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shaneosullivan.wordpress.com/2011/10/07/how-to-easily-check-a-webos-app-version/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abaeb4f7149a11600f472c23652ae7db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shaneosullivan</media:title>
		</media:content>
	</item>
		<item>
		<title>JavaScript performance tips</title>
		<link>http://shaneosullivan.wordpress.com/2011/09/28/javascript-performance-tips/</link>
		<comments>http://shaneosullivan.wordpress.com/2011/09/28/javascript-performance-tips/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 02:10:07 +0000</pubDate>
		<dc:creator>Shane O'Sullivan</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://shaneosullivan.wordpress.com/?p=534</guid>
		<description><![CDATA[Every now and again a question comes up at work as to which of two or more approaches to the same problem in JavaScript performs better. I&#8217;ve started using the fantastic site jsperf.com to document these, so I&#8217;ll append to this post whenever I add a new test. I hope you find these useful, as [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=534&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Every now and again a question comes up at work as to which of two or more approaches to the same problem in JavaScript performs better. I&#8217;ve started using the fantastic site <a href="http://jsperf.com">jsperf.com</a> to document these, so I&#8217;ll append to this post whenever I add a new test. I hope you find these useful, as they are answering questions that pertain to practical JavaScript usage.</p>
<p><a href="http://jsperf.com/creating-a-regex-in-and-outside-a-loop">Creating a regex inside and outside a loop</a></p>
<p><a href="http://jsperf.com/declaring-variables-inside-loops/4">Declaring variables in a loop or outside it</a></p>
<p><a href="http://jsperf.com/improving-hasownproperty">Using hasOwnProperty or testing with undefined and void 0</a></p>
<p><a href="http://jsperf.com/indexof-vs-substring-end-of-string">Using indexOf or substring to test the end of a string</a></p>
<p><a href="http://jsperf.com/extend-without-foreach">Extend Without Foreach</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shaneosullivan.wordpress.com/534/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shaneosullivan.wordpress.com/534/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=534&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shaneosullivan.wordpress.com/2011/09/28/javascript-performance-tips/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abaeb4f7149a11600f472c23652ae7db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shaneosullivan</media:title>
		</media:content>
	</item>
		<item>
		<title>Tip: Declare regular expressions once and reuse for performance win</title>
		<link>http://shaneosullivan.wordpress.com/2011/09/22/tip-declare-regular-expressions-once-and-reuse-for-performance-win/</link>
		<comments>http://shaneosullivan.wordpress.com/2011/09/22/tip-declare-regular-expressions-once-and-reuse-for-performance-win/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 21:54:51 +0000</pubDate>
		<dc:creator>Shane O'Sullivan</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://shaneosullivan.wordpress.com/?p=532</guid>
		<description><![CDATA[A pattern I see quite often in JavaScript is of people using a regular expression in a loop, e.g. &#160; for (var i = 0; i &#60; array.length; i++) { array[i].match(/something/); } The naive assumption is that a regex is some special native thing, like a boolean. However regular expressions have a cost to construct, [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=532&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>A pattern I see quite often in JavaScript is of people using a regular expression in a loop, e.g.</p>
<p>&nbsp;<br />
<code><br />
for (var i = 0; i &lt; array.length; i++) {<br />
  array[i].match(/something/);<br />
}<br />
</code></p>
<p>The naive assumption is that a regex is some special native thing, like a boolean.  However regular expressions have a cost to construct, which you can see in this performance test &#8211; <a href="http://jsperf.com/creating-a-regex-in-and-outside-a-loop">http://jsperf.com/creating-a-regex-in-and-outside-a-loop</a></p>
<p>So, if you&#8217;re using a regular expression in JavaScript more than once, declare it first and reuse it to see a dramatic performance gain</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shaneosullivan.wordpress.com/532/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shaneosullivan.wordpress.com/532/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=532&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shaneosullivan.wordpress.com/2011/09/22/tip-declare-regular-expressions-once-and-reuse-for-performance-win/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abaeb4f7149a11600f472c23652ae7db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shaneosullivan</media:title>
		</media:content>
	</item>
		<item>
		<title>CSS Box Sizing makes me happy</title>
		<link>http://shaneosullivan.wordpress.com/2011/09/13/css-box-sizing-makes-me-happy/</link>
		<comments>http://shaneosullivan.wordpress.com/2011/09/13/css-box-sizing-makes-me-happy/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 15:18:29 +0000</pubDate>
		<dc:creator>Shane O'Sullivan</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://shaneosullivan.wordpress.com/?p=530</guid>
		<description><![CDATA[Quick note: For anyone fighting for years against the CSS box model, where the visible size of an element depends on the sum of it&#8217;s width, height AND padding, check out the box-sizing: border-box;. It does exactly what we need, where if you say .myclass { width: 100%; padding: 10px; } then myclass will still [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=530&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Quick note: For anyone fighting for years against the CSS box model, where the visible size of an element depends on the sum of it&#8217;s width, height AND padding, check out the <strong>box-sizing: border-box;</strong>. It does exactly what we need, where if you say</p>
<p><code><br />
.myclass {<br />
width: 100%;<br />
padding: 10px;<br />
}<br />
</code></p>
<p>then <strong>myclass</strong> will still take up 100% width of its container, instead of overflowing.</p>
<p><a href="https://developer.mozilla.org/en/CSS/box-sizing">https://developer.mozilla.org/en/CSS/box-sizing</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shaneosullivan.wordpress.com/530/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shaneosullivan.wordpress.com/530/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=530&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shaneosullivan.wordpress.com/2011/09/13/css-box-sizing-makes-me-happy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abaeb4f7149a11600f472c23652ae7db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shaneosullivan</media:title>
		</media:content>
	</item>
		<item>
		<title>This is what a successful platform launch looks like</title>
		<link>http://shaneosullivan.wordpress.com/2011/09/02/this-is-what-a-successful-platform-launch-looks-like/</link>
		<comments>http://shaneosullivan.wordpress.com/2011/09/02/this-is-what-a-successful-platform-launch-looks-like/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 18:15:12 +0000</pubDate>
		<dc:creator>Shane O'Sullivan</dc:creator>
				<category><![CDATA[apps]]></category>
		<category><![CDATA[Flickr Mundo]]></category>
		<category><![CDATA[Palm]]></category>
		<category><![CDATA[Tablet]]></category>
		<category><![CDATA[WebOS]]></category>

		<guid isPermaLink="false">http://shaneosullivan.wordpress.com/?p=524</guid>
		<description><![CDATA[&#8230; pity it had to happen as a result of a liquidation sale. WebOS looks to be on it&#8217;s last legs, and HP has announced that it&#8217;ll never make new WebOS hardware. In the meantime, the fire sale of TouchPads has done fantastic things for us WebOS developers. The image below is a graph of [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=524&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>&#8230; pity it had to happen as a result of a liquidation sale.</p>
<p>WebOS looks to be on it&#8217;s last legs, and HP has announced that it&#8217;ll never make new WebOS hardware.  In the meantime, the fire sale of TouchPads has done fantastic things for us WebOS developers.  The image below is a graph of the <a href="http://developer.palm.com/appredirect/?packageid=com.chofter.flickrmundo">Flickr Mundo HD</a> sales for 2011.  </p>
<p>If only HP had anything resembling courage, rather than wimping out with the revelation that &#8220;Competition is hard? What? No one told me! <a href="http://www.youtube.com/watch?v=_W_u4UTvk9w" target="_blank">Run away</a>!!&#8221;, this sales trend might have actually continued for a long time.  </p>
<p>Ah well, I&#8217;ll enjoy it while it lasts!</p>
<p><img src="http://shaneosullivan.files.wordpress.com/2011/09/touchpadsales.png?w=590&#038;h=171" alt="Touchpad Sales of Flickr Mundo HD" title="Touchpad Sales of Flickr Mundo HD" width="590" height="171" class="alignnone size-full wp-image-525" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shaneosullivan.wordpress.com/524/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shaneosullivan.wordpress.com/524/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=524&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shaneosullivan.wordpress.com/2011/09/02/this-is-what-a-successful-platform-launch-looks-like/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abaeb4f7149a11600f472c23652ae7db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shaneosullivan</media:title>
		</media:content>

		<media:content url="http://shaneosullivan.files.wordpress.com/2011/09/touchpadsales.png" medium="image">
			<media:title type="html">Touchpad Sales of Flickr Mundo HD</media:title>
		</media:content>
	</item>
		<item>
		<title>Unpacking webOS .ipk files on a Mac</title>
		<link>http://shaneosullivan.wordpress.com/2011/08/28/unpacking-webos-ipk-files-on-a-mac/</link>
		<comments>http://shaneosullivan.wordpress.com/2011/08/28/unpacking-webos-ipk-files-on-a-mac/#comments</comments>
		<pubDate>Sun, 28 Aug 2011 02:40:41 +0000</pubDate>
		<dc:creator>Shane O'Sullivan</dc:creator>
				<category><![CDATA[Palm]]></category>
		<category><![CDATA[WebOS]]></category>

		<guid isPermaLink="false">http://shaneosullivan.wordpress.com/?p=520</guid>
		<description><![CDATA[Quick tip: For some reason, the archive files that webOS uses as application installers are very awkward to extract on a Mac. It&#8217;s simple on Windows. After a little digging, I found a handy script at http://forums.precentral.net/webos-development/235149-extract-build-ipkg-mac-osx.html that does the trick.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=520&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Quick tip: For some reason, the archive files that webOS uses as application installers are very awkward to extract on a Mac.  It&#8217;s simple on Windows.</p>
<p>After a little digging, I found a handy script at <a href="http://forums.precentral.net/webos-development/235149-extract-build-ipkg-mac-osx.html">http://forums.precentral.net/webos-development/235149-extract-build-ipkg-mac-osx.html</a> that does the trick.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shaneosullivan.wordpress.com/520/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shaneosullivan.wordpress.com/520/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=520&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shaneosullivan.wordpress.com/2011/08/28/unpacking-webos-ipk-files-on-a-mac/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abaeb4f7149a11600f472c23652ae7db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shaneosullivan</media:title>
		</media:content>
	</item>
		<item>
		<title>HP Enyo talk from the London Ajax conference</title>
		<link>http://shaneosullivan.wordpress.com/2011/07/03/hp-enyo-talk-from-the-london-ajax-conference/</link>
		<comments>http://shaneosullivan.wordpress.com/2011/07/03/hp-enyo-talk-from-the-london-ajax-conference/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 17:17:51 +0000</pubDate>
		<dc:creator>Shane O'Sullivan</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[enyo]]></category>
		<category><![CDATA[Palm]]></category>

		<guid isPermaLink="false">http://shaneosullivan.wordpress.com/?p=510</guid>
		<description><![CDATA[I really enjoyed talking about HP Enyo at the London Ajax groups conference on July 2nd.  People were genuinely interested, and hopefully will take a closer look at the framework, which I find great to develop HTML5 apps with. You can view the talk below [source] The slides are embedded below. Thanks to Dylan from [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=510&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I really enjoyed talking about <a href="http://developer.palm.com/">HP Enyo</a> at the <a href="http://londonajax.com">London Ajax</a> groups conference on July 2nd.  People were genuinely interested, and hopefully will take a closer look at the framework, which I find great to develop HTML5 apps with.</p>
<p>You can view the talk below [<a href="http://vimeo.com/26570760">source</a>] </p>
<div class="embed-vimeo"><iframe src="http://player.vimeo.com/video/26570760?title=1&amp;byline=1&amp;portrait=1" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>
<p>The slides are embedded below.</p>
<iframe src='http://www.slideshare.net/slideshow/embed_code/8495194' width='425' height='348' scrolling='no'></iframe>
<p>Thanks to Dylan from SitePen for organising everything and RIM for sponsoring the event.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shaneosullivan.wordpress.com/510/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shaneosullivan.wordpress.com/510/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=510&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shaneosullivan.wordpress.com/2011/07/03/hp-enyo-talk-from-the-london-ajax-conference/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abaeb4f7149a11600f472c23652ae7db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shaneosullivan</media:title>
		</media:content>
	</item>
		<item>
		<title>Come hear about HP Enyo at the London Ajax event</title>
		<link>http://shaneosullivan.wordpress.com/2011/06/30/come-hear-about-hp-enyo-at-the-london-ajax-event/</link>
		<comments>http://shaneosullivan.wordpress.com/2011/06/30/come-hear-about-hp-enyo-at-the-london-ajax-event/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 16:38:19 +0000</pubDate>
		<dc:creator>Shane O'Sullivan</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[enyo]]></category>

		<guid isPermaLink="false">http://shaneosullivan.wordpress.com/?p=508</guid>
		<description><![CDATA[I&#8217;m very happy to have been invite to speak at the London Ajax event on July 2nd, 2011 &#8211; http://londonajax.com/ .  I&#8217;ll be giving a talk about the new HP Enyo framework, and how you can use it to develop HTML 5 apps. &#160;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=508&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m very happy to have been invite to speak at the London Ajax event on July 2nd, 2011 &#8211; <a href="http://londonajax.com">http://londonajax.com</a>/ .  I&#8217;ll be giving a talk about the new <a href="http://developer.palm.com/">HP Enyo</a> framework, and how you can use it to develop HTML 5 apps.</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shaneosullivan.wordpress.com/508/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shaneosullivan.wordpress.com/508/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=508&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shaneosullivan.wordpress.com/2011/06/30/come-hear-about-hp-enyo-at-the-london-ajax-event/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abaeb4f7149a11600f472c23652ae7db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shaneosullivan</media:title>
		</media:content>
	</item>
		<item>
		<title>Sweep line Voronoi algorithm in JavaScript</title>
		<link>http://shaneosullivan.wordpress.com/2011/03/22/sweep-line-voronoi-algorithm-in-javascript/</link>
		<comments>http://shaneosullivan.wordpress.com/2011/03/22/sweep-line-voronoi-algorithm-in-javascript/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 18:51:35 +0000</pubDate>
		<dc:creator>Shane O'Sullivan</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[voronoi]]></category>

		<guid isPermaLink="false">http://shaneosullivan.wordpress.com/?p=498</guid>
		<description><![CDATA[Years ago I translated Steven Fortune&#8217;s sweep line Voronoi algorithm to C++, and have been meaning to make a JavaScript version for some time, but never got around to it. Now, someone has actually done it with the D3 charting library, and it&#8217;s fantastic.  Check it out at http://mbostock.github.com/d3/ex/voronoi.html<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=498&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Years ago I <a href="http://shaneosullivan.wordpress.com/2007/04/05/fortunes-sweep-line-voronoi-algorithm-implemented-in-java/">translated</a> Steven Fortune&#8217;s sweep line Voronoi algorithm to C++, and have been meaning to make a JavaScript version for some time, but never got around to it.</p>
<p>Now, someone has actually done it with the D3 charting library, and it&#8217;s fantastic.  Check it out at <a href="http://mbostock.github.com/d3/ex/voronoi.html">http://mbostock.github.com/d3/ex/voronoi.html </a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shaneosullivan.wordpress.com/498/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shaneosullivan.wordpress.com/498/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=498&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shaneosullivan.wordpress.com/2011/03/22/sweep-line-voronoi-algorithm-in-javascript/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abaeb4f7149a11600f472c23652ae7db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shaneosullivan</media:title>
		</media:content>
	</item>
		<item>
		<title>Quick canvas effect prototyping</title>
		<link>http://shaneosullivan.wordpress.com/2011/03/07/quick-canvas-effect-prototyping/</link>
		<comments>http://shaneosullivan.wordpress.com/2011/03/07/quick-canvas-effect-prototyping/#comments</comments>
		<pubDate>Mon, 07 Mar 2011 05:14:45 +0000</pubDate>
		<dc:creator>Shane O'Sullivan</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://shaneosullivan.wordpress.com/?p=495</guid>
		<description><![CDATA[I&#8217;m doing some playing around with image processing on HTML5 Canvas elements, and so I&#8217;ve hacked together a simple page for prototyping different algorithms. Check it out http://chofter.com/EffectPrototyping. The code abstracts away most of the complexities of working with Canvas elements, and just lets you get down to what you need: your pixel manipulation algorithms.  [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=495&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m doing some playing around with image processing on HTML5 Canvas elements, and so I&#8217;ve hacked together a simple page for prototyping different algorithms.  Check it out <a href="http://chofter.com/EffectPrototyping">http://chofter.com/EffectPrototyping</a>.</p>
<p>The code abstracts away most of the complexities of working with Canvas elements, and just lets you get down to what you need: your pixel manipulation algorithms.  It provides a number of test images and examples to get you started, so have fun!</p>
<p>Oh and yes, it&#8217;s pretty ugly <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shaneosullivan.wordpress.com/495/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shaneosullivan.wordpress.com/495/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=495&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shaneosullivan.wordpress.com/2011/03/07/quick-canvas-effect-prototyping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abaeb4f7149a11600f472c23652ae7db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shaneosullivan</media:title>
		</media:content>
	</item>
		<item>
		<title>Palm and the Mobile Expressionists</title>
		<link>http://shaneosullivan.wordpress.com/2011/01/28/palm-and-the-mobile-expressionists/</link>
		<comments>http://shaneosullivan.wordpress.com/2011/01/28/palm-and-the-mobile-expressionists/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 16:36:28 +0000</pubDate>
		<dc:creator>Shane O'Sullivan</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://shaneosullivan.wordpress.com/?p=492</guid>
		<description><![CDATA[Palm/HP have a new advertising campaign aimed at getting app developers all excited, and I was very happy to be a part of it.  Here&#8217;s hoping it helps give webOS the kick it needs to show developers how simple and fun it is to develop for.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=492&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.palm.com/us/developer/artist.html"><img class="alignnone size-full wp-image-493" title="HP Mobile Expressionists" src="http://shaneosullivan.files.wordpress.com/2011/01/hp-mobile-expressionists.png?w=428&#038;h=258" alt="" width="428" height="258" /></a></p>
<p>Palm/HP have a new advertising campaign aimed at getting app developers all excited, and I was very happy to be a part of it.  Here&#8217;s hoping it helps give webOS the kick it needs to show developers how simple and fun it is to develop for.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shaneosullivan.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shaneosullivan.wordpress.com/492/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=492&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shaneosullivan.wordpress.com/2011/01/28/palm-and-the-mobile-expressionists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abaeb4f7149a11600f472c23652ae7db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shaneosullivan</media:title>
		</media:content>

		<media:content url="http://shaneosullivan.files.wordpress.com/2011/01/hp-mobile-expressionists.png" medium="image">
			<media:title type="html">HP Mobile Expressionists</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Flickr Mundo to make your webOS app better</title>
		<link>http://shaneosullivan.wordpress.com/2010/11/14/using-flickr-mundo-to-make-your-webos-app-better/</link>
		<comments>http://shaneosullivan.wordpress.com/2010/11/14/using-flickr-mundo-to-make-your-webos-app-better/#comments</comments>
		<pubDate>Sun, 14 Nov 2010 19:09:59 +0000</pubDate>
		<dc:creator>Shane O'Sullivan</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[Flickr Mundo]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Palm]]></category>
		<category><![CDATA[WebOS]]></category>

		<guid isPermaLink="false">http://shaneosullivan.wordpress.com/?p=481</guid>
		<description><![CDATA[If you are a webOS developer with an interest in Flickr, you can now greatly improve your users experience by integrating your app with Flickr Mundo. (thanks to @rparvez for the idea to integrate with @neato_webos) I&#8217;ve added the ability for other webOS apps to launch Flickr Mundo with a Flickr URL.  This gives a [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=481&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>If you are a <a href="http://developer.palm.com/"><code>webOS</code></a> developer with an interest in <a href="http://flickr.com">Flickr</a>, you can now greatly improve your users experience by integrating your app with <a href="http://shaneosullivan.wordpress.com/2010/09/05/flickr-mundo-for-palm-webos/" target="_self">Flickr Mundo</a>. (thanks to <a href="http://twitter.com/rparvez" target="_blank">@rparvez</a> for the idea to integrate with <a href="http://twitter.com/neato_webos" target="_blank">@neato_webos</a>)</p>
<p>I&#8217;ve added the ability for other webOS apps to launch Flickr Mundo with a Flickr URL.  This gives a far better experience to the user than simply loading Flickr in the browser &#8211; they&#8217;ve already purchased the app, it is built natively for webOS and can do many things that the web interface cannot.</p>
<p>For example, loading the link</p>
<ul>
<li><a href="http://flickr.com/photos/shaneosullivan" target="_blank">http://flickr.com/photos/shaneosullivan</a> will open the user &#8216;shaneosullivan&#8217;</li>
<li><a href="http://flickr.com/groups/palmpre" target="_blank">http://flickr.com/groups/palmpre</a> will open the &#8216;palmpre&#8217; group</li>
<li><a href="http://www.flickr.com/search/?q=tree">http://www.flickr.com/search/?q=tree</a> will do a search for photos on Flickr</li>
</ul>
<p>Many different patterns of Flickr URLs are supported.  However if you pass a URL that is not supported, Flickr Mundo will simply launch the browser at that URL.</p>
<p>To make this work just takes a few lines of code.  From within any Mojo scene assistant, simply use the followinf JavaScript code:<br />
<code><br />
var url = "http://flickr.com/upload";<br />
this.controller.serviceRequest("palm://com.palm.applicationManager", {<br />
&nbsp;&nbsp;method: 'open',<br />
&nbsp;&nbsp;parameters: {<br />
&nbsp;&nbsp;&nbsp;&nbsp;id: 'com.chofter.flickrmundo',<br />
&nbsp;&nbsp;&nbsp;&nbsp;params: {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;target: url<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;}<br />
});<br />
</code></p>
<p>As you can see, you can even upload photos to Flickr using this method.  So if you have some kind of photo app, would like to be able to upload to Flickr but don&#8217;t want to have to go to all the trouble of correctly authenticating a user, you can just use Flickr Mundo to do it for you.</p>
<p>The version of Flickr Mundo with this included, v1.4.0, was submitted for review today, Nov 14th 2010, and should hopefully be available for download in a couple of days.  Many different URL patterns are supported, but if you find one that isn&#8217;t, please let me know and I&#8217;ll look into adding it.</p>
<p>A future version will also include the ability to specify the file to upload &#8211; v1.4.0 asks the user to pick the file, similar to the stock Photos app on webOS.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shaneosullivan.wordpress.com/481/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shaneosullivan.wordpress.com/481/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=481&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shaneosullivan.wordpress.com/2010/11/14/using-flickr-mundo-to-make-your-webos-app-better/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abaeb4f7149a11600f472c23652ae7db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shaneosullivan</media:title>
		</media:content>
	</item>
		<item>
		<title>Flickr Mundo for Palm webOS</title>
		<link>http://shaneosullivan.wordpress.com/2010/09/05/flickr-mundo-for-palm-webos/</link>
		<comments>http://shaneosullivan.wordpress.com/2010/09/05/flickr-mundo-for-palm-webos/#comments</comments>
		<pubDate>Sun, 05 Sep 2010 08:41:03 +0000</pubDate>
		<dc:creator>Shane O'Sullivan</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[Flickr Addict]]></category>
		<category><![CDATA[Flickr Mundo]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[Palm]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[wallpaper]]></category>
		<category><![CDATA[WebOS]]></category>

		<guid isPermaLink="false">http://shaneosullivan.wordpress.com/?p=466</guid>
		<description><![CDATA[I am very happy to announce the release of Flickr Mundo, a fully featured Flickr app for Palm webOS devices.  It is packed full of pretty much everything that a Flickr addict could possibly want, including: Photo upload and download, with multiple simultaneous supported for both. Read &#38; add comments to photos and photo sets [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=466&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I am very happy to announce the release of <a href="http://developer.palm.com/appredirect/?packageid=com.chofter.flickrmundo" target="_blank">Flickr Mundo</a>, a fully featured Flickr app for Palm webOS devices.  It is packed full of pretty much everything that a Flickr addict could possibly want, including:</p>
<ul>
<li>Photo upload and download, with multiple simultaneous supported for both.</li>
<li>Read &amp; add comments to photos and photo sets</li>
<li>Add/remove favourites</li>
<li>Bulk editing, e.g. choose 6 photos and add tags to them all in one go, add/remove them from a set or group, add/remove person tags&#8230;. and much more.</li>
<li>A great browsing experience, jump from one user to another,  open photo sets, groups and galleries.  Swipe from photo to photo.</li>
<li>Auto rotated wallpapers.   All the functionality from my other app <a href="http://shaneosullivan.wordpress.com/2009/12/22/flickr-addict-gets-a-huge-upgrade/" target="_blank">Flickr Addict</a> is included in Flickr Mundo.  Automatically download images in the background based on many different criteria and change the phone wallpaper on a schedule chosen by you.  No more boring backgrounds!</li>
<li>Context sensitive &#8216;Just Type&#8217; search.  Wherever you are in the app, either hit the search icon or just start typing to search Flickr.  If you&#8217;re looking at a user, you can choose to just search that user. If looking at a photo group, you can search just that group.</li>
<li>Group search, find a photo group.</li>
<li>Location based search.  Find photos near you using GPS, or search for photos close to anywhere else you name.</li>
<li>Fullscreen slideshows with an optional audio playlist for playing music while watching your photos.</li>
</ul>
<p>and much, much more, all wrapped in a highly polished UI that maximises the space of a small screen to the best effect.</p>
<p>A special thank you goes out to Jake and all the guys on the <a href="http://www.flickr.com/groups/palmpre" target="_blank">Palm Pre</a> group on Flickr who did huge amounts of user testing on the beta version of the app. They spotted many obscure bugs, and made many suggestions for features and tweaks, most of which have ended up in the app.  Without them Flickr Mundo wouldn&#8217;t be anywhere near as complete, functional and fun as it is.</p>
<p>Flickr Mundo will be submitted to the Palm App Catalog in the next 24 hours, and should be available to everyone as soon as Palm approves it!</p>
<p><strong>Update: Flickr Mundo has now been submitted to the App Catalog</strong></p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/_ZdPB_LbsQY?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span>
<p><img class="alignnone size-full wp-image-467" title="Main Screen" src="http://shaneosullivan.files.wordpress.com/2010/09/main-screen.png?w=320&#038;h=480" alt="" width="320" height="480" /> <img class="alignnone size-full wp-image-468" title="Thumbnails Screen" src="http://shaneosullivan.files.wordpress.com/2010/09/thumbnails-screen.png?w=320&#038;h=480" alt="" width="320" height="480" /><img class="alignnone size-full wp-image-469" title="Search Dialog" src="http://shaneosullivan.files.wordpress.com/2010/09/search-dialog.png?w=320&#038;h=480" alt="" width="320" height="480" /> <img class="alignnone size-full wp-image-470" title="Comments Screen" src="http://shaneosullivan.files.wordpress.com/2010/09/comments-screen.png?w=320&#038;h=480" alt="" width="320" height="480" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shaneosullivan.wordpress.com/466/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shaneosullivan.wordpress.com/466/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=466&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shaneosullivan.wordpress.com/2010/09/05/flickr-mundo-for-palm-webos/feed/</wfw:commentRss>
		<slash:comments>61</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abaeb4f7149a11600f472c23652ae7db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shaneosullivan</media:title>
		</media:content>

		<media:content url="http://shaneosullivan.files.wordpress.com/2010/09/main-screen.png" medium="image">
			<media:title type="html">Main Screen</media:title>
		</media:content>

		<media:content url="http://shaneosullivan.files.wordpress.com/2010/09/thumbnails-screen.png" medium="image">
			<media:title type="html">Thumbnails Screen</media:title>
		</media:content>

		<media:content url="http://shaneosullivan.files.wordpress.com/2010/09/search-dialog.png" medium="image">
			<media:title type="html">Search Dialog</media:title>
		</media:content>

		<media:content url="http://shaneosullivan.files.wordpress.com/2010/09/comments-screen.png" medium="image">
			<media:title type="html">Comments Screen</media:title>
		</media:content>
	</item>
		<item>
		<title>Dojo gets a speed boost on IE6 and IE7</title>
		<link>http://shaneosullivan.wordpress.com/2010/08/28/dojo-gets-a-speed-boost-on-ie6-and-ie7/</link>
		<comments>http://shaneosullivan.wordpress.com/2010/08/28/dojo-gets-a-speed-boost-on-ie6-and-ie7/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 10:32:08 +0000</pubDate>
		<dc:creator>Shane O'Sullivan</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[dijit]]></category>
		<category><![CDATA[Dojo]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://shaneosullivan.wordpress.com/?p=460</guid>
		<description><![CDATA[My former employer, Cúram Software, was good enough to give me a couple of months to work on the performance issues that Dojo and it&#8217;s widget project Dijit have in horrible legacy browsers IE6 and IE7.  Some of the fruits of that labour have now been checked into the code base and will be included [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=460&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>My former employer, Cúram Software, was good enough to give me a couple of months to work on the performance issues that <a href="http://dojotoolkit.org">Dojo</a> and it&#8217;s widget project Dijit have in horrible legacy browsers IE6 and IE7.  Some of the fruits of that labour have now been checked into the code base and will be included in Dojo 1.6, out in Q4 2010.</p>
<p>So what I/we learned from the exercise?</p>
<p><strong>DynaTrace rocks!</strong></p>
<p>To begin with, I can&#8217;t praise <a href="http://ajax.dynatrace.com" target="_blank">DynaTrace</a> enough.  It&#8217;s a fantastic piece of profiling software that delves deep into Internet Explorer&#8217;s innards to find every little horrible Microsoft bug.  It can take a while to get used to, but that is just because it presents you with so much data, all of it useful, and anyone would have trouble finding a way to make it easily consumable.  Long story short, if you&#8217;re having performance issues with your site in IE, download DynaTrace.</p>
<p><strong>Touching className makes IE cry</strong></p>
<p>Pretty much every time you change the <em>className</em> property of a node, IE6 and IE7 reflow the page.  It doesn&#8217;t matter if the new value is the same as the old one, or whether or not the changed CSS class has any visual effect, IE will redraw the page, resulting in a lot of time being lost.</p>
<p>Dojo was changing <em>className</em> too often, for example in <strong>dojo.addClass</strong>, if the class being added was already present, it would still assign the changed value to <em>className</em>.  I put a fix for this into v1.5.  There were also many cases where Dojo would use a combination of <strong>dojo.removeClass </strong>and <strong>dojo.addClass</strong> to replace a class, which changed <em>className</em> twice instead of just once.  To fix this, I&#8217;ve added a new public api <strong>dojo.replaceClass</strong>, which only changes <em>className</em> once.</p>
<p>Dijit widgets often add CSS classes to the DOM nodes which they are creating after the nodes have been inserted into the document.  This is costly, and a large performance improvement can be gained by applying these classes earlier in the lifecycle, before inserting into the document.  Bill Keese (Dijit master) checked in the first of the fixes for this for the BorderContainer recently, and a strategy is being formulated for the many other widgets that can benefit from this.  This work should be completed for v1.6.</p>
<p><strong>Risky but&#8230;.. </strong></p>
<p>A solution that we cannot use for Dojo, but which we found gave huge performance gains for my company&#8217;s application, was to figure out what CSS classes Dojo would apply to a node and write those classes out when generating the HTML.  For example, when creating a <strong>dijit.layout.BorderContainer</strong>, our HTML contains the CSS class <strong>dijitBorderContainer</strong>.  There is an inherent risk with this approach, as Dojo may change the CSS classes in a later release, but if you&#8217;re willing to accept the risk and the upgrade pain, you can get a nice performance boost this way.</p>
<p><strong>Reading offsetLeft and offsetTop is costly</strong></p>
<p>When your code reads the <em>offsetLeft </em>or <em>offsetTop </em>of a node, all pending changes to the DOM have to be performed first.  This can be very expensive &#8211; we saw a number of single operations taking over 500ms each!  Many Dijits were using the <strong>dojo.marginBox</strong> method to get the left, top, width and height properties of a node, when all they needed was the width and height.</p>
<p>To solve this, I introduced a new method, <strong>dojo._getMarginSize</strong>, a private method that just returns the width and height of a node.  This has resulted in huge gains in performance on IE6 &amp; 7, especially when used with layout widgets like the BorderContainer.</p>
<p><strong>Unexplained gaps in DynaTrace profiles</strong></p>
<p>We hit a bit of a wall at one point when analysing the performance profiles, where there was a 1.5 second gap in the profile where it seemed like nothing was happening, but everything was paused with the CPU at 100%.</p>
<p>We eventually discovered that there is a horrible bug in IE7 where if you have a <strong>:hover</strong> style on something that is not an anchor tag, it causes the rendering engine to go crazy, get all confused, and push the CPU up to 100% for no reason at all.</p>
<p>The solution: <strong>don&#8217;t user :hover styles on anything other than &lt;a&gt; tags</strong>.  Ridiculous I know, but so is the IE7 rendering engine.</p>
<p><strong>Give it a go!</strong></p>
<p>So, the long and short of it is that Dojo/Dijit should now be a good bit snappier on IE6 and 7.  With our application we got the load time for a huge application down from 20 seconds to 5 seconds using these techniques, making IE7 far, far more usable.  Of course it just flies on any other browser, even IE8 which, all credit to MS for once, is far less buggy than the earlier incarnations.</p>
<p>So feel free to try out the <a href="http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/themes/themeTester.html" target="_blank">Dojo nightlies</a>, you should find them to be a good bit more responsive in IE6 and 7 than just a few days ago, and now that we have learned some important lessons, Dojo will be even faster for v1.6.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shaneosullivan.wordpress.com/460/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shaneosullivan.wordpress.com/460/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shaneosullivan.wordpress.com&#038;blog=258432&#038;post=460&#038;subd=shaneosullivan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shaneosullivan.wordpress.com/2010/08/28/dojo-gets-a-speed-boost-on-ie6-and-ie7/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/abaeb4f7149a11600f472c23652ae7db?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shaneosullivan</media:title>
		</media:content>
	</item>
	</channel>
</rss>
