<?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>Harsh J &#187; Software</title>
	<atom:link href="http://www.harshj.com/tags/personal/computing-issues/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.harshj.com</link>
	<description>Memoirs of a QWERTY Keyboard</description>
	<lastBuildDate>Sun, 15 Jan 2012 19:52:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<atom:link rel='hub' href='http://www.harshj.com/?pushpress=hub'/>
		<item>
		<title>Email&#8217;s Reply-To Header and Mailing Lists</title>
		<link>http://www.harshj.com/2011/04/06/emails-reply-to-header-and-mailing-lists/</link>
		<comments>http://www.harshj.com/2011/04/06/emails-reply-to-header-and-mailing-lists/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 18:19:23 +0000</pubDate>
		<dc:creator>Harsh</dc:creator>
				<category><![CDATA[Computing Issues]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.harshj.com/?p=2705</guid>
		<description><![CDATA[It is very irritating to have to hit &#8220;Reply to all&#8221; in an email on a mailing list in order to make your message post back to the list and not the original author of the mail you are replying to. I never really understand why public mailing lists never implement the reply-to munging feature [...]]]></description>
			<content:encoded><![CDATA[<p>It is very irritating to have to hit &#8220;<em>Reply to all</em>&#8221; in an email on a mailing list in order to make your message post back to the list and not the original author of the mail you are replying to.</p>
<p>I never really understand why public mailing lists never implement the reply-to munging feature to always overwrite the Reply-To fields back to the mailing list address instead of the user address. Erlang&#8217;s <a title="Erlang.org's questions mailing list." href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">questions list</a> is one such example.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6470447295952949";
//Big-Posts-Journalist
google_ad_slot = "1391165574";
google_ad_width = 336;
google_ad_height = 280;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>The mailman software&#8217;s <a title="Reply-To munging - a feature and some &quot;guidelines&quot;" href="http://www.gnu.org/software/mailman/mailman-admin/node11.html" target="_blank">doc page on the topic</a> of munging &#8220;reply-to&#8221; mentions that this is a pretty sensitive issue but I fail to see why. When I get onto a mailing list with a question, I would like to have the best responses &#8211; even if that meant it had to come from multiple people. If everyone posted to the list itself, the ensuing email &#8220;conversation&#8221; can be more effective than if everyone were to reply to only the author. In the former case, people who&#8217;ve offered solutions or suggestions can still have their answers improved upon by other people who&#8217;ve read it &#8211; thereby proving more helpful than the latter case.</p>
<p>There is <a title="&quot;Reply-To munging is harmful&quot; - NOT on public mailing lists." href="http://woozle.org/~neale/papers/reply-to-still-harmful.html" target="_blank">this page</a> which asserts the RFC&#8217;s statements on what the Reply-To really stands for, and I disagree to its views since a user getting on a mailing list <strong>does not</strong> know what they want their Reply-To to be. They are posting to a public mailing list and it would be very disappointing if the mailing list does not serve the public&#8217;s interest in sharing and improving knowledge. Following standards is a good thing when it is constructive, not destructive.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6470447295952949";
//Big-Posts-Journalist
google_ad_slot = "1391165574";
google_ad_width = 336;
google_ad_height = 280;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Let us get a little off-track here. Have a look at <a href="http://stackoverflow.com" target="_blank">Stack Overflow</a>, or even the newer <a href="http://quora.com" target="_blank">Quora</a> &#8211; They never hide any answers from the public when a question is replied to. The answers do not privately go to the author, nor do the comments upon it. Everything is pretty much public. As a result, people have enjoyed very good answers with edits and comments; and using web search has proven to be more effective in problem-solving at work or else ever since these sites got popular. Why can&#8217;t the same ideals, then, be applied to the archaic-yet-effective mailing lists?</p>
<p>I&#8217;d like to state my opinions only here (in personal spaces). I do not wish to engage in &#8220;flame wars&#8221;, which is claimed to happen in discussions on these topics and thereby refuse to bring up this topic on the mailing lists that follow no reply-to overriding.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.harshj.com/2011/04/06/emails-reply-to-header-and-mailing-lists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A simple email search trick</title>
		<link>http://www.harshj.com/2011/01/17/a-simple-email-search-trick/</link>
		<comments>http://www.harshj.com/2011/01/17/a-simple-email-search-trick/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 17:33:27 +0000</pubDate>
		<dc:creator>Harsh</dc:creator>
				<category><![CDATA[Computing Issues]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Gmail]]></category>
		<category><![CDATA[Helpful]]></category>
		<category><![CDATA[Trick]]></category>

		<guid isPermaLink="false">http://www.harshj.com/?p=1542</guid>
		<description><![CDATA[Oh boy, I love standards. When I was wondering how do I search for mails sent by me, where I&#8217;m also the thread originator, I looked at what GMail had to offer as it search fields and other such advanced options. In the end my search was simply: Now am wondering why it didn&#8217;t strike [...]]]></description>
			<content:encoded><![CDATA[<p>Oh boy, I love standards.<br />
<!--adsense--><br />
When I was wondering how do I search for mails sent by me, where I&#8217;m <strong><em>also</em> the thread originator</strong>, I looked at what GMail had to offer as it search fields and other such advanced options. In the end my search was simply:</p>
<pre class="brush: plain; title: ; notranslate">in:sent from:me term -Re</pre>
<p><!--adsense--></p>
<p>Now am wondering why it didn&#8217;t strike me immediately to look for the &#8220;<strong>Re</strong>&#8221; keyword that makes a mail a reply de-facto. Of course, there&#8217;s a much more neater, more RFC-5322 compliant way of searching such mails, but I&#8217;m unsure if <em>GMail</em> supports such querying.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.harshj.com/2011/01/17/a-simple-email-search-trick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arkham Spider-Man</title>
		<link>http://www.harshj.com/2010/12/26/arkham-spider-man/</link>
		<comments>http://www.harshj.com/2010/12/26/arkham-spider-man/#comments</comments>
		<pubDate>Sat, 25 Dec 2010 19:46:07 +0000</pubDate>
		<dc:creator>Harsh</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Spider-Man]]></category>

		<guid isPermaLink="false">http://www.harshj.com/?p=1407</guid>
		<description><![CDATA[I have to play every Spider-Man game produced, somehow. So I went ahead and got my hands on the most recent one of them, &#8220;Spider-Man: Shattered Dimensions&#8220;, and oh boy. I&#8217;m blown away! After playing Batman: Arkham Asylum, my bar that sets the definition of a good RPG action game just took a shot towards [...]]]></description>
			<content:encoded><![CDATA[<p>I <strong>have</strong> to play every Spider-Man game produced, <em>somehow</em>. So I went ahead and got my hands on the most recent one of them, &#8220;<strong>Spider-Man: Shattered Dimensions</strong>&#8220;, and oh boy. I&#8217;m blown away!</p>
<div class="wp-caption aligncenter" style="width: 258px"><img title="Spider-Man: Shattered Dimensions" src="http://img267.imageshack.us/img267/1531/spidermanshattereddimene.jpg" alt="Spider-Man: Shattered Dimensions" width="248" height="350" /><p class="wp-caption-text">Spider-Man: Shattered Dimensions Box Cover showing all four playable Spider-Men -- 2099, Amazing, Noir and Ultimate (The Ultimate character comes with a Venom suit)</p></div>
<p><!--adsense--><br />
After playing <strong>Batman: Arkham Asylum</strong>, my bar that sets the definition of a <em>good</em> RPG action game just took a shot towards the sky. The game-play in it was the most involving for a comic character based RPG, based on a comic character who&#8217;s at human heights. The fights were great, the moving around the area fluid and just like how the character would do, etc.. I&#8217;m sure you&#8217;ll appreciate the game if you play it, cause the story doesn&#8217;t disappoint you either.</p>
<p>Along came the Spider-Man game, and brought in perhaps for the first time ever, the Spider-Man 2099 and the Spider-Man Noir characters into video games! I think they&#8217;re great characterizations. The former imposing the role upon himself to get rid of a drug addiction, and the latter just facing a twisted history with his timeless humor. Their comics are great too.</p>
<div class="wp-caption aligncenter" style="width: 610px"><img title="Spider-Man Noir" src="http://img140.imageshack.us/img140/8548/spidermanshattereddimenu.jpg" alt="Spider-Man Noir" width="600" height="339" /><p class="wp-caption-text">Spider-Man Noir -- Incapacitating a henchman. All in total silence. Way cool.</p></div>
<p>Now case-in-point: <strong>Spider-Man Noir</strong>. The Noir Spider-Man levels in Shattered Dimensions is very similar to what much of Arkham Asylum had to offer. Only, it has <em>much more pace</em>. Any Spider-Man game worth its salt would offer deadly combos and faster-than-eye-can-follow agility during battles, and Shattered Dimensions <em>doesn&#8217;t</em> disappoint. The way you could incapacitate a henchman in Arkham Asylum, you can do it with Spider-Man Noir using webbing. Sneak up on them in the darkness, and web yank them to blackouts. Its Arkham Asylum all over, <strong>but with webs and sticking on walls</strong>! I&#8217;m not getting enough of this, so am going and playing more of it now. What&#8217;s more is that it offers a great bunch of classic rogues from Spider-Man gallery, across different timelines; yet you don&#8217;t get lost!<br />
<!--adsense--><br />
You should try this game out, its good fun with not too repetitive themes. For Spider-Man fans, it is an imperative. Stan Lee has himself voiced over a few narrations. This one is surely a timeless classic.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.harshj.com/2010/12/26/arkham-spider-man/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing the Google Chrome&#8217;s User Agent String</title>
		<link>http://www.harshj.com/2010/12/22/changing-the-google-chromes-user-agent-string/</link>
		<comments>http://www.harshj.com/2010/12/22/changing-the-google-chromes-user-agent-string/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 19:48:49 +0000</pubDate>
		<dc:creator>Harsh</dc:creator>
				<category><![CDATA[Computing Issues]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.harshj.com/?p=1416</guid>
		<description><![CDATA[A simple google for changing the Google Chrome web-browser&#8217;s UA (user-agent) string would lead you to a horribly old, yet popular result that would ask you to basically hex-hack the chrome binary [Winks at labnol.org]. Ugh, ugh, ugly for 2010! For those who don&#8217;t know yet, you can start a fresh chrome window with a [...]]]></description>
			<content:encoded><![CDATA[<p>A simple google for changing the Google Chrome web-browser&#8217;s UA (user-agent) string would lead you to a horribly old, yet popular result that would ask you to basically hex-hack the chrome binary [Winks at labnol.org]. Ugh, ugh, ugly for 2010!</p>
<p><!--adsense--></p>
<p>For those who don&#8217;t know yet, you can start a fresh chrome window with a custom UA using the <strong>&#8211;user-agent</strong> command-line parameter while launching it:</p>
<pre class="brush: bash; title: ; notranslate">
# Using chrome, or chromium -- as you like it.
chrome --user-agent=&quot;My User Agent String. Bow to it, statisticians. Kidding.&quot;
</pre>
<p>You can then visit <a href="http://whatsmyuseragent.com/">http://whatsmyuseragent.com/</a> to verify the results of the user-agent property change in Chrome/Chromium.</p>
<p>The command-line parameter, <strong>&#8211;user-agent</strong>, is (not very) surprisingly not documented under the supplied manual page.</p>
<p><!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.harshj.com/2010/12/22/changing-the-google-chromes-user-agent-string/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Swype Beta APK [Zeitgeist]</title>
		<link>http://www.harshj.com/2010/12/22/swype-beta-apk-zeitgeist/</link>
		<comments>http://www.harshj.com/2010/12/22/swype-beta-apk-zeitgeist/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 19:26:54 +0000</pubDate>
		<dc:creator>Harsh</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.harshj.com/?p=1413</guid>
		<description><![CDATA[[This is a December 2010 Post -- mind it] Here&#8217;s a quick way to download the now-available beta swype.apk if you don&#8217;t really want to download right onto your phone via their given link: There, nice and easy? Sorry Swype, to make you count a N1 download instead of an SGS.]]></description>
			<content:encoded><![CDATA[<p>[This is a December 2010 Post -- mind it]<br />
<!--adsense--><br />
Here&#8217;s a quick way to download the now-available beta swype.apk if you don&#8217;t really want to download right onto your phone via their given link:</p>
<pre class="brush: bash; title: ; notranslate">wget https://beta.swype.com/android/get/?download_NOW=androidBeta -U &quot;Mozilla/5.0 (Linux; U; Android 2.2; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1&quot; -O Swype.apk</pre>
<p>There, nice and easy?</p>
<p>Sorry Swype, to make you count a N1 download instead of an SGS.<br />
<!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.harshj.com/2010/12/22/swype-beta-apk-zeitgeist/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Modals and the spinning void</title>
		<link>http://www.harshj.com/2010/09/25/modals-and-the-spinning-void/</link>
		<comments>http://www.harshj.com/2010/09/25/modals-and-the-spinning-void/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 18:38:55 +0000</pubDate>
		<dc:creator>Harsh</dc:creator>
				<category><![CDATA[Computing Issues]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.harshj.com/?p=1155</guid>
		<description><![CDATA[If you like modal dialogs, you love being annoyed and probably don&#8217;t care if you murder someone out there due to the rage that you didn&#8217;t know popped up cause of some piece of software pushing a neat looking, variable sized box with aligned text and a helper image onto your face. Never has a [...]]]></description>
			<content:encoded><![CDATA[<p>If you like modal dialogs, you love being annoyed and probably don&#8217;t care if you murder someone out there due to the rage that you didn&#8217;t know popped up cause of some piece of software pushing a neat looking, variable sized box with aligned text and a <em>helper</em> image onto your face.</p>
<p>Never has a modal dialog made you read itself to understand. It has always been about pressing the right button, to get back to whatever it was you wanted to do. As far as intentions of the developers, and to some extent the libraries go, they only want you to do whatever it is you wanted to do in the software&#8217;s right way. Press the right button, and maybe the software will do good to you. Press the wrong button and you&#8217;re probably doomed. Press the only button and you know you&#8217;re back to square one. If there are no buttons, then thank god for the display manager. If there is no display manager, you&#8217;re free of all annoyances.<br />
<!--adsense--><br />
There have been enough criticisms of modal dialogs that the Wikipedia page for the same has a section discussing it. But one hardly finds an application that does not throw a modal dialog on your face for whatever it is you did wrong or it did wrong (oh the horror).</p>
<p>Then there came the web, claiming to do away with most modal stuff as the web GUI programming model is hardly similar to the desktop model. Designers had a great chance to rid all the flaws of ancient desktop models and implement the best usability ways there could ever be, with support of some very powerful languages and associated libraries. What got popular instead, are things similar to Lightbox.</p>
<p>Such elegant are the looks of a lightbox implementation (an example of modal-ness), that it makes you feel all warm inside when you see it working on your own website, the feeling you get about never having to, or having your visitors to, leave the page they are on in order to see content associated to it; and to certain extent, browse horizontally across all other associated content than just one. It began okay first, click a media and it begins a modal environment that looks like Apple&#8217;s keynote events with a spinner. People could also open the link in a new tab to view the image in their browser&#8217;s image viewer (or other). Then, people couldn&#8217;t. Someone exclaimed with great delight that their JavaScript Kung-Fu was better than others.</p>
<p>Its one thing to pop a modal window and darken out all other content to let it have <em>focus</em>. It is another thing to add a spinning animation with absolutely no information, percentage wise or other, to indicate progress. Nobody cared if the spinner were enough to let the user know content&#8217;s actually loading or not because hey, they developed it in environments where the network was blazing fast and you hardly ever saw it. Progress. They just don&#8217;t get its meaning right. Space and time are measurable quantities and with content, progress is finite and must be calculated to be called as a progress animation. Fancy circular spinning darkness is anything but fancy. Even the Flash developers of the past, present <em>and the future</em> understood this mostly. But not the web developers, never ever.<br />
<!--adsense--><br />
Has no one ever noticed how a browser or image viewers worth their salt render images? Has nobody seen the progressive rendering of image data on the screen as it gets downloaded? It might make your network feel slow, but it never lets it feel non-functional.</p>
<p>Plague like the Lightbox (and associated <em>beautiful</em> modals) must be scrubbed out of the WWW. Let my clicks pass me to another page, I don&#8217;t mind. Nobody ever minded it until someone suspected they did.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.harshj.com/2010/09/25/modals-and-the-spinning-void/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pomodoro and KDE</title>
		<link>http://www.harshj.com/2010/05/05/pomodoro-and-kde/</link>
		<comments>http://www.harshj.com/2010/05/05/pomodoro-and-kde/#comments</comments>
		<pubDate>Wed, 05 May 2010 09:52:54 +0000</pubDate>
		<dc:creator>Harsh</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Pomodoro]]></category>
		<category><![CDATA[RSIBreak]]></category>
		<category><![CDATA[Timer]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://www.harshj.com/?p=876</guid>
		<description><![CDATA[Am no follower of the Pomodoro technique nor do I know its specifics but before you go ahead and try out those multiple Adobe AIR applications or use the GNOME-oriented Workrave, please try out this software called RSIBreak which was built for KDE specifically. It isn&#8217;t a full fledged timer feature but I think it [...]]]></description>
			<content:encoded><![CDATA[<p>Am no follower of the Pomodoro technique nor do I know its specifics but before you go ahead and try out those multiple Adobe AIR applications or use the GNOME-oriented <a title="Workrave - RSI software for GNOME" href="http://workrave.com" target="_blank">Workrave</a>, please try out this software called <strong><a title="RSIBreak - RSI Software for KDE" href="http://rsibreak.org" target="_blank">RSIBreak</a></strong> which was built for <strong>KDE</strong> specifically.<br />
<!--adsense--></p>
<div class="wp-caption aligncenter" style="width: 255px"><a href="http://rsibreak.org"><img class="  " title="RSIBreak - Repetitive Strain Injury prevention software for KDE" src="http://img263.imageshack.us/img263/2506/popup.png" alt="RSIBreak - Repetitive Strain Injury prevention software for KDE" width="245" height="73" /></a><p class="wp-caption-text">RSIBreak - Repetitive Strain Injury prevention software for KDE</p></div>
<p><!--adsense--><br />
It isn&#8217;t a full fledged timer feature but I think it will get your needs covered with its offerings easily enough. One of the amazing utilities I&#8217;ve used, built with KDE Libraries. It should be available in your Linux distribution&#8217;s software repository too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.harshj.com/2010/05/05/pomodoro-and-kde/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PyQt &#8211; Creating interfaces visually with Designer</title>
		<link>http://www.harshj.com/2010/04/18/pyqt-creating-interfaces-visually-with-designer/</link>
		<comments>http://www.harshj.com/2010/04/18/pyqt-creating-interfaces-visually-with-designer/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 15:58:03 +0000</pubDate>
		<dc:creator>Harsh</dc:creator>
				<category><![CDATA[Computing Issues]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[PyQt]]></category>
		<category><![CDATA[PyQt Python Programming Tutorial Designer]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Qt]]></category>

		<guid isPermaLink="false">http://www.harshj.com/?p=662</guid>
		<description><![CDATA[Note: If you&#8217;re new to using PyQt but are interested in great cross-platform GUI application development please read the PyQt Introduction article. Designing a graphical interface for an application could be a tiresome task. There are guidelines to keep track of, layouts to maintain and more of such stuff. In the PyQt code samples you&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><em><strong>Note:</strong> If you&#8217;re new to using PyQt but are interested in great cross-platform GUI application development please read the </em><a title="Introduction to PyQt and Nokia's Qt4" href="http://www.harshj.com/2009/04/26/the-pyqt-intro/" target="_self"><em>PyQt Introduction</em></a><em> article.</em></p></blockquote>
<p>Designing a graphical interface for an application could be a tiresome task. There are guidelines to keep track of, layouts to maintain and more of such stuff. In the PyQt code samples you&#8217;ve seen so far we&#8217;ve written our interfaces in pure code. While this is fun and easy to do for little applications that consist of about 5 to 10 widgets, it&#8217;s not worth spending the time upon in creating fully blown up interfaces for complete applications.</p>
<h1>The Qt Designer</h1>
<p>Fortunately, Qt provides us a tool to design interfaces and to port it to usable code automatically. This tool is called the Qt Designer, and it comes with the Qt library bundle you installed. Additionally we would require a converter for processing the XML .ui files Designer produces into a python module .py file; also installed with the PyQt4 bundle.</p>
<p>Thus, to design in PyQt we need the two following tools:</p>
<ul>
<li><strong>Qt Designer</strong> from Nokia&#8217;s Qt Software</li>
<li>The <strong>pyuic4</strong> script from Riverbank&#8217;s PyQt</li>
</ul>
<p>Once you have Designer and PyQt4 tools installed, let&#8217;s fire it up and get started.</p>
<p>The initial interface might look familiar to those who have used Visual Studio, or Glade and such tools. For the rest, it&#8217;s intuitive enough to learn smoothly. Read the <a title="Qt Designer Tutorial and Guide" href="http://qt.nokia.com/doc/latest/qt4-designer.html" target="_blank">Qt Designer guide</a> for more elaborate help if you still don&#8217;t find it usable.</p>
<div class="wp-caption aligncenter" style="width: 497px"><a href="http://pyqt.files.wordpress.com/2010/04/qt-designer-window.png"><img class=" " title="The Qt Designer" src="http://pyqt.files.wordpress.com/2010/04/qt-designer-window.png" alt="The Qt Designer" width="487" height="132" /></a><p class="wp-caption-text">The Qt Designer</p></div>
<p>In this article, we&#8217;ll be using Designer to design and create a simple <strong>Image Viewer application</strong>.</p>
<p>References: <a title="Qt Designer Documentation at Nokia" href="http://qt.nokia.com/doc/latest/qt4-designer.html" target="_blank">Qt Designer</a>, <a title="Using Qt Designer with PythonQt4" href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#using-qt-designer" target="_blank">The PyQt + Qt Designer Documentation</a></p>
<h2>Image Viewer</h2>
<p>Our Image Viewer application would be a very simple one, with options to Open an image file of major types (JPEG, PNG, GIF, etc.) and another to Quit. Upon opening of an image, we shall also set the status bar to show the dimensions of the image.<br />
<!--adsense--></p>
<h3>Designing the GUI</h3>
<p>Open <strong>Qt Designer</strong> (&#8216;designer&#8217; command if on Linux) and choose File | New | &#8220;Main Window&#8221; under templates/forms expansion. This creates a new <strong>QMainWindow</strong> widget for us to work upon. The <em>QMainWindow</em> is basically a composition of a main-area widget, a menu-bar and a status-bar at the bottom, the very usual stuff an application consists of.</p>
<div class="wp-caption aligncenter" style="width: 399px"><img title="Design of the Image Viewer UI" src="http://pyqt.files.wordpress.com/2010/04/image-viewer-in-designer.png" alt="Design of the Image Viewer UI" width="389" height="331" /><p class="wp-caption-text">Design of the Image Viewer UI</p></div>
<p>From the Widget Box, drag a Label onto the main window&#8217;s area. Right-Click at any of the free space available on the same area, choose the &#8220;Lay out&#8221; sub-menu and then hit the &#8220;Lay out Horizontally&#8221; option. Designer will automatically stretch your Label across the area available this way. We need this layout (any layout will do here, actually) since we want the image to show in the entire window area.</p>
<p>Now on to menus, Add a File menu and under it add an Open and a Quit option, as shown below. To add these just click where it says &#8220;Type here&#8221; and get typing; Hit Enter/Return key to get to the next element in the menu after you&#8217;ve typed.</p>
<p>Under the Property Editor, select and set the Label&#8217;s <strong>text</strong> property to blank, and its <strong>alignment</strong> property to <strong>AlignHCenter and AlignVCenter</strong>. This completes our UI design in Qt Designer. But don&#8217;t quit already, do explore the other properties of the widgets used and figure out their possible uses; get used to the interface and available tools like Form Previews, etc.</p>
<div class="wp-caption aligncenter" style="width: 317px"><img title="The imageLabel (QLabel) object Properties" src="http://pyqt.files.wordpress.com/2010/04/image-viewer-label-properties.png" alt="The imageLabel (QLabel) object Properties" width="307" height="218" /><p class="wp-caption-text">The imageLabel (QLabel) object Properties</p></div>
<p>For instance, check out the properties like <strong>geometry</strong> (Height and Width), <strong>font</strong>, <strong>tooltip</strong>, etc. If you&#8217;re in a good reading mood, also checkout the amazing <a title="Qt Style Sheets" href="http://qt.nokia.com/doc/latest/stylesheet-reference.html" target="_blank">Style Sheet documentation</a> in Qt Assistant, as it explains a lot about each Widget&#8217;s construct and how to go about customizing it till your heart&#8217;s content.</p>
<p>Finally, renaming the widget elements&#8217; variables would be a good idea, since it will help us code our application in a much more readable manner. This is how I&#8217;ve named these widgets but feel free to follow whatever naming conventions you would like to use:</p>
<div class="wp-caption aligncenter" style="width: 316px"><img title="Image Viewer object names" src="http://pyqt.files.wordpress.com/2010/04/image-viewer-object-names.png" alt="Image Viewer object names" width="306" height="192" /><p class="wp-caption-text">Image Viewer object names</p></div>
<p>Just double-click on the Object Name items and edit them in-line after that. Note and remember your <strong>QMainWindow</strong> class&#8217;s object name. Once you&#8217;re done, save the file as &#8216;<strong><em>ImageViewerUI.ui</em></strong>&#8216;.</p>
<p>References: <a title="QLabel Class Reference" href="http://qt.nokia.com/doc/latest/qlabel.html" target="_blank">QLabel</a>, <a title="QAction Class Reference" href="http://qt.nokia.com/doc/latest/qaction.html" target="_blank">QAction</a>, <a title="QMenuBar Class Reference" href="http://qt.nokia.com/doc/latest/qmenubar.html" target="_blank">QMenuBar</a>, <a title="Using Layouts in Qt Designer - A Guide" href="http://qt.nokia.com/doc/latest/designer-layouts.html" target="_blank">Layouts Guide</a></p>
<h3>Using PyQt&#8217;s pyuic4 script</h3>
<p>Our next step requires the use of the aforementioned pyuic4 tool. It&#8217;s usage syntax is as follows:</p>
<pre class="brush: bash; title: ; notranslate">pyuic4 input_file.ui -o output_file.py
# Optionally takes -x parameter to make the generated code executable.</pre>
<p>Thus we should run, for our UI file:</p>
<pre class="brush: bash; title: ; notranslate">pyuic4 ImageViewerUI.ui -o ImageViewerUI.py</pre>
<p>This will create a file <strong>ImageViewerUI.py</strong> that we can now use. Looking into the file will show you that its just a long list of widget constructs and of applying property settings. There is no need to edit this file, and is advised not to since pyuic4 will over-write all changes in it if you run it once again after some changes you wanted to do.</p>
<p>Whenever you edit your .ui files, make sure to run the pyuic4 tool to convert it into its Python equivalent (or to update existing Python code such that it reflects the new changes).</p>
<p>Additional info: Try `<strong>pyuic4 &#8211;help</strong>` for more fine-tuning options.</p>
<h3>Running the basic GUI</h3>
<p>Create a new file <strong>ImageViewer.py</strong> to finally add the application logic. Before we get to the code part, let me explain how the Qt&#8217;s subclass approach works. A Qt Designer file is inherited by the QMainWindow-derived class, and then the interface is setup using the <strong>setupUi()</strong> call with an instance. This creates all the objects/widgets for the interface as attributes of the derived QMainWindow class so that it&#8217;s ready to show. Next, we need to add the application-level logic to this derived class as normal methods. Since we have access to all the widgets used in the interface via our class, we can do as we like with their available features. The following diagram explains the hierarchy we ought to follow each time we need to implement a UI class for use:</p>
<div class="wp-caption aligncenter" style="width: 277px"><img title="Image Viewer Inheritance Diagram" src="http://pyqt.files.wordpress.com/2010/04/imageviewerinheritance.png" alt="Image Viewer Inheritance Diagram" width="267" height="166" /><p class="wp-caption-text">Image Viewer Inheritance Diagram</p></div>
<p>Thus, a basic class that can be run would look like:</p>
<pre class="brush: python; title: ; notranslate">
#!/usr/bin/python

from PyQt4 import QtGui, QtCore
import sys

# Import the interface class
import ImageViewerUI

class ImageViewer(QtGui.QMainWindow, ImageViewerUI.Ui_mainWindow):
    &quot;&quot;&quot; The second parent must be 'Ui_&lt;obj. name of main widget class&gt;'.
        If confusing, simply open up ImageViewer.py and get the class
        name used. I'd named mine as mainWindow, hence Ui_mainWindow. &quot;&quot;&quot;

    def __init__(self, parent=None):
        super(ImageViewer, self).__init__(parent)
        # This is because Python does not automatically
        # call the parent's constructor.
        self.setupUi(self)
        # Pass this &quot;self&quot; for building widgets and
        # keeping a reference.

    def main(self):
        self.show()

if __name__=='__main__':
    app = QtGui.QApplication(sys.argv)
    imageViewer = ImageViewer()
    imageViewer.main()
    app.exec_()
    # This shows the interface we just created. No logic has been added, yet.</pre>
<p>Run this class and you can see the window you just created.</p>
<div class="wp-caption aligncenter" style="width: 376px"><img title="Basic GUI of Image Viewer during Runtime" src="http://pyqt.files.wordpress.com/2010/04/image-viewer-ui.png" alt="Basic GUI of Image Viewer during Runtime" width="366" height="341" /><p class="wp-caption-text">Basic GUI of Image Viewer during Runtime</p></div>
<p>You MUST call <strong>self.setupUi(self)</strong> to make the UI file run the setup statements and build the GUI interface for use by our class.</p>
<p>References: <a title="QMainWindow Class Reference" href="http://qt.nokia.com/doc/latest/qmainwindow.html" target="_blank">QMainWindow</a><br />
<!--adsense--></p>
<h3>Adding Application Logic and other Code</h3>
<p>Now to add the opening-an-image feature, let&#8217;s define a few methods in the class as:</p>
<pre class="brush: python; highlight: [22,24,25,30,34,37,38,39,40,41,42,45,46]; title: ; notranslate">
#!/usr/bin/python
# -*- coding: utf-8 -*-

from PyQt4 import QtGui, QtCore
import sys

# Import the interface class
import ImageViewerUI

class ImageViewer(QtGui.QMainWindow, ImageViewerUI.Ui_mainWindow):
    &quot;&quot;&quot; The second parent must be Ui_&lt;obj. name of main widget class&gt;. \
      If confusing, simply open up ImageViewer.py and get the class \
      name used. I'd named mine as mainWindow and hence the use. &quot;&quot;&quot;

    def __init__(self, parent=None):
        super(ImageViewer, self).__init__(parent)
        # This is because Python does not automatically
        # call the parent's constructor.
        self.setupUi(self)
        # Pass this &quot;self&quot; for building widgets and
        # keeping a reference.
        self.connectActions()

    def connectActions(self):
        self.actionQuit.triggered.connect(QtGui.qApp.quit)
        # Connect the Quit action's triggered signal
        # to a proper Quit method
        # given by qApp (which points to your QApplication
        # object).
        self.actionOpen.triggered.connect(self.openImage)
        # Connect the Open action's triggered signal
        # to load an image onto the image label.

    def openImage(self):
        # Lets get a user-provided file to open
        # using PyQt's QFileDialog class.
        fileName = QtGui.QFileDialog.getOpenFileName(
                        self,
                        &quot;Open Image File&quot;,
                        QtCore.QDir.homePath(),
                        &quot;Image Files (*.jpg *.jpeg *.gif *.png)&quot;
                    )
        # Don't attempt to open if open dialog
        # was cancelled away.
        if fileName:
            self.imageLabel.setPixmap(QtGui.QPixmap(fileName))
            # Load the image file as a pixmap onto the
            # labelImage QLabel GUI object.

    def main(self):
        self.show()

if __name__=='__main__':
    app = QtGui.QApplication(sys.argv)
    imageViewer = ImageViewer()
    imageViewer.main()
    app.exec_()
</pre>
<p>Note the two new method additions <strong>connectActions()</strong> and <strong>openImage()</strong>. They complete the application logic that&#8217;s involved for our image viewing application example. Try to understand them better by seeing the PyQt classes used in them and referring them up in Qt Assistant for much more detailed information.</p>
<p>Now the application can open images via <strong>File | Open</strong> and can also be quit via <strong>File | Quit</strong>.</p>
<p>This is the final result of our work:</p>
<div class="wp-caption aligncenter" style="width: 276px"><img title="Image Viewer in Action" src="http://pyqt.files.wordpress.com/2010/04/image-viewer-in-action.png" alt="Image Viewer in Action" width="266" height="238" /><p class="wp-caption-text">Image Viewer in Action</p></div>
<p>References: <a title="QPixmap Class Reference" href="http://qt.nokia.com/doc/latest/qpixmap.html" target="_blank">QPixmap</a>, <a title="QFileDialog Class Reference" href="http://qt.nokia.com/doc/latest/qfiledialog.html" target="_blank">QFileDialog</a>, <a title="qApp Macro Documentation" href="http://qt.nokia.com/doc/4.6/qapplication.html#qApp" target="_blank">qApp</a></p>
<h2>Exercise</h2>
<p>Try to build a simple text-based evaluator application that contains of two things:</p>
<ul>
<li>A text input box that allows for mathematical expressions input.</li>
<li>An output label or text area (non-editable) for showing results of these expressions.</li>
</ul>
<p>Classes you could use are <a title="QLabel Class Reference" href="http://qt.nokia.com/doc/latest/qlabel.html" target="_blank">QLabel</a>, <a title="QLineEdit Class Reference" href="http://qt.nokia.com/doc/latest/qlineedit.html" target="_blank">QLineEdit</a> and <a title="QTextArea Class Reference" href="http://qt.nokia.com/doc/latest/qtextedit.html" target="_blank">QTextEdit</a>. Another hint is to use Python&#8217;s &#8216;<a title="Python's eval - built-in function (evaluator of expressions and code)" href="http://docs.python.org/library/functions.html#eval" target="_blank">eval</a>&#8216; function. As a bonus try to make the evaluation via Python safe.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.harshj.com/2010/04/18/pyqt-creating-interfaces-visually-with-designer/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>KDE and the .gtkrc</title>
		<link>http://www.harshj.com/2010/04/17/kde-and-the-gtkrc/</link>
		<comments>http://www.harshj.com/2010/04/17/kde-and-the-gtkrc/#comments</comments>
		<pubDate>Sat, 17 Apr 2010 11:11:34 +0000</pubDate>
		<dc:creator>Harsh</dc:creator>
				<category><![CDATA[Computing Issues]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[.gtkrc]]></category>
		<category><![CDATA[Customization]]></category>
		<category><![CDATA[KDE4]]></category>
		<category><![CDATA[QtCurve]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://www.harshj.com/?p=841</guid>
		<description><![CDATA[In my quest to have a perfectly usable dark theme I found I would require two things: The QtCurve Style for KDE Applications The darkPearl QtCurve theme for QtCurve and its KDE Color Scheme Having acquired those, I went on to install and select them via System Settings&#8217;s Appearance applet and all my Qt4+KDE4 applications [...]]]></description>
			<content:encoded><![CDATA[<p>In my quest to have a perfectly usable dark theme I found I would require two things:</p>
<ul>
<li>The <a title="QtCurve for GTK, KDE3 and KDE4" href="http://kde-look.org/content/show.php?content=40492" target="_blank">QtCurve Style</a> for KDE Applications</li>
<li>The <a title="darkPearl - A great dark theme for KDE4/QtCurve" href="http://kde-look.org/content/show.php/darkPearl+for+QtCurve?content=97644" target="_blank">darkPearl QtCurve theme</a> for QtCurve and its KDE Color Scheme</li>
</ul>
<p><!--adsense--><br />
Having acquired those, I went on to install and select them via <em>System Settings&#8217;s Appearance</em> applet and all my Qt4+KDE4 applications looked neat in their dark avatars. Next I had to make <em>Chromium</em> reflect and respect the native theme settings and found an option for it to &#8220;<em>Use GTK Theme&#8221; under Settings &#8211; Options &#8211; Personal Stuff</em>.</p>
<p>However upon switching that on I realized that GTK themes were indeed showing the coloring of darkPearl right but not the <em>widget styling</em> that the darkPearl + QtCurve provide together, despite placing a proper QtCurve <strong>.gtkrc</strong> and its other known aliases at all key positions. Sometimes it&#8217;d work after doing the last action, but only for the current KDE session and it would all go back to simple-coloring hell post a re-logon.<br />
<!--adsense--><br />
The solution to this was apparently under <em>System Settings&#8217;s Appearance &#8211; Colors</em> applet itself. I&#8217;d missed an option under the <strong>Options</strong> tab of <em>Colors</em> that said &#8220;<strong>Apply color to non-KDE4 Applications</strong>&#8220;. Un-check this and the custom .gtkrc you place sticks like its supposed to. Chromium looks great now! So does GIMP, the second of the two GTK-using applications I use.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.harshj.com/2010/04/17/kde-and-the-gtkrc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UML Blues</title>
		<link>http://www.harshj.com/2010/03/29/uml-blues/</link>
		<comments>http://www.harshj.com/2010/03/29/uml-blues/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 17:04:26 +0000</pubDate>
		<dc:creator>Harsh</dc:creator>
				<category><![CDATA[Computing Issues]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Diagrams]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Umbrello]]></category>
		<category><![CDATA[UML]]></category>
		<category><![CDATA[Violet]]></category>

		<guid isPermaLink="false">http://www.harshj.com/?p=829</guid>
		<description><![CDATA[Turn those blues to violet using Violet Violet was the UML modelling tool I had to use to save me some fun-later-time and make the whole process quick and painless. It also supports exporting to an image format and all in all it is a lovable, simple and just-works tool. But do note that it [...]]]></description>
			<content:encoded><![CDATA[<p>Turn those blues to violet using <a title="Violet UML Editor" href="http://alexdp.free.fr/violetumleditor/page.php" target="_blank">Violet</a> <img src='http://www.harshj.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><strong>Violet</strong> was the UML modelling tool I had to use to save me some fun-later-time and make the whole process quick and painless. It also supports exporting to an image format and all in all it is a lovable, simple and <em>just-works</em> tool. But do note that it uses Java to do all that magic.</p>
<p>The other alternative I had was <a title="Umbrello UML Modeller" href="http://uml.sourceforge.net/" target="_blank">Umbrello</a> which sadly isn&#8217;t in a very usable state yet. Perhaps this summer its GSoC fix may make it better. Wish I knew enough of QGraphicsView stuff to try it myself <img src='http://www.harshj.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.harshj.com/2010/03/29/uml-blues/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

