<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The adventures of Foo &#187; Rant</title>
	<atom:link href="http://jensge.org/tag/rant/feed/" rel="self" type="application/rss+xml" />
	<link>http://jensge.org</link>
	<description>My aggregated random tech blabber</description>
	<lastBuildDate>Sat, 04 Feb 2012 19:12:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>The QThread anti-pattern</title>
		<link>http://jensge.org/2010/09/the-qthread-anti-pattern/</link>
		<comments>http://jensge.org/2010/09/the-qthread-anti-pattern/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 17:50:56 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programmieren]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://jensge.org/?p=467</guid>
		<description><![CDATA[Sometimes with QThread you see something like this: void run&#40;&#41; &#123; while &#40;true&#41; &#123; &#123; QMutexLocker lock&#40;&#38;mMutexData&#41;; if &#40;mQuit&#41; break; &#125; &#160; msleep &#40;200&#41;; &#125; &#160; mWaitExit.wakeAll&#40;&#41;; &#125; &#160; void stop&#40;&#41; &#123; mMutexData.lock&#40;&#41;; mQuit = true; mMutexData.unlock&#40;&#41;; mWaitExit.wait&#40;&#38;mMutexExit&#41;; &#125; This &#8230; <a href="http://jensge.org/2010/09/the-qthread-anti-pattern/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Sometimes with QThread you see something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">void</span> run<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0000ff;">while</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">true</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
        <span style="color: #008000;">&#123;</span>
            QMutexLocker lock<span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>mMutexData<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
            <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>mQuit<span style="color: #008000;">&#41;</span>
                <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        msleep <span style="color: #008000;">&#40;</span><span style="color: #0000dd;">200</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    mWaitExit.<span style="color: #007788;">wakeAll</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">void</span> stop<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    mMutexData.<span style="color: #007788;">lock</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    mQuit <span style="color: #000080;">=</span> <span style="color: #0000ff;">true</span><span style="color: #008080;">;</span>
    mMutexData.<span style="color: #007788;">unlock</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    mWaitExit.<span style="color: #007788;">wait</span><span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>mMutexExit<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>This is potentially problematic. Why? Consider the extreme case of a function <code>shutdown()</code> which does something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">void</span> shutdown<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    thread<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>stop<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #0000dd;">delete</span> thread<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>Congratulations, you&#8217;ve just introduced a race condition. Why, you will ask? You&#8217;re waiting for the thread to end before deleting it, right?</p>
<p>No. And this has to do with the way Qt implements <code>QThread::wait()</code> which you should have probably used in the first place, if you really need this sort of functionality.</p>
<p>Qt hooks a pthread cleanup handler in the native thread which will call <code>wakeAll()</code> on a <code>QWaitCondition</code> stored inside the pimpl of <code>QThread</code>. And this pimpl &#8211; you might have guessed &#8211; is gone when you call <code>delete</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jensge.org/2010/09/the-qthread-anti-pattern/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Trekstor Vibez and Jaunty^WLucid</title>
		<link>http://jensge.org/2010/08/trekstor-vibez-and-jauntywlucid/</link>
		<comments>http://jensge.org/2010/08/trekstor-vibez-and-jauntywlucid/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 09:04:00 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://jensge.org/?p=441</guid>
		<description><![CDATA[So &#8211; A year has passed, two Ubuntu versions, what&#8217;s the state of MTP vs. mass storage? Apparently still broken. Same same but different. Instead of making the player crash, gphoto2/libmtp and usb mass storage fight for the right to &#8230; <a href="http://jensge.org/2010/08/trekstor-vibez-and-jauntywlucid/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So &#8211; <a href="http://jensge.org/2009/05/trekstor-vibez-jaunty/">A year has passed, two Ubuntu versions</a>, what&#8217;s the state of MTP vs. mass storage? Apparently still broken. Same same but different.</p>
<p>Instead of making the player crash, gphoto2/libmtp and usb mass storage fight for the right to access the device which leads to very ugly errors in dmesg that look like the device or at least its file-system is severely broken <img src='http://jensge.org/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>So, once again: Either make the device MTP only or remove the device&#8217;s entry from the libmtp udev rules which now reside in /lib/udev/rules.d/45-libmtp8.rules</p>
]]></content:encoded>
			<wfw:commentRss>http://jensge.org/2010/08/trekstor-vibez-and-jauntywlucid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kolmas viikola Helsingissä</title>
		<link>http://jensge.org/2010/07/kolmas-viikola-helsingissa/</link>
		<comments>http://jensge.org/2010/07/kolmas-viikola-helsingissa/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 18:23:23 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://jensge.org/?p=425</guid>
		<description><![CDATA[or: You&#8217;re holding it wrong. Seriously. Once upon a time, you could buy a IBM/Lenovo ThinkPad with Intel graphics and it just worked. While the Intel issues in the last versions of Ubuntu were mostly home-grown, the current disaster with &#8230; <a href="http://jensge.org/2010/07/kolmas-viikola-helsingissa/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>or: You&#8217;re holding it wrong. Seriously. Once upon a time, you could buy a IBM/Lenovo ThinkPad with Intel graphics and it just worked. While the Intel issues in the last versions of Ubuntu were mostly home-grown, the current disaster with the Core i3/i5 on-chip graphics isn&#8217;t. Like in the X201.</p>
<p><strong>The Ubutu experience</strong></p>
<p>Getting Ubuntu 10.4 LTS to work on an X201 isn&#8217;t too hard. You just need to follow some simple steps:</p>
<ol>
<li><a href="http://www.ubuntu.com/desktop/get-ubuntu/download">Get Ubuntu</a> (obviously) and <a href="https://help.ubuntu.com/community/Installation/FromUSBStick">put it on an USB stick</a>; the X201 doesn&#8217;t have a CD drive</li>
<li>Go to <a href="http://people.canonical.com/~hzhang/554569/">http://people.canonical.com/~hzhang/554569/</a> and grab the latest kernel package linked there (see also <a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/554569">Launchpad  bug 554569</a>)</li>
<li>Get the most recent BIOS update from Lenovo. A description on how to update your BIOS if you don&#8217;t have an optical drive may be found <a href="http://www.thinkwiki.org/wiki/BIOS_update_without_optical_disk">at thinkwiki.org</a></li>
<li>Go to the BIOS setup and deactivate Intel AMT.</li>
<li>Install Ubuntu normally. The installer should work just fine. If the graphical installer doesn&#8217;t, try the alternate install CD.</li>
<li>After the installation is done, boot from USB once again and go into rescue mode to install the kernel package downloaded before.</li>
<li>Boot normally.</li>
</ol>
<p><strong>Remaining issues</strong></p>
<ul>
<li><em>External video<br />
</em>VGA works, but if you shut down the machine with the external monitor connected, it will somehow lockup (CPU is busy)</li>
<li><em>Suspend/Resume<br />
</em>With the kernel from the launchpad bug, USB works after resume; the only thing I noticed is that sometimes the wireless LAN won&#8217;t come up again (like 1 in 10 resumes).</li>
<li><em>UltraBase<br />
</em>No idea yet. Haven&#8217;t used though it is said that there are still problems with the display port on it</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jensge.org/2010/07/kolmas-viikola-helsingissa/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>A plea agains tofu</title>
		<link>http://jensge.org/2010/03/a-plea-agains-tofu/</link>
		<comments>http://jensge.org/2010/03/a-plea-agains-tofu/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 10:44:47 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Arbeit]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://jensge.org/?p=391</guid>
		<description><![CDATA[No, not the stuff made from soy beans. Tofu is the the german term for a behaviour most likely found in corporate email. It means &#8220;Quote full, add your text on the top&#8221;. That&#8217;s sort of reversed &#8220;AOL&#8221; behaviour. When &#8230; <a href="http://jensge.org/2010/03/a-plea-agains-tofu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>No, not the stuff made from soy beans. Tofu is the the german term for a behaviour most likely found in corporate email. It means &#8220;Quote full, add your text on the top&#8221;. That&#8217;s sort of reversed &#8220;AOL&#8221; behaviour.</p>
<p>When I started email, I came from a <a href="http://en.wikipedia.org/wiki/FidoNet">FIDO background</a> (anyone remembers this? BBS and stuff?). Connection time was precious and expensive. Quoting rules existed like don&#8217;t quote too many levels, answer inline etc. When moving on to the internet, I mostly kept this. </p>
<p>I dropped writing emails like this like five years ago, when I entered the magical world of business emails. Noone understood inline replys and most people were complaining that the communication history was missing. So I adapted, at least at work. And Outlook 2007 even has support for navigating in mails like those. I also understand why a certain kind of people like it. When you print the mail, you only need to print one mail and have the whole conversation at hand.</p>
<p>But honestly. I&#8217;m doing a lot of mail on my mobile phone currently. Fetching mails is not too fast on there. I don&#8217;t want to download 200k for a simple &#8220;Me too&#8221;. I don&#8217;t want to scroll through all of the shit. I don&#8217;t event want to download the same shit again and again. I already have the communication history available.</p>
]]></content:encoded>
			<wfw:commentRss>http://jensge.org/2010/03/a-plea-agains-tofu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Herr, schmeiÃŸ Hirn vom Himmel&#8230;</title>
		<link>http://jensge.org/2009/06/herr-schmeis-hirn-vom-himmel/</link>
		<comments>http://jensge.org/2009/06/herr-schmeis-hirn-vom-himmel/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 10:24:06 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Datenschutz]]></category>
		<category><![CDATA[Politik]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[Zensur]]></category>

		<guid isPermaLink="false">http://jensge.org/2009/06/herr-schmeis-hirn-vom-himmel/</guid>
		<description><![CDATA[Liebe CDU, in Zeiten, in denen Ihr unsere Grundrechte gerne mal mit FÃ¼ÃŸen tretet und euer Innenminister wahrscheinlich am liebsten Kameras in jedem Privathaushalt installieren wÃ¼rde, sorgt IHR EUCH UM EURE Sicherheit und PrivatsphÃ¤re? Ihr seid peinlich, ernsthaft&#8230; Mir ist &#8230; <a href="http://jensge.org/2009/06/herr-schmeis-hirn-vom-himmel/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Liebe CDU,</p>
<p>in Zeiten, in denen <a href="http://www.heise.de/newsticker/CDU-Bundestagsabgeordneter-erwaegt-Internetsperren-fuer-Online-Gewaltspiele--/meldung/140273">Ihr</a> <a href="http://www.heise.de/newsticker/Familienministerin-rechnet-mit-baldiger-Weichenstellung-bei-Kinderporno-Sperren--/meldung/140127">unsere</a> <a href="http://de.wikipedia.org/wiki/Vorratsdatenspeicherung">Grundrechte</a> gerne mal mit FÃ¼ÃŸen tretet und euer Innenminister wahrscheinlich am liebsten Kameras in jedem Privathaushalt installieren wÃ¼rde, <a href="http://www.heise.de/newsticker/CDU-Abgeordneter-Google-Street-View-gefaehrdet-Sicherheit-von-Politikern--/meldung/140312">sorgt IHR EUCH UM EURE Sicherheit und PrivatsphÃ¤re</a>? Ihr seid peinlich, ernsthaft&#8230;</p>
<p>Mir ist schleierhaft, warum euch eigentlich immer noch Leute freiwillig wÃ¤hlen.</p>
<p>Mit nicht ganz so freundlichen GrÃ¼ÃŸen</p>
]]></content:encoded>
			<wfw:commentRss>http://jensge.org/2009/06/herr-schmeis-hirn-vom-himmel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eternal struggle</title>
		<link>http://jensge.org/2009/04/eternal-struggle/</link>
		<comments>http://jensge.org/2009/04/eternal-struggle/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 09:09:18 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Arbeit]]></category>
		<category><![CDATA[Crypto]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[NoteToMyself]]></category>
		<category><![CDATA[OSS]]></category>
		<category><![CDATA[Programmieren]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">https://jensge.org/?p=195</guid>
		<description><![CDATA[My current task is evaluation crypto (here: OpenPGP) solutions for Microsoft Windows; of course including GnuPG. Well, what do I say. While there is a nice installer for GnuPG on Windows available (either here or here), try to find one &#8230; <a href="http://jensge.org/2009/04/eternal-struggle/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My current task is evaluation crypto (here: OpenPGP) solutions for Microsoft Windows; of course including <a href="http://www.gnupg.org" target="_blank">GnuPG</a>.</p>
<p>Well, what do I say. While there is a nice installer for GnuPG on Windows available (either <a href="http://gnupg.org/download/" target="_blank">here</a> or <a href="http://www.gpg4win.org/download.html" target="_blank">here</a>), try to find one for the gpgme supporting library&#8230; (including header and .lib import files for Visual Studio, that is).</p>
<p>You can guess&#8230; It&#8217;s all about build-your-own-stuff. It basically boils down to this:</p>
<p><em>Preparations</em></p>
<ul>
<li>Create a directory to collect all the stuff you will need (e.g. <code>C:\gpgme</code> with <code>bin</code>, <code>include</code> and <code>lib</code> sub folders)</li>
<li>Get <a href="http://www.mingw.org" target="_blank">mingw</a> and install it</li>
<li>Get <a href="http://www.mingw.org/wiki/MSYS" target="_blank">MSYS</a> and install it</li>
<li><a href="http://www.gnupg.org/download/index.en.html#libgpg-error" target="_blank">Download libgpg-error</a> and extract it</li>
<li><a href="http://www.gnupg.org/download/index.en.html#gpgme" target="_blank">Download gpgme</a> and extract it</li>
</ul>
<p><em>Compiling libgpg-error</em></p>
<ul>
<li>In the MSYS bash, change to the directory you extracted libgpg-error into and run <code>./configure --prefix=/mingw &amp;&amp; make install</code></li>
<li>Call <code>strip src/.libs/libgpg-error-0.dll src/gpg-error.exe</code> as MSVC can&#8217;t use gcc&#8217;s debug info anyway</li>
<li>Copy <code>src/gpg-error.exe and src/.libs/libgpg-error-0.dll</code> to the bin directory created above</li>
<li>Copy <code>src/.libs/libgpg-error-0.dll.def</code> to <code>lib/libgpg-error-0.def</code> (note the renaming; otherwise your program will look for a <code>libgpg-error-0.dll.dll</code>)</li>
<li>Open the Visual Studio Command Prompt</li>
<li>Call <code>lib /machine:i386 /def:lib\libgpg-error-0.def /out:lib\libgpg-error-0.lib</code> to create the import library</li>
<li>Copy <code>include/gpg-error.h</code> to include</li>
</ul>
<p><em>Compiling gpgme</em></p>
<ul>
<li>In the MSYS bash, run <code>./configure --prefix=/mingw &amp;&amp; make</code></li>
<li>Call <code>strip src/gpgme-w32spawn.exe src/.libs/libgpgme-11.dll</code></li>
<li>Copy <code>src/gpgme-w32spawn.exe</code> to <code>bin</code> <strong>Note:</strong> To use the gpgme library, this binary has to live either in the installation dir of gpg (set in windows registry key <code>HKLM\Software\GNU\GnuPG\Installation Directory</code>) or in <code>%PROGRAMFILES%\GNU\GnuPG</code>. <strong>Otherwise gpgme will not work!</strong></li>
<li>Copy <code>src/.libs/libgpgme-11.dll</code> to bin and <code>src/.libs/libgpgme-11.dll.def</code> to <code>lib/libgpgme-11.def</code> (Once again, note the renaming)</li>
<li>Call <code>lib /machine:i386 /def:lib\libgpgme-11.def /out:lib\libgpgme-11.lib</code> to create the import library</li>
<li>Copy <code>include/gpgme.h</code> to <code>include</code></li>
</ul>
<p><em>Optional: Creating the documentation</em></p>
<p>I was not able to create the documentation properly using cygwin so I did this on a Linux host. Install a TeX distribution of your choice as well as texinfo (for Debian Lenny this would mean installing the packages texinfo, texi2html and texlive). Call make pdf in the doc subdir to generate the PDF documentation and manually call <code>texi2html gpgme.texi</code> for a HTML document.</p>
<p><em>Summary</em></p>
<p>Now you can add the lib dir to your Visual Studio linker settings and the include dir to your C/C++ common settings. To make gpgme work, be sure you have the gpgme-w32spawn.exe installed properly as noted above.</p>
<p>I hope this helps to guide one or another through the struggle of getting gpgme on windows.</p>
<p><em>Q&amp;A</em></p>
<ul>
<li>
<blockquote><p>Q: gpgme does not find libgpg-error</p></blockquote>
<p>A: You did not call <code>make install</code> after compiling it</li>
<li>
<blockquote><p>Q: My program is looking for <code>{libgpg-error-0.dll.dll|libgpgme-11.dll.dll}</code></p></blockquote>
<p>A: You did not rename the .def file before calling <code>lib.exe</code></li>
<li>
<blockquote><p>Q: I did everything you said, but when I run my program, <code>gpgme_engine_check_version(GPGME_PROTOCOL_OpenPGP)</code> fails with <code>GPG_ERR_INV_ENGINE</code>. If I check the engine info, <code>info-&gt;version</code> is empty</p></blockquote>
<p>A: First of all, check if you copied <code>gpgme-w32spawn.exe</code> to the correct directory. If this is the case, actually, I have no idea what went wrong</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jensge.org/2009/04/eternal-struggle/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

