<?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; Ruby</title>
	<atom:link href="http://hcoder.org/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://hcoder.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 15 Apr 2012 21:43:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Goodbye Typo, Hello WordPress!</title>
		<link>http://hcoder.org/2010/01/24/goodbye-typo-hello-wordpress/</link>
		<comments>http://hcoder.org/2010/01/24/goodbye-typo-hello-wordpress/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 17:34:35 +0000</pubDate>
		<dc:creator>emanchado</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Meta]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[movable type]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://hcoder.org/?p=266</guid>
		<description><![CDATA[As I had mentioned several times, I had been frustrated with Typo. Several bugs or misfeatures that really annoyed me, upgrades that had frustrated me, and sometimes the feeling that more or less visible things were broken from time to time in new releases. And while the upgrade problems were mostly because of the need [...]]]></description>
			<content:encoded><![CDATA[<p>As I had mentioned several times, I had <a href="http://hcoder.org/2010/01/03/typo-upgrade-2/">been</a> <a href="http://hcoder.org/2009/02/23/another-typo-upgrade/">frustrated</a> <a href="http://hcoder.org/2008/08/19/sucky-typo-update/">with</a> <a href="http://hcoder.org/2008/08/07/typo-upgrade/">Typo</a>. Several bugs or misfeatures that really annoyed me, upgrades that had frustrated me, and sometimes the feeling that more or less visible things were broken from time to time in new releases. And while the upgrade problems were mostly because of the need to upgrade Ruby gems, still it was something that was inevitable with Typo apparently, so sticking with Typo meant having to deal with Rubygems, which as you may know <a href="http://hcoder.org/2008/11/23/why-i-hate-rubygems/">I hate</a>.</p>
<p>So, after the last upgrade and the frustrations that came with it, I decided to ask around for good blogging software. The main contenders I had in mind were <a href="http://wordpress.org/">WordPress</a> and <a href="http://movabletype.org/">Movable Type</a>. Most of the people who replied talked wonders about WordPress, but I decided to try both. WordPress&#8217; installation was ridiculously easy (I&#8217;m talking about installing my own copy, not opening a blog in wordpress.com obviously) and I had a working blog pretty quickly. Also, at least the first impression of the UI is that it&#8217;s very slick and easy to use. It shows maturity. Movable Type was easy enough to install, although I did have some problems (mostly due to my own stupidity, but still). The first impression was that Movable Type was much &#8220;heavier&#8221; and maybe a bit too much for a single, personal blog. So I decided to go for WordPress, which was the one that I had been recommended by most people anyway.</p>
<p>So, the first thing I had to do was exporting the content from Typo&#8217;s HCoder so I could import into WordPress. I quickly found some <a href="http://snippets.dzone.com/posts/show/3264">script for Typo that would export in WordPress&#8217; format</a>, for easy import. It worked very well, although I did a problem with the tags: they were treated as normal categories, so I ended up with <strong>many</strong> categories and no tags (and a huge, horrible, impossible to navigate sidebar with dozens of categories). I started to look around, and I couldn&#8217;t find a spec for the <em>wxr</em> format. Maybe I was naive thinking that there would be one, but hey. In any case, eventually I figured out that I had to change the:</p>
<pre>&lt;category&gt;rants&lt;/category&gt;</pre>
<p>to</p>
<pre>&lt;category domain="tag"&gt;rants&lt;/category&gt;</pre>
<p>for the tags. The categories had to stay as they were, but luckily for me, all uppercase names were categories, and all lowercase names were tags, so I could do the trick with vim with:</p>
<pre>:%s/&lt;category&gt;\([a-z]\)/&lt;category domain="tag"&gt;\1/</pre>
<p>After that, I could import back all the content, but then I had the next hurdle: the style of the blog. I didn&#8217;t mind if the design wasn&#8217;t exactly the same, but I was used to the old one and didn&#8217;t want to change it too much, so I used the excellent <a href="http://www.opera.com/dragonfly/">Opera Dragonfly</a> to inspect the styles of the old blog, and I slowly copied the most interesting values (colours and font sizes mostly) to the equivalent CSS classes in the WordPress theme. I&#8217;m happy with the result, so I think I&#8217;ll leave it as it is for now.</p>
<p>Last, but not least, I wanted to try to keep the old URLs working. I did two things for this:</p>
<ol>
<li>I added some URL rewrites to keep Typo&#8217;s feed URLs working. However, the Atom ones also redirect to the RSS ones, I wonder if that&#8217;ll be a problem.</li>
<li>I changed the default permalink settings in WordPress so they matched what I had in Typo. Hopefully almost all blog posts will actually keep the URL and the migration to WordPress won&#8217;t be very traumatic. You tell me if I&#8217;ve broken anything ;-)</li>
</ol>
<p>One thing that I don&#8217;t like about WordPress&#8217; blog editor is that apparently it doesn&#8217;t allow you to write in some Wiki-like syntax, like <a href="http://daringfireball.net/projects/markdown/syntax">Markdown</a> or <a href="http://www.textism.com/tools/textile/">Textile</a>. I know Movable Type does have it, but several other things made me stick with WordPress and I&#8217;m happy overall. At least for now ;-)</p>
 <p><a href="http://hcoder.org/?flattrss_redirect&amp;id=266&amp;md5=3b44a41370a570e3adff54e8c2f83ee1" 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/2010/01/24/goodbye-typo-hello-wordpress/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=30124&amp;popout=1&amp;url=http%3A%2F%2Fhcoder.org%2F2010%2F01%2F24%2Fgoodbye-typo-hello-wordpress%2F&amp;language=en_GB&amp;category=text&amp;title=Goodbye+Typo%2C+Hello+WordPress%21&amp;description=As+I+had+mentioned+several+times%2C+I+had+been+frustrated+with+Typo.+Several+bugs+or+misfeatures+that+really+annoyed+me%2C+upgrades+that+had+frustrated+me%2C+and+sometimes+the+feeling+that...&amp;tags=movable+type%2Crants%2Cupgrade%2Cwordpress%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Typo upgrade</title>
		<link>http://hcoder.org/2010/01/03/typo-upgrade-2/</link>
		<comments>http://hcoder.org/2010/01/03/typo-upgrade-2/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 20:29:00 +0000</pubDate>
		<dc:creator>emanchado</dc:creator>
				<category><![CDATA[Meta]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I have upgraded to Typo 5.4.1. Partly because of security issues, partly because of new features and improvements. It took me a while, mostly because of stupid Ruby deployment nonsense that makes me even more tired of Ruby as a language for production usage, than I already was. Oh well. One of the most important [...]]]></description>
			<content:encoded><![CDATA[<p>
	I have upgraded to Typo 5.4.1. Partly because of security issues, partly because of new features and improvements.</p>
<p>
	It took me a while, mostly because of stupid Ruby deployment nonsense that makes me even more tired of Ruby as a language for production usage, than I already was. Oh well.</p>
<p>
	One of the most important new features for me in this release was the article preview, which doesn&#39;t seem to work. Or maybe it does, but then support for writing blog posts in Textile seems like it was dropped. Suggestions for other blogging platforms that aren&#39;t a pain to upgrade because of the language dependencies, supports writing in some wiki-like syntax (e.g. Textile or Markdown) and generally works well are <em>very</em> welcome.</p>
<p>
	It seems that everything is in place and working now, but if you see anything misbehaving, please give me a shout and I&#39;ll try to fix.</p>
 <p><a href="http://hcoder.org/?flattrss_redirect&amp;id=82&amp;md5=8273c1f4c688163cc8faace0e614b85c" 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/2010/01/03/typo-upgrade-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=30124&amp;popout=1&amp;url=http%3A%2F%2Fhcoder.org%2F2010%2F01%2F03%2Ftypo-upgrade-2%2F&amp;language=en_GB&amp;category=text&amp;title=Typo+upgrade&amp;description=I+have+upgraded+to+Typo+5.4.1.+Partly+because+of+security+issues%2C+partly+because+of+new+features+and+improvements.+It+took+me+a+while%2C+mostly+because+of+stupid+Ruby+deployment+nonsense...&amp;tags=rants%2CRuby%2Cupgrade%2Cblog" type="text/html" />
	</item>
		<item>
		<title>The ultimate TODO app redux</title>
		<link>http://hcoder.org/2009/06/29/the-ultimate-todo-app-redux/</link>
		<comments>http://hcoder.org/2009/06/29/the-ultimate-todo-app-redux/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 19:59:00 +0000</pubDate>
		<dc:creator>emanchado</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Freedom]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[bitbucket]]></category>
		<category><![CDATA[bubug]]></category>
		<category><![CDATA[hg]]></category>
		<category><![CDATA[merb]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[todo]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[When writing yesterday about the Perl modules, I realised that I hadn&#8217;t written anything about the TODO application since &#8220;The ultimate TODO app&#8221;. Well, a lot has happened to it actually. I&#8217;m glad to announce that: It does have a (lame) name now: Bubug (supposedly stands for &#8220;Barely Unconventional Bug Untracking Gizmo&#8221;. Whatever). It has [...]]]></description>
			<content:encoded><![CDATA[<p>When writing yesterday about the Perl modules, I realised that I hadn&#8217;t written anything about the <span class="caps">TODO</span> application since &#8220;<a href="http://hcoder.org/2009/02/09/the-ultimate-todo-app">The ultimate <span class="caps">TODO</span> app</a>&#8221;. Well, a <em>lot</em> has happened to it actually. I&#8217;m glad to announce that:</p>
<ul>
<li>It does have a (lame) name now: <a href="http://bitbucket.org/emanchado/bubug/wiki/Home">Bubug</a> (supposedly stands for &#8220;Barely Unconventional Bug Untracking Gizmo&#8221;. Whatever).</li>
<li>It has improved a lot here and there, and it now has authentication and multi-user support, not to mention a lot of UI bling bling and goodies.</li>
<li>The development has moved to <a href="http://bitbucket.org/">BitBucket</a>, an excellent free service built by ex-Opera&#8217;s <a href="http://noehr.org/">Jesper Noehr</a>, where you can follow it more easily, comment on, check the Wiki, fork, or whatever you want. You even have a screenshot there ;-)</li>
</ul>
<p>As you can guess from the last point, for this project I&#8217;ve been using Mercurial instead of Git. Although I certainly don&#8217;t have sophisticated needs, so <span class="caps">YMMV</span> (heavily), I find Git more pleasant to use. Which is kind of surprising, because I always thought that Git&#8217;s UI was a pain in the ass. Oh, well. That doesn&#8217;t mean that Mercurial is hard to use, though. I think it&#8217;s more that I&#8217;m used to Git now, and there are a couple of things that I find more convenient: the coloured diff (possible in Hg, but you have to install some extension for it, and only thinking about installing some Python extension that is not even packaged for Debian makes me want to switch to Git) and the staging area are the most important ones I can think of.</p>
<p>So, if you thought I had abandoned the <span class="caps">TODO</span> application thing, you were wrong ;-) If you&#8217;re interested, have a look at the <a href="http://bitbucket.org/emanchado/bubug/wiki/Home">Bubug BitBucket project page</a>, download it, play with it, and tell me what you think.</p>
 <p><a href="http://hcoder.org/?flattrss_redirect&amp;id=71&amp;md5=14fbafa3aa6d871e89681cc8b0ba5c25" 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/06/29/the-ultimate-todo-app-redux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=30124&amp;popout=1&amp;url=http%3A%2F%2Fhcoder.org%2F2009%2F06%2F29%2Fthe-ultimate-todo-app-redux%2F&amp;language=en_GB&amp;category=text&amp;title=The+ultimate+TODO+app+redux&amp;description=When+writing+yesterday+about+the+Perl+modules%2C+I+realised+that+I+hadn%26%238217%3Bt+written+anything+about+the+TODO+application+since+%26%238220%3BThe+ultimate+TODO+app%26%238221%3B.+Well%2C+a+lot+has+happened+to+it...&amp;tags=bitbucket%2Cbubug%2Chg%2Cmerb%2Cmercurial%2Cprojects%2Ctodo%2Cblog" type="text/html" />
	</item>
		<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="https://flattr.com/submit/auto?user_id=30124&amp;popout=1&amp;url=http%3A%2F%2Fhcoder.org%2F2009%2F04%2F06%2Frecent-pet-projects-git-github%2F&amp;language=en_GB&amp;category=text&amp;title=Recent+pet+projects+%2B+Git+%2B+Github&amp;description=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%2C+and+I+have...&amp;tags=darcs%2Cdemisus%2Cgit%2Cgithub%2Chaskell%2Cjavascript%2Ckiva%2Cloanmeter%2Copera%2CRuby%2Csudoku%2Cwidget%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Another Typo upgrade</title>
		<link>http://hcoder.org/2009/02/23/another-typo-upgrade/</link>
		<comments>http://hcoder.org/2009/02/23/another-typo-upgrade/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 19:06:00 +0000</pubDate>
		<dc:creator>emanchado</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Meta]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[5.2]]></category>
		<category><![CDATA[issues]]></category>
		<category><![CDATA[rubygems]]></category>
		<category><![CDATA[typo]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I just upgraded the blog to Typo 5.2. I had a couple of issues, but things worked reasonably ok. Just in case this helps anyone, these are the issues I ran into: I had to install a ridiculous amount of dependencies, sometimes to go from version 1.1.1 to 1.1.3 of some module. I really wonder [...]]]></description>
			<content:encoded><![CDATA[<p>I just upgraded the blog to Typo 5.2. I had a couple of issues, but things worked reasonably ok. Just in case this helps anyone, these are the issues I ran into:</p>
<ul>
<li>I had to install a <strong>ridiculous</strong> amount of dependencies, sometimes to go from version 1.1.1 to 1.1.3 of some module. I really wonder if Typo 5.2 really needs those versions.</li>
<li>When trying to upgrade, it seemed to hang in this line: <code>Backing up to /var/www/virtual/hcoder.org/db/backup/backup-20090223-1843.yml</code>. It turns out, it didn&#8217;t really hang, it just takes a good while (and yeah, the file stays at 0 bytes for a long time too)</li>
<li>I had some permission issues that I had to fix (when upgrading, it tried to modify/copy some files, and it couldn&#8217;t)</li>
<li>When applying the migrations, it died with a really strange error message. It turns out, my version of Rubygems was too old ????</li>
</ul>
<p>While writing this first post, I see some improvements in the admin interface, although I still can&#8217;t see any kind of &#8220;preview&#8221;. I hope it helps me with my struggle with spam, at least :-/</p>
 <p><a href="http://hcoder.org/?flattrss_redirect&amp;id=58&amp;md5=817baa09ce76cc88fae3730ab49d2e01" 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/23/another-typo-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=30124&amp;popout=1&amp;url=http%3A%2F%2Fhcoder.org%2F2009%2F02%2F23%2Fanother-typo-upgrade%2F&amp;language=en_GB&amp;category=text&amp;title=Another+Typo+upgrade&amp;description=I+just+upgraded+the+blog+to+Typo+5.2.+I+had+a+couple+of+issues%2C+but+things+worked+reasonably+ok.+Just+in+case+this+helps+anyone%2C+these+are+the+issues+I...&amp;tags=5.2%2Cissues%2Crubygems%2Ctypo%2Cupgrade%2Cblog" type="text/html" />
	</item>
		<item>
		<title>The ultimate TODO app</title>
		<link>http://hcoder.org/2009/02/09/the-ultimate-todo-app/</link>
		<comments>http://hcoder.org/2009/02/09/the-ultimate-todo-app/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 20:05:00 +0000</pubDate>
		<dc:creator>emanchado</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[merb]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[todo]]></category>
		<category><![CDATA[webapp]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I have been quite frustrated by TODO applications for some months now. They&#8217;re usually either too simple, or almost too complex and without features that I think are really valuable. In particular, there are two things that I don&#8217;t remember having seen in any TODO application: Possibility to &#8220;postpone&#8221; a task, so it doesn&#8217;t appear [...]]]></description>
			<content:encoded><![CDATA[<p>I have been quite frustrated by <span class="caps">TODO</span> applications for some months now. They&#8217;re usually either too simple, or almost too complex <em>and</em> without features that I think are really valuable. In particular, there are two things that I don&#8217;t remember having seen in any <span class="caps">TODO</span> application:</p>
<ol>
<li>Possibility to &#8220;postpone&#8221; a task, so it doesn&#8217;t appear in the main view for a defined time.</li>
<li>Possibility to associate a task to a &#8220;person to nag&#8221;.</li>
</ol>
<p>When you have a lot of small tasks to do, and they are not the kind of things you put in a <span class="caps">BTS</span> (say, stuff that you have to do that is not really connected to some project&#8217;s code) I think these two features are really useful, and I was surprised that no applications I saw seemed to have those. I mean, don&#8217;t people have the same problems as me?</p>
<p>That&#8217;s why, as I <a href="http://hcoder.org/2008/12/14/playing-around-with-jquery">had mentioned</a>, I started writing my own <span class="caps">TODO</span> application: I&#8217;d have what I wanted, and I&#8217;d learn a thing or two about <a href="http://www.merbivore.com/">Merb</a>, <a href="http://datamapper.org/">DataMapper</a> and <a href="http://jquery.com/">jQuery</a>. The application has several design limitations that I used to simplify things, like not having any notion of users (single user app without authentication) or supporting only a &#8220;title&#8221; for the tasks, without any longer description. It isn&#8217;t something I really plan to publish for other people to use (I mean, <a href="http://www.demiurgo.org/darcs/bubug/">the code</a> is in my <a href="http://www.demiurgo.org/darcs/">Darcs repo</a>, I&#8217;m just not going to make a project page for it or anything like that), so I don&#8217;t really care how much it fits other people&#8217;s needs :-)</p>
<p>As it is a pet project and I didn&#8217;t really mind how long it would take to finish it, I started by making some mockup of the application in <span class="caps">HTML</span> (+ a bit of Javascript with jQuery), and once I was happy, I started with the actual design and code. I think some parts of the code are nice, and it has some Ajax sweetness, but I admit I haven&#8217;t used it yet for myself: only as a kind of underpowered <span class="caps">BTS</span> for the application. Maybe I&#8217;ll upload some screenshot some day. In the meantime, feel free to download and try it out ;-)</p>
 <p><a href="http://hcoder.org/?flattrss_redirect&amp;id=57&amp;md5=8e78854115609b979b2b70f2688a08b2" 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/09/the-ultimate-todo-app/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=30124&amp;popout=1&amp;url=http%3A%2F%2Fhcoder.org%2F2009%2F02%2F09%2Fthe-ultimate-todo-app%2F&amp;language=en_GB&amp;category=text&amp;title=The+ultimate+TODO+app&amp;description=I+have+been+quite+frustrated+by+TODO+applications+for+some+months+now.+They%26%238217%3Bre+usually+either+too+simple%2C+or+almost+too+complex+and+without+features+that+I+think+are+really+valuable....&amp;tags=merb%2Cprojects%2CRuby%2Ctodo%2Cwebapp%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Playing around with jQuery</title>
		<link>http://hcoder.org/2008/12/14/playing-around-with-jquery/</link>
		<comments>http://hcoder.org/2008/12/14/playing-around-with-jquery/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 11:27:00 +0000</pubDate>
		<dc:creator>emanchado</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[datamapper]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[merb]]></category>
		<category><![CDATA[pet]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[todo]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[A couple of weeks ago I started a new pet project. Namely, making the ultimate todo list application. The idea was to: Make a TODO application that I actually like (I&#8217;ll post about it some other day). Learn Merb and DataMapper&#8230; and jQuery. The experience have been roughly half frustrating, half rewarding. It&#8217;s fun learning [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of weeks ago I started a new pet project. Namely, making the ultimate todo list application. The idea was to:</p>
<ul>
<li>Make a <span class="caps">TODO</span> application that I actually like (I&#8217;ll post about it some other day).</li>
<li>Learn <a href="http://merbivore.com/">Merb</a> and <a href="http://datamapper.org/">DataMapper</a>&#8230; and <a href="http://jquery.com/">jQuery</a>.</li>
</ul>
<p>The experience have been roughly half frustrating, half rewarding. It&#8217;s fun learning new things, but the documentation for both Merb and DataMapper sucks big time so sometimes I spend much more time than I would like figuring out how to make things work. Don&#8217;t get me wrong, the <strong>reference</strong> documentation looks very complete&#8230; but there&#8217;s no single source of consistent documentation to <strong>learn</strong> how things are done. And that&#8217;s painful. Moreover, apparenly the <span class="caps">API</span> has changed several times (at least before 1.0.0, but it hasn&#8217;t been that long since), so a lot of recipes or solutions you find on the internet are simply not valid anymore, which just adds up to the confusion and frustration.</p>
<p>Anyway. The client-side piece of the puzzle, jQuery, has proven to be a very handy, clean, easy-to-use-even-for-non-Javascript-wizards, natural way of writing Javascript. I admit I&#8217;m a kind of Javascript-phobe, as I don&#8217;t really know more than the basics and never has had the need or inclination to actually learn the language (yeah, my bad, but whatever). And yet, I really like jQuery, so there has to be something there. My favourite feature is the <a href="http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery#Find_me:_Using_selectors_and_events">selectors</a>: they&#8217;re a very clean way to access elements in a page, and add event handlers or otherwise manipulate them. Also the <a href="http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery#Rate_me:_Using_Ajax">jQuery Ajax features</a> feel really natural and comfortable to use.</p>
<p>The only problem I have had was using the <a href="http://docs.jquery.com/UI/Autocomplete">autocomplete</a> jQuery UI feature. I read the documentation, downloaded the appropriate bits from the jQuery website, included everything in my application, but it just wouldn&#8217;t work. After a lot of trial and error (and more frustration), I finally could make it work&#8230; using the Javascript files from the <a href="http://dev.jquery.com/view/trunk/plugins/autocomplete/demo/">demo page</a> (<a href="http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.js">js</a>, <a href="http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.css">css</a>) instead of the latest version from the jQuery download page. I think the problem is that the <span class="caps">API</span> has changed (the <span class="caps">API</span> apparently documents the older version that they use in the demo page), but I couldn&#8217;t figure it out reading the source code, so I just used the older, known-to-work version.</p>
 <p><a href="http://hcoder.org/?flattrss_redirect&amp;id=52&amp;md5=e4a781bc03fbe4e7c7669356fa18dab8" 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/2008/12/14/playing-around-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=30124&amp;popout=1&amp;url=http%3A%2F%2Fhcoder.org%2F2008%2F12%2F14%2Fplaying-around-with-jquery%2F&amp;language=en_GB&amp;category=text&amp;title=Playing+around+with+jQuery&amp;description=A+couple+of+weeks+ago+I+started+a+new+pet+project.+Namely%2C+making+the+ultimate+todo+list+application.+The+idea+was+to%3A+Make+a+TODO+application+that+I+actually+like...&amp;tags=application%2Cdatamapper%2Cjquery%2Cmerb%2Cpet%2Cproject%2Ctodo%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Problems with comments</title>
		<link>http://hcoder.org/2008/11/26/problems-with-comments/</link>
		<comments>http://hcoder.org/2008/11/26/problems-with-comments/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 18:30:00 +0000</pubDate>
		<dc:creator>emanchado</dc:creator>
				<category><![CDATA[Meta]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[typo]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Today, my good friend &#8220;Esberrito&#8221; warned me that comments were not working in the blog. I hadn&#8217;t realised earlier, but I had them enabled so they should have appeared all the time. I investigated a bit, and it turns out that there&#8217;s some bug (apparently related to saving a post as draft, then publishing) that [...]]]></description>
			<content:encoded><![CDATA[<p>Today, my good friend &#8220;Esberrito&#8221; warned me that comments were not working in the blog. I hadn&#8217;t realised earlier, but I had them enabled so they should have appeared all the time.</p>
<p>I investigated a bit, and it turns out that there&#8217;s some bug (apparently related to saving a post as draft, then publishing) that makes the post have an empty &#8220;permalink&#8221;. When this happens, the link to the blog post looks exactly like the view of the posts for that particular day (say, http://hcoder.org/2008/11/23/ instead of http://hcoder.org/2008/11/23/why-i-hate-rubygems), so Typo decides that it shouldn&#8217;t show the comment form.</p>
<p>The bad news is that many posts are fucked now (although I have fixed some of the most recent ones). The good news is that it&#8217;s more or less easy to fix. You just have to connect to a &#8220;Rails terminal&#8221; with the production configuration (with <code>./script/console production</code>) and do something like this for each post you want to fix:</p>
<p>&gt;&gt; a = Article.find(:first, :conditions =&gt; [&#8220;title <span class="caps">LIKE</span> ?&#8221;, &#8220;<span class="caps">GPG</span>%&#8221;])<br />
=&gt; #&lt;Article id: 41, type: &#8220;Article&#8221;, yadda, yadda, yadda, &#8230;&gt;<br />
&gt;&gt; a.title<br />
=&gt; &#8220;<span class="caps">GPG</span> confusion&#8221;<br />
&gt;&gt; a.permalink = a.stripped_title<br />
=&gt; &#8220;gpg-confusion&#8221;<br />
&gt;&gt; a.save<br />
=&gt; true</p>
<p>Lesson learned: don&#8217;t save as draft for now (maybe I should upgrade to 5.1.3, it seems fixed there). Instead, untick the &#8220;Online&#8221; under &#8220;Post settings&#8221;, and hit &#8220;Publish&#8221;. That will assign a default, sane permalink value.</p>
 <p><a href="http://hcoder.org/?flattrss_redirect&amp;id=50&amp;md5=50c89ef561373561975e9be6466b3c4b" 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/2008/11/26/problems-with-comments/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=30124&amp;popout=1&amp;url=http%3A%2F%2Fhcoder.org%2F2008%2F11%2F26%2Fproblems-with-comments%2F&amp;language=en_GB&amp;category=text&amp;title=Problems+with+comments&amp;description=Today%2C+my+good+friend+%26%238220%3BEsberrito%26%238221%3B+warned+me+that+comments+were+not+working+in+the+blog.+I+hadn%26%238217%3Bt+realised+earlier%2C+but+I+had+them+enabled+so+they+should+have+appeared+all...&amp;tags=bug%2Ccomments%2Cproblem%2Ctypo%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Why I hate Rubygems</title>
		<link>http://hcoder.org/2008/11/23/why-i-hate-rubygems/</link>
		<comments>http://hcoder.org/2008/11/23/why-i-hate-rubygems/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 20:10:00 +0000</pubDate>
		<dc:creator>emanchado</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[cpan]]></category>
		<category><![CDATA[packaging]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[rubygems]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I have always thought that systems should be something integrated. Each &#8220;system&#8221; has its own conventions, cultural values, etc. and I think you have to respect that. I believe in the Debian way (adapting programs to an integrated system, not just creating a large collection of packages that are identical to the upstream versions), I [...]]]></description>
			<content:encoded><![CDATA[<p>I have always thought that systems should be something integrated. Each &#8220;system&#8221; has its own conventions, cultural values, etc. and I think you have to respect that. I believe in the Debian way (adapting programs to an integrated system, not just creating a large collection of packages that are identical to the upstream versions), I like to adapt my style of programming to the language (indentation conventions, identifiers, tools for building and testing, etc.), I prefer cross-platform applications that look and feel like each platform they run on, etc.</p>
<p>In the same way, I feel that the mere idea of having a programming-language-dependent packaging system is a broken idea. I <strong>know</strong> it has advantages, and I know that being specific to the language, some things work better or are more flexible, but I just don&#8217;t believe in that idea. Why should I use a different packaging system for certain things just because they&#8217;re written in Ruby? Why do I, as a user of those programs/modules, even have to know that there&#8217;s some Ruby-specific packaging system, that doesn&#8217;t integrate at all with my system&#8217;s packaging system, and mixing both leads to a mess?</p>
<p>Not only that, but Rubygems in particular is quite hostile to repackaging into a <em>platform</em>-specific packaging system. A lot of people <em>only</em> provide the gems for their software, which are harder to work with than &#8220;normal&#8221; tarballs. They also use their own conventions for directories, that break the <span class="caps">FHS</span> (for example) and basically only make sense in the context of Rubygems. In that sense, <a href="http://search.cpan.org/"><span class="caps">CPAN</span></a> is much better (although I think using it for application deployment is a <em>very</em> bad idea, but that&#8217;s a different matter), because at least it installs everything in sane directories, it doesn&#8217;t change Perl in any way, and it&#8217;s not a special <em>format</em>, just a repository of easy-to-install, easy-to-work-with, easy-to-hack, easy-to-repackage &#8220;distributions&#8221;.</p>
<p>Why, oh, why?</p>
 <p><a href="http://hcoder.org/?flattrss_redirect&amp;id=48&amp;md5=9dc1a4817603aa1ba663d5435f92cdfc" 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/2008/11/23/why-i-hate-rubygems/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=30124&amp;popout=1&amp;url=http%3A%2F%2Fhcoder.org%2F2008%2F11%2F23%2Fwhy-i-hate-rubygems%2F&amp;language=en_GB&amp;category=text&amp;title=Why+I+hate+Rubygems&amp;description=I+have+always+thought+that+systems+should+be+something+integrated.+Each+%26%238220%3Bsystem%26%238221%3B+has+its+own+conventions%2C+cultural+values%2C+etc.+and+I+think+you+have+to+respect+that.+I+believe+in...&amp;tags=cpan%2Cpackaging%2Crants%2CRuby%2Crubygems%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Typo upgrade</title>
		<link>http://hcoder.org/2008/08/07/typo-upgrade/</link>
		<comments>http://hcoder.org/2008/08/07/typo-upgrade/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 21:05:00 +0000</pubDate>
		<dc:creator>emanchado</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Meta]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[problems]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[typo]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Hey there! I have just upgraded Typo. It was slightly traumatic, because at first the blog broke horribly and I couldn&#8217;t see anything other than errors 500. To be fair, the change was quite big, because it included also an upgrade to Rails 2 (I was using some older Typo that used Rails 1.2.x), so [...]]]></description>
			<content:encoded><![CDATA[<p>Hey there!</p>
<p>I have just upgraded Typo. It was slightly traumatic, because at first the blog broke horribly and I couldn&#8217;t see anything other than errors 500. To be fair, the change was quite big, because it included also an upgrade to Rails 2 (I was using some older Typo that used Rails 1.2.x), so everything worked better than expected.</p>
<p>I could login as admin, and change preferences and whatnot, and the only thing that was broken was the public view of the blog. I had a look at the logs, and it complained about not being able to find some template for the sidebars. I was very confused, and didn&#8217;t know where to starting looking for this. So, obviously, I asked &#8220;Señor Google&#8221;. He didn&#8217;t tell me that much, but someone left me the following hint: if you comment out the call to the helper `render_sidebars` (in the active theme code) solved the problem&#8230;. at the price of not having sidebars of course.</p>
<p>So I decided to connect a Ruby/Rails console to the production database, and have a look at the Sidebar model. The summary of what I did is this:</p>
<p>&gt;&gt; Sidebar.find(:all, :order =&gt; &#8216;active_position <span class="caps">ASC</span>&#8217;).<br />
map {|s| s.active_position}<br />
=&gt; [0, 0, 1, 1, 2, 2, 3, 4]<br />
&gt;&gt; Sidebar.find(:all, :order =&gt; &#8216;active_position <span class="caps">ASC</span>&#8217;).<br />
map {|s| s.type}<br />
=&gt; [nil, &#8220;CategorySidebar&#8221;, nil, &#8220;ArchivesSidebar&#8221;, nil,<br />
&#8220;TagSidebar&#8221;, &#8220;StaticSidebar&#8221;, &#8220;XmlSidebar&#8221;]<br />
&gt;&gt; Sidebar.find(:all, :order =&gt; &#8216;active_position <span class="caps">ASC</span>&#8217;).<br />
find_all {|s| s.type.nil?}.size<br />
=&gt; 3<br />
&gt;&gt; Sidebar.find(:all, :order =&gt; &#8216;active_position <span class="caps">ASC</span>&#8217;).<br />
find_all {|s| s.type.nil?}.each {|s| s.destroy}<br />
=&gt; [#&lt;Sidebar id: 1, active_position: 0, config: {&quot;empty&quot;=&gt;false, &#8220;count&#8221;=&gt;true}, staged_position: nil, type: nil&gt;,<br />
#&lt;Sidebar id: 2, active_position: 1, config: {&quot;title&quot;=&gt;&quot;Links&quot;, &#8220;body&#8221;=&gt;&quot;&#8230;&quot;}, staged_position: nil, type: nil&gt;,<br />
#&lt;Sidebar id: 3, active_position: 2, config: {&quot;format&quot;=&gt;&quot;rss20&quot;, &#8220;trackbacks&#8221;=&gt;true, &#8220;comments&#8221;=&gt;true, &#8220;articles&#8221;=&gt;true}, staged_position: nil, type: nil&gt;]<br />
&gt;&gt; Sidebar.find(:all, :order =&gt; &#8216;active_position <span class="caps">ASC</span>&#8217;).find_all {|s| s.type.nil?}.size<br />
=&gt; 0</p>
<p>So, the problem is that there were some (severely broken) leftovers of the upgrade. I just removed them, and everything started working again. Phew!</p>
 <p><a href="http://hcoder.org/?flattrss_redirect&amp;id=35&amp;md5=8273c1f4c688163cc8faace0e614b85c" 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/2008/08/07/typo-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=30124&amp;popout=1&amp;url=http%3A%2F%2Fhcoder.org%2F2008%2F08%2F07%2Ftypo-upgrade%2F&amp;language=en_GB&amp;category=text&amp;title=Typo+upgrade&amp;description=Hey+there%21+I+have+just+upgraded+Typo.+It+was+slightly+traumatic%2C+because+at+first+the+blog+broke+horribly+and+I+couldn%26%238217%3Bt+see+anything+other+than+errors+500.+To+be+fair%2C...&amp;tags=problems%2Crails%2CRuby%2Csolution%2Ctypo%2Cupgrade%2Cblog" type="text/html" />
	</item>
	</channel>
</rss>

