<?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>dennogumi.org</title>
	<atom:link href="http://www.dennogumi.org/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dennogumi.org</link>
	<description>On the web since 1999</description>
	<lastBuildDate>Tue, 27 Jul 2010 22:41:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>What this might ever be?</title>
		<link>http://www.dennogumi.org/2010/07/what-this-might-ever-be</link>
		<comments>http://www.dennogumi.org/2010/07/what-this-might-ever-be#comments</comments>
		<pubDate>Tue, 27 Jul 2010 22:41:14 +0000</pubDate>
		<dc:creator>Einar</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.dennogumi.org/?p=790</guid>
		<description><![CDATA[
The rest is up to you to figure out.
]]></description>
			<content:encoded><![CDATA[<p align="center"><img src="http://imagebin.ca/img/V-7GlD.png" /></p>
<p align="left">The rest is up to you to figure out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennogumi.org/2010/07/what-this-might-ever-be/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>OCS and KDE Forums &#8211; work continues</title>
		<link>http://www.dennogumi.org/2010/07/ocs-and-kde-forums-work-continues</link>
		<comments>http://www.dennogumi.org/2010/07/ocs-and-kde-forums-work-continues#comments</comments>
		<pubDate>Sun, 25 Jul 2010 18:49:22 +0000</pubDate>
		<dc:creator>Einar</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OCS]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.dennogumi.org/?p=787</guid>
		<description><![CDATA[With my last entry, I announced the start of the work for an OCS library for the KDE Community Forums. Today I&#8217;d like to blog again about the recent developments. 
First of all, now there isn&#8217;t one, but two Python modules:

ocslib,  a pure Python module that can be used to interface with OCS-based forum [...]]]></description>
			<content:encoded><![CDATA[<p>With my last entry, I announced the start of the work for an OCS library for the KDE Community Forums. Today I&#8217;d like to blog again about the recent developments. </p>
<p>First of all, now there isn&#8217;t one, but <em>two</em> Python modules:</p>
<ul>
<li><em>ocslib, </em> a pure Python module that can be used to interface with OCS-based forum systems;</li>
<li><em>ocslibkde</em>, a PyKDE4 based module that can be used to interface with OCS-based forum system in KDE applications.</li>
</ul>
<p>Currently ocslib supports reading and posting, while ocslibkde only reading (as of now). Both can be retrieved from the <a href="http://gitorious.org/kde-forum-mods" title="Gitorious.org repository">kde-forum-mods repository</a> under the <em>ocs-client</em> subdirectory. The Python lib needs unit-testing, then I&#8217;ll be able to push a tarball soon for people to test (but you can always check out the Git repository). With regards to the PyKDE4 library, I plan on making a proof-of-concept plasmoid soon that shows how to use the API.</p>
<p>Speaking of API, here are some examples using ocslib:</p>
</p>
<pre class="brush: python;">
&gt;&gt;&gt; from ocslib import service# Connect to OCS
&gt;&gt;&gt; ocs_service = ocslib.service.OCService(&quot;http://www.example.com&quot;)
#Retrieve all forums
&gt;&gt;&gt; forums = ocs_service.list_forums()
# Elements have attributes for name, posts, etc.
&gt;&gt;&gt; print forums[0].name
&quot;Test forum&quot;
#Retrieve threads for forum 15
&gt;&gt;&gt; threads = ocs_service.list_forum_threads(forum_id=15)
# Retrieve thread 8945 from forum 15
&gt;&gt;&gt; messages = ocs_service.show_thread(forum_id=15, topic_id=8945)
&gt;&gt;&gt; print messages[0].text
&quot;Hello world!
#Post to a forum - requires authentication
&gt;&gt;&gt; ocs_service = service.OCService(&quot;http://www.example.com&quot;, username=&quot;foo&quot;, password=&quot;bar&quot;)
&gt;&gt;&gt; message = &quot;Hello, KDE people!&quot;
&gt;&gt;&gt; subject = &quot;Test message&quot;
&gt;&gt;&gt; ocs_service.post(forum_id=15, subject=subject, message=message)
True # Return code of operation
</pre>
<p>Feedback (especially on the API) welcome!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennogumi.org/2010/07/ocs-and-kde-forums-work-continues/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Collaboration Services and KDE Forums</title>
		<link>http://www.dennogumi.org/2010/07/open-collaboration-services-and-kde-forums</link>
		<comments>http://www.dennogumi.org/2010/07/open-collaboration-services-and-kde-forums#comments</comments>
		<pubDate>Sun, 18 Jul 2010 10:00:39 +0000</pubDate>
		<dc:creator>Einar</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[forums]]></category>
		<category><![CDATA[OCS]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.dennogumi.org/?p=785</guid>
		<description><![CDATA[For KDE developers, web-based forums are often uncommon workflows. Indeed, for communication among developers mailing lists are much better tools, especially since you can handle everything inside a client (most of the time), compared to forums where you have to use a web browser. The ways of reading, replying and interacting with posters are dramatically [...]]]></description>
			<content:encoded><![CDATA[<p>For KDE developers, web-based forums are often uncommon workflows. Indeed, for communication among developers mailing lists are much better tools, especially since you can handle everything inside a client (most of the time), compared to forums where you have to use a web browser. The ways of reading, replying and interacting with posters are dramatically different. And that is why some developers find themselves uncomfortable with the <a href="http://forum.kde.org" title="KDE Community Forums">KDE Community Forums</a>.</p>
<p>A dedicated application would be usually much better than a browser, because you can work around the intrinsic limitations of the browser itself. The problem is that you can&#8217;t really access a forum with anything else than a browser. That is, it <em>used to be</em> like this, but now things are changing.</p>
<p>In the past months fellow administrator bcooksley has been working quite hard implementing the <a href="http://freedesktop.org/wiki/Specifications/open-collaboration-services" title="OCS specification">Open Collaboration Services (OCS) specification</a> in the KDE Community Forums. For the uninformed, it&#8217;s the same API that powers <a href="http://opendesktop.org" title="OpenDesktop.org">OpenDesktop.org</a> and related web pages. This means that you could access the forum contents programmatically using a REST API and parsing the XML that is returned by the service. </p>
<p>Unfortunately, bcooksley had no time to implement a client that would make use of this newly-made service.</p>
<p>That&#8217;s where I stepped in. This morning <a href="http://gitorious.org/kde-forum-mods/phpbb/commit/471f6f7b4135d004be040c2bbd552b12451badfe" title="OCS commit">I committed in the kde-forum-mods repository</a> the first implementation of a backend to access the forums&#8217; OCS service. Currently it&#8217;s extremely basic &#8211; just a few classes to wrap the XML responses into decent data representation, and a basic class to perform reading requests: that means that technically it is possible to request forum listings, thread listing, and posts. I&#8217;m still working on the ability of replying and posting messages.</p>
<p>Being a Pythonista, the backend is written entirely in Python: currently it uses the standard library plus <a href="http://labix.org/python-dateutil" title="Python-dateutil"><em>dateutil</em></a> and <a href="http://codespeak.net/lxml/" title="lxml home page"><em>lxml</em></a> to do its bidding, but the next steps would be to turn it into a PyKDE4 library to access all the KDE related goodness (hello, KIO!). Bear in mind that currently there is no application using this: I merely completed (part of) the backend. </p>
<p>If you&#8217;re interested, the code can be found on gitorious.org, in the <em>ocs-client</em> directory, branch <em>experimental</em>,  inside the <a href="http://gitorious.org/kde-forum-mods" title="Gitorious.org repository">kde-forum-mods repository</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennogumi.org/2010/07/open-collaboration-services-and-kde-forums/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>What&#8217;s cooking at the KDE Community Forums?</title>
		<link>http://www.dennogumi.org/2010/06/whats-cooking-at-the-kde-community-forums</link>
		<comments>http://www.dennogumi.org/2010/06/whats-cooking-at-the-kde-community-forums#comments</comments>
		<pubDate>Sat, 05 Jun 2010 11:56:51 +0000</pubDate>
		<dc:creator>Einar</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[forums]]></category>

		<guid isPermaLink="false">http://www.dennogumi.org/?p=783</guid>
		<description><![CDATA[In the past weeks and days, the KDE Community Forums staff has been working to bring new features to improve even more the user experience. A few months ago, the staff was discussing the idea of finding a way to guide users to the most appropriate forum to post their questions or discussions. Now, thanks [...]]]></description>
			<content:encoded><![CDATA[<p>In the past weeks and days, the KDE Community Forums staff has been working to bring new features to improve even more the user experience. A few months ago, the staff was discussing the idea of finding a way to guide users to the most appropriate forum to post their questions or discussions. Now, thanks also to the return in service of one of our admins (welcome back, sayakb!) the feature is now being implemented, as the screenshots below will show.</p>
<p>Bear in mind that everything for now is running on a testing server, to make sure it doesn&#8217;t break anything. Once the tests and the implementation are complete, we&#8217;ll integrate the feature in the forums. How soon we are not sure, but it won&#8217;t be too long.</p>
<h2>&quot;Help me post a topic&quot;</h2>
<p>Upon logging in, you will be greeted by a new &quot;New Post&quot; button:</p>
<p align="center"><img src="http://www.dennogumi.org/wp-content/uploads/2010/06/new1.png" /></p>
<p align="left">You can either click on the arrow to quickly post an idea for Brainstorm, a new discussion, access the &quot;getting started&quot; forum or contact the staff:</p>
<p align="center"><img src="http://www.dennogumi.org/wp-content/uploads/2010/06/new2.png" /></p>
<p align="left">Or if you just click on the button itself, you access the guided post section:</p>
<p align="center"><img src="http://www.dennogumi.org/wp-content/uploads/2010/06/new3_small.png" /></p>
<p align="left">The &quot;Share an idea&quot; and &quot;Chat and discuss&quot; buttosn will bring you to the relevant forums (Brainstorm and Discussions and Opinions), while &quot;Ask a question&quot; will bring about an additional screen:</p>
<p align="center"><img src="http://www.dennogumi.org/wp-content/uploads/2010/06/new4_small.png" /></p>
<p align="left">You&#8217;ll be able to select your favorite application and you&#8217;ll be able to post directly in the relevant forum. </p>
<h2 align="left">Open Collaboration Services</h2>
<p align="left">But that&#8217;s not all. Thanks to the hard work of Ben Cooksley (fellow admin and System Settings maintainer) there is also an implementation of the <a href="http://www.freedesktop.org/wiki/Specifications/open-collaboration-services" title="OCS page on the freedesktop.org wiki">Open Collaboration Services (OCS)</a>, the same system that powers the well-known Get Hot New Stuff connected to <a href="http://opendesktop.org" title="OpenDesktop">OpenDesktop.org</a>. This will mean, in principle, that you could access forum posts and discussions in a programmatic way, using a REST API. This opens up possibilities like Brainstorm plasmoids, other means to access the forum (like an Akonadi resource &#8211; there&#8217;s some ongoing work in KDE SVN). If you&#8217;re interested in testing the OCS for the forum (or if you want to develop some kind of application that ties to the forums themselves), let us know on IRC (#kde-forum on freenode).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennogumi.org/2010/06/whats-cooking-at-the-kde-community-forums/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Akademy: my own BoF</title>
		<link>http://www.dennogumi.org/2010/05/akademy-my-own-bof</link>
		<comments>http://www.dennogumi.org/2010/05/akademy-my-own-bof#comments</comments>
		<pubDate>Sat, 29 May 2010 19:55:37 +0000</pubDate>
		<dc:creator>Einar</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[akademy2010]]></category>

		<guid isPermaLink="false">http://www.dennogumi.org/?p=774</guid>
		<description><![CDATA[
My Akademy talk proposal was not accepted, but the organizers were kind enough to offer me the chance to hold a BoF on the same subject. Now I bet you wonder on what I&#8217;m going to discuss, and I think the title already gives you an idea:
KDE and bioinformatics: the missing link
Although in the KDE [...]]]></description>
			<content:encoded><![CDATA[<p align="center"><a href="http://akademy.kde.org"><img src="http://www.dennogumi.org/wp-content/uploads/2010/05/igta2010.png" title="I'm going to Akademy 2010" alt="I'm going to Akademy 2010 image" /></a></p>
<p>My Akademy talk proposal was not accepted, but the organizers were kind enough to offer me the chance to hold a BoF on the same subject. Now I bet you wonder on what I&#8217;m going to discuss, and I think the title already gives you an idea:</p>
<p align="center"><strong>KDE and bioinformatics: the missing link</strong></p>
<p align="left">Although in the KDE community we have our fair share of scientists (hey there, Stuart!), my BoF will focus on the adoption of KDE in the field of <a href="http://en.wikipedia.org/wiki/Bioinformatics" title="General explanation on bioinformatics">bioinformatics</a> (my day job, not-so-by-chance) on the &quot;outsiders&quot; front and how to improve the current situation. To elaborate further, bioinformatics is a rather broad field where biological data are treated with computational methods. The oldest and most famous branch of bioinformatics is sequence analysis and related field, where sequences of DNA are analyzed, for example, to find common ancestors among several species, or to reconstruct the genetic code of an organism by comparing it to a related species. Another recent example is related to <em>high-throughput technologies</em>, technologies which produce huge amounts of data from a very small number of experiments (&quot;<a href="http://en.wikipedia.org/wiki/DNA_sequencing#Large-scale_sequencing_strategies" title="Wikipedia article">ultramassive sequencing</a>&quot; and <a href="http://en.wikipedia.org/wiki/DNA_microarray" title="Wikipedia explanation">DNA microarrays</a> are examples of such a technology). </p>
<p align="left">Either way, bioinformaticians have to deal with large amounts of data all the time, and usually there&#8217;s no &quot;shrink-wrap&quot; solution to the problems they have to face, software-wise. That&#8217;s because we do research, so we need to find something new. So the solution is often to write algorithms, or re-implement existing ones in a form that is suited for the tasks at hand. So, bioinformaticians also write software, although they&#8217;re by no means (usually) professional coders: some have a mathematical or statistical background, others (like me) come from an experience at the lab bench. What kind of programs bioinformaticians write? Normally scripts and small stuff, but in certain cases even full blown-algorithms and applications. Some become so famous that are even trend-setters.</p>
<p align="left">Which brings us to the heart of the matter: how does KDE stand in all of this? Sadly, not too well. I&#8217;ve done some research in the published literature, but there&#8217;s just <strong>one</strong> hit returned that&#8217;s proper: <a href="http://www.ncbi.nlm.nih.gov/pubmed/18695948" title="KInNeSS: a modular framework for computational neuroscience.">a KDE application for neuroscience</a> (based on the 3.5.x Development Platform) published in 2008. I know that big research places like CERN use KDE, but to my knowledge smaller realities such as research group code in the majority of the cases for Windows or for web-based solutions. Given that at least a signficant portion of bioinformaticians uses UNIX-like operating systems, the question we need to answer is: why?</p>
<p align="left">The first and foremost problem is related to market share. Research groups don&#8217;t even know that KDE exists, so it&#8217;s unlikely they develop something using the Development Platform (even now that&#8217;s becoming more cross-platform). This is where some promo efforts could help. Secondly, the problem lies in the &quot;difficulty&quot; (notice the quotes!) of developing using the KDE Development platform: most bioinformaticians, as I wrote, are <strong>not</strong> professional coders, and few of them know C++. The most used languages in bioinformatics are Perl and Java (with some Python and Ruby thrown into the mix). Thus, the need for proper bindings. The bindings are there, thanks to the excellent work of the kde-bindings team, but documentation is still lacking (namely in the examples department, but also in tutorials and getting started guides that aren&#8217;t aimed at C++). Some documentation is auto-generated, and while the KDE API docs are usually not too hard to read, they can still scare off newcomers. Of course this is not the fault of the kde-bindings team: namely, more help is needed. </p>
<p align="left">Promo efforts and better bindings are the keys to spread KDE more in the field of the bioinformatics. This is what my BoF is about, plus an informal discussion on the use of FOSS in academia and related matters. </p>
<p align="left">Interested? If you are, you can come to the BoF which will be on <strong>Tuesday, 6th July</strong> at <strong>15.00</strong> in the Area 2 of the main room at Demola. </p>
<p align="left">I&#8217;ll also be around later till the following morning (sadly, two days is the best I can do to attend) in case you&#8217;re interested for a chat.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennogumi.org/2010/05/akademy-my-own-bof/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>PyKDE4: new style signals and slots</title>
		<link>http://www.dennogumi.org/2010/03/pykde4-new-style-signals-and-slots</link>
		<comments>http://www.dennogumi.org/2010/03/pykde4-new-style-signals-and-slots#comments</comments>
		<pubDate>Sat, 06 Mar 2010 09:04:48 +0000</pubDate>
		<dc:creator>Einar</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.dennogumi.org/?p=763</guid>
		<description><![CDATA[Those who use PyQt and PyKDE4 are certainly familiar with the syntax used to connect signals and slots:

from PyQt4 import QtCore
from PyQt4 import QtGui
from PyKDE4 import kdeui

class MyGUI(QtGui.QWidget):

    def __init__(self, parent=None):
        super(MyGUI, self).__init__(parent)
        self.pushbutton = kdeui.KPushButton()
   [...]]]></description>
			<content:encoded><![CDATA[<p>Those who use PyQt and PyKDE4 are certainly familiar with the syntax used to connect signals and slots:</p>
<pre class="brush: python;">
from PyQt4 import QtCore
from PyQt4 import QtGui
from PyKDE4 import kdeui

class MyGUI(QtGui.QWidget):

    def __init__(self, parent=None):
        super(MyGUI, self).__init__(parent)
        self.pushbutton = kdeui.KPushButton()
        self.pushbutton.setText(&quot;Push me!&quot;)

        QObject.connect(self.pushbutton, QtCore.SIGNAL(&quot;clicked()&quot;),
                               self.button_pushed)

    def button_pushed(self):
        print &quot;Button clicked&quot;
</pre>
<p>The main advantage of this syntax is that it&#8217;s very close to the C++ equivalent, and so you can translate easily from C++ to Python. Unfortunately the advantages of this syntax end here. The disadvantages, at least from a Python coding perspective, outweigh the advantages:</p>
<ul>
<li>It&#8217;s <em>extremely</em> error-prone: make a typo, and not only your signal won&#8217;t be connected, but you won&#8217;t even get a warning, your program will simply do nothing;</li>
<li>In case you have overloaded signals, you have to type the exact signature, going back to the first problem;</li>
<li>It&#8217;s not Pythonic at all.</li>
</ul>
<p>So, in recent PyQt versions (and thus also in PyKDE4) a <em>new style</em> approach was introduced (although the old style is always present should it be the need to). Using the new style, the signals become a property of the object that emits them. and then you use the connect function of that property. Here&#8217;s the example using the new style-signals:</p>
<pre class="brush: python;">
from PyQt4 import QtCore
from PyQt4 import QtGui
from PyKDE4 import kdeui

class MyGUI(QtGui.QWidget):

    def __init__(self, parent=None):
        super(MyGUI, self).__init__(parent)
        self.pushbutton = kdeui.KPushButton()
        self.pushbutton.setText(&quot;Push me!&quot;)
        # New style
        self.pushbutton.clicked.connect(self.button_pushed)

    def button_pushed(self):
        print &quot;Button clicked&quot;
</pre>
<p>As you can see it&#8217;s much clearer, and much more Pythonic. Also, typos  <strong>will</strong> trigger an AttributeError, which means you&#8217;ll be able to track where the problem is.  </p>
<p>What about overloaded signals? Normally the first defined is the default, but you can use a dictionary-like syntax to access other overloads (signal names are completely made up here):</p>
<pre class="brush: python;">
# One signal is without arguments, the other has a bool

# Signal without arguments
self.my_widget.connected.connect(self.handle_errors)
# Signal with a book
self.my_widget.connected[bool].connect(self.handle_errors)
</pre>
<p>Signals are emitted with the emit() function and disconnected with the disconnect() function:</p>
<pre class="brush: python;">
# Emit a signal
self.pushbutton.clicked.emit()
# Emit a signal with a value (an int)
self.my_widget.valueChanged.emit(int)
# Disconnect another
self.my_tabwidget.currentIndexChanged.disconnect()
</pre>
<p>To define new signals, you can use the <em>pyqtSignal</em> function, specifying which values will the signal take (if any): just define that as a class constant (like in the example) and then you can access them like the wrapped ones:</p>
<pre class="brush: python;">

class MyWidget(QWidget):

    # Signal with no arguments
    operationPerformed = QtCore.pyqtSignal()

    # Signal that takes arguments
    valueChanged = QtCore.pyqtSignal(int)
</pre>
<p>I merely scratched the surface with this. For more information, check out <a href="http://riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html" title="PyQt4 Reference Manual">PyQt&#8217;s reference manual</a>, which also covers other cases.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennogumi.org/2010/03/pykde4-new-style-signals-and-slots/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>The world of KIO metadata &#8211; checking the HTTP response from a server</title>
		<link>http://www.dennogumi.org/2010/02/the-world-of-kio-metadata-checking-the-http-response-from-a-server</link>
		<comments>http://www.dennogumi.org/2010/02/the-world-of-kio-metadata-checking-the-http-response-from-a-server#comments</comments>
		<pubDate>Thu, 18 Feb 2010 21:42:46 +0000</pubDate>
		<dc:creator>Einar</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.dennogumi.org/?p=753</guid>
		<description><![CDATA[Recently, I investigated how to perform some checks on web addresses using KIO for Danbooru Client. My old code was synchronous, so it blocked the application while checking, thus causing all sort of troubles (UI freezing, etc.). Therefore, making the switch to KIO was the best solution. However, I had one problem: how could I [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I investigated how to perform some checks on web addresses using KIO for <a href="http://kde-apps.org/content/show.php/Danbooru+Client?action=content&#038;content=114343" title="kde-apps page">Danbooru Client</a>. My old code was synchronous, so it blocked the application while checking, thus causing all sort of troubles (UI freezing, etc.). Therefore, making the switch to KIO was the best solution. However, I had one problem: <em>how could I check the HTTP response?</em></p>
<p>I knew already that the various ioslaves can store metadata, consisting of key-value pairs which are specific on the slave used. Normally you can get the whole map by accessing the <a href="http://api.kde.org/4.4-api/kdelibs-apidocs/kio/html/classKIO_1_1Job.html#a631cbc61c70e512ad91b2cf2c23ef029" title="API docs on metaData()"><em>metaData</em></a> function of the job you have used, in the slot connected from the <em>result</em> signal.  For some reason, however, in PyKDE4 calling metaData() triggers an assert in SIP, which ends in a crash (at least in my application; I stil need to debug further).  KIO  jobs have also the <a href="http://api.kde.org/4.4-api/kdelibs-apidocs/kio/html/classKIO_1_1Job.html#aafd31b4d9643bffb4cd75f3a31242bd4" title="API docs on queryMetaData"><em>queryMetaData</em></a> function, which returns the value of the key you have queried. Unfortunately, there was no way I could find the name.</p>
<p>Thus began my search for the right key. Googling didn&#8217;t help, and on IRC I got the first answers I needed but not enough to reach the goal. Until I saw a commit by David Faure in trunk/kdelibs/kio/ which touched a file called <a href="http://websvn.kde.org/branches/KDE/4.4/kdelibs/kio/DESIGN.metadata?revision=1070858&#038;view=markup" title="Link to the branch version">DESIGN.metadata</a> (link is for the branch version). After checking with webSVN, that was exactly the thing I was looking for! It lists all the keys for the metadata, indicating also to which ioslave they begin.  After that, the solution was easy.</p>
<p>Of course I&#8217;m not leaving you hanging there and now I&#8217;ll show you how, in PyKDE4, you can quickly check for the server response:</p>
<pre class="brush: python;">
from PyKDE4.kio import KIO
from PyQt4.QtCore import SIGNAL
[...]

class my_widget(QWidget):
[...]

    def check_address(self, url):

        # You can add optional flags such as KIO.HideProgressInfo
        job = KIO.get(KUrl(url))
        self.connect(job, SIGNAL(&quot;result (KJob *)&quot;), self.slot_result)

    def slot_result(self, job):

        if job.error():
            # Bail out if there's an error
            return    

        # Get the HTTP response through queryMetaData
        http_response = job.queryMetaData(&quot;responsecode&quot;)
        print &quot;Got response: %s&quot; % unicode(http_response)
</pre>
<p>This snippet does a few things. Firstly, it gets the specified URL, using KIO.get (KIO.stat doesn&#8217;t set the required metadata). Notice that the call is not wrapped in the  new-style PyQt API because <em>result (KJob *)</em> isn&#8217;t wrapped like that (<a href="https://bugs.kde.org/show_bug.cgi?id=211070" title="Bug 211070">there&#8217;s a bug open for that</a>). In any case, the signal passes to the connecting slot (slot_result) where we first check if there&#8217;s an error (perhaps the address didn&#8217;t exist?) and then we use <em>queryMetaData(&quot;responsecode&quot;)</em> to get the actual response code. </p>
<p>If you want to do error checking basing on the result, bear in mind that KIO operates asynchronously, so you should use a signal to tell your application that the result is what it expected or not.</p>
<p>I wonder if this should be documented in Techbase&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennogumi.org/2010/02/the-world-of-kio-metadata-checking-the-http-response-from-a-server/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ar Tonelico III</title>
		<link>http://www.dennogumi.org/2010/02/ar-tonelico-iii</link>
		<comments>http://www.dennogumi.org/2010/02/ar-tonelico-iii#comments</comments>
		<pubDate>Sat, 06 Feb 2010 21:33:20 +0000</pubDate>
		<dc:creator>Einar</dc:creator>
				<category><![CDATA[Anime]]></category>
		<category><![CDATA[ar tonelico 3]]></category>
		<category><![CDATA[games]]></category>

		<guid isPermaLink="false">http://www.dennogumi.org/?p=748</guid>
		<description><![CDATA[
It&#8217;s been a while since I blogged about anything non-FOSS. This time I&#8217;ll be sharing some impressions on one of the games I&#8217;m playing at the moment, that is, Ar Tonelico III (which arrived at my doorstep two days ago). I admit I haven&#8217;t been a fan of Gust games (aside from Ar Tonelico, they&#8217;re [...]]]></description>
			<content:encoded><![CDATA[<p><img title="Ar Tonelico III cover" src="http://www.dennogumi.org/wp-content/uploads/2010/02/ar_3.jpg" alt="Ar Tonelico III cover image" /></p>
<p>It&#8217;s been a while since I blogged about anything non-FOSS. This time I&#8217;ll be sharing some impressions on one of the games I&#8217;m playing at the moment, that is,<strong> Ar Tonelico III</strong> (which arrived at my doorstep two days ago). I admit I haven&#8217;t been a fan of Gust games (aside from Ar Tonelico, they&#8217;re known mostly for the <em>Atelier</em> series), mostly because technically wise they didn&#8217;t really perform that well. While I understood they&#8217;re a small company, sometimes it was a little too much.</p>
<p>I bought this one because from the movies and information disseminated throughout the net it looked like it was better, so I started reading information, which in turn prompted the buy: it&#8217;s also a good way to keep my Japanese in order, as I need to keep up with the language if I want to understand things.</p>
<p>Right now I&#8217;ve just played a couple of hours, and it looks decent, although with some technical issues (the characters glide over the terrain, rather than walk). I&#8217;ve also seen the infamous <em>Purge System</em> in action (look it up online), which made quite a number of fan sneer for a various number of reasons. As of the story, I can&#8217;t say anything at the moment: I&#8217;ve just started. At least it is moderately fun.</p>
<p><a title="Hands-on" href="http://forum.everyeye.it/invision/index.php?showtopic=527861">Here&#8217;s a hands-on</a> (Italian) which covers more details. I&#8217;ll try to post a few updates in the future (if I don&#8217;t forget&#8230;.)</p>
<p>And here&#8217;s a quick video I made with my camera:</p>
<p><a href="http://www.dennogumi.org/2010/02/ar-tonelico-iii"><em>Click here to view the embedded video.</em></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennogumi.org/2010/02/ar-tonelico-iii/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://www.heavensinferno.net/downloads/tonelico3_conv.flv" length="8569353" type="video/x-flv" />
		</item>
		<item>
		<title>Learning by example</title>
		<link>http://www.dennogumi.org/2010/01/learning-by-example</link>
		<comments>http://www.dennogumi.org/2010/01/learning-by-example#comments</comments>
		<pubDate>Wed, 13 Jan 2010 21:37:38 +0000</pubDate>
		<dc:creator>Einar</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[pykde]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.dennogumi.org/?p=744</guid>
		<description><![CDATA[With my brand-new SVN account, I just committed some code to kdeexamples, KDE&#8217;s example code module. In particular, I  committed a simple example which shows how to use KConfigXT via PyKDE4, a simplified version of what I wrote about here.
As most of KDE is C++, and the Python API docs are translated directly from [...]]]></description>
			<content:encoded><![CDATA[<p>With my brand-new SVN account, <a href="http://lists.kde.org/?l=kde-commits&#038;m=126342017923323&#038;w=2" title="SVN commit">I just committed some code</a> to kdeexamples, KDE&#8217;s example code module. In particular, I  committed a simple example which shows how to use KConfigXT via PyKDE4, a simplified version of <a href="http://www.dennogumi.org/2009/10/howto-kconfigxt-with-pykde4" title="HOWTO: KConfigXT with PyKDE4">what I wrote about here</a>.</p>
<p>As most of KDE is C++, and the Python API docs are translated directly from the C++ API docs, it is essential to have good examples to help newcomers learn faster.  There are some PyKDE4 examples in the kdebindings module already, but I put mine in kdeexamples for a number of reasons:</p>
<ul>
<li><em>Clear purpose</em>: kdeexamples is meant exactly for this &#8211; example code;</li>
<li><em>Visibility:</em> A central place to find KDE examples even for bindings is optimal, makes easier to find what one is looking for.</li>
</ul>
<p>Visibility is also important as currently the examples are rather buried inside kdebindings, and as far as I know they aren&#8217;t included in the packages of some distributions (at least not openSUSE; YMMV). </p>
<p>I decided to take this route because PyKDE4 is basically the job of one person (Simon Edwards): he does already a great job, but the work is too much for a single person to handle. And due to shortage of human resources, PyKDE4 lacks examples and documentation, and thus it&#8217;s not always easy to understand how to use the C++ API in Python. Writing snippets of working code, with extensive comments, is a step in the good direction. And also an opportunity to contribute back to KDE after all these years!</p>
<p>For now there&#8217;s just KConfigXT,  but I plan on tackling KIO next, as soon as I have time. Of course, help is welcome!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennogumi.org/2010/01/learning-by-example/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Danbooru Client 0.5 is out</title>
		<link>http://www.dennogumi.org/2009/12/danbooru-client-0-5-is-out</link>
		<comments>http://www.dennogumi.org/2009/12/danbooru-client-0-5-is-out#comments</comments>
		<pubDate>Sun, 27 Dec 2009 08:54:54 +0000</pubDate>
		<dc:creator>Einar</dc:creator>
				<category><![CDATA[Anime]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[danbooru client]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.dennogumi.org/?p=738</guid>
		<description><![CDATA[Sometimes answering apparently harmless questions on instant messaging can have unexpected results. In particular, I was telling about Danbooru Client to someone and a question popped up &#34;Why don&#8217;t you support pages?&#34;. It seemed a nice idea, so I branched off the code (yay for git!) and started working on it.
Well, it took me more [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes answering apparently harmless questions on instant messaging can have unexpected results. In particular, I was telling about Danbooru Client <a href="http://www.clorophilla.net/blog" title="NRK's blog">to someone</a> and a question popped up &quot;Why don&#8217;t you support pages?&quot;. It seemed a nice idea, so I branched off the code (yay for git!) and started working on it.</p>
<p>Well, it took me more than a <em>month</em> to get this thing done&#8230; I didn&#8217;t spend every day coding, but it was a challenge. Glad it&#8217;s over now, which means that Danbooru Client 0.5 is finally available. Grab it <a href="http://kde-apps.org/content/show.php/Danbooru+Client?content=114343" title="kde-apps page">at the usual place on kde-apps.org</a>. </p>
<p>Changes in this version:</p>
<ul>
<li>Massive code refactoring and documentation</li>
<li>Support for multiple pages: the same query can be repeated multiple pages (shown in a tabbed interface), kind of like browsing the actual Danbooru board;</li>
<li>Rating information added to the API;</li>
<li>Support for translations (thanks to Pino &quot;pinotree&quot; Toscano for the help): the tarball now contains a .pot file which can be used for translating Danbooru Client. If you make a translation, send the .po file my way and I&#8217;ll include it in the next version.</li>
</ul>
<p>Improvements that I have in the queue:</p>
<ul>
<li>Suppport for pools (every board out there changes the API, so it will require some work);</li>
<li>Support for storing password/username using KWallet (through <a href="http://pypi.python.org/pypi/keyring" title="keyring at PyPi">python-keyring</a>, so it works even without KWallet installed);</li>
<li>Review usability of the dialogs (I have a separate branch for that);</li>
<li>Improve the image download dialog.</li>
</ul>
<p>On recent KDE SC versions (4.4 beta 2 and onwards) there are some painting issues with regards to the thumbnails, but I&#8217;m not sure if the fault is in PyKDE4 or in the underlying libraries. Nothing too bad, luckily: hovering the thumbnails or giving focus to the thumbnail view should be what&#8217;s needed. </p>
<p>Here&#8217;s a screenshot of the new interface (click to enlarge):</p>
<p align="center"><a href="http://www.dennogumi.org/wp-content/uploads/2009/12/danbooru_new.png"><img src="http://www.dennogumi.org/wp-content/uploads/2009/12/danbooru_new_resized.png" title="The new interface" alt="Screenshot of the new interface" /></a></p>
<p>Comments and suggestions are always welcome, so don&#8217;t hesitate to drop me a line.</p>
<p>As a final word, some thoughts on the work required to get this out of the door. My largest issues are related to garbage collection: Python&#8217;s reference counting based GC got a lot in the way, at least because of how the underlying C++ structures work. I had to work a bit to keep references to objects around so I wouldn&#8217;t get crashes (accessing an already deleted object). All is well now, and I think my Python/PyQt/PyKDE4 knowledge gained from it. I keep telling myself that I should be writing some tutorials one day&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennogumi.org/2009/12/danbooru-client-0-5-is-out/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
