<?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>the_isz&#039;s Arch Linux Blog</title>
	<atom:link href="http://archlinux.me/theisz/feed/" rel="self" type="application/rss+xml" />
	<link>http://archlinux.me/theisz</link>
	<description>Just another Arch Linux Blog site</description>
	<lastBuildDate>Mon, 24 Jan 2011 06:54:10 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Distributing configuration files 2: Cygwin hassles and Vim</title>
		<link>http://archlinux.me/theisz/2009/11/09/distributing-configuration-files-2-cygwin-hassles-and-vim/</link>
		<comments>http://archlinux.me/theisz/2009/11/09/distributing-configuration-files-2-cygwin-hassles-and-vim/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 14:00:14 +0000</pubDate>
		<dc:creator>theisz</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Editors]]></category>
		<category><![CDATA[Source Control Managers]]></category>
		<category><![CDATA[Cygwin]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://archlinux.me/the_isz/?p=83</guid>
		<description><![CDATA[Today&#8217;s topic is the first continuation of Distributing configuration files and as the title already denotes, it is concerned with Vim, specifically with using it in heterogenous environments (read: Linux and window$/Cygwin). Unfortunately, the window$ version of Vim searches different paths for configuration files than the Linux version does. That means that even though there [...]]]></description>
				<content:encoded><![CDATA[<p>Today&#8217;s topic is the first continuation of <a href="http://archlinux.me/the_isz/2009/11/06/distributing-configuration-files/">Distributing configuration files</a> and as the title already denotes, it is concerned with Vim, specifically with using it in heterogenous environments (read: Linux and window$/Cygwin).</p>
<p>Unfortunately, the window$ version of Vim searches different paths for configuration files than the Linux version does. That means that even though there probably is a git version for window$, it won&#8217;t help us much as window$ doesn&#8217;t know softlinks. So we must use a little trick&#8230;</p>
<p><span id="more-83"></span></p>
<p>When I&#8217;m forced to work under window$, I install <a href="http://www.cygwin.com/">Cygwin</a> to make the work a lot more enjoyable. It has packages for practically everything I need, the most important of which is a usable terminal. Unfortunately, the Linux file system it simulates conflicts with window$&#8217; own one, so there typically arise problems when using an editor started from this environment.</p>
<p>To make things worse, Cygwin has problems with ntfs&#8217; file properties (ownership and access rights) and with handling the different line endings of Linux and window$ files. Therefor, I prefer installing the window$ version of Vim which does not suffer from these problems. Of course, I still want to use the same settings for it that I use on my PC at home&#8230;</p>
<p><b>Coping with textmode hassles</b></p>
<p><i>This is very important!</i> You need to make sure that the directory you check your settings out to is mounted in <i>binary mode</i>. Otherwise, you won&#8217;t get much further than checking out: The first commit, branch or tag you do will completely screw up your git directory as it cannot deal with textmode&#8217;s line endings (aka &lt;CR&gt;&lt;LF&gt; instead of just &lt;LF&gt;, check out the <a href="http://www.cygwin.com/1.7/cygwin-ug-net/using-textbinary.html">Cygwin website</a> for details).</p>
<p>If you use textmode per default, you at least need to mount the directory into which you will check out your configs in binary mode. Doing this is easy in Cygwin. You can see your mounted directories with <code>mount</code> and the respective commands with <code>mount -m</code>. The important flags are <code>-t</code> for text- and <code>-b</code> for binary mode.</p>
<p>As an example, let&#8217;s assume you want to mount User&#8217;s <code>$HOME</code> directory in binary mode:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-f</span> <span style="color: #660033;">-s</span> <span style="color: #660033;">-b</span> <span style="color: #ff0000;">&quot;C:/cygwin/home/User&quot;</span> <span style="color: #ff0000;">&quot;/home/User&quot;</span></pre></td></tr></table></div>

<p><b>Getting the window$ version of Vim to use your settings</b></p>
<p>I assume you still know how to retrieve the settings via git from the first part of this mini-series, so I&#8217;ll skip that as it works just the same way under Cygwin. Once you&#8217;re done, rename the file <code>C:\Programs\Vim\_vimrc</code> and create a new file with the same name and edit it:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #804040;">set</span> <span style="color: #668080;">runtimepath</span><span style="color: #000000;">+</span>=C<span style="color: #000000;">:</span>\cygwin\home\<span style="color: #25BB4D;">User</span>\<span style="color: #000000;">.</span>config\vim\<span style="color: #000000;">.</span>vim
<span style="color: #804040;">set</span> <span style="color: #668080;">runtimepath</span><span style="color: #000000;">+</span>=C<span style="color: #000000;">:</span>\cygwin\home\<span style="color: #25BB4D;">User</span>\<span style="color: #000000;">.</span>config\vim\<span style="color: #000000;">.</span>vim\after
source C<span style="color: #000000;">:</span>\cygwin\home\<span style="color: #25BB4D;">User</span>\<span style="color: #000000;">.</span>config\vim\<span style="color: #000000;">.</span>vimrc</pre></td></tr></table></div>

<p>Replace User with your username under window$ and the next time you start the window$ version of Vim, it should use the settings imported with git.</p>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://archlinux.me/theisz/2009/11/09/distributing-configuration-files-2-cygwin-hassles-and-vim/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Distributing configuration files</title>
		<link>http://archlinux.me/theisz/2009/11/06/distributing-configuration-files/</link>
		<comments>http://archlinux.me/theisz/2009/11/06/distributing-configuration-files/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 13:37:30 +0000</pubDate>
		<dc:creator>theisz</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Source Control Managers]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://archlinux.me/the_isz/?p=75</guid>
		<description><![CDATA[Wow, what a title for a blog entry&#8230; I hope the entry itself can live up to the generated expectations So, what I want to talk about is how to use the same configuration files for programs I use everyday &#8211; such as bash, vim or ssh, just to name a few &#8211; in different [...]]]></description>
				<content:encoded><![CDATA[<p>Wow, what a title for a blog entry&#8230; I hope the entry itself can live up to the generated expectations <img src='http://archlinux.me/theisz/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  So, what I want to talk about is how to use the same configuration files for programs I use everyday &#8211; such as bash, vim or ssh, just to name a few &#8211; in different places:</p>
<ul>
<li>My PC at home</li>
<li>My laptop</li>
<li>My girlfriend&#8217;s PC (also running Arch, of course) on which I regularly need to do administrative work</li>
<li>The Arch live system on a USB stick</li>
<li>My PC at work</li>
</ul>
<p>Now, in each of these work places, I regularly modify configurations or even add new ones. What has always bugged me is that I have a hard time synchronizing these changes. So I thought: How about employing a revisioning system to do the work for me?</p>
<p><span id="more-75"></span></p>
<p><b>Which system to use?</b></p>
<p>At first, I wanted to use <a href="http://subversion.tigris.org/">subversion</a>, as I already got used to it during my diploma thesis and got even more experience from using it everyday at work. But then I remembered that I had read about <a href="http://git-scm.com/">git</a> and how great it was supposed to be and indeed, it has some advantages over subversion for my plans.</p>
<p>The most important one is that it is a distributed system, meaning that I could pull from any workspace, instead of just a central repository. This could come quite handy if I only got my laptop with me or my PC at home isn&#8217;t running, but the one of my girlfriend is. Not to mention how helpful this is when my desktop PC should crash!</p>
<p><b>Directory layout</b></p>
<p>Now that I decided which tool to use, I needed to decide how to layout the directory structure. My first idea was to simply create a repository inside my <code>$HOME</code> under which I could add all my config files. But that would have forced me to always check out the configuration files of all tools I&#8217;m using at the specific computer I&#8217;m at instead of only the ones I need.</p>
<p>So I created a subdirectory under my <code>$HOME</code> and added another subdirectory for each tool whose settings I&#8217;d like to keep track of. That&#8217;s when I noticed that many tools already use the <code>$HOME/.config</code> directory for exactly this purpose and so I did as well. The layout now looks like this:</p>
<pre>
$HOME
 + .config
  + vim
  + bash
  + ssh
  + ...
</pre>
<p>To have the respective tool find the config file, I just add a softlink (remember to remove/backup the original files first):</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.config<span style="color: #000000; font-weight: bold;">/</span>bash<span style="color: #000000; font-weight: bold;">/</span>.bashrc <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.bashrc
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.config<span style="color: #000000; font-weight: bold;">/</span>vim<span style="color: #000000; font-weight: bold;">/</span>.vimrc <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.vimrc
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.config<span style="color: #000000; font-weight: bold;">/</span>vim<span style="color: #000000; font-weight: bold;">/</span>.vim <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.vim
<span style="color: #666666; font-style: italic;"># and so on, I think you get the idea...</span></pre></td></tr></table></div>

<p><b>Using git</b></p>
<p>I don&#8217;t want to give a full tutorial to git here, but the following should be enough to help you getting started. As an example, let&#8217;s set up a repository for bash based on an existing <code>.bashrc</code> file:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.config<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">bash</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.config<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">bash</span>
<span style="color: #c20cb9; font-weight: bold;">git init</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.bashrc .
<span style="color: #c20cb9; font-weight: bold;">git add</span> .bashrc
<span style="color: #c20cb9; font-weight: bold;">git commit</span> <span style="color: #660033;">-m</span> <span style="color: #ff0000;">'Initial commit'</span></pre></td></tr></table></div>

<p>That&#8217;s it! You successfully initialized your first repository. To check it out from another PC, I use ssh, for which a server obviously needs to be running on the machine which we want to check out from:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.config
<span style="color: #c20cb9; font-weight: bold;">git clone</span> ssh:<span style="color: #000000; font-weight: bold;">//</span>User<span style="color: #000000; font-weight: bold;">@</span>Server:Port<span style="color: #000000; font-weight: bold;">/</span>~<span style="color: #000000; font-weight: bold;">/</span>.config<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">bash</span> <span style="color: #c20cb9; font-weight: bold;">bash</span></pre></td></tr></table></div>

<p>Replace User, Server and Port with your username on the server, the server&#8217;s url or ip address and the port on which the ssh server is listening, respectively. If your username on the server is the same as on the client, you can skip it, just as you can skip the port specification if the server is listening on port 22. To make your life easier, you can preconfigure these settings in the <code>$HOME/.ssh/config</code> file. See <code>man ssh_config</code> for details on how to do this.</p>
<p>This concludes the first part of this tutorial. I definetely plan to give some examples about how to fetch and push changes with git. See you then, if you&#8217;re interested.</p>
]]></content:encoded>
			<wfw:commentRss>http://archlinux.me/theisz/2009/11/06/distributing-configuration-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Long time no see</title>
		<link>http://archlinux.me/theisz/2009/11/06/long-time-no-see/</link>
		<comments>http://archlinux.me/theisz/2009/11/06/long-time-no-see/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 09:32:47 +0000</pubDate>
		<dc:creator>theisz</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Stories]]></category>

		<guid isPermaLink="false">http://archlinux.me/the_isz/?p=54</guid>
		<description><![CDATA[Wow, I haven&#8217;t updated this blog for a long time&#8230; I&#8217;ve been on holidays in Bulgaria in the midst of September, then we did the most rushed move in the history of flats (thanks to all our friends who helped us), which was immediately followed by a month of furnishing/unpacking the new flat. What happened [...]]]></description>
				<content:encoded><![CDATA[<p>Wow, I haven&#8217;t updated this blog for a long time&#8230; I&#8217;ve been on holidays in Bulgaria in the midst of September, then we did the most rushed move in the history of flats (thanks to all our friends who helped us), which was immediately followed by a month of furnishing/unpacking the new flat. What happened between July and September? I don&#8217;t know&#8230; must&#8217;ve been some sort of time hole.</p>
<p>However, the flat is now pretty much livable, though far from being completely furnished. Luckily, I do have some time updating the blog again. So brace yourself, new experiences coming in. Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://archlinux.me/theisz/2009/11/06/long-time-no-see/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emacs vs. Vi review</title>
		<link>http://archlinux.me/theisz/2009/10/21/emacs-vs-vi-review/</link>
		<comments>http://archlinux.me/theisz/2009/10/21/emacs-vs-vi-review/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 16:20:24 +0000</pubDate>
		<dc:creator>theisz</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Editors]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://archlinux.me/the_isz/?p=65</guid>
		<description><![CDATA[After trying out Vim for about two months now, I gave a summary of what I like and dislike about it in the thread on the Arch linux forums I was talking about in an earlier post. As this thread still isn&#8217;t viewable for unregistered users, I&#8217;ll do my summary here as well. What I [...]]]></description>
				<content:encoded><![CDATA[<p>After trying out Vim for about two months now, I gave a summary of what I like and dislike about it in <a href="http://bbs.archlinux.org/viewtopic.php?pid=641137#p641137">the thread on the Arch linux forums</a> I was talking about in an <a href="http://archlinux.me/the_isz/2009/08/19/emacs-vs-vi-comparison/">earlier post</a>. As this thread still isn&#8217;t viewable for unregistered users, I&#8217;ll do my summary here as well.</p>
<p><span id="more-65"></span></p>
<p><b>What I like about Vim</b></p>
<ul>
<li><b>Completion</b><br />
  The C++ auto-completion (omnicomplete) is not only much easier to install and set up than anything I&#8217;ve found for emacs, it also actually works. The closest comparable thing for Emacs is Cedet, which not only bloats emacs&#8217; gui and makes it take even longer to start, it also relies on etags. etags is an emacs version of ctags, the latter of which creates tags files needed for Vim&#8217;s omnicomplete to work. Why the developers of emacs chose a different (to me seemingly non-standard) tool for is really a mystery to me.<br />
  Moreover, Vim supports a drop-down completion menu out of the box! I know there are scripts for Emacs which do the same, but again, these are difficult to install and also don&#8217;t work when using Emacs on the command-line. In Vim, this works exactly the same, be it in gvim or the console Vim.<br />
  Finally, Vim supports completion for different types of objects: You can have Vim complete words from open buffers, words from dictionaries, words from omnicomplete or filenames, just by pressing a different key combination. This works, and it works great!
  </li>
<li><b>Movement</b><br />
  Some of Vim&#8217;s movement commands are just incredibly awesome! I can&#8217;t sum them all up, but just to give you an example, the &#8220;cib&#8221; command &#8211; standing for &#8220;change inner block&#8221; &#8211; deletes the contents of the innermost ()-block the cursor is in and positions the cursor so that you can replace it. This is such a time-saver that I hardly believe I&#8217;ll ever want to live without it.<br />
  These movements become even more powerful when it comes to scripting (see next item), where you can use them to step over text objects generically.
  </li>
<li><b>Scripting</b><br />
  Emacs uses the extremely powerful lisp dialect elisp for scripting and extending Emacs functionality. The downside is that to use it, you obviously need to know lisp, which certainly not everyone does. I learned some Common Lisp, but as interesting as it was, I didn&#8217;t know where I could actually utilize it and so I never got to train it and kept but the mere concepts of functional programming in mind.<br />
  Vim&#8217;s scripting language on the other hand is relatively easy to learn, as it much resembles other scripting languages such as perl or python. Even after this short time, I&#8217;ve managed to write my first few short scripts which help me in everyday programming. For instance, I wrote a function which generically converts a C++ function declaration to a function implementation body.
  </li>
<li><b>Getting help</b><br />
  Both Emacs and Vim do have a vivid user base who you can contact if you have questions. But often, you just don&#8217;t have the time to search the web or hang around in an irc chat. I found that practically all questions I had about Vim could be answered by visiting <a href="http://www.vim.org">www.vim.org</a> or using the superb builtin help functionality. I never found Emacs&#8217; help to be even half as helpful.
  </li>
</ul>
<p><b>What I dislike about Vim</b></p>
<ul>
<li><b>Inconsistent movement</b><br />
  Once you got used to Emacs&#8217; movement keys (e.g. C-n for down, C-p for up, etc), you use those everywhere, no matter what you&#8217;re currently doing. This enables you to keep your hands on the main key field of the keyboard, greatly increasing your typing speed while programming.<br />
  In Vim, the cursor movement highly depends on the mode you&#8217;re in. When in normal mode, you use the hjkl keys to move the cursor around, but in insert mode, these of course produce the respective letters, forcing you to use the cursor keys if you need to correct a mistake.<br />
  There are some alternatives for solving this problem, none of which I find very attractive. The first was suggested by a fellow Arch user, <a href="http://bbs.archlinux.org/profile.php?id=27271">alterecco</a>: He has defined a key mapping, in which the hjkl keys are bound to the respective cursor keys and a key to switch between this and the standard mapping. This has the advantage that you can use the hjkl keys as cursor keys in every application, but you need to find a well-reachable key (or combination therof) to switch the mappings. This key of course must not be used by other applications and porting this behaviour to the different environments you&#8217;re working on might prove difficult.<br />
  The other alternative is presumably the classical Vim way: If you make a mistake, you don&#8217;t go back to correct it right away as that would break your workflow, but continue typing until you&#8217;re done with that sentence/paragraph/block/whatever. Afterwards, you go back to the error in normal mode and correct it. This is the way I&#8217;m currently trying to get used to, but for now, it just doesn&#8217;t &#8220;feel right&#8221;&#8230;
  </li>
<li><b>Indentation</b><br />
  Vim has pretty many options for configuring C++ indentation rules. But it still is a limited set of options and as far as I see it, if you want something that is not covered by this set, you got a problem.<br />
  Emacs syntactically analyses your code and thus it is easy to configure another indentation behaviour for any place in your code. I find this to be superior to the way Vim handles this, although it covers most of what I need.
  </li>
<li><b>Shell mode</b><br />
  Bash, the default shell of most linux distributions, uses emacs key combinations out of the box, but can also be configured to use Vi ones. I&#8217;m still trying out the latter ones, but until now, it seems to me that a) the emacs feature set is much more complete and it b) feels much more &#8220;natural&#8221;.<br />
  I know this isn&#8217;t a problem of Vi(m) (if at all), but to me, it belongs to the same topic, as I don&#8217;t want to switch editing modes in my mind when switching from editor to shell.
  </li>
</ul>
<p>This concludes my preliminary observations of Emacs versus Vim. I hope there are some people out there who might find this helpful. Me, I&#8217;m going to continue using Vim until I find a real reason to switch back. Until now, the advantages outweigh the disadvantages by far.</p>
]]></content:encoded>
			<wfw:commentRss>http://archlinux.me/theisz/2009/10/21/emacs-vs-vi-review/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Emacs vs. Vi comparison</title>
		<link>http://archlinux.me/theisz/2009/08/19/emacs-vs-vi-comparison/</link>
		<comments>http://archlinux.me/theisz/2009/08/19/emacs-vs-vi-comparison/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 16:56:06 +0000</pubDate>
		<dc:creator>theisz</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Editors]]></category>
		<category><![CDATA[Arch Linux]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://archlinux.me/the_isz/?p=60</guid>
		<description><![CDATA[Having been an emacs user since the time I&#8217;ve first met linux, I always wondered why so many Arch users favor Vi(m). So I asked them. If you&#8217;re registered, you can find the forum thread on the Arch linux forums. Again, as it is an off-topic thread, unregistered users unfortunately can&#8217;t view it.]]></description>
				<content:encoded><![CDATA[<p>Having been an emacs user since the time I&#8217;ve first met linux, I always wondered why so many Arch users favor Vi(m). So I asked them. If you&#8217;re registered, you can find the forum thread on <a href="http://bbs.archlinux.org/viewtopic.php?id=78344">the Arch linux forums</a>. Again, as it is an off-topic thread, unregistered users unfortunately can&#8217;t view it.</p>
]]></content:encoded>
			<wfw:commentRss>http://archlinux.me/theisz/2009/08/19/emacs-vs-vi-comparison/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I got a creative moment&#8230;</title>
		<link>http://archlinux.me/theisz/2009/07/08/i-got-a-creative-moment/</link>
		<comments>http://archlinux.me/theisz/2009/07/08/i-got-a-creative-moment/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 06:19:00 +0000</pubDate>
		<dc:creator>theisz</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Fun]]></category>

		<guid isPermaLink="false">http://archlinux.me/the_isz/?p=48</guid>
		<description><![CDATA[&#8230;or as Terry Pratchett probably would have said, I was hit by an Inspiration Particle. If you&#8217;re interested, you can find it here. You might want to read the first post of the thread first, so you know what this is about. Have fun! Edit: A friend of mine told me that he could not [...]]]></description>
				<content:encoded><![CDATA[<p>&#8230;or as Terry Pratchett probably would have said, I was hit by an <a href="http://wiki.lspace.org/wiki/Inspiration_Particles">Inspiration Particle</a>. If you&#8217;re interested, you can find it <a href="http://bbs.archlinux.org/viewtopic.php?pid=581535#p581535">here</a>. You might want to read the first post of the thread first, so you know what this is about.</p>
<p>Have fun!</p>
<p><strong>Edit:</strong> A friend of mine told me that he could not visit the linked thread on the Arch Linux forums. Unfortunately, I found out that this does not only concern him, but everyone not registered on these forums. The offtopic forum there cannot be looked into without being logged in. Sorry for that!</p>
]]></content:encoded>
			<wfw:commentRss>http://archlinux.me/theisz/2009/07/08/i-got-a-creative-moment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#039;m through with ATI</title>
		<link>http://archlinux.me/theisz/2009/07/03/im-through-with-ati/</link>
		<comments>http://archlinux.me/theisz/2009/07/03/im-through-with-ati/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 18:28:00 +0000</pubDate>
		<dc:creator>theisz</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Arch Linux]]></category>

		<guid isPermaLink="false">http://archlinux.me/the_isz/?p=40</guid>
		<description><![CDATA[I&#8217;ve finally done it. Today I installed my new nVidia GeForce GTX 275. After about a year with my Radeon HD 4870 I couldn&#8217;t stand it anymore. ATI makes me feel like I&#8217;m a beta tester for their drivers. I feel cheated and stupid for being such an idealistic idiot at the same time. They [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve finally done it. Today I installed my new nVidia GeForce GTX 275. After about a year with my Radeon HD 4870 I couldn&#8217;t stand it anymore. ATI makes me feel like I&#8217;m a beta tester for their drivers. I feel cheated and stupid for being such an idealistic idiot at the same time. They promised to open up their drivers (which was the main reason for me to buy an ATI card in the first place) and neither have they done so in the meantime, nor have they shown any clear sign that they will in the near future.</p>
<p><span id="more-40"></span></p>
<p>Even worse, ATI isn&#8217;t supporting Linux anymore, they are only supporting Ubuntu and maybe OpenSuse, merely releasing new drivers matching the kernel versions included in the releases of these distributions. As a user of the rolling-release distribution Arch Linux, I have but two choices when new kernel versions come out: Using one of the open source drivers (each lacking certain features such as energy-saving, tv-out or compositing support) or using modified binary drivers.</p>
<p>Concerning the latter, the Arch Linux community has once more impressed me very much. People try to get these drivers to work and are actually quite successful, especially regarding the fact that they neither wrote the drivers, nor are paid for this work. I wonder if ATI watches the famous <a href="http://bbs.archlinux.org/viewtopic.php?id=57084">AMD/ATI Catalyst Bar &amp; Grill</a> for inspiration and tips on their future driver releases&#8230;<br />
Nevertheless, the aforementioned busy Archers don&#8217;t have access to the driver sources and so even they can&#8217;t solve all the problems arising with each new kernel version. And so I &#8211; like many other ATI users &#8211; had to live with many inconveniences while using them, including not being able to play WoW under Linux, regular manual reinstallations of the drivers and irregular system freezes&#8230;</p>
<p>I&#8217;d like to note what finally changed my mind to switch back to nVidia although not being a cheap decision: Recently, I met a former lecturer of mine and told him about the situation with the ATI drivers. He told me that he applied at an ATI factory in Germany in 2002 and ATI was talking about opening their drivers even at that time! And then he added that the factory doesn&#8217;t exist anymore. I didn&#8217;t want to continue looking at such a &#8220;promising&#8221; future and ordered the nVidia card few days later.</p>
<p>Anyway, the good news is: The nVidia card is working great out of the box! Finally, I can play my favourite game WoW inside my favourite operating system once again. TV-out is working without any hassle, I have options in a graphical dialog I didn&#8217;t even touch yet <img src='http://archlinux.me/theisz/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  And the card is really quiet when idle. Now the only thing left is to get rid of the ATI card.</p>
]]></content:encoded>
			<wfw:commentRss>http://archlinux.me/theisz/2009/07/03/im-through-with-ati/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update: Combining calcurse and conky</title>
		<link>http://archlinux.me/theisz/2009/06/27/update-combining-calcurse-and-conky/</link>
		<comments>http://archlinux.me/theisz/2009/06/27/update-combining-calcurse-and-conky/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 11:14:47 +0000</pubDate>
		<dc:creator>theisz</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Arch Linux]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://archlinux.me/the_isz/?p=36</guid>
		<description><![CDATA[Wow, that was fast! I only wrote the bug report to the creator of calcurse two days ago and received a patched version yesterday already! That&#8217;s what I call support. I tried this new version and can absolutely confirm that the bug I reported is fixed. Thus, it&#8217;s time I update my conky adaption as [...]]]></description>
				<content:encoded><![CDATA[<p>Wow, that was fast! I only wrote the bug report to the creator of <a href="http://culot.org/calcurse/">calcurse</a> two days ago and received a patched version yesterday already! That&#8217;s what I call support. I tried this new version and can absolutely confirm that the bug I reported is fixed. Thus, it&#8217;s time I update my conky adaption as well. Not much needs changing, but there&#8217;s one thing I didn&#8217;t consider about when creating the &#8220;workaround&#8221; version&#8230;</p>
<p><span id="more-36"></span></p>
<p>The &#8220;workaround&#8221; version of my script relies on the <code>.conkyrc</code> file to insert an empty line between the todo&#8217;s and the appointments. If you don&#8217;t need such a line, you can skip reading the rest of this blog entry. All others need to patch the script. First, edit your <code>.conkyrc</code> to call the script only once, but with the parameters for both the appointments and todo&#8217;s:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #800000;">${execpi 300 calcurse -d14 -t | ~/.conky/calcurse_task_to_conky.pl}</span></pre></td></tr></table></div>

<p>Then, save the following patch as <code>~/.conky/new_version.patch</code>:</p>
<pre>
5,12d4
&lt; sub spacer
&lt; {
&lt;     if( ${ (\scalar keys %inited) } &gt; 0 )
&lt;     {
&lt;         print "\n";
&lt;     }
&lt; }
&lt;
25,26d16
&lt;             spacer();
&lt;
49,50d38
&lt;             spacer();
&lt;
</pre>
<p>Finally, apply the patch:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">patch</span> <span style="color: #660033;">-R</span> <span style="color: #660033;">-i</span> ~<span style="color: #000000; font-weight: bold;">/</span>.conky<span style="color: #000000; font-weight: bold;">/</span>new_version.patch ~<span style="color: #000000; font-weight: bold;">/</span>.conky<span style="color: #000000; font-weight: bold;">/</span>calcurse_task_to_conky.pl</pre></td></tr></table></div>

<p>That&#8217;s it! Now the appointments and todo&#8217;s always have a separating line between them.</p>
]]></content:encoded>
			<wfw:commentRss>http://archlinux.me/theisz/2009/06/27/update-combining-calcurse-and-conky/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The pimpl-pattern</title>
		<link>http://archlinux.me/theisz/2009/06/22/5/</link>
		<comments>http://archlinux.me/theisz/2009/06/22/5/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 18:28:34 +0000</pubDate>
		<dc:creator>theisz</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Coding Style]]></category>

		<guid isPermaLink="false">http://archlinux.me/the_isz/?p=5</guid>
		<description><![CDATA[Today a colleague and I discussed whether the pimpl-pattern was such a good idea to be used. He argued that it hides implementation details which might remind you of the internal implementation of the respective class while looking at its header file. Thus, it&#8217;s easy for you to miss stuff that you have already implemented [...]]]></description>
				<content:encoded><![CDATA[<p>Today a colleague and I discussed whether the pimpl-pattern was such a good idea to be used. He argued that it hides implementation details which might remind you of the internal implementation of the respective class while looking at its header file. Thus, it&#8217;s easy for you to miss stuff that you have already implemented but forgot about, eventually leading to you implementing it twice (or even more often).</p>
<p><span id="more-22"></span></p>
<p>Of course, he has a certain point about this. I countered that this is only the case if that person is really looking at the header file, instead of the implementation file, leading to the fundamental discussion mentioned above. In the end, I was able to convince him that the pimpl-pattern is useful by three arguments. But before enlisting them, let&#8217;s look again at how the pimpl-pattern can be implemented in C++.</p>
<p>You might declare a class like this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #666666;">// header file for Widget class</span>
<span style="color: #339900;">#include &quot;gadget.h&quot;;</span>
&nbsp;
<span style="color: #0000ff;">class</span> Widget
<span style="color: #008000;">&#123;</span>
 <span style="color: #0000ff;">public</span><span style="color: #008080;">:</span>
  <span style="color: #666666;">// public interface of Widget //</span>
 <span style="color: #0000ff;">private</span><span style="color: #008080;">:</span>
  <span style="color: #0000ff;">float</span> _topLeftCoordinates<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
  <span style="color: #0000ff;">float</span> _bottomRightCoordinates<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
&nbsp;
  Gadget _gadget<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span></pre></td></tr></table></div>

<p>A typical class definition. Now let&#8217;s see how the class would be declared employing the pimpl-pattern and the boost library:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #666666;">// header file for Widget class</span>
<span style="color: #339900;">#include &lt;boost/shared_ptr.hpp&gt;</span>
&nbsp;
<span style="color: #0000ff;">class</span> Widget
<span style="color: #008000;">&#123;</span>
 <span style="color: #0000ff;">public</span><span style="color: #008080;">:</span>
  <span style="color: #666666;">// public interface of Widget //</span>
 <span style="color: #0000ff;">private</span><span style="color: #008080;">:</span>
  boost<span style="color: #008080;">::</span><span style="color: #007788;">shared_ptr</span><span style="color: #000080;">&lt;</span><span style="color: #0000ff;">struct</span> WidgetPrivate<span style="color: #000080;">&gt;</span> _pimpl<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span></pre></td></tr></table></div>

<p>The interesting part of the implementation for this example would look like this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #666666;">// implementation file for widget class</span>
<span style="color: #339900;">#include &quot;widget.h&quot;</span>
<span style="color: #339900;">#include &quot;gadget.h&quot;</span>
&nbsp;
<span style="color: #0000ff;">struct</span> WidgetPrivate
<span style="color: #008000;">&#123;</span>
  <span style="color: #0000ff;">float</span> _topLeftCoordinates<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
  <span style="color: #0000ff;">float</span> _bottomRightCoordinates<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
&nbsp;
  Gadget _gadget<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
&nbsp;
Widget<span style="color: #008080;">::</span><span style="color: #007788;">Widget</span><span style="color: #008000;">&#40;</span> <span style="color: #ff0000; font-style: italic;">/* constructor parameters */</span> <span style="color: #008000;">&#41;</span>
<span style="color: #008080;">:</span> _pimpl<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">new</span> WidgetPrivate<span style="color: #008000;">&#41;</span>
<span style="color: #666666;">// rest of the constructor's implementation //</span></pre></td></tr></table></div>

<p>This little example demonstrates all advantages about the pimpl-pattern:</p>
<ul>
<li><strong>It makes the public interface to a class easier to identify</strong>: When a class is implemented in terms of the pimpl-pattern, all a reader needs to filter out is the line where the private object is declared. Everything else is part of the class&#8217; interface and thus important to the reader. On the other hand, the actual implementation of the class is hidden from the user, making him rely on the interface, not the (assumed) implementation of the class, which might change over time.</li>
<li><strong>It reduces compile time dependencies</strong>: By moving non-trivial object instanciations (here: <code>_gadget</code>) &#8211; which need to be allocated and therefore defined on object construction &#8211; to the implementation file, we need only very few includes in the header file. This results in less compile-time dependencies, reducing compilation times.</li>
<li>Last, but not least: <strong>A class implemented with the pimpl-pattern can be easier adapted to use the lazy-copying algorithm</strong>. As the complete state of each object is encoded in a separate structure (here: <code>WidgetPrivate</code>), it suffices to have a copied object refer to the original&#8217;s private implementation as long as there is no write-access to it. This can save a lot of time!</li>
</ul>
<p>One of the disadvantages of this pattern has been mentioned above and I&#8217;d like to mention the other as well: Every access to a class&#8217;s private members now incurs another indirection. Depending on how often the functions of your class are used, this might result in a noticeable run-time cost. However, according to the famous 80-20 rule, this disadvantage won&#8217;t affect many classes&#8230;</p>
<p>In case you wondered: Of course the pimpl-pattern can be implemented without boost just as well. It&#8217;s just that with boost&#8217;s shared_ptr implementation, we don&#8217;t need to worry about deleting our private struct as opposed to using standard pointers and won&#8217;t get compiler warnings as opposed to using std::auto_ptr (which doesn&#8217;t like forward declared structs/classes).</p>
]]></content:encoded>
			<wfw:commentRss>http://archlinux.me/theisz/2009/06/22/5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An Arch Linux xdm theme</title>
		<link>http://archlinux.me/theisz/2009/06/21/an-arch-linux-xdm-theme/</link>
		<comments>http://archlinux.me/theisz/2009/06/21/an-arch-linux-xdm-theme/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 21:33:49 +0000</pubDate>
		<dc:creator>theisz</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Arch Linux]]></category>
		<category><![CDATA[Bash]]></category>

		<guid isPermaLink="false">http://archlinux.me/the_isz/?p=15</guid>
		<description><![CDATA[Today I finalized a PKGBUILD for Xappe&#8216;s Arch Linux xdm theme, which I find really nice. For those who don&#8217;t know, xdm is a very minimal (and usually ugly) graphical login manager for the X window system. It has very few dependencies and low hardware requirements, making it a good choice for low-end environments or [...]]]></description>
				<content:encoded><![CDATA[<p>Today I finalized a PKGBUILD for <a href="http://bbs.archlinux.org/profile.php?id=16569">Xappe</a>&#8216;s Arch Linux xdm theme, which I find really nice. For those who don&#8217;t know, xdm is a very minimal (and usually ugly) graphical login manager for the X window system. It has very few dependencies and low hardware requirements, making it a good choice for low-end environments or minimalism freaks like myself&#8230;</p>
<p><span id="more-15"></span></p>
<p><a href="http://bbs.archlinux.org/profile.php?id=16569">Xappe</a> presented his theme on the <a href="http://bbs.archlinux.org/viewtopic.php?id=69299">Arch Linux Boards</a> where I saw it and tried it out immediately. I was annoyed by gdm&#8217;s many dependencies anyway&#8230; Following the &#8220;true&#8221; Arch way, I created a simple PKGBUILD, enabling me to install and uninstall it via Arch&#8217;s package manager pacman. After having posted it in the aforementioned thread, <a href="http://bbs.archlinux.org/profile.php?id=16569">Xappe</a> drew my attention to the missing dependency on the imagemagick library.</p>
<p>So I started overhauling the PKGBUILD and the package at the same time. imagemagick is a rather large library, which I didn&#8217;t find suitable for a theme to such a minimalistic login manager. That&#8217;s why I modified the theme so that it automatically tries to set the background with imagemagick, feh and xloadimage which are all optional dependencies to the package now. If none of these are available, it will just set a black background without emitting an error.</p>
<p>You can find the package at the <a href="http://aur.archlinux.org/packages.php?ID=27463">Arch User Repository</a> and the thread on which it was originally posted on the <a href="http://bbs.archlinux.org/viewtopic.php?id=69299">Arch Linux Boards</a>.</p>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://archlinux.me/theisz/2009/06/21/an-arch-linux-xdm-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
