<?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>dev.enekoalonso.com &#187; code</title>
	<atom:link href="http://dev.enekoalonso.com/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.enekoalonso.com</link>
	<description>having fun with code</description>
	<lastBuildDate>Wed, 12 Oct 2011 21:40:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>My Sublime Text 2 settings</title>
		<link>http://dev.enekoalonso.com/2011/07/26/my-sublime-text-2-settings/</link>
		<comments>http://dev.enekoalonso.com/2011/07/26/my-sublime-text-2-settings/#comments</comments>
		<pubDate>Wed, 27 Jul 2011 03:54:25 +0000</pubDate>
		<dc:creator>Eneko Alonso</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[settings]]></category>
		<category><![CDATA[sublime]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://dev.enekoalonso.com/?p=714</guid>
		<description><![CDATA[My Sublime Text 2 settings: // Settings in here override those in &#34;Default/Base File.sublime-settings&#34;, and // are overridden in turn by file type specific settings. Place your settings // here, to ensure they&#39;re preserved when upgrading. &#123; &#160;// Set to false for horizontal scrolling &#160;&#34;word_wrap&#34;: false, &#160;// Set to false to disable detection of tabs [...]]]></description>
			<content:encoded><![CDATA[<p>My <a href="http://www.sublimetext.com/2">Sublime Text 2</a> settings:</p>
<div class="geshi no javascript">
<ol>
<li class="li1">
<div class="de1"><span class="co1">// Settings in here override those in &quot;Default/Base File.sublime-settings&quot;, and</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// are overridden in turn by file type specific settings. Place your settings</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// here, to ensure they&#39;re preserved when upgrading.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="co1">// Set to false for horizontal scrolling</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="st0">&quot;word_wrap&quot;</span>: <span class="kw2">false</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="co1">// Set to false to disable detection of tabs vs. spaces on load</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="st0">&quot;detect_indentation&quot;</span>: <span class="kw2">false</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="co1">// Set to &quot;none&quot; to turn off drawing white space, &quot;selection&quot; to draw only the</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="co1">// white space within the selection, and &quot;all&quot; to draw all white space</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="st0">&quot;draw_white_space&quot;</span>: <span class="st0">&quot;all&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="co1">// Set to true to removing trailing white space on save</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="st0">&quot;trim_trailing_white_space_on_save&quot;</span>: <span class="kw2">true</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="co1">// Set to true to ensure the last line of the file ends in a newline</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="co1">// character when saving</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="st0">&quot;ensure_newline_at_eof_on_save&quot;</span>: <span class="kw2">true</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<h3  class="related_post_title">Related Posts:</h3><ul class="related_post"><li>July 30, 2010 -- <a href="http://dev.enekoalonso.com/2010/07/30/titanium-developer-love-and-hate/" title="Titanium Developer: love and hate">Titanium Developer: love and hate</a> (3)</li><li>June 3, 2011 -- <a href="http://dev.enekoalonso.com/2011/06/03/step-back-and-watch-what-the-%e2%80%9cnormals%e2%80%9d-do/" title="Step back and watch what the “normals” do">Step back and watch what the “normals” do</a> (0)</li><li>May 12, 2011 -- <a href="http://dev.enekoalonso.com/2011/05/12/angry-birds-as-a-web-app/" title="Angry Birds as a Web App">Angry Birds as a Web App</a> (0)</li><li>August 27, 2010 -- <a href="http://dev.enekoalonso.com/2010/08/27/link-whirlpool-js/" title="Link: Whirlpool JS">Link: Whirlpool JS</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://dev.enekoalonso.com/2011/07/26/my-sublime-text-2-settings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Angry Birds as a Web App</title>
		<link>http://dev.enekoalonso.com/2011/05/12/angry-birds-as-a-web-app/</link>
		<comments>http://dev.enekoalonso.com/2011/05/12/angry-birds-as-a-web-app/#comments</comments>
		<pubDate>Thu, 12 May 2011 17:40:58 +0000</pubDate>
		<dc:creator>Eneko Alonso</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[angry]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[birds]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[webapp]]></category>

		<guid isPermaLink="false">http://dev.enekoalonso.com/?p=693</guid>
		<description><![CDATA[Really, really cool, Rovio has released Angry Birds (and all the game assets) as a web app, Javascript and Canvas based. I can&#8217;t wait to see clones of Angry Birds with custom assets, maps and sounds. via Angry Birds as a Web App. Related Posts:July 30, 2010 -- Titanium Developer: love and hate (3)May 3, 2010 [...]]]></description>
			<content:encoded><![CDATA[<p>Really, really cool, Rovio has released Angry Birds (and all the game assets) as a web app, Javascript and Canvas based. I can&#8217;t wait to see clones of Angry Birds with custom assets, maps and sounds.</p>
<p>via <a href="http://googlesystem.blogspot.com/2011/05/angry-birds-as-web-app.html">Angry Birds as a Web App</a>.</p>
<h3  class="related_post_title">Related Posts:</h3><ul class="related_post"><li>July 30, 2010 -- <a href="http://dev.enekoalonso.com/2010/07/30/titanium-developer-love-and-hate/" title="Titanium Developer: love and hate">Titanium Developer: love and hate</a> (3)</li><li>May 3, 2010 -- <a href="http://dev.enekoalonso.com/2010/05/03/playing-with-websockets/" title="Playing with WebSockets">Playing with WebSockets</a> (4)</li><li>May 18, 2011 -- <a href="http://dev.enekoalonso.com/2011/05/18/location-hash-is-dead-on-html5-browsers/" title="location.hash is dead (on html5 browsers)">location.hash is dead (on html5 browsers)</a> (0)</li><li>May 6, 2011 -- <a href="http://dev.enekoalonso.com/2011/05/06/finding-duplicate-ids-on-an-html-page/" title="Finding duplicate ID&#8217;s on an HTML page">Finding duplicate ID&#8217;s on an HTML page</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://dev.enekoalonso.com/2011/05/12/angry-birds-as-a-web-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Link: Whirlpool JS</title>
		<link>http://dev.enekoalonso.com/2010/08/27/link-whirlpool-js/</link>
		<comments>http://dev.enekoalonso.com/2010/08/27/link-whirlpool-js/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 20:08:25 +0000</pubDate>
		<dc:creator>Eneko Alonso</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[compressed]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[cryptography]]></category>
		<category><![CDATA[encode]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[hash]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[minified]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[whirlpool]]></category>

		<guid isPermaLink="false">http://dev.enekoalonso.com/?p=651</guid>
		<description><![CDATA[Whirlpool is a very strong hashing algorithm (one way encryption) that encodes any text into a 128 character string (popular md5 generates a 32 byte string). Looking for the JavaScript version, I had to search on my email inbox for an email I received back in October 2009 to found the link where to download [...]]]></description>
			<content:encoded><![CDATA[<p>Whirlpool is a very strong hashing algorithm (one way encryption) that encodes any text into a 128 character string (popular md5 generates a 32 byte string). </p>
<p>Looking for the JavaScript version, I had to search on my email inbox for an email I received back in October 2009 to found the link where to download the Whirlpool Hash Javascript Algorithm. It&#8217;s kind of surprising that searching in Google for &#8220;whirlpool js&#8221;, &#8220;whirlpool javascript&#8221; or &#8220;whirlpool hash javascript algorithm&#8221; does not return the link.</p>
<p>For the record, here is the url:<br />
<a href="http://www.sunsean.com/Whirlpool.html">Whirlpool Hash Javascript Algorithm</a></p>
<h3  class="related_post_title">Related Posts:</h3><ul class="related_post"><li>May 18, 2011 -- <a href="http://dev.enekoalonso.com/2011/05/18/location-hash-is-dead-on-html5-browsers/" title="location.hash is dead (on html5 browsers)">location.hash is dead (on html5 browsers)</a> (0)</li><li>May 12, 2011 -- <a href="http://dev.enekoalonso.com/2011/05/12/angry-birds-as-a-web-app/" title="Angry Birds as a Web App">Angry Birds as a Web App</a> (0)</li><li>September 17, 2010 -- <a href="http://dev.enekoalonso.com/2010/09/17/mootools-core-for-server-and-mobile-development/" title="MooTools Core for Server and Mobile Development">MooTools Core for Server and Mobile Development</a> (1)</li><li>August 18, 2010 -- <a href="http://dev.enekoalonso.com/2010/08/18/titanium-developer-love-and-hate-part-ii/" title="Titanium Developer: love and hate (Part II)">Titanium Developer: love and hate (Part II)</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://dev.enekoalonso.com/2010/08/27/link-whirlpool-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Titanium Developer: love and hate (Part II)</title>
		<link>http://dev.enekoalonso.com/2010/08/18/titanium-developer-love-and-hate-part-ii/</link>
		<comments>http://dev.enekoalonso.com/2010/08/18/titanium-developer-love-and-hate-part-ii/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 19:58:52 +0000</pubDate>
		<dc:creator>Eneko Alonso</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[appcelerator]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[compiled]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[generated]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[native]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[objc]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[scrollview]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[titanium]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://dev.enekoalonso.com/?p=644</guid>
		<description><![CDATA[For the last four weeks and despite other projects and deadlines, I&#8217;ve been working on a mobile app for iPhone and Android, using Titanium Developer from Appcelerator. I still hate it. And I still love it. More to come&#8230; Related Posts:June 14, 2011 -- Titanium Studio and Titanium Mobile 1.7 (0)July 30, 2010 -- Titanium [...]]]></description>
			<content:encoded><![CDATA[<p>For the last <a href="http://dev.enekoalonso.com/2010/07/30/titanium-developer-love-and-hate/">four weeks</a> and despite other projects and deadlines, I&#8217;ve been working on a mobile app for iPhone and Android, using Titanium Developer from <a href="http://appcelerator.com">Appcelerator</a>.</p>
<p>I still hate it. And I still love it.</p>
<p>More to come&#8230;</p>
<h3  class="related_post_title">Related Posts:</h3><ul class="related_post"><li>June 14, 2011 -- <a href="http://dev.enekoalonso.com/2011/06/14/titanium-studio-and-titanium-mobile-1-7/" title="Titanium Studio and Titanium Mobile 1.7">Titanium Studio and Titanium Mobile 1.7</a> (0)</li><li>July 30, 2010 -- <a href="http://dev.enekoalonso.com/2010/07/30/titanium-developer-love-and-hate/" title="Titanium Developer: love and hate">Titanium Developer: love and hate</a> (3)</li><li>September 17, 2010 -- <a href="http://dev.enekoalonso.com/2010/09/17/mootools-core-for-server-and-mobile-development/" title="MooTools Core for Server and Mobile Development">MooTools Core for Server and Mobile Development</a> (1)</li><li>August 3, 2010 -- <a href="http://dev.enekoalonso.com/2010/08/03/iphone-sdk-old-versions/" title="List of iPhone SDK &#038; XCode packages">List of iPhone SDK &#038; XCode packages</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://dev.enekoalonso.com/2010/08/18/titanium-developer-love-and-hate-part-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating QR Codes with Google Charts API</title>
		<link>http://dev.enekoalonso.com/2010/07/30/creating-qr-codes-with-google-charts-api/</link>
		<comments>http://dev.enekoalonso.com/2010/07/30/creating-qr-codes-with-google-charts-api/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 05:51:28 +0000</pubDate>
		<dc:creator>Eneko Alonso</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[charts]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[qr]]></category>
		<category><![CDATA[qrcode]]></category>

		<guid isPermaLink="false">http://dev.enekoalonso.com/?p=618</guid>
		<description><![CDATA[As simple as a URL: http://chart.apis.google.com/chart?cht=qr&#038;chs=250&#215;250&#038;chl=http://dev.enekoalonso.com Related Posts:May 6, 2010 -- Tech talks at LEVEL Studios (0)February 19, 2010 -- Having fun with Mooml &#038; Twitter (0)January 28, 2010 -- Things to do (0)June 30, 2009 -- iPhone 3.0 geolocation with Javascript (1)]]></description>
			<content:encoded><![CDATA[<p>As simple as a URL: <a href="http://chart.apis.google.com/chart?cht=qr&#038;chs=250x250&#038;chl=http://dev.enekoalonso.com">http://chart.apis.google.com/chart?cht=qr&#038;chs=250&#215;250&#038;chl=http://dev.enekoalonso.com</a><br />
<img src="http://chart.apis.google.com/chart?cht=qr&#038;chs=250x250&#038;chl=http://dev.enekoalonso.com" alt="" /></p>
<h3  class="related_post_title">Related Posts:</h3><ul class="related_post"><li>May 6, 2010 -- <a href="http://dev.enekoalonso.com/2010/05/06/tech-talks-at-level-studios/" title="Tech talks at LEVEL Studios">Tech talks at LEVEL Studios</a> (0)</li><li>February 19, 2010 -- <a href="http://dev.enekoalonso.com/2010/02/19/having-fun-with-mooml-and-twitter/" title="Having fun with Mooml &#038; Twitter">Having fun with Mooml &#038; Twitter</a> (0)</li><li>January 28, 2010 -- <a href="http://dev.enekoalonso.com/2010/01/28/things-to-do/" title="Things to do">Things to do</a> (0)</li><li>June 30, 2009 -- <a href="http://dev.enekoalonso.com/2009/06/30/iphone-3-0-geolocation-with-javascript/" title="iPhone 3.0 geolocation with Javascript">iPhone 3.0 geolocation with Javascript</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://dev.enekoalonso.com/2010/07/30/creating-qr-codes-with-google-charts-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Titanium Developer: love and hate</title>
		<link>http://dev.enekoalonso.com/2010/07/30/titanium-developer-love-and-hate/</link>
		<comments>http://dev.enekoalonso.com/2010/07/30/titanium-developer-love-and-hate/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 04:57:16 +0000</pubDate>
		<dc:creator>Eneko Alonso</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[appcelerator]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[pc]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[titanium]]></category>

		<guid isPermaLink="false">http://dev.enekoalonso.com/?p=615</guid>
		<description><![CDATA[I&#8217;ve been using Titanium Developer for a while now, since I installed it to do some mobile app research one or two months ago. But up until now I barely used it again other than to maintain a desktop app I created for a game, which thanks to Titanium runs in both Mac and PC. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://www.appcelerator.com/products/titanium-mobile-application-development/">Titanium Developer</a> for a while now, since I installed it to do some mobile app research one or two months ago. But up until now I barely used it again other than to maintain a desktop app I created for a game, which thanks to Titanium runs in both Mac and PC. Thus, up until this week, I hadn&#8217;t really get in depth with it.</p>
<h3>The good things</h3>
<p>Nice, easy and fast. Creating apps is piece of cake, loading JSON feeds from Internet, using local storage, placing buttons and labels on the screen&#8230; it&#8217;s all easy and it works on both iPhone and Android right away.</p>
<h3>The bad things</h3>
<p>Titanium Developer looks like an unfinished app. It shouldn&#8217;t be version 1.X, not even 0.X. Looks like an alpha, buggy and very easy to get screwed up, specially if you share your projects between Windows and Mac. This time it launches the emulator, this time it does not. This time your project does not load properly. Next time, you try to create a new project and it fails. And the errors are totally useless. Not very helpful.</p>
<h3>Conclusion</h3>
<p>The idea is great, awesome. The code is clean and using Javascript for development makes it easy for web developers to get easily involved into mobile app development. If only the <a href="http://twitter.com/appcelerator">Appcelerator</a> team could improve their app, we would save a lot of headaches.</p>
<h3  class="related_post_title">Related Posts:</h3><ul class="related_post"><li>September 17, 2010 -- <a href="http://dev.enekoalonso.com/2010/09/17/mootools-core-for-server-and-mobile-development/" title="MooTools Core for Server and Mobile Development">MooTools Core for Server and Mobile Development</a> (1)</li><li>August 18, 2010 -- <a href="http://dev.enekoalonso.com/2010/08/18/titanium-developer-love-and-hate-part-ii/" title="Titanium Developer: love and hate (Part II)">Titanium Developer: love and hate (Part II)</a> (0)</li><li>June 14, 2011 -- <a href="http://dev.enekoalonso.com/2011/06/14/titanium-studio-and-titanium-mobile-1-7/" title="Titanium Studio and Titanium Mobile 1.7">Titanium Studio and Titanium Mobile 1.7</a> (0)</li><li>August 3, 2010 -- <a href="http://dev.enekoalonso.com/2010/08/03/iphone-sdk-old-versions/" title="List of iPhone SDK &#038; XCode packages">List of iPhone SDK &#038; XCode packages</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://dev.enekoalonso.com/2010/07/30/titanium-developer-love-and-hate/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Playing with WebSockets</title>
		<link>http://dev.enekoalonso.com/2010/05/03/playing-with-websockets/</link>
		<comments>http://dev.enekoalonso.com/2010/05/03/playing-with-websockets/#comments</comments>
		<pubDate>Tue, 04 May 2010 04:20:37 +0000</pubDate>
		<dc:creator>Eneko Alonso</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[connection]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[socket]]></category>
		<category><![CDATA[studio]]></category>
		<category><![CDATA[tpc]]></category>
		<category><![CDATA[visual]]></category>
		<category><![CDATA[websocket]]></category>
		<category><![CDATA[websockets]]></category>

		<guid isPermaLink="false">http://dev.enekoalonso.com/?p=521</guid>
		<description><![CDATA[Today I spent some time with Tim at work, playing with WebSockets, a new HTML5 feature that only Google Chrome supports so far. WebSockets allow browsers to create and maintain open direct TCP connections to the server, allowing instant communication in both directions. This means that ajax polling is no longer needed to get updates [...]]]></description>
			<content:encoded><![CDATA[<p>Today I spent some time with Tim at work, playing with <a href="http://en.wikipedia.org/wiki/Web_Sockets">WebSockets</a>, a new <a href="http://dev.w3.org/html5/websockets/">HTML5 feature</a> that only Google Chrome supports so far. WebSockets allow browsers to create and maintain open direct TCP connections to the server, allowing instant communication in both directions. This means that ajax polling is no longer needed to get updates from the server. Instead, the server can send a message directly to the browser at any point in time while the connection is open. Awesome!</p>
<p style="text-align: left;">Since we are currently working on a C# .Net project, we searched Internet and found this very cool example that we took as a base for a little multiuser game we were working on today: <a href="http://www.codeproject.com/KB/webservices/c_sharp_web_socket_server.aspx">WebSocket Chat</a></p>
<p style="text-align: left;"><a href="http://www.codeproject.com/KB/webservices/c_sharp_web_socket_server.aspx"></a><br />
<a href="http://www.codeproject.com/KB/webservices/c_sharp_web_socket_server.aspx"><img class="aligncenter" src="http://www.codeproject.com/KB/webservices/c_sharp_web_socket_server/WebSocketServer.png" alt="" /></a></p>
<p>The potential of WebSockets is incredible, specially for online games and multiuser applications.</p>
<h3  class="related_post_title">Related Posts:</h3><ul class="related_post"><li>May 22, 2010 -- <a href="http://dev.enekoalonso.com/2010/05/22/more-websockets-now-with-python/" title="More WebSockets, now with Python!">More WebSockets, now with Python!</a> (9)</li><li>May 12, 2011 -- <a href="http://dev.enekoalonso.com/2011/05/12/angry-birds-as-a-web-app/" title="Angry Birds as a Web App">Angry Birds as a Web App</a> (0)</li><li>June 8, 2010 -- <a href="http://dev.enekoalonso.com/2010/06/08/change-in-websockets-handshake-protocol/" title="Change in WebSockets handshake protocol">Change in WebSockets handshake protocol</a> (0)</li><li>May 6, 2010 -- <a href="http://dev.enekoalonso.com/2010/05/06/tech-talks-at-level-studios/" title="Tech talks at LEVEL Studios">Tech talks at LEVEL Studios</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://dev.enekoalonso.com/2010/05/03/playing-with-websockets/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Having fun with Mooml &amp; Twitter</title>
		<link>http://dev.enekoalonso.com/2010/02/19/having-fun-with-mooml-and-twitter/</link>
		<comments>http://dev.enekoalonso.com/2010/02/19/having-fun-with-mooml-and-twitter/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 20:43:54 +0000</pubDate>
		<dc:creator>Eneko Alonso</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[jsonp]]></category>
		<category><![CDATA[mooml]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[sample]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://dev.enekoalonso.com/?p=472</guid>
		<description><![CDATA[Mooml is a templating engine for Mootools. With it, you can create HTML from Javascript using a very clean syntax. Plus, it is extremely useful when you have to generate repeating elements, since Mooml automatically renders arrays of data multiple times. Let&#8217;s see an example. Searching Twitter Nowadays there are a lot of APIs out [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mootools.net/plugins/p/mooml">Mooml</a> is a templating engine for Mootools. With it, you can create HTML from Javascript using a very clean syntax. Plus, it is extremely useful when you have to generate repeating elements, since Mooml automatically renders arrays of data multiple times. Let&#8217;s see an example.</p>
<h3>Searching Twitter</h3>
<p>Nowadays there are a lot of APIs out there that support JSON or JSONP, which we can use directly from the front end using Javascript. Also, there are other APIs that return tons of JS data, like Google Maps. In this example we are going to be searching Twitter and displaying the search results in a container div, properly rendered as HTML.</p>
<p>The url for searching Twitter is <a href="http://search.twitter.com/search.json?q=mootools&#038;show_user=true">http://search.twitter.com/search.json?q=mootools&#038;show_user=true</a> (searching for Mootools in this case). Check the output:</p>
<div class="geshi no javascript">
<ol>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="st0">&quot;results&quot;</span>:<span class="br0">&#91;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="st0">&quot;profile_image_url&quot;</span>:<span class="st0">&quot;http://a3.twimg.com/profile_images/547672997/twitterProfilePhoto_normal.jpg&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="st0">&quot;created_at&quot;</span>:<span class="st0">&quot;Fri, 19 Feb 2010 17:08:55 +0000&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="st0">&quot;from_user&quot;</span>:<span class="st0">&quot;digitalr3bel&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="st0">&quot;to_user_id&quot;</span>:<span class="nu0">1212494</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="st0">&quot;text&quot;</span>:<span class="st0">&quot;@davidwalshblog Hi David &#8211; im a big fan of your site! Can you recommend a good MooTools tutorial for someone who can already program? thx&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="st0">&quot;id&quot;</span>:<span class="nu0">9343656026</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="st0">&quot;from_user_id&quot;</span>:<span class="nu0">23704390</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="st0">&quot;to_user&quot;</span>:<span class="st0">&quot;davidwalshblog&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="st0">&quot;geo&quot;</span>:<span class="kw2">null</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="st0">&quot;iso_language_code&quot;</span>:<span class="st0">&quot;en&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="st0">&quot;source&quot;</span>:<span class="st0">&quot;&lt;a href=&quot;</span>http:<span class="co1">//apiwiki.twitter.com/&quot; rel=&quot;nofollow&quot;&gt;API&lt;/a&gt;&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">// More results here&#8230;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="br0">&#93;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="st0">&quot;max_id&quot;</span>:<span class="nu0">9343656026</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="st0">&quot;since_id&quot;</span>:<span class="nu0">0</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="st0">&quot;refresh_url&quot;</span>:<span class="st0">&quot;?since_id=9343656026&amp;q=mootools&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="st0">&quot;next_page&quot;</span>:<span class="st0">&quot;?page=2&amp;max_id=9343656026&amp;q=mootools&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="st0">&quot;results_per_page&quot;</span>:<span class="nu0">15</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="st0">&quot;page&quot;</span>:<span class="nu0">1</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="st0">&quot;completed_in&quot;</span>:<span class="nu0">0.0352710000000001</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="st0">&quot;query&quot;</span>:<span class="st0">&quot;mootools&quot;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>We want to render each result inside out container div. On this example, we will just render the user name, user image and message text. Here is our Mooml template:</p>
<div class="geshi no javascript">
<ol>
<li class="li1">
<div class="de1">Mooml.<span class="me1">register</span><span class="br0">&#40;</span><span class="st0">&#39;twitter-search-result&#39;</span>, <span class="kw2">function</span><span class="br0">&#40;</span>entry<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; div<span class="br0">&#40;</span><span class="br0">&#123;</span>id: <span class="st0">&quot;tweet-&quot;</span> + entry.<span class="me1">id</span><span class="br0">&#125;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; img<span class="br0">&#40;</span><span class="br0">&#123;</span>src: entry.<span class="me1">profile_image_url</span>, alt: entry.<span class="me1">from_user</span><span class="br0">&#125;</span><span class="br0">&#41;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; span<span class="br0">&#40;</span>entry.<span class="me1">from_user</span><span class="br0">&#41;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; p<span class="br0">&#40;</span>entry.<span class="me1">text</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
<p>Since all results are returned into an array, we can pass it directly to Mooml which will render all of the elements in it:</p>
<div class="geshi no javascript">
<ol>
<li class="li1">
<div class="de1"><span class="co1">// Data is the JSON response from Twitter</span></div>
</li>
<li class="li1">
<div class="de1">Mooml.<span class="me1">render</span><span class="br0">&#40;</span><span class="st0">&#39;twitter-search-result&#39;</span>, data.<span class="me1">results</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
<p>So, let&#8217;s do a live test. Type something you want to search for and hit the search button to see Mooml in action :)<br />

<p>Search: <input type="text" id="twitter-mooml-search" value="mootools" /> <input type="button" value="search" id="twitter-mooml-search-btn"/></p>
<div id="mooml-twitter-demo" style="width:400px;border:solid 1px #444;font-size:11px;font-face:Arial,Helvetica;margin:0 auto;"></div>

<script type="text/javascript" src="http://enekoalonso.com/lib/mootools-1.2.4-core-nc.js"></script>
<script type="text/javascript" src="http://enekoalonso.com/lib/mooml.js"></script>
<script type="text/javascript">
Mooml.register('twitter-search-result', function(entry) {
  div({id: "tweet-" + entry.id},
    img({src: entry.profile_image_url, alt: entry.from_user}),
    span(entry.from_user),
    p(entry.text)
  );
});

function searchTwitter() {
  new Element('script', {type:'text/javascript', src:'http://search.twitter.com/search.json?q={text}&show_user=true&callback=renderData'.substitute({text:$('twitter-mooml-search').get('value')})}).inject(document.head);
}
function renderData(data) {
  $('mooml-twitter-demo').empty().adopt(Mooml.render('twitter-search-result', data.results));
}
$('twitter-mooml-search-btn').addEvent('click', searchTwitter);
searchTwitter();
</script>
</p>
<p>How cool is that?</p>
<h3>The code</h3>
<p>Ok, so here is the whole code I have used in this post for this mini-demo:</p>
<div class="geshi no javascript">
<ol>
<li class="li1">
<div class="de1"><span class="sy0">&lt;</span>script type=<span class="st0">&quot;text/javascript&quot;</span> src=<span class="st0">&quot;http://enekoalonso.com/lib/mootools-1.2.4-core-nc.js&quot;</span><span class="sy0">&gt;&lt;/</span>script<span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">&lt;</span>script type=<span class="st0">&quot;text/javascript&quot;</span> src=<span class="st0">&quot;http://enekoalonso.com/lib/mooml.js&quot;</span><span class="sy0">&gt;&lt;/</span>script<span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">&lt;</span>script type=<span class="st0">&quot;text/javascript&quot;</span><span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1">Mooml.<span class="me1">register</span><span class="br0">&#40;</span><span class="st0">&#39;twitter-search-result&#39;</span>, <span class="kw2">function</span><span class="br0">&#40;</span>entry<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; div<span class="br0">&#40;</span><span class="br0">&#123;</span>id: <span class="st0">&quot;tweet-&quot;</span> + entry.<span class="me1">id</span><span class="br0">&#125;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; img<span class="br0">&#40;</span><span class="br0">&#123;</span>src: entry.<span class="me1">profile_image_url</span>, alt: entry.<span class="me1">from_user</span><span class="br0">&#125;</span><span class="br0">&#41;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; span<span class="br0">&#40;</span>entry.<span class="me1">from_user</span><span class="br0">&#41;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; p<span class="br0">&#40;</span>entry.<span class="me1">text</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">function</span> searchTwitter<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw2">new</span> Element<span class="br0">&#40;</span><span class="st0">&#39;script&#39;</span>, <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; type:<span class="st0">&#39;text/javascript&#39;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; src:<span class="st0">&#39;http://search.twitter.com/search.json?q={text}&amp;show_user=true&amp;callback=renderData&#39;</span>.<span class="me1">substitute</span><span class="br0">&#40;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; text:$<span class="br0">&#40;</span><span class="st0">&#39;twitter-mooml-search&#39;</span><span class="br0">&#41;</span>.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">&#39;value&#39;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>.<span class="me1">inject</span><span class="br0">&#40;</span>document.<span class="me1">head</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">function</span> renderData<span class="br0">&#40;</span>data<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; $<span class="br0">&#40;</span><span class="st0">&#39;mooml-twitter-demo&#39;</span><span class="br0">&#41;</span>.<span class="me1">empty</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">adopt</span><span class="br0">&#40;</span>Mooml.<span class="me1">render</span><span class="br0">&#40;</span><span class="st0">&#39;twitter-search-result&#39;</span>, data.<span class="me1">results</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">$<span class="br0">&#40;</span><span class="st0">&#39;twitter-mooml-search-btn&#39;</span><span class="br0">&#41;</span>.<span class="me1">addEvent</span><span class="br0">&#40;</span><span class="st0">&#39;click&#39;</span>, searchTwitter<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">searchTwitter<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
<p>As you can see, the code is very basic and so is the Mooml template. The coolest thing here is that you don&#8217;t need to iterate over the results to render each element.</p>
<p>Have fun!</p>
<h3  class="related_post_title">Related Posts:</h3><ul class="related_post"><li>April 28, 2010 -- <a href="http://dev.enekoalonso.com/2010/04/28/mooml-1-2-3-bye-bye-with/" title="Mooml 1.2.3 &#8211; Bye, bye, with()">Mooml 1.2.3 &#8211; Bye, bye, with()</a> (3)</li><li>March 24, 2010 -- <a href="http://dev.enekoalonso.com/2010/03/24/mooml-1-1-no-more-eval-say-hi-to-mooml-template-and-mooml-templates/" title="Mooml 1.1 &#8211; No more eval(), say Hi to Mooml.Template and Mooml.Templates">Mooml 1.1 &#8211; No more eval(), say Hi to Mooml.Template and Mooml.Templates</a> (0)</li><li>March 15, 2010 -- <a href="http://dev.enekoalonso.com/2010/03/15/more-updates-to-mooml-coming-soon/" title="More updates to Mooml coming soon">More updates to Mooml coming soon</a> (0)</li><li>February 1, 2010 -- <a href="http://dev.enekoalonso.com/2010/02/01/mooml-globalize-mooml-template-functions-going-global/" title="Mooml.globalize(): Mooml template functions going global">Mooml.globalize(): Mooml template functions going global</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://dev.enekoalonso.com/2010/02/19/having-fun-with-mooml-and-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MyGameOfLife source code</title>
		<link>http://dev.enekoalonso.com/2008/11/28/mygameoflife-source-code/</link>
		<comments>http://dev.enekoalonso.com/2008/11/28/mygameoflife-source-code/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 06:11:25 +0000</pubDate>
		<dc:creator>Eneko Alonso</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[conway]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[gameoflife]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[googlecode]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://dev.enekoalonso.com/?p=40</guid>
		<description><![CDATA[Almost a year ago I was learning some Cocoa and I decided it will be fun to implement a Cocoa based version of Conway&#8217;s Game of Life. Back then I didn&#8217;t publish the source code, not for any special reason. So now I have just uploaded it to Google Code. It&#8217;s not fully functional, since [...]]]></description>
			<content:encoded><![CDATA[<p>Almost a year ago I was learning some Cocoa and I decided it will be fun to implement a Cocoa based version of <a href="http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life">Conway&#8217;s Game of Life</a>. Back then I didn&#8217;t publish the source code, not for any special reason. So now I have just uploaded it to Google Code. It&#8217;s not fully functional, since the last time I worked on it I was creating an structure editor. My idea was to create a library of structures, with drag&#038;drop and import/export options.</p>
<p>If you are interested on working on the project, let me know :)</p>
<p><a href="http://code.google.com/p/my-gameoflife">http://code.google.com/p/my-gameoflife</a></p>
<p><a href="http://www.flickr.com/photos/eneko/2142616139/" title="My Game of Life by Eneko Alonso, on Flickr"><img src="http://farm3.static.flickr.com/2104/2142616139_eed0282fca_o.png" width="500" height="359" alt="My Game of Life" /></a></p>
<h3  class="related_post_title">Related Posts:</h3><ul class="related_post"><li>August 18, 2010 -- <a href="http://dev.enekoalonso.com/2010/08/18/titanium-developer-love-and-hate-part-ii/" title="Titanium Developer: love and hate (Part II)">Titanium Developer: love and hate (Part II)</a> (0)</li><li>May 12, 2011 -- <a href="http://dev.enekoalonso.com/2011/05/12/angry-birds-as-a-web-app/" title="Angry Birds as a Web App">Angry Birds as a Web App</a> (0)</li><li>August 27, 2010 -- <a href="http://dev.enekoalonso.com/2010/08/27/link-whirlpool-js/" title="Link: Whirlpool JS">Link: Whirlpool JS</a> (0)</li><li>July 30, 2010 -- <a href="http://dev.enekoalonso.com/2010/07/30/creating-qr-codes-with-google-charts-api/" title="Creating QR Codes with Google Charts API">Creating QR Codes with Google Charts API</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://dev.enekoalonso.com/2008/11/28/mygameoflife-source-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

