<?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>Alex on Linux&#187; Opinion</title>
	<atom:link href="http://www.alexonlinux.com/category/articles/opinion/feed" rel="self" type="application/rss+xml" />
	<link>http://www.alexonlinux.com</link>
	<description></description>
	<lastBuildDate>Sun, 25 Jul 2010 10:00:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Distributed vs. centralized version control systems</title>
		<link>http://www.alexonlinux.com/distributed-vs-centralized-version-control-systems</link>
		<comments>http://www.alexonlinux.com/distributed-vs-centralized-version-control-systems#comments</comments>
		<pubDate>Tue, 16 Jun 2009 19:26:33 +0000</pubDate>
		<dc:creator>Alexander Sandler</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[bazaar]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[version control system]]></category>

		<guid isPermaLink="false">http://www.alexonlinux.com/?p=1435</guid>
		<description><![CDATA[When git appeared for the first time, I was convinced that I don&#8217;t need it. It seemed that git is good for large and distributed projects, like kernel. While my own needs where much more modest &#8211; manage a project with couple of dozen files and perhaps a couple of contributors at most. Couple of [...]


Related posts:<ol><li><a href='http://www.alexonlinux.com/bazaar-for-subversion-users-part-1-the-basics' rel='bookmark' title='Permanent Link: Bazaar for subversion users, part 1 &#8211; the basics'>Bazaar for subversion users, part 1 &#8211; the basics</a></li>
<li><a href='http://www.alexonlinux.com/2-reasons-why-small-package-repository-is-better-than-large' rel='bookmark' title='Permanent Link: 2 reasons why small package repository is better than large'>2 reasons why small package repository is better than large</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>When <em>git</em> appeared for the first time, I was convinced that I don&#8217;t need it. It seemed that <em>git </em>is good for large and distributed projects, like kernel. While my own needs where much more modest &#8211; manage a project with couple of dozen files and perhaps a couple of contributors at most.</p>
<p>Couple of years passed and I am now looking into <a href="http://bazaar-vcs.org/" rel="nofollow"  onclick="return TrackClick('http%3A%2F%2Fbazaar-vcs.org%2F','Bazaar')">Bazaar</a>. This is a relatively new distributed version control system. I think I&#8217;ll write more about Bazaar, but in the meantime, I&#8217;d like to share some thoughts that crossed my mind while I was playing with it.</p>
<p><span id="more-1435"></span>There&#8217;s one thing that distributed version control does much better then centralized version control. Let me explain.</p>
<p>We do commits for two reasons.</p>
<ol>
<li>We want our work backed-up. We commit to repository because we know that repositories being backed up.</li>
<li>We want to be able to track our work, i.e. keep a record of changes that we apply to the project.</li>
</ol>
<p>In centralized version control system, these two are integrated in one system. I.e. if you want to track your changes, you commit. If you want to backup your code, again, you commit.</p>
<p>Don&#8217;t know how about you, but for me, this is totally broken. I work on a small projects, usually from home. I prefer not to host Subversion server on one of my home computers, but rather have a small VPS system for this purpose. It has mirrored disks, so the data is safe, more or less.</p>
<p>The problem is that this setup is horribly slow. It uses web front-end, so it creates a new secure connection to the server for every file I commit. This is so frustrating. I bet Subversion has faster front-ends, but I doubt they will be fast enough.</p>
<p>On the other hand, with distributed version control, the two above items are separated. When you commit for code tracking purposes, you commit to your local repository. When you want to backup your code, you commit to centralized, backed-up repository. In the first case, you can commit as often as you want &#8211; do local commits, in Bazaar terms. In the later case, you can commit to the repository, lets say, nightly.</p>
<p>So, despite distributed version control systems naturally fit large projects, my mini-projects can enjoy them as well. Hence I am definitely going to try Bazaar with one of my mini-projects and report the results. Stay tuned.</p>


<p>Related posts:<ol><li><a href='http://www.alexonlinux.com/bazaar-for-subversion-users-part-1-the-basics' rel='bookmark' title='Permanent Link: Bazaar for subversion users, part 1 &#8211; the basics'>Bazaar for subversion users, part 1 &#8211; the basics</a></li>
<li><a href='http://www.alexonlinux.com/2-reasons-why-small-package-repository-is-better-than-large' rel='bookmark' title='Permanent Link: 2 reasons why small package repository is better than large'>2 reasons why small package repository is better than large</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.alexonlinux.com/distributed-vs-centralized-version-control-systems/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>6 things that I miss in bash</title>
		<link>http://www.alexonlinux.com/6-things-that-i-miss-in-bash</link>
		<comments>http://www.alexonlinux.com/6-things-that-i-miss-in-bash#comments</comments>
		<pubDate>Tue, 09 Jun 2009 18:20:36 +0000</pubDate>
		<dc:creator>Alexander Sandler</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Short articles]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[enhancement]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[scp]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.alexonlinux.com/?p=1395</guid>
		<description><![CDATA[What is the most frequently used piece of software on your computer? Here&#8217;s one program that holds one of the highest place in my list of most frequently used programs. I am talking about&#8230; bash. In case you don&#8217;t know, this is the program behind large portion of the Linux command line. It is the [...]


Related posts:<ol><li><a href='http://www.alexonlinux.com/one-sane-voice-in-the-crowd' rel='bookmark' title='Permanent Link: One sane voice in the crowd'>One sane voice in the crowd</a></li>
<li><a href='http://www.alexonlinux.com/creating-new-application-on-top-of-ssh' rel='bookmark' title='Permanent Link: Creating new application on top of SSH'>Creating new application on top of SSH</a></li>
<li><a href='http://www.alexonlinux.com/is-desktop-linux-too-fragmented-to-succeed' rel='bookmark' title='Permanent Link: Is desktop Linux too fragmented to succeed?'>Is desktop Linux too fragmented to succeed?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>What is the most frequently used piece of software on your computer? Here&#8217;s one program that holds one of the highest place in my list of most frequently used programs. I am talking about&#8230; <em>bash</em>.</p>
<p>In case you don&#8217;t know, this is the program behind large portion of the Linux command line. It is the program that actually makes majority of work turning Linux command line into such a magnificent tool it is.</p>
<p>As for use frequency, on my computer the only program that beats it is perhaps a web browser. I use it more often than mail client, text processor or just any other program.</p>
<p>Now, one thing that entertains me is that there is absolutely no hype around <em>bash</em>. I mean, you probably know that next version of Firefox coming tomorrow (I am writing this on June 9th, 2009). But do you know when next version of <em>bash</em> is coming? Do you even know what is the version of <em>bash</em> that you currently use? Well, you are not alone &#8211; I have no clue either <img src='http://www.alexonlinux.com/wp-content/plugins/smilies-themer/modern/smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><span id="more-1395"></span>One thing that concerns me is that <em>bash</em> almost didn&#8217;t change for the last ten years. I mean the only new feature that, to my knowledge, it didn&#8217;t support ten years ago is <em>bash_completion</em> &#8211; that is the advanced version of plain completion that it does to files. I could be wrong about this of course, but one thing is certain. Whatever the changes are, they are unnoticeable.</p>
<p>So, I thought that I&#8217;d compile a list of features that I would like to see in the upcoming version of <em>bash</em>. Now really, if only one of them would become a reality, I&#8217;d chew my pair of orange Crocs (I do have a pair of orange Crocs), put it on video and post it on youtube. Alright, I won&#8217;t do that. But it would still be very nice to see these happening.</p>
<p>The list:</p>
<h3>1 &#8211; History sharing</h3>
<p>I often open multiple shells. It would be really nice to be able to synchronize history between them. Right now, it seems that <em>bash</em> writes history file when it shuts down. If you open another session after history has been saved, you can access commands that you&#8217;ve typed in in the previous session. Otherwise, the history between two sessions is completely independent. Not good.</p>
<h3>2 &#8211; Completion of directory and file names based on their usage</h3>
<p>I think that 90% of <em>cd</em>&#8216;s that I do are all destined to the same directory. Why on earth I see  the list of possible destination for <em>cd</em> in alphabetical order every time I press TAB?</p>
<h3>3 &#8211; Completion of make targets</h3>
<p>I know this has already been implemented. But I am wondering why it isn&#8217;t part of <em>bash_completion</em> package on Ubuntu. OpenSuSE is no better &#8211; it does completion only to some <em>yast</em> stuff.</p>
<h3>4 &#8211; Show a browseable and searchable list of files when hitting TAB key twice</h3>
<p>I guess you all know that. Single TAB key completes a word if it can make a single match. Double TAB shows a list of choices for completion. In case the list is too long, it builds a long list and pipes it through <em>more</em>.</p>
<p>What I would like to see is a browseable and searchable list. One that I can browse with arrow keys. I also would like to be able to enter portion of the file name and in that case <em>bash</em> should filter out everything that doesn&#8217;t match the criteria I&#8217;ve entered.</p>
<h3>5 &#8211; Completion of <em>scp</em>, on remote host</h3>
<p>I guess it happened to all of us. Copying file to a remote computer with <em>scp</em>, is always difficult because you actually have to remember the path on remote computer. Wouldn&#8217;t it be great if <em>bash</em> could complete remote paths as well?</p>
<p>Now, I know this is very difficult to implement. Basically you have to spawn <em>ssh</em> with <em>ls</em> command, wait for it to complete and parse the results. Oh and there is a password thing. You gotta take care of password prompt that <em>ssh</em> may produce. Have no idea how to solve this issue. I do see a couple of options, but all of them are far from being ideal.</p>
<h3>6 &#8211; Fix typos</h3>
<p>This one is simple. As long as I don&#8217;t hit the TAB key, no need to fix anything. Once I hit the TAB key, shell should check if the command I&#8217;ve entered makes sense and if not try to fix it. Good example of what could make sense are file names. <em>vi &lt;filename&gt; </em>probably means that you want to edit a file. If the file does not exist and yet there&#8217;s another file with almost identical name, fix it. Same with <em>cd</em>. You don&#8217;t <em>cd</em> into directories that don&#8217;t exist. So once shell detects an attempt to do so and the user asks for help (by pressing the TAB key), shell can fix the typo and make the user smile.</p>
<p>This is it. I hope to see any of these happening one day. In the meantime, enjoy the list and by all means leave comments with your ideas of <em>bash</em> enhancements.</p>


<p>Related posts:<ol><li><a href='http://www.alexonlinux.com/one-sane-voice-in-the-crowd' rel='bookmark' title='Permanent Link: One sane voice in the crowd'>One sane voice in the crowd</a></li>
<li><a href='http://www.alexonlinux.com/creating-new-application-on-top-of-ssh' rel='bookmark' title='Permanent Link: Creating new application on top of SSH'>Creating new application on top of SSH</a></li>
<li><a href='http://www.alexonlinux.com/is-desktop-linux-too-fragmented-to-succeed' rel='bookmark' title='Permanent Link: Is desktop Linux too fragmented to succeed?'>Is desktop Linux too fragmented to succeed?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.alexonlinux.com/6-things-that-i-miss-in-bash/feed</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>Is desktop Linux too fragmented to succeed?</title>
		<link>http://www.alexonlinux.com/is-desktop-linux-too-fragmented-to-succeed</link>
		<comments>http://www.alexonlinux.com/is-desktop-linux-too-fragmented-to-succeed#comments</comments>
		<pubDate>Tue, 12 May 2009 08:07:39 +0000</pubDate>
		<dc:creator>Alexander Sandler</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Short articles]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[marketing]]></category>
		<category><![CDATA[money]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.alexonlinux.com/?p=1282</guid>
		<description><![CDATA[This question is especially relevant after yesterday&#8217;s fiasco. I ran into an article whose name is exactly Is desktop Linux too fragmented to succeed? The article argues that the fragmentation is what keeping Linux Desktop from beating Mac OS and even Windows. It is because the effort to create Linux desktop is scattered across multiple [...]


Related posts:<ol><li><a href='http://www.alexonlinux.com/ubuntu-904-with-wubi-failure' rel='bookmark' title='Permanent Link: Ubuntu 9.04 with Wubi &#8211; Failure'>Ubuntu 9.04 with Wubi &#8211; Failure</a></li>
<li><a href='http://www.alexonlinux.com/what-kept-me-from-sticking-to-ubuntu-as-a-desktop-solution' rel='bookmark' title='Permanent Link: What kept me from sticking to Ubuntu as a desktop solution'>What kept me from sticking to Ubuntu as a desktop solution</a></li>
<li><a href='http://www.alexonlinux.com/6-things-that-i-miss-in-bash' rel='bookmark' title='Permanent Link: 6 things that I miss in bash'>6 things that I miss in bash</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This question is especially relevant after <a href="http://www.alexonlinux.com/ubuntu-904-with-wubi-failure" onclick="return TrackClick('http%3A%2F%2Fwww.alexonlinux.com%2Fubuntu-904-with-wubi-failure','yesterday%22s+fiasco')">yesterday&#8217;s fiasco</a>. I ran into an article whose name is exactly <a href="http://www.computerworld.com/action/article.do?command=viewArticleBasic&amp;taxonomyName=Software&amp;articleId=9132157&amp;taxonomyId=18&amp;pageNumber=2" rel="nofollow"  onclick="return TrackClick('http%3A%2F%2Fwww.computerworld.com%2Faction%2Farticle.do%3Fcommand%3DviewArticleBasic%26amp%3BtaxonomyName%3DSoftware%26amp%3BarticleId%3D9132157%26amp%3BtaxonomyId%3D18%26amp%3BpageNumber%3D2','Is+desktop+Linux+too+fragmented+to+succeed')">Is desktop Linux too fragmented to succeed</a>?</p>
<p>The article argues that the fragmentation is what keeping Linux Desktop from beating Mac OS and even Windows. It is because the effort to create Linux desktop is scattered across multiple distribution, it cannot become a serious player in desktop solutions.</p>
<p>Toward its end, the article gives optimistic prospects. There are some efforts to bring Linux desktop community to common ground, unanswered though.</p>
<p><span id="more-1282"></span></p>
<h2>This is so wrong</h2>
<p>The truth is that are some points in the article that made my eyebrows go up. You see, having single desktop Linux distribution is impossible. This is against the nature of Linux and how its being distributed.</p>
<p>To get it moving you have to talk big distributors into this. But for big distributors, their desktop solution is one way or another their selling point. RedHat compete with Novell through Fedora and OpenSuSE. Moreover, they don&#8217;t want common ground. They want to compete.</p>
<p>Small distributions want their piece of the big cake too. Asking them to provide the same desktop solution would be as asking them to close their business &#8211; if they wanted to be a part of joined effort to make the world better place and Linux better desktop OS, people behind the distro could simply join someone else&#8217;s project.</p>
<p>Actually, this entire idea seems to be taken from socialism. We take something from everyone and create something that everyone would use. Sounds great, but this creates so called moral hazards. This strips away the will of competition. And competition is the driving force behind many of the technological marvels that we see today in general and in Linux in particular.</p>
<h2>The only way to improve Linux&#8217;s position in desktop market is</h2>
<p>to invest money into development of better Linux desktop.</p>
<p>Actually the author of the article was addressing the same issue, but from different angle. Linux desktop needs money. It needs more graphical designers, more QA engineers and more software engineers.</p>
<p>It straggles to become a serious desktop operating system because no one did usability testing. Because no one hired best UI designers, as Apple did. Because no one had hired enough QA engineers to make sure that all the software indeed works.</p>
<p>One way to overcome this problem is indeed by combining the effort. The problem is that Fedora isn&#8217;t there to beat Windows in desktop OS market. Fedora is a beta version of RedHat&#8217;s server systems. Same can be said about OpenSuSE, Ubuntu and most of the Linux distros.</p>
<p>Obviously money can be spent on nothing useful. Hundred engineers will not do in one month what ten engineers do in ten month. However, financing creates opportunity. And opportunity is exactly what Linux desktop needs.</p>


<p>Related posts:<ol><li><a href='http://www.alexonlinux.com/ubuntu-904-with-wubi-failure' rel='bookmark' title='Permanent Link: Ubuntu 9.04 with Wubi &#8211; Failure'>Ubuntu 9.04 with Wubi &#8211; Failure</a></li>
<li><a href='http://www.alexonlinux.com/what-kept-me-from-sticking-to-ubuntu-as-a-desktop-solution' rel='bookmark' title='Permanent Link: What kept me from sticking to Ubuntu as a desktop solution'>What kept me from sticking to Ubuntu as a desktop solution</a></li>
<li><a href='http://www.alexonlinux.com/6-things-that-i-miss-in-bash' rel='bookmark' title='Permanent Link: 6 things that I miss in bash'>6 things that I miss in bash</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.alexonlinux.com/is-desktop-linux-too-fragmented-to-succeed/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 9.04 with Wubi &#8211; Failure</title>
		<link>http://www.alexonlinux.com/ubuntu-904-with-wubi-failure</link>
		<comments>http://www.alexonlinux.com/ubuntu-904-with-wubi-failure#comments</comments>
		<pubDate>Sun, 10 May 2009 20:03:20 +0000</pubDate>
		<dc:creator>Alexander Sandler</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Short articles]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[failure]]></category>
		<category><![CDATA[israel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wireless]]></category>
		<category><![CDATA[wubi]]></category>

		<guid isPermaLink="false">http://www.alexonlinux.com/?p=1268</guid>
		<description><![CDATA[Once every year or so, I get so frustrated with Windows Desktop that I decide to install Linux. I am a big fun of Ubuntu Linux. I use it for many things, this includes a server platform for this web-site. So most natural choice for me was to try Ubuntu 9.04, the latest version. I [...]


Related posts:<ol><li><a href='http://www.alexonlinux.com/is-desktop-linux-too-fragmented-to-succeed' rel='bookmark' title='Permanent Link: Is desktop Linux too fragmented to succeed?'>Is desktop Linux too fragmented to succeed?</a></li>
<li><a href='http://www.alexonlinux.com/what-kept-me-from-sticking-to-ubuntu-as-a-desktop-solution' rel='bookmark' title='Permanent Link: What kept me from sticking to Ubuntu as a desktop solution'>What kept me from sticking to Ubuntu as a desktop solution</a></li>
<li><a href='http://www.alexonlinux.com/few-thoughts-about-ubuntu-servers-and-centos' rel='bookmark' title='Permanent Link: Few thoughts about Ubuntu servers and CentOS'>Few thoughts about Ubuntu servers and CentOS</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Once every year or so, I get so frustrated with Windows Desktop that I decide to install Linux. I am a big fun of Ubuntu Linux. I use it for many things, this includes a server platform for this web-site. So most natural choice for me was to try Ubuntu 9.04, the latest version. I installed it on my Laptop computer using a program called <a href="http://wubi-installer.org/" rel="nofollow"  onclick="return TrackClick('http%3A%2F%2Fwubi-installer.org%2F','Wubi')">Wubi</a>.</p>
<p>Wubi is a program that installs Ubuntu Linux on top of installed Windows. I already had a Windows installation on my laptop, that I didn&#8217;t want to destroy. This is why I&#8217;ve chosen Wubi. It places root file-system in a file on Windows partition. Because of this feature, you don&#8217;t even need a partition to install Ubuntu.</p>
<p><span id="more-1268"></span></p>
<h2>What got me into this</h2>
<p>What got me into Linux desktop frenzy this time, is Vista&#8217;s slowness. We all know various virtues of Microsoft&#8217;s operating systems. But installing Linux desktop instead&#8230; Silly me. It took me just four hours to figure out that I am better with slowness. Four hours I usually don&#8217;t have.</p>
<p>I am full of respect to developers of Linux. I work with Linux and develop for it for many years and I think this is a great server platform, unmatched by any other OS. But, Linux desktop is unfortunately isn&#8217;t too mature to be a serious match for Windows as a Desktop OS.</p>
<p>Knowing this from my previous attempts to install Linux desktop, I tried a less destructive option out of all. That is, Wubi doesn&#8217;t change your existing Windows installation. It install Ubuntu Linux as if it was another Windows program.</p>
<h2>Installing Wubi</h2>
<p>Problems started with Wubi itself. I live in Israel and although I use English version of Vista, Wubi installation has decided that I am better with Hebrew. Entire installation procedure was in Hebrew.</p>
<p>Next, despite I explicitly told Wubi that I want English version of Ubuntu, it installed Hebrew version. I checked on Wubi&#8217;s web-site and it appeared someone reported this particular bug just few days before. And it already had a solution &#8211; developers presented a new revision of Wubi which wasn&#8217;t yet publicly available, but solved the problem. The installation interface language remained Hebrew, but at least it installed English version of Ubuntu.</p>
<p>Now in case you wonder why I had to reinstall entire operating system just because of interface language, I&#8217;ll explain you. You see, I am not very familiar with Ubuntu&#8217;s graphical interface and I didn&#8217;t know how to configure wireless network. Hebrew interface made it even more complicated for me, so I decided to get things right form the start and not to begin tackling problems on unfamiliar ground.</p>
<p>On the other hand, because I didn&#8217;t have internet access, I could not just install English support it as I would do otherwise.</p>
<h2>Now to Ubuntu</h2>
<p>My next task, after installing the Linux itself, was to configure wireless network. The installation program did detect both wired and wireless card. However, the network interfaces configuration program didn&#8217;t show the wireless interface &#8211; only the wired. Luckily, simply pressing Add solved the problem. New dialog, popped up, asking me what is my SSID.</p>
<p>I am lucky to have some background in wireless networking, otherwise I would not know what SSID is. In case you&#8217;re wondering, this is the name of your wireless network. Anyway, it appeared that I&#8217;ve forgotten name of my wireless network and I had to use my cell. phone (which luckily supports wi-fi) to find the name. Not to mention I&#8217;ve absolutely forgotten that I&#8217;ve used WPA2-PSK security for my network. I had to choose it manually too, but before that I had to investigate it with my cell. phone.</p>
<p>I must say that Ubuntu could ship a program that scans for wireless networks, but it just wasn&#8217;t there.</p>
<p>On the bright side, once I entered right values for SSID and encryption, it got connected immediately.</p>
<h2>The breaking point</h2>
<p>The next thing I planned to do was mounting my Windows partitions. Somehow mounting my C: drive wasn&#8217;t that difficult. The desktop was empty. I right clicked on it, created a new directory and then double clicked on it. It opened gnome file explorer. Then I pressed the computer button and here they were, my CD-ROM and C: drive. Clicking on C: drive, created a C: drive icon on the desktop and I could safely delete the directory I created, knowing that I can always open gnome explorer by clicking on C: drive icon.</p>
<p>Now I know that there are several ways of opening gnome explorer, but I just couldn&#8217;t find them.</p>
<p>Anyway, note that I have two partitions and gnome explorer only showed me one of them. It appeared to me that something is wrong with D: drive and I should try to mount it. I went to Add/Remove programs and added a program called <em>Disk Management</em>. It seemed logical to me that I need some program that manipulates disks, so I searched for <em>disk </em>and found that <em>Disk Management</em> program. However, once I started it, it reported that I don&#8217;t have disks at all.</p>
<p>This was the breaking point. Playing around with Ubuntu was fun, but I had to stop and go back to the world of productivity &#8211; where at least sometimes things work.</p>
<h2>Conclusion</h2>
<p>Linux is a great operating system and like I mentioned I feel lots of respect to developers of Ubuntu and Linux for the job they are doing. This is especially true because I owe my income to Linux, for the last decade. Linux has given me a profession and I am grateful for that. However it seems that, regrettably, Ubuntu, one of the the undoubtful leaders among Linux distributions, is still too immature as a Desktop solution. Too many things are not obvious. Too many things just don&#8217;t work out of the box. Yes I could find a solution for everything, but I am just too busy person to search solutions for everything.</p>


<p>Related posts:<ol><li><a href='http://www.alexonlinux.com/is-desktop-linux-too-fragmented-to-succeed' rel='bookmark' title='Permanent Link: Is desktop Linux too fragmented to succeed?'>Is desktop Linux too fragmented to succeed?</a></li>
<li><a href='http://www.alexonlinux.com/what-kept-me-from-sticking-to-ubuntu-as-a-desktop-solution' rel='bookmark' title='Permanent Link: What kept me from sticking to Ubuntu as a desktop solution'>What kept me from sticking to Ubuntu as a desktop solution</a></li>
<li><a href='http://www.alexonlinux.com/few-thoughts-about-ubuntu-servers-and-centos' rel='bookmark' title='Permanent Link: Few thoughts about Ubuntu servers and CentOS'>Few thoughts about Ubuntu servers and CentOS</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.alexonlinux.com/ubuntu-904-with-wubi-failure/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Python&#8217;s optparse for human beings</title>
		<link>http://www.alexonlinux.com/pythons-optparse-for-human-beings</link>
		<comments>http://www.alexonlinux.com/pythons-optparse-for-human-beings#comments</comments>
		<pubDate>Wed, 29 Apr 2009 08:23:17 +0000</pubDate>
		<dc:creator>Alexander Sandler</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Programming Articles]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[line]]></category>
		<category><![CDATA[modules]]></category>
		<category><![CDATA[options]]></category>
		<category><![CDATA[optparse]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.alexonlinux.com/?p=1162</guid>
		<description><![CDATA[In this article I cover in depth Python's optparse module. It presents most useful recipes and is a good handbook when parsing command line options in a Python program.


No related posts.]]></description>
			<content:encoded><![CDATA[<h1>Table of contents</h1>
<p><div class="toc"><a title='table_of_contents' name='table_of_contents'></a><a class='toc_h1' href='#introduction'>Introduction</a><br />
<a class='toc_h1' href='#what_do_we_do_with_command_line_options'>What do we do with command line options</a><br />
<a class='toc_h1' href='#optparse_basics'><em>optparse</em> basics</a><br />
<a class='toc_h2' href='#adding_options'>Adding options</a><br />
<a class='toc_h2' href='#specifying_help_string_for_an_option'>Specifying help string for an option</a><br />
<a class='toc_h2' href='#telling_optparse_to_parse_arguments'>Telling <em>optparse</em> to parse arguments</a><br />
<a class='toc_h2' href='#putting_it_together'>Putting it together</a><br />
<a class='toc_h1' href='#optparse_cookbook'><em>optparse</em> cookbook</a><br />
<a class='toc_h2' href='#support_for_a_standalone_command_line_options'>Support for a standalone command line options</a><br />
<a class='toc_h2' href='#support_for_mandatory_(required)_options.'>Support for mandatory (required) options.</a><br />
<a class='toc_h2' href='#support_for_options_with_one_or_more_arguments'>Support for options with one or more arguments</a><br />
<a class='toc_h2' href='#option_destination_types'>Option destination types</a><br />
<a class='toc_h2' href='#dependencies_between_options'>Dependencies between options</a><br />
<a class='toc_h2' href='#help_screen_customizations'>Help screen customizations</a><br />
<a class='toc_h3' href='#grouping_options'>Grouping options</a><br />
<a class='toc_h3' href='#changing_programs_usage_string'>Changing programs usage string</a><br />
<a class='toc_h3' href='#telling_option&#8217;s_default_value'>Telling option&#8217;s default value</a><br />
<a class='toc_h3' href='#better_argument_description'>Better argument description</a><br />
<a class='toc_h3' href='#adding_program_description'>Adding program description</a><br />
<a class='toc_h3' href='#adding_epilog'>Adding epilog</a><br />
<a class='toc_h2' href='#program_version_string'>Program version string</a><br />
<a class='toc_h1' href='#conclusion'>Conclusion</a><br />
<a class='toc_h1' href='#introduction'>Introduction</a><br />
<a class='toc_h1' href='#what_do_we_do_with_command_line_options'>What do we do with command line options</a><br />
<a class='toc_h1' href='#optparse_basics'><em>optparse</em> basics</a><br />
<a class='toc_h2' href='#adding_options'>Adding options</a><br />
<a class='toc_h2' href='#specifying_help_string_for_an_option'>Specifying help string for an option</a><br />
<a class='toc_h2' href='#telling_optparse_to_parse_arguments'>Telling <em>optparse</em> to parse arguments</a><br />
<a class='toc_h2' href='#putting_it_together'>Putting it together</a><br />
<a class='toc_h1' href='#optparse_cookbook'><em>optparse</em> cookbook</a><br />
<a class='toc_h2' href='#support_for_a_standalone_command_line_options'>Support for a standalone command line options</a><br />
<a class='toc_h2' href='#support_for_mandatory_(required)_options.'>Support for mandatory (required) options.</a><br />
<a class='toc_h2' href='#support_for_options_with_one_or_more_arguments'>Support for options with one or more arguments</a><br />
<a class='toc_h2' href='#option_destination_types'>Option destination types</a><br />
<a class='toc_h2' href='#dependencies_between_options'>Dependencies between options</a><br />
<a class='toc_h2' href='#help_screen_customizations'>Help screen customizations</a><br />
<a class='toc_h3' href='#grouping_options'>Grouping options</a><br />
<a class='toc_h3' href='#changing_programs_usage_string'>Changing programs usage string</a><br />
<a class='toc_h3' href='#telling_option&#8217;s_default_value'>Telling option&#8217;s default value</a><br />
<a class='toc_h3' href='#better_argument_description'>Better argument description</a><br />
<a class='toc_h3' href='#adding_program_description'>Adding program description</a><br />
<a class='toc_h3' href='#adding_epilog'>Adding epilog</a><br />
<a class='toc_h2' href='#program_version_string'>Program version string</a><br />
<a class='toc_h1' href='#conclusion'>Conclusion</a><br />
</div>
</p>
<h1><a title='introduction' name='introduction'></a>Introduction<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h1>
<p>This article extends <em>optparse</em>&#8216;s documentation. <em>optparse</em> is a Python&#8217;s module that allows your program to easily parse command line options it receives. In addition, it takes care of some of the very common tasks, such as handling -h command line option.</p>
<p><em>optparse</em> is one of those modules that are an absolutely must have for almost every project. However, because we start new project so seldom, it is difficult to remember all those recipes that we come up with, every time we add a new command line option. This article is an attempt to bring together such recipes.</p>
<p><a href="http://docs.python.org/library/optparse.html" rel="nofollow" title="Link to official optparse's documentation"  onclick="return TrackClick('http%3A%2F%2Fdocs.python.org%2Flibrary%2Foptparse.html','Link+to+official+optparse')"><em>optparse</em>&#8216;s official documentation</a> lacks some very important information. On the contrary to official documentation, in this document I am trying to give you more hands-on kind of documentation. This article is a cookbook of things that you do with <em>optparse</em> most often.</p>
<h1><a title='what_do_we_do_with_command_line_options' name='what_do_we_do_with_command_line_options'></a>What do we do with command line options<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h1>
<p>Every time we use <em>optparse</em>, we use it to do a number of things. Obviously we want our program to support command line options. What varies is the type of options we want to support. Some options doesn&#8217;t have additional arguments (boolean options). Others are mandatory. Some require one or more arguments. Finally, we may want options to depend on each other &#8211; i.e. we may want one option to depend on presence of another.</p>
<p>These are most common things that we would like to implement, but there are more. Lets try to build a list of all such functionalities that we may want to implement.</p>
<ul>
<li>Support for a standalone command line options (boolean options).</li>
<li>Support for mandatory (required) options.</li>
<li>Support for options with one or more arguments.</li>
<li>Default values for options.</li>
<li>Dependency between options.</li>
<li>Grouping of options in help screen.</li>
<li>Customizing help screen.</li>
</ul>
<p>However, before we dig into implementation details of each and every one of these bullets, lets see the basics of using <em>optparse</em>.</p>
<h1><a title='optparse_basics' name='optparse_basics'></a><em>optparse</em> basics<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h1>
<p>No matter what you do with <em>optparse</em>, it all starts with importing <em>optparse </em>and instantiating <em>OptionParser</em> class.</p>
<pre class="brush:py">import optparse

parser = optparse.OptionParser()</pre>
<h2><a title='adding_options' name='adding_options'></a>Adding options<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h2>
<p>To add an option, we should use <em>OptionParser</em>&#8216;s method called <em>add_option()</em>. It accepts a large number of parameters. For now, we will see only the most basic. We will see more advanced parameters later in this article. Note that we should call <em>add_option()</em> for every option that we would like our program to support.</p>
<p>Obviously the most important parameter tells what command line option we would like to support. Lets say that for sake of this article we would like our little Python script to support -n command line option. Also, we would like -n to have longer sibling &#8211;new. &#8211;new and -n would have the same meaning, but one is shorter and the other longer and more verbose.</p>
<p>This is how we add these options.</p>
<pre class="brush:py">parser.add_option('-n', '--new')</pre>
<p>Note that by all means this is not enough to be able to parse even simplest case of command line options. This is only the basics.</p>
<h2><a title='specifying_help_string_for_an_option' name='specifying_help_string_for_an_option'></a>Specifying help string for an option<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h2>
<p>One more thing that is very common when using <em>optparse</em> is to give a short help string that would tell user what this particular command line option does. <em>optparse</em> will print this string if user runs your program with -h.</p>
<p>To specify such help string pass parameter named <em>help</em> to <em>add_option()</em>. Like this:</p>
<pre class="brush:py">parser.add_option('-n', '--new', help='creates a new object')</pre>
<h2><a title='telling_optparse_to_parse_arguments' name='telling_optparse_to_parse_arguments'></a>Telling <em>optparse</em> to parse arguments<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h2>
<p>Once we&#8217;ve added all the options we want our program to support, we should tell <em>optparse</em> that it is time to do actual parsing. This is how we do it.</p>
<pre class="brush:py">(opts, args) = parser.parse_args()</pre>
<p><em>parse_args() </em>method returns a tuple of objects. First object, <em>opts</em>, contains all values we&#8217;ve received via command line. We will learn how to use this later in the article.</p>
<p><em>args</em> is a list of words that contain everything that left after options that parser recognizes. This is useful if you want your program to support indefinite number of arguments &#8211; like in <em>cp</em> or <em>mv</em> Unix commands, where you specify options first and then a long list of files to copy/move, followed by a destination directory.</p>
<h2><a title='putting_it_together' name='putting_it_together'></a>Putting it together<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h2>
<p>This is how our script looks like so far.</p>
<pre class="brush:py">#!/usr/bin/python

import optparse

parser = optparse.OptionParser()
parser.add_option('-n', '--new', help='creates a new object')

(opts, args) = parser.parse_args()</pre>
<p>Running it with -h command line option, would produce following result.</p>
<pre class="brush: plain; gutter: false;">alex ~/works/args -&gt; ./args.py -h
Usage: args.py [options]

Options:
  -h, --help         show this help message and exit
  -n NEW, --new=NEW  creates a new object
alex ~/works/args -&gt;</pre>
<p>args.py is the name I had given to the script. Take this little nice help screen. Note that we didn&#8217;t do a thing to make it appear. This is where power of <em>optparse</em> begins.</p>
<h1><a title='optparse_cookbook' name='optparse_cookbook'></a><em>optparse</em> cookbook<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h1>
<p>What we saw until now were common things that you do with <em>optparse</em> to operate it. No matter what options you would like your program to support and what are relationships between the options, you have to instantiate <em>OptionParser</em> and have to call <em>parse_args()</em> method.</p>
<p>However, few methods that we&#8217;ve seen so far, are useless by themselves. We use them to do more specific things, which we will study in this section of the article.</p>
<h2><a title='support_for_a_standalone_command_line_options' name='support_for_a_standalone_command_line_options'></a>Support for a standalone command line options<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h2>
<p>I call such options boolean options because eventually we want some boolean variable to indicate if <em>optparse</em> saw the option or not.</p>
<p>For the sake of the demonstration, lets say we want our script to support -b option. When this option is specified, we want some variable to be True. This is how we do it.</p>
<pre class="brush:py">parser.add_option('-b', help='boolean option', dest='bool', \
    default=False, action='store_true')

(opts, args) = parser.parse_args()</pre>
<p>Note three new named parameters that we&#8217;re passing to <em>add_option()</em>. <em>dest</em> specifies the name of the variable that will hold True or False value once <em>optparse</em> runs into -b. <em>default</em> specifies default value of the variable, in case <em>optparse</em> doesn&#8217;t find -b. Finally <em>action</em> tells <em>optparse</em> what to do when it runs into -b. <em>store_true</em> action tells <em>optparse</em> to place True value into <em>bool</em> once it detects -b.</p>
<p>Additional action that we may want to use called <em>store_false</em>. It tells <em>optparse</em> to set a value of <em>bool</em> to False. Note that when we use <em>store_false</em>, we better change <em>default</em> value to something other than False &#8211; otherwise you won&#8217;t be able to see the difference between when -b is there and it is not.</p>
<p>Once <em>parse_args()</em> finishes, you can access the variable via <em>opts.bool</em>. You can drop the default value of the variable. In this case, if you don&#8217;t specify -b command line option, value of <em>opts.bool</em> will be None.</p>
<h2><a title='support_for_mandatory_(required)_options.' name='support_for_mandatory_(required)_options.'></a>Support for mandatory (required) options.<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h2>
<p><em>optparse </em>itself doesn&#8217;t support mandatory options. As <em>optparse</em>&#8216;s documentation states, mandatory options are a bad practice and should be avoided. However, I think that at the end, it is your choice to make and modules such as <em>optparse</em> should give you the tools to do things that you want to do. This said, this is what I usually do to have a mandatory option.</p>
<p>For a single variable, just don&#8217;t set default value for it and check if <em>opts.&lt;variable name&gt;</em> is None, after <em>opt_parse()</em>. Like this:</p>
<pre class="brush:py">parser.add_option('-m', help='mandatory option', dest='man',
    action='store_true')

(opts, args) = parser.parse_args()

if opts.man is None:
    print "A mandatory option is missing\n"
    parser.print_help()
    exit(-1)</pre>
<p>Obviously, when a mandatory option is missing, we want to do something about it. This can be anything of course, but most likely you want to tell about the mistake and print a help message. This is exactly what happens in lines 7-9.</p>
<p>But what if you have multiple mandatory options? Well, we can do exactly the same, but for several options. Lets have a look.</p>
<pre class="brush:py">parser.add_option('-m', help='mandatory option', dest='man',
    action='store_true')
parser.add_option('-p', help='mandatory option', dest='pan',
    action='store_true')

(opts, args) = parser.parse_args()

# Making sure all mandatory options appeared.
mandatories = ['man', 'pan']
for m in mandatories:
    if not opts.__dict__[m]:
        print "mandatory option is missing\n"
        parser.print_help()
        exit(-1)</pre>
<p>Here, we have two mandatory options: -m and -p. In lines 9-14, I build a list of all mandatory options (represented by their destination property name), run through the list and see if any of them is None. If so, it prints an error message, help message and returns.</p>
<h2><a title='support_for_options_with_one_or_more_arguments' name='support_for_options_with_one_or_more_arguments'></a>Support for options with one or more arguments<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h2>
<p>With <em>optparse</em> we can parse options with an argument and even several arguments. This is how we do it.</p>
<div style="font-family: &quot;Consolas&quot;; font-size: 11pt; color: #000000; background-color: #ffffff; font-style: normal; font-weight: normal; text-decoration: none;">
<pre class="brush:py">parser.add_option('-s', help='arguments', dest='opt_args', \
    action='store')</pre>
</div>
<p>This example is somewhat different from what we&#8217;ve seen before. Here, use an action named <em>store</em>. This action, tells <em>optparse</em> to store option&#8217;s argument in specified destination member of <em>opts</em>.</p>
<p>How about having an option with two or three arguments. It is doable as well.</p>
<pre class="brush:py">parser.add_option('-M', help='multiple arguments', dest='multi', \
    action='store', nargs=2)</pre>
<p>As you can see, you can tell <em>optparse</em> how many arguments you want some option to support. To do this, we pass <em>nargs </em>parameter to <em>add_option()</em>. Its default value is 1. This is why we could omit it when we registered option with a single argument. However, if we need two or more options, <em>nargs </em>is a must.</p>
<p>In this case <em>parse_args()</em> will place all arguments in a tuple. I.e. after we run <em>parse_args()</em>, <em>opt.multi</em> will be a tuple containing all arguments that user has passed to our program.</p>
<h2><a title='option_destination_types' name='option_destination_types'></a>Option destination types<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h2>
<p>By default, all members of <em>opts</em> object will be strings. I.e. when you specify a destination for your argument, its type is string, by default. However, it doesn&#8217;t have to be this way. You can change the type of the destination variable for the argument by passing <em>add_option()</em> a parameter named <em>type</em>. Note that default <em>type</em> is string. Despite you can always convert string into anything you want, you can ask <em>optparse</em> to do it for you. This is how.</p>
<pre class="brush:py">parser.add_option('-s', help='arguments', dest='opt_args', \
    action='store', type='int', default=10)
parser.add_option('-M', help='multiple arguments', dest='multi', \
    action='store', nargs=2, type='string')</pre>
<p>Here we&#8217;ve specified int type for -s and string type for -M. Note default value of -s. It should be of the same type as option itself.</p>
<p>Also note -M. Although <em>optparse</em> turns two arguments into a tuple, it does not support different types for several arguments. So, when an option has multiple arguments, their type should be the same.</p>
<h2><a title='dependencies_between_options' name='dependencies_between_options'></a>Dependencies between options<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h2>
<p>As with mandatory options, <em>optparse</em> does not give you much help setting dependencies between various options. If you still want to have some relationship between options, you have to implement it manually, after <em>parse_args()</em> is over.</p>
<p>Luckily this is not very difficult thing to do. Remember how we&#8217;ve implemented mandatory options? We can do the same here.</p>
<pre class="brush:py">parser.add_option('-A', help='option A', dest='a',
    action='store_true')
parser.add_option('-B', help='option B', dest='b',
    action='store_true')

(opts, args) = parser.parse_args()

if opts.b and not opts.a:
    print "Option B requires option A\n"
    parser.print_help()
    exit(-1)</pre>
<p>Here, option B requires option A. If B is there, but A is missing, script will produce an error message, print help screen and exit.</p>
<h2><a title='help_screen_customizations' name='help_screen_customizations'></a>Help screen customizations<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h2>
<h3><a title='grouping_options' name='grouping_options'></a>Grouping options<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h3>
<p><em>optparse</em> has a neat feature allowing you to group options. You can create as many groups as you want. Each group will have a short description that would appear on help screen. Also, you can use option groups to group options inside of your program, making it easier to understand and more readable. This is how you do it.</p>
<p>First, we create an option parser as we usually do.</p>
<pre class="brush:py">parser = optparse.OptionParser()</pre>
<p>Next we create a new options group.</p>
<pre class="brush:py">group1 = optparse.OptionGroup(parser, 'Options group 1')
group2 = optparse.OptionGroup(parser, 'Options group 2')</pre>
<p>Note that to create an option group, we have to specify parser that we will use and a short description of the options in this option group. The description will later appear in the help screen.</p>
<p>Now we should add the actual options. This time however, we add them to groups instead of adding them to parser.</p>
<pre class="brush:py">group1.add_option('-t', help='group 1 option', dest='t', \
    action='store')
group2.add_option('-d', help='group 2 option', dest='d', \
    action='store')</pre>
<p><em>add_option()</em> method of class <em>OptionGroup</em> is exactly the same as <em>add_option()</em> method of class <em>OptionParser</em>.</p>
<p>Finally, we add groups to parsers and call <em>parse_options()</em>.</p>
<pre class="brush:py">parser.add_option_group(group1)
parser.add_option_group(group2)

(args, opts) = parser.parse_args()</pre>
<p>Now, lets have a look at the help screen.</p>
<pre class="brush: plain; gutter: false;">alex ~/works/args -&gt; ./args.py -h
Usage: args.py [options]

Options:
  -h, --help  show this help message and exit

  Option group 1:
    -t T      group 1 option

  Option group 2:
    -d D      group 2 option
alex ~/works/args -&gt;</pre>
<p>See how -t and -d standout, each in its own group.</p>
<h3><a title='changing_programs_usage_string' name='changing_programs_usage_string'></a>Changing programs usage string<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h3>
<p>You can specify your own usage string. This is the first line of help screen. You do this by passing <em>usage</em> parameter to <em>OptionParser</em> constructor.</p>
<pre class="brush:py">parser = optparse.OptionParser(usage='Usage: %prog &lt;options&gt;')</pre>
<p>If we run this code, this is how our help screen would look like.</p>
<pre class="brush: plain; gutter: false;">alex ~/works/args --&gt; ./args.py -h
Usage: args.py &lt;options&gt;
.
.
.</pre>
<p>As you can see, you can use <em>%prog</em> mnemonics inside of usage string. It will be substituted with the name of the program.</p>
<h3><a title='telling_option&#8217;s_default_value' name='telling_option&#8217;s_default_value'></a>Telling option&#8217;s default value<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h3>
<p>Another thing that you can do is specify default value of the option in its help screen. To do that you can use <em>%default</em> mnemonics inside of help string of an option. Like this:</p>
<pre class="brush:py">parser.add_option('-w', default='hello', dest='t', \
    action='store', help='this one has a default value [%default]')</pre>
<p>This will make help line in help screen for this option to look like this:</p>
<p>-w T        this one has a default value [hello]</p>
<h3><a title='better_argument_description' name='better_argument_description'></a>Better argument description<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h3>
<div style="font-family: &quot;Consolas&quot;; font-size: 11pt; color: #000000; background-color: #ffffff; font-style: normal; font-weight: normal; text-decoration: none;">
<pre class="brush:py">parser.add_option('-s', help='single argument', dest='single', \
    action='store')
parser.add_option('-M', help='multiple arguments', dest='multi', \
    action='store', nargs=2)</pre>
</div>
<p>Lets have a look at how the help screen would look like for two options above.</p>
<pre class="brush: plain; gutter: false;">  -s SINGLE          single argument
  -M MULTI           multiple arguments</pre>
<p>Not a pretty sight. See how <em>optparse</em> described parameters that each option receives. In fact, <em>optparse</em> take this description from name of the destination argument. To generate such description, it converts its name into a string and changes it to upper case.</p>
<p>This may somewhat work for an option that receives one argument. But it certainly will not work for an option that receives mutliple arguments, such as -M. Luckily, there&#8217;s a solution for this problem. <em>add_option()</em> receives a parameter named <em>metavar</em>. It tells <em>optparse </em>how to describe option argument in help screen. So, instead of calling <em>add_option() </em>the way we did it for -s and -M, we should call it this way:</p>
<pre class="brush:py">parser.add_option('-s', help='single argument', dest='single', \
    action='store', metavar='&lt;ARG&gt;')
parser.add_option('-M', help='multiple arguments', dest='multi', \
    action='store', metavar='&lt;ARG1&gt; &lt;ARG2&gt;', nargs=2)</pre>
<p>This makes the help message for these two options look like this:</p>
<pre class="brush: plain; gutter: false;">  -s &lt;ARG&gt;           single argument
  -M &lt;ARG1&gt; &lt;ARG2&gt;   multiple arguments</pre>
<p>Now this is much better.</p>
<h3><a title='adding_program_description' name='adding_program_description'></a>Adding program description<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h3>
<p>You can have a description of what your program does. When having it, it will appear in help screen between usage line and options description. To do that, pass <em>description </em>argument to <em>OptionParser</em> constructor, when creating <em>OptionParser</em> object. Like this:</p>
<pre class="brush:py">desc="""This is a description of %prog. optparse uses Python's
textwrap module to format the text, so
don't
bother
adding
new
line
characters, as optparse will prettify your description in
its own way."""

parser = optparse.OptionParser(description=desc)

parser.add_option('-s', help='single argument', dest='single', \
    action='store')

(args, opts) = parser.parse_args()</pre>
<p>Running this little program with -h, will produce following help screen.</p>
<pre class="brush: plain; gutter: false;">alex ~/works/args --&gt; ./args.py -h
Usage: args.py [options]

This is a description of args.py. optparse uses Python's  textwrap
module to format the text, so  don't  bother  adding  new  line
characters, as optparse will prettify your description in its own
way.

Options:
  -h, --help  show this help message and exit
  -s SINGLE   single argument
alex ~/works/args --&gt;</pre>
<p>Note how <em>optparse</em> reformatted the description string. It uses Python&#8217;s textwrap module to format your description, producing nice, 80 character long lines of text.</p>
<p>Also note that as with <em>usage</em> parameter, you can use <em>%prog</em> mnemonics here. It will be substituted with name of your program.</p>
<h3><a title='adding_epilog' name='adding_epilog'></a>Adding epilog<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h3>
<p>Epilog will appear after options description. To specify epilog, pass <em>epilog</em> parameter to <em>OptionParser</em>&#8216;s constructor. Note that as with description string, <em>optparse</em> will prettify the text you use with textwrap.</p>
<h2><a title='program_version_string' name='program_version_string'></a>Program version string<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h2>
<p>Like help screen, <em>optparse</em> can also generate version string, responding to &#8211;version option. Unlike with help screen where <em>optparse</em> did most of the job, here <em>optparse</em> merely prints what you&#8217;ve specified as version string.</p>
<p>To specify version string, pass <em>version</em> parameter to <em>OptionParser</em>&#8216;s constructor. You can use <em>%prog</em> mnemonics inside of version string. Here&#8217;s an example.</p>
<pre class="brush:py">parser = optparse.OptionParser(version='%prog version 1.0')
(args, opts) = parser.parse_args()</pre>
<p>Running this script with &#8211;version option, produces following result.</p>
<pre class="brush: plain; gutter: false;">alex ~/works/args --&gt; ./args.py --version
args.py version 1.0
alex ~/works/args --&gt;</pre>
<p><em>optparse</em> produce version string only if you run it with &#8211;version option. If you want to your program to print its version with -v option, you will have to add -v option manually and then call <em>print_version()</em> method of <em>OptionParser</em>, to produce the version string.</p>
<h1><a title='conclusion' name='conclusion'></a>Conclusion<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h1>
<p>There is a bunch of other things that you can do with <em>optparse</em>. You can have your own actions, your own formatter &#8211; an object that formats the help screen.  You can use callbacks that get called when <em>optparse</em> runs into certain option. However, I think I&#8217;ve covered 99.9% of what you may need. In case I missed something, send me an email to <a href="mailto:alex@alexonlinux.com" rel="nofollow" >alex@alexonlinux.com</a>.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.alexonlinux.com/pythons-optparse-for-human-beings/feed</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>32bit vs 64bit computers, the QA</title>
		<link>http://www.alexonlinux.com/32bit-vs-64bit-computers-the-qa</link>
		<comments>http://www.alexonlinux.com/32bit-vs-64bit-computers-the-qa#comments</comments>
		<pubDate>Tue, 26 Aug 2008 10:05:00 +0000</pubDate>
		<dc:creator>Alexander Sandler</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Programming Articles]]></category>
		<category><![CDATA[System Administrator Articles]]></category>
		<category><![CDATA[32-bit]]></category>
		<category><![CDATA[64-bit]]></category>
		<category><![CDATA[AMD]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[Intel]]></category>
		<category><![CDATA[Processor]]></category>
		<category><![CDATA[RAM]]></category>

		<guid isPermaLink="false">http://www.alexandersandler.net/?page_id=376</guid>
		<description><![CDATA[Table of contents Introduction What do we do with command line options optparse basics Adding options Specifying help string for an option Telling optparse to parse arguments Putting it together optparse cookbook Support for a standalone command line options Support for mandatory (required) options. Support for options with one or more arguments Option destination types [...]


Related posts:<ol><li><a href='http://www.alexonlinux.com/pythons-optparse-for-human-beings' rel='bookmark' title='Permanent Link: Python&#8217;s optparse for human beings'>Python&#8217;s optparse for human beings</a></li>
<li><a href='http://www.alexonlinux.com/aligned-vs-unaligned-memory-access' rel='bookmark' title='Permanent Link: Aligned vs. unaligned memory access'>Aligned vs. unaligned memory access</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<h1>Table of contents</h1>
<p><div class="toc"><a title='table_of_contents' name='table_of_contents'></a><a class='toc_h1' href='#introduction'>Introduction</a><br />
<a class='toc_h1' href='#what_do_we_do_with_command_line_options'>What do we do with command line options</a><br />
<a class='toc_h1' href='#optparse_basics'><em>optparse</em> basics</a><br />
<a class='toc_h2' href='#adding_options'>Adding options</a><br />
<a class='toc_h2' href='#specifying_help_string_for_an_option'>Specifying help string for an option</a><br />
<a class='toc_h2' href='#telling_optparse_to_parse_arguments'>Telling <em>optparse</em> to parse arguments</a><br />
<a class='toc_h2' href='#putting_it_together'>Putting it together</a><br />
<a class='toc_h1' href='#optparse_cookbook'><em>optparse</em> cookbook</a><br />
<a class='toc_h2' href='#support_for_a_standalone_command_line_options'>Support for a standalone command line options</a><br />
<a class='toc_h2' href='#support_for_mandatory_(required)_options.'>Support for mandatory (required) options.</a><br />
<a class='toc_h2' href='#support_for_options_with_one_or_more_arguments'>Support for options with one or more arguments</a><br />
<a class='toc_h2' href='#option_destination_types'>Option destination types</a><br />
<a class='toc_h2' href='#dependencies_between_options'>Dependencies between options</a><br />
<a class='toc_h2' href='#help_screen_customizations'>Help screen customizations</a><br />
<a class='toc_h3' href='#grouping_options'>Grouping options</a><br />
<a class='toc_h3' href='#changing_programs_usage_string'>Changing programs usage string</a><br />
<a class='toc_h3' href='#telling_option&#8217;s_default_value'>Telling option&#8217;s default value</a><br />
<a class='toc_h3' href='#better_argument_description'>Better argument description</a><br />
<a class='toc_h3' href='#adding_program_description'>Adding program description</a><br />
<a class='toc_h3' href='#adding_epilog'>Adding epilog</a><br />
<a class='toc_h2' href='#program_version_string'>Program version string</a><br />
<a class='toc_h1' href='#conclusion'>Conclusion</a><br />
<a class='toc_h1' href='#introduction'>Introduction</a><br />
<a class='toc_h1' href='#what_do_we_do_with_command_line_options'>What do we do with command line options</a><br />
<a class='toc_h1' href='#optparse_basics'><em>optparse</em> basics</a><br />
<a class='toc_h2' href='#adding_options'>Adding options</a><br />
<a class='toc_h2' href='#specifying_help_string_for_an_option'>Specifying help string for an option</a><br />
<a class='toc_h2' href='#telling_optparse_to_parse_arguments'>Telling <em>optparse</em> to parse arguments</a><br />
<a class='toc_h2' href='#putting_it_together'>Putting it together</a><br />
<a class='toc_h1' href='#optparse_cookbook'><em>optparse</em> cookbook</a><br />
<a class='toc_h2' href='#support_for_a_standalone_command_line_options'>Support for a standalone command line options</a><br />
<a class='toc_h2' href='#support_for_mandatory_(required)_options.'>Support for mandatory (required) options.</a><br />
<a class='toc_h2' href='#support_for_options_with_one_or_more_arguments'>Support for options with one or more arguments</a><br />
<a class='toc_h2' href='#option_destination_types'>Option destination types</a><br />
<a class='toc_h2' href='#dependencies_between_options'>Dependencies between options</a><br />
<a class='toc_h2' href='#help_screen_customizations'>Help screen customizations</a><br />
<a class='toc_h3' href='#grouping_options'>Grouping options</a><br />
<a class='toc_h3' href='#changing_programs_usage_string'>Changing programs usage string</a><br />
<a class='toc_h3' href='#telling_option&#8217;s_default_value'>Telling option&#8217;s default value</a><br />
<a class='toc_h3' href='#better_argument_description'>Better argument description</a><br />
<a class='toc_h3' href='#adding_program_description'>Adding program description</a><br />
<a class='toc_h3' href='#adding_epilog'>Adding epilog</a><br />
<a class='toc_h2' href='#program_version_string'>Program version string</a><br />
<a class='toc_h1' href='#conclusion'>Conclusion</a><br />
<a class='toc_h1' href='#introduction'>Introduction</a><br />
<a class='toc_h1' href='#what_64-bit_support_mean?'>What 64-bit support mean?</a><br />
<a class='toc_h1' href='#what_the_difference_between_the_32-bit_and_64-bit_anyway?'>What the difference between the 32-bit and 64-bit anyway?</a><br />
<a class='toc_h2' href='#general_purpose_registers'>General purpose registers</a><br />
<a class='toc_h2' href='#what_additional_registers_good_for?'>What additional registers good for?</a><br />
<a class='toc_h1' href='#so_how_good_64-bit_really_is?'>So how good 64-bit really is?</a><br />
<a class='toc_h1' href='#what_about_os_and_software?'>What about OS and software?</a><br />
<a class='toc_h2' href='#does_that_mean_that_paying_extra_money_for_64-bit_windows_xp/vista_worth_it?'>Does that mean that paying extra money for 64-bit Windows XP/Vista worth it?</a><br />
<a class='toc_h2' href='#how_about_linux?'>How about Linux?</a><br />
<a class='toc_h1' href='#introduction'>Introduction</a><br />
<a class='toc_h1' href='#what_64-bit_support_mean?'>What 64-bit support mean?</a><br />
<a class='toc_h1' href='#what_the_difference_between_the_32-bit_and_64-bit_anyway?'>What the difference between the 32-bit and 64-bit anyway?</a><br />
<a class='toc_h2' href='#general_purpose_registers'>General purpose registers</a><br />
<a class='toc_h2' href='#what_additional_registers_good_for?'>What additional registers good for?</a><br />
<a class='toc_h1' href='#so_how_good_64-bit_really_is?'>So how good 64-bit really is?</a><br />
<a class='toc_h1' href='#what_about_os_and_software?'>What about OS and software?</a><br />
<a class='toc_h2' href='#does_that_mean_that_paying_extra_money_for_64-bit_windows_xp/vista_worth_it?'>Does that mean that paying extra money for 64-bit Windows XP/Vista worth it?</a><br />
<a class='toc_h2' href='#how_about_linux?'>How about Linux?</a><br />
<a class='toc_h1' href='#introduction'>Introduction</a><br />
<a class='toc_h1' href='#what_64-bit_support_mean?'>What 64-bit support mean?</a><br />
<a class='toc_h1' href='#what_the_difference_between_the_32-bit_and_64-bit_anyway?'>What the difference between the 32-bit and 64-bit anyway?</a><br />
<a class='toc_h2' href='#general_purpose_registers'>General purpose registers</a><br />
<a class='toc_h2' href='#what_additional_registers_good_for?'>What additional registers good for?</a><br />
<a class='toc_h1' href='#so_how_good_64-bit_really_is?'>So how good 64-bit really is?</a><br />
<a class='toc_h1' href='#what_about_os_and_software?'>What about OS and software?</a><br />
<a class='toc_h2' href='#does_that_mean_that_paying_extra_money_for_64-bit_windows_xp/vista_worth_it?'>Does that mean that paying extra money for 64-bit Windows XP/Vista worth it?</a><br />
<a class='toc_h2' href='#how_about_linux?'>How about Linux?</a><br />
</div>
</p>
<h1><a title='introduction' name='introduction'></a>Introduction<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h1>
<p>Many wonder what is the real difference between 64-bit and 32-bit computers. Is paying a little extra for 64-bit support really worth it?</p>
<h1><a title='what_64-bit_support_mean?' name='what_64-bit_support_mean?'></a>What 64-bit support mean?<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h1>
<p>This can mean many things actually. This article dedicated to recent (relatively of course) addition of the 64-bit support in AMD&#8217;s and Intel&#8217;s micro-processors. Processors supporting 64-bit calculations exists for many years. However these were industry class processors, very expensive and powerful. Couple of year ago, first AMD and then Intel began selling 64-bit processors designed with home user in mind. This historical change is the one I would like to review in this article.</p>
<h1><a title='what_the_difference_between_the_32-bit_and_64-bit_anyway?' name='what_the_difference_between_the_32-bit_and_64-bit_anyway?'></a>What the difference between the 32-bit and 64-bit anyway?<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h1>
<p>Processors with 64-bit support are those that natively support operations with 64-bit long numbers &#8211; you need lots of bits to accommodate large numbers. You may be a little confused by the fact that built into both Linux and Windows calculators easily sum a pair of nearly every possible numbers, including a pair of very big numbers. The thing is that 32-bit CPUs only simulate calculations with large numbers.</p>
<p>In 32-bit computer, summing two 64-bit numbers takes 10 and even more times than summing two 32-bit numbers. On the other hand, in 64-bit computers summing two 64-bit numbers takes same period of time as summing two 32-bit numbers.</p>
<h2><a title='general_purpose_registers' name='general_purpose_registers'></a>General purpose registers<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h2>
<p>Another, less obvious, difference between the two is that processors with 64-bit support has additional 8 general purpose registers &#8211; these are small pieces of memory that are built into processor itself and help it to do its job. Importance of the later addition often overlooked, however this is the change that has brought a truly significant performance boost to 64-bit processors over their 32-bit predecessors.</p>
<h2><a title='what_additional_registers_good_for?' name='what_additional_registers_good_for?'></a>What additional registers good for?<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h2>
<p>Actually the CPU does most of its operations using registers. Registers work as fast as the CPU itself, while RAM is much slower. So in terms of performance, it is better to do as many calculations using registers as possible. The problem is however that having registers is very expensive.</p>
<blockquote><p>Intel&#8217;s Itanim processors have 128 general purpose registers. Itaniums are an industry class processors and are very expensive.</p></blockquote>
<p>Additional 8 registers is a significant addition that let the CPU to speed up some of its operations by a large margin.</p>
<h1><a title='so_how_good_64-bit_really_is?' name='so_how_good_64-bit_really_is?'></a>So how good 64-bit really is?<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h1>
<p>With 64-bit extension you get 10% performance boost for free. This number can be different from system to system of course, but I think we can presume this is pretty much the average.</p>
<h1><a title='what_about_os_and_software?' name='what_about_os_and_software?'></a>What about OS and software?<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h1>
<p>When you have some neat feature in your CPU, you need software uses it. This is why there are 32-bit operating systems and 64-bit operating systems. First knows nothing about 64-bit calculations and additional registers, while the later uses both of them all the time.</p>
<p>Same with regular software.</p>
<h2><a title='does_that_mean_that_paying_extra_money_for_64-bit_windows_xp/vista_worth_it?' name='does_that_mean_that_paying_extra_money_for_64-bit_windows_xp/vista_worth_it?'></a>Does that mean that paying extra money for 64-bit Windows XP/Vista worth it?<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h2>
<p>It&#8217;s a bit complex. You cannot run 64-bit software on 32-bit operating system. So if you plan running anything that uses 64-bit, you will need 64-bit operating system.</p>
<p>Still for most of the users the answer would be negative. The problem is that most of the software for Windows is 32-bit. 64-bit versions are rarely available. You can run 32-bit software on 64-bit computer and 64-bit operating system, but buying 64-bit operating system is often useless because you may end up using 32-bit software all the time.</p>
<p><strong>update: </strong>As Mr. rasmasyean kindly noted in the comments below, amount of physical RAM that you plan to have in your computer is another consideration that should be taken. 32-bit versions of both Windows XP and Windows Vista limit amount of supported physical RAM to 4GB. In case you need more RAM, you will need 64-bit version of Windows.</p>
<h2><a title='how_about_linux?' name='how_about_linux?'></a>How about Linux?<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h2>
<p>Linux is completely different story. For most of the software there is a 64-bit version. Even if there is none, you can try to compile it yourself &#8211; it is not that complicated. And there is no difference between 64-bit and 32-bit operating system in terms of price. So go ahead, grab yourself a 64-bit Linux and enjoy its improved performance <img src='http://www.alexonlinux.com/wp-content/plugins/smilies-themer/modern/biggrin.gif' alt=':D' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://www.alexonlinux.com/pythons-optparse-for-human-beings' rel='bookmark' title='Permanent Link: Python&#8217;s optparse for human beings'>Python&#8217;s optparse for human beings</a></li>
<li><a href='http://www.alexonlinux.com/aligned-vs-unaligned-memory-access' rel='bookmark' title='Permanent Link: Aligned vs. unaligned memory access'>Aligned vs. unaligned memory access</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.alexonlinux.com/32bit-vs-64bit-computers-the-qa/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Swap vs. no swap</title>
		<link>http://www.alexonlinux.com/swap-vs-no-swap</link>
		<comments>http://www.alexonlinux.com/swap-vs-no-swap#comments</comments>
		<pubDate>Thu, 21 Aug 2008 09:43:25 +0000</pubDate>
		<dc:creator>Alexander Sandler</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[System Administrator Articles]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[io]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[leaks]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[partition]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[RAM]]></category>
		<category><![CDATA[speed]]></category>
		<category><![CDATA[swap]]></category>
		<category><![CDATA[virtual memory]]></category>

		<guid isPermaLink="false">http://www.alexandersandler.net/?page_id=194</guid>
		<description><![CDATA[Table of contents Introduction What do we do with command line options optparse basics Adding options Specifying help string for an option Telling optparse to parse arguments Putting it together optparse cookbook Support for a standalone command line options Support for mandatory (required) options. Support for options with one or more arguments Option destination types [...]


Related posts:<ol><li><a href='http://www.alexonlinux.com/whats-is-direct-io-anyway' rel='bookmark' title='Permanent Link: What&#8217;s is direct I/O anyway?'>What&#8217;s is direct I/O anyway?</a></li>
<li><a href='http://www.alexonlinux.com/aligned-vs-unaligned-memory-access' rel='bookmark' title='Permanent Link: Aligned vs. unaligned memory access'>Aligned vs. unaligned memory access</a></li>
<li><a href='http://www.alexonlinux.com/backup-and-restore-your-linux-installation' rel='bookmark' title='Permanent Link: Backup and restore your Linux installation'>Backup and restore your Linux installation</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<h1>Table of contents</h1>
<p><div class="toc"><a title='table_of_contents' name='table_of_contents'></a><a class='toc_h1' href='#introduction'>Introduction</a><br />
<a class='toc_h1' href='#what_do_we_do_with_command_line_options'>What do we do with command line options</a><br />
<a class='toc_h1' href='#optparse_basics'><em>optparse</em> basics</a><br />
<a class='toc_h2' href='#adding_options'>Adding options</a><br />
<a class='toc_h2' href='#specifying_help_string_for_an_option'>Specifying help string for an option</a><br />
<a class='toc_h2' href='#telling_optparse_to_parse_arguments'>Telling <em>optparse</em> to parse arguments</a><br />
<a class='toc_h2' href='#putting_it_together'>Putting it together</a><br />
<a class='toc_h1' href='#optparse_cookbook'><em>optparse</em> cookbook</a><br />
<a class='toc_h2' href='#support_for_a_standalone_command_line_options'>Support for a standalone command line options</a><br />
<a class='toc_h2' href='#support_for_mandatory_(required)_options.'>Support for mandatory (required) options.</a><br />
<a class='toc_h2' href='#support_for_options_with_one_or_more_arguments'>Support for options with one or more arguments</a><br />
<a class='toc_h2' href='#option_destination_types'>Option destination types</a><br />
<a class='toc_h2' href='#dependencies_between_options'>Dependencies between options</a><br />
<a class='toc_h2' href='#help_screen_customizations'>Help screen customizations</a><br />
<a class='toc_h3' href='#grouping_options'>Grouping options</a><br />
<a class='toc_h3' href='#changing_programs_usage_string'>Changing programs usage string</a><br />
<a class='toc_h3' href='#telling_option&#8217;s_default_value'>Telling option&#8217;s default value</a><br />
<a class='toc_h3' href='#better_argument_description'>Better argument description</a><br />
<a class='toc_h3' href='#adding_program_description'>Adding program description</a><br />
<a class='toc_h3' href='#adding_epilog'>Adding epilog</a><br />
<a class='toc_h2' href='#program_version_string'>Program version string</a><br />
<a class='toc_h1' href='#conclusion'>Conclusion</a><br />
<a class='toc_h1' href='#introduction'>Introduction</a><br />
<a class='toc_h1' href='#what_do_we_do_with_command_line_options'>What do we do with command line options</a><br />
<a class='toc_h1' href='#optparse_basics'><em>optparse</em> basics</a><br />
<a class='toc_h2' href='#adding_options'>Adding options</a><br />
<a class='toc_h2' href='#specifying_help_string_for_an_option'>Specifying help string for an option</a><br />
<a class='toc_h2' href='#telling_optparse_to_parse_arguments'>Telling <em>optparse</em> to parse arguments</a><br />
<a class='toc_h2' href='#putting_it_together'>Putting it together</a><br />
<a class='toc_h1' href='#optparse_cookbook'><em>optparse</em> cookbook</a><br />
<a class='toc_h2' href='#support_for_a_standalone_command_line_options'>Support for a standalone command line options</a><br />
<a class='toc_h2' href='#support_for_mandatory_(required)_options.'>Support for mandatory (required) options.</a><br />
<a class='toc_h2' href='#support_for_options_with_one_or_more_arguments'>Support for options with one or more arguments</a><br />
<a class='toc_h2' href='#option_destination_types'>Option destination types</a><br />
<a class='toc_h2' href='#dependencies_between_options'>Dependencies between options</a><br />
<a class='toc_h2' href='#help_screen_customizations'>Help screen customizations</a><br />
<a class='toc_h3' href='#grouping_options'>Grouping options</a><br />
<a class='toc_h3' href='#changing_programs_usage_string'>Changing programs usage string</a><br />
<a class='toc_h3' href='#telling_option&#8217;s_default_value'>Telling option&#8217;s default value</a><br />
<a class='toc_h3' href='#better_argument_description'>Better argument description</a><br />
<a class='toc_h3' href='#adding_program_description'>Adding program description</a><br />
<a class='toc_h3' href='#adding_epilog'>Adding epilog</a><br />
<a class='toc_h2' href='#program_version_string'>Program version string</a><br />
<a class='toc_h1' href='#conclusion'>Conclusion</a><br />
<a class='toc_h1' href='#introduction'>Introduction</a><br />
<a class='toc_h1' href='#what_64-bit_support_mean?'>What 64-bit support mean?</a><br />
<a class='toc_h1' href='#what_the_difference_between_the_32-bit_and_64-bit_anyway?'>What the difference between the 32-bit and 64-bit anyway?</a><br />
<a class='toc_h2' href='#general_purpose_registers'>General purpose registers</a><br />
<a class='toc_h2' href='#what_additional_registers_good_for?'>What additional registers good for?</a><br />
<a class='toc_h1' href='#so_how_good_64-bit_really_is?'>So how good 64-bit really is?</a><br />
<a class='toc_h1' href='#what_about_os_and_software?'>What about OS and software?</a><br />
<a class='toc_h2' href='#does_that_mean_that_paying_extra_money_for_64-bit_windows_xp/vista_worth_it?'>Does that mean that paying extra money for 64-bit Windows XP/Vista worth it?</a><br />
<a class='toc_h2' href='#how_about_linux?'>How about Linux?</a><br />
<a class='toc_h1' href='#introduction'>Introduction</a><br />
<a class='toc_h1' href='#what_64-bit_support_mean?'>What 64-bit support mean?</a><br />
<a class='toc_h1' href='#what_the_difference_between_the_32-bit_and_64-bit_anyway?'>What the difference between the 32-bit and 64-bit anyway?</a><br />
<a class='toc_h2' href='#general_purpose_registers'>General purpose registers</a><br />
<a class='toc_h2' href='#what_additional_registers_good_for?'>What additional registers good for?</a><br />
<a class='toc_h1' href='#so_how_good_64-bit_really_is?'>So how good 64-bit really is?</a><br />
<a class='toc_h1' href='#what_about_os_and_software?'>What about OS and software?</a><br />
<a class='toc_h2' href='#does_that_mean_that_paying_extra_money_for_64-bit_windows_xp/vista_worth_it?'>Does that mean that paying extra money for 64-bit Windows XP/Vista worth it?</a><br />
<a class='toc_h2' href='#how_about_linux?'>How about Linux?</a><br />
<a class='toc_h1' href='#introduction'>Introduction</a><br />
<a class='toc_h1' href='#what_64-bit_support_mean?'>What 64-bit support mean?</a><br />
<a class='toc_h1' href='#what_the_difference_between_the_32-bit_and_64-bit_anyway?'>What the difference between the 32-bit and 64-bit anyway?</a><br />
<a class='toc_h2' href='#general_purpose_registers'>General purpose registers</a><br />
<a class='toc_h2' href='#what_additional_registers_good_for?'>What additional registers good for?</a><br />
<a class='toc_h1' href='#so_how_good_64-bit_really_is?'>So how good 64-bit really is?</a><br />
<a class='toc_h1' href='#what_about_os_and_software?'>What about OS and software?</a><br />
<a class='toc_h2' href='#does_that_mean_that_paying_extra_money_for_64-bit_windows_xp/vista_worth_it?'>Does that mean that paying extra money for 64-bit Windows XP/Vista worth it?</a><br />
<a class='toc_h2' href='#how_about_linux?'>How about Linux?</a><br />
<a class='toc_h1' href='#introduction'>Introduction</a><br />
<a class='toc_h1' href='#the_obvious'>The obvious</a><br />
<a class='toc_h2' href='#memory_leaks'>Memory leaks</a><br />
<a class='toc_h2' href='#hibernation'>Hibernation</a><br />
<a class='toc_h1' href='#the_less_obvious'>The less obvious</a><br />
<a class='toc_h2' href='#i/o_cache'>I/O cache</a><br />
<a class='toc_h1' href='#bottom_line'>Bottom line</a><br />
<a class='toc_h1' href='#introduction'>Introduction</a><br />
<a class='toc_h1' href='#the_obvious'>The obvious</a><br />
<a class='toc_h2' href='#memory_leaks'>Memory leaks</a><br />
<a class='toc_h2' href='#hibernation'>Hibernation</a><br />
<a class='toc_h1' href='#the_less_obvious'>The less obvious</a><br />
<a class='toc_h2' href='#i/o_cache'>I/O cache</a><br />
<a class='toc_h1' href='#bottom_line'>Bottom line</a><br />
</div>
</p>
<h1><a title='introduction' name='introduction'></a>Introduction<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h1>
<p>This short article deals with simple question. How exactly lack of swap partition affects Linux&#8217;s performance. What would happen if you turn the swap off?</p>
<h1><a title='the_obvious' name='the_obvious'></a>The obvious<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h1>
<h2><a title='memory_leaks' name='memory_leaks'></a>Memory leaks<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h2>
<p>The obvious price one would have to pay for turning the swap off is lack of so called virtual memory. The term virtual memory refers to several different things really. What I mean is that when a program leaks memory, the memory it has leaked will remain unused as long as the program still running.</p>
<p>On the contrary, when swap is on, operating system copies memory that is not in use to the swap partition, by that freeing actual memory. So when one of the programs has memory leaks, memory that being lost by the program finds its way to hard drive instead of continuing to take precious memory.</p>
<p>I never heart of a program that claims that it has no memory leaks. Every program looses memory. It is a matter of time until it will ran out of memory and then the program will crash. Swap is not an ultimate solution for this problem because swap space can run out too, yet it significantly prologues live of the individual processes and the overall system.</p>
<h2><a title='hibernation' name='hibernation'></a>Hibernation<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h2>
<p>It is being referred to as hibernation and perhaps few other ways. At the bottom line this is a method to fast turn on and off the computer.</p>
<p>Instead of turning off all services and programs and then initializing them again, operating system suspends execution of all processes, then writes all used memory to swap space and then turns off the computer.</p>
<p>When you turn your computer back on, instead of starting a brand new session from scratch, operating system restores memory from swap and resumes all programs that were running, without reinitializing them.</p>
<blockquote><p>By the way, one of the reasons why recommended swap space size is twice the size of the RAM that is in the computer is to let the operating system to accommodate all your RAM in swap partition &#8211; to allow hibernation of course.</p></blockquote>
<p>Obviously, when you don&#8217;t have swap partition, you cannot do hibernation anymore.</p>
<h1><a title='the_less_obvious' name='the_less_obvious'></a>The less obvious<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h1>
<h2><a title='i/o_cache' name='i/o_cache'></a>I/O cache<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h2>
<p>Linux uses all available memory to do I/O cache &#8211; that is to save portions of the hard disk space and to serve it straight from the memory avoiding relatively long disk access. This is why for instance when you copy several large files from one place to another several times in a row, second copy takes significantly fewer time then the first. This is also the reason why, in Linux, it takes a second to write a megabyte to a floppy disk, a device known for its slowliness &#8211; the data being written to the memory and not to an actual disk.</p>
<p>Also, disks optimized to read and write large chunks of data. Average program on the contrary reads and writes small chunks of data. To speed up the process, Linux collects several small read and write requests into bigger thus increasing disk performance. This however requires memory.</p>
<p>What many people don&#8217;t realize is that Linux uses all available memory and always tries to free even more memory for caching. When it sees a piece of memory that some program did claim, but doesn&#8217;t use very often, it will copy it to swap partition and use the actual memory for caching. Once the program will try to do something with this memory piece, Linux will detect this and read the contents of the memory piece from swap partition back to the real RAM.</p>
<blockquote><p>By the way, this is the reason why when you minimize a program and after a while restore it, it takes it a few seconds to become fully functional &#8211; Linux had moved pieces of its memory to swap partition and now this memory has to be restored. Reading data from disk takes more time than actual memory access, thus the delay you see when you restore the program. You can change how hard the operating system tries to free memory for cache by changing value in the /proc/sys/vm/swappiness. The value varies between 0 and 100. Value of 100 means that operating system will not wait much time to move memory to cache. Note that whatever swappiness value you have, Linux tries to keep your system stable and will move pieces of memory into cache if it thinks it is necessary.</p></blockquote>
<p>The real issue here is that this mechanism should be very balanced. Linux is optimized to use all available memory for caching. When it doesn&#8217;t have enough memory, time it takes to access data on disks will rise! Since all programs leak memory, over the time Linux will have less and less memory for caching and disk access speed will drop.</p>
<h1><a title='bottom_line' name='bottom_line'></a>Bottom line<a class='toc_top' href='#table_of_contents'>BACK TO TOC</a></h1>
<p>Bottom line is that, without swap:</p>
<ol>
<li>Your system will be less stable.</li>
<li>Your system will not be able to hibernate.</li>
<li>Disk access speed in your system will be slower compared to a system that has swap partition. Moreover, disk access speed will drop in the course of time.</li>
</ol>
<p>In case you have further questions, please email me to <a href="mailto:alexander.sandler@gmail.com" rel="nofollow" >alexander.sandler@gmail.com</a>.</p>


<p>Related posts:<ol><li><a href='http://www.alexonlinux.com/whats-is-direct-io-anyway' rel='bookmark' title='Permanent Link: What&#8217;s is direct I/O anyway?'>What&#8217;s is direct I/O anyway?</a></li>
<li><a href='http://www.alexonlinux.com/aligned-vs-unaligned-memory-access' rel='bookmark' title='Permanent Link: Aligned vs. unaligned memory access'>Aligned vs. unaligned memory access</a></li>
<li><a href='http://www.alexonlinux.com/backup-and-restore-your-linux-installation' rel='bookmark' title='Permanent Link: Backup and restore your Linux installation'>Backup and restore your Linux installation</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.alexonlinux.com/swap-vs-no-swap/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Best picture ever?</title>
		<link>http://www.alexonlinux.com/best-picture-ever</link>
		<comments>http://www.alexonlinux.com/best-picture-ever#comments</comments>
		<pubDate>Thu, 15 May 2008 10:23:28 +0000</pubDate>
		<dc:creator>Alexander Sandler</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[awards]]></category>
		<category><![CDATA[pictures]]></category>

		<guid isPermaLink="false">http://www.alexandersandler.net/?p=109</guid>
		<description><![CDATA[Related posts:Wow! My tcpdump for Dummies is on the front page of delicious.com


Related posts:<ol><li><a href='http://www.alexonlinux.com/wow-my-tcpdump-for-dummies-is-on-the-front-page-of-deliciouscom' rel='bookmark' title='Permanent Link: Wow! My tcpdump for Dummies is on the front page of delicious.com'>Wow! My tcpdump for Dummies is on the front page of delicious.com</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<a href="http://www.alexonlinux.com/wp-content/gallery/rothschild-park/P1020194.jpg" title="" class="thickbox" rel="singlepic666" >
	<img class="ngg-singlepic ngg-center" src="http://www.alexonlinux.com/index.php?callback=image&amp;pid=666&amp;width=400&amp;height=350&amp;mode=" alt="P1020194.jpg" title="P1020194.jpg" />
</a>



<p>Related posts:<ol><li><a href='http://www.alexonlinux.com/wow-my-tcpdump-for-dummies-is-on-the-front-page-of-deliciouscom' rel='bookmark' title='Permanent Link: Wow! My tcpdump for Dummies is on the front page of delicious.com'>Wow! My tcpdump for Dummies is on the front page of delicious.com</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.alexonlinux.com/best-picture-ever/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Irex Technologies, Iliad &#8211; More than a year together</title>
		<link>http://www.alexonlinux.com/irex-technologies-iliad-together-more-than-a-year</link>
		<comments>http://www.alexonlinux.com/irex-technologies-iliad-together-more-than-a-year#comments</comments>
		<pubDate>Mon, 17 Mar 2008 10:35:48 +0000</pubDate>
		<dc:creator>Alexander Sandler</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[back]]></category>
		<category><![CDATA[e-ink]]></category>
		<category><![CDATA[ebook]]></category>
		<category><![CDATA[iliad]]></category>
		<category><![CDATA[irex technologies]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[sound]]></category>
		<category><![CDATA[touch screen]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.alexandersandler.net/stuff/written-stuff/irex-technologies-iliad-together-more-than-a-year</guid>
		<description><![CDATA[Introduction I decided to write this review for two reasons. First of all, although there are so many reviews out there, no one has tracked the device and its development or evolution for over a year. I did. Also, there is a personal story of using Irex Technologies Iliad that I would like to tell. [...]


Related posts:<ol><li><a href='http://www.alexonlinux.com/g15dods' rel='bookmark' title='Permanent Link: g15dods'>g15dods</a></li>
<li><a href='http://www.alexonlinux.com/hall-of-fame' rel='bookmark' title='Permanent Link: Hall of fame'>Hall of fame</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>I decided to write this review for two reasons. First of all, although there are so many reviews out there, no one has tracked the device and its development or evolution for over a year. I did. Also, there is a personal story of using Irex Technologies Iliad that I would like to tell.</p>
<h3>History</h3>
<p>I started tracking development of e-Ink or e-Paper based devices sometime in 2002 or 2003, when I heart about this wonderful technology for the first time. The perspective of having screen with paper like DPI thrilled me. I am respectful to paper books, yet in terms of convenience and ease of use, analogue media already lost it to digital media in nearly every possible aspect. Consider MP3, personal media players with movie playing capabilities. Etc. Yet, the only direction in which digital media didn&#8217;t make much progress was reading and books. LCD screen based e-book readers lack many features that are a must in devices of this kind: readability, battery power, etc. As far as readability concerned, I assume either you yourself experienced headache or heart about people suffering from this problem when reading from LCD screen. Not to mention endless problem of reading at sunlight. On the other hand constantly emitting light, like LCD screens do, causes high power consumption, thus rises requirements for the power source &#8211; the battery. Problem of power consumption is even worse when combined with reading at sun-light issues.</p>
<p>Considering this, no wonder LCD screen based e-book readers didn&#8217;t take off. What about other technologies, you may ask? There is no monitor technology that would be suitable for intensive reading. On the contrary, other technologies are even more problematic then LCD. Something had to change and it did. With introduction of e-Ink screens.</p>
<h3>A word on technology</h3>
<p>I don&#8217;t want to dig too deeply into technical details of how things work in e-Ink screens. Yet at least on paper the idea is quiet simple. Screen consists of positively charged dark particles and negatively charged white particles. Charge applied to one side of the screen. Positive charge draws negative particles, pushing positive particles to the other side of the screen. Same thing, with opposite polarity, happens when applying negative charge.</p>
<p align="center"><img src="http://www.alexandersandler.net/wp-content/uploads/2008/02/800px-electrophoretic_display_001svg.png" alt="e-Ink Technology Diagram" width="533" height="211" /></p>
<h3>Irex Technologies Iliad</h3>
<p>After waiting for several years for the new dream gadget, such gadgets finally began to appear. At first it was Japan only. <a href="http://www.irextechnologies.com" rel="nofollow" title="Irex Technologies"  onclick="return TrackClick('http%3A%2F%2Fwww.irextechnologies.com','Irex+Technologies')">Irex Technologies</a>, a Philips spin off, was the first firm to release e-Ink based device in Europe. Few month after its initial release it became available in the middle east and I couldn&#8217;t wait any longer. It cost me almost 900$ including taxes, delivery and customs to Israeli authorities that didn&#8217;t know how to handle the device and detained it until I payed another 60$ and explained them myself what the hell is this. I didn&#8217;t think about the price. I had to get one and I did it.</p>
<h3>First impression</h3>
<p>At first, I was astonished by simplicity of packaging. Cool looking box contained only three items &#8211; USB cable, charger/USB/Ethernet hub and the device itself. I expected to see a manual, yet it wasn&#8217;t there. After thinking about it, I concluded that all documentation should be in the device itself. After all, this is a device for reading texts.</p>
<p>So, I decided to turn it on and see for myself. My first guess was that On/Off button is the big round button in the right top corner, yet after pushing it for a while I concluded that either the device is broken or the On/Off button is somewhere else. This is when I thought that it still might be a good idea to see a manual before turning it on. Luckily I was next to a computer. I browsed to Irex&#8217;s web-site and downloaded the manual. It appeared that power button is not the round button in the right top corner but a little needle at the bottom edge of the device. After I pulled it, the screen blinked and I saw the e-Ink technology in action for the first time in my life.</p>
<p align="left"><a href="http://www.alexandersandler.net/wp-content/uploads/2008/02/iliad-for-dummies.jpg" rel="nofollow" title="Iliad for Dummies"  onclick="return TrackClick('http%3A%2F%2Fwww.alexandersandler.net%2Fwp-content%2Fuploads%2F2008%2F02%2Filiad-for-dummies.jpg','Iliad+for+Dummies')"><img class="HeaderImage" style="width: 92px; height: 128px;" src="http://www.alexandersandler.net/wp-content/uploads/2008/02/iliad-for-dummies.thumbnail.jpg" alt="Iliad for Dummies" width="92" height="128" /></a>I must say that it is one amazing technology. Well you can see the pixels, but they are small. And by small I mean really small. You can see the text under any angle and it does look like paper. The surface color is bright grayish beige. The darkest black appears as dark gray color.</p>
<p align="left">The device has a resolution of 1024&#215;768 pixels. And since the screen size is only 8 inch (diagonal) you get nice around 160 DPI (Dots Per Inch). This is twice more then you have on a regular LCD panel and you enjoy every dot per every inch out of it <img src='http://www.alexonlinux.com/wp-content/plugins/smilies-themer/modern/smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h3>Second impression</h3>
<p>After playing around with the device, I decided to see what kind of settings are available for me. The device&#8217;s user interface is very intuitive so it didn&#8217;t take me much time to figure out where are the goodies. It appeared that software version installed on my Iliad was 2.5, despite specs on the package clearly stated that it is 2.6. Moreover, the Irex&#8217;s web-site stated that all new units sold with 2.6. And what&#8217;s the first thing you do with a gadget when you know that newer version of software is available? Of course, you upgrade. So did I.</p>
<p>I configured wireless network, plugged it into power hub and did a long press on the connect button (the button in the right top corner &#8211; more on buttons later). Upgrade went almost smoothly. The only problem was that I had to retry the installation twice &#8211; first time it got stalled and I had to reset. My prayers were answered because after the reset it booted with good old 2.5. Second attempt went so much better and I ended up with brand new 2.6.</p>
<h3>Third impression</h3>
<p>After reading few documents that were already on the device (readme, release-notes, etc <img src='http://www.alexonlinux.com/wp-content/plugins/smilies-themer/modern/smile.gif' alt=':-)' class='wp-smiley' /> ), I decided its time to try some of my own content. I had latest Intel&#8217;s x86 PDF specs and I decided to give them a try. I&#8217;ll spear you a story of what happened during next couple of hours. I think you can make a guess yourself, knowing that USB cable I received with the device wasn&#8217;t good and I had to use my own &#8211; luckily, it is a standard USB to square-USB cable. So after few hours long headache I was finally reading my beloved x86 spec.</p>
<p>Well&#8230; When you think about it, it really shouldn&#8217;t surprise anyone. I mean PDFs made for A4 paper will not render well on a A5 screen. Yet, it was some sort of disappointment. On the other hand it really has nothing to do with Iliad, since most of the e-Ink based devices have relatively small display. Later, Irex partially solved this problem by adding zoom in feature in PDF viewer.</p>
<p align="left">Something that draw my attention immediately after I turned it on was the fact that it takes so much time for it to boot. I mean my PC usually boots faster then Iliad. By much time I mean 40 seconds, more or less. I&#8217;ve seen people wondering if this will ever change and prognoses on this are quiet pessimistic. More on this later.</p>
<h3>Features overview</h3>
<p>Now let&#8217;s say few words about Iliad&#8217;s features. After all Irex always claimed Iliad is business oriented device, thus it should be packet with lots of stuff. And actually, it is:</p>
<ol>
<li>Support for several different formats, PDF, HTML, Mobipocket, etc.</li>
<li>Supports MP3 and has audio jack. The only problem with this feature is that they never implemented it. More on this later.</li>
<li>Touch screen &#8211; correct me if I am wrong, but this is the only e-Ink device with touch screen at the moment. More on this later.</li>
<li>Wi-fi, ethernet and USB connectivity.</li>
<li>MMC/SD and CF (I/II) slots for more memory.</li>
<li>Exceptionally (for this kind of devices) powerful CPU (xScale at 400MHz).</li>
<li>64Mb of RAM and 128Mb of internal memory.</li>
</ol>
<p>Unfortunately, as I mentioned, MP3 support actually never appeared. HTML is indeed supported but only few languages supported (actually this is something that changes so keep up with the updates). This is a serious problem for someone who reads other languages, such as myself.</p>
<p>Touch screen is nice, but here&#8217;s something that Irex never mention when they advertise Iliad. e-Ink is quiet slow. Meaning that no matter what you draw, it will appear something like 0.5-1 second after you drew it and this is really annoying. In my case, it is so annoying, I stopped using Iliad for sketching and writing almost immediately, despite I hoped it would become a replacement for my paper note book that I often use.</p>
<p>You can easily guess why you need USB connectivity but Wi-Fi and Ethernet? At the moment, the only feature that uses Wi-Fi and Ethernet is downloading firmware updates. Otherwise it is completely useless. Now obviously there is a reason why Iliad has them, but year and half after Iliad was introduced for the first time, we still can only speculate. One possible reason is that Iliad going to let you browse Mobipocket book catalog and buy stuff right from the device. We will see.</p>
<p>Of course you need a memory card slot. Of course you don&#8217;t need two slots. You could argue that some people may not have MMC/SD or CF card and having two cards is convenient, but truly, do you know a person that doesn&#8217;t own a MMC/SD card?</p>
<p>Finally, I simply cannot explain why there&#8217;s so powerful CPU in it? You could argue that Irex probably are going to add more features that will raise the CPU consumption, but nothing like this happened since Iliad was released for the first time. And I doubt it will ever happen. Actually, after reading release notes each time they released a software upgrade, I noticed that Irex spent great deal of time trying to keep the CPU running at 100MHz most of the time (to reduce power consumption). Go figure.</p>
<p>Having too powerful CPU, useless Ethernet and Wi-FI controllers, useless memory card slot and a touch screen skyrockets the price for the device. No wonder this is one of the most expensive e-Ink based devices at the moment.</p>
<h3>The backside thing</h3>
<p><a href="http://www.alexandersandler.net/wp-content/uploads/2008/03/back.jpg" rel="nofollow" title="Iliad Backside"  onclick="return TrackClick('http%3A%2F%2Fwww.alexandersandler.net%2Fwp-content%2Fuploads%2F2008%2F03%2Fback.jpg','Iliad+Backside')"><img class="HeaderImage" style="width: 117px; height: 128px;" src="http://www.alexandersandler.net/wp-content/uploads/2008/03/back.thumbnail.jpg" alt="Iliad Backside" width="117" height="128" /></a>Take a look at the picture. What is that you see on it? This is a backside of 1st edition of Iliad. The backside seems to be designed for some stand or holding device. Yet, there is no holding device, neither stand for Irex Iliad.</p>
<p>Moreover, in September 2007 Irex announced a new edition of Iliad. Let me quote &#8220;The iLiad 2nd edition features a fully redesigned backside that looks more elegant and also provides more stability when the iLiad is laying on a surface&#8221;.</p>
<p>Now I must say that this whole backside thing sounds, smells and looks like a complete joke. I suppose there are things that you can do with backside of the device. Things like placing retractable leg that would let to have Iliad standing and not laying. Yet these features bypassed Iliad. Instead it features useless backside design that was redesigned in 2nd edition. Unfortunately, I couldn&#8217;t find pictures of the backside of 2nd edition.</p>
<h3>Buttons</h3>
<p>One of the things Irex advertise is the <em>flip</em> button used to turn pages. I certainly agree that the button is indeed very convenient. Yet, it may start getting jammed a bit, sometimes causing Iliad to interpret single press and a long press turning five pages instead of one. And it is exceptionally annoying if all you wanted to do is to turn to a next page and instead you jump five pages ahead and try to get back, page by page, but then suddenly it jumps five pages back and eventually you flip two pages back instead of one page forward (other combinations are possible, taking you to any page within ten pages range but not to the next page). Can&#8217;t tell if this is a software or a hardware problem. Also I can&#8217;t tell you if it will happen to you too. It did happen to me.</p>
<p>Other buttons are handy. I suppose you&#8217;ve seen them on pictures. There are four dedicated buttons that take you to different sections of device&#8217;s memory &#8211; the <em>news</em>, <em>books</em>, <em>docs</em> and <em>notes</em> buttons. You can configure a folder to which you&#8217;ll be taken once you press any of these buttons. Pressing any of these buttons twice will take you to the last document you&#8217;ve read from that category.</p>
<p>Below the <em>flip</em> button, there&#8217;s a <em>next</em> and <em>prev</em> buttons and the <em>enter</em> button. Above the <em>flip</em> button there&#8217;s a <em>menu</em> button that takes you to main menu of the device and a <em>up</em> button that takes you to higher level in the menu.</p>
<p>You are probably wondering what&#8217;s <em>next</em> and <em>prev</em> buttons needed for. After all, there&#8217;s a <em>flip</em> button. Actually, <em>next</em> and <em>prev</em> complement the <em>flip</em> button. In menu, <em>flip</em> button allows you to step over pages of menu items (six items per page), while <em>next</em> and <em>prev</em> buttons allow you to walk through menu item after item.</p>
<p>The power button is a completely different story. It is exceptionally inconvenient. You really must to have your fingernails in good shape to turn Iliad on. Furthermore, not only you have to reach that needle, but you also have to hold it pressed for a second or two. There is absolutely no chance of pressing it accidentally. Yet you still have to hold it pressed to turn the device on. This is perhaps the most annoying imperfections that Irex afforded to have.</p>
<h3>Software</h3>
<p>Irex Iliad is a Linux based device. It&#8217;s interface built using, believe it or not, X windows toolkit. From one point of view it should ease software development. From the other point of view, it gives the interface slightly oldish look and feel &#8211; considering the monochromatic nature of the device it might be an advantage.</p>
<p>The Iliad&#8217;s interface is relatively well thought. There are eight items in the main menu</p>
<ol>
<li>Iliad Settings</li>
<li>Iliad Profiles</li>
<li>Reference Materials</li>
<li>Recent Documents</li>
<li>CF Card</li>
<li>MMC Card</li>
<li>USB Stick</li>
<li>Main Memory</li>
</ol>
<p>As I already mentioned there are four dedicated buttons that take you into news, books, docs or notes folders in either CF card, MMC card, USB stick or main memory (default). You can also use the main menu to get to one of these.</p>
<p>Anyway, things seems to be good more or less. The only thing that I didn&#8217;t like was the operation of the menu itself. First it is too bulky on the screen. There is absolutely no reason to limit number of items appearing on such a large screen to six &#8211; compare with Sony PRS-50X, pressing tens of items onto smaller screen. Other thing that I didn&#8217;t like very much is that the menu is so slow. I mean with so much RAM and CPU power, Iliad could draw in memory every possible menu item long before I attempt to access it and only show a picture once the menu is accessed. Instead it takes over a second, and sometimes even more, to open a menu item.</p>
<p>On the other hand, Irex tend to solve this kind of problems and in this particular case I think it will be solved at a time.</p>
<h3>Ergonomics</h3>
<p>One of the problems with all e-Ink based devices that I&#8217;ve seen is that they are not comfortable to hold. Despite this device is mostly hand held, Iliad in particular doesn&#8217;t have much space for a grip. This is bad for people with big hands, such as myself. Iliad is also not very comfortable for people with small hands because it is quiet heavy. It seems that Irex didn&#8217;t put too much effort into thinking about how people going to hold it.</p>
<p>This emphasizes the negative impression I got when was looking for power button. As far as ease of use and ergonomics concerned, Irex could do a much better job.</p>
<p>To complement this, I admit that I didn&#8217;t see other companies placing too much effort into solving this problem.</p>
<h3>The power thing</h3>
<p>Irex are doing excellent job keeping the device working for as long as possible. Also, this is one of the issues that improves over the time. When I received Iliad it was working for 6-8 hours. Now, with version 2.11 it&#8217;s supposed to be 12. Yet, just to make things a little bitter I must remind that Irex were selling 20 hours non-stop. They are no longer advertising anything like this today, but this is what I payed for.</p>
<p>Still, having a device like this working for 10 and even more hours straight is almost too much to ask.</p>
<h3>The boot time thing</h3>
<p>Iliad boots in 40 seconds. This is absolutely awful. Perhaps they&#8217;ve planned people having Iliad on for whole day. I don&#8217;t know. I was mostly using it for periods from couple of minutes, to couple of hours and while in later case waiting 40 seconds for it to boot is more or less acceptable, waiting 40 seconds just to read for two minutes (or actually what have left from them), is too much.</p>
<p>I encountered several discussions regarding this issue on different forums on the web. The final verdict, told by the Irex themselves, was that it is impossible to shorten boot time. This is mostly due to amount of hardware devices on board that have to be initialized.  Also it is impossible to implement suspend/resume features because hardware was never designed for something like this. I am not sure this is completely true, there is nothing we can do about it. 2nd edition of the device didn&#8217;t bring so awaited salvation. 40 seconds boot time it is.</p>
<h3>Upgrades</h3>
<p>Once in couple of months Irex releasing a new version of software for Iliad. Although it usually brings nothing exceptionally new to your Iliad experience, most of the time it does include nice improvements here and there. Over the time, Iliad&#8217;s battery life got better. New features, such as zoom in that I already mentioned and landscape mode, had appeared. It now supports Mobipocket, which is a very nice addition to the overall feature set.</p>
<p>One of the things that significantly improved Iliad experience was an improved PDF viewer page rendering time. As I mentioned e-Ink screens are very slow. It takes it almost a second to redraw itself. Irex did software changes to make this process much faster.</p>
<h3>SDK for Iliad</h3>
<p>One of the things Irex promised and accomplished was a release of SDK for Iliad. Iliad is Linux based device, running Linux kernel 2.4. It took them some time, but eventually the SDK is here and the results can already be seen &#8211; take the Sudoku game for Iliad for example.</p>
<p>The release of SDK makes me believe that MP3 support will arrive &#8211; and if Irex won&#8217;t add mp3 support, someone else will do it for them.</p>
<p>Last time I checked there were some problems installing home brew Iliad software &#8211; this process isn&#8217;t standardized yet. However things are changing and I believe more home brew software will appear and it will be much easier to install it.</p>
<h3>Technical support</h3>
<p>I applied for technical support twice. In both cases it was exceptionally slow and tedious process.</p>
<p>I&#8217;ve heart about people who were luckier then me. I think it depends on how you buy it and if there is a local distributor in your country. If you&#8217;re wondering how&#8217;s tech. support in your country, you better check on local forums and see what people are saying.</p>
<p>In case there is no local distributor in your country and you intend to buy directly from Irex, the technical support process is awful. If something goes wrong with your Iliad and it has to be repaired they send you a special box. You should place your Iliad into the box and send it back to them. Then, few weeks later they will send you a replacement unit. No, they won&#8217;t repair your unit. They will send you someone esle&#8217;s, repaired unit. And they won&#8217;t delete information from your Iliad before sending it to someone else, so make sure you don&#8217;t have any sensitive information on Iliad before sending it to repair. In addition you may run into problems with your local tax authorities &#8211; most likely they have no idea what&#8217;s Irex Iliad and why you and Irex Technologies LTD. want to exchange expensive goods without paying any customs.</p>
<p>I did it twice (see &#8220;Iliad vs. me&#8221; below) and in both cases the whole process took month and half.</p>
<p>Their technical support personnel isn&#8217;t exactly listening to you (reading your emails). Once they understand what&#8217;s the problem, they follow a procedure. They have procedures for every occasion and they will follow the procedure ignoring any of your attempts to speed things up. And you do want to speed things up because it is really slow.</p>
<p>Finally, luckily, it won&#8217;t cost you money (except for customs) if your Iliad is on warranty. Otherwise you will have to buy a &#8220;Repair Voucher&#8221; that can be as much as 112$.</p>
<h3>Conclusions</h3>
<p>I think I covered most of the interesting aspects of Irex Iliad. In my opinion the technology is absolutely amazing. Yet so far Irex Iliad failed to deliver what they sell. Perhaps this can be compensated by the fact that the technology is so new. Hopefully one day they will overcome the problems that Iliad has and it will become a killer device. They are making some progress (although I am not sure that the direction is right). In the meantime it is up to you to device whether to spend your money on the device.</p>
<h3>Iliad vs. me.</h3>
<p>As a post script to this review, I would like to tell you what have happened to me personally.</p>
<p>I bought Iliad a second after it became available here, in Israel. Payed for it a small fortune. At first I liked it very much, but after two months two horizontal stripes appeared in the middle of the screen. The stripes didn&#8217;t disappear when device was turned on and off. I ignored them, but then they became wider and eventually I had to apply to Irex&#8217;s technical support.</p>
<p><a href="http://www.alexandersandler.net/wp-content/uploads/2008/03/1.jpg" rel="nofollow" title="First stripe"  onclick="return TrackClick('http%3A%2F%2Fwww.alexandersandler.net%2Fwp-content%2Fuploads%2F2008%2F03%2F1.jpg','First+stripe')" onclick="return TrackClick('http%3A%2F%2Fwww.alexandersandler.net%2Fwp-content%2Fuploads%2F2008%2F03%2F1.jpg','First+stripe')"></a></p>
<p style="text-align: center"><a href="http://www.alexandersandler.net/wp-content/uploads/2008/03/1.jpg" rel="nofollow" title="First stripe"  onclick="return TrackClick('http%3A%2F%2Fwww.alexandersandler.net%2Fwp-content%2Fuploads%2F2008%2F03%2F1.jpg','First+stripe')" onclick="return TrackClick('http%3A%2F%2Fwww.alexandersandler.net%2Fwp-content%2Fuploads%2F2008%2F03%2F1.jpg','First+stripe')"><img src="http://www.alexandersandler.net/wp-content/uploads/2008/03/1.thumbnail.jpg" alt="First stripe" /></a></p>
<p>It took two months to complete box/replacement unit cycle. Most of them I spent without Iliad, reading books from my old pocket PC. I payed 30$ to Israeili customs authorities when I received the box for the first time &#8211; this is because they decided to check what kind of item costs 1$ and detained it. I had to pay 30$ storage fee (when they detain things, they store them).</p>
<p>I asked technical support, several times, what caused this problem and if there is a way to avoid this problem in the future. They ignored all my questions.</p>
<p>There was one problem with the replacement unit &#8211; the stylus for the touch screen was very loose in its slot. It was falling off its slot when you simply upended Iliad. I thought it is nothing, until one day I lost it. You can use Iliad without a stylus if you only need it for reading, but there are some things that require that darn stylus. For instance, you can&#8217;t change network settings without it.</p>
<p>I decided not to buy a new stylus because it was simply too expensive. Consider paying 50$ for piece of cheap plastic crappy stylus that you are going to loose anyway. It is cheaper now. Only 30$. Yet still too expensive for me.</p>
<p>Three months after I received a replacement unit, once again, a horizontal stripe appeared in the middle of the screen. It widened with time, so I applied for technical  support again. This time I wasn&#8217;t too patient and got almost blunt in my emails to them. Don&#8217;t know if it has anything to do with my bluntness or it was bad luck, but this time, the cycle took months, again.</p>
<p style="text-align: center"><a href="http://www.alexandersandler.net/wp-content/uploads/2008/03/2.jpg" rel="nofollow" title="Second stripe"  onclick="return TrackClick('http%3A%2F%2Fwww.alexandersandler.net%2Fwp-content%2Fuploads%2F2008%2F03%2F2.jpg','Second+stripe')"><img src="http://www.alexandersandler.net/wp-content/uploads/2008/03/2.thumbnail.jpg" alt="Second stripe" /></a></p>
<p>Replacement unit I received obviously wasn&#8217;t configured to work with my home wireless network. Since I didn&#8217;t have a stylus to configure it, I got stacked with version 2.10 of the software. Still, I kept using it, until three months ago vertical stripe appeared in the middle of the screen. This time the 1 year warranty was over so I decided not to apply for technical support but to write this review instead.</p>
<p><a href="http://www.alexandersandler.net/wp-content/uploads/2008/03/3.jpg" rel="nofollow" title="Third stripe"  onclick="return TrackClick('http%3A%2F%2Fwww.alexandersandler.net%2Fwp-content%2Fuploads%2F2008%2F03%2F3.jpg','Third+stripe')" onclick="return TrackClick('http%3A%2F%2Fwww.alexandersandler.net%2Fwp-content%2Fuploads%2F2008%2F03%2F3.jpg','Third+stripe')"></a></p>
<p style="text-align: center"><a href="http://www.alexandersandler.net/wp-content/uploads/2008/03/3.jpg" rel="nofollow" title="Third stripe"  onclick="return TrackClick('http%3A%2F%2Fwww.alexandersandler.net%2Fwp-content%2Fuploads%2F2008%2F03%2F3.jpg','Third+stripe')" onclick="return TrackClick('http%3A%2F%2Fwww.alexandersandler.net%2Fwp-content%2Fuploads%2F2008%2F03%2F3.jpg','Third+stripe')"><img src="http://www.alexandersandler.net/wp-content/uploads/2008/03/3.thumbnail.jpg" alt="Third stripe" /></a></p>
<p>At the moment I&#8217;m saving some money to buy myself a new ebook reader. Didn&#8217;t decide which one to buy yet, but it certainly won&#8217;t be Irex Technologies Iliad.</p>
<p>I hope you found this article useful. Fill free to leave comments.</p>
<p>Alexander Sandler.</p>


<p>Related posts:<ol><li><a href='http://www.alexonlinux.com/g15dods' rel='bookmark' title='Permanent Link: g15dods'>g15dods</a></li>
<li><a href='http://www.alexonlinux.com/hall-of-fame' rel='bookmark' title='Permanent Link: Hall of fame'>Hall of fame</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.alexonlinux.com/irex-technologies-iliad-together-more-than-a-year/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
