<?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>Thu, 02 Sep 2010 13:56:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<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>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>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>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>December 29, 2008 -- <a href="http://dev.enekoalonso.com/2008/12/29/modifying-the-url-hash-without-affecting-the-browser-history/" title="Modifying the URL Hash without affecting the browser history">Modifying the URL Hash without affecting the browser history</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:July 30, 2010 -- Titanium Developer: love and hate (3)August 3, 2010 -- List of [...]]]></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>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>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> (0)</li><li>November 28, 2008 -- <a href="http://dev.enekoalonso.com/2008/11/28/mygameoflife-source-code/" title="MyGameOfLife source code">MyGameOfLife source code</a> (0)</li><li>July 26, 2009 -- <a href="http://dev.enekoalonso.com/2009/07/26/placing-a-uiactivityindicartorview-on-a-uibarbuttonitem/" title="Placing a UIActivityIndicartorView on a UIBarButtonItem">Placing a UIActivityIndicartorView on a UIBarButtonItem</a> (0)</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>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>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> (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>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></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> (1)</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><li>February 18, 2010 -- <a href="http://dev.enekoalonso.com/2010/02/18/google-fiber-in-san-luis-obispo-that-would-be-awesome/" title="Google Fiber in San Luis Obispo? That would be awesome!">Google Fiber in San Luis Obispo? That would be awesome!</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://dev.enekoalonso.com/2010/05/03/playing-with-websockets/feed/</wfw:commentRss>
		<slash:comments>2</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> (2)</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>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><li>May 3, 2010 -- <a href="http://dev.enekoalonso.com/2010/05/03/playing-with-websockets/" title="Playing with WebSockets">Playing with WebSockets</a> (2)</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>
