<?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; migraine</title>
	<atom:link href="http://hcoder.org/tag/migraine/feed/" rel="self" type="application/rss+xml" />
	<link>http://hcoder.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sat, 17 Jul 2010 21:17:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>My first contributions to CPAN</title>
		<link>http://hcoder.org/2009/06/28/my-first-contributions-to-cpan/</link>
		<comments>http://hcoder.org/2009/06/28/my-first-contributions-to-cpan/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 20:46:00 +0000</pubDate>
		<dc:creator>emanchado</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[bsd]]></category>
		<category><![CDATA[cpan]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[migraine]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I have been using Perl for many years, but I had never uploaded anything to CPAN. That&#8217;s unfortunate, because I&#8217;ve probably written several programs or modules that could have been useful for other people. The point is, now I have. Not only that, but it was code I wrote at work, so if I&#8217;m not [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using Perl for many years, but I had never uploaded anything to <span class="caps">CPAN</span>. That&#8217;s unfortunate, because I&#8217;ve probably written several programs or modules that could have been useful for other people. The point is, now I have. Not only that, but it was code I wrote at work, so if I&#8217;m not mistaken these are my first contributions to free software from Opera. Yay me!</p>
<p>The two modules I&#8217;ve released so far are:</p>
<ul>
<li><a href="http://search.cpan.org/~opera/Parse-Debian-PackageDesc-0.1/lib/Parse/Debian/PackageDesc.pm">Parse::Debian::PackageDesc</a>, a module for parsing both <code>.dsc</code> and <code>.changes</code> files from Debian. This is actually a support module for something bigger that I hope I&#8217;ll release soon-ish.</li>
<li><a href="http://search.cpan.org/~opera/Migraine-0.53/script/migraine.pl">Migraine</a>, a still somewhat primitive database change manager inspired on the <a href="http://www.oracle.com/technology/pub/articles/kern-rails-migrations.html">Ruby on Rails migration system</a>.</li>
</ul>
<p>As I feel that Migraine could be useful to a lot of people, but it&#8217;s easy to misunderstand what it really does (unless you already know Rails migrations of course), I&#8217;ll elaborate a bit. Imagine that you are developing some application that uses a database. You design the schema, write some <span class="caps">SQL</span> file with it, and everybody creates their own databases from that file. Now, as your application evolves, your schema will evolve too. What do you do now to update all databases (every developer installation, testing installations, and don&#8217;t forget the production database)? One painful way to do it could be documenting which <span class="caps">SQL</span> statements you have to execute in order to have the latest version of the schema, and expect people to apply copying-and-pasting from the documentation. However, it&#8217;s messy, confusing, and it needs someone to know both which databases to update and when.</p>
<p>Migraine offers a simpler, more reliable way to keep all your databases up to date. Basically, you write all your changes (&#8220;migrations&#8221;) in some files in a directory, following a simple version number naming convention (e.g. <code>001-add_users_table.sql</code>, <code>002-change_passwd_field_type.sql</code>), and migraine will allow you to keep your databases up to date. In the simplest, most common case, you call migraine with a configuration file specifying which database to upgrade, and it will figure out which migrations are pending to apply, if any, and apply them. The system currently only supports raw <span class="caps">SQL</span>, but it should be easy to extend with other types.</p>
<p>In principle, you shouldn&#8217;t need to write any Perl code to use migraine (it has a Perl module that you can use to integrate with your Perl programs if you like, but also a command-line tool), so you can use it even in non-Perl projects. Of course, some modern ORMs have their own database migration system, but very often you have to maintain legacy code that doesn&#8217;t use any fancy <span class="caps">ORM</span>, or you don&#8217;t like the migration system provided by the <span class="caps">ORM</span>, or you prefer keeping a single system for schema and data migrations&#8230; I think in those cases Migraine can help a lot reducing chaos and keeping things under control. Try it out and tell me what you think <code>:-)</code></p>
<p>In a couple of days I&#8217;ll blog again about other contributions to free software I&#8217;ve made lately, but this time in the form of Opera widgets&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://hcoder.org/2009/06/28/my-first-contributions-to-cpan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Predictably irrational</title>
		<link>http://hcoder.org/2009/06/01/predictably-irrational/</link>
		<comments>http://hcoder.org/2009/06/01/predictably-irrational/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 21:28:00 +0000</pubDate>
		<dc:creator>emanchado</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Other]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[cpan]]></category>
		<category><![CDATA[kiva]]></category>
		<category><![CDATA[loanmeter]]></category>
		<category><![CDATA[migraine]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I haven&#8217;t written in some time, I know. I haven&#8217;t done much worth blogging about. Just a new release of the Kiva World Loanmeter widget, and also a couple of things at work that I&#8217;ll be releasing soon (including a small tool for managing database changes and some Perl module to parse Debian .changes files). [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t written in some time, I know. I haven&#8217;t done much worth blogging about. Just a new release of the <a href="http://widgets.opera.com/widget/12102/">Kiva World Loanmeter widget</a>, and also a couple of things at work that I&#8217;ll be releasing soon (including a small tool for managing database changes and some Perl module to parse Debian <code>.changes</code> files).</p>
<p>However, recently I watched a really funny and interesting talk at <a href="http://www.ted.com"><span class="caps">TED</span></a>, <a href="http://www.ted.com/index.php/talks/dan_ariely_asks_are_we_in_control_of_our_own_decisions.html">Are we in control of our own decisions?</a>, by <a href="http://www.ted.com/speakers/dan_ariely.html">Dan Ariely</a>. In the talk he mentions his book, <a href="http://www.predictablyirrational.com/">Predictably Irrational</a>, which funnily enough a friend had already mentioned to me.</p>
<p>Well, I just finished the book and I have to say it was very interesting and eye-opening. It&#8217;s interesting how it shows our minds are biased for certain kinds of decisions or behaviour, even though they are often not the best for us. Some of the experiments are truly brilliant and they show totally unexpected (at least before starting reading the book ;-P) outcomes. One of the experiments that got me thinking was this:</p>
<blockquote>
<p>Research on stereotypes shows [&#8230;] that stereotyped people themselves react differently when they are aware of the label that they are forced to wear [&#8230;] One stereotype of Asian-Americans, for instance, is that they are especially gifted in mathematics and science. A common stereotype of females is that they are weak in mathematics [&#8230;] In a remarkable experiment, [&#8230;] asked Asian-American women to take an objective math exam. But first they divided the women into two groups. The women in one group were asked questions related to their gender [&#8230;] The women in the second group were asked questions related to their race [&#8230;] The performance of the two groups differed in a way that matched the stereotypes of both women and Asian-Americans. Those who had been reminded that they were women performed worse than those who had been reminded that they were Asian-American.</p>
</blockquote>
<p>I can&#8217;t stop thinking about the implications this has to working conditions and productivity in different countries, and also to project management.</p>
]]></content:encoded>
			<wfw:commentRss>http://hcoder.org/2009/06/01/predictably-irrational/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
