<?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>HCoder.org &#187; widget</title>
	<atom:link href="http://hcoder.org/tag/widget/feed/" rel="self" type="application/rss+xml" />
	<link>http://hcoder.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 09 Feb 2012 22:15:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Recent pet projects + Git + Github</title>
		<link>http://hcoder.org/2009/04/06/recent-pet-projects-git-github/</link>
		<comments>http://hcoder.org/2009/04/06/recent-pet-projects-git-github/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 22:21:00 +0000</pubDate>
		<dc:creator>emanchado</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[darcs]]></category>
		<category><![CDATA[demisus]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[kiva]]></category>
		<category><![CDATA[loanmeter]]></category>
		<category><![CDATA[opera]]></category>
		<category><![CDATA[sudoku]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I had mentioned that I was learning Javascript to write a Kiva Opera widget. Some time ago I released the first version of my World Loanmeter widget, and I have uploaded two more since. Not much has happened between the first and the third release from the user POV, but a couple of things were [...]]]></description>
			<content:encoded><![CDATA[<p>I had mentioned that I was <a href="http://hcoder.org/2009/02/26/kiva-api-javascript-git-and-my-first-widget-oh-my">learning Javascript to write a Kiva Opera widget</a>. Some time ago I released the first version of my <a href="http://widgets.opera.com/widget/12102/">World Loanmeter</a> widget, and I have uploaded two more since. Not much has happened between the first and the third release from the user <span class="caps">POV</span>, but a couple of things were interesting when developing it:</p>
<ul>
<li>I learned <a href="http://docs.jquery.com/QUnit">QUnit</a>, which I used to write <a href="http://github.com/emanchado/world-loanmeter/blob/31d34707728a1f7d5813a57de4d3b8caf10750ce/test/unittest.html">some really useful unit tests</a>. It&#8217;s quite nice to be able to write Javascript unit tests easily.</li>
<li>I made some <a href="http://github.com/emanchado/world-loanmeter/commit/425a4a854bc074c825b6f15546235958977da1d5">heavy refactoring</a> (see above) which made me learn some more Javascript <em>and</em> made the code much more flexible, so now the widget is not limited to a single Kiva <span class="caps">API</span> page of results, but to as many pages as needed to fetch whatever number of loans the user wants. Not to mention that the data source need not be a <span class="caps">URL</span>.</li>
<li>Now the widget actually has some configuration. Namely, the number of loans to show in the map. It also stores it persistently using the <a href="http://dev.opera.com/articles/view/opera-widgets-preference-store/">preference store</a>, which is quite nice.</li>
</ul>
<p>As I said, I used Git for it. I don&#8217;t &#8220;hate&#8221; it anymore, but I still find some things annoying, like the horrible, confusing names some options have (I&#8217;m thinking about &#8220;git checkout <file>&#8221; to revert the local changes, or &#8220;git diff &#8212;cached&#8221; to see the contents of the index/staging area; seriously guys, W-T-F?). I used to be skeptical about the &#8220;git add&#8221; for changes and then &#8220;git commit&#8221;, but I actually find it quite nice: it&#8217;s easier to plan a commit that way, and if you don&#8217;t want to plan it, you can always just &#8220;git commit <file>&#8221; directly. Also &#8220;git add -p&#8221; is really nice to commit just <em>parts</em> of a file (at last, someone copies some of the good stuff <a href="http://darcs.net/">Darcs</a> had had for ages!). Apart from Git itself, it&#8217;s cool that there is <a href="http://github.com">GitHub</a>, so it&#8217;s easy to share your repositories without having to <code>rsync</code> to some web server or similar&#8230; not to mention that your project is much more visible that way.</p>
<p>But the World Loanmeter wasn&#8217;t the only pet project I was working on these past weeks: I also wrote a simple sudoku solver, <a href="http://wiki.github.com/emanchado/demisus">demisus</a>, in Ruby. The reason? Writing a prototype of a sudoku solver in a language I&#8217;m fluent with, to play with the design and get something interesting and easy to maintain&#8230; to rewrite it in Haskell. I have been trying to learn some functional language for some years now, but I never find a &#8220;project&#8221; that is interesting enough to write some &#8220;real world program&#8221; in the language and I end up not learning anything. After starting reading <a href="http://book.realworldhaskell.org/">Real World Haskell</a>, I really felt like trying to learn the language once and for all, and I figured that a sudoku solver was easy enough to write, something I know enough about, and something math-y enough to be reasonably easy to implement in Haskell.</p>
<p>So, if you&#8217;re interested in any of them, you can have a look in Github and even contribute ;-)</p>
 <p><a href="http://hcoder.org/?flattrss_redirect&amp;id=65&amp;md5=e6722f7dfe9cd27244931593fc4215ed" title="Flattr" target="_blank"><img src="http://hcoder.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://hcoder.org/2009/04/06/recent-pet-projects-git-github/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="http://hcoder.org/?flattrss_redirect&amp;id=65&amp;md5=e6722f7dfe9cd27244931593fc4215ed" type="text/html" />
	</item>
		<item>
		<title>Kiva API, Javascript, Git and my first widget, oh my!</title>
		<link>http://hcoder.org/2009/02/26/kiva-api-javascript-git-and-my-first-widget-oh-my/</link>
		<comments>http://hcoder.org/2009/02/26/kiva-api-javascript-git-and-my-first-widget-oh-my/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 19:48:00 +0000</pubDate>
		<dc:creator>emanchado</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Freedom]]></category>
		<category><![CDATA[Other]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[kiva]]></category>
		<category><![CDATA[microloans]]></category>
		<category><![CDATA[opera]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[About two weeks ago I wrote about Kiva, a cool website that allows people to make microloans. Almost one month ago they had started a developer site, including an easy to use API to access the data (loans, borrowers, lenders, etc). I couldn&#8217;t resist the temptation to have a look at the documentation and start [...]]]></description>
			<content:encoded><![CDATA[<p>About two weeks ago I wrote about <a href="http://www.kiva.org">Kiva</a>, a cool website that allows people to make microloans. Almost one month ago they had started a <a href="http://build.kiva.org">developer site</a>, including an easy to use <span class="caps">API</span> to access the data (loans, borrowers, lenders, etc).</p>
<p>I couldn&#8217;t resist the temptation to have a look at the documentation and start thinking about some application to use it. Soon after I started reading I came up with the idea of writing an <a href="http://widgets.opera.com">Opera widget</a>. There were a couple of reasons for that:</p>
<ol>
<li>I had never written a widget, so it sounded like a good excuse to learn how to write them.</li>
<li>Widgets use Javascript, and that felt like a natural fit (as the <span class="caps">API</span> returns <a href="http://en.wikipedia.org/wiki/Json"><span class="caps">JSON</span></a>).</li>
<li>I didn&#8217;t really know that much Javascript (just enough to write a couple of event handlers), and that seemed a good opportunity to start learning the language &#8220;properly&#8221;.</li>
<li>A widget in <a href="http://widgets.opera.com">http://widgets.opera.com</a> had more possibilities of actually being used than a random pet project of mine lying in some obscure repository of some obscure version control system (well, actually I ended up using Git for it, so it&#8217;s not that obscure in some sense; but you get the point).</li>
</ol>
<p>So I started by learning a bit of Javascript. After asking around, the best thing I found to learn quickly was a very <a href="http://video.yahoo.com/watch/111593/1710507">good</a> <a href="http://video.yahoo.com/watch/111594/1710553">series</a> <a href="http://video.yahoo.com/watch/111595/1710607">of</a> <a href="http://video.yahoo.com/watch/111596/1710658">videos</a> by <a href="http://en.wikipedia.org/wiki/Douglas_Crockford">Douglas Crockford</a> hosted in Yahoo! Video.</p>
<p>Then, I had a look at the excellent articles in <a href="http://dev.opera.com">Dev Opera</a> about <a href="http://dev.opera.com/articles/view/creating-your-first-opera-widget/">creating widgets</a> and started creating one. As I had the idea of creating something that would show loans around the world, I started looking for <span class="caps">HTML</span> and Javascript for building maps, and found a very good article in <a href="http://www.alistapart.com/">A List Apart</a> about <a href="http://www.alistapart.com/articles/cssmaps">accessible maps</a>. The sad part is, once I understood how everything worked I destroyed the whole accessibility of the solution, but it was for a widget anyway (you have excellent support for <span class="caps">CSS</span> and Javascript in Opera, no need to have a fallback to show textual data in a widget) and my code ended up much much simpler and easier to maintain.</p>
<p>Finally, for Git, I had a look at the screencasts hosted in <a href="http://www.gitcasts.com/">GitCasts</a>. I already new some basic Git things, but I think I started to feel more comfortable with it after watching a couple of those videos. Still, too many references to the obscure objects and <span class="caps">SHA</span> names and whatever, but clear enough to understand your way around it.</p>
<p>In short, I have to say that creating the widget was easy enough, and it was lots of fun to write it. I had some frustrations debugging it, but things worked fairly well in general. When I finished it, I uploaded to widgets.opera.com and after a couple of days it was already approved and public for everyone.</p>
<p>So, if you want to give it a shot, just go to <a href="http://widgets.opera.com/author/zoso/">my widgets page</a> and download the <a href="http://widgets.opera.com/widget/12102/">World Loanmeter</a>! Enjoy it! :-D</p>
 <p><a href="http://hcoder.org/?flattrss_redirect&amp;id=59&amp;md5=4f11f8d8abce7359c919fed239667112" title="Flattr" target="_blank"><img src="http://hcoder.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://hcoder.org/2009/02/26/kiva-api-javascript-git-and-my-first-widget-oh-my/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<atom:link rel="payment" href="http://hcoder.org/?flattrss_redirect&amp;id=59&amp;md5=4f11f8d8abce7359c919fed239667112" type="text/html" />
	</item>
	</channel>
</rss>

