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

<channel>
	<title>Guillaume Piot &#124; Application Developer &#38; User Interface Designer &#187; Web development</title>
	<atom:link href="http://gpiot.com/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://gpiot.com</link>
	<description></description>
	<lastBuildDate>Tue, 30 Apr 2013 08:42:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Twitter Bower &amp; Grunt: Get started with assets management</title>
		<link>http://gpiot.com/twitter-bower-grunt-get-started-with-assets-management/</link>
		<comments>http://gpiot.com/twitter-bower-grunt-get-started-with-assets-management/#comments</comments>
		<pubDate>Thu, 11 Apr 2013 14:41:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development tips]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Node.js]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://gpiot.com/?p=719</guid>
		<description><![CDATA[You may have found yourself downloading latest version of your favourites JS or LESS packages every time you created a new website or app project, or even worse copy and pasted assets from an old website. In this article, I [...]]]></description>
			<content:encoded><![CDATA[<p>You may have found yourself downloading latest version of your favourites JS or LESS packages every time you created a new website or app project, or even worse copy and pasted assets from an old website. In this article, I will demonstrate how you can automate package management with <a href="http://twitter.github.io/bower/">Twitter Bower</a> and build your assets with <a href="http://gruntjs.com/">Grunt</a>, and eventually work smarter.</p>
<h2>Installing Bower</h2>
<p>Bower is written in <a href="http://nodejs.org/">Node.js</a> and therefore require Node package manager <a href="https://npmjs.org/">npm</a> to install it. So first you will need to install Node.js, by choosing an installer on the <a href="http://nodejs.org/download/">Node.js download page</a>.</p>
<p>Once Node.js is installed, simply run the following command:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ sudo npm install -r bower</div></td></tr></tbody></table></div>
<h2>Finding packages</h2>
<p>There&#8217;s two ways of looking for packages:</p>
<p>Either search for packages using the command line tool:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ bower search bootstrap</div></td></tr></tbody></table></div>
<p><a href="http://gpiot.com/wp-content/uploads/2013/04/bower-search-bootstrap.png"><img class="alignnone size-full wp-image-728" title="bower-search-bootstrap" src="http://gpiot.com/wp-content/uploads/2013/04/bower-search-bootstrap.png" alt="" /></a></p>
<p>Or alternatively, browse them from the <a href="http://sindresorhus.com/bower-components/">online repository</a></p>
<h2>Installing packages</h2>
<p>Once you have found your favourite packages, run the following command within your project folder:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ bower install bootstrap</div></td></tr></tbody></table></div>
<p>It may take a minute or so&#8230;</p>
<p><a href="http://gpiot.com/wp-content/uploads/2013/04/bower-install-bootstrap.png"><img class="alignnone size-full wp-image-732" title="bower-install-bootstrap" src="http://gpiot.com/wp-content/uploads/2013/04/bower-install-bootstrap.png" alt="" /></a></p>
<p>Please note that Bower will cache your downloaded packages in ~/.bower/cache so next time you run the install, it will use the cache version for a quicker install.</p>
<p>Though, if the packages have been updated and you want to download the latest, you can clear the cache:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ bower cache-clean</div></td></tr></tbody></table></div>
<p>Or if you wish to update your packages:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ bower update bootstrap</div></td></tr></tbody></table></div>
<h2>Building your assets</h2>
<p>Grunt is wonderful tool build in Node.js which basically allows you to write a set of functions that will process your assets as required. You can for example command to <strong>jshint</strong> (check JS syntax), <strong>concat</strong> (Concatenated multiple files in one) and <strong>uglify</strong> (minify files) a bundle of JS files as required.</p>
<p>The list of plugins is long so check the <a href="http://gruntjs.com/plugins">Grunt plugin page</a> to see what it can do. For the purpose of this article, I will demonstrate how to use Grunt for scaffolding the assets installed by Bower, and building a deployment methodology to manage our assets.</p>
<p>First we need to install Grunt, in a similar fashion as we did for Bower, using NPM:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ sudo npm install -g grunt-cli </div></td></tr></tbody></table></div>
<p>Then, we need to create a package.json file to indicate which Grunt dependencies we need to install:</p>
<p><script src="https://gist.github.com/guillaumepiot/5363418.js"></script> And install:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ npm install</div></td></tr></tbody></table></div>
<p>Then, we must create a gruntfile.js to config which action we would like Grunt to execute:  <script src="https://gist.github.com/guillaumepiot/5363386.js"></script></p>
<p>In this config, we specify which files to copy files from downloaded packages (<strong>copy</strong>), check for syntax (<strong>jshint</strong>), which file to concatenate (<strong>concat</strong>), which file to uglify (<strong>uglify</strong>) and finally which file to watch (<strong>watch</strong>).</p>
<p>To execute this command:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ grunt</div></td></tr></tbody></table></div>
<p>By default, grunt will run the &#8216;default&#8217; tasks. So it is also possible to run a specific task for example:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ grunt build</div></td></tr></tbody></table></div>
<p>The build command will pull the assets from the packages downloaded by Bower and set up a default starting architecture for the new project. So technically, it should only be run once.</p>
<h3>Watch file changes</h3>
<p>You can also watch you files, so if you change any of those files, then grunt will automatically re-run the config, which great to test development work.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ grunt watch</div></td></tr></tbody></table></div>
<p>So if you use something like <strong>CodeKit</strong>, then you won&#8217;t need it anymore!</p>
<h2>Further reading</h2>
<p>You can read the <a href="https://npmjs.org/package/bower">NPM Bower package instructions</a> for an overview of all the commands or simply look on the <a href="http://twitter.github.io/bower/">Twitter Bower home page</a>.</p>
<p>For Grunt, you can refer to their <a href="http://gruntjs.com/getting-started">online documentation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gpiot.com/twitter-bower-grunt-get-started-with-assets-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AngularJS: useful tips to get started</title>
		<link>http://gpiot.com/angularjs-useful-tips-to-get-started/</link>
		<comments>http://gpiot.com/angularjs-useful-tips-to-get-started/#comments</comments>
		<pubDate>Tue, 23 Oct 2012 15:43:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AngularJS]]></category>
		<category><![CDATA[Development tips]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://gpiot.com/?p=670</guid>
		<description><![CDATA[AJAX POST calls: CSRF token for Django In order to pass in the required CRSF token for Django POST requests, we can config our Angular module to add the X-CSRFToken POST header parameter on every call. To do so, set a [...]]]></description>
			<content:encoded><![CDATA[<h2>AJAX POST calls: CSRF token for Django</h2>
<p>In order to pass in the required CRSF token for Django POST requests, we can config our Angular module to add the X-CSRFToken POST header parameter on every call. To do so, set a config on the app module that way:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> myApp <span style="color: #339933;">=</span> angular.<span style="color: #660066;">module</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'myApp'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">config</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>$httpProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<br />
$httpProvider.<span style="color: #660066;">defaults</span>.<span style="color: #660066;">headers</span>.<span style="color: #660066;">post</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'X-CSRFToken'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input[name=csrfmiddlewaretoken]'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>In this scenario, the csrfmiddlewaretoken is output by the Django template context as an hidden input field.</p>
<p><strong>Download the gist:</strong> <a href="https://gist.github.com/3939452">ANGULARJS &#8211; Django CSRF Token header setup</a></p>
<h2>Route path changes (or URL redirect)</h2>
<p>Obviously in AngularJS, we don&#8217;t actually redirect the user but we change the url path (the one followed by #/) in order to load a different controller. It is quite simple to do, simply by giving a url parameter to the <strong>path()</strong> method:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">myApp.<span style="color: #660066;">controller</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'myCtrl'</span><span style="color: #339933;">,</span>&nbsp; <span style="color: #003366; font-weight: bold;">function</span> myCtrl<span style="color: #009900;">&#40;</span>$location<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<br />
$location.<span style="color: #660066;">path</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'/mypath'</span><span style="color: #009900;">&#41;</span><br />
<br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>Do not forget to pass $location in your controller arguments!</p>
<p>More in depth documentation is available on the <a href="http://docs.angularjs.org/api/ng.$location">AngularJS $location reference page</a></p>
<h2>Passing data to a POST call with $http</h2>
<p>The $http POST call on AngularJS will not automatically convert your data array to a set of parameter for the AJAX call. So you must encode the data array as follow (i&#8217;m using jQuery to do so):</p>
<p>$.param(data))</p>
<p><strong>Example:</strong></p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$scope.<span style="color: #660066;">add_flight_route</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<br />
<span style="color: #003366; font-weight: bold;">var</span> d <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #003366; font-weight: bold;">var</span> data <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>route_id<span style="color: #339933;">:</span>$rootScope.<span style="color: #660066;">route_info</span>.<span style="color: #660066;">route_id</span><span style="color: #009900;">&#125;</span><br />
<br />
$http.<span style="color: #660066;">post</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'/ajax/vall/?rand='</span><span style="color: #339933;">+</span>d.<span style="color: #660066;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> $.<span style="color: #660066;">param</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">success</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<h3>Related links</h3>
<p>I found even more tips and tricks on this blog: <a href="http://deansofer.com/posts/view/14/AngularJs-Tips-and-Tricks-UPDATED">http://deansofer.com/posts/view/14/AngularJs-Tips-and-Tricks-UPDATED</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gpiot.com/angularjs-useful-tips-to-get-started/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AngularJS on IE7 not working: how to fix it.</title>
		<link>http://gpiot.com/angularjs-on-ie7-not-working-how-to-fix-it/</link>
		<comments>http://gpiot.com/angularjs-on-ie7-not-working-how-to-fix-it/#comments</comments>
		<pubDate>Wed, 17 Oct 2012 16:53:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AngularJS]]></category>
		<category><![CDATA[Development tips]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://gpiot.com/?p=649</guid>
		<description><![CDATA[We must tag accordingly The main issue with IE7 is its lack of support for HTML5 tags, so we have to tag our AngularJS HTML template accordingly to make sure it will load our app. So here&#8217;s how it got [...]]]></description>
			<content:encoded><![CDATA[<h2>We must tag accordingly</h2>
<p>The main issue with IE7 is its lack of support for HTML5 tags, so we have to tag our AngularJS HTML template accordingly to make sure it will load our app.</p>
<p>So here&#8217;s how it got it to work:</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ng-app&quot;</span> ng-app<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;routemapApp&quot;</span>&gt;</span></div></td></tr></tbody></table></div>
<p>Now I have seen many sites suggesting adding those attributes on the <strong>&lt;html&gt;</strong> tag, but for me <strong>it doesn&#8217;t work! </strong>So stick with the body tag and you should be a much happier person!</p>
<p>Then, we need to tag our ng-view accordingly as well:</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ng-view&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></td></tr></tbody></table></div>
<p>Using the class binder is safer than trying to support for &lt;ng-view&gt;</p>
<h2>Adding support for JSON</h2>
<p>You will need to load this JSON polyfill for IE7 and IE8</p>
<p><a href="http://bestiejs.github.com/json3/">http://bestiejs.github.com/json3/</a></p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">&lt;!--[if lte IE 8]&gt;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp;&lt;script src=&quot;/static/js/libs/json3.min.js&quot;&gt;&lt;/script&gt;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp;&lt;![endif]--&gt;</span></div></td></tr></tbody></table></div>
<h2>Supporting for special tags</h2>
<p>AngularJS developer site provides a great starting guide on adding support for special tags on IE7, so here&#8217;s a good way to start:</p>
<p><a href="http://docs.angularjs.org/guide/ie">http://docs.angularjs.org/guide/ie</a></p>
<p>This is what they suggest:</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/html.html"><span style="color: #000000; font-weight: bold;">html</span></a> xmlns:ng<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://angularjs.org&quot;</span>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/head.html"><span style="color: #000000; font-weight: bold;">head</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!--[if lte IE 8]&gt;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp;&lt;script&gt;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;document.createElement('ng-include');</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;document.createElement('ng-pluralize');</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;document.createElement('ng-view');</span><br />
 <br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;// Optionally these for CSS</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;document.createElement('ng:include');</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;document.createElement('ng:pluralize');</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;document.createElement('ng:view');</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp;&lt;/script&gt;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp;&lt;![endif]--&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/head.html"><span style="color: #000000; font-weight: bold;">head</span></a>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a>&gt;</span><br />
&nbsp; &nbsp; ...<br />
&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/html.html"><span style="color: #000000; font-weight: bold;">html</span></a>&gt;</span></div></td></tr></tbody></table></div>
<p>Though I am not using it, I&#8217;d rather stick to the old fashion class binding system!</p>
]]></content:encoded>
			<wfw:commentRss>http://gpiot.com/angularjs-on-ie7-not-working-how-to-fix-it/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Sublime Text 2: moving on from Textmate</title>
		<link>http://gpiot.com/sublime-text-2-moving-on-from-textmate/</link>
		<comments>http://gpiot.com/sublime-text-2-moving-on-from-textmate/#comments</comments>
		<pubDate>Tue, 02 Oct 2012 09:23:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://gpiot.com/?p=611</guid>
		<description><![CDATA[After 4 years of loyal service from Textmate, it was time to an upgrade in order to improve my coding productivity. The long waited Textmate 2 being converted to an open source project still at an alpha stage hasn&#8217;t made [...]]]></description>
			<content:encoded><![CDATA[<p>After 4 years of loyal service from <a href="http://macromates.com/">Textmate</a>, it was time to an upgrade in order to improve my coding productivity.</p>
<p>The long waited Textmate 2 being converted to an <a href="http://thenextweb.com/apps/2012/08/09/the-long-delayed-textmate-2-text-editor-open-sourced/">open source project</a> still at an alpha stage hasn&#8217;t made it a tool of choice for me.</p>
<p>Luckily, my fellow developer <a href="https://twitter.com/kin_hung">@kin_hung</a> has been using Sublime Text 2 for quite a while and has showed me a list of useful packages that could seriously increase my productivity. So the choice was made.</p>
<p>I have listed some cool packages I have installed so far, but I probably will add more later on as I discover them so it&#8217;ll be worth keeping an eye on this article.</p>
<h2>First, let&#8217;s get a package installer</h2>
<p>This will allow us to install (almost) any package from the Sublime command line which is a big time saver.</p>
<p>Follow the instructions on this page:</p>
<p><a href="http://wbond.net/sublime_packages/package_control/installation">http://wbond.net/sublime_packages/package_control/installation</a></p>
<p>Or simply type the following in your Sublime console (Menu &gt; View &gt; Show Console):</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print 'Please restart Sublime Text to finish installation'</div></td></tr></tbody></table></div>
<h2>Django templates, model fields &amp; form fields</h2>
<p><a href="https://github.com/squ1b3r/Djaneiro">https://github.com/squ1b3r/Djaneiro</a></p>
<p>It really eases up writing Django code, I&#8217;m so glad I don&#8217;t need to write {% %} ever again!</p>
<h3>Template examples</h3>
<table border="1" width="100%">
<tbody>
<tr>
<td width="25%"><strong>if</strong></td>
<td><tt>&gt; {% if %} {% endif %}</tt></td>
</tr>
<tr>
<td><strong>ifchanged </strong></td>
<td><tt>&gt; {% ifchanged %} {% endifchanged %}</tt></td>
</tr>
<tr>
<td><strong>ife</strong></td>
<td><tt>&gt; {% if %} {% else %} {% endif %}</tt></td>
</tr>
<tr>
<td><strong>ifelse</strong></td>
<td><tt>&gt; {% if %} {% else %} {% endif %}</tt></td>
</tr>
</tbody>
</table>
<h3>Model field examples</h3>
<table border="1" width="100%">
<tbody>
<tr>
<td width="25%"><strong>memail</strong></td>
<td><tt>&gt; models.EmailField()</tt></td>
</tr>
<tr>
<td><strong>mfile</strong></td>
<td><tt>&gt; models.FileField()</tt></td>
</tr>
</tbody>
</table>
<h3>Form field examples</h3>
<table border="1" width="100%">
<tbody>
<tr>
<td width="25%"><strong>fdate</strong></td>
<td><tt>&gt; forms.DateField()</tt></td>
</tr>
<tr>
<td><strong>fdatetime</strong></td>
<td><tt>&gt; forms.DateTime()</tt></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<h2>HTML &amp; CSS high speed coding</h2>
<p><a href="http://code.google.com/p/zen-coding/">http://code.google.com/p/zen-coding/</a><br />
This is the most intuitive way I have seen to shortcut HTML. You can write a string like this:</p>
<p><strong>div#page&gt;div.logo+ul#navigation&gt;li*5&gt;a</strong></p>
<p><strong> </strong><br />
&#8230; and it will generate this:</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;navigation&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/li.html"><span style="color: #000000; font-weight: bold;">li</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/ul.html"><span style="color: #000000; font-weight: bold;">ul</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></td></tr></tbody></table></div>
<p>That&#8217;s at least 30s saved!</p>
<h2>Jquery</h2>
<p>A long list of jQuery shortcut that will save you plenty of time again.</p>
<p><a href="https://github.com/mrmartineau/jQuery">https://github.com/mrmartineau/jQuery</a></p>
<table border="1" width="100%">
<tbody>
<tr>
<td width="25%"><strong>$</strong></td>
<td><tt>&gt; $('#select DOM Element')</tt></td>
</tr>
<tr>
<td><strong>.click</strong></td>
<td><tt>&gt; .click(${1:function(${2:event}) {	${0:// Act on the event}\}});&nbsp;</p>
<p></tt><tt></tt><tt></tt><tt></tt><tt></tt><tt></tt><tt></tt><tt></tt></td>
</tr>
</tbody>
</table>
<h2>Tutorials</h2>
<p>If you wish to dig deeper into Sublime Text 2, then I recommend reading this tutorial:</p>
<p><a href="https://tutsplus.com/course/improve-workflow-in-sublime-text-2/">https://tutsplus.com/course/improve-workflow-in-sublime-text-2/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gpiot.com/sublime-text-2-moving-on-from-textmate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Burrst.com: A glimpse under the bonnet</title>
		<link>http://gpiot.com/burrst-com-a-glimpse-under-the-bonnet/</link>
		<comments>http://gpiot.com/burrst-com-a-glimpse-under-the-bonnet/#comments</comments>
		<pubDate>Thu, 06 Sep 2012 16:08:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Digital trends]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Tornado]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://gpiot.com/?p=584</guid>
		<description><![CDATA[One of my very respected web developer friend, Anthony Blackshaw (Getme Ltd) has released earlier this month a brand new way to publish and share short pieces of fiction written by anyone who wants to have a try at writing [...]]]></description>
			<content:encoded><![CDATA[<p>One of my very respected web developer friend, <a href="https://twitter.com/getmeweb">Anthony Blackshaw</a> (<a href="http://www.getme.co.uk/">Getme Ltd</a>) has released earlier this month a brand new way to publish and share short pieces of fiction written by anyone who wants to have a try at writing (or already is an author!) and is seeking constructive feedback.</p>
<p>Content quality is ensured on a registration process by approval, where each first fiction piece is reviewed by a moderator before according the &#8216;publisher&#8217; account type to the registrant.</p>
<p>On the same lines a <a href="http://dribbble.com">Dribbble.com</a>, <a href="http://burrst.com">Burrst</a> will maintain high quality content by selecting only the worthwhile. Looking back on the success on Dribbble, I&#8217;m sure this will have positive effects on the website.</p>
<p>Being a web developer and therefore very curious about what is powering this site, I have collected from Anthony a few things that I will share with you now.</p>
<p><a href="http://gpiot.com/wp-content/uploads/2012/09/homepage.jpg"><img class="alignnone size-full wp-image-597" title="homepage" src="http://gpiot.com/wp-content/uploads/2012/09/homepage.jpg" alt="" /></a></p>
<h2>So, what is Burrst.com built on?</h2>
<p>Burrst is built on <a href="http://www.tornadoweb.org/">Tornado</a>, a lightweight Python framework which has the unusual advantage of being an asynchronous web server as well (great for live notifications which we&#8217;ll discuss further down).</p>
<p><strong>But why Tornado and not Django for example?</strong></p>
<p>Well, Tornado is lightening fast (hence the name) and Ant like his applications to be fast (we all do really). So by being lightweight and well written, the result are staggering: under 300ms page load and under 500ms for a fully loaded home page, that&#8217;s just about the time to see the loading spin appearing in your browser window.</p>
<p>Speed is such as an important factor in application success, users tend to get frustrated after <strong>1s</strong> an will probably leave at <strong>4s</strong>, the whole user experience starts with speed, and more generally, responsiveness.</p>
<h2>Template engine</h2>
<p>Tornado is equipped with a lightweight template processor which works by inheritance (in the same way as django does) but don&#8217;t allow includes. You can run raw Python in the template but that may not be the best practice, keeping the logic away from the view lead to leaner code.</p>
<h2>Form management</h2>
<p>This is where things start to get tight. The built in form system is limited and is likely to be insufficient to build public apps, where a high level of validation, security and variety of fields are required. So Burrst has turned its eyes towards <a href="http://wtforms.simplecodes.com/docs/1.0.2/">wtForms</a>, a much more complete package that plugs in easily in Tornado, providing it with the necessary form tools, considerably diminishing the amount of development work.</p>
<p><a href="http://gpiot.com/wp-content/uploads/2012/09/form.jpg"><img class="alignnone size-full wp-image-598" title="form" src="http://gpiot.com/wp-content/uploads/2012/09/form.jpg" alt="" /></a></p>
<h2>Database handling</h2>
<p>Tornado comes with a MySQL database handler but speed is not its forte. So it has been a wise decision to turn to <a href="https://storm.canonical.com/">Storm</a>, a super fast database handler. Storm has the advantage to bundle up a series of queries before applying them, increasing processor efficiency, and also provide query result caching for accelerating those recurring query tasks.</p>
<p>One downside of Storm is that its developer haven&#8217;t completed the documentation, which that you will have to dig in the source to really get the best out of it.</p>
<h2>Search</h2>
<p>One thing that Tornado does not cover is a search engine. So <a href="http://pypi.python.org/pypi/Whoosh/">Woosh</a> have been implemented for its ease of use and fast search.</p>
<p>Just like creating a model in Django, Woosh allow the creation of search index objects where one can specify which attribute they want to feed in the index for later being queried against.</p>
<p>Index generation is not automatic so a recurring job must be in place to regularly update the index with new content. Alternatively, it could be updated when a user save new content but that may lead to an extra delay in page processing, unless you are using a Python queuing process so it won&#8217;t affect the immediate page load.</p>
<p>Overall it may also add on computer cycle which can be optimise by having a single global update during quiet times. I have recently integrated <a href="https://mixpanel.com/">Mixpanel</a> for application event tracking, and they strongly advise to use a python queuing processing to send tracking call without delaying the page load.</p>
<p><a href="http://gpiot.com/wp-content/uploads/2012/09/search.jpg"><img class="alignnone size-full wp-image-599" title="search" src="http://gpiot.com/wp-content/uploads/2012/09/search.jpg" alt="" /></a></p>
<h2>Cloud server</h2>
<p>Burrst is running on the very famous Amazon EC2 platform, using a micro-instance (yes, micro!) to render an average of <strong>35000 pages</strong> a month without a problem, thanks to the efficiency of the application. The instance offers <strong>613MB</strong> of RAM and run on a 64bits core.<br />
All media files are hosed on the S3 CDN, once again lightening the load on the micro-instance.</p>
<p><a href="http://gpiot.com/wp-content/uploads/2012/09/post.jpg"><img class="alignnone size-full wp-image-601" title="post" src="http://gpiot.com/wp-content/uploads/2012/09/post.jpg" alt="" /></a></p>
<h2>From idea to product</h2>
<p>The process of delivering Burrst has been surprisingly fast, fitting is today&#8217;s modern <a href="http://velocitylaws.com/">laws of velocity </a>where delivering small but fast and adapting along the way to the user needs is key to success.</p>
<p>The project has started on <strong>January 1st, 2012</strong>, from Anthony passion for writing fiction and not having an exclusive, content quality checked website to do so. It was time to offer a service that bring good prose to highlights rather being buried in a pile of mediocre work.</p>
<p>Only 6 months down the line, after a regular dedicated amount of hard work, Burrst was ready to hit the wild at the <strong>end of June 2012</strong>.</p>
<p>And it&#8217;s been an impressive start with already <strong>131,283 words</strong> burrsted and nearly 200 members within the first 3 months.</p>
<p>The project has been a success so far, I believe first for its concept but undeniably propelled by the quality of the service delivered, in terms of content, usability and speed.</p>
]]></content:encoded>
			<wfw:commentRss>http://gpiot.com/burrst-com-a-glimpse-under-the-bonnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Euros 2012 website: Social stats have never been so exiting</title>
		<link>http://gpiot.com/the-euros-2012-website-social-stats-have-never-been-so-exiting/</link>
		<comments>http://gpiot.com/the-euros-2012-website-social-stats-have-never-been-so-exiting/#comments</comments>
		<pubDate>Wed, 20 Jun 2012 10:24:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Digital trends]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Recent work]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://gpiot.com/?p=508</guid>
		<description><![CDATA[I would like to introduce you to my latest development project at VIVA Aspire. The project is about demonstrating the impact of football players performance (whether good or bad) on the pitch and how it affects their social media print off it. [...]]]></description>
			<content:encoded><![CDATA[<p>I would like to introduce you to my latest development project at <a href="http://www.viva-aspire.com">VIVA Aspire</a>.</p>
<p>The project is about demonstrating the impact of football players performance (whether good or bad) on the pitch and how it affects their social media print off it.</p>
<p><a href="http://twitter.com/cj_viva">Chris Jones</a> &amp; <a href="http://twitter.com/gbviva">Gary Blowers</a> have been doing a great job in writing consistently fresh content, pulling out and explaining some social facts we can see on the graph, along with interesting feedback on the players performances.</p>
<p>The design was created by <a href="http://twitter.com/gavinauty">Gavin Auty</a>, and I have worked on a few refinement of the UI for optimal ease of use.</p>
<h2>How does it work</h2>
<p>The website is equiped with a cron job (a schedule task on the server), which fetches data every 30 mins for a list of players owning a Twitter and/or Facebook account. The data is then saved in a database (over 90,000 rows so far!) to be later processed by the charts.</p>
<p>In order to display a nice graph, we need to generate an array of values every 30 mins between a start date and end date. I had to program an <strong>extrapolation</strong> script which covers for missing data points. As good as Twitter&#8217;s API is, we do get the odd connection lost, which means we have holes in the data. Using the extrapolation, we just use the previous values if the current one is missing, avoiding holes in the graphs.</p>
<h2>Datatainment</h2>
<p>Once we had the data nicely processed, it was time to display it a beautiful charts. Lack of time forced me to use a third party chart code (<a href="http://amcharts.com">amcharts.com</a>) which in the end proved to be a great asset of the site.</p>
<p>We feed the data to the chart using a JSON data object that we get from an AJAX call. The data object is then processed in the chart into a beautiful line graph, which also allows you to refine the view by zooming and slicing.</p>
<p><a href="http://gpiot.com/wp-content/uploads/2012/06/Screen-Shot-2012-06-20-at-11.21.14.jpg"><img class="alignnone size-full wp-image-515" title="Screen-Shot-2012-06-20-at-11.21.14" src="http://gpiot.com/wp-content/uploads/2012/06/Screen-Shot-2012-06-20-at-11.21.14.jpg" alt="" width="630" height="534" /></a></p>
<h2>Putting it all together</h2>
<p>One of the biggest challenge has been to layout the home page of the site in a way that tell the visitor what is this all about in a single glance. Having using great imagery for the blog articles, we have featured a quick stat view on the right hand side which allow the visitor to quickly play around, but mainly give an incentive to use the great charts we produce.</p>
<p>Then comes the tournament results and fixtures for reference and how to connect with our social network.</p>
<p>We also decided to support <a href="http://www.gosh.org">The Great Ormond Street Hospital</a> by giving a small donation for each unique visitors we get on the site.</p>
<p><a href="http://gpiot.com/wp-content/uploads/2012/06/Screen-Shot-2012-06-20-at-11.22.50.jpg"><img class="alignnone size-full wp-image-516" title="Screen-Shot-2012-06-20-at-11.22.50" src="http://gpiot.com/wp-content/uploads/2012/06/Screen-Shot-2012-06-20-at-11.22.50.jpg" alt="" width="630" height="486" /></a></p>
<h2>Oh and also, it&#8217;s fully responsive.</h2>
<p><a href="http://gpiot.com/wp-content/uploads/2012/06/euros-2012-responsive.png"><img class="alignnone size-full wp-image-520" title="euros-2012-responsive" src="http://gpiot.com/wp-content/uploads/2012/06/euros-2012-responsive.png" alt="" width="630" height="400" /></a></p>
<p>Feel free to post any comment here about the site, any feedback is always welcome (good or bad).</p>
]]></content:encoded>
			<wfw:commentRss>http://gpiot.com/the-euros-2012-website-social-stats-have-never-been-so-exiting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Export Tumblr blog to WordPress with XML file</title>
		<link>http://gpiot.com/export-tumblr-blog-to-wordpress-with-xml-file/</link>
		<comments>http://gpiot.com/export-tumblr-blog-to-wordpress-with-xml-file/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 11:28:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://piot.co.uk/?p=167</guid>
		<description><![CDATA[Since Tumblr doesn&#8217;t offer a way to export all the content at once, people have been developing online app that will will dump all your blog post into one XML file (using Tumblr API) which you can use to re-import [...]]]></description>
			<content:encoded><![CDATA[<p>Since Tumblr doesn&#8217;t offer a way to export all the content at once, people have been developing online app that will will dump all your blog post into one XML file (using <a href="http://www.tumblr.com/docs/api">Tumblr API</a>) which you can use to re-import into WordPress.</p>
<p><a title="Export Tumblr blog and import into WordPress" href="http://haochen.me/tumblr/">Export Tumblr blog and import into WordPress</a></p>
<p>Here&#8217;s how to import your XML data file into wordpress</p>
<ol>
<li>Log into that blog as an administrator.</li>
<li>Go to Manage: Import in the blog’s admin panels.</li>
<li>Choose “WordPress” from the list.</li>
<li>Upload this file using the form provided on that page.</li>
<li>You will first be asked to map the authors in this export file to  users on the blog.  For each author, you may choose to map to an  existing user on the blog or to create a new user</li>
<li>WordPress will then import each of the posts, comments, and categories contained in this file into your blog</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://gpiot.com/export-tumblr-blog-to-wordpress-with-xml-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
