<?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>Lukáš Lalinský &#187; Rants</title>
	<atom:link href="http://oxygene.sk/lukas/category/rants/feed/" rel="self" type="application/rss+xml" />
	<link>http://oxygene.sk/lukas</link>
	<description>Random notes and stuff</description>
	<lastBuildDate>Thu, 02 Feb 2012 20:17:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Oracle&#8230;</title>
		<link>http://oxygene.sk/lukas/2010/06/oracle/</link>
		<comments>http://oxygene.sk/lukas/2010/06/oracle/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 18:37:40 +0000</pubDate>
		<dc:creator>Lukáš Lalinský</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://oxygene.sk/lukas/?p=495</guid>
		<description><![CDATA[Working with Oracle is always an adventure. The error messages are usually not very helpful, so you have to guess a lot. What I&#8217;ve seen today is an extreme though. Oracle allows you to create a table with a column &#8230; <a href="http://oxygene.sk/lukas/2010/06/oracle/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Working with Oracle is always an adventure. The error messages are usually not very helpful, so you have to guess a lot. What I&#8217;ve seen today is an extreme though. Oracle allows you to create a table with a column named &#8220;TIMESTAMP&#8221; if you quote it:</p>
<pre>
CREATE TABLE "SOME_TABLE" (
    ...
    "TIMESTAMP" TIMESTAMP WITH TIME ZONE
);
</pre>
<p>Oracle is rather picky on identifier names, but since it accepted &#8220;TIMESTAMP&#8221;, I was assuming everything is fine. Later I needed to create a trigger for this table and that&#8217;s where the fun starts.</p>
<pre>
CREATE OR REPLACE TRIGGER "SOME_TABLE_TR"
BEFORE INSERT ON "SOME_TABLE"
FOR EACH ROW
BEGIN
    ...
END;
</pre>
<p>This was failing for some reason though. The only thing I got was this &#8220;nice&#8221; error message, pointing to the table name in the <code>CREATE TRIGGER</code> statement:</p>
<pre>
ORA-06552: PL/SQL: Compilation unit analysis terminated
ORA-06553: PLS-320: the declaration of the type of this expression is incomplete or malformed
</pre>
<p>What type? Do I have a typo somewhere? Did the table somehow get corrupted? You can&#8217;t imaging how long did it take for me to figure out that it doesn&#8217;t like the column name, which was not mentioned anywhere in the PL/SQL block. I would have no problem if it told me that I can&#8217;t use the name. There are too many restrictions on identifiers anyway. What I don&#8217;t understand is why does it allow me to create something that&#8217;s going to break other core functionality.</p>
]]></content:encoded>
			<wfw:commentRss>http://oxygene.sk/lukas/2010/06/oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mercurial, part 1</title>
		<link>http://oxygene.sk/lukas/2010/01/mercurial-part-1/</link>
		<comments>http://oxygene.sk/lukas/2010/01/mercurial-part-1/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 08:00:38 +0000</pubDate>
		<dc:creator>Lukáš Lalinský</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[hg]]></category>
		<category><![CDATA[mercurial]]></category>

		<guid isPermaLink="false">http://oxygene.sk/lukas/?p=283</guid>
		<description><![CDATA[I&#8217;ve been using Mercurial at work for two months now and the expectations I had about it didn&#8217;t change to anything better. I guess it looks cool for people who are used to SVN, or even CVS, and are not &#8230; <a href="http://oxygene.sk/lukas/2010/01/mercurial-part-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using Mercurial at work for two months now and the expectations I had about it didn&#8217;t change to anything better. I guess it looks cool for people who are used to SVN, or even CVS, and are not familiar with other DVCS. I must say that as a Bazaar user, I miss a lot of things. There are some that can be worked around, for something you just have to be extra careful and for something you are out of luck. I really don&#8217;t get how people use Mercurial for managing large projects.</p>
<h3>Cheap Branches</h3>
<p>One of the main reason people use DVCS is cheap branching. The most surprising thing for me was that Mercurial doesn&#8217;t offer many choices. It doesn&#8217;t have the concept of branches, like Bazaar or Git. All you have is an immutable repository that can contain multiple head revisions. By default, you are expected to clone the whole repository. As <a href="http://oxygene.sk/lukas/2009/10/working-with-branches-in-bazaar/">I mentioned earlier</a>, I tend to work with many feature branches, so I prefer to have just one working tree.</p>
<p>One way to partially solve this problem is the <a href="http://mercurial.selenic.com/wiki/BookmarksExtension">bookmarks extension</a>. It basically allows you to have dynamic tags that move to new revisions as you commit. The initial configuration looks like this:</p>
<pre>[extensions]
bookmarks =
[bookmarks]
track.current = True</pre>
<p>The next step is to go to your clone and set the main/trunk/master/etc. bookmark:</p>
<pre>hg bookmark main</pre>
<p>This is necessary, so that you easily know which revisions represents the project&#8217;s &#8220;mainline&#8221;. With the configuration I mentioned, the extension will track your current bookmark and update only that one. To set the current bookmark, you can use update:</p>
<pre>hg up -r main</pre>
<p>It&#8217;s important to always have the current bookmark set to <em>main</em> whenever you are fetching changes from the mainline. Otherwise you will have to manually fix the bookmark&#8217;s revision.</p>
<p>Creating new &#8220;feature branches&#8221; is easy then:</p>
<pre>hg bookmark -r main my-feature
hg up -r my-feature</pre>
<p>One important thing to remember is that after you use this, the repository will contain multiple heads. This means you can&#8217;t use plain <code>hg push</code> to push changes to remote repositories. You always have to specify the revision, for example:</p>
<pre>hg push -r main https://hg.example.com/projects/trunk</pre>
<h3>Merging</h3>
<p>When it comes to merging, Mercurial doesn&#8217;t make your life easier at all. The default assumption is that visual merging is the preferred way to go. Maybe I&#8217;m just too stupid, but I don&#8217;t get visual merge tools. I just don&#8217;t know how to use them. I prefer merging changes manually in my text editor, after I see the changes for the whole project. Mercurial would start up the merge tool for each file linearly, which means you don&#8217;t have a global picture of impact on the project, when you are supposed to resolve a merge. I just can&#8217;t work that way.</p>
<p>Fortunately, Mercurial does have an internal three-way merge algorithm, that can leave conflict markers in the merged files and let me do my job. You can configure it this way:</p>
<pre>[ui]
merge = internal:merge</pre>
<p>This actually uses the merge code from Bazaar, so I expected I&#8217;ll be done quickly. There is one problem though. Instead of using patience diff, like Bazaar, it uses its own diff algorithm. The result is that in Bazaar the algorithm works just fine, in Mercurial it produces horrible results. That&#8217;s actually pretty funny, considering the fact that I used ideas from Mercurial&#8217;s diff code to implement the C version of patience diff in Bazaar.</p>
<p>Next step, the <a href="http://mercurial.selenic.com/wiki/MergeProgram">Mercurial wiki</a> suggests <code>diff3</code> as a possible non-interactive merge tool. There are no examples how to configure it, but something like this technically works:</p>
<pre>[ui]
merge = diff3
[merge-tools]
diff3.args = -m $local $base $other &gt; $output</pre>
<p>In my experience, this produces even worse results than <code>internal:merge</code>, so there is no reason to use it.</p>
<p>The last idea was to use the <code>merge</code> program from <a href="http://www.gnu.org/software/rcs/">RCS</a> (yes, that&#8217;s right, using an ancient VCS to fix issues in a &#8220;modern&#8221; VCS). I must say that installing RCS in 2010 feels weird, but as long as I can get my job done&#8230; Once it was installed, I used this configuration:</p>
<pre>[ui]
merge = merge</pre>
<p>I was surprised that the results were acceptably good. Not perfect, but I knew I can&#8217;t expect more from a three-way merge. Ideally I&#8217;d like Bazaar&#8217;s merge algorithm with patience diff, but I probably won&#8217;t find time to port it, so <code>merge</code> will stay as my default merge tool for some time.</p>
<p>That&#8217;s only the first part of the problem though. Now you have files with conflict markers and you need to resolve them. Based on my experience with other version control systems, I assumed conflicts would be listed in <code>hg status</code>, but I was wrong. They are nicely hidden here:</p>
<pre>hg resolve -l | grep '^U'</pre>
<p>After manually resolving the conflicts, you can use the following command to mark the files as resolved:</p>
<pre>hg resolve -m path/to/file</pre>
<p><em>To be continued&#8230;</em></p>
]]></content:encoded>
			<wfw:commentRss>http://oxygene.sk/lukas/2010/01/mercurial-part-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Technical book authors</title>
		<link>http://oxygene.sk/lukas/2010/01/technical-book-authors/</link>
		<comments>http://oxygene.sk/lukas/2010/01/technical-book-authors/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 12:56:27 +0000</pubDate>
		<dc:creator>Lukáš Lalinský</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[ego]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[stackoverflow]]></category>

		<guid isPermaLink="false">http://oxygene.sk/lukas/?p=260</guid>
		<description><![CDATA[To be honest, I don&#8217;t read technical books much. I prefer reading the official documentation for a product I need to work with, or use some other ways to get information about it. I always assumed people who write such &#8230; <a href="http://oxygene.sk/lukas/2010/01/technical-book-authors/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>To be honest, I don&#8217;t read technical books much. I prefer reading the official documentation for a product I need to work with, or use some other ways to get information about it. I always assumed people who write such books are experts though. There are many book authors on Stack Overflow, but today I encountered a particularly interesting situation with one of them.</p>
<p>Somebody asked a <a href="http://stackoverflow.com/questions/1993050/how-can-i-set-the-output-file-for-perls-filefetch">question about a Perl module</a> a few days ago and based on reading the source code of the module, I gave them one possible way to solve the problem. Today, <a href="http://stackoverflow.com/users/8817/brian-d-foy">an author of multiple Perl books</a> came in and very confidently claimed that my solution will never work. I explained him why he is wrong, but it didn&#8217;t help. The problem was that he failed to read the source code correctly and made incorrect assumptions based on that. I pointed him to specific parts of the code, still nothing. At that point I wanted to gave up, but later he came up with a broken example, which didn&#8217;t work for different reasons, that should show me why I&#8217;m wrong. Soon after that he realized what is wrong about the example, changed his answer and deleted all his old comments, as if they never happened.</p>
<p>The problem I see is not this specific case (I&#8217;ve seen far more of them, either on Stack Overflow or some IRC channels), but the fact that even average programmers write popular programming books. And people learn from these books. I guess the saying about teachers who failed to apply their knowledge in practice, which I can&#8217;t remember right now, applies even for book authors. What a wonderful world.</p>
<p><em>(I just needed to get this out of myself.)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://oxygene.sk/lukas/2010/01/technical-book-authors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stack Overflow Careers</title>
		<link>http://oxygene.sk/lukas/2009/12/stack-overflow-careers/</link>
		<comments>http://oxygene.sk/lukas/2009/12/stack-overflow-careers/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 08:13:12 +0000</pubDate>
		<dc:creator>Lukáš Lalinský</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[job]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[stack overflow]]></category>

		<guid isPermaLink="false">http://oxygene.sk/lukas/?p=222</guid>
		<description><![CDATA[When I have some free time and I&#8217;m bored, I try to help people at Stack Overflow.  Recently the owners of Stack Overflow launched a site where you can post your CV, which are linked to your Stack Overflow account, &#8230; <a href="http://oxygene.sk/lukas/2009/12/stack-overflow-careers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When I have some free time and I&#8217;m bored, I try to help people at <a href="http://stackoverflow.com/users/60950/lukas-lalinsky">Stack Overflow</a>.  Recently the owners of Stack Overflow launched a site where you can post your CV, which are linked to your Stack Overflow account, and companies can search them. Nice idea. But the business model behind it makes it horrible. <a href="http://www.joelonsoftware.com/items/2009/12/02.html">This blog post by Joel Spolsky</a> actually made me write this rant. Stack Overflow is obviously doing very good at getting money from ads. People answering questions over there actually make them money, as they increase the value of the site. (They still display ads even to those people, which is something I also don&#8217;t get, but with <a href="http://adblockplus.org/">Adblock Plus</a>, I don&#8217;t care.) The thing is that they charge job seekers for having their CV searchable within the site. The official reason for that is that they want to ensure that everybody who has their CV listed there is actively looking for a job. If that&#8217;s so, why are they raising the price from $29 to $99? $29 should do just as well for filtering the people who post their CV &#8220;just because they can&#8221;. I have real trouble imagining any competent programmer (who actively contributes to Stack Overflow, therefore makes sure they get their ad revenue) would want to pay to get his CV listed on the site. It&#8217;s not about the money though, it&#8217;s about the principle. I wouldn&#8217;t pay for such a service, just like I wouldn&#8217;t send my CV to a recruitment agency.</p>
]]></content:encoded>
			<wfw:commentRss>http://oxygene.sk/lukas/2009/12/stack-overflow-careers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

