<?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:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>remy sharp's b:log</title>
	<atom:link href="http://remysharp.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://remysharp.com</link>
	<description>About [code] and all that jazz</description>
	<pubDate>Mon, 30 Aug 2010 11:00:21 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
		<item>
		<title>Universal launch images with PhoneGap</title>
		<link>http://remysharp.com/2010/08/30/universal-launch-images-with-phonegap/</link>
		<comments>http://remysharp.com/2010/08/30/universal-launch-images-with-phonegap/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 11:00:21 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[ios]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[phonegap]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=613</guid>
		<description><![CDATA[I've been playing with PhoneGap a lot recently, in part to prepare Marbles2, but also to bring JS Console to the iPhone as a native app. I've always wanted to create an app that worked on all devices, but getting the launch image correct for each device can be tricky.



How the launch image works on [...]


Related posts:<ol><li><a href='http://remysharp.com/2010/08/05/doing-it-right-skipping-the-iphone-url-bar/' rel='bookmark' title='Permanent Link: Doing it right: skipping the iPhone url bar'>Doing it right: skipping the iPhone url bar</a></li><li><a href='http://remysharp.com/2008/02/03/poor-mans-javascript-behaviours/' rel='bookmark' title='Permanent Link: Poor man's JavaScript Behaviours'>Poor man's JavaScript Behaviours</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I've been playing with PhoneGap a lot recently, in part to prepare <a href="http://marbles2.com">Marbles2</a>, but also to bring <a href="http://jsconsole.com">JS Console</a> to the iPhone as a native app. I've always wanted to create an app that worked on all devices, but getting the launch image correct for each device can be tricky.</p>

<p><span id="more-613"></span></p>

<h2>How the launch image works on PhoneGap</h2>

<p>Basically there's <em>two</em> launch images. Once for the native app and once (manually by PhoneGap) whilst the UIWebView (aka Safari) is loading up. The native one is handled by the app as per the documentation on the Apple developer site, but the overlaid image is hardcoded to 'Default.png'. This is what we'll fix.</p>

<h2>Changes to PhoneGapDelete.m</h2>

<p>To get the three devices to work properly, you need to make a change to <code>PhoneGapDelete.m</code>. Changing the <a href="http://github.com/phonegap/phonegap-iphone/blob/master/PhoneGapLib/Classes/PhoneGapDelegate.m#L209">following line</a><sup>&dagger;</sup>:</p>

<pre><code>UIImage* image = [[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Default" ofType:@"png"]];
imageView = [[UIImageView alloc] initWithImage:image];
[image release];</code></pre>

<p>To:</p>

<pre><code>UIImage *image = [UIImage imageNamed:"Default"];
imageView = [[UIImageView alloc] initWithImage:image];
// [image release]</code></pre>

<p><small>&dagger; Note that I've not learnt Objective-c, I've just messed around and Googled enough to get to this point!</small></p>

<h3>imageNamed</h3>

<p>The reason we switch from <code>initWithContentsOfFile</code> to <code>imageNamed</code> is for two reasons:</p>

<ol>
<li><code>initWithContentsOfFile</code> is also using the bespoke <code>pathForResource</code> which returns the full path to the file, which we don't want as I'll explain.</li>
<li><code>initWithContentsOfFile</code> <a href="http://atastypixel.com/blog/uiimage-resolution-independence-and-the-iphone-4s-retina-display/">apparently doesn't correctly pick up</a> the @2x resources for the iPhone 4 retina displays</li>
</ol>

<h2>Adding the Launch Images</h2>

<p>Now you need to create three images, for:</p>

<ol>
<li>iPhone 3GS and below</li>
<li>iPad</li>
<li>iPhone 4 double resolution</li>
</ol>

<p>The details of the resolutions are available <a href="http://developer.apple.com/iphone/library/documentation/userexperience/conceptual/mobilehig/IconsImages/IconsImages.html#//apple_ref/doc/uid/TP40006556-CH14-SW5">Apple's developer reference</a>.</p>

<p>The iPhone 4 image is easy, you call it <code>Default@2x.png</code> and drag it in to the xcode project. The iPhone 3GS (and below) image is called <code>Default.png</code> and also dragged in to the project (there will probably already be a phonegap default image that you'll overwrite).  Finally the iPad image needs to be called <code>Default~ipad.png</code>.</p>

<p>This only works because we've made the change to use <code>initWithImage</code> because it'll automatically detect the device type and add the extension.</p>

<h2>One Final Tip</h2>

<p>If you notice that when your app loads the launch image jumps, it's because the phonegap UIWebView is (incorrectly) offset by negative 20 pixels - we can fix this too. </p>

<p><a href="http://github.com/mwbrooks">Michael Brooks</a> wrote a really elegant little bit of code that fixes the offset in the web view that's also contributing to the launch image jumping.</p>

<p>Add the code from this gist <a href="http://gist.github.com/510407">http://gist.github.com/510407</a> to your *AppDelegate.m (in that if your app is called jsconsole, add the code to jsconsoleAppDelegate.m).</p>

<p>Once that code is in, you'll have your universal phonegap app with launch images all in the appropriate size for the app.</p>

<p>I used this technique for the iOS version of <a href="http://jsconsole.com/app/">JS Console</a> (though I'm not totally sure it'll get accepted to the itunes store!!!).</p>

<p>Finally, if you want to learn more about PhoneGap, my conference Full Frontal, is running a <a href="http://2010.full-frontal.org/workshops#phonegap">full day workshop with Brian LeRoux</a> entirely on  PhoneGap, so check it out!</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2010/08/05/doing-it-right-skipping-the-iphone-url-bar/' rel='bookmark' title='Permanent Link: Doing it right: skipping the iPhone url bar'>Doing it right: skipping the iPhone url bar</a></li><li><a href='http://remysharp.com/2008/02/03/poor-mans-javascript-behaviours/' rel='bookmark' title='Permanent Link: Poor man's JavaScript Behaviours'>Poor man's JavaScript Behaviours</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2010/08/30/universal-launch-images-with-phonegap/feed/</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Dynamic favicons</title>
		<link>http://remysharp.com/2010/08/24/dynamic-favicons/</link>
		<comments>http://remysharp.com/2010/08/24/dynamic-favicons/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 12:25:27 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[canvas]]></category>

		<category><![CDATA[html5]]></category>

		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=600</guid>
		<description><![CDATA[Google Calendar released a new favicon which prompted a few mentions from friends on Twitter. The first, probably more important was from Cennydd:


  New Google Calendar icon most un-Googley. I like it.


Then Danny pitched in with: 


  I see Google Calendar has a new icon. They could use the current date rather than [...]


Related posts:<ol><li><a href='http://remysharp.com/2007/04/12/how-to-detect-when-an-external-library-has-loaded/' rel='bookmark' title='Permanent Link: How to detect when an external library has loaded'>How to detect when an external library has loaded</a></li><li><a href='http://remysharp.com/2007/04/20/performance-profiling-javascript/' rel='bookmark' title='Permanent Link: Performance profiling JavaScript'>Performance profiling JavaScript</a></li><li><a href='http://remysharp.com/2009/07/06/rimshot-with-html5/' rel='bookmark' title='Permanent Link: Rimshot with HTML5'>Rimshot with HTML5</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Google Calendar released a new favicon which prompted a few mentions from friends on Twitter. The first, probably more important was from <a href="http://twitter.com/Cennydd/status/21986651336">Cennydd</a>:</p>

<blockquote>
  <p>New Google Calendar icon most un-Googley. I like it.</p>
</blockquote>

<p>Then <a href="http://twitter.com/yandle/status/21989058504">Danny pitched in</a> with: </p>

<blockquote>
  <p>I see Google Calendar has a new icon. They could use the current date rather than "31" though</p>
</blockquote>

<p>So let's fix that shall we?</p>

<p><span id="more-600"></span></p>

<h2>How it's done</h2>

<p>The trick here is to use a canvas element and export the image data as a png. Since favicons can be pngs then we know this can work. Note that this technique <a href="http://www.p01.org/releases/DEFENDER_of_the_favicon/">has been done before</a>.</p>

<p>The setup is needing to create two calendar images: one with the date if this doesn't work (defaulting to something like 31) and the second without the date text. For whatever reason, I went and replicated the Google Calendar icon in Photoshop:</p>

<p><img src="http://remysharp.com/images/favicon-without-text.png" alt="favicon without text" title="" />
<img src="http://remysharp.com/images/favicon-with-text.png" alt="favicon with text" title="" /></p>

<p>The plan now is to use the favicon template and lay the text over. Simple.</p>

<h2>The minimum starting point</h2>

<p>Start your document by including the favicon <code>link</code> element in the <code>head</code>:</p>

<pre><code>&lt;link id=&quot;favicon&quot; rel=&quot;icon&quot; type=&quot;image/png&quot; href=&quot;ical-icon-complete.png&quot; /&gt;</code></pre>

<p>The "complete" version is the favicon with the 31 on it already. Next we'll use JavaScript to dynamically create the favicon.</p>

<h2>Using a canvas for dynamic favicons</h2>

<p>We need the following items to make this effect work:</p>

<ol>
<li>A canvas that doesn't have to live in the DOM, that's 16x16 - our favicon size</li>
<li>The template favicon image</li>
<li>Once, and only once, the template image has loaded, we then go adding the text</li>
<li>The date in a two character format, i.e. 04 is the 4th</li>
</ol>

<p>That's it. For connivence I've added an <code>id</code> to the <code>link</code> element so that I can just change the <code>href</code> when the image is ready. The following JavaScript can be included anywhere below the <code>link</code> element:</p>

<pre><code>(function () {
var canvas = document.createElement('canvas'),
    ctx,
    img = document.createElement('img'),
    link = document.getElementById('favicon').cloneNode(true),
    day = (new Date).getDate() + '';

if (canvas.getContext) {
  canvas.height = canvas.width = 16; // set the size
  ctx = canvas.getContext('2d');
  img.onload = function () { // once the image has loaded
    ctx.drawImage(this, 0, 0);
    ctx.font = 'bold 10px "helvetica", sans-serif';
    ctx.fillStyle = '#F0EEDD';
    if (day.length == 1) day = '0' + day;
    ctx.fillText(day, 2, 12);
    link.href = canvas.toDataURL('image/png');
    document.body.appendChild(link);
  };
  img.src = 'ical-icon.png';
}

})();</code></pre>

<p>The important part is the order in which the code runs.  It creates an image element, and hooks an <code>onload</code> event handler.  When this <code>onload</code> event runs, it draws the image on to the canvas using <code>ctx.drawImage(this, 0, 0)</code>. <code>this</code> refers to the image the <code>onload</code> event acted upon, and <code>0, 0</code> is the top, left position to start drawing.</p>

<p>Next we style the text and draw it on.</p>

<p>Finally using <code>canvas.toDataURL</code> we set a new href to the link. </p>

<p>You should be able to see the code running on this blog post, if you look at the favicon associated with this page, it should be the calendar icon with the correct date if your browser supports the canvas API (IE8 and below don't, all other browsers <em>do</em>).</p>

<p>Try changing the date to test it out.</p>

<div class="update">A few people having pointed out that in fact trying to change favicons in IE is not possible. I've read around this a bit now, and it looks like there isn't a way - good thing we're just adding a sprinkle of sexiness then, eh?</div>

<script>
(function () {

var canvas = document.createElement('canvas'),
    ctx,
    img = document.createElement('img'),
    link = document.getElementById('favicon').cloneNode(true),
    day = (new Date).getDate() + '';

if (canvas.getContext) {
  canvas.height = canvas.width = 16;
  ctx = canvas.getContext('2d');
  img.onload = function () {
    ctx.drawImage(this, 0, 0);
    ctx.font = 'bold 10px "helvetica", sans-serif';
    ctx.fillStyle = '#F0EEDD';
    if (day.length == 1) day = '0' + day;
    ctx.fillText(day, 2, 12);
    link.href = canvas.toDataURL('image/png');
    document.body.appendChild(link);
  };
  img.src = '/images/ical-icon.png';
}

})();
</script>


<p>Related posts:<ol><li><a href='http://remysharp.com/2007/04/12/how-to-detect-when-an-external-library-has-loaded/' rel='bookmark' title='Permanent Link: How to detect when an external library has loaded'>How to detect when an external library has loaded</a></li><li><a href='http://remysharp.com/2007/04/20/performance-profiling-javascript/' rel='bookmark' title='Permanent Link: Performance profiling JavaScript'>Performance profiling JavaScript</a></li><li><a href='http://remysharp.com/2009/07/06/rimshot-with-html5/' rel='bookmark' title='Permanent Link: Rimshot with HTML5'>Rimshot with HTML5</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2010/08/24/dynamic-favicons/feed/</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Doing it right: skipping the iPhone url bar</title>
		<link>http://remysharp.com/2010/08/05/doing-it-right-skipping-the-iphone-url-bar/</link>
		<comments>http://remysharp.com/2010/08/05/doing-it-right-skipping-the-iphone-url-bar/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 12:57:05 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Apple]]></category>

		<category><![CDATA[Code]]></category>

		<category><![CDATA[iphone]]></category>

		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=590</guid>
		<description><![CDATA[With some mobile web sites when visited on the iPhone, you may want to skip past the url bar (something I'm not sure if it's possible, or even worth doing on other mobiles). There's a simple solution to doing this, but doing it right is the real trick.



Below are two screenshots from the mobile view [...]


Related posts:<ol><li><a href='http://remysharp.com/2008/01/21/fixing-ie-overflow-problem/' rel='bookmark' title='Permanent Link: Fixing IE overflow problem'>Fixing IE overflow problem</a></li><li><a href='http://remysharp.com/2007/03/20/how-to-add-twitter-to-your-blog-without-it-hanging-your-site/' rel='bookmark' title='Permanent Link: How to add Twitter to your blog, without it hanging your site'>How to add Twitter to your blog, without it hanging your site</a></li><li><a href='http://remysharp.com/2007/04/12/how-to-detect-when-an-external-library-has-loaded/' rel='bookmark' title='Permanent Link: How to detect when an external library has loaded'>How to detect when an external library has loaded</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>With some mobile web sites when visited on the iPhone, you may want to skip past the url bar (something I'm not sure if it's possible, or even worth doing on other mobiles). There's a simple solution to doing this, but doing it right is the real trick.</p>

<p><span id="more-590"></span></p>

<p>Below are two screenshots from the mobile view of <a href="http://full-frontal.org">Full Frontal, my JavaScript conference</a>:</p>

<p><img width="280" style="margin-right: 20px;" src="http://remysharp.com/images/ff-with-bar.png" alt="Full Frontal with the url bar" /><img  width="280" src="http://remysharp.com/images/ff-without-bar.png" alt="Full Frontal without the url bar" /> </p>

<p>Making the iPhone hide the url bar is fairly simple, you need run the following JavaScript:</p>

<pre><code>window.scrollTo(0, 1);</code></pre>

<p>However there's the question of when? You have to do this once the height is correct so that the iPhone can scroll to the first pixel of the document, otherwise it will try, then the height will load forcing the url bar back in to view.</p>

<p>You could wait until the images have loaded and the <code>window.onload</code> event fires, but this doesn't always work, if everything is cached, the event fires too early and the <code>scrollTo</code> never has a chance to jump. Here's an example using <code>window.onload</code>: <a href="http://jsbin.com/edifu4/4/">http://jsbin.com/edifu4/4/</a></p>

<p>I personally use a timer for 1 second - which is enough time on a mobile device while you wait to render, but long enough that it doesn't fire too early:</p>

<pre><code>setTimeout(function () {
  window.scrollTo(0, 1);
}, 1000);</code></pre>

<p>However, you only want this to setup if it's an iPhone (or just mobile) browser, so a sneaky sniff (I don't generally encourage this, but I'm comfortable with this to prevent "normal" desktop browsers from jumping one pixel):</p>

<pre><code>/mobile/i.test(navigator.userAgent) &#038;&#038; setTimeout(function () {
  window.scrollTo(0, 1);
}, 1000);</code></pre>

<p>The very last part of this, and this is the part that seems to be missing from some examples I've seen around the web is this: if the user specifically linked to a url fragment, i.e. the url has a hash on it, you <em>don't</em> want to jump. So if I navigate to <a href="http://full-frontal.org/tickets#dayconf">http://full-frontal.org/tickets#dayconf</a> - I want the browser to scroll <em>naturally</em> to the element whose id is <em>dayconf</em>, and not jump to the top using <code>scrollTo(0, 1)</code>:</p>

<pre><code>/mobile/i.test(navigator.userAgent) &#038;&#038; !location.hash &#038;&#038; setTimeout(function () {
  window.scrollTo(0, 1);
}, 1000);​</code></pre>

<p>Try this out on an iPhone (or simulator) <a href="http://jsbin.com/edifu4/10">http://jsbin.com/edifu4/10</a> and you'll see it will only scroll when you've landed on the page without a url fragment.</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2008/01/21/fixing-ie-overflow-problem/' rel='bookmark' title='Permanent Link: Fixing IE overflow problem'>Fixing IE overflow problem</a></li><li><a href='http://remysharp.com/2007/03/20/how-to-add-twitter-to-your-blog-without-it-hanging-your-site/' rel='bookmark' title='Permanent Link: How to add Twitter to your blog, without it hanging your site'>How to add Twitter to your blog, without it hanging your site</a></li><li><a href='http://remysharp.com/2007/04/12/how-to-detect-when-an-external-library-has-loaded/' rel='bookmark' title='Permanent Link: How to detect when an external library has loaded'>How to detect when an external library has loaded</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2010/08/05/doing-it-right-skipping-the-iphone-url-bar/feed/</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Throttling function calls</title>
		<link>http://remysharp.com/2010/07/21/throttling-function-calls/</link>
		<comments>http://remysharp.com/2010/07/21/throttling-function-calls/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 12:28:52 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[development]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=583</guid>
		<description><![CDATA[If you've written any kind of validation on user input, like onkeypress then you'll know that sometimes you want to throttle the amount of times your function runs. A good example of this is Ajax based username validation - you don't want to hit the server on every key press, because most users will be [...]


Related posts:<ol><li><a href='http://remysharp.com/2008/01/12/ajax-validation-pattern/' rel='bookmark' title='Permanent Link: Ajax validation pattern'>Ajax validation pattern</a></li><li><a href='http://remysharp.com/2008/12/12/stop-treating-ajax-as-something-special/' rel='bookmark' title='Permanent Link: Stop treating Ajax as something special'>Stop treating Ajax as something special</a></li><li><a href='http://remysharp.com/2007/12/28/jquery-tag-suggestion/' rel='bookmark' title='Permanent Link: jQuery Tag Suggestion'>jQuery Tag Suggestion</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>If you've written any kind of validation on user input, like <code>onkeypress</code> then you'll know that sometimes you want to throttle the amount of times your function runs. A good example of this is Ajax based username validation - you don't want to hit the server on every key press, because most users will be able to write their name in around 1/10th of a second, so you <em>should</em> throttle the Ajax request until the input is dormant for 100ms.</p>

<p><span id="more-583"></span></p>

<p>So with a bit of magic JavaScript making use of the ever useful <a href="http://en.wikipedia.org/wiki/Closure_(computer_science)">closure</a> JavaScript offers, we can create a simple method to handle this for us:</p>

<pre><code>function throttle(fn, delay) {
  var timer = null;
  return function () {
    var context = this, args = arguments;
    clearTimeout(timer);
    timer = setTimeout(function () {
      fn.apply(context, args);
    }, delay);
  };
}</code></pre>

<p>So if you were doing something with jQuery, like a key press validation, you would do this instead:</p>

<pre><code>$('input.username').keypress(<strong>throttle</strong>(function (event) {
  // do the Ajax request
}, <strong>250</strong>));</code></pre>

<p>The keyword <code>this</code> is the input as you would expect, and all the correct arguments are passed to the event handle, i.e. it works the exact same way as you'd expect, except it only fires once the <code>keypress</code> event is idle for 250ms (in this particular case).</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2008/01/12/ajax-validation-pattern/' rel='bookmark' title='Permanent Link: Ajax validation pattern'>Ajax validation pattern</a></li><li><a href='http://remysharp.com/2008/12/12/stop-treating-ajax-as-something-special/' rel='bookmark' title='Permanent Link: Stop treating Ajax as something special'>Stop treating Ajax as something special</a></li><li><a href='http://remysharp.com/2007/12/28/jquery-tag-suggestion/' rel='bookmark' title='Permanent Link: jQuery Tag Suggestion'>jQuery Tag Suggestion</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2010/07/21/throttling-function-calls/feed/</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Hacking Twitter's reply system</title>
		<link>http://remysharp.com/2010/06/14/hacking-twitters-reply-system/</link>
		<comments>http://remysharp.com/2010/06/14/hacking-twitters-reply-system/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 11:37:45 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Web]]></category>

		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=573</guid>
		<description><![CDATA[I'm only writing about this because I still see some tweets coming out of Twitter that are intended for everyone, but end up just going to a select few. This trick is pretty well used, but hopefully it'll help those people who haven't spotted it yet.



The way @replies work, is that if you start your [...]


Related posts:<ol><li><a href='http://remysharp.com/2009/09/16/a-better-twitter-search/' rel='bookmark' title='Permanent Link: A better Twitter search'>A better Twitter search</a></li><li><a href='http://remysharp.com/2008/05/31/twitter-script-upgrades-jsonp-hacking/' rel='bookmark' title='Permanent Link: Twitter script upgrades &#038; JSONP hacking'>Twitter script upgrades &#038; JSONP hacking</a></li><li><a href='http://remysharp.com/2008/09/17/tweet-offline-better-locations/' rel='bookmark' title='Permanent Link: Tweet offline &#038; better locations'>Tweet offline &#038; better locations</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I'm only writing about this because I still see some tweets coming out of Twitter that are intended for everyone, but end up just going to a select few. This trick is pretty well used, but hopefully it'll help those people who haven't spotted it yet.</p>

<p><span id="more-573"></span></p>

<p>The way @replies work, is that if you start your tweet with @user only that user and your common followers (ie. that follow both you and me) will see the tweet.</p>

<p>If you want everyone to see the tweet, yet the tweet is in reply to @user, then you can you can hack the @reply system by putting a character before the tweet.</p>

<p>Instead of doing:</p>

<blockquote>
  <p>@brucel and I are doing are talking HTML5 at London Geeknights</p>
</blockquote>

<p>I'll insert a period character (it can be anything you want) and it'll be seen by everyone:</p>

<blockquote>
  <p>.@brucel and I are doing are talking HTML5 at London Geeknights</p>
</blockquote>

<h2>When would you want to use this?</h2>

<p>I <em>only</em> use this when my reply is of value to all my followers. </p>

<p>If it's not, and only a specific reply, then I don't hack the @reply.</p>

<h2>Inverting the hack, not CC'ing lots of people</h2>

<p>The inverse of this hack (perhaps...!) is when you're having a conversation with a specific group of followers. You don't need to /cc them all if you all follow each other.  For example, if I'm replying to a tweet from @codepo8:</p>

<blockquote>
  <p>@brucel @adactio HTML5 has wings! (not a real tweet!)</p>
</blockquote>

<p>I can reply with simply:</p>

<blockquote>
  <p>@codepo8 Like redbull or something else?</p>
</blockquote>

<p>And since @brucel &amp; @adactio follow @codepo8 I know they'll see the reply too in their main stream.  </p>

<p>If I want to force it in to their replies, then I'll include them in the @reply if it's really worth getting to their attention.</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2009/09/16/a-better-twitter-search/' rel='bookmark' title='Permanent Link: A better Twitter search'>A better Twitter search</a></li><li><a href='http://remysharp.com/2008/05/31/twitter-script-upgrades-jsonp-hacking/' rel='bookmark' title='Permanent Link: Twitter script upgrades &#038; JSONP hacking'>Twitter script upgrades &#038; JSONP hacking</a></li><li><a href='http://remysharp.com/2008/09/17/tweet-offline-better-locations/' rel='bookmark' title='Permanent Link: Tweet offline &#038; better locations'>Tweet offline &#038; better locations</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2010/06/14/hacking-twitters-reply-system/feed/</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Signs of a poorly written jQuery plugin</title>
		<link>http://remysharp.com/2010/06/03/signs-of-a-poorly-written-jquery-plugin/</link>
		<comments>http://remysharp.com/2010/06/03/signs-of-a-poorly-written-jquery-plugin/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 12:27:24 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[jQuery]]></category>

		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=558</guid>
		<description><![CDATA[So far with every single workshop I've given, both for advanced JavaScript and jQuery for Designers, this question (or some variation thereof) has come up:


  How do you know if the plugin is good to use?


It's always dependant on the problem they're trying to solve, but in lieu of a better jQuery plugin ranking [...]


Related posts:<ol><li><a href='http://remysharp.com/2009/07/08/jquery-multibinding-events/' rel='bookmark' title='Permanent Link: jQuery multibinding events'>jQuery multibinding events</a></li><li><a href='http://remysharp.com/2009/01/26/element-in-view-event-plugin/' rel='bookmark' title='Permanent Link: Element 'in view' Event Plugin'>Element 'in view' Event Plugin</a></li><li><a href='http://remysharp.com/2007/01/25/jquery-tutorial-text-box-hints/' rel='bookmark' title='Permanent Link: jQuery tutorial: Text box hints'>jQuery tutorial: Text box hints</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>So far with every single workshop I've given, both for advanced JavaScript and jQuery for Designers, this question (or some variation thereof) has come up:</p>

<blockquote>
  <p>How do you know if the plugin is good to use?</p>
</blockquote>

<p>It's always dependant on the problem they're trying to solve, but in lieu of a better jQuery plugin ranking system, here's a couple of tips that should raise a red flag.</p>

<p><span id="more-558"></span></p>

<p>Consider the following:</p>

<pre><code>$.fn.myplugin = function () {
  var me = $(this).each(function() {
    return $(this).bind('someEvent', function () {
      // does something
    });
  });

  return me;
};</code></pre>

<p>Although the code may be perfect once some event has run, most times you don't have time to read through <em>all</em> the code carefully and you need to make a decision so you can move on to the actual problem you're trying to solve.</p>

<p>In the code above, there's a number of red flags that have gone up for me, and I tend to look in this area of code first.  If these patterns have been used, it tells me the author hasn't quite grasped how jQuery works and hasn't considered making simple tuning changes.</p>

<h2>The inline return</h2>

<pre><code>$.fn.myplugin = function () {
  var me = $(this).each(fn);
  return me;
};</code></pre>

<p>Should be written as:</p>

<pre><code>$.fn.myplugin = function () {
  return $(this).each(fn);
};</code></pre>

<p>The <code>me</code> variable isn't being used again, so there's no point in creating it.</p>

<h2>Double jQuery</h2>

<pre><code>$.fn.myplugin = function () {
  return $(this).each(fn);
};</code></pre>

<p>Whilst within the context of the plugin code - i.e. within the function attached to <code>.fn</code>, the keyword <code>this</code> refers to the jQuery instance, <strong>not</strong> DOM elements.</p>

<p>If I were to rewrite <code>this</code> to show you the value, you'd see:</p>

<pre><code>$.fn.myplugin = function () {
  return $($('div.foo')).each(fn);
};</code></pre>

<p>So within the actual plugin (<em>not</em> jQuery callbacks), <code>this</code> refers to jQuery, so we can access jQuery's methods directly:</p>

<pre><code>$.fn.myplugin = function () {
  return this.each(fn);
};</code></pre>

<h2>Returning <em>what</em> to each?</h2>

<pre><code>$.fn.myplugin = function () {
  return this.each(function () {
    return $(this).bind('someEvent', fn);
  });
};</code></pre>

<p>jQuery's each iterator simply loops, it doesn't collect anything. The result variable is jQuery with the original collection inside it still - you can't modify the collection by returning or not returning.</p>

<p>So <code>return</code> isn't required at all in this case:</p>

<pre><code>$.fn.myplugin = function () {
  return this.each(function () {
    $(this).bind('someEvent', fn);
  });
};</code></pre>

<h2>Wasteful use of each</h2>

<pre><code>$.fn.myplugin = function () {
  return this.each(function () {
    $(this).bind('someEvent', fn);
  });
};</code></pre>

<p>Hopefully by removing all the cruft from the starting version, this next step should be obvious. If not, here's a clue:</p>

<ul>
<li>What's returned from an <code>each</code> call? A jQuery collection.</li>
<li>What's returned from a <code>bind</code> call? A jQuery collection.</li>
</ul>

<p>Since we're running the <code>bind</code> on <code>each</code> element, and only doing that, it means there's no difference. So let's throw away the <code>each</code> call and <em>just</em> return the <code>bind</code>:</p>

<pre><code>$.fn.myplugin = function () {
  return this.bind('someEvent', fn);
};</code></pre>

<p>Remember that within the plugin, <code>this</code> refers to the jQuery instance, and not the element, so we don't need the wrapping <code>$()</code>.</p>

<p>All better now, eh?</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2009/07/08/jquery-multibinding-events/' rel='bookmark' title='Permanent Link: jQuery multibinding events'>jQuery multibinding events</a></li><li><a href='http://remysharp.com/2009/01/26/element-in-view-event-plugin/' rel='bookmark' title='Permanent Link: Element 'in view' Event Plugin'>Element 'in view' Event Plugin</a></li><li><a href='http://remysharp.com/2007/01/25/jquery-tutorial-text-box-hints/' rel='bookmark' title='Permanent Link: jQuery tutorial: Text box hints'>jQuery tutorial: Text box hints</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2010/06/03/signs-of-a-poorly-written-jquery-plugin/feed/</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Why Firebug sucks more than IE6</title>
		<link>http://remysharp.com/2010/05/28/why-firebug-sucks-more-than-ie6/</link>
		<comments>http://remysharp.com/2010/05/28/why-firebug-sucks-more-than-ie6/#comments</comments>
		<pubDate>Fri, 28 May 2010 09:00:08 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Web]]></category>

		<category><![CDATA[debug]]></category>

		<category><![CDATA[debugging]]></category>

		<category><![CDATA[firebug]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=545</guid>
		<description><![CDATA[Updated because I got tired of the crap I was getting for venting.


Related posts:Firebug 1.0 betaFirebug in IE for *any* web site


Related posts:<ol><li><a href='http://remysharp.com/2006/12/30/firebug-10-beta/' rel='bookmark' title='Permanent Link: Firebug 1.0 beta'>Firebug 1.0 beta</a></li><li><a href='http://remysharp.com/2007/03/13/firebug-in-ie-for-any-web-site/' rel='bookmark' title='Permanent Link: Firebug in IE for *any* web site'>Firebug in IE for *any* web site</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Updated because I got tired of the crap I was getting for venting.</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2006/12/30/firebug-10-beta/' rel='bookmark' title='Permanent Link: Firebug 1.0 beta'>Firebug 1.0 beta</a></li><li><a href='http://remysharp.com/2007/03/13/firebug-in-ie-for-any-web-site/' rel='bookmark' title='Permanent Link: Firebug in IE for *any* web site'>Firebug in IE for *any* web site</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2010/05/28/why-firebug-sucks-more-than-ie6/feed/</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Slicehost, Node.js &amp; WebSockets</title>
		<link>http://remysharp.com/2010/02/14/slicehost-nodejs-websockets/</link>
		<comments>http://remysharp.com/2010/02/14/slicehost-nodejs-websockets/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 10:06:32 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Web]]></category>

		<category><![CDATA[html5]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[node]]></category>

		<category><![CDATA[slicehost]]></category>

		<category><![CDATA[websockets]]></category>

		<guid isPermaLink="false">http://remysharp.com/2010/02/14/slicehost-nodejs-websockets/</guid>
		<description><![CDATA[I've been looking for a small hosting provider that I could run node.js on to test out some WebSocket experiments, and this is my account so that you also can have a play.


I should add before I continue, that it's not difficult by any measure if you know what you're doing (which I was about [...]


Related posts:<ol><li><a href='http://remysharp.com/2007/10/27/lamp-in-leopard-osx-105-php5-and-apache-22/' rel='bookmark' title='Permanent Link: LAMP in Leopard OSX 10.5 (PHP5 and Apache 2.2)'>LAMP in Leopard OSX 10.5 (PHP5 and Apache 2.2)</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I've been looking for a small hosting provider that I could run <a href="http://nodejs.org">node.js</a> on to test out some WebSocket experiments, and this is my account so that you also can have a play.</p>

<p><span id="more-534"></span>
I should add before I continue, that it's not difficult by any measure if you know what you're doing (which I was about 80% of the way there myself) as per:</p>

<div class="tweet" style="border: 1px solid #ccc; padding: 10px;">
  <p>@rem since your last tweet (roughly 20 minutes) I bought a slice on Slicehost for 20$ and got the #nodejs example server running on it.</p>
  <div class="source">
    <p style="margin: 0; line-height: 20px;"><img style="padding-right: 10px; vertical-align: top;" src="http://twivatar.org/kriskowal/mini"><a href="http://twitter.com/kriskowal/status/9075436737" style="font-size: 150%;">kriskowal</a></p>
  </div>
</div>

<h2>Slicehost</h2>

<p>I did try out Rackspace Cloud at $11/month to start off with, but after the registration was complete they told me that they needed to call me to finalise verification. I wasn't at home so I didn't get the call. Plus, since I've moved my bank account is in a weird flux at the moment. Suffice to say, the account was never completed and I couldn't get access to the server. So I cancelled quickly and looked at registering with Slicehost.</p>

<p><a href="http://www.slicehost.com/">Slicehost</a> registration was a breeze - I started with the smallest option. One form to complete and the server was up. Amazingly easy. They had preselected an "Ubuntu 8.04.2 LTS (hardy)" distro for me, which if I was asked to select one of the distros myself, I'd have no idea which would be a decent starting point otherwise: 8, 9, 10? Who knows, I just wanted to get going. Perfect.</p>

<p>Immediately my server was running. I did hit one security block which you're unlikely to also hit because I was registering from the UK, but accessing from Switzerland (since I was still on holiday), but the customer support notified me of the security issue (which blocked my server) and literally had it all sort and resolved within 10 minutes. I whole heartily praise their support for the speed and personal touch they had sorting this out.</p>

<p>So, getting set up. I'd need the following:</p>

<ol>
<li>My own account, rather than root</li>
<li>Git (so I could clone the repos)</li>
<li>Node.js (and thus also c++ compilers, etc)</li>
<li>WebSocket server</li>
</ol>

<h2>Configuring the Ubuntu server</h2>

<p>Slicehost has a superb wiki with instructions here:</p>

<p><a href="http://wiki.slicehost.com/doku.php?id=get_started_with_your_new_ubuntu_slice">Getting Started With Your New Ubuntu Slice</a></p>

<p>I followed the directions up to the "pimping out your prompt" (since I've got my own poison). That was the user config done and now I could sudo and root was blocked.</p>

<h2>Installing Git</h2>

<p>Git was simple, although I did go round the houses a little. Just run:</p>

<pre><code>sudo apt-get install git-core</code></pre>

<p>Now git was installed.</p>

<h2>Installing Compilers &amp; Node.js</h2>

<p>Getting node was simple as all I needed to do was clone the repo:</p>

<pre><code>git clone git://github.com/ry/node.git</code></pre>

<p>The problem was actually building Node - I hadn't installed the compilers, c++, cc, gcc, etc. Using a combination of hit and miss and shotgun approach, this was also simple:</p>

<pre><code>sudo aptitude install build-essential -y</code></pre>

<p>This gave me all the compilers, so I was then able to build.</p>

<p>I'm now going to fast forward through my experience and rather than take you round the houses, just tell you that you want the <em>stable</em> build and not the latest.  The WebSockets don't work properly with the latest 0.1.28 build, and the stable build is on 0.1.26. So you need to switch branches (from the <code>node</code> directory):</p>

<pre><code>git checkout origin/stable</code></pre>

<p>Now you're ready to build. It actually took me a lot of faffing around to work out I wasn't on the stable release, so consider this a favour! <img src='http://remysharp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <em>Now</em> we're ready to build:</p>

<pre><code>./configure
make
sudo make install</code></pre>

<p>Next stop, let's get the WebSocket server running</p>

<h2>WebSocket Server</h2>

<p>I personally wanted to play with the <a href="http://apiwiki.twitter.com/Streaming-API-Documentation" title="Twitter API Wiki / Streaming API Documentation">streaming Twitter API</a>, conveniently there's a git repo for that!</p>

<p>I created a <code>web</code> directory in my home directory so that I could run my experiments out of, from there I run:</p>

<pre><code>git clone git://github.com/andregoncalves/twitter-nodejs-websocket.git</code></pre>

<p>From there I kicked off the server (by default it listens for "iphone"):</p>

<pre><code>cd twitter-nodejs-websocket
node server.js &lt;username&gt; &lt;password&gt;</code></pre>

<p>Now on my other "normal" server (though the smoothness of slicehost, I'm now thinking of porting across all my sites) hosts a simple web page (from the example in the git repo) that streams the latest tweets found by the server and should be viewed on a WebSocket enabled browser, i.e. Google Chrome (dev channel) or Webkit nightly: <a href="http://rem.im/relay-tweets.html">http://rem.im/relay-tweets.html</a> (note that I'll be running this demo for a while, but it may well be taken down in the future). Here's a screenshot in case I've shut it down and moved on:</p>

<p><img src="http://remysharp.com/images/twitter-stream.png" alt="Screenshot of streaming tweets" title="Screenshot of streaming tweets" /></p>

<p>The core code to run the socket is simply this:</p>

<pre><code>ws = new WebSocket("ws://&lt;host&gt;:8080/");

ws.onmessage = function(event) { 
  var data = JSON.parse(event.data);
  var $p = $(twitterlib.render(data)); // uses <a href="http://github.com/remy/twitterlib">Twitterlib.js</a>
  if ($('#tweets > li').length > 15) {
    $('#tweets >li:last').slideDown(100, function () {
      $(this).remove();
    });
  }

  $('#tweets').prepend($p);
  $p.slideDown(140);
};

ws.onclose = function() {
  alert("socket closed");
};</code></pre>

<p>No doubt I'll be posting an article on <a href="http://html5doctor.com/" title="HTML5 Doctor, helping you implement HTML5 today">HTML5 Doctor</a> about WebSockets and writing about it in the upcoming <a href="http://www.amazon.com/Introducing-HTML-Voices-That-Matter/dp/0321687299">Introducing HTML5</a> that I'm writing with <a href="http://www.brucelawson.co.uk/" title="Bruce Lawson&#8217;s  personal site">Bruce Lawson</a>.</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2007/10/27/lamp-in-leopard-osx-105-php5-and-apache-22/' rel='bookmark' title='Permanent Link: LAMP in Leopard OSX 10.5 (PHP5 and Apache 2.2)'>LAMP in Leopard OSX 10.5 (PHP5 and Apache 2.2)</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2010/02/14/slicehost-nodejs-websockets/feed/</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>HTML5 vs. Flash</title>
		<link>http://remysharp.com/2010/02/08/html5-vs-flash/</link>
		<comments>http://remysharp.com/2010/02/08/html5-vs-flash/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 11:00:24 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Web]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=525</guid>
		<description><![CDATA[First of all I wanted to make the title of this post "HTML5 and Flash", but I know it's going to bait more readers if I say versus. I should state for the record that for the foreseeable future I think Flash has a valid place on the web, and I don't personally see it [...]


Related posts:<ol><li><a href='http://remysharp.com/2009/05/28/html5-spell-death-to-flash/' rel='bookmark' title='Permanent Link: HTML5 spell death to Flash?'>HTML5 spell death to Flash?</a></li><li><a href='http://remysharp.com/2008/03/18/safari-31-web-developer-functionality/' rel='bookmark' title='Permanent Link: Safari 3.1 web developer functionality'>Safari 3.1 web developer functionality</a></li><li><a href='http://remysharp.com/2009/04/14/html5-and-firefox2/' rel='bookmark' title='Permanent Link: html5 and Firefox2'>html5 and Firefox2</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>First of all I wanted to make the title of this post "HTML5 <em>and</em> Flash", but I know it's going to bait more readers if I say versus. I should state for the record that for the foreseeable future I think Flash has a valid place on the web, and I don't personally see it as an <em>us and them</em> web.</p>

<p>Stephen Shankland, writer for CNET News got in touch and asked me to comment on an <a href="http://news.cnet.com/8301-30685_3-20000037-264.html">article he was writing</a>, posing me the questions in this post. Unfortunately my reply got to him to late and he had to go to post without my answers, but I thought that it would be worthwhile sharing my views via my own blog instead.</p>

<p><span id="more-525"></span></p>

<blockquote>
  <p>How far is HTML (and SVG and CSS and WebGL and JavaScript) to reproducing what Flash can do today?</p>
</blockquote>

<p>HTML, SVG, CSS and JavaScript are very far along to replacing a lot of what I see Flash doing today - but it should be noted my browsing style is general usage, rather than gaming or interactive videos - which Flash is good at.  </p>

<p>WebGL is very much at an early stage in it's development, only really (currently) appearing in the nightly builds of Webkit and Firefox, equally I've seen videos from Mozilla putting WebGL on to a Nokia device with no optimisation and it being able to render pretty well.  </p>

<p>There's lots of examples of apps and effects that have been achieve using Flash in the first decade of this century, but today we can build these using Open Web technologies.  This ranges from the simple image galleries to full fledged word processors.  Adobe released Buzzword which relies on Flash, but on the other side we have Google Docs which relies entirely on the Open Web.</p>

<blockquote>
  <p>Would you like to see Flash replaced by HTML?</p>
</blockquote>

<p>I personally don't think HTML will replace Flash.  I think HTML5 and the Open Web will replace Flash where Flash has been used as a stopgap.  sIFR is used to bring "custom" fonts to the browser, but now we have really good support for native custom fonts via the CSS fonts module, and products like TypeKit and FontDeck are making it easy for web authors to include those custom fonts without the need of Flash.</p>

<p>The native video element will (eventually) allow us to drop using Flash for video.  Flash has done an awesome job of pulling the braces up on browsers for the last decade, and we've needed it, but Flash is so much more than just video or font rendering.  I think the smart developers aren't won't be worried about native browser functionality making Flash redundant for noddy tasks, no doubt they'll be thankful to not have to build <em>another</em> video player.</p>

<p>As much as I'd like to see Open Web technology do everything, I still think we're a long way off HTML being able to able to natively replace applications such as <a href="http://aviary.com">Aviary</a> and games like <a href="http://channel4.com/bowstreetrunner">Bow Street Runner</a>.</p>

<p>Equally, as I mentioned before SVG is one technology that has come along, and with the help of the svgweb JavaScript library, SVG works in IE.  This library of course gets IE to support SVG via Flash.  It translate the SVG markup on to a Flash canvas proving that Flash still has a place on the web as a bridging technology as well as it's intended use.</p>

<blockquote>
  <p>How serious do you think the H.264/Ogg Theora matter is with the HTML5 video codec?</p>
</blockquote>

<p>It's hard to say.  Personally it doesn't make much difference to me if I have to encode once, twice or three times.  Encoding is a background task so I set my converter off when I produce my screencasts and after an arbitrary amount of time I'll have some files to upload - obviously if you have masses of video to encode the disk usage is going to be a possible issue for you.</p>

<p>The problem lies with patents, which is why Firefox and Opera won't implement H.264 - but the politics and patents are for smarter people than me.  There's also the fear that we as content producers could be liable for license costs to the patent owners of H.264.</p>

<p>On the other hand, the company that own the patent for H.264 has elected not to collect royalties until 2016 - when they may again choose not to collect royalties.  Flash developers have been using H.264 for some time already  and there hasn't been any retribution for them, but for now I'll be producing both H.264 and Ogg Theora encoded content.</p>

<p>I'll be watching this topic closely to see how browsers deal with the two codecs.</p>

<blockquote>
  <p>As HTML etc. gets what Flash has today, do you think Flash will move upstream and remain relevant, become optional, or what?</p>
</blockquote>

<p>I think two things will happen.  Firstly I do think that Flash will move (or remain in some cases) upstream, and continue to push what's capable within the browser.  Gaming is a great example of an arena that Flash excels at.  The second thing I think we'll see is Flash developers taking the progressive enhancement approach to applications, relying more on HTML based solutions and enhancing upwards using Flash - Jeffrey Zeldman posted a great article recently <a href="http://www.zeldman.com/2010/02/01/flash-ipad-standards/">suggestion exactly that</a>.</p>

<blockquote>
  <p>How difficult is it for a Web developer today to use the fragmented Open Web standards vs. the more consistent Flash?</p>
</blockquote>

<p>I don't think it's too hard at at all, but it really depends on what technology you choose.  Web Storage has pretty solid support in the latest browsers (if not the nightly builds), but it's relatively easy to patch missing support just using JavaScript which would map sessionStorage to the <a href="http://ajaxian.com/archives/whats-in-a-windowname">window.name hack</a> and localStorage to cookies.</p>

<p>Geolocation can be detected and made use of if it's available, whilst those without the functionality can still map their position using something like Google Maps or a text field, thus taking a progressive enhancement approach.</p>

<p>Offline applications on the other hand can't be achieved if the technology isn't available - so it really depends on the application, it's use and whether you have a specific platform in mind for deployment (which generally I wouldn't encourage, but we know it happens).</p>

<p>Flash developers definitely have an easier time when it comes to deployment environment - in fact I've met a number of Flash developers now that said they made the shift from JavaScript and HTML years ago to Flash because of the appeal of a single environment: the Flash runtime.  </p>

<blockquote>
  <p>Anything else on the subject?</p>
</blockquote>

<p>As I said at the start of this post, I don't see this as an <em>us and them</em>, Open Web and Flash. I do see HTML5 plugging the areas that have been held up by Flash for the first decade of this century, and there are other areas that HTML5 supports that Flash doesn't - but Flash could even make use of, such as Offline Applications.</p>

<p>It's an exciting time on the web again where browsers are implementing features that make it an even more powerful platform to develop on. I for one, am keen as mustard to get building with the new shiny toys they're giving us. Equally, I'm certain Flash will continue to be used to build awesome shit (and probably some not so  awesome shit) for a long time yet.</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2009/05/28/html5-spell-death-to-flash/' rel='bookmark' title='Permanent Link: HTML5 spell death to Flash?'>HTML5 spell death to Flash?</a></li><li><a href='http://remysharp.com/2008/03/18/safari-31-web-developer-functionality/' rel='bookmark' title='Permanent Link: Safari 3.1 web developer functionality'>Safari 3.1 web developer functionality</a></li><li><a href='http://remysharp.com/2009/04/14/html5-and-firefox2/' rel='bookmark' title='Permanent Link: html5 and Firefox2'>html5 and Firefox2</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2010/02/08/html5-vs-flash/feed/</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Goodnight 2009</title>
		<link>http://remysharp.com/2010/01/03/goodnight-2009/</link>
		<comments>http://remysharp.com/2010/01/03/goodnight-2009/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 11:27:31 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Personal]]></category>

		<category><![CDATA[newyear]]></category>

		<guid isPermaLink="false">http://remysharp.com/2010/01/03/goodnight-2009/</guid>
		<description><![CDATA[I'm a little late to the game of year reviews (since we're a few days in), but this blog was originally designed to supplement my memory, so I'm going to brain-dump my year, more for me, but also for you (if you're interested!).  Here's what I got up to in 2009.



Projects

Aside from client projects, [...]


Related posts:<ol><li><a href='http://remysharp.com/2008/05/02/the-long-ride/' rel='bookmark' title='Permanent Link: The Long Ride'>The Long Ride</a></li><li><a href='http://remysharp.com/2008/03/13/presenting-jquery-at-qcon/' rel='bookmark' title='Permanent Link: Presenting jQuery at QCon'>Presenting jQuery at QCon</a></li><li><a href='http://remysharp.com/2006/09/13/another-day-another-birthday/' rel='bookmark' title='Permanent Link: Another day, another birthday'>Another day, another birthday</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I'm a little late to the game of year reviews (since we're a few days in), but this blog was originally designed to supplement my memory, so I'm going to brain-dump my year, more for me, but also for you (if you're interested!).  Here's what I got up to in 2009.</p>

<p><span id="more-509"></span></p>

<h2>Projects</h2>

<p>Aside from client projects, I also like to tinker with technology and launch my own projects, here's a run down of some of my favourites:</p>

<ul>
<li><a href="http://2009.full-frontal.org">Full Frontal</a> - our very own JavaScript conference, the idea stemming from a conversation during "<a href="http://www.flickr.com/photos/remysharp/sets/72157613262265564/">snow day</a>" in Feb 2009, where Julie and I sat in a pub and I complained that there should be a JavaScript conference.  Come November we ran our own conference at the local indie cinema Duke of Yorks to my great pleasure it was a massive success. <a href="http://www.flickr.com/photos/remysharp/sets/72157622854415414/">Pictures</a>, <a href="http://remysharp.com/2009/11/26/full-frontal-javascript-2009/">my review</a>, others: <a href="http://domscripting.com/blog/display/123">#1</a>, <a href="http://developer.yahoo.net/blog/archives/2009/11/full_frontal.html">#2</a>, <a href="http://unclescript.blogspot.com/2009/12/full-brighton.html">#3</a>, <a href="http://chrismahon.com/blog/2009/11/full-frontal-2009/">#4</a>, <a href="http://chrisbewick.com/blog/events/full-frontal-2009-back-to-brighton/">#5</a></li>
<li><a href="http://snapbird.org">Snap Bird</a> - out of frustration with the 10 day limit in Twitter's search, I decided to reverse engineer the search structure and apply it to individual timeline lines, which have a limit of 3,200 tweets - busting far out from the 10 day limit, and most of the time you're looking for something specific. It started out as a plain grey project and with a <a href="http://twitter.com/rem/status/4691561713">gentle tweet request for design</a> and within a week <a href="http://twitter.com/stompfrog">Chris Bewick</a> and (local) <a href="http://twitter.com/nicepaul">Paul Annett</a> had given me an awesome logo/mascot (Chris) and design (Paul). I use this tool probably once every other day to find various lost tweets, one project I'm damn proud of.</li>
<li><a href="http://jsbin.com">JS Bin</a> redesign - with the help of <abbr title="user experience designer">UX</abbr> local <a href="http://twitter.com/yandle">Danny Hope</a> JS Bin is getting a long awaited make over, but also dynamic syntax highlighting and some tighter features, such as milestones.  It's not live yet, but it's getting there, and I'm also making the project <a href="http://github.com/remy/jsbin">open source</a>.</li>
<li><a href="http://html5doctor.com">HTML5 Doctor</a> - I was kindly invited to join the HTML5 Doctors just before they launched offering a JavaScript perspective on HTML5 (though I've written a number of non-JS based articles already). A project that aims to translate the specs for web authors and organised by <a href="http://richclarkdesign.com/">Rich Clark</a> a great resource for those wanting to learn HTML5.</li>
<li><a href="http://html5demos.com">HTML5 Demos</a> - created out of the need to experiment with HTML5, I figured I may as well share those experiments.</li>
<li><a href="http://remysharp.com/twitter">Twitter hacking</a> - I've built a number of twitter related apps this year, in fact enough to run two demos during the 140 second presentations at <a href="http://twitterdevelopernest.com/">Devnest</a> (run approximately every two months). Including a permalink for twitter avatars, an app to find where your friends are located and bunch more <img src='http://remysharp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>

<h2>Personal</h2>

<p>2009 was even bigger than this post can begin to explain for me personally, and a lot of my personal achievements have been in my working life (because I allow - purposely - the two to bleed into each other).</p>

<ul>
<li>Moved house - no less than 5 days <em>after</em> Full Frontal, Julie and I moved house, from our small one bed-flat, to a 3-bed house. A big jump, and we're definitely growing up! It's definitely a family home (though currently it's just <a href="http://www.flickr.com/photos/remysharp/tags/cats/">us and the cats</a>) and somewhere I can see us staying for a good number of years.</li>
<li>Full Frontal - yeah, I'm repeating this one, it was freekin' huge for Julie and I to run a conference that sold out <em>and</em> was a huge success with it's delegates. I'm really looking forward to the challenge again next year.</li>
<li>Meeting the locals - 2009 was the first year where I didn't have another job to support my business, so I had to start meeting people if I didn't want to spend a year working from my bedroom with only my cats for company (they're great, but not that great!). So I met people in Brighton, and (I'm partly blaming my Austin experience) I've made new friends I never expected to find - I consider my self a very lucky chap indeed to have met and befriended all the people I have done this year <img src='http://remysharp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li><a href="http://docs.jquery.com/About#Evangelism_Team">jQuery evangelist</a> - I was invited to join the jQuery team as an evangelist, which mostly means continuing what I've been doing, but I'm proud as pudding to be officially representing the library.</li>
<li>Publications - the <a href="http://oreilly.com/catalog/9780596159788" title="jQuery Cookbook">jQuery Cookbook</a> was published in November, I contributed chapter 7 - effects, I contributed a <a href="http://www.netmag.co.uk/zine/latest-issue/issue-195">featured article on HTML5 to .net magazine</a> along with a tutorial article a few quotes for jQuery winning the award for best open source app. </li>
</ul>

<h2>Travelling: personal &amp; speaking</h2>

<ul>
<li>March: <a href="http://www.flickr.com/photos/remysharp/sets/72157616256504958/">Claviere, Italy</a> - snowboarding, mine and Julie's first solid week of powder. Crazy that we've been snowboarding for 10 years, and only how we get a week of powder. It was awesome none the less!</li>
<li>March: <a href="http://www.flickr.com/photos/remysharp/sets/72157616166315155/">Austin, Texas</a> - for <a href="http://sxsw.com/interactive" title="SXSW.com">SxSWi</a>. Much to my surprise this experience actually changed me. I'm generally quite a shy chap, and Austin forced me to be more on my own than I had been in a long while. I created new friends, something that I've been traditionally very precious about, and now as a man in his 30s, I'm making new friends almost as much as when I was a kid at school.</li>
<li>May: <a href="http://www.flickr.com/photos/remysharp/sets/72157618904068998/">All over Peru</a> - Julie and my big trip, 3 weeks out in Peru. We had an absolutely amazing time, walking 4 days to Machu Picchu was an experience of a lifetime. I can <em>rarely</em> express in words the experience, but if you ever have the chance, I'd recommend it in a heart beat.</li>
<li>May: Stockholm, Sweden - invited to speak at <a href="http://swdc2009.com/"><abbr title="Scandinavian web developer conference">SWDC</abbr></a> arriving only one day after getting back from Peru, proved to be incredibly expensive as jet-lag cost me my return flight home <img src='http://remysharp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> None the less, it was great to meet <a href="http://www.robertnyman.com/" title="Robert's talk">Robert Nyman</a> for the first time, <a href="http://molly.com/" title="molly.com">Molly</a> and <a href="http://dylanschiemann.com">Dylan</a> again after SxSWi (Dylan saved me with coffee, video adapter testing and Dr Who - so über kudos) and meeting <a href="http://jan.prima.de/">Jan</a> and <a href="http://www.nonblocking.io/">Malte</a> (who I would meet again for jsconf.eu) and organiser and scandie tasmanian devil: <a href="http://unclescript.blogspot.com/">Peter Svensson</a>.</li>
<li>June: <a href="http://www.flickr.com/photos/remysharp/sets/72157619348053685/">Stockholm, Sweden</a> - only to return 2 weeks later to speak with <a href="http://dev.opera.com/author/974138">Chris Mills</a> to talk at Robert Nyman's <a href="http://robertnyman.com/2009/05/04/geek-meet-charity-june-4th-2009-chris-mills-and-remy-sharp-speaking/">Geek Meet</a>. 150 odd people and one of the bigger talks I had given so far, and the feedback was really good (possibly because our talk was to be 2 hours and slightly laden with beer!).</li>
<li>August: Leamington, UK - invited to talk HTML5 at the <a href="http://2009.geekinthepark.co.uk/">Geek in the Park</a> and really nice day up north (I'm from Brighton, everything is north for me!)</li>
<li>August: Zürich, Switzerland - for a friend's 30th birthday, where I got to see quite possible one of the <a href="http://www.flickr.com/photos/remysharp/3870647730/">best signage I've seen</a>.</li>
<li>October: London &amp; Cambridge, UK - DevDays, talking about jQuery as an introduction to developers, but had the chance to speak to over 900 developers, and to my surprise it went down really well on the day (though criticisms in post reviews were it was aimed too much at the beginner - something I'd agree, and generally don't do), including great quotes like <em>more accomplished presenters shone too, Remy Sharp was first rate</em>!.</li>
<li>October: <a href="http://www.flickr.com/photos/remysharp/sets/72157622676095331/">Copenhagen, Denmark</a> - I had some business travelling to do, and I wanted to take Julie along for some of the trip away, so we used Copenhagen as our base and travelled around. It was a pretty city, easy to walk around, but pretty expensive to what we were used to <img src='http://remysharp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </li>
<li>November: <a href="http://www.flickr.com/photos/remysharp/sets/72157622676095331/">Malmö, Sweden</a> - for Øredev speaking about jQuery. It was sadly a fleeting visit, but the conference was absolutely huge and the first I'd been to that put the food on for us - I didn't spend a penny!</li>
<li>November: <a href="http://www.flickr.com/photos/remysharp/sets/72157622676095331/">Berlin, Germany</a> - again to speak, this time on HTML5 JavaScript APIs for <a href="http://jsconf.eu/" title="JSConf.eu - The JavaScript Conference">JSConf.eu</a> - which was crazy good. Two solid days of developers listening to JavaScript related talks, so much enthusiasm for language that had been given a bad wrap for many years. I strongly recommend the conference if you can get a ticket for next year.</li>
<li>December: Lisbon, Portugal - again talking HTML5 JS APIs, but this time I had time to really hone the content compared to JSConf.eu, and ditched some content and replaced it with more detail, <a href="http://codebits.eu/intra/s/session/60">a talk that I think went really well</a>, talking to over 300 people and (hopefully) getting them excited about JavaScript!  It was a bit of a boys weekend too, I got to mee <a href="http://twitter.com/andr3">André Luís</a> (an infinitely nice chap), <a href="http://suda.co.uk/">Brian Suda</a> (and talked about many a project idea), local Brightonian <a href="http://www.glennjones.net/Home/">Glenn Jones</a>, Robert Nyman (yep, again - this boy is following me, eh!) and <a href="http://twitter.com/brianleroux">Brian Leroux</a>, (one of the) developer behind <a href="http://phonegap.com/">PhoneGap</a> &amp; <a href="http://xuijs.com/">XUI</a> and hardened drinker as Julie and I would find out (Julie met me at the end of the conference so we could explore Lisbon some more).</li>
<li>December: Bergen, Norway - more of a commute than a trip, but I got to visit Norway for a fleeting 48 hours while I gave an advanced jQuery and JavaScript workshop.</li>
</ul>

<p>Then I got home and it was Christmas! Quite possibly the most travelling I've every done in a year, perhaps more than I had done up to that point in my life!</p>

<h2>2010</h2>

<p>I've got new challenges in the pipeline, some technical, some professional and some personal.  For now, if you're still interested, I've started my own <a href="http://www.flickr.com/photos/remysharp/sets/72157623114973634/">365 project</a> so let's see how I do on that.  </p>

<p>Until the next post, thanks for reading, thanks for sticking with me and I hope your 2010 is going to be bees knees <img src='http://remysharp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2008/05/02/the-long-ride/' rel='bookmark' title='Permanent Link: The Long Ride'>The Long Ride</a></li><li><a href='http://remysharp.com/2008/03/13/presenting-jquery-at-qcon/' rel='bookmark' title='Permanent Link: Presenting jQuery at QCon'>Presenting jQuery at QCon</a></li><li><a href='http://remysharp.com/2006/09/13/another-day-another-birthday/' rel='bookmark' title='Permanent Link: Another day, another birthday'>Another day, another birthday</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2010/01/03/goodnight-2009/feed/</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Full Frontal JavaScript 2009</title>
		<link>http://remysharp.com/2009/11/26/full-frontal-javascript-2009/</link>
		<comments>http://remysharp.com/2009/11/26/full-frontal-javascript-2009/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 16:16:53 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Business]]></category>

		<category><![CDATA[conference]]></category>

		<category><![CDATA[fullfrontal09]]></category>

		<guid isPermaLink="false">http://remysharp.com/2009/11/26/full-frontal-javascript-2009/</guid>
		<description><![CDATA[Last Friday I saw through the very first Full Frontal JavaScript conference. An idea that was born back on a snowy day in February, with me complaining there was no conferences dedicated to JavaScript (anymore) and my wife, Julie telling simply replying with let's do it (it helps that by day she's an events organiser).

So [...]


Related posts:<ol><li><a href='http://remysharp.com/2009/04/20/full-frontal-javascript-conference/' rel='bookmark' title='Permanent Link: Full Frontal JavaScript Conference'>Full Frontal JavaScript Conference</a></li><li><a href='http://remysharp.com/2009/11/16/going-full-frontal-in-one-week/' rel='bookmark' title='Permanent Link: Going Full Frontal in one week'>Going Full Frontal in one week</a></li><li><a href='http://remysharp.com/2009/08/19/win-a-ticket-for-the-full-frontal-javascript-conference/' rel='bookmark' title='Permanent Link: Win a ticket for the Full Frontal JavaScript Conference'>Win a ticket for the Full Frontal JavaScript Conference</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Last Friday I saw through the very first <a href="http://full-frontal.org">Full Frontal JavaScript conference</a>. An idea that was born back on a snowy day in February, with me complaining there was no conferences dedicated to JavaScript (anymore) and <a href="http://www.flickr.com/photos/remysharp/4124570521/in/set-72157622854415414/">my wife, Julie</a> telling simply replying with <em>let's do it</em> (it helps that by day she's an events organiser).</p>

<p>So over the next 10 months, Julie and I slowly plodded our way towards Friday 20th November where 248 (or so) developers and designers would come to our sunny city of Brighton for a day dedicated to JavaScript.</p>

<p>What started as a bit of complaining and wanted to scratch my own itch, ended up being an excellent day of talks and very, very well received first time conference.</p>

<p><span id="more-504"></span></p>

<h2>Leading up to the idea</h2>

<p>JavaScript is a passion for me. My hair stands on end when I talk about what can be done in this little language many have learned to love. I fell in love with JavaScript over 10 years ago when I realised I just needed a browser and notepad to code with. No compilers, no downloading tools, no SDKs. Just notepad and my imagination. </p>

<p>True, back then, my imagination was limited compared to today, but it's something that has kept me excited over a good number of years.</p>

<p>So when I found out that the US were running <a href="http://jsconf.us">JS Conf</a>, I <em>knew</em> I had to see something here in the UK.</p>

<p>JS Conf US turned out to be a massive success (well played <a href="http://twitter.com/voodootikigod">Chris Williams</a>, et al) which only cemented my feeling that the JavaScript community was (finally) coming together and there was a need for these conferences.</p>

<p>Once I had been convinced by Julie it was something we could do, I went about hand picking my speakers, and then announcing the conference. This also meant that there were no sponsored slots available, something I had been asked about after we launched, but I felt it was important to me to keep the content on topic and free of any sales pitches.</p>

<p>I was also adamant that the cost of the ticket should be cheap enough that <em>I</em> would be happy to go along. Sometimes you don't know how much you'll get out of a conference, so when faced with a £500 ticket price it's tough to justify, especially if you're a freelancer. I felt that around the £100 mark made it a much easier decision to make, freelancers and full timers alike.</p>

<h2>Going from 90 to 250</h2>

<p>Originally Julie and I had looked at, and were about to book, a venue in Brighton in a hotel convention room.  It would hold about 80-90 people, was relatively posh, but still felt like it might come off as a meet up rather than a conference.  This wasn't a big deal, but I wanted the day to feel special for the delegates along with delivering awesome talks.</p>

<p>However, a little over a week before the conference was set for 90 people, I had a conversation with <a href="http://adactio.com">Jeremy Keith</a> changed all that. It went pretty much like this:</p>

<blockquote>
  <p>Jeremy: You should run Full Frontal at the Duke of Yorks cinema</p>
</blockquote>

<p>He waves two fingers across my face whilst doing so, in an Obi Wan-esque way.</p>

<blockquote>
  <p>Me: you know what, I should run Full Frontal at the Dukes of Yorks</p>
</blockquote>

<p>In my best "these aren't the droids we're looking for" face.</p>

<p>And that was that.  We got on to the Duke of Yorks and suddenly our conference was increased by 150% - and the venue change was a superb suggestion, it added so much more character to the conference, and resulted in tweets such as:</p>

<blockquote>
  <p>At #fullfrontal09. Most comfy seats I've ever [known] at a conference &mdash; <a href="http://twitter.com/jot/status/5885454457">@jot</a></p>
</blockquote>

<p>So thank you Jeremy <img src='http://remysharp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<h2>JS Conf.eu</h2>

<p>Two weeks before Full Frontal, I had the honour of speaking at <a href="http://jsconf.eu">JS Conf.eu</a> - which was an amazing conference. In fact, I highly recommend it for anyone wanting more JavaScript than you can throw a bunny at.</p>

<p>It was so good, that it actually started to really worry me that my own conference wouldn't live up to my own expectations, let alone the delegates (seriously, JS Conf was awesome).</p>

<p>The guys behind JS Conf.eu, <a href="http://twitter.com/janl">Jan</a>, <a href="http://twitter.com/cramforce">Matle</a> and <a href="http://twitter.com/hblank">hblank</a> were all supportive of Full Frontal, and as I like to see in <em>normal business</em>, there was a collaboration of conferences rather than competition.  My hat goes off to you chaps (and everyone who supported your conference).</p>

<h2>The day</h2>

<p>The day was a HUGE success. A few issues I hit were:</p>

<ul>
<li>The wifi was pretty nuked - but to be fair, that's the case at most conferences and I told all the delegates at the start of the day to use their 3G. My intention was that since most people would have mobile devices, they could tweet from there - and they did! <img src='http://remysharp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> I don't see this as big deal and I'm happy with how it was handled.</li>
<li>I forgot music for the intervals, which only really showed in the morning when delegates were arriving, but by 9:10am I had hooked up my iPhone's music to the PA system, and the silence was broken. As it turns out, we didn't need it during the breaks.</li>
<li>Lunch was a bit of a mad rush for the speakers. In fact, since we (the speakers and supporting staff) didn't get over to the local pub until (what seemed like) everyone else had, we didn't manage to get served before the 2nd half of the day resumed, so it was sandwiches all round. Not a biggie either.</li>
</ul>

<p>That was about it for problems. Pros included:</p>

<ul>
<li>Hugely comfy seats and venue with great character</li>
<li>Frickin' awesome talks from <a href="http://twitter.com/codepo8">Christian</a>, <a href="http://twitter.com/robertnyman">Robert</a>, <a href="http://twitter.com/ppk">PPK</a>, <a href="http://twitter.com/sil">Stuart</a>, <a href="http://twitter.com/toddkloots">Todd</a>, <a href="http://twitter.com/jaffathecake">Jake</a> and <a href="http://twitter.com/simonw">Simon</a></li>
<li>Jake's talk was not only pure comedy throughout, but riddled with genuinely good content, a balance that's hard to strike</li>
<li>A successful after party (which I <a href="http://remysharp.com/2009/11/16/going-full-frontal-in-one-week/">bought the first round</a> for everyone)</li>
<li>Everyone's really positive feedback to Julie and I after the conference and at the after party</li>
</ul>

<p>And few more nice thing <a href="http://snapbird.org/rem/favs/fullfrontal09">tucked away in twitter</a>, and lots of pictures have been <a href="http://www.flickr.com/photos/tags/fullfrontal09/">uploaded to flickr</a> too (under the #fullfrontal09 tag).</p>

<h2>Thank yous</h2>

<p>The conference was a success because of a number of factors, including:</p>

<ul>
<li>It's sponsors: Yahoo! developer network, Guardian's open platform, Opera, .net, Dharmafly, O'Reilly and AVT.</li>
<li>All of our delegates</li>
<li>Our volunteers: Claire, <a href="http://twitter.com/yandle">Danny</a>, <a href="http://twitter.com/natbat">Natalie</a> and <a href="http://twitter.com/binarytales">Jon</a></li>
<li>Julie - my wife, who ran the strategic parts of the conference organising and the actual day itself, and kicked me up the bum to get Full Frontal to you all.</li>
</ul>

<h2>Full Frontal 2010?</h2>

<p>Absolutely. I'll be releasing dates and a site as soon as possible. A <a href="http://domscripting.com/blog/display/123">Jeremy said</a>, I'm going to have a hard job of matching this year's standard, but, hey, I'm up for a challenge if it means more awesome JavaScript talks!</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2009/04/20/full-frontal-javascript-conference/' rel='bookmark' title='Permanent Link: Full Frontal JavaScript Conference'>Full Frontal JavaScript Conference</a></li><li><a href='http://remysharp.com/2009/11/16/going-full-frontal-in-one-week/' rel='bookmark' title='Permanent Link: Going Full Frontal in one week'>Going Full Frontal in one week</a></li><li><a href='http://remysharp.com/2009/08/19/win-a-ticket-for-the-full-frontal-javascript-conference/' rel='bookmark' title='Permanent Link: Win a ticket for the Full Frontal JavaScript Conference'>Win a ticket for the Full Frontal JavaScript Conference</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2009/11/26/full-frontal-javascript-2009/feed/</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Native Retweets</title>
		<link>http://remysharp.com/2009/11/19/native-retweets/</link>
		<comments>http://remysharp.com/2009/11/19/native-retweets/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 00:40:49 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[api]]></category>

		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=497</guid>
		<description><![CDATA[Users of Twitter created the idiom "RT @suchnsuch said sumfink", and as with @ replies, RT's have been rolled in to Twitter's architecture.  Now we have, what I think should be called, the native retweet.

It was turned on for early users and more of the "twittersphere" is getting the feature now.  Certainly the [...]


Related posts:<ol><li><a href='http://remysharp.com/2009/09/16/a-better-twitter-search/' rel='bookmark' title='Permanent Link: A better Twitter search'>A better Twitter search</a></li><li><a href='http://remysharp.com/2009/07/20/twitpic-api-for-getting-pictures-out/' rel='bookmark' title='Permanent Link: Twitpic API for getting pictures out'>Twitpic API for getting pictures out</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Users of Twitter created the idiom "RT @suchnsuch said sumfink", and as with @ replies, RT's have been rolled in to Twitter's architecture.  Now we have, what I think should be called, the native retweet.</p>

<p>It was turned on for early users and more of the "twittersphere" is getting the feature now.  Certainly the first thing I wanted to see was what a native RT of 140 characters would look like. Well...truncated...but not really.</p>

<p><span id="more-497"></span></p>

<p>I <a href="http://twitter.com/rem/status/5841873578">posted this</a> when I noticed native retweets were turned on:</p>

<blockquote>
  <p>I'm wondering: using the new retweet feature, what retweeting messages of 140 characters looks like to users that are not in the beta group.</p>
</blockquote>

<p>So kindly, <a href="http://twitter.com/rellyab">RellyAB</a> (amongst others) retweeted for me.</p>

<p>Here's what it looks like with native retweets enabled:</p>

<p><img src="http://remysharp.com/images/native.png" alt="Native" title="" /></p>

<p>...and here it is with out native retweets enabled:</p>

<p><img src="http://remysharp.com/images/oldschool.png" alt="Old School" title="" /></p>

<p>Notice the ellipsis. No huge surprise there.</p>

<p>What's interesting is that the actual tweet is modified in the Twitter's view of the timeline, i.e. it's mashing together Relly's tweets and her retweets in to one view.</p>

<p>This can be seen in the new API method: <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses-home_timeline">home_timeline</a></p>

<p>Retweeting looks to be pitched as a thumbs up for a tweet, or "like" feature, but I personally agree with <a href="http://twitter.com/cennydd">Cennydd</a> when <a href="http://twitter.com/Cennydd/status/5841743636">he said</a>:</p>

<blockquote>
  <p>There's already a "like": Favourite. I think using that intelligently would have been wiser than the over-engineered RT.</p>
</blockquote>

<p>But the upshot of this architecture change is that potentially the noise goes down.  Since the retweets have their own API, the friends timeline can stay free (for now<sup>&dagger;</sup>) of the extra noise.  For example, in Tweetie, even though Relly had retweeted my experiment, it <em>doesn't</em> appear in her timeline:</p>

<p><img src="http://remysharp.com/images/tweetie.png" alt="Tweetie RT" title="" /></p>

<p>Moreover, this is because the API call to user timeline is free of native retweets - so apps relying on it won't contain the retweet (for better or for worse - you may be using <a href="http://snapbird.org">Snap Bird</a> to find the tweet that was retweeted by Relly and <a href="http://snapbird.org/rellyab/140">fail to find it</a>).  </p>

<p>In fact, <em>all</em> of the native retweet APIs require authentication, so apps that rely on working without auth (such as <a href="http://snapbird.org">Snap Bird</a>) won't contain retweets at all in the future!  </p>

<p>I'm not 100% sure whether this is good or bad, but it certainly mixes things up for the <a href="http://twitter.com/nuxnix/uk-twitterati">developers working with the API</a>.</p>

<p>I think, if anything, it shows that Twitter are treating <a href="http://twitter.com">twitter.com</a> as a client to the API, and (rightly) they're aggressively keeping up to date with API changes, and I think that <a href="http://www.atebits.com/tweetie-mac/">other twitter apps</a> are going to have to do the same.</p>

<h3>Update</h3>

<p>I've also spotted this (obvious now) functionality in Twitter - the ability to ignore retweets from particular users (via the green RT button on the right):</p>

<p><img src="http://remysharp.com/images/aral.png" alt="Aral" title="" /></p>

<p>This is perfect for those people you follow and value their retweets, something you could have missed, and where you can choose to ignore others. Ignoring the developer implications for a moment, the user experience is definitely better, and this will pass down the chain to the third-party apps like Tweetie (once they update).</p>

<p><em>Obviously you'll still be able to bork the retweet feature by just adding it yourself, just like I can break the @mentions feature by adding a character (usually a period) in front of the @!</em></p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2009/09/16/a-better-twitter-search/' rel='bookmark' title='Permanent Link: A better Twitter search'>A better Twitter search</a></li><li><a href='http://remysharp.com/2009/07/20/twitpic-api-for-getting-pictures-out/' rel='bookmark' title='Permanent Link: Twitpic API for getting pictures out'>Twitpic API for getting pictures out</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2009/11/19/native-retweets/feed/</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Going Full Frontal in one week</title>
		<link>http://remysharp.com/2009/11/16/going-full-frontal-in-one-week/</link>
		<comments>http://remysharp.com/2009/11/16/going-full-frontal-in-one-week/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 09:00:32 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Business]]></category>

		<category><![CDATA[conference]]></category>

		<category><![CDATA[fullfrontal]]></category>

		<category><![CDATA[fullfrontal09]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=488</guid>
		<description><![CDATA[Today is Monday. In 4 days time JavaScripters from across the UK and Europe will be coming together for the UK based JavaScript conference: Full Frontal.  After being at JSConf.eu last weekend, I couldn't be more excited about getting a community of front end developers together again.



Full Frontal is really close to selling out, [...]


Related posts:<ol><li><a href='http://remysharp.com/2009/04/20/full-frontal-javascript-conference/' rel='bookmark' title='Permanent Link: Full Frontal JavaScript Conference'>Full Frontal JavaScript Conference</a></li><li><a href='http://remysharp.com/2009/11/26/full-frontal-javascript-2009/' rel='bookmark' title='Permanent Link: Full Frontal JavaScript 2009'>Full Frontal JavaScript 2009</a></li><li><a href='http://remysharp.com/2009/08/19/win-a-ticket-for-the-full-frontal-javascript-conference/' rel='bookmark' title='Permanent Link: Win a ticket for the Full Frontal JavaScript Conference'>Win a ticket for the Full Frontal JavaScript Conference</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Today is Monday. In 4 days time JavaScripters from across the UK and Europe will be coming together for the UK based JavaScript conference: Full Frontal.  After being at <a href="http://jsconf.eu/" title="JSConf.eu - The JavaScript Conference">JSConf.eu</a> last weekend, I couldn't be more excited about getting a community of front end developers together again.</p>

<p><span id="more-488"></span></p>

<p><img src="http://remysharp.com/images/ff-banners.jpg" style="float: right; margin: 0 0 10px 10px;" alt="Full Frontal Banners" />Full Frontal is really close to selling out, and I wanted to make a deal with you: if we sell out, Left Logic (my company, consisting of just me) promises to buy everyone a drink at the after party to kick off a great evening.</p>

<p>So if you're someone who's been thinking about coming along, or you know someone, this is the week to get your ticket.</p>

<p>The lineup consists of great topics by awesome speakers Christian Heilmann, Robert Nyman, PPK, Stuart Langridge, Todd Kloots, Jake Archibald and Simon Willison.  The full schedule and abstracts are available on the web site: <a href="http://2009.full-frontal.org">http://2009.full-frontal.org</a></p>

<p>Like I said, we're <em>really close</em> to selling out, so make your move now to get those last few tickets and the drinks are on me <img src='http://remysharp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2009/04/20/full-frontal-javascript-conference/' rel='bookmark' title='Permanent Link: Full Frontal JavaScript Conference'>Full Frontal JavaScript Conference</a></li><li><a href='http://remysharp.com/2009/11/26/full-frontal-javascript-2009/' rel='bookmark' title='Permanent Link: Full Frontal JavaScript 2009'>Full Frontal JavaScript 2009</a></li><li><a href='http://remysharp.com/2009/08/19/win-a-ticket-for-the-full-frontal-javascript-conference/' rel='bookmark' title='Permanent Link: Win a ticket for the Full Frontal JavaScript Conference'>Win a ticket for the Full Frontal JavaScript Conference</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2009/11/16/going-full-frontal-in-one-week/feed/</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>The Missing Stat: noscript</title>
		<link>http://remysharp.com/2009/10/15/the-missing-stat-noscript/</link>
		<comments>http://remysharp.com/2009/10/15/the-missing-stat-noscript/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 14:41:50 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[plugin]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://remysharp.com/2009/10/15/the-missing-stat-noscript/</guid>
		<description><![CDATA[I use Google Analytics for my web sites, you might use Mint or something else bespoke, but if you're using JavaScript to track those stats (as Google does), you're not capturing how many users you have that don't have JavaScript installed.  

I've written a plugin which I'll share with you and also explain how [...]


Related posts:<ol><li><a href='http://remysharp.com/2008/07/16/download-stats-for-s3/' rel='bookmark' title='Permanent Link: Download stats for S3'>Download stats for S3</a></li><li><a href='http://remysharp.com/2007/07/26/lastfm-recent-album-artwork-plugin/' rel='bookmark' title='Permanent Link: Last.fm Recent Album Artwork Plugin'>Last.fm Recent Album Artwork Plugin</a></li><li><a href='http://remysharp.com/2008/01/12/ajax-validation-pattern/' rel='bookmark' title='Permanent Link: Ajax validation pattern'>Ajax validation pattern</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I use Google Analytics for my web sites, you might use <a href="http://haveamint.com/">Mint</a> or something else bespoke, but if you're using JavaScript to track those stats (as Google does), you're not capturing how many users you have that <em>don't</em> have JavaScript installed.  </p>

<p>I've written a plugin which I'll share with you and also explain how it works (so you can add it to a non-WordPress site).</p>

<p><span id="more-468"></span></p>

<h2>WordPress Plugin</h2>

<p>The WordPress plugin has it's own control panel that you'll need to add your site's analytic's ID, something like <code>UA-12345-6</code>, save settings and you're off.</p>

<p><a href="http://remysharp.com/downloads/noscript.php">Download the noscript wordpress plugin</a></p>

<h2>Reporting</h2>

<p>All the stats on users without JavaScript will be stored under a page /noscript, the page the user was actually on will be the page referring to /noscript.</p>

<p><img src="http://remysharp.com/wp-content/uploads/2009/10/noscript-reporting.jpg" alt="noscript reporting" title="" /></p>

<h2>Doing it manually</h2>

<p>Doing it manually is very simple.  If you want to record where the user is coming from, then you'll want to grab this code, and replace the variables with your own values.  I'd recommend either grabbing the plugin and whipping the code out of there, or copying the code below and making the changes for your own site.</p>

<pre><code>$var_utmac = 'UA-12345-6'; // your identifier
$var_utmhn = 'http://mydomain.com'; //enter your domain
$var_referer = @$_SERVER['HTTP_REFERER']; //referer url

$var_utmp = '/noscript'; //this example adds a fake file request to the (fake) tracker directory

$var_utmn = rand(1000000000,9999999999); //random request number
$var_cookie = rand(10000000,99999999); //random cookie number
$var_random = rand(1000000000,2147483647); //number under 2147483647
$var_today = time(); //today
$var_uservar = '-'; //enter your own user defined variable

$urchinUrl = 'http://www.google-analytics.com/__utm.gif?utmwv=1&#038;utmn='.$var_utmn.'&#038;utmsr=-&#038;utmsc=-&#038;utmul=-&#038;utmje=0&#038;utmfl=-&#038;utmdt=-&#038;utmhn='.$var_utmhn.'&#038;utmr='.$var_referer.'&#038;utmp='.$var_utmp.'&#038;utmac='.$var_utmac.'&#038;utmcc=__utma%3D'.$var_cookie.'.'.$var_random.'.'.$var_today.'.'.$var_today.'.'.$var_today.'.2%3B%2B__utmb%3D'.$var_cookie.'%3B%2B__utmc%3D'.$var_cookie.'%3B%2B__utmz%3D'.$var_cookie.'.'.$var_today.'.2.2.utmccn%3D(direct)%7Cutmcsr%3D(direct)%7Cutmcmd%3D(none)%3B%2B__utmv%3D'.$var_cookie.'.'.$var_uservar.'%3B';

echo '&lt;noscript&gt;&lt;img src="' . $urchinUrl . '" /&gt;&lt;/noscript&gt;';
</code></pre>

<h2>Share</h2>

<p>Then later, let's share the results and see what kind of sites actually have visitors with JavaScript disabled.  That kind of information makes me more comfortable with things like the <a href="http://remysharp.com/2009/01/07/html5-enabling-script/">HTML5 shiv</a>.</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2008/07/16/download-stats-for-s3/' rel='bookmark' title='Permanent Link: Download stats for S3'>Download stats for S3</a></li><li><a href='http://remysharp.com/2007/07/26/lastfm-recent-album-artwork-plugin/' rel='bookmark' title='Permanent Link: Last.fm Recent Album Artwork Plugin'>Last.fm Recent Album Artwork Plugin</a></li><li><a href='http://remysharp.com/2008/01/12/ajax-validation-pattern/' rel='bookmark' title='Permanent Link: Ajax validation pattern'>Ajax validation pattern</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2009/10/15/the-missing-stat-noscript/feed/</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>A better Twitter search</title>
		<link>http://remysharp.com/2009/09/16/a-better-twitter-search/</link>
		<comments>http://remysharp.com/2009/09/16/a-better-twitter-search/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 12:00:27 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Web]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[project]]></category>

		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=438</guid>
		<description><![CDATA[If you've not noticed already the search in Twitter has been downgraded to 7 days history.  In fact, that changed some time ago.  I've had the good fortune to be able to ask Twitter employees directly about the history via attending Devnest and I've been assured the history is being kept.

That doesn't solve [...]


Related posts:<ol><li><a href='http://remysharp.com/2010/06/14/hacking-twitters-reply-system/' rel='bookmark' title='Permanent Link: Hacking Twitter's reply system'>Hacking Twitter's reply system</a></li><li><a href='http://remysharp.com/2007/05/18/add-twitter-to-your-blog-step-by-step/' rel='bookmark' title='Permanent Link: Add Twitter to your blog (step-by-step)'>Add Twitter to your blog (step-by-step)</a></li><li><a href='http://remysharp.com/2008/09/19/twitter-upgrades-via-greasemonkey/' rel='bookmark' title='Permanent Link: Twitter Upgrades via Greasemonkey'>Twitter Upgrades via Greasemonkey</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>If you've not noticed already the search in Twitter has been downgraded to 7 days history.  In fact, that changed some time ago.  I've had the good fortune to be able to ask Twitter employees directly about the history via attending <a href="http://twitterdevelopernest.com/">Devnest</a> and I've been assured the history is being kept.</p>

<p>That doesn't solve the problem of how am I supposed to find that tweet such and such posted a while ago.</p>

<p>So I've written two things: 1) a simple history search for user timelines and 2) a micro library for search filtering.</p>

<p><span id="more-438"></span></p>

<h2>Searching Further Back</h2>

<p>I've written a very simple, purely JavaScript based search limited to an individual's history or their favourites.</p>

<p>Currently you can't search your "friend" timeline, but it's a feature I'd be willing to add if people thought it would add a lot of value.  If I did add it though, it would have to use Twitter's oAuth and I'd host it on a Google App Engine (or similar), firstly because friend timelines require authentication (although historically they didn't...annoyingly) and secondly, because I probably don't need to host another app myself!</p>

<p>There's also limits within the API calls I'm making, in particular:</p>

<ol>
<li>User timeline searches are limited to 200 tweets per hit</li>
<li>Favourite searches are limited to 20 tweets (yeah, only 20!)</li>
</ol>

<p>Check it out, bookmark it, make use of it:</p>

<p><a href="http://snapbird.org/">http://snapbird.org/</a></p>

<h2>Giving Back to Developers: Twitter Search Library</h2>

<p>I figured search filtering is a pretty basic requirement, and it's one that I'd add to a lot of my own apps/hacks and one I'd like to see in apps being built.</p>

<p>I've put the search filter library up on Github for people to pinch, share, upgrade and do as you will.</p>

<p><a href="http://github.com/remy/twitter-search-js">http://github.com/remy/twitter-search-js</a></p>

<p>The library supports the following search commands (from the existing <a href="http://search.twitter.com">Twitter search</a>):</p>

<ul>
<li>All these words. Example: <em>cheese wine</em></li>
<li>This exact phrase. Example: <em>"good weather"</em></li>
<li>Any of these words. Example: <em>cheese OR @brucel</em></li>
<li>None of these words. Example: <em>cheese -wine</em></li>
<li>From this person. Example: <em>from:brucel</em></li>
<li>To this person. Example: <em>to:brucel</em></li>
</ul>

<p>This can be combined as per the current search in to more complicated search strings: <em>font OR cheese -wife</em>.</p>

<h3>Usage</h3>

<p>Include the library and you can pass the raw tweet objects to the filter - that's the <em>raw</em> tweet and not the <em>string</em> (because it needs the tweet to assert the <em>from this person</em>).</p>

<pre><code>if (twitterSearch.filter(tweet, searchString)) {
  // tweet passed search criteria
}</code></pre>

<p>I'd love to see this library plugged in to widgets to allow live search filtering, or HTML based Twitter apps to apply dynamic search filters to any given result of tweets.</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2010/06/14/hacking-twitters-reply-system/' rel='bookmark' title='Permanent Link: Hacking Twitter's reply system'>Hacking Twitter's reply system</a></li><li><a href='http://remysharp.com/2007/05/18/add-twitter-to-your-blog-step-by-step/' rel='bookmark' title='Permanent Link: Add Twitter to your blog (step-by-step)'>Add Twitter to your blog (step-by-step)</a></li><li><a href='http://remysharp.com/2008/09/19/twitter-upgrades-via-greasemonkey/' rel='bookmark' title='Permanent Link: Twitter Upgrades via Greasemonkey'>Twitter Upgrades via Greasemonkey</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2009/09/16/a-better-twitter-search/feed/</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>dConstruct 2009 &amp; Barcamp Brighton 4</title>
		<link>http://remysharp.com/2009/09/07/dconstruct-2009-barcamp-brighton-4/</link>
		<comments>http://remysharp.com/2009/09/07/dconstruct-2009-barcamp-brighton-4/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 14:50:35 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Web]]></category>

		<category><![CDATA[conference]]></category>

		<category><![CDATA[jQuery]]></category>

		<category><![CDATA[talks]]></category>

		<guid isPermaLink="false">http://remysharp.com/2009/09/07/dconstruct-2009-barcamp-brighton-4/</guid>
		<description><![CDATA[This last week has been a huge social/talky/knowledge festival for me. It comprised of dConstruct 2009 and my first attendance at any barcamp: Barcamp Brighton 4.



dConstruct Workshop: jQuery for Designers



I ran the jQuery for Designers workshop at dConstruct this year and I was honoured to be able to contribute to one of the great conference [...]


Related posts:<ol><li><a href='http://remysharp.com/2008/09/08/dconstruct-08/' rel='bookmark' title='Permanent Link: dConstruct 08'>dConstruct 08</a></li><li><a href='http://remysharp.com/2008/07/09/updated-jquery-talk/' rel='bookmark' title='Permanent Link: Updated jQuery Talk'>Updated jQuery Talk</a></li><li><a href='http://remysharp.com/2008/03/13/presenting-jquery-at-qcon/' rel='bookmark' title='Permanent Link: Presenting jQuery at QCon'>Presenting jQuery at QCon</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>This last week has been a huge social/talky/knowledge festival for me. It comprised of <a href="http://2009.dconstruct.org/" title="dConstruct 2009">dConstruct 2009</a> and my first attendance at any barcamp: <a href="http://www.barcampbrighton.org/" title="BarCampBrighton &#8211; 5th &amp; 6th September 2009">Barcamp Brighton 4</a>.</p>

<p><span id="more-433"></span></p>

<h2>dConstruct Workshop: jQuery for Designers</h2>

<p><img src="http://remysharp.com/images/dconstruct09.jpg" alt="Remy's speaker badge" /></p>

<p>I ran the jQuery for Designers workshop at dConstruct this year and I was honoured to be able to contribute to one of the great conference in Brighton (<a href="http://full-frontal.org">of course there's more</a>).</p>

<p>It ran from 10am until 5pm, overrunning by about 30 minutes.  The night before I was worried I had too little content and was trying to work out what I would do if I ran 1-2 hours short.  As it turned out, I had about 2 hours <em>too much</em> content, and 2/3rd of the way through, ditched the slides, the <em>talky</em> content, in favour for the remaining exercises.  That way delegates could get more hands on experience and help directly from me as I'd walk through the solutions with them (either by their side or on the main screen).  </p>

<p>There was lots of really positive feedback, and my <a href="http://www.flickr.com/photos/remysharp/3896735012/">handdrawn</a> <a href="http://www.flickr.com/photos/remysharp/3895957857/">slides</a> seemed to go down quite well.  Although the talk was entitled jQuery for Designers, the vast majority of delegates knew some JavaScript (or jQuery) which meant the workshop was aimed a little higher than pure beginner.  Equally I had a couple of friends who attended the workshop, with no experience tell me they struggled at the <em>codey</em> parts - so future workshops will be split between <em>total</em> beginner and <em>intermediate</em> - total beginner getting things like where to include the jQuery library, etc.</p>

<p>You can download the <a href="http://remysharp.com/downloads/j4d-dconstruct.pdf">PDF slidedeck</a> from the workshop and all the <a href="http://remysharp.com/downloads/j4d-dconstruct.zip">examples and solutions</a>.</p>

<h2>Barcamp Brighton</h2>

<p><img src="http://remysharp.com/images/bcb4.jpg" alt="Gaggle of Geeks" /></p>

<p>This was my first every Barcamp, and I had a really, really good time.  The first day comprised of preparing my talk in the park with friends (because I'd been busy preparing for the jQuery workshop!), and then running to the venue and presenting. </p>

<p>I made the fatal marketing mistake of writing my talk in biro rather than marker pen, and choosing a title that had about 4 lines (only because I didn't know or have time to workout how to get a "great" title).  Something along the lines of: "iPhone Apps, without the store, or Objective-C, using web technology and works offline!"!!!</p>

<p>My talk showed off the <a href="http://icnhz.com/rubiks">Rubik's cube</a> I'd been playing with for the iPhone (and Webkit).  It's not a full working game, but a proof of concept, check out the <a href="http://remysharp.com/downloads/iphone-rubiks-demo.mov">demo video</a> to see what I mean.</p>

<p>The demo includes HTML5 offline applications, CSS 3D transforms (<a href="http://www.fofronline.com/2009-07/animated-css3-cube-interface-using-3d-transforms/">inspired directly by Paul Hayes' demo</a>), iPhone web apps meta tags and a few other bits and bobs.</p>

<p>You can download the <a href="http://remysharp.com/downloads/barcampbrighton4.pdf">PDF slidedeck</a> from the talks and all play with the <a href="http://icnhz.com/rubiks">live demo</a>.</p>

<p>The organisers did an awesome job with the venue, food and drink, and I'm really looking forward to next Barcamp Brighton (I've almost convinced my wife to attend too!).  I'm knackered from the last few days activities, but I've had some of the best laughs in a good while and have had my head stuffed with ideas over an incredibly short amount of time!</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2008/09/08/dconstruct-08/' rel='bookmark' title='Permanent Link: dConstruct 08'>dConstruct 08</a></li><li><a href='http://remysharp.com/2008/07/09/updated-jquery-talk/' rel='bookmark' title='Permanent Link: Updated jQuery Talk'>Updated jQuery Talk</a></li><li><a href='http://remysharp.com/2008/03/13/presenting-jquery-at-qcon/' rel='bookmark' title='Permanent Link: Presenting jQuery at QCon'>Presenting jQuery at QCon</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2009/09/07/dconstruct-2009-barcamp-brighton-4/feed/</wfw:commentRss>
<enclosure url="http://remysharp.com/downloads/iphone-rubiks-demo.mov" length="4374890" type="video/quick" />
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Win a ticket for the Full Frontal JavaScript Conference</title>
		<link>http://remysharp.com/2009/08/19/win-a-ticket-for-the-full-frontal-javascript-conference/</link>
		<comments>http://remysharp.com/2009/08/19/win-a-ticket-for-the-full-frontal-javascript-conference/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 12:10:28 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Business]]></category>

		<category><![CDATA[conference]]></category>

		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://remysharp.com/2009/08/19/win-a-ticket-for-the-full-frontal-javascript-conference/</guid>
		<description><![CDATA[I recently released a way to enter to win a ticket for Full Frontal, but I'm particularly guilty of only sending things through Twitter lately, and I know not everyone uses Twitter (see dull meta), so I need to make sure I'm not ignoring my regular readers: you!



Free ticket or reimbursed ticket

I've never been sure [...]


Related posts:<ol><li><a href='http://remysharp.com/2009/04/20/full-frontal-javascript-conference/' rel='bookmark' title='Permanent Link: Full Frontal JavaScript Conference'>Full Frontal JavaScript Conference</a></li><li><a href='http://remysharp.com/2009/11/26/full-frontal-javascript-2009/' rel='bookmark' title='Permanent Link: Full Frontal JavaScript 2009'>Full Frontal JavaScript 2009</a></li><li><a href='http://remysharp.com/2009/11/16/going-full-frontal-in-one-week/' rel='bookmark' title='Permanent Link: Going Full Frontal in one week'>Going Full Frontal in one week</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I recently released <a href="https://twitter.com/fullfrontalconf/status/3226112563">a way to enter to win a ticket</a> for <a href="http://full-frontal.org">Full Frontal</a>, but I'm particularly guilty of only sending things through <a href="http://twitter.com">Twitter</a> lately, and I know <a href="http://www.brucelawson.co.uk/2009/html-5-doctor-sitepoint-article/">not everyone uses Twitter</a> (see dull meta), so I need to make sure I'm not ignoring my <em>regular</em> readers: you!</p>

<p><span id="more-413"></span></p>

<h2>Free ticket or reimbursed ticket</h2>

<p>I've never been sure whether to enter these competitions when I had already bought a ticket, so I figured I may as well make <em>my</em> competition the kind that I would enter.</p>

<p>If you've already got a ticket, and you win, we'll give you a full reimbursement.  If you don't have a ticket, we'll give you one for free.</p>

<p>So, you can <a href="http://www.stubmatic.com/leftlogic/">get your Full Frontal ticket</a> now, and <em>still</em> enter <img src='http://remysharp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>

<h2>How to win a free ticket</h2>

<p>We're drawing two winners for free tickets on <em>Tuesday 1st September</em> and <em>Monday 2nd November</em>, and announcing the winners via <a href="http://twitter.com/fullfrontalconf">@fullfrontalconf</a>.</p>

<p>Head over to the <a href="http://full-frontal.org">Full Frontal</a> web site, and read the <a href="http://2009.full-frontal.org/ticket-draw">ticket draw</a> details.</p>

<p>Pop the Full Frontal banner on your blog, and that's it.  You can see an example of the banner on my sidebar to the right of my site.</p>

<p>If you have any questions, get in touch, otherwise: Good luck!</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2009/04/20/full-frontal-javascript-conference/' rel='bookmark' title='Permanent Link: Full Frontal JavaScript Conference'>Full Frontal JavaScript Conference</a></li><li><a href='http://remysharp.com/2009/11/26/full-frontal-javascript-2009/' rel='bookmark' title='Permanent Link: Full Frontal JavaScript 2009'>Full Frontal JavaScript 2009</a></li><li><a href='http://remysharp.com/2009/11/16/going-full-frontal-in-one-week/' rel='bookmark' title='Permanent Link: Going Full Frontal in one week'>Going Full Frontal in one week</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2009/08/19/win-a-ticket-for-the-full-frontal-javascript-conference/feed/</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Saving Figure &amp; Detail</title>
		<link>http://remysharp.com/2009/08/12/saving-figure-detail/</link>
		<comments>http://remysharp.com/2009/08/12/saving-figure-detail/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 10:18:35 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Web]]></category>

		<category><![CDATA[html5]]></category>

		<category><![CDATA[legend]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=390</guid>
		<description><![CDATA[In finding that the legend element simply doesn't work inside both details and figure, myself and others been keen to find a solution.



Ian Hickson has said:


  I am leaning towards keeping the language sane (not introducing yet another element that basically means "header" or "important" or "caption"), at the cost of delaying how soon [...]


Related posts:<ol><li><a href='http://remysharp.com/2009/07/31/legend-not-such-a-legend-anymore/' rel='bookmark' title='Permanent Link: Legend not such a legend anymore'>Legend not such a legend anymore</a></li><li><a href='http://remysharp.com/2009/04/14/html5-and-firefox2/' rel='bookmark' title='Permanent Link: html5 and Firefox2'>html5 and Firefox2</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>In finding that the <code>legend</code> element <a href="http://remysharp.com/2009/07/31/legend-not-such-a-legend-anymore/">simply doesn't work</a> inside both <code>details</code> and <code>figure</code>, myself <a href="http://adactio.com">and</a> <a href="http://brucelawson.co.uk">others</a> been keen to find a solution.</p>

<p><span id="more-390"></span></p>

<p>Ian Hickson <a href="http://remysharp.com/2009/07/31/legend-not-such-a-legend-anymore/#comment-166653">has said</a>:</p>

<blockquote>
  <p>I am leaning towards keeping the language sane (not introducing yet another element that basically means "header" or "important" or "caption"), at the cost of delaying how soon we can use the feature.</p>
</blockquote>

<p>The <strong>huge</strong> problem with this is that browsers will <em>not</em> catch up.  IE is the dominant browser, and if IE6 to IE8 don't support the <code>legend</code> element embedded in anything <em>other</em> than <code>fieldset</code> then we, as authors, are going to <strong>have</strong> to find an alternative.  This is where the spec is fiction.</p>

<p>I agree with Hixie that a new element isn't required that means "header" or "caption", but equally I believe we have enough in the spec to label the <code>figure</code> and <code>details</code> elements properly.</p>

<h2>Alternatives</h2>

<p>I've gone through a number of alternatives with <a href="http://adactio.com">Jeremy</a> and <a href="http://brucelawson.co.uk">Bruce</a> and I want to share them with you:</p>

<h3>label</h3>

<p><code>label</code>: This was my initial favourite to work within the new elements, since what we're trying to do is <em>label</em> the figure or details that are tucked away.  </p>

<p>The problem Jeremy raised was that of screenreaders.  Are they going to look or assume there's an associated input element?  </p>

<p>I'm not an expert on screenreaders, so I can't say for sure.  Bruce suggests screenreaders may only look for the input element if the <code>label</code> is within a <code>form</code>.  If this is so, then it's almost a good candidate.</p>

<p>My issue with this, is that it's perfectly reasonable, in my head, to have a <code>figure</code> within a <code>form</code>, which <em>could</em> cause screenreader problems.</p>

<p>Here's a label figure test: <a href="http://jsbin.com/elatu">http://jsbin.com/elatu</a> (<a href="http://jsbin.com/elatu/edit#html">edit</a>)</p>

<p>Here's label in a <code>details</code> element and nested in a form: <a href="http://www.brucelawson.co.uk/tests/html5-details-label.html">http://www.brucelawson.co.uk/tests/html5-details-label.html</a></p>

<div class="update"><p><strong>Update</strong> Bruce's tests so far show that <code>label</code> is <a href="http://twitter.com/brucel/status/3265221421">working fine with screenreaders</a></p></div>

<h3>caption</h3>

<p><code>caption</code> is used to add a caption to tables, which makes it a good candidate for captioning the <code>figure</code> and <code>details</code> elements.  </p>

<p>However, due to a similar bug as the <code>legend</code> issue, if the browser finds the <code>caption</code> element outside a table, it simply strips it from the DOM - which makes this a non-option.</p>

<p>Example of caption being stripped from the DOM: <a href="http://jsbin.com/eloda">http://jsbin.com/eloda</a> (<a href="http://jsbin.com/eloda/edit#html">edit</a>) (view the DOM and you'll see the element has gone)</p>

<h3>Heading</h3>

<p>Could we use an <code>hX</code> tag?  We want to give the <code>figure</code> or <code>details</code> element a heading, so it stands to reason that we could use an <code>h2</code> or <code>h3</code>, etc.</p>

<p>The problem is the <abbr title="table of contents">TOC</abbr> that's created. </p>

<p>I originally thought I could hide this from the TOC by using the <code>hgroup</code>, but this element will grab the first heading and include it in the TOC.  So this isn't a viable solution because I don't believe these should be part of the TOC.</p>

<p>On top of which it seems over the top to include <em>two</em> elements just to solve this issue.  I think the <code>figure</code> and <code>details</code> need a heading, and although using <code>hX</code> elements make sense to me, it feels klunky (for want of a more expressive technical term!).</p>

<h3>Header</h3>

<p><code>header</code>, to me, has a similar semantic meaning as an <code>hX</code> element, and we could reuse this to replace the <code>legend</code> in the <code>figure</code> and <code>details</code> elements.  </p>

<p>It wouldn't become part of the TOC, because you'd need an <code>hX</code> element to create a new item in the TOC.  This also doesn't cause any issues with screenreaders (if in fact <code>label</code> does).</p>

<p>Here's an example of <code>header</code> being used in the wild (for the button example on the right): <a href="http://2009.full-frontal.org/ticket-draw">http://2009.full-frontal.org/ticket-draw</a></p>

<p><a href="http://lachy.id.au/log/">Lachy</a> pointed out on the <a href="irc://irc.freenode.net/whatwg" title="WHATWG IRC">WHATWG IRC</a> channel that in the future User Agents may treat the <code>header</code> element properly and using it for the caption to the <code>figure</code> or <code>details</code> would cause confusion to the browser <small>(citation needed)</small>.</p>

<h3>New Element</h3>

<p>After discussing the issue on the IRC, aside from Hixie suggesting that the <code>figure</code> and <code>details</code> is dropped, one solution is to create a new element.  This works fine in any browser because you're not stepping on an existing element.  For example, using <code>&lt;c&gt;</code> as caption can solve the issue.</p>

<p>I don't mind how it's solved, obviously a <code>c</code> element would be duplicating the <code>caption</code> element, but that's unavoidable.</p>

<h2>Conclusion</h2>

<p>I think we need to discuss and find an alternative to <em>hoping</em> the browsers will fix the <code>legend</code> issue.  <code>figure</code> and <code>details</code> are both useful elements, particularly the former, so I'd rather not see them binned from the spec. If <code>label</code> is viable, I think this is the best fit, otherwise (since <code>header</code> could cause long term issues), a new element can solve this.</p>

<p>HTML 5 <em>paves the cowpaths</em> but the use of <code>legend</code> <strong>isn't</strong> possible, so we <em>must</em> find an alternative if we want to sensibly uses this captioning feature.</p>

<p>I know using the html5.enable feature if Firefox 3.6b, but this still leaves all the other browsers (and Firefox 3.6 isn't even out) - so again, waiting to see what browsers do isn't a solution (nor is serving the page as XML - since IE just chokes).</p>

<p>What do you think? Is there a better alternative? How do screenreaders react to <code>label</code>?</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2009/07/31/legend-not-such-a-legend-anymore/' rel='bookmark' title='Permanent Link: Legend not such a legend anymore'>Legend not such a legend anymore</a></li><li><a href='http://remysharp.com/2009/04/14/html5-and-firefox2/' rel='bookmark' title='Permanent Link: html5 and Firefox2'>html5 and Firefox2</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2009/08/12/saving-figure-detail/feed/</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Defining The Vomit Bug</title>
		<link>http://remysharp.com/2009/08/10/defining-the-vomit-bug/</link>
		<comments>http://remysharp.com/2009/08/10/defining-the-vomit-bug/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 12:00:32 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Web]]></category>

		<category><![CDATA[bug]]></category>

		<category><![CDATA[debug]]></category>

		<category><![CDATA[debugging]]></category>

		<category><![CDATA[dom]]></category>

		<category><![CDATA[html]]></category>

		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=382</guid>
		<description><![CDATA[The more I test HTML 5 and the more I play around in the DOM, the more I find odd situations that will trigger particular bugs.

The one result I'm seeing is what I'm now referring to as a vomit bug. 



Definition


  Vomit bug
  When the browser's parser rearranges the DOM completely differently to [...]


Related posts:<ol><li><a href='http://remysharp.com/2009/04/14/html5-and-firefox2/' rel='bookmark' title='Permanent Link: html5 and Firefox2'>html5 and Firefox2</a></li><li><a href='http://remysharp.com/2009/07/31/legend-not-such-a-legend-anymore/' rel='bookmark' title='Permanent Link: Legend not such a legend anymore'>Legend not such a legend anymore</a></li><li><a href='http://remysharp.com/2009/01/07/html5-enabling-script/' rel='bookmark' title='Permanent Link: HTML5 enabling script'>HTML5 enabling script</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>The more I <a href="http://html5doctor.com">test HTML 5</a> and the more I <a href="http://html5demos.com">play around in the DOM</a>, the more I find odd situations that will trigger particular bugs.</p>

<p>The one result I'm seeing is what I'm now referring to as a <em>vomit</em> bug. </p>

<p><span id="more-382"></span></p>

<h2>Definition</h2>

<dl>
  <dt>Vomit bug</dt>
  <dd>When the browser's parser rearranges the DOM completely differently to the markup, resulting in content being placed <em>outside</em> its original container.</dd>
</dl>

<h2>Examples</h2>

<p>For example, due to a bug in Firefox 3.5.2 (and perhaps before) the following markup is subject to the vomit bug:</p>

<pre><code>&lt;a href=&quot;#&quot;&gt;
  &lt;section&gt;
    &lt;p&gt;p nested in a section wrapped in a link&lt;/p&gt;
  &lt;/section&gt;
&lt;/a&gt;</code></pre>

<p>The resulting DOM is as such:</p>

<pre><code>&lt;a href=&quot;#&quot;&gt;
  &lt;section&gt;&lt;/section&gt;
&lt;/a&gt;
&lt;p&gt;
  &lt;a href=&quot;#&quot;&gt;p nested in a section wrapped in a link&lt;/a&gt;
&lt;/p&gt;
&lt;a href=&quot;#&quot;&gt;&lt;/a&gt;</code></pre>

<p>This is a particular bug in Firefox that triggers when it parses a <code>section</code> element nested inside an <code>a</code> element that causes all currently open element to close, and the contents of the <code>section</code> element has been "corrected" by the browser and the DOM rearranged.  </p>

<p><small>Note that by using the <code><a href="http://ejohn.org/blog/html-5-parsing/">html5.enable</a></code> option in <a href="http://www.mozilla.org/projects/minefield/" title="Minefield Start Page">Minefield</a> renders correctly.</small></p>

<p>You can see a live example here: <a href="http://jsbin.com/upiza">http://jsbin.com/upiza</a></p>

<p>The old Gecko engine (for <a href="http://emberapp.com/remy/images/camino-html5-issue/">Camino</a> and Firefox 2) suffers from the same vomit bug when introducing new (or HTML5) elements (which can be fixed by <a href="http://html5doctor.com/how-to-get-html5-working-in-ie-and-firefox-2/">serving as XHTML</a>).</p>

<p>What other vomit bugs have you found?</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2009/04/14/html5-and-firefox2/' rel='bookmark' title='Permanent Link: html5 and Firefox2'>html5 and Firefox2</a></li><li><a href='http://remysharp.com/2009/07/31/legend-not-such-a-legend-anymore/' rel='bookmark' title='Permanent Link: Legend not such a legend anymore'>Legend not such a legend anymore</a></li><li><a href='http://remysharp.com/2009/01/07/html5-enabling-script/' rel='bookmark' title='Permanent Link: HTML5 enabling script'>HTML5 enabling script</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2009/08/10/defining-the-vomit-bug/feed/</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Legend not such a legend anymore</title>
		<link>http://remysharp.com/2009/07/31/legend-not-such-a-legend-anymore/</link>
		<comments>http://remysharp.com/2009/07/31/legend-not-such-a-legend-anymore/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 12:00:24 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Web]]></category>

		<category><![CDATA[html5]]></category>

		<category><![CDATA[legend]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=365</guid>
		<description><![CDATA[Lately I decided I was going to recreate the interactive features of the details element using JavaScript (apparently the same day as fellow Brightonian Jeremy Keith).

However I ran in to some very serious issues with the tag combined with the legend element, so serious, in it's current state, it's unusable.



This article has been cross posted [...]


Related posts:<ol><li><a href='http://remysharp.com/2009/08/12/saving-figure-detail/' rel='bookmark' title='Permanent Link: Saving Figure &#038; Detail'>Saving Figure &#038; Detail</a></li><li><a href='http://remysharp.com/2009/06/23/safaris-problem-with-font-face/' rel='bookmark' title='Permanent Link: Safari's problem with @font-face'>Safari's problem with @font-face</a></li><li><a href='http://remysharp.com/2006/12/30/firebug-10-beta/' rel='bookmark' title='Permanent Link: Firebug 1.0 beta'>Firebug 1.0 beta</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Lately I decided I was going to recreate the interactive features of the <code>details</code> element using JavaScript (apparently <a href="http://twitter.com/adactio/status/2869549874">the same day</a> as fellow Brightonian <a href="http://adactio.com/" title="Adactio: Jeremy Keith">Jeremy Keith</a>).</p>

<p>However I ran in to some very serious issues with the tag combined with the <code>legend</code> element, so serious, in it's current state, it's unusable.</p>

<p><span id="more-365"></span></p>

<p><small>This article has been cross posted from <a href="http://html5doctor.com">HTML 5 Doctor</a>.</small></p>

<h2>Overview of the details element</h2>

<p>The <code>details</code> element, by default, is a collapsed element whose summary, or label, is the first child <code>legend</code> (if no <code>legend</code> is used, the UA provides a default, such as "Details"), with a triangular button to indicate it's current open state.</p>

<p>If you include the <code>open</code> attribute, then the element is open by default.  In theory, you could attach a click event to the legend, and switch the <code>open</code> attribute.</p>

<p>The markup would roughly be this:</p>

<pre><code>&lt;details open=&quot;open&quot;&gt;
  &lt;legend&gt;Terms &amp; Conditions&lt;/legend&gt;
  &lt;p&gt;You agree to xyz, etc.&lt;/p&gt;
&lt;/details&gt;</code></pre>

<p>Here's the details test page I was working from: <a href="http://remysharp.com/demo/details.html">HTML 5 details test</a></p>

<h2>The issues</h2>

<p>The biggest problem, and the show stopper for me, is that the browser's treatment of the <code>legend</code> element completely breaks this markup pattern - this is true for <strong>all</strong> the major browsers: Opera, Safari, Firefox and IE (tested in all the latest and some older browsers).  I'll go in these issues in detail in a moment.</p>

<p>Other problems include:</p>

<ul>
<li>Styling the legend element is exceptionally difficult, particularly positioning</li>
<li>Using the <a href="http://www.whatwg.org/" title="Web Hypertext Application Technology Working Group">WHATWG</a> <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-xhtml-syntax.html#the-details-element-0">guidelines to styling</a> the <code>details</code> element prove both difficult to interpret and difficult to implement.</li>
<li>When using CSS to style the open state of the <code>details</code> element using: <code>details[open] { height: auto; }</code>, meant that once I changed the open state using JavaScript, it wouldn't trigger the browser to redraw (as it would if I had added a class). I've <a href="http://twitter.com/rem/status/2178972149">run in to this before</a>, CSS 2.1 is styling source, not the DOM.</li>
</ul>

<h2>Legend treatment</h2>

<p>Surprisingly Firefox is the worst one out in these issues, the rest of the browsers have fairly same treatment of the issue.  In the screenshots, I've included a <code>fieldset</code> and nested <code>legend</code> for reference.</p>

<h3>Internet Explorer</h3>

<p>Both IE7 &amp; IE8 closes the <code>legend</code> element it encounters when it's not inside a <code>fieldset</code> element and move it's contents out to an adjacent text node.</p>

<p>What's also strange, is that looking at the DOM it also creates another empty(?) closed <code>legend</code> element after that text node.  It doesn't have any effect, but just looked odd:</p>

<p><img src="http://remysharp.com/wp-content/uploads/2009/07/ies-details-element-treatment.jpg" alt="IE's details element treatment" title="" /></p>

<h3>Opera</h3>

<p>Opera (9 &amp; 10b) is very similar to IE in it's treatment of the <code>legend</code> in the details element, except it doesn't create the second closing <code>legend</code> node.  It just closes the <code>legend</code>, and creates the adjacent text node.</p>

<h3>Safari</h3>

<p>Safari simply strips the <code>legend</code> all together out of the DOM.  So much so, that if you open the web inspector, then the error console, you'll see it warning out that it's encountered an illegal element, ignoring it, then encountering the closing tag, so it ignores that too.  You're left with just the text node.</p>

<h3>Firefox</h3>

<p>The best for last.  Firefox goes one step beyond the other browsers.  It assumes you've forgotten to include the <code>fieldset</code> element.  So when it hits the <code>legend</code> element, Firefox inserts an opening <code>fieldset</code> up until it finds (I believe) the closing <code>fieldset</code> element, which obviously it <em>doesn't</em> so the result is the rest of the DOM, after the first illegally placed <code>legend</code> ends up eaten by <code>fieldset</code> element, which leaves my DOM in a mess:</p>

<p><img src="http://remysharp.com/wp-content/uploads/2009/07/firefox-details-treatment.jpg" alt="Firefox details treatment" title="" /></p>

<h2>Impact on other elements</h2>

<p><code>details</code> isn't the only element that reuses the <code>legend</code> element for labelling, the <code>figure</code> element also is <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-content-0.html#the-figure-element">supposed to support</a> the <code>legend</code> element.  The result is obviously going to be the same.</p>

<h2>Conclusion</h2>

<p>We can't style the legend element when the text is being thrown out by all the browsers, and Firefox's DOM mangling is just too painful to look at.</p>

<p>This basically means that we can't, in any reasonable amount of time, use the <code>legend</code> element inside both the <code>details</code> and <code>figure</code> element in the spec's current state.</p>

<p>For me, I'll be using an alternative element, probably just a <code>p</code> element styled to look like a <code>legend</code>, but that's really not the point.  Ideas anyone?</p>

<p>It turns out we weren't the only ones looking at this and <a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-July/021494.html">Ian Hickson</a> has responded on the issue:</p>

<blockquote>My plan here is to continue to wait for a while longer to see if the parsing issues can get ironed out (the HTML5 parser in Gecko for instance solves this problem for Firefox). If we really can't get past this, we'll have to introduce a new element, but I'm trying to avoid going there.</blockquote>

<p>It's fine to think that Gecko will update, but it's IE that I'm worried about, they <em>won't</em> turn out their render engine, and the result is we'll <em>have</em> to avoid using the <code>legend</code> in any element other than <code>fieldset</code>.</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2009/08/12/saving-figure-detail/' rel='bookmark' title='Permanent Link: Saving Figure &#038; Detail'>Saving Figure &#038; Detail</a></li><li><a href='http://remysharp.com/2009/06/23/safaris-problem-with-font-face/' rel='bookmark' title='Permanent Link: Safari's problem with @font-face'>Safari's problem with @font-face</a></li><li><a href='http://remysharp.com/2006/12/30/firebug-10-beta/' rel='bookmark' title='Permanent Link: Firebug 1.0 beta'>Firebug 1.0 beta</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2009/07/31/legend-not-such-a-legend-anymore/feed/</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	</item>
	</channel>
</rss>
