<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>If I knew what I was doing, I&#039;d be dangerous</title>
	<atom:link href="http://lbarclay.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://lbarclay.wordpress.com</link>
	<description></description>
	<lastBuildDate>Sat, 28 Jan 2012 00:01:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='lbarclay.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>If I knew what I was doing, I&#039;d be dangerous</title>
		<link>http://lbarclay.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://lbarclay.wordpress.com/osd.xml" title="If I knew what I was doing, I&#039;d be dangerous" />
	<atom:link rel='hub' href='http://lbarclay.wordpress.com/?pushpress=hub'/>
		<item>
		<title>iTunes 5103 ? delete your SC Info folder</title>
		<link>http://lbarclay.wordpress.com/2012/01/28/itunes-5103-delete-your-sc-info-folder/</link>
		<comments>http://lbarclay.wordpress.com/2012/01/28/itunes-5103-delete-your-sc-info-folder/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 00:01:24 +0000</pubDate>
		<dc:creator>lbarclay</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[MacBook]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[support]]></category>

		<guid isPermaLink="false">http://lbarclay.wordpress.com/?p=436</guid>
		<description><![CDATA[Just got this whilst trying to play an iTunes rental &#8211; 5103: This was the solution: http://support.apple.com/kb/TS1389 &#160; Filed under: Apple, iphone, iTunes, MacBook Tagged: Apple, itunes, solution, support<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lbarclay.wordpress.com&amp;blog=4831721&amp;post=436&amp;subd=lbarclay&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;">Just got this whilst trying to play an iTunes rental &#8211; 5103:<a href="http://lbarclay.files.wordpress.com/2012/01/screen-shot-2012-01-27-at-23-30-49.png"><img class="aligncenter size-full wp-image-437" title="Screen Shot 2012-01-27 at 23.30.49" src="http://lbarclay.files.wordpress.com/2012/01/screen-shot-2012-01-27-at-23-30-49.png?w=600" alt="iTunes 5103 cant play rental"   /></a></p>
<p style="text-align:center;">This was the solution:<br />
<a title="Fix a 5103 iTunes error" href="http://support.apple.com/kb/TS1389" target="_blank">http://support.apple.com/kb/TS1389</a></p>
<p>&nbsp;</p>
<br />Filed under: <a href='http://lbarclay.wordpress.com/category/apple/'>Apple</a>, <a href='http://lbarclay.wordpress.com/category/apple/iphone/'>iphone</a>, <a href='http://lbarclay.wordpress.com/category/apple/itunes/'>iTunes</a>, <a href='http://lbarclay.wordpress.com/category/apple/macbook/'>MacBook</a> Tagged: <a href='http://lbarclay.wordpress.com/tag/apple/'>Apple</a>, <a href='http://lbarclay.wordpress.com/tag/itunes-2/'>itunes</a>, <a href='http://lbarclay.wordpress.com/tag/solution/'>solution</a>, <a href='http://lbarclay.wordpress.com/tag/support/'>support</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lbarclay.wordpress.com/436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lbarclay.wordpress.com/436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lbarclay.wordpress.com/436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lbarclay.wordpress.com/436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lbarclay.wordpress.com/436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lbarclay.wordpress.com/436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lbarclay.wordpress.com/436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lbarclay.wordpress.com/436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lbarclay.wordpress.com/436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lbarclay.wordpress.com/436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lbarclay.wordpress.com/436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lbarclay.wordpress.com/436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lbarclay.wordpress.com/436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lbarclay.wordpress.com/436/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lbarclay.wordpress.com&amp;blog=4831721&amp;post=436&amp;subd=lbarclay&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lbarclay.wordpress.com/2012/01/28/itunes-5103-delete-your-sc-info-folder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6dd2273c60019dd55fa225ca69367ed?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lbarclay</media:title>
		</media:content>

		<media:content url="http://lbarclay.files.wordpress.com/2012/01/screen-shot-2012-01-27-at-23-30-49.png" medium="image">
			<media:title type="html">Screen Shot 2012-01-27 at 23.30.49</media:title>
		</media:content>
	</item>
		<item>
		<title>Class and Object definitions in JavaScript</title>
		<link>http://lbarclay.wordpress.com/2012/01/26/class-and-object-definitions-in-javascript/</link>
		<comments>http://lbarclay.wordpress.com/2012/01/26/class-and-object-definitions-in-javascript/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 14:05:04 +0000</pubDate>
		<dc:creator>lbarclay</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[The web]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[objects]]></category>

		<guid isPermaLink="false">http://lbarclay.wordpress.com/?p=429</guid>
		<description><![CDATA[A developer friend of mine emailed me with a question about Classes in Javascript: Don&#8217;t suppose you have any literature or anything I can look at in regards to the correct structure for a javascript class (in node.js)? I have looked all over the shop and found various different ways of doing it but am having [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lbarclay.wordpress.com&amp;blog=4831721&amp;post=429&amp;subd=lbarclay&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A developer friend of mine emailed me with a question about Classes in Javascript:</p>
<blockquote><p><strong>Don&#8217;t suppose you have any literature or anything I can look at in regards to the correct structure for a javascript class (in node.js)?</strong><br />
<strong>I have looked all over the shop and found various different ways of doing it but am having problems.</strong></p></blockquote>
<h2>My emailed response</h2>
<p>Classes don&#8217;t exist in Javascript (yet), at least not natively. There is some work on EcmaScript / JavaScript.next that suggests they might but, in short:</p>
<p>Javascript is <a title="Lexically scoped" href="http://en.wikipedia.org/wiki/Scope_(computer_science)" target="_blank">lexically scoped</a> and <a title="Javascript : first class objects" href="http://en.wikipedia.org/wiki/First-class_object" target="_blank">functions are &#8217;1st class objects&#8217;</a>.</p>
<p>You can declare and instantiate objects in many ways but the most familiar might be  like this:</p>
<pre>function foo(bar){
    this.bar = bar;
}

var myFoo = new foo('oh hi there');
alert(myFoo.bar);</pre>
<p>Where you&#8217;d normally use the term &#8216;class&#8217;, it&#8217;s implied in Javascript, as above for example,  but not explicit. There are also many different ways to approach this. Javascript does not support access levels (private, public, protected etc) natively, so you have to follow a coding style that will have the same effect.</p>
<p>There  many different patterns you can use, but different patterns work well for different problems and you don&#8217;t always want to use the classical (class based) style, you can do things differently in Javascript and utilise the flexibility of the language to your advantage.</p>
<h2>Some things worth reading about:</h2>
<p>Read mostly everything Douglas Crockford writes: (and get his book on <a title="'Javascript the good parts' book" href="http://www.amazon.co.uk/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742" target="_blank">Javascript &#8211; The good parts</a>). Although I disagree with some things he says about coding style, it&#8217;s all relevant even though it was written a while ago.</p>
<p><a href="http://www.crockford.com/">http://www.crockford.com/</a></p>
<h3>Learn these</h3>
<h4>Prototypal Inheritance</h4>
<p><a title="Prototypal Inheritance" href="http://javascript.crockford.com/prototypal.html" target="_blank">http://javascript.crockford.com/prototypal.html</a></p>
<h4> Javascript scope</h4>
<p><a title="Javascript scope" href="http://coding.smashingmagazine.com/2009/08/01/what-you-need-to-know-about-javascript-scope/" target="_blank">http://coding.smashingmagazine.com/2009/08/01/what-you-need-to-know-about-javascript-scope/</a></p>
<h4>Javascript closures</h4>
<p><a title="Javascript closures" href="http://blog.morrisjohns.com/javascript_closures_for_dummies" target="_blank">http://blog.morrisjohns.com/javascript_closures_for_dummies</a></p>
<h4>Object Literals</h4>
<p><a title="Object Literals" href="http://www.dyn-web.com/tutorials/obj_lit.php" target="_blank">http://www.dyn-web.com/tutorials/obj_lit.php</a></p>
<h4>Currying</h4>
<p><a title="Javascript currying" href="http://www.dustindiaz.com/javascript-curry/" target="_blank">http://www.dustindiaz.com/javascript-curry/</a></p>
<h4>Module pattern</h4>
<p><a title="Javascript Module Patterns" href="http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth" target="_blank">http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth</a></p>
<p>That should be enough to get you started!</p>
<br />Filed under: <a href='http://lbarclay.wordpress.com/category/development/'>development</a>, <a href='http://lbarclay.wordpress.com/category/development/javascript/'>javascript</a>, <a href='http://lbarclay.wordpress.com/category/the-web/'>The web</a> Tagged: <a href='http://lbarclay.wordpress.com/tag/classes/'>classes</a>, <a href='http://lbarclay.wordpress.com/tag/development/'>development</a>, <a href='http://lbarclay.wordpress.com/tag/javascript/'>javascript</a>, <a href='http://lbarclay.wordpress.com/tag/objects/'>objects</a>, <a href='http://lbarclay.wordpress.com/tag/web-development/'>web development</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lbarclay.wordpress.com/429/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lbarclay.wordpress.com/429/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lbarclay.wordpress.com/429/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lbarclay.wordpress.com/429/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lbarclay.wordpress.com/429/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lbarclay.wordpress.com/429/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lbarclay.wordpress.com/429/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lbarclay.wordpress.com/429/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lbarclay.wordpress.com/429/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lbarclay.wordpress.com/429/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lbarclay.wordpress.com/429/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lbarclay.wordpress.com/429/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lbarclay.wordpress.com/429/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lbarclay.wordpress.com/429/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lbarclay.wordpress.com&amp;blog=4831721&amp;post=429&amp;subd=lbarclay&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lbarclay.wordpress.com/2012/01/26/class-and-object-definitions-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6dd2273c60019dd55fa225ca69367ed?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lbarclay</media:title>
		</media:content>
	</item>
		<item>
		<title>A simple jQuery Plugin to automagically create anchors from recognised HTTP links and convert hash tags into links on Twitter</title>
		<link>http://lbarclay.wordpress.com/2012/01/21/a-simple-jquery-plugin-to-automagically-create-anchors-from-recognised-http-links-and-convert-hash-tags-into-links-on-twitter/</link>
		<comments>http://lbarclay.wordpress.com/2012/01/21/a-simple-jquery-plugin-to-automagically-create-anchors-from-recognised-http-links-and-convert-hash-tags-into-links-on-twitter/#comments</comments>
		<pubDate>Sat, 21 Jan 2012 20:49:31 +0000</pubDate>
		<dc:creator>lbarclay</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://lbarclay.wordpress.com/?p=426</guid>
		<description><![CDATA[Linkify (and Hashify) A simple jQuery Plugin to automagically create anchors from recognised HTTP links and convert hash tags into links to Twitter. Get the code on github. I created linkify after using the @anywhere Twitter library and found that it didn&#8217;t automatically link urls in tweets or hash tags. Usage $([selector]).linkify();  / $([selector]).hashify(); Examples [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lbarclay.wordpress.com&amp;blog=4831721&amp;post=426&amp;subd=lbarclay&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>Linkify (and Hashify)</h1>
<h2>A simple jQuery Plugin to automagically create anchors from recognised HTTP links and convert hash tags into links to Twitter.</h2>
<p><a title="A simple jQuery Plugin to automagically create anchors from recognised HTTP links and convert hash tags into links to Twitter." href="https://github.com/errumm/Linkify">Get the code on github</a>.</p>
<p>I created linkify after using the @anywhere Twitter library and found that it didn&#8217;t automatically link urls in tweets or hash tags.</p>
<h2>Usage</h2>
<p>$([selector]).linkify();  / $([selector]).hashify();</p>
<h2>Examples</h2>
<p>$(&#8216;p&#8217;).linkify(); &#8211; convert all recognised urls in all matched paragraph elements to hyperlinks.</p>
<p>$(&#8216;p&#8217;).hashify(); &#8211; convert all recognised hashtags in all matched paragraph elements to links to hash tags on Twitter.</p>
<p>$(&#8216;.toLink&#8217;).linkify(); convert all recognised urls in all matched elements with the class .toLink to hyperlinks.</p>
<p>$(&#8216;.toLink&#8217;).hashify(); convert all recognised hashtags in all matched all matched elements with the class .toLink tags to links to hash tags on Twitter.</p>
<p>Simple not much to it.</p>
<br />Filed under: <a href='http://lbarclay.wordpress.com/category/development/'>development</a>, <a href='http://lbarclay.wordpress.com/category/development/javascript/'>javascript</a>, <a href='http://lbarclay.wordpress.com/category/development/javascript/jquery-javascript-development/'>jquery</a> Tagged: <a href='http://lbarclay.wordpress.com/tag/development/'>development</a>, <a href='http://lbarclay.wordpress.com/tag/javascript/'>javascript</a>, <a href='http://lbarclay.wordpress.com/tag/jquery/'>jquery</a>, <a href='http://lbarclay.wordpress.com/tag/programming/'>programming</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lbarclay.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lbarclay.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lbarclay.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lbarclay.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lbarclay.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lbarclay.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lbarclay.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lbarclay.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lbarclay.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lbarclay.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lbarclay.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lbarclay.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lbarclay.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lbarclay.wordpress.com/426/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lbarclay.wordpress.com&amp;blog=4831721&amp;post=426&amp;subd=lbarclay&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lbarclay.wordpress.com/2012/01/21/a-simple-jquery-plugin-to-automagically-create-anchors-from-recognised-http-links-and-convert-hash-tags-into-links-on-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6dd2273c60019dd55fa225ca69367ed?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lbarclay</media:title>
		</media:content>
	</item>
		<item>
		<title>Interesting content, it makes work less &#8216;work like&#8217;!</title>
		<link>http://lbarclay.wordpress.com/2012/01/21/interesting-content-it-makes-work-less-work-like/</link>
		<comments>http://lbarclay.wordpress.com/2012/01/21/interesting-content-it-makes-work-less-work-like/#comments</comments>
		<pubDate>Sat, 21 Jan 2012 13:24:38 +0000</pubDate>
		<dc:creator>lbarclay</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[inspiration]]></category>
		<category><![CDATA[The web]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[illustration]]></category>
		<category><![CDATA[infographics]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[latest work]]></category>

		<guid isPermaLink="false">http://lbarclay.wordpress.com/?p=419</guid>
		<description><![CDATA[www.grundini.com I just finished working on the first release of this website (above) for Peter Grundy, with Further Creative http://www.furthercreative.co.uk. After discussing with the user experience expert and designer, I  faced the usual development decisions. I chose some solutions which use technology that I&#8217;d not employed in anger on many projects before. With Peter&#8217;s content [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lbarclay.wordpress.com&amp;blog=4831721&amp;post=419&amp;subd=lbarclay&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a title="Peter Grundy, Illustrator, Infographics designer" href="http://www.grundini.com" target="_blank"><img class="size-medium wp-image-420 alignnone" title="Screen Shot 2012-01-21 at 10.16.43" src="http://lbarclay.files.wordpress.com/2012/01/screen-shot-2012-01-21-at-10-16-43.png?w=300&#038;h=243" alt="" width="300" height="243" /></a></p>
<p><a title="Peter Grundy, Illustrator, infographics designer." href="http://www.grundini.com" target="_blank">www.grundini.com</a></p>
<p>I just finished working on the first release of this website (above) for Peter Grundy, with Further Creative <a title="A design agency that helps clients go further by communicating better" href="http://www.furthercreative.co.uk" target="_blank">http://www.furthercreative.co.uk</a>.</p>
<p>After discussing with the user experience expert and designer, I  faced the usual development decisions. I chose some solutions which use technology that I&#8217;d not employed in anger on many projects before. With Peter&#8217;s content being heavy on the visual side, delivered via Flickr, my decisions were largely driven by how well we could present his work,  over any potential SEO ranking.</p>
<p>I don&#8217;t remember enjoying working on content that was as stimulating and interesting as the work that Peter creates. Luckily Further allowed the user experience expert, designer and myself enough time to try and achieve what we set out to do and I think this first release is very close to getting there.</p>
<p>Working in a good team always makes work more enjoyable, and the client is always part of a wider development team. In this case the team was great and the content we were working on was inspiring.</p>
<p>I hope it&#8217;s not too long before I get to work on the same kind of project again!</p>
<br />Filed under: <a href='http://lbarclay.wordpress.com/category/development/'>development</a>, <a href='http://lbarclay.wordpress.com/category/inspiration/'>inspiration</a>, <a href='http://lbarclay.wordpress.com/category/development/javascript/'>javascript</a>, <a href='http://lbarclay.wordpress.com/category/the-web/'>The web</a> Tagged: <a href='http://lbarclay.wordpress.com/tag/design/'>design</a>, <a href='http://lbarclay.wordpress.com/tag/development/'>development</a>, <a href='http://lbarclay.wordpress.com/tag/illustration/'>illustration</a>, <a href='http://lbarclay.wordpress.com/tag/infographics/'>infographics</a>, <a href='http://lbarclay.wordpress.com/tag/latest-work/'>latest work</a>, <a href='http://lbarclay.wordpress.com/tag/web-development/'>web development</a>, <a href='http://lbarclay.wordpress.com/tag/work/'>work</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lbarclay.wordpress.com/419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lbarclay.wordpress.com/419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lbarclay.wordpress.com/419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lbarclay.wordpress.com/419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lbarclay.wordpress.com/419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lbarclay.wordpress.com/419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lbarclay.wordpress.com/419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lbarclay.wordpress.com/419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lbarclay.wordpress.com/419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lbarclay.wordpress.com/419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lbarclay.wordpress.com/419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lbarclay.wordpress.com/419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lbarclay.wordpress.com/419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lbarclay.wordpress.com/419/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lbarclay.wordpress.com&amp;blog=4831721&amp;post=419&amp;subd=lbarclay&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lbarclay.wordpress.com/2012/01/21/interesting-content-it-makes-work-less-work-like/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6dd2273c60019dd55fa225ca69367ed?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lbarclay</media:title>
		</media:content>

		<media:content url="http://lbarclay.files.wordpress.com/2012/01/screen-shot-2012-01-21-at-10-16-43.png?w=300" medium="image">
			<media:title type="html">Screen Shot 2012-01-21 at 10.16.43</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating ShareThis buttons with custom images in Javascript</title>
		<link>http://lbarclay.wordpress.com/2011/12/05/creating-sharethis-buttons-with-custom-images-in-javascript/</link>
		<comments>http://lbarclay.wordpress.com/2011/12/05/creating-sharethis-buttons-with-custom-images-in-javascript/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 15:05:48 +0000</pubDate>
		<dc:creator>lbarclay</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[free code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[useful tools]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[ShareThis]]></category>

		<guid isPermaLink="false">http://lbarclay.wordpress.com/?p=393</guid>
		<description><![CDATA[This should have been easy! I wanted to add some ShareThis buttons on a page in an single page web application and update the link to be shared every time the hash was changed. The shareThis functionality didn&#8217;t really allow this &#8216;out of the box&#8217; and it took me a while to work out the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lbarclay.wordpress.com&amp;blog=4831721&amp;post=393&amp;subd=lbarclay&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>This should have been easy!</h2>
<p>I wanted to add some ShareThis buttons on a page in an single page web application and update the link to be shared every time the hash was changed.</p>
<p>The shareThis functionality didn&#8217;t really allow this &#8216;out of the box&#8217; and it took me a while to work out the best way to do it using Google and their API documentation.</p>
<h3>What I wanted to do</h3>
<p>Share an AJAX friendly / hashed url  that updates along with the hash, using ShareThis and some custom button images</p>
<h3>How I did it</h3>
<p>I wrote a small Javascript function to do it (it&#8217;s not pure JS as I was using jQuery anyway.</p>
<p>IMHO the solution isn&#8217;t ideal as I don&#8217;t really like having to recreate te buttons every time, but it seems like the only way to make it work.</p>
<p>You can find <a title="code to add custom share this buttons in an AJAX app" href="https://gist.github.com/1433849" target="_blank">the code on github here</a>.</p>
<div class="highlight">
<pre class="line">//----&gt;BEGIN
  function updateShareButtons(location, title, imgsrc) {
    $('.share').hide();
    $('.sharethis').html('');

    var services = [
      {type : 'facebook',
        image : './css/img/social-facebook.png'},
      {type : 'twitter',
        image : './css/img/social-twitter.png'},
      {type : 'email',
        image : './css/img/social-email.png'},
      {type : 'sharethis',
        image : './css/img/social-more.png'}
    ];

    var svc, elm;

    for (var i = 0; i &lt; services.length; i++) {
      svc = services[i];
      elm = $([&#039;<span><img src="',svc.image,'" /></span>'].join(''));

      $('.sharethis').append(elm);
    }

    stButtons.locateElements();

    $('.share').show();
  }</pre>
<pre class="line">//----&lt;END</pre>
</div>
<br />Filed under: <a href='http://lbarclay.wordpress.com/category/development/'>development</a>, <a href='http://lbarclay.wordpress.com/category/free-code/'>free code</a>, <a href='http://lbarclay.wordpress.com/category/development/javascript/'>javascript</a>, <a href='http://lbarclay.wordpress.com/category/development/javascript/jquery-javascript-development/'>jquery</a>, <a href='http://lbarclay.wordpress.com/category/open-source/'>open source</a>, <a href='http://lbarclay.wordpress.com/category/uncategorized/'>Uncategorized</a>, <a href='http://lbarclay.wordpress.com/category/development/useful-tools/'>useful tools</a> Tagged: <a href='http://lbarclay.wordpress.com/tag/ajax/'>AJAX</a>, <a href='http://lbarclay.wordpress.com/tag/development/'>development</a>, <a href='http://lbarclay.wordpress.com/tag/javascript/'>javascript</a>, <a href='http://lbarclay.wordpress.com/tag/jquery/'>jquery</a>, <a href='http://lbarclay.wordpress.com/tag/sharethis/'>ShareThis</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lbarclay.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lbarclay.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lbarclay.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lbarclay.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lbarclay.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lbarclay.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lbarclay.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lbarclay.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lbarclay.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lbarclay.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lbarclay.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lbarclay.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lbarclay.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lbarclay.wordpress.com/393/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lbarclay.wordpress.com&amp;blog=4831721&amp;post=393&amp;subd=lbarclay&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lbarclay.wordpress.com/2011/12/05/creating-sharethis-buttons-with-custom-images-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6dd2273c60019dd55fa225ca69367ed?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lbarclay</media:title>
		</media:content>
	</item>
		<item>
		<title>My Twitter Flickr Mashup</title>
		<link>http://lbarclay.wordpress.com/2009/11/26/my-twitter-flickr-mashup/</link>
		<comments>http://lbarclay.wordpress.com/2009/11/26/my-twitter-flickr-mashup/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 23:20:02 +0000</pubDate>
		<dc:creator>lbarclay</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[inspiration]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[free javascript code]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Mike]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[WS]]></category>

		<guid isPermaLink="false">http://lbarclay.wordpress.com/?p=218</guid>
		<description><![CDATA[I attended full frontal last week, which was excellent. It gave me inspiration to experiment a bit with some Javascript.

I went about setting myself a very loose brief; I wanted to do something quick, in no more than seven hours, I didn't want to have to write any server side code and wanted the code to reside on a single page.

I went about looking into the Twitter and Flickr APIs and decided to combine them by doing a photo search on flickr using tweets from the Twitter public timeline every 60 seconds.

What I came up with ended up as a kind of visual social commentary using Twitter and flickr.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lbarclay.wordpress.com&amp;blog=4831721&amp;post=218&amp;subd=lbarclay&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I attended <a title="Full frontal 09 - Javascript conference" href="http://2009.full-frontal.org/" target="_blank">full frontal</a> last week, which was excellent. It gave me inspiration to experiment a bit with some JavaScript.</p>
<p>I went about setting myself a very loose brief; Completely written in JS, I wanted to do something quick, in no more than seven hours, I didn&#8217;t want to have to write any server-side code and wanted the code to reside on a single page.</p>
<p>I went about looking into the <a title="twitter api" href="http://apiwiki.twitter.com/" target="_blank">Twitter</a> and <a title="flickr API" href="http://www.flickr.com/services/api/" target="_blank">Flickr API</a>s and decided to combine them by doing a photo search on Flickr using tweets from the <a title="Twitter" href="http://www.twitter.com" target="_blank">Twitter</a> public timeline every 60 seconds.</p>
<p>What I came up with ended up as a kind of <a title="Visual social commentary using flickr and twitter" href="http://flittr.lewisbarclay.com" target="_blank">visual social commentary using Twitter and Flickr</a>.</p>
<div id="attachment_219" class="wp-caption aligncenter" style="width: 310px"><a title="Visual social commentary using flickr and twitter" href="http://flittr.lewisbarclay.com" target="_blank"><img class="size-medium wp-image-219" title="flittr" src="http://lbarclay.files.wordpress.com/2009/11/flittr.jpg?w=300&#038;h=224" alt="flittr" width="300" height="224" /></a><p class="wp-caption-text">visual social commentary</p></div>
<p style="text-align:left;">I can&#8217;t claim any credit for any of the content and I doubt that the idea is unique or original but  I did set out some rules for getting the content : search terms had to exceed two words and I attempted to recognise proper nouns and only use them. The content updated every minute. The tweets must not be recognised replies.</p>
<p style="text-align:left;">The result gave some interesting effects on me as a viewer. The search result images weren&#8217;t always obvious results from the tweets, hey &#8211; people tag their photos with strange tags. So knowing that I only had 60 seconds to look through the tweets (not always in English) it made trying to figure out the relationship of the narrative with the  corresponding photos more important, somehow and it became more important to look at the photos and see where the connections came from when I got frustrated.</p>
<p style="text-align:left;">I also liked the fact that very few users would see the same page with the same tweets and images. This makes me want to expand on the idea and add the option to &#8216;save your favourite fleet&#8217; (a fleet is what I called the combination of tweet a Flickr images, brilliant hey!)<br />
I thought about adding the option to enter a twitter screen name and allow that to work in the same way on a specific timeline.</p>
<br />Posted in development, inspiration, javascript, jquery, open source Tagged: development, flickr, free javascript code, inspiration, jquery, JSON, Mike, photos, twitter, WS <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lbarclay.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lbarclay.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lbarclay.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lbarclay.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lbarclay.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lbarclay.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lbarclay.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lbarclay.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lbarclay.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lbarclay.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lbarclay.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lbarclay.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lbarclay.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lbarclay.wordpress.com/218/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lbarclay.wordpress.com&amp;blog=4831721&amp;post=218&amp;subd=lbarclay&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lbarclay.wordpress.com/2009/11/26/my-twitter-flickr-mashup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6dd2273c60019dd55fa225ca69367ed?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lbarclay</media:title>
		</media:content>

		<media:content url="http://lbarclay.files.wordpress.com/2009/11/flittr.jpg?w=300" medium="image">
			<media:title type="html">flittr</media:title>
		</media:content>
	</item>
		<item>
		<title>Javascript League Tables</title>
		<link>http://lbarclay.wordpress.com/2009/08/15/javascript-league-tables/</link>
		<comments>http://lbarclay.wordpress.com/2009/08/15/javascript-league-tables/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 13:39:37 +0000</pubDate>
		<dc:creator>lbarclay</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[sport]]></category>
		<category><![CDATA[free javascript code]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[user experience]]></category>
		<category><![CDATA[WS]]></category>

		<guid isPermaLink="false">http://lbarclay.wordpress.com/?p=195</guid>
		<description><![CDATA[Having seen a lot of league tables on various websites I was suprised to not see the implementations use the UI more effectively. Most of the implementations required the user to click on seperate links to view the current table, results or fixtures. I was interested to see if I could provide an easier way [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lbarclay.wordpress.com&amp;blog=4831721&amp;post=195&amp;subd=lbarclay&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Having seen a lot of league tables on various websites I was suprised to not see the implementations use the UI more effectively. Most of the implementations required the user to click on seperate links to view the current table, results or fixtures.</p>
<p>I was interested to see if I could provide an easier way of navigating between these sets of information, whilst providing a generic API to support different sports, using Javascript only, fed by JSON serialised data.</p>
<p>I naturally chose soccer (football!) as the base of my test data and used the current English Premier League teams to build a demonstration table.</p>
<p>This is what I&#8217;ve come up with so far:<a title="Javascript League Table and Fixtures" href="http://www.lewisbarclay.com/LeagueTable" target="_blank"> Javascript League Table and Fixtures</a></p>
<p>What I&#8217;ve done so far is delieverd completely in Javascript and is a bit verbose! If anyone is interested in getting me to develop it further for their website then let me know!</p>
<br />Posted in development, javascript, jquery, open source, sport Tagged: development, free javascript code, javascript, jquery, JSON, user experience, WS <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lbarclay.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lbarclay.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lbarclay.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lbarclay.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lbarclay.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lbarclay.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lbarclay.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lbarclay.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lbarclay.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lbarclay.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lbarclay.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lbarclay.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lbarclay.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lbarclay.wordpress.com/195/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lbarclay.wordpress.com&amp;blog=4831721&amp;post=195&amp;subd=lbarclay&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lbarclay.wordpress.com/2009/08/15/javascript-league-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6dd2273c60019dd55fa225ca69367ed?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lbarclay</media:title>
		</media:content>
	</item>
		<item>
		<title>ExtJs stores and baseParams</title>
		<link>http://lbarclay.wordpress.com/2009/03/19/extjs-stores-and-baseparams/</link>
		<comments>http://lbarclay.wordpress.com/2009/03/19/extjs-stores-and-baseparams/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 15:54:00 +0000</pubDate>
		<dc:creator>lbarclay</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[free javascript code]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[WS]]></category>

		<guid isPermaLink="false">http://lbarclay.wordpress.com/?p=123</guid>
		<description><![CDATA[I have found myself using ExtJS on both of the last two contracts I have worked on. I have found that the API documentation, however well organised, doesn&#8217;t suit me. Finding examples that are  specifically what you need can be a difficult task as they tend not to exist in the documentation itself but are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lbarclay.wordpress.com&amp;blog=4831721&amp;post=123&amp;subd=lbarclay&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have found myself using <a title="Ext Javascript Frameworks" href="http://www.extjs.com" target="_blank">ExtJS</a> on both of the last two contracts I have worked on.</p>
<p>I have found that the <a title="ExtJS API Documentation" href="http://extjs.com/deploy/dev/docs/" target="_blank">API documentation</a>, however well organised, doesn&#8217;t suit me.<br />
Finding examples that are  specifically what you need can be a difficult task as they tend not to exist in the documentation itself but are more often than not found fragmented in the <a title="ExtJs Forums" href="https://www.yui-ext.com/forum/" target="_blank">forums</a>, across several posts, or in the <a title="ExtJs examples" href="http://www.extjs.com/products/extjs/" target="_blank">example pages within the ExtJS site</a>.</p>
<p>I&#8217;m not sure if this is intentional and meant as a way of pushing the user to buy a support contract but it can be frustrating. As well as  this the extensiveness of the ExtJS library causes me to sometimes forget some of the more straightforward principles in Javascript and become more lazy, expecting things to &#8216;just work out of the box&#8217;.</p>
<p>An example of this occurred this afternoon&#8230;</p>
<p><span id="more-123"></span><br />
I have a grid on a page and am setting the grid to have only 10 records displayed, paged at any one time.</p>
<p>I wrote some asp.net to facilitate the request and return some data as JSON which I called with the <em>start</em> and <em>limit</em> parameters, as described in the API documentation. Using a JsonStore bound to a grid with a pagingToolbar I could make subsequents requests to next and previous pages of data, sorted ascending or descending.</p>
<p>All good so far!</p>
<p>An additional requirement was for the data to have a filter applied by the way of a text box at the top of the grid.<br />
I&#8217;m not using ExtJs for anything other than the grids on this project and am using <a title="The daddy of all Javascript Frameworks!" href="http://www.jquery.com" target="_blank">jQuery </a>as an adapter.<br />
So I simply wanted to get the filter text from the grid and pass it in as an additional parameter as part of the requests made by the jsonStore.</p>
<p>I can treat any initial request to the data as an &#8216;empty filter&#8217; so can have all requests passing all three parameters (start, limit and filter), no matter when the request occurs.</p>
<p>So all I needed to do was make sure that, for each subsequent load of the store, I was retrieving the value from the filter.</p>
<p>The problem I had was a confusion over what to send across in the params when using the store.load({&#8230;}) call and and how to set the baseParams on the store and when.</p>
<p>In hindsight, the way to achieve this seems obvious , but it wasn&#8217;t something that came to me naturally at first (because of the reasons I described above).</p>
<p>I found myself looking around at the pagingToolbar class in the API docs and trawling through the API for an example. I found it hard to believe that the forums didn&#8217;t have any specific examples of how this might be done, seeing as I&#8217;m sure many others have tried to do the same thing.</p>
<p>The solution was to set the base parameters before the request was made by adding a listener to the <em>beforeload </em>event on the datastore. I&#8217;m using jQuery to get the value of the text box with the id of <em>txtFilter</em> to do this:</p>
<pre style="background:#eee;border:dotted 1px #ddd;overflow:scroll;margin:5px;padding:5px;">//DATA STORE
    <span style="color:#0000ff;">var</span> myStore= <span style="color:#0000ff;">new </span>Ext.data.JsonStore({<span style="color:#339966;">...</span>});

    myStore.on(<span style="color:#ff0000;">'beforeload'</span>, <span style="color:#0000ff;">function</span>(store){
	store.baseParams = {limit: gridPageSize, filter: $(<span style="color:#ff0000;">'#txtFilter'</span>).val()};
    });</pre>
<p>Nothing too complicated about it.  I just wish that this kind of example were more readily available (or at least linked to) from the ExtJs API documentation.</p>
<p>Lewis Barclay<br />
<a title="Web Development Architecture and design" href="http://www.lewisbarclay.com/" target="_blank">Web Development, Architecture and Design</a></p>
<br />Posted in development, javascript, open source, Uncategorized Tagged: development, extjs, free javascript code, javascript, jquery, WS <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lbarclay.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lbarclay.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lbarclay.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lbarclay.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lbarclay.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lbarclay.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lbarclay.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lbarclay.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lbarclay.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lbarclay.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lbarclay.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lbarclay.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lbarclay.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lbarclay.wordpress.com/123/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lbarclay.wordpress.com&amp;blog=4831721&amp;post=123&amp;subd=lbarclay&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lbarclay.wordpress.com/2009/03/19/extjs-stores-and-baseparams/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6dd2273c60019dd55fa225ca69367ed?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lbarclay</media:title>
		</media:content>
	</item>
		<item>
		<title>MacBook Pro Trackpad and Keyboard not Working?</title>
		<link>http://lbarclay.wordpress.com/2009/01/29/macbook-pro-trakpad-and-keyboard-not-working/</link>
		<comments>http://lbarclay.wordpress.com/2009/01/29/macbook-pro-trakpad-and-keyboard-not-working/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 12:35:06 +0000</pubDate>
		<dc:creator>lbarclay</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[MacBook]]></category>
		<category><![CDATA[Annoyance]]></category>
		<category><![CDATA[Broken Hardware]]></category>
		<category><![CDATA[MacBook Pro]]></category>
		<category><![CDATA[WS]]></category>

		<guid isPermaLink="false">http://lbarclay.wordpress.com/?p=93</guid>
		<description><![CDATA[I was sat at the airport the other week with very little to do. I turned on my 13 and  a half month old (that&#8217;s one and half months out of warranty I believe, around 45 days) MacBook Pro , that I love and has been working perfectly since I purchased it and I couldn&#8217;t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lbarclay.wordpress.com&amp;blog=4831721&amp;post=93&amp;subd=lbarclay&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was sat at the airport the other week with very little to do.</p>
<p>I turned on my 13 and  a half month old (that&#8217;s one and half months out of warranty I believe, around 45 days)  <a title="Macbook Pro" href="http://www.apple.com/macbookpro/">MacBook Pro</a> , that I love and has been working perfectly since I purchased it and I couldn&#8217;t type in my password when it came to logging in to OSX.</p>
<p>&#8216;No problem&#8217; I thought, &#8216;a simple reastart should fix this&#8217;.</p>
<p>Hmm. Not so. On restart this time, I realised that th Trackpad wasn&#8217;t working also.</p>
<p>&#8216;One last try, booting into Windows instead&#8217; was my next thought. Only, holding down the Alt key wasn&#8217;t bringing up the boot loader menu!</p>
<h2>Suddenly I had a lot to do</h2>
<ul>
<li>Find an Internet booth at the airport to check for known issues</li>
<li>Find a local Apple dealership that would be helpful and fix my laptop before I wanted to turn it back on again.</li>
<li>Write an angry letter to Steve Jobs (Get well soon Steve) about how I felt my two year old loyalty to Apple as a brand had been taken for granted, by providing me with equipment that lasted less time than the reasoning behind me spending £1,500 on the new notebook did with my Bank Manager.</li>
<li>Decide what I would buy instead of the Mac Pro I had been pricing up for £3500 just that week.</li>
<li>Wonder how my life would work whilst my Macbook Pro keyboard didn&#8217;t.</li>
</ul>
<p>Blimey, I was busy.</p>
<p>After a flight home fraught with concern, a few minutes ignoring my girlfriend when I arrived home and the meal she cooked &#8216;because my laptop is broken&#8217; I calmed down and took out the battery.</p>
<h2>The problem</h2>
<p>Anyway, what I found was that there are two small ribbon cables just under the battery in my MacBook Pro  (Revision :3,1). The darker orange / brown cable was the one causing trouble.</p>
<p>To discover this I:</p>
<ol>
<li>Booted into OSX with a USB keyboard and mouse</li>
<li>Plugged in the power cable</li>
<li>Removed the battery</li>
<li>Whilst pressing the caps lock key on continuously (on the laptop keyboard),  I gently pressed the ribbon cable.</li>
</ol>
<p>Although there was no visual signs of a problem, it seemed as though the ribbon cable had heated up too much and become warped. When pressed down the keyboard functioned perfectly.</p>
<h2>The Repair Centre</h2>
<p>So, I started looking for a company to repair my Macbook and, I found  a <a title="Apple Dealership, training and repairs" href="http://www.amsys.co.uk/">local Apple repair center</a> who, after hassling them without any response on a Saturday, fair enough on the weekend I guess, responded at 9.15 on Monday morning, with a price.</p>
<p>I&#8217;ll be honest, I wasn&#8217;t happy about the £250 price tag, &#8216;because the whole keyboard housing was going to have to be replaced&#8217;, which I suspect was Apple, not Amsys&#8217; reasoning,  but the response time was the best I could have expected. Well done Amsys.</p>
<h2>My (temporary) Fix</h2>
<p>Not getting a response until I was back in another country on Monday morning did however leave me with a weekend to work out my own fix.</p>
<p>Before you try this, it is temporary and I&#8217;d like my MacBook Pro to be fully functional without the use of Sellotape (Scotch tape, whatever) at some point,  as I&#8217;m sure you would. <strong>I take no responsibility for burnt laps, smoking MacBooks or the smell of burning glue or any other associated issues the fix might cause.</strong></p>
<ol>
<li>Get a small piece of sticky tape and roll it up</li>
<li>With the power on, battery out and machine on:</li>
<li>Place the Sticky tape onto the ribbon cable whilst pressing the caps lock key to identify that the keyboard is working</li>
<li>Close the screen and turn over your mack book.</li>
<li>Replace the battery so that it presses on the sticky tape and ribbon cable</li>
</ol>
<p>This worked for me, but did take a few attempts, and it is still working after three weeks!</p>
<p>Let me know if you&#8217;ve had the same issue please, or if you know of an alternative fix or repair centre!</p>
<br />Posted in Apple, MacBook Tagged: Annoyance, Apple, Broken Hardware, MacBook Pro, WS <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lbarclay.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lbarclay.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lbarclay.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lbarclay.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lbarclay.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lbarclay.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lbarclay.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lbarclay.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lbarclay.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lbarclay.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lbarclay.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lbarclay.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lbarclay.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lbarclay.wordpress.com/93/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lbarclay.wordpress.com&amp;blog=4831721&amp;post=93&amp;subd=lbarclay&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lbarclay.wordpress.com/2009/01/29/macbook-pro-trakpad-and-keyboard-not-working/feed/</wfw:commentRss>
		<slash:comments>101</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6dd2273c60019dd55fa225ca69367ed?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lbarclay</media:title>
		</media:content>
	</item>
		<item>
		<title>Unit Testing with xUnit and ReSharper</title>
		<link>http://lbarclay.wordpress.com/2009/01/22/setting-up-unit-tests-with-resharper-and-xunit-in-c/</link>
		<comments>http://lbarclay.wordpress.com/2009/01/22/setting-up-unit-tests-with-resharper-and-xunit-in-c/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 11:56:56 +0000</pubDate>
		<dc:creator>lbarclay</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[Unit testing]]></category>
		<category><![CDATA[WS]]></category>

		<guid isPermaLink="false">http://lbarclay.wordpress.com/?p=59</guid>
		<description><![CDATA[In this Post: The xUnit unit testing Framework ReSharper, .Net code productivity tool I&#8217;ve just started using the xUnit framework, and inherently the xUnit approach as a unit testing framework within .Net. For the purpose of this post and to avoid confusion when I say xUnit, I&#8217;m talking specifically about the framework! I&#8217;m using ReSharper [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lbarclay.wordpress.com&amp;blog=4831721&amp;post=59&amp;subd=lbarclay&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this Post:</p>
<ul>
<li><a title="Xunit unit testing framework" href="http://www.codeplex.com/xunit" target="_self">The xUnit unit testing Framework</a></li>
<li><a title="ReSharper VS Addin" href="http://www.jetbrains.com/resharper/index.html">ReSharper, .Net code productivity tool</a></li>
</ul>
<p>I&#8217;ve just started using the xUnit framework, and inherently the xUnit approach as a unit testing framework within .Net. For the purpose of this post and to avoid confusion when I say xUnit, I&#8217;m talking specifically about the framework!</p>
<p>I&#8217;m using ReSharper and the integration is really useful. I have a VS2008 standard edition license and it adds the UI point and click testing environment I lack, not having the heavier weight VS editions.</p>
<p>I&#8217;m currently building an MVC application and have abstracted out the model into seperate project(s).<br />
This leaves me with the following projects as part of my solution:</p>
<ul>
<li><span style="color:#ff0000;">NewSolutionName.Model [C# classes : Business Logic]</span></li>
<li><span style="color:#ff0000;">NewSolutionName.Web [MVC / ASP.Net (C#) : UI]</span></li>
<li><span style="color:#ff0000;">NewSolutionName.Tests.xUnit [C# Classes :  Unit tests]</span></li>
</ul>
<h2>Setting up the xUnit unit test project</h2>
<p>Add a reference to xunit.dll so that you can write unit tests using xUnit , as well as referencing any of the projects that you are going to write unit tests for, in my case both the Model and Web Projects.</p>
<p>I structured my unit test project into the followiung folders:</p>
<ul>
<li><span style="color:#ff0000;">/ModelTests/<br />
(contains all the tests for the Model Project) </span></li>
<li><span style="color:#ff0000;">/WebTests/<br />
(contains all the tests for the Web Project) </span></li>
<li><span style="color:#ff0000;">/TestRespository/<br />
(contains all Mock /  Dummy / Stub etc and helper class code)<br />
</span></li>
</ul>
<p>I collate my tests into logical collections. So unit tests for a Foobar class, in my model layer, would be created in a class in the /ModelTests folder:</p>
<ul>
<li><span style="color:#ff0000;">/ModelTests/FoobarTests.cs</span></li>
</ul>
<h2>Creating a Simple Test</h2>
<p>Using the Foobar class as an example:</p>
<div style="border:1px solid #dddddd;background:#e9e9e9 none repeat scroll 0 0;overflow:scroll;height:140px;margin:5px;padding:10px;">
<pre>namespace SolutionName.Model
{
    public class Foo
    {
        public int MyValue { get; set;}

        public Foo(int initVal)
        {
            MyValue = initVal;
        }

        public int Bar(int toAdd)
        {
            if (toAdd &lt; 10)
                MyValue += toAdd ;

            return toAdd;
        }
    }
}</pre>
</div>
<p>I wrote the following (far from exhausitve) example test:</p>
<div style="border:1px solid #dddddd;background:#e9e9e9 none repeat scroll 0 0;overflow:scroll;height:140px;margin:5px;padding:10px;">
<pre>namespace SolutionName.Tests.xUnit.ModelTests
{
    public class FooTests
    {
        private Foo thisFoo;

        public FooTests()
        {
            //SETUP<span style="color:#0000ff;">[ARRANGE]</span>
            thisFoo = new Foo(5);
        }

        ~FooTests()
        {
            //TEARDOWN
            thisFoo = null;
        }

        <span style="color:#ff0000;">[Fact]</span>
        public void TestFoo_MyValueHasExpectedValue_AfterInstanciation()
        {
            Assert.Equal(5, thisFoo.MyValue);
        }

        <span style="color:#ff0000;">[Fact]</span>
        public void TestFooBar_MyValueIsSame_AfterBarMethodPassingValueGreaterThanTen()
        {

            int expectedValue = thisFoo.MyValue;<span style="color:#0000ff;">//[ARRANGE]</span>
            thisFoo.Bar(100);<span style="color:#0000ff;">//[ACT]</span>

            Assert.Equal(expectedValue, thisFoo.MyValue);<span style="color:#0000ff;">//[ASSERT]</span>
        }

        <span style="color:#ff0000;">[Fact]</span>
        public void TestFooBar_MyValueExpectedValue_AfterBarMethodPassingValueLessThanTen()
        {
            Assert.Equal(5, thisFoo.MyValue);

            int newValue = 9;
            int expectedValue = thisFoo.MyValue + newValue;

            thisFoo.Bar(newValue);

            Assert.Equal(expectedValue, thisFoo.MyValue);
        }
    }
}</pre>
</div>
<p>Developing units with xUnit sits more naturally than other frameworks I&#8217;ve used.  I try to  think of the test itself as a self contained object that has a constructor for setup and destructor for tear down (as well as helper methods where necessary) and then each method should contain the following:</p>
<ul>
<li><span style="color:#ff0000;">ARRANGE &#8211; this should be any code that needs to setup the test Mock / Dummy objects etc.</span></li>
<li><span style="color:#ff0000;">ACT &#8211; Execute the actual functionality being tested</span></li>
<li><span style="color:#ff0000;">ASSERT &#8211; check that the results of the test are as expected</span></li>
</ul>
<p>The test we&#8217;re interested above is:</p>
<pre>TestFooBar_MyValueIsSame_AfterBarMethodPassingValueGreaterThanTen</pre>
<p>Where I marked the AAA code!</p>
<h2>Running the test From ReSharper</h2>
<p>The first thing to do is to check that the xUnit Test Runner plugin is installed and recognised by ReSharper:</p>
<ol>
<li>Select the Resharper Menu &gt; Plugins&#8230;</li>
<li>There should be a plugin entitled : xUnit.Net Runner for ReSharper 4.0</li>
</ol>
<p>If so you should see green and yellow <em>&#8216;test icons&#8217;</em> on the left hand side of your code, one for your test class (to run all tests) and then  one for each individual test.</p>
<div id="attachment_72" class="wp-caption alignnone" style="width: 716px"><img class="size-full wp-image-72" title="resharperruntests" src="http://lbarclay.files.wordpress.com/2009/01/resharperruntests.gif?w=600" alt="Running unit tests in ReSharper"   /><p class="wp-caption-text">Running unit tests in ReSharper</p></div>
<p>To run your tests simply click the icon for your test class and choose Run or Debug to debug your code.</p>
<p>Lewis Barclay<br />
<a title="Web Development and Consultancy" href="http://www.lewisbarclay.com" target="_self">Web Development and Web Consultancy</a></p>
<br />Posted in javascript, open source, Unit testing Tagged: WS <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lbarclay.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lbarclay.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lbarclay.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lbarclay.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lbarclay.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lbarclay.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lbarclay.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lbarclay.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lbarclay.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lbarclay.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lbarclay.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lbarclay.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lbarclay.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lbarclay.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lbarclay.wordpress.com&amp;blog=4831721&amp;post=59&amp;subd=lbarclay&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lbarclay.wordpress.com/2009/01/22/setting-up-unit-tests-with-resharper-and-xunit-in-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6dd2273c60019dd55fa225ca69367ed?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lbarclay</media:title>
		</media:content>

		<media:content url="http://lbarclay.files.wordpress.com/2009/01/resharperruntests.gif" medium="image">
			<media:title type="html">resharperruntests</media:title>
		</media:content>
	</item>
	</channel>
</rss>
