<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The Geek Shall Inherit The Earth</title>
	<atom:link href="http://majewsky.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://majewsky.wordpress.com</link>
	<description>Thoughts on KDE games hacking and everything</description>
	<lastBuildDate>Thu, 26 Jan 2012 15:00:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='majewsky.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The Geek Shall Inherit The Earth</title>
		<link>http://majewsky.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://majewsky.wordpress.com/osd.xml" title="The Geek Shall Inherit The Earth" />
	<atom:link rel='hub' href='http://majewsky.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Introducing obs-tools: Doing away with ugly repository URLs on openSUSE</title>
		<link>http://majewsky.wordpress.com/2012/01/22/introducing-obs-tools-doing-away-with-ugly-repository-urls-on-opensuse/</link>
		<comments>http://majewsky.wordpress.com/2012/01/22/introducing-obs-tools-doing-away-with-ugly-repository-urls-on-opensuse/#comments</comments>
		<pubDate>Sun, 22 Jan 2012 21:46:16 +0000</pubDate>
		<dc:creator>Stefan Majewsky</dc:creator>
				<category><![CDATA[The command line and I]]></category>

		<guid isPermaLink="false">http://majewsky.wordpress.com/?p=778</guid>
		<description><![CDATA[While I like openSUSE&#8217;s approach of ordering extra packages into addon repositories on their Build Service, I hate those ugly repository URLs. GUI users may just use the one-click install links on the package search, but command-line enthusiasts are out of luck. To solve the problem, I&#8217;ve written two small Python scripts. obs-addrepo wraps zypper [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majewsky.wordpress.com&amp;blog=3158478&amp;post=778&amp;subd=majewsky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While I like openSUSE&#8217;s approach of ordering extra packages into addon repositories on their <a href="http://build.opensuse.org">Build Service</a>, I hate those ugly repository URLs. GUI users may just use the one-click install links on the <a href="http://software.opensuse.org/search">package search</a>, but command-line enthusiasts are out of luck.</p>
<p>To solve the problem, I&#8217;ve written two small Python scripts. <b>obs-addrepo</b> wraps <tt>zypper addrepo</tt> for Build Service repos:</p>
<pre>
# before
$ sudo zypper addrepo http://download.opensuse.org/repositories/Application:/Geo/openSUSE_12.1/ Application:Geo
# after
$ sudo obs-addrepo Application:Geo
</pre>
<p><b>obs-quickinstall</b> is the 1-click installer for command-line users:</p>
<pre>
# before
$ sudo zypper addrepo http://download.opensuse.org/repositories/Application:/Geo/openSUSE_12.1/ temp
$ sudo zypper refresh temp
$ sudo zypper install --from temp josm
$ sudo zypper removerepo temp
# after
$ sudo obs-quickinstall Application:Geo josm
</pre>
<p>Both tools are now available as the <a href="http://www.bethselamin.de/obs-tools/">obs-tools</a> package (<a href="//git.bethselamin.de/obs-tools.git">Git repo</a>). Packages are currently building on the Build Service, the <a href="http://www.bethselamin.de/obs-tools/">project page</a> has installation instructions.</p>
<br />Filed under: <a href='http://majewsky.wordpress.com/category/geek-stuff/the-command-line-and-i/'>The command line and I</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/majewsky.wordpress.com/778/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/majewsky.wordpress.com/778/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/majewsky.wordpress.com/778/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/majewsky.wordpress.com/778/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/majewsky.wordpress.com/778/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/majewsky.wordpress.com/778/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/majewsky.wordpress.com/778/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/majewsky.wordpress.com/778/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/majewsky.wordpress.com/778/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/majewsky.wordpress.com/778/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/majewsky.wordpress.com/778/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/majewsky.wordpress.com/778/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/majewsky.wordpress.com/778/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/majewsky.wordpress.com/778/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majewsky.wordpress.com&amp;blog=3158478&amp;post=778&amp;subd=majewsky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://majewsky.wordpress.com/2012/01/22/introducing-obs-tools-doing-away-with-ugly-repository-urls-on-opensuse/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a990c810b2ac5c9f1d1d246a41d18219?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">majewsky</media:title>
		</media:content>
	</item>
		<item>
		<title>Bug of the day: How ConfigParser ruined my calculations</title>
		<link>http://majewsky.wordpress.com/2011/12/07/bug-of-the-day-how-configparser-ruined-my-calculations/</link>
		<comments>http://majewsky.wordpress.com/2011/12/07/bug-of-the-day-how-configparser-ruined-my-calculations/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 13:37:51 +0000</pubDate>
		<dc:creator>Stefan Majewsky</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://majewsky.wordpress.com/?p=774</guid>
		<description><![CDATA[For my thesis, I have implemented a series of numerical applications. The core application (written in C++) uses simple INI-like configuration files for reading system parameters. For example: [system] name=example2 r1=1.0 r2=1.5 V1=-0.05 V2=0.1 [...] Nothing exciting there, reading this is a breeze with QSettings. Now I needed to do some symbolic calculations, for which [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majewsky.wordpress.com&amp;blog=3158478&amp;post=774&amp;subd=majewsky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For my thesis, I have implemented a series of numerical applications. The core application (written in C++) uses simple INI-like configuration files for reading system parameters. For example:</p>
<p><code><br />
[system]<br />
name=example2<br />
r1=1.0<br />
r2=1.5<br />
V1=-0.05<br />
V2=0.1<br />
[...]<br />
</code></p>
<p>Nothing exciting there, reading this is a breeze with QSettings. Now I needed to do some symbolic calculations, for which I chose Python and the excellent <a href="http://www.sympy.org">SymPy</a> module. To read the system configuration, I chose the standard <a href="http://docs.python.org/library/configparser.html">ConfigParser</a> module.</p>
<p><code><br />
parser = ConfigParser.RawConfigParser()<br />
parser.read("scatttd.conf")<br />
sysType = parser.get("system", "name")<br />
# read system parameters<br />
sysParams = dict()<br />
for key, value in parser.items("system"):<br />
&nbsp;&nbsp;&nbsp;&nbsp;if value != "name":<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sysParams[key] = float(value)<br />
</code></p>
<p>That reads the &#8220;system/name&#8221; key, and puts all other keys (which are assumed to be floats) into a dictionary, so the system-specific code does not need to deal with the ConfigParser object.</p>
<p><code><br />
r1, r2 = params.get("r1", 1.0), params.get("r2", 1.0)<br />
V1, V2 = params.get("V1", -0.1), params.get("V2", +0.1)<br />
</code></p>
<p>This code gets the parameters in the system-specific code. Nothing exciting here. Except, stuff doesn&#8217;t work. The results of the following calculations suddenly don&#8217;t match my expectations (or the predictions made by my other programs).</p>
<p>Since the code after the snippet above is about 30 lines of SymPy magic (accumulating expressions that print dozens of lines onto my terminal), I suspected that some error occurred there. After about two days of searching for the problem there, and calculating everything by hand, something occurred to me when I looked at the debug output:</p>
<p><code><br />
DEBUG V1 = -0.1<br />
</code></p>
<p>Didn&#8217;t the configuration file say &#8220;V1=-0.05&#8243;? Let&#8217;s have a look at the parameter dict:</p>
<p><code><br />
{'v1': -0.05, 'v2': 0.1, 'r1': 1.0, 'r2': 1.5}<br />
</code></p>
<p>See the problem? &#8220;v1&#8243; has a lower-case &#8220;v&#8221;, so <tt>params.get("V1", -0.1)</tt> fails and returns the default value (-0.1). One glimpse at the documentation says that</p>
<p><code><br />
parser.optionxform = str<br />
</code></p>
<p>solves the problem. Gah!</p>
<br />Filed under: <a href='http://majewsky.wordpress.com/category/geek-stuff/programming/'>Programming</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/majewsky.wordpress.com/774/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/majewsky.wordpress.com/774/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/majewsky.wordpress.com/774/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/majewsky.wordpress.com/774/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/majewsky.wordpress.com/774/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/majewsky.wordpress.com/774/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/majewsky.wordpress.com/774/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/majewsky.wordpress.com/774/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/majewsky.wordpress.com/774/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/majewsky.wordpress.com/774/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/majewsky.wordpress.com/774/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/majewsky.wordpress.com/774/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/majewsky.wordpress.com/774/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/majewsky.wordpress.com/774/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majewsky.wordpress.com&amp;blog=3158478&amp;post=774&amp;subd=majewsky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://majewsky.wordpress.com/2011/12/07/bug-of-the-day-how-configparser-ruined-my-calculations/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a990c810b2ac5c9f1d1d246a41d18219?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">majewsky</media:title>
		</media:content>
	</item>
		<item>
		<title>Lost for words</title>
		<link>http://majewsky.wordpress.com/2011/11/04/lost-for-words/</link>
		<comments>http://majewsky.wordpress.com/2011/11/04/lost-for-words/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 23:26:37 +0000</pubDate>
		<dc:creator>Stefan Majewsky</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://majewsky.wordpress.com/?p=768</guid>
		<description><![CDATA[commit 740673c11aee9762987e3a205443ce1dec11aee8 Author: Stefan Majewsky &#60;majewsky@gmx.net&#62; Date: Sat Nov 5 00:11:37 2011 +0100 lolwut? diff --git a/tagaro/interface/board.cpp b/tagaro/interface/board.cpp index 199c007..17dbdfc 100644 --- a/tagaro/interface/board.cpp +++ b/tagaro/interface/board.cpp @@ -42,7 +42,6 @@ Tagaro::Board::~Board() Tagaro::Board::Private::~Private() { - QList&#60;Tagaro::SpriteObjectItem*&#62; m_items; for(QList&#60;Tagaro::SpriteObjectItem*&#62;::const_iterator a = m_items.constBegin(); a != m_items.constEnd(); ++a) (*a)-&#62;d-&#62;unsetBoard(); } Filed under: Programming<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majewsky.wordpress.com&amp;blog=3158478&amp;post=768&amp;subd=majewsky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre>
<span style="color:#826818;">commit 740673c11aee9762987e3a205443ce1dec11aee8</span>
Author: Stefan Majewsky &lt;majewsky@gmx.net&gt;
Date:   Sat Nov 5 00:11:37 2011 +0100

    lolwut?

diff --git a/tagaro/interface/board.cpp b/tagaro/interface/board.cpp
index 199c007..17dbdfc 100644
--- a/tagaro/interface/board.cpp
+++ b/tagaro/interface/board.cpp
<span style="color:#18B2B2;">@@ -42,7 +42,6 @@</span> Tagaro::Board::~Board()

 Tagaro::Board::Private::~Private()
 {
<span style="color:red;">-       QList&lt;Tagaro::SpriteObjectItem*&gt; m_items;</span>
        for(QList&lt;Tagaro::SpriteObjectItem*&gt;::const_iterator a = m_items.constBegin(); a != m_items.constEnd(); ++a)
                (*a)-&gt;d-&gt;unsetBoard();
 }
</pre>
<br />Filed under: <a href='http://majewsky.wordpress.com/category/geek-stuff/programming/'>Programming</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/majewsky.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/majewsky.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/majewsky.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/majewsky.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/majewsky.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/majewsky.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/majewsky.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/majewsky.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/majewsky.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/majewsky.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/majewsky.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/majewsky.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/majewsky.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/majewsky.wordpress.com/768/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majewsky.wordpress.com&amp;blog=3158478&amp;post=768&amp;subd=majewsky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://majewsky.wordpress.com/2011/11/04/lost-for-words/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a990c810b2ac5c9f1d1d246a41d18219?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">majewsky</media:title>
		</media:content>
	</item>
		<item>
		<title>Introducing the Raven Music Server</title>
		<link>http://majewsky.wordpress.com/2011/10/10/introducing-the-raven-music-server-2/</link>
		<comments>http://majewsky.wordpress.com/2011/10/10/introducing-the-raven-music-server-2/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 21:22:57 +0000</pubDate>
		<dc:creator>Stefan Majewsky</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[The command line and I]]></category>

		<guid isPermaLink="false">http://majewsky.wordpress.com/?p=756</guid>
		<description><![CDATA[While I was on my quest of reducing the memory footprint of a freshly launched KDE session, I found that the process which uses most memory just after startup is Amarok, which contributes over 80 MiB to 300 MiB total RAM usage. Now of course, Amarok has its reasons for a high memory usage: For [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majewsky.wordpress.com&amp;blog=3158478&amp;post=756&amp;subd=majewsky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While I was on my quest of <a href="http://majewsky.wordpress.com/2011/10/10/reducing-the-memory-footprint-of-akonadi/">reducing the memory footprint</a> of a freshly launched KDE session, I found that the process which uses most memory just after startup is Amarok, which contributes over 80 MiB to 300 MiB total RAM usage. Now of course, Amarok has its reasons for a high memory usage: For example, its collection is backed by a MySQL/Embedded database. This memory footprint is justified by the plethora of features Amarok offers. But still, 80 MiB RAM usage is quite a lot when all I want to do (99% of the time) is to listen to some music files on the local disk. (My collection has 818 tracks at this very moment.)</p>
<p>Can we improve on that?</p>
<p>Looking at my desktop, I see the &#8220;Now Playing&#8221; applet. It shows the current track from Amarok, and has the basic media player controls (pause/stop/previous/next + seek slider + volume slider). Again, this is about all I need for an user interface while my playlist is filled. I remember that the nowplaying applet communicates with Amarok via DBus using the <a href="http://www.mpris.org">MPRIS</a> (Media Player Remote Interface Specification) standard.</p>
<p>With all these impressions in mind, my target is clear: I want a headless media player which runs in the background and offers an MPRIS-compliant control interface on DBus. Something with a smaller memory footprint.<br />
<a href="http://majewsky.files.wordpress.com/2011/10/ravend-resource-usage.png"><img src="http://majewsky.files.wordpress.com/2011/10/ravend-resource-usage.png?w=480&#038;h=267" alt="" title="ravend-resource-usage" width="480" height="267" class="alignnone size-full wp-image-757" /></a></p>
<p>Intensive searches on the internet did not turn up anything of interest. Of course there are command-line music players (e.g. MPlayer), but those expect to be connected to a terminal for control. They cannot be run in the background, and there&#8217;s no nice GUI for them (like with the nowplaying applet). It looks like I need to do it myself yet again.</p>
<p>So here is the Raven Music Server (called ravend for short, as it is a daemon), which is now publicly available at <a href="http://quickgit.kde.org/?p=scratch%2Fmajewsky%2Fraven.git&amp;a=summary">git://anongit.kde.org/scratch/majewsky/raven</a>. It currently implements the basic interfaces mandated by MPRIS version 2 (unfortunately the &#8220;Now Playing&#8221; applet supports MPRIS 1 only). The biggest missing piece is support for editing the track list, so at the moment you need to restart the process to change the playlist.</p>
<p>I have been productively using ravend for two weeks now, since one day after its inception, and I&#8217;m quite satisfied with it. And now that it is in a public Git repo, you can, too! Provided that you find pleasure in controlling your mediaplayer with commands like</p>
<pre>
qdbus org.mpris.MediaPlayer2.ravend /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
</pre>
<p>Convenient user interfaces will become available, eventually. Even then, the Raven Music Server will probably not be interesting for end users. Power users may find this project interesting if they like to keep an eye on their system&#8217;s memory footprint, or want to have their playback continue even when the X server is terminated, or want to run a full-fledged media player on a headless system.</p>
<br />Filed under: <a href='http://majewsky.wordpress.com/category/kde/'>KDE</a>, <a href='http://majewsky.wordpress.com/category/geek-stuff/the-command-line-and-i/'>The command line and I</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/majewsky.wordpress.com/756/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/majewsky.wordpress.com/756/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/majewsky.wordpress.com/756/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/majewsky.wordpress.com/756/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/majewsky.wordpress.com/756/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/majewsky.wordpress.com/756/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/majewsky.wordpress.com/756/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/majewsky.wordpress.com/756/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/majewsky.wordpress.com/756/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/majewsky.wordpress.com/756/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/majewsky.wordpress.com/756/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/majewsky.wordpress.com/756/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/majewsky.wordpress.com/756/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/majewsky.wordpress.com/756/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majewsky.wordpress.com&amp;blog=3158478&amp;post=756&amp;subd=majewsky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://majewsky.wordpress.com/2011/10/10/introducing-the-raven-music-server-2/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a990c810b2ac5c9f1d1d246a41d18219?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">majewsky</media:title>
		</media:content>

		<media:content url="http://majewsky.files.wordpress.com/2011/10/ravend-resource-usage.png" medium="image">
			<media:title type="html">ravend-resource-usage</media:title>
		</media:content>
	</item>
		<item>
		<title>Reducing the memory footprint of Akonadi</title>
		<link>http://majewsky.wordpress.com/2011/10/10/reducing-the-memory-footprint-of-akonadi/</link>
		<comments>http://majewsky.wordpress.com/2011/10/10/reducing-the-memory-footprint-of-akonadi/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 20:09:59 +0000</pubDate>
		<dc:creator>Stefan Majewsky</dc:creator>
				<category><![CDATA[KDE]]></category>

		<guid isPermaLink="false">http://majewsky.wordpress.com/?p=754</guid>
		<description><![CDATA[I have some systems where I don&#8217;t use Kontact or anything else that makes use of Akonadi, so my Akonadi database is empty. Still I find the Akonadi server and its numerous agents running when I have just started my session. The Akonadi server is only started when some application needs it. So who wants [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majewsky.wordpress.com&amp;blog=3158478&amp;post=754&amp;subd=majewsky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have some systems where I don&#8217;t use Kontact or anything else that makes use of <a href="http://userbase.kde.org/Akonadi">Akonadi</a>, so my Akonadi database is empty. Still I find the Akonadi server and its numerous agents running when I have just started my session.</p>
<p>The Akonadi server is only started when some application needs it. So who wants to communicate with Akonadi? After some search, I found that <b>the clock applet</b> on the Plasma panel is the culprit. It has a feature to display events from the Akonadi calendar which is enabled by default (and I don&#8217;t want to oppose this choice; it&#8217;s a very nice integration feature for people using KOrganizer).</p>
<p>So if you want to prevent the Akonadi server from starting on systems where you don&#8217;t use Akonadi, or just want to speed up the startup of your KDE session by delaying Akonadi&#8217;s startup until it&#8217;s actually needed, do the following: Go to the configuration of the clock applet, and disable &#8220;Display Events&#8221; in the &#8220;Calendar&#8221; section.</p>
<p>To check whether Akonadi is running, open the &#8220;System Activity&#8221; monitor with Ctrl+Esc (or by clicking on the second icon from the left in KRunner). Look for a process called &#8220;akonadiserver&#8221;. (There will also be multiple processes with names like &#8220;akonadi_agent_launcher&#8221; or &#8220;akonadi_whatever_resource&#8221;.) You can also manually start and stop Akonadi with the commands &#8220;akonadictl start&#8221; and &#8220;akonadictl stop&#8221; (from either the command line or KRunner).</p>
<br />Filed under: <a href='http://majewsky.wordpress.com/category/kde/'>KDE</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/majewsky.wordpress.com/754/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/majewsky.wordpress.com/754/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/majewsky.wordpress.com/754/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/majewsky.wordpress.com/754/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/majewsky.wordpress.com/754/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/majewsky.wordpress.com/754/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/majewsky.wordpress.com/754/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/majewsky.wordpress.com/754/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/majewsky.wordpress.com/754/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/majewsky.wordpress.com/754/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/majewsky.wordpress.com/754/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/majewsky.wordpress.com/754/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/majewsky.wordpress.com/754/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/majewsky.wordpress.com/754/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majewsky.wordpress.com&amp;blog=3158478&amp;post=754&amp;subd=majewsky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://majewsky.wordpress.com/2011/10/10/reducing-the-memory-footprint-of-akonadi/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a990c810b2ac5c9f1d1d246a41d18219?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">majewsky</media:title>
		</media:content>
	</item>
		<item>
		<title>$ echo &#8220;A clear sign of madness&#8221;</title>
		<link>http://majewsky.wordpress.com/2011/09/13/a-clear-sign-of-madness/</link>
		<comments>http://majewsky.wordpress.com/2011/09/13/a-clear-sign-of-madness/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 22:32:57 +0000</pubDate>
		<dc:creator>Stefan Majewsky</dc:creator>
				<category><![CDATA[The command line and I]]></category>

		<guid isPermaLink="false">http://majewsky.wordpress.com/?p=748</guid>
		<description><![CDATA[What&#8217;s a clear sign that I&#8217;m a command-line addict? Not only do I have a custom prompt. My prompt is generated by a Python program, which has already grown to over 200 lines. My prompt detects Git and SVN repos, my custom build directory hierarchy, deleted directories at or above $PWD, common usernames and hostnames, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majewsky.wordpress.com&amp;blog=3158478&amp;post=748&amp;subd=majewsky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>What&#8217;s a clear sign that I&#8217;m a command-line addict? Not only do I have a custom prompt. My prompt is generated by a Python program, which has already grown to <a href="http://quickgit.kde.org/?p=scratch%2Fmajewsky%2Fdevenv.git&amp;a=blob&amp;h=2405b0531653d9b833a785a135e68eaf658caebf&amp;hb=841eb992e6c8adae5e831f6d43b8d5f373d15338&amp;f=bin/prettyprompt.py">over 200 lines</a>. My prompt detects Git and SVN repos, my custom build directory hierarchy, deleted directories at or above $PWD, common usernames and hostnames, shell type and shell level; and it&#8217;s still missing some features. What do you think: Is this madness? Does anyone else here use fully custom prompts?</p>
<br />Filed under: <a href='http://majewsky.wordpress.com/category/geek-stuff/the-command-line-and-i/'>The command line and I</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/majewsky.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/majewsky.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/majewsky.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/majewsky.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/majewsky.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/majewsky.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/majewsky.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/majewsky.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/majewsky.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/majewsky.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/majewsky.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/majewsky.wordpress.com/748/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/majewsky.wordpress.com/748/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/majewsky.wordpress.com/748/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majewsky.wordpress.com&amp;blog=3158478&amp;post=748&amp;subd=majewsky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://majewsky.wordpress.com/2011/09/13/a-clear-sign-of-madness/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a990c810b2ac5c9f1d1d246a41d18219?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">majewsky</media:title>
		</media:content>
	</item>
		<item>
		<title>A new take on autogenerated passwords</title>
		<link>http://majewsky.wordpress.com/2011/08/11/new-take-autogenerated-passwords/</link>
		<comments>http://majewsky.wordpress.com/2011/08/11/new-take-autogenerated-passwords/#comments</comments>
		<pubDate>Thu, 11 Aug 2011 16:46:17 +0000</pubDate>
		<dc:creator>Stefan Majewsky</dc:creator>
				<category><![CDATA[The command line and I]]></category>

		<guid isPermaLink="false">http://majewsky.wordpress.com/?p=745</guid>
		<description><![CDATA[Today&#8217;s XKCD got me thinking about the strength of my own passwords again. Some time ago, XKCD already hit on the topic of password reuse. A major argument for reusing passwords is that one can&#8217;t remember dozens of passwords for all services one uses. The typical counter-argument then is that one can use a password [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majewsky.wordpress.com&amp;blog=3158478&amp;post=745&amp;subd=majewsky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://xkcd.com/936/">Today&#8217;s XKCD</a> got me thinking about the strength of my own passwords again. Some time ago, XKCD already hit on the topic of <a href="http://xkcd.com/792/">password reuse</a>.</p>
<p>A major argument for reusing passwords is that one can&#8217;t remember dozens of passwords for all services one uses. The typical counter-argument then is that one can use a password storage, be it a local application like KWallet or an <a href="http://www.google.de/search?q=password+storage+service">online service</a>. Such services allow you to protect multiple different passwords with one master password, which is the only one which you have to remember.</p>
<p>I am personally a user of KWallet, and must agree that it&#8217;s a great relief to have a backup for this crucial data available anytime. (Currently, KWallet stores over 200 passwords on my notebook alone, and there are probably unmerged passwords over at my desktop.)</p>
<p>But alas, both kinds of password storage solutions have a big problem: KWallet and friends are useless when you don&#8217;t have the wallet file around on the computer which you are currently using, you&#8217;re stuck. If the only computer carrying the wallet file gets broken, you&#8217;re totally lost. On the other hand, online storage solutions require a big deal of trust towards the provider running the service. As we saw earlier this year with LastPass, this trust is in general not justified.</p>
<p>So what can be done? I just had an idea which I did not see before anywhere. (Might be that I did not look closely enough. Please tell me if this idea has already existed before.)</p>
<p>If we don&#8217;t want to store passwords (because that requires both the availability of the storage and trust with a provider of this available storage), we need to generate them based on an algorithm. In other words,</p>
<pre>
#!/usr/bin/env python2

import base64, getpass, hashlib, subprocess, sys

def doHash(x):
    return base64.b64encode(hashlib.sha512(x).digest())

def sendToXClipboard(x):
    subprocess.Popen(["xsel", "-i"], stdin=subprocess.PIPE).stdin.write(x)

try:
    site = sys.argv[1]
except IndexError:
    sys.stderr.write("Usage: %s [domain]\n" % sys.argv[0])
else:
    masterPassword = getpass.getpass("Password: ")
    sitePassword = doHash(doHash(site) + doHash(masterPassword)) # variant 1
    sitePassword = doHash(site + masterPassword)                 # variant 2
    sendToXClipboard(sitePassword)
</pre>
<p>This Python script reads the name of a website, and prompts for a master password. It then combines both using a considered-secure hashing algorithm (SHA-512 in this case), and sends the Base64-encoded result of that to the X clipboard (so the password won&#8217;t be displayed on screen). Base64 is the best compromise between printability and string size.</p>
<p>The code shows two incompatible variants of obtaining the sitePassword. I won&#8217;t debate over which is better. The extra hashes in variant 1 are, strictly speaking, security by obscurity, as they don&#8217;t help when the attacker knows the algorithm. However, that&#8217;s not the main security feature. As far as I can see, this algorithm relies solely on the strength of the SHA-512 algorithm, which is (as of August 11, 2011) considered secure, and (if the attacker is brute-forcing) on the strength of your master password. So don&#8217;t choose &#8220;correcthorsebatterystaple&#8221;. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p>
<br />Filed under: <a href='http://majewsky.wordpress.com/category/geek-stuff/the-command-line-and-i/'>The command line and I</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/majewsky.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/majewsky.wordpress.com/745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/majewsky.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/majewsky.wordpress.com/745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/majewsky.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/majewsky.wordpress.com/745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/majewsky.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/majewsky.wordpress.com/745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/majewsky.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/majewsky.wordpress.com/745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/majewsky.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/majewsky.wordpress.com/745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/majewsky.wordpress.com/745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/majewsky.wordpress.com/745/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majewsky.wordpress.com&amp;blog=3158478&amp;post=745&amp;subd=majewsky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://majewsky.wordpress.com/2011/08/11/new-take-autogenerated-passwords/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a990c810b2ac5c9f1d1d246a41d18219?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">majewsky</media:title>
		</media:content>
	</item>
		<item>
		<title>Proof of concept systemd dataengine for Plasma</title>
		<link>http://majewsky.wordpress.com/2011/08/11/proof-of-concept-systemd-dataengine-plasma/</link>
		<comments>http://majewsky.wordpress.com/2011/08/11/proof-of-concept-systemd-dataengine-plasma/#comments</comments>
		<pubDate>Thu, 11 Aug 2011 14:48:08 +0000</pubDate>
		<dc:creator>Stefan Majewsky</dc:creator>
				<category><![CDATA[KDE]]></category>

		<guid isPermaLink="false">http://majewsky.wordpress.com/?p=741</guid>
		<description><![CDATA[What you see here is the very first steps towards systemd integration in Qt. I&#8217;ve started to build a libqsystemd, which wraps systemd&#8217;s DBus API into something which can be used by Qt applications. The screenshot shows a simple QML-based Plasma applet reading information about available systemd units from a simple dataengine. At the moment, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majewsky.wordpress.com&amp;blog=3158478&amp;post=741&amp;subd=majewsky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://majewsky.files.wordpress.com/2011/08/keks3.png"><img src="http://majewsky.files.wordpress.com/2011/08/keks3.png?w=480" alt="" title="systemd-dataengine-proofofconcept"   class="alignnone size-full wp-image-742" /></a></p>
<p>What you see here is the very first steps towards systemd integration in Qt. I&#8217;ve started to build a libqsystemd, which wraps systemd&#8217;s DBus API into something which can be used by Qt applications. The screenshot shows a simple QML-based Plasma applet reading information about available systemd units from a simple dataengine.</p>
<p>At the moment, the library can only list available units, providing about 60% of the info which you would get from `systemctl list-units`. But adding more functions should be trivial now that the foundations are laid.</p>
<p>The only interesting point left is how different privilege levels will be handled. For example, only root may activate and deactivate units, initiate system shutdown etc. Most properties are even read-protected from normal users.</p>
<p>Of course, providing a library interface is only the first step for systemd integration with KDE. The second step is to actually use it. For example, systemd provides standard interfaces for setting the hostname, timezone, etc. in a desktop-independent manner. systemd can in the future also be used to coordinate the startup of a KDE session, and thus replace parts of startkde and kdeinit.</p>
<br />Filed under: <a href='http://majewsky.wordpress.com/category/kde/'>KDE</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/majewsky.wordpress.com/741/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/majewsky.wordpress.com/741/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/majewsky.wordpress.com/741/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/majewsky.wordpress.com/741/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/majewsky.wordpress.com/741/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/majewsky.wordpress.com/741/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/majewsky.wordpress.com/741/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/majewsky.wordpress.com/741/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/majewsky.wordpress.com/741/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/majewsky.wordpress.com/741/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/majewsky.wordpress.com/741/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/majewsky.wordpress.com/741/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/majewsky.wordpress.com/741/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/majewsky.wordpress.com/741/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majewsky.wordpress.com&amp;blog=3158478&amp;post=741&amp;subd=majewsky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://majewsky.wordpress.com/2011/08/11/proof-of-concept-systemd-dataengine-plasma/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a990c810b2ac5c9f1d1d246a41d18219?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">majewsky</media:title>
		</media:content>

		<media:content url="http://majewsky.files.wordpress.com/2011/08/keks3.png" medium="image">
			<media:title type="html">systemd-dataengine-proofofconcept</media:title>
		</media:content>
	</item>
		<item>
		<title>KDE Games: Towards an &#8220;Active&#8221; interface</title>
		<link>http://majewsky.wordpress.com/2011/07/08/kde-games-towards-an-active-interface/</link>
		<comments>http://majewsky.wordpress.com/2011/07/08/kde-games-towards-an-active-interface/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 23:26:26 +0000</pubDate>
		<dc:creator>Stefan Majewsky</dc:creator>
				<category><![CDATA[kdegames]]></category>
		<category><![CDATA[KDiamond]]></category>

		<guid isPermaLink="false">http://majewsky.wordpress.com/?p=733</guid>
		<description><![CDATA[The fact that KDiamond is included by default in Plasma Active&#8217;s default set of &#8220;Favorite applications&#8221; (among rekonq-active, calligra-active, and friends) finally made me hack a bit on kdegames stuff again. The main problem I see with KDiamond on a mobile form factor is that menubar and toolbar waste quite some vertical space. Also, the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majewsky.wordpress.com&amp;blog=3158478&amp;post=733&amp;subd=majewsky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The fact that KDiamond is included by default in Plasma Active&#8217;s default set of &#8220;Favorite applications&#8221; (among rekonq-active, calligra-active, and friends) finally made me hack a bit on kdegames stuff again. The main problem I see with KDiamond on a mobile form factor is that menubar and toolbar waste quite some vertical space. Also, the menubar is awful to use on a touchscreen; the toolbar is much better in this regard.</p>
<p>Can we combine these observations into an interface that saves space, yet is as approachable as a simple toolbar? We can.</p>
<p><a href="http://majewsky.files.wordpress.com/2011/07/kgbw.png"><img src="http://majewsky.files.wordpress.com/2011/07/kgbw.png?w=480&#038;h=144" alt="" title="kgbw" width="480" height="144" class="alignnone size-full wp-image-734" /></a></p>
<p>In the back is the normal menubar/toolbar chrome. In the front is my first draft of an &#8220;Active&#8221; version of it. The menus &#8220;Game&#8221; and &#8220;Move&#8221; are completely gone, all contained actions are now on this first level of the toolbar. The &#8220;Settings&#8221; and &#8220;Help&#8221; menus have turned into toolbar buttons. Upon pressing one of these, the toolbar descends into that subcategory:</p>
<p><a href="http://majewsky.files.wordpress.com/2011/07/kgbw1.png"><img src="http://majewsky.files.wordpress.com/2011/07/kgbw1.png?w=480&#038;h=184" alt="" title="kgbw1" width="480" height="184" class="alignnone size-full wp-image-735" /></a></p>
<p>After selecting something from a subcategory, the toolbar automatically returns to the default category. For example, if you click on &#8220;Settings&#8221;, then on &#8220;Configure KDiamond&#8221;, the theme selection dialog comes up. When you&#8217;re done with that, you come back to the main window and find the default toolbar with the relevant New/Pause/Hint actions again.</p>
<p>What do you think? A first step in a good direction? Something you would even want on the desktop? Or just plain awful? Please let me know. BTW the source is available on <a href="https://svn.reviewboard.kde.org/r/6744/">ReviewBoard</a>.</p>
<p>P.S. To get that straight: This is only for games with a small set of menu actions (about 28 of 40 KDE games, according to my counting). Apps like KGoldRunner or KTuberling just don&#8217;t fit the idea behind this proposal and will therefore not be affected.</p>
<p>P.P.S. I&#8217;m aware that vertical space is still wasted. I&#8217;m going to experiment with moving the toolbar to the side for displays which are wider than tall.</p>
<br />Filed under: <a href='http://majewsky.wordpress.com/category/kde/kdegames/'>kdegames</a>, <a href='http://majewsky.wordpress.com/category/kde/kdegames/kdiamond/'>KDiamond</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/majewsky.wordpress.com/733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/majewsky.wordpress.com/733/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/majewsky.wordpress.com/733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/majewsky.wordpress.com/733/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/majewsky.wordpress.com/733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/majewsky.wordpress.com/733/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/majewsky.wordpress.com/733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/majewsky.wordpress.com/733/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/majewsky.wordpress.com/733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/majewsky.wordpress.com/733/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/majewsky.wordpress.com/733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/majewsky.wordpress.com/733/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/majewsky.wordpress.com/733/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/majewsky.wordpress.com/733/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majewsky.wordpress.com&amp;blog=3158478&amp;post=733&amp;subd=majewsky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://majewsky.wordpress.com/2011/07/08/kde-games-towards-an-active-interface/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a990c810b2ac5c9f1d1d246a41d18219?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">majewsky</media:title>
		</media:content>

		<media:content url="http://majewsky.files.wordpress.com/2011/07/kgbw.png" medium="image">
			<media:title type="html">kgbw</media:title>
		</media:content>

		<media:content url="http://majewsky.files.wordpress.com/2011/07/kgbw1.png" medium="image">
			<media:title type="html">kgbw1</media:title>
		</media:content>
	</item>
		<item>
		<title>Case study: Porting and modularizing an in-house Python application</title>
		<link>http://majewsky.wordpress.com/2011/05/30/case-study-porting-modularizing-inhouse-python-application/</link>
		<comments>http://majewsky.wordpress.com/2011/05/30/case-study-porting-modularizing-inhouse-python-application/#comments</comments>
		<pubDate>Mon, 30 May 2011 11:45:21 +0000</pubDate>
		<dc:creator>Stefan Majewsky</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://majewsky.wordpress.com/?p=727</guid>
		<description><![CDATA[Is it just a feeling, or has the number of technical posts decreased on the Planet? I definitely need to change that! (Update: The post got quite long, so I&#8217;ve shortened the syndicated version.) These days, I&#8217;m usually working on my Diplomarbeit at the Institute of Theoretical Physics at the Technical University here in Dresden. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majewsky.wordpress.com&amp;blog=3158478&amp;post=727&amp;subd=majewsky&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Is it just a feeling, or has the number of technical posts decreased on the Planet? I definitely need to change that! (<b>Update:</b> The post got quite long, so I&#8217;ve shortened the syndicated version.)</p>
<p>These days, I&#8217;m usually working on my Diplomarbeit at the Institute of Theoretical Physics at the Technical University here in Dresden. (A Diplomarbeit is about comparable to a master&#8217;s thesis, though preparation time is one year since there was no bachelor&#8217;s thesis before it.) Our working group has an in-house application for inspecting iterated functions, which is quite intuitively called Iterator. Like many scientific applications, it has on one hand a very sharp functional objective, but contains tons of different tools and plugins.</p>
<p>As a part-time project besides my usual work, I&#8217;m working on a Qt port of the Iterator, which is currently based on wxWidgets. Of course, a port offers the opportunity to refactor badly engineered parts of the application. It clearly shows that all involved developers are first and foremost physicists which have not received any formal training in software design. Many antipatterns can be observed in the code. The most interesting is the existence of a god class called IteratorApp.<span id="more-727"></span></p>
<p>IteratorApp is not the application instance which drives the eventloop, as one might expect from the name, but the main window. The iterator.gui.iteratorapp module imports about all other core modules, and instantiates them inside the IteratorApp class. The reference to the IteratorApp class is then passed around to all components inside the IteratorApp, and also all plugins loaded by it. The IteratorApp also contains  most of the basic business logic: loading of plugins, creating and managing all widgets in the mainwindow, etc.</p>
<p>There are evidences that it was even worse some years ago. People have already worked on extracting modules out of IteratorApp, but they are still closely tied to IteratorApp, and thus have direct connections to all other parts of the code. The most interesting thing about this design is that the Python programming language makes it very hard to discover dependencies between modules in this design. Consider the following Python code:</p>
<p><code><br />
from external import BarComponent</p>
<p>class FooApp(object):<br />
&nbsp;&nbsp;&nbsp;&nbsp;def __init__(self):<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.bar = BarComponent()<br />
</code></p>
<p>FooApp is our equivalent to IteratorApp here. Now when you have a reference &#8220;foo&#8221; somewhere, &#8220;foo.bar&#8221; will give you the corresponding BarComponent instance, which you can directly use if you need functions of BarComponent. You can also pass it to other modules with different variable names and stuff. All this makes it quite hard to track efficiently on which components the specific module you are looking at depends. One can grep for &#8220;foo.bar&#8221; if &#8220;foo&#8221; is the established name for FooApp references. But if you pass the BarComponent reference to some other code, this also won&#8217;t help. The problem is that you do not need to explicitly import BarComponent like in FooApp. This is a non-issue in C++, where used classes are usually forward-declared:</p>
<p><code><br />
class BarComponent;</p>
<p>class FooApp<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;public:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BarComponent* bar() const;<br />
};<br />
</code></p>
<p>If you use methods of &#8220;foo-&gt;bar()&#8221; somewhere in your code, you absolutely need to include the BarComponent header. The dependency of the component in question to BarComponent is then obvious. (Executive summary for this part: Forward declarations are good not only for reducing compilation time.) How can we transfer this advantage of C++ to Python?</p>
<p>The Qt port of the Iterator does not include something as powerful as the IteratorApp. However, in an application consisting mostly of plugins (i.e. the iterable functions, and the tools that the different group members use to solve their distinct problems), there must be some authority that keeps everything together, and which is passed to plugins. In the Qt Iterator, this position is taken by a new PluginLoader class. </p>
<p>The PluginLoader itself is &ndash; on purpose &ndash; very light-weight: Its tasks are restricted to creating application-global instances of other classes which are called application plugins. For example, the Qt main window is an application plugin. One can ask the plugin loader to load a specific plugin by calling it (i.e. its __call__ method) with the type of this plugin. For example, to instantiate a PluginLoader and get a MainWindow from it, the code is:<br />
<code><br />
from iterator.common.pluginloader import PluginLoader<br />
from iterator.qtgui.mainwindow import MainWindow</p>
<p>pl = PluginLoader()<br />
mw = pl(MainWindow)<br />
</code><br />
The plugin loader places a reference to itself in all loaded plugin instances in the &#8220;pl&#8221; attribute. This behavior is similar to the IteratorApp, which distributed &#8220;app&#8221; references all over the place. The important difference is that all business logic resides in application plugins. These can be obtained from the plugin loader at any time, but using a syntax which requires to name the type. Naming the type requires the Python developer to import the type explicitly, thus making module inter-dependencies visible e.g. to automated dependency graphing solutions, which can, as a follow-up to this initial refactoring, be used to decide on subsequent refactoring steps.</p>
<p>Along with the plugin loader, I defined (and documented!) a simple protocol which plugins must follow. This protocol defines a common set of functions which plugins can implement e.g. to be stopped at runtime or to get notified when other plugins are started or stopped. The latter allows for optional dependencies between modules. This protocol allows for some nifty features: The plugin loader installs a <tt>sys.excepthook</tt> and stops interface plugins which throw unhandled exceptions. The exception and trace is displayed directly in the interface, as can be seen in the lower right here:</p>
<p><a href="http://majewsky.files.wordpress.com/2011/05/iterator-crash-handler.png"><img src="http://majewsky.files.wordpress.com/2011/05/iterator-crash-handler.png?w=480&#038;h=353" alt="" title="Iterator Crash Handler" width="480" height="353" class="alignnone size-full wp-image-728" /></a></p>
<p>The PluginLoader has been designed with the migration path from wx to Qt in mind: It has no Qt dependency, and can also be used in the old Iterator. (Legacy installations might not have PyQt available, so Qt can only be an optional code path at this point.) In fact, some of the new application plugins, which are used for internal data management, are also used in the old IteratorApp now, although the data is additionally made available in the old attributes for compatibility.</p>
<p>For communication between application plugins, Qt signals/slots have been chosen. As these are obviously not available in wx or Python itself, I&#8217;ve written a basic, sufficiently source-compatible implementation which is used as a drop-in replacement in non-Qt environments.</p>
<p>Here&#8217;s the source code for the plugin loader (minus some highly application-specific parts like plugin shutdown, which can be easily inferred by copying the startup code) and the platform detection including optionally Qt-based signals and slots. But I cannot upload text files or tar archives here in this blog, and any linked external source to which I upload the archive file can go away any time, which I do not like. (I tend to get mad on 404 links.) I therefore insert the BZip2-compressed tar archive as Base64. To get the archive, copy the following character block into a file e.g. &#8220;foo.txt&#8221; and then do &#8220;base64 -d foo.txt | tar xjf -&#8221;.</p>
<p><code><br />
QlpoOTFBWSZTWawqqUsADKD/pPz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gIIw3+g13EOCvw4uLC<br />
ZE8eiOzq6Tdv4IudS5G2INeD/wO+iRn5jwGLMarmv8h8kBf0h9vpNxtMZT0oZsJxRH7i+Wse/e0w<br />
iNN2foPr2befmwxg0gClHsjUegjRrHCAkJBoEpYi4DKcpUcZjgmjO3zk83b58Vt2LvglQRFWOVU8<br />
6FRFPRECnEGooyWvVM5WuGBj8tFLHDj5u9XudmFjhCg8O84Tz7ANooQsDVGYpX4hecRbVUvh9CxF<br />
MgNg8WhGB7Fn9APBVKrIPJ1VKM4SpUOgxDgJFWkcgoQ5RQc9yoUKQiqHVQEWVYK8sFo6itEelYcS<br />
0OxqFV17qeAjoZt3Y3YmIvDqRaD1iYqa0DlgqE+plvywCl2HW6gFzqOjpmHJYNOaekN0AaDGNbe2<br />
F357CTFsM8JDRm0JrYI4w2NkhhJYKnLvCr48AeRe5vo67IGHNZiAuxl4h2i5ENLRrSikGsRmIMus<br />
5ZxKybhujRngGFgKsWCTEOjupKDOKR/zVcQhugQA2QTeVI7u1mj0oiS1KNIgaLtoqFbmKCe6KijB<br />
Zu1zYhvTF89m/GLlXsGvwL7N8bknINEaNDlCPE0CjTKEiSWPw2uK9kBEDsJMVRBrJahe4LVBELkY<br />
gosAp7nVCGeXS+tyzpMsgGMNESa7Vg0A0srZ6IPXlqt3y5ELIIOedswCEfcZfMR0Y5rxIIJZa4tI<br />
YI1MEyAYnPNYRw/4B/qm5wNYtdWBqn7QCKVlG+qq2yqKJHB5S12rXOa+4ulUIi5fnZxevdUyZJkk<br />
u+oncHvVkHauOWvZAQ+Waus0ndFJo9Llb1C00a/ABpCpReE3W1UM+8iiMyJ363VUPIeokh/8XckU<br />
4UJCsKqlLA==<br />
</code></p>
<br />Filed under: <a href='http://majewsky.wordpress.com/category/geek-stuff/programming/'>Programming</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/majewsky.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/majewsky.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/majewsky.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/majewsky.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/majewsky.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/majewsky.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/majewsky.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/majewsky.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/majewsky.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/majewsky.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/majewsky.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/majewsky.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/majewsky.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/majewsky.wordpress.com/727/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=majewsky.wordpress.com&amp;blog=3158478&amp;post=727&amp;subd=majewsky&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://majewsky.wordpress.com/2011/05/30/case-study-porting-modularizing-inhouse-python-application/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a990c810b2ac5c9f1d1d246a41d18219?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">majewsky</media:title>
		</media:content>

		<media:content url="http://majewsky.files.wordpress.com/2011/05/iterator-crash-handler.png" medium="image">
			<media:title type="html">Iterator Crash Handler</media:title>
		</media:content>
	</item>
	</channel>
</rss>
