<?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>Attracted by virtual constructs</title>
	<atom:link href="http://frinring.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://frinring.wordpress.com</link>
	<description>Thoughts about developing systems in software</description>
	<lastBuildDate>Sat, 31 Oct 2009 21:40:01 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='frinring.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/4a77e0017050226d632e1350fbe80c1d?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Attracted by virtual constructs</title>
		<link>http://frinring.wordpress.com</link>
	</image>
			<item>
		<title>Synchronisation with Kasten, just to filesystems now</title>
		<link>http://frinring.wordpress.com/2009/10/31/synchronisation-with-kasten-just-to-filesystems-now/</link>
		<comments>http://frinring.wordpress.com/2009/10/31/synchronisation-with-kasten-just-to-filesystems-now/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 21:40:01 +0000</pubDate>
		<dc:creator>frinring</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Kasten]]></category>
		<category><![CDATA[Okteta]]></category>

		<guid isPermaLink="false">http://frinring.wordpress.com/?p=539</guid>
		<description><![CDATA[Sometimes it seems with faster and faster JavaScript-JIT-compilers and Gears/HTML5 the current software stacks, written in other languages, like e.g. Qt/KDE are going to be legacy. Google Docs &#38; Co. show what is possible, with the browser as the generic adapter to the platform.
But the current software stacks are fighting back. Things like the openSUSE [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=frinring.wordpress.com&blog=251139&post=539&subd=frinring&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Sometimes it seems with faster and faster JavaScript-JIT-compilers and Gears/HTML5 the current software stacks, written in other languages, like e.g. Qt/KDE are going to be legacy. Google Docs &amp; Co. show what is possible, with the browser as the generic adapter to the platform.<br />
But the current software stacks are fighting back. Things like the openSUSE Build Service make it possible to have your code compiled and ready to be delivered for several platforms, run natively by the hardware you actually bought to do so, instead of having some resources abused for virtual layers. It just needs code which does not (over-)use platform-specific constructs. The expansion of Qt/KDE to more and more architectures is a fine example here what is possible.<br />
Curious what will be next, perhaps Javascript programs using alternatively binary blocks of code compiled for popular hardware, given the OS has built-in access control? Things are merging.</p>
<p>With this in mind I congratulate the people from AbiWord on their new <a href="http://abisource.com/release-notes/2.8.0.phtml">version 2.8</a>, which not only improves the support for the open spec&#8217;ed on-disk format OpenDocument (.odt), but especially improves on the collaboration features which <a href="http://abicollab.net/">integrate</a> the Web 2.0. That looks really great. My only nitpick is that this seems to be a non-FLOSS webservice. I just hope they find a good business model so that the software for the server can be shared, too. Others, like Inkscape or hopefully soon KOffice, might be interested in such a server system, too.</p>
<p>I also congratulate the people from Étoilé, who just have started to <a href="http://etoileos.com/news/archive/2009/09/15/1659/">send objects over XMPP</a>. This all sounds so promising.</p>
<p>Realtime collaboration and such data model synchronisation is something I hope Kasten, my WIP framework for composing programs, one day supports out of the box, too. From the very beginning this has been considered in the design, even if it is not yet too visible. And it still will take some time to get there.</p>
<p>There is other stuff to do first, like making Okteta work with very large files. This isn&#8217;t done yet, I am still working on it, but have hopes this feature will make it into the next release. Working with very large files means only loading the parts which are currently interesting (e.g. solved by memmapping the file). Currently Kasten, the framework Okteta is built on, only has support for the concept of loading document objects completely from the remote storage (like the filesystem on disk) to the working memory, done by subclasses of <code>AbstractModelSynchronizer</code>. There is a specialized subclass <code>AbstractModelFileSystemSynchronizer</code>, which takes care for the common stuff on dealing with the filesystem, including loading/storing to remote filesystems with <code>KIO::NetAccess</code>. So the/your document-specific subclass has just to implement the de- and encoding of the data from a QFile to the working data model.</p>
<p>Now, <code>AbstractModelFileSystemSynchronizer</code> was not really finished, so before adding a new construction site in Kasten for the partial-loading of files I want to finish the old one for the complete loading. E.g. there was no support for a property State of the remote storage. Thanks to <code>KDirWatcher</code> there is now some easily done initial one. Investigations are still needed how to make sure there is no race-condition where another process might break into writing to the file, reading the file&#8217;s timestamp of the own modification and starting to watch for changes again.<br />
Also, <code>KDirWatcher</code> does not work for Kio-slaves. So files loaded from them are just marked to be in Unknown state. Besides, if the network connection is down, they are set to Unreachable. <code>Solid::Networking</code> serves this with just a few lines again <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>See in the screenshot for the two state symbols now in the Documents tool: the left icon shows the working data state (saved changes, unsaved changes), the right one the remote storage state. The yellow flag means Unknown, in case you wonder, and turns into the Network-disconnected icon if you disconnect from the network, like pulling the plug (looks impressive if you have several files loaded e.g. by sftp:// <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ). Well, seems I need to apply for some more icons from our icon heros.<br />
<a href="http://frinring.files.wordpress.com/2009/10/okteta-local-and-remote-sync-status.png"><img src="http://frinring.files.wordpress.com/2009/10/okteta-local-and-remote-sync-status.png?w=300&#038;h=148" alt="Okteta Local and Remote Sync Status" title="Okteta Local and Remote Sync Status" width="300" height="148" class="alignnone size-medium wp-image-540" /></a></p>
<p>Other changes in this area:</p>
<ul>
<li>The action Revert is renamed to Reload. Revert will not do what the name says if the storage copy was modified since the loading of the document. Revert would rather mean undoing all changes, so that action semantic  might rather appear in the Edit menu, for some quicker navigation through the change history.</li>
<li>The actions Reload and Save are only available if they are useful and usable. E.g. they are disabled if there are no known changes in both the working copy of the document data and the storage copy or the connection to the remote storage is lost.</li>
<li>Also new documents which are generated from random data or user input (like parameters) are set to modified, so closing them without adding any further content will still trigger the question if you really want to discard this perhaps unique data.</li>
</ul>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/frinring.wordpress.com/539/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/frinring.wordpress.com/539/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/frinring.wordpress.com/539/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/frinring.wordpress.com/539/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/frinring.wordpress.com/539/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/frinring.wordpress.com/539/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/frinring.wordpress.com/539/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/frinring.wordpress.com/539/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/frinring.wordpress.com/539/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/frinring.wordpress.com/539/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=frinring.wordpress.com&blog=251139&post=539&subd=frinring&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://frinring.wordpress.com/2009/10/31/synchronisation-with-kasten-just-to-filesystems-now/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/99a2c0597f51fc359467492b816edb6d?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">frinring</media:title>
		</media:content>

		<media:content url="http://frinring.files.wordpress.com/2009/10/okteta-local-and-remote-sync-status.png?w=300" medium="image">
			<media:title type="html">Okteta Local and Remote Sync Status</media:title>
		</media:content>
	</item>
		<item>
		<title>Okteta: Fighting the crisis with productivity from generators</title>
		<link>http://frinring.wordpress.com/2009/10/18/okteta-fighting-the-crisis-with-productivity-from-generators/</link>
		<comments>http://frinring.wordpress.com/2009/10/18/okteta-fighting-the-crisis-with-productivity-from-generators/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 13:29:30 +0000</pubDate>
		<dc:creator>frinring</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Kasten]]></category>
		<category><![CDATA[Okteta]]></category>

		<guid isPermaLink="false">http://frinring.wordpress.com/?p=529</guid>
		<description><![CDATA[(And if it is just random data)
There has been some productivity-related productivity in Kasten and Okteta development the last days, as can be seen by commit logs like &#8220;added: factories to create generators&#8221;   :
Kasten, my WIP framework for composing programs, gained some AbstractModelDataGenerator class to serve as base class for data generating stuff. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=frinring.wordpress.com&blog=251139&post=529&subd=frinring&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>(And if it is just random data)</p>
<p>There has been some productivity-related productivity in Kasten and Okteta development the last days, as can be seen by commit logs like &#8220;added: factories to create generators&#8221; <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  :</p>
<p>Kasten, my WIP framework for composing programs, gained some AbstractModelDataGenerator class to serve as base class for data generating stuff. It also got a general Insert controller which plugs into the menu, offers all available data generators and has the chosen one generate its data (if parameterized after showing a config dialog) and then inserts it into the current document. And with the AbstractModelDataGenerator around, I extended the AbstractDocumentFactory to also create new documents from QMimeData and reworked the general New controller: it now not only offers to create an empty document, but also to create one prefilled with data from one of the data generators. Or by the data from the clipboard, which also serves QMimeData. And while I was at it, the shell now no longer rejects D&#8217;n'D data other than file urls to non-document areas (like next to tabs or the empty space on start) but passes it to the document factory to see if it can construct a new document from it, all by just a few lines of codes. Kasten may look bloated to some (including myself sometimes) but it has it&#8217;s value here and there <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>To see if it is working Okteta, the KDE 4 hex editor, which is built on Kasten, has got some generators:<br />
For one Okteta since the first release had some simple Insert pattern controller, which now got ported to a plain data generator plugin (+ config editor). Then two weeks ago I found myself for the x-th time in life in the need for data in the whole range of all bytes, from 0 to 255. So I had done a clone of the pattern controller and already added as a Insert sequence controller (which started the idea for these general data generators). Got ported to a plain generator plugin, too. </p>
<p>Another generator perhaps useful might be a random data generator. So now there is one. It is based on srand(time(0)) and rand(), which may be of different quality depending of the platform&#8217;s libc. If you instead want a certain algorithm, please contribute and send me some code for it filling a QByteArray, licensed like the rest of the <a href="http://websvn.kde.org/trunk/KDE/kdeutils/okteta/kasten/gui/io/bytearrayrandomdatagenerator.cpp?revision=1036872&amp;view=markup">file</a>, I am happy to add some alternative RNG to select from <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Lots of TODOs and ideas coming with this, but works already. If you like screenshots, have a look:<br />
 <a href="http://frinring.files.wordpress.com/2009/10/generators-for-okteta.png"><img src="http://frinring.files.wordpress.com/2009/10/generators-for-okteta.png?w=300&#038;h=174" alt="Data generators for Okteta" title="Data generators for Okteta" width="300" height="174" class="alignnone size-medium wp-image-530" /></a></p>
<p>And there has been even more productivity with regard to Okteta: First external contribution is coming with a new tool <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  More on this soon&#8230;</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/frinring.wordpress.com/529/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/frinring.wordpress.com/529/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/frinring.wordpress.com/529/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/frinring.wordpress.com/529/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/frinring.wordpress.com/529/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/frinring.wordpress.com/529/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/frinring.wordpress.com/529/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/frinring.wordpress.com/529/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/frinring.wordpress.com/529/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/frinring.wordpress.com/529/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=frinring.wordpress.com&blog=251139&post=529&subd=frinring&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://frinring.wordpress.com/2009/10/18/okteta-fighting-the-crisis-with-productivity-from-generators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/99a2c0597f51fc359467492b816edb6d?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">frinring</media:title>
		</media:content>

		<media:content url="http://frinring.files.wordpress.com/2009/10/generators-for-okteta.png?w=300" medium="image">
			<media:title type="html">Data generators for Okteta</media:title>
		</media:content>
	</item>
		<item>
		<title>Tutorial: Add a Checksum/Hashsum Algorithm to Okteta</title>
		<link>http://frinring.wordpress.com/2009/10/14/tutorial-add-a-checksum-hashsum-algorithm-to-okteta/</link>
		<comments>http://frinring.wordpress.com/2009/10/14/tutorial-add-a-checksum-hashsum-algorithm-to-okteta/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 19:29:50 +0000</pubDate>
		<dc:creator>frinring</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Okteta]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://frinring.wordpress.com/?p=502</guid>
		<description><![CDATA[Here comes the second in a row of little tutorials showing how you can yourself add the features you need to Okteta, the KDE 4 hex editor (the first one was about Adding a Binary Filter).
Since KDE 4.3 (resp. Okteta 0.3) Okteta features a tool to calculate a checksum/hashsum from the bytes in the current [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=frinring.wordpress.com&blog=251139&post=502&subd=frinring&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here comes the second in a row of little tutorials showing how you can yourself add the features you need to <a href="http://utils.kde.org/projects/okteta">Okteta</a>, the KDE 4 hex editor (the first one was about <a href="http://frinring.wordpress.com/2009/09/27/tutorial-add-a-binary-filter-to-okteta/">Adding a Binary Filter</a>).</p>
<p>Since KDE 4.3 (resp. Okteta 0.3) Okteta features a tool to calculate a checksum/hashsum from the bytes in the current selection. It comes with some built-in checksum algorithms (Modular sum (8/16/32/64 bit), Adler-32, CRC-32), but for hashsums relies on the <a href="http://delta.affinix.com/qca/">QCA lib (Qt Cryptographic Architecture)</a> (can be SHA-0/1/224/256/384/512, MD2/4/5, RIPEMD-160, Whirlpool, depending on the installed QCA plugins).</p>
<p>Ideally you would write a new hashsum algorithm as a <a href="http://delta.affinix.com/docs/qca/">plugin</a> for the QCA library, so it is available to more programs than just Okteta. But if you want to add another checksum to Okteta, here is your tutorial:</p>
<h3>Setup of the Development Environment</h3>
<p></a></p>
<p>See for the <a href="http://frinring.wordpress.com/2009/09/27/tutorial-add-a-binary-filter-to-okteta/#devenvsetup">instructions</a> in the first tutorial about Binary Filters.</p>
<h3>Adding a Checksum Algorithm</h3>
<p>In this tutorial you write a checksum algorithm which will calculate the parity of all bytes using only a given bit position. It will look like this:<br />
<img src="http://frinring.files.wordpress.com/2009/10/bitparitychecksum.png?w=234&#038;h=197" alt="Bit-Parity checksum" title="Bit-Parity checksum" width="234" height="197" class="alignnone size-full wp-image-522" /><br />
<span id="more-502"></span><br />
To do so you follow the instructions found in <a href="http://websvn.kde.org/trunk/KDE/kdeutils/okteta/kasten/controllers/view/libbytearraychecksum/README.developers?revision=1029894&amp;view=markup">okteta/kasten/controllers/view/libbytearraychecksum/README.developers</a>:</p>
<h4>Step 1: Creating source files</h4>
<p>Commands to get this done:</p>
<blockquote><p><code>cd ../../kdeutils/okteta/kasten/controllers/view/libbytearraychecksum/algorithm/<br />
cp template/template_bytearraychecksumalgorithm.h bitparitybytearraychecksumalgorithm.h<br />
cp template/template_bytearraychecksumalgorithm.cpp bitparitybytearraychecksumalgorithm.cpp</code></p></blockquote>
<h4>Step 2: Adapting the code from the template</h4>
<p>&#8220;bitparitybytearraychecksumalgorithm.h&#8221; should end up like this:</p>
<blockquote><pre>#ifndef BITPARITYBYTEARRAYCHECKSUMALGORITHM_H
#define BITPARITYBYTEARRAYCHECKSUMALGORITHM_H

// lib
#include "nobytearraychecksumparameterset.h"
#include 

class BitParityByteArrayChecksumAlgorithm : public AbstractByteArrayChecksumAlgorithm
{
  public:
    BitParityByteArrayChecksumAlgorithm();

    virtual ~BitParityByteArrayChecksumAlgorithm();

  public: // AbstractByteArrayChecksumAlgorithm API
    virtual bool calculateChecksum( QString* result, const Okteta::AbstractByteArrayModel* model, const Okteta::AddressRange&amp; range ) const;
    virtual AbstractByteArrayChecksumParameterSet* parameterSet();

  protected:
    NoByteArrayChecksumParameterSet mParameterSet;
};

#endif
</pre>
</blockquote>
<p>And the file&#8221;bitparitybytearraychecksumalgorithm.cpp&#8221; should end like this:</p>
<blockquote><pre>#include "bitparitybytearraychecksumalgorithm.h"

// Okteta core
#include
// KDE
#include 

static const int DefaultBitNumber = 1; // using the LSB as default

BitParityByteArrayChecksumAlgorithm::BitParityByteArrayChecksumAlgorithm()
  : AbstractByteArrayChecksumAlgorithm(
     i18nc("name of the checksum algorithm", "Bit Parity") )
{}

AbstractByteArrayChecksumParameterSet* BitParityByteArrayChecksumAlgorithm::parameterSet() { return &#038;mParameterSet; }

bool BitParityByteArrayChecksumAlgorithm::calculateChecksum( QString* result,
                                                           const Okteta::AbstractByteArrayModel* model, const Okteta::AddressRange&amp; range ) const
{
    bool success = true;

    const int bitNumber = DefaultBitNumber;
    const int mask = ( 1 &lt;&lt; bitNumber-1 );

    int sum = 0;

    Okteta::Address nextBlockEnd = range.start() + CalculatedByteCountSignalLimit;
    for( Okteta::Address i = range.start(); ibyte(i) &amp; mask );

        if( i &gt;= nextBlockEnd )
        {
            nextBlockEnd += CalculatedByteCountSignalLimit;
            emit calculatedBytes( range.localIndex(i)+1 );
        }
    }

    *result = QString::fromLatin1("%1").arg( sum );

    return success;
}

BitParityByteArrayChecksumAlgorithm::~BitParityByteArrayChecksumAlgorithm() {}
</pre>
</blockquote>
<h4>Step 3: Adding the filter to the library</h4>
<p>The file &#8220;okteta/kasten/controllers/view/libbytearraychecksum/bytearraychecksumalgorithmfactory.cpp&#8221; should now as both have an include for the file &#8220;algorithm/bitparitybytearraychecksumalgorithm.h&#8221;</p>
<blockquote><pre>
#include "algorithm/bitparitybytearraychecksumalgorithm.h"
</pre>
</blockquote>
<p>as well create an algorithm BitParityByteArrayChecksumAlgorithm:</p>
<blockquote><pre>
    result
        &lt;&lt; new ModSum8ByteArrayChecksumAlgorithm()
        &lt;&lt; new ModSum16ByteArrayChecksumAlgorithm()
        &lt;&lt; new ModSum32ByteArrayChecksumAlgorithm()
        &lt;&lt; new ModSum64ByteArrayChecksumAlgorithm()
        &lt;&lt; new Adler32ByteArrayChecksumAlgorithm()
        &lt;&lt; new Crc32ByteArrayChecksumAlgorithm()
        // new:
        &lt;&lt; new BitParityByteArrayChecksumAlgorithm();
</pre>
</blockquote>
<p>In the file &#8220;okteta/kasten/controllers/CMakeLists.txt&#8221; the list &#8220;LIBCHECKSUM_SRCS&#8221; should now also include the file &#8220;bitparitybytearraychecksumalgorithm.cpp&#8221;:</p>
<blockquote><pre>
  view/libbytearraychecksum/algorithm/modsum16bytearraychecksumalgorithm.cpp
  view/libbytearraychecksum/algorithm/modsum32bytearraychecksumalgorithm.cpp
  view/libbytearraychecksum/algorithm/modsum64bytearraychecksumalgorithm.cpp
# new:
  view/libbytearraychecksum/algorithm/bitparitybytearraychecksumalgorithm.cpp
</pre>
</blockquote>
<h4>Step 4: Compile, install and run</h4>
<p>Commands to get this done:</p>
<blockquote><p><code>cd ../../../../../../../build/<br />
make<br />
make install</code></p></blockquote>
<p>If the build and install went well, start Okteta with <code>yourinstallpath/okteta</code> (cmp. remarks at end of section &#8220;Setup of the development environment&#8221; in the first tutorial, linked above).</p>
<p>Load some file, select a range, open the Checksum tool and select &#8220;Bit Parity&#8221; as algorithm. It should look like this:<br />
<a href="http://frinring.files.wordpress.com/2009/10/bitparitychecksum-before.png"><img src="http://frinring.files.wordpress.com/2009/10/bitparitychecksum-before.png?w=300&#038;h=230" alt="Bit-Parity checksum before being applied" title="Bit-Parity checksum before being applied" width="300" height="230" class="alignnone size-medium wp-image-512" /></a></p>
<p>Now press the &#8220;Calculate&#8221; button. It should look like this:<br />
<a href="http://frinring.files.wordpress.com/2009/10/bitparitychecksum-after.png"><img src="http://frinring.files.wordpress.com/2009/10/bitparitychecksum-after.png?w=300&#038;h=230" alt="Bit-Parity checksum after being applied" title="Bit-Parity checksum after being applied" width="300" height="230" class="alignnone size-medium wp-image-513" /></a></p>
<p>Now let&#8217;s turn to&#8230;</p>
<h3>Making the used Bit an editable Parameter</h3>
<h4>Step 1: Creating source files</h4>
<p>Commands to get this done:</p>
<blockquote><p><code>cd ../kdeutils/okteta/kasten/controllers/view/libbytearraychecksum/algorithm/<br />
cp template/template_bytearraychecksumparameterset.h bitparitybytearraychecksumparameterset.h<br />
cp template/template_bytearraychecksumparameterset.cpp bitparitybytearraychecksumparameterset.cpp<br />
cp template/template_bytearraychecksumparametersetedit.h bitparitybytearraychecksumparametersetedit.h<br />
cp template/template_bytearraychecksumparametersetedit.cpp bitparitybytearraychecksumparametersetedit.cpp</code></p></blockquote>
<h4>Step 2: Adapting the code from the template</h4>
<p>&#8220;bitparitybytearraychecksumparameterset.h&#8221; should end up like this:</p>
<blockquote><pre>#ifndef BITPARITYBYTEARRAYCHECKSUMPARAMETERSET_H
#define BITPARITYBYTEARRAYCHECKSUMPARAMETERSET_H

// lib
#include "abstractbytearraychecksumparameterset.h"

class BitParityByteArrayChecksumParameterSet : public AbstractByteArrayChecksumParameterSet
{
  public:
    BitParityByteArrayChecksumParameterSet();

    virtual ~BitParityByteArrayChecksumParameterSet();

  public: // AbstractByteArrayChecksumParameterSet API
    virtual const char* id() const;

  public: // getters
    int bitNumber() const;

  public: // setters
    void setBitNumber( int bitNumber );

  protected: // parameters
    int mBitNumber;
};

#endif</pre>
</blockquote>
<p>&#8220;bitparitybytearraychecksumparameterset.cpp&#8221; should end up like this:</p>
<blockquote><pre>#include "bitparitybytearraychecksumparameterset.h"

static const int DefaultBitNumber = 1;

BitParityByteArrayChecksumParameterSet::BitParityByteArrayChecksumParameterSet()
  : mBitNumber( DefaultBitNumber )
{}

const char* BitParityByteArrayChecksumParameterSet::id() const { return "BitParity"; }

int BitParityByteArrayChecksumParameterSet::bitNumber() const { return mBitNumber; }

void BitParityByteArrayChecksumParameterSet::setBitNumber( int bitNumber ) { mBitNumber = bitNumber; }

BitParityByteArrayChecksumParameterSet::~BitParityByteArrayChecksumParameterSet() {}</pre>
</blockquote>
<p>&#8220;bitparitybytearraychecksumparametersetedit.h&#8221; should end up like this:</p>
<blockquote><pre>#ifndef BITPARITYBYTEARRAYCHECKSUMPARAMETERSETEDIT_H
#define BITPARITYBYTEARRAYCHECKSUMPARAMETERSETEDIT_H

// lib
#include "abstractbytearraychecksumparametersetedit.h"

class KIntNumInput;

class BitParityByteArrayChecksumParameterSetEdit : public AbstractByteArrayChecksumParameterSetEdit
{
  Q_OBJECT

  public:
    static const char* const Id;

  public:
    BitParityByteArrayChecksumParameterSetEdit( QWidget* parent = 0 );

    virtual ~BitParityByteArrayChecksumParameterSetEdit();

  public: // AbstractByteArrayFilterParameterSetEdit API
    virtual void setParameterSet( const AbstractByteArrayChecksumParameterSet* parameterSet );
    virtual void getParameterSet( AbstractByteArrayChecksumParameterSet* parameterSet ) const;
    virtual bool isValid() const;

  protected Q_SLOTS:
    void onBitNumberChanged( int value );

  protected:
    KIntNumInput* mBitNumberEdit;

    bool mIsValid :1;
};

#endif</pre>
</blockquote>
<p>&#8220;bitparitybytearraychecksumparametersetedit.cpp&#8221; should end up like this:</p>
<blockquote><pre>#include "bitparitybytearraychecksumparametersetedit.h"

// parameterset
#include "bitparitybytearraychecksumparameterset.h"
// KDE
#include
#include
// Qt
#include 

const char* const BitParityByteArrayChecksumParameterSetEdit::Id = "BitParity";

BitParityByteArrayChecksumParameterSetEdit::BitParityByteArrayChecksumParameterSetEdit( QWidget* parent )
  : AbstractByteArrayChecksumParameterSetEdit( parent )
{
    QFormLayout* baseLayout = new QFormLayout( this );
    // margin is provided by the container for this widget
    baseLayout-&gt;setMargin( 0 );

    mBitNumberEdit = new KIntNumInput( this );
    // For demonstration purpose we start at 0, not 1, to show handling of an invalid state
    // Otherwise the range should start at 1 and there is no need to connect to the valueChanged signal
    mBitNumberEdit-&gt;setRange( 0, 8 );
    // start with the invalid number
    mBitNumberEdit-&gt;setValue( 0 );
    connect( mBitNumberEdit, SIGNAL(valueChanged( int )), SLOT(onBitNumberChanged( int )) );

    const QString levelLabelText =
         i18nc( "@label:spinbox number of the bit to use",
                "Number of bit:" );
    const QString levelToolTip =
        i18nc( "@info:tooltip",
               "The number of the bit to use for the parity calculation. 1 means the LSB, 8 the MSB." );
    mBitNumberEdit-&gt;setToolTip( levelToolTip );
    const QString levelWhatsThis =
        i18nc( "@info:whatsthis",
               "Select the bit which should be used for the parity calculation. And more explanation." );
    mBitNumberEdit-&gt;setWhatsThis( levelWhatsThis );

    baseLayout-&gt;addRow( levelLabelText, mBitNumberEdit );

    // note start state
    mIsValid = isValid();
}

bool BitParityByteArrayChecksumParameterSetEdit::isValid() const { return mBitNumberEdit-&gt;value() != 0; }

void BitParityByteArrayChecksumParameterSetEdit::setParameterSet( const AbstractByteArrayChecksumParameterSet* parameterSet )
{
    const BitParityByteArrayChecksumParameterSet* template_ParameterSet =
        static_cast( parameterSet );

    mBitNumberEdit-&gt;setValue( template_ParameterSet-&gt;bitNumber() );
}

void BitParityByteArrayChecksumParameterSetEdit::getParameterSet( AbstractByteArrayChecksumParameterSet* parameterSet ) const
{
    BitParityByteArrayChecksumParameterSet* template_ParameterSet =
        static_cast( parameterSet );

    template_ParameterSet-&gt;setBitNumber( mBitNumberEdit-&gt;value() );
}

void BitParityByteArrayChecksumParameterSetEdit::onBitNumberChanged( int value )
{
    const bool isValid = ( value != 0 );

    if( mIsValid == isValid )
        return;

    mIsValid = isValid;
    emit validityChanged( isValid );
}

BitParityByteArrayChecksumParameterSetEdit::~BitParityByteArrayChecksumParameterSetEdit() {}</pre>
</blockquote>
<p>Also make the &#8220;BitParityByteArrayChecksumAlgorithm&#8221; use the &#8220;BitParityByteArrayChecksumParameterSet&#8221;, by adapting the include notion and the used parameter set class in the file &#8220;bitparitybytearraychecksumalgorithm.h&#8221; to now be:</p>
<blockquote><pre>
#include "bitparitybytearraychecksumparameterset.h"
</pre>
</blockquote>
<blockquote><pre>
    BitParityByteArrayChecksumParameterSet mParameterSet;
</pre>
</blockquote>
<p>In the file &#8220;bitparitybytearraychecksumalgorithm.cpp&#8221; change the variable &#8220;bitNumber&#8221; to be not the hardcoded 1, but to take its value from the parameter set:</p>
<blockquote><pre>
    const int bitNumber = mParameterSet.bitNumber();
</pre>
</blockquote>
<h4>Step 3: Adding the parameterset to the library</h4>
<p>The file &#8220;okteta/kasten/controllers/view/libbytearraychecksum/bytearraychecksumparameterseteditfactory.cpp&#8221; should now both have an include for the file &#8220;algorithm/bitparitybytearraychecksumparametersetedit.h&#8221;</p>
<blockquote><pre>
#include "algorithm/bitparitybytearraychecksumparametersetedit.h"
</pre>
</blockquote>
<p>as well as create a widget &#8220;BitParityByteArrayChecksumParameterSetEdit&#8221; for the &#8220;BitParityByteArrayChecksumParameterSetEdit::Id&#8221;:</p>
<blockquote><pre>
[...]
    if( qstrcmp(id,ModSumByteArrayChecksumParameterSetEdit::Id) == 0 )
        result = new ModSumByteArrayChecksumParameterSetEdit();
// new:
    else if( qstrcmp(id,BitParityByteArrayChecksumParameterSetEdit::Id) == 0 )
        result = new BitParityByteArrayChecksumParameterSetEdit();
[...]
</pre>
</blockquote>
<p>In the file &#8220;okteta/kasten/controllers/CMakeLists.txt&#8221; the list &#8220;LIBCHECKSUM_SRCS&#8221; should now also include the files &#8220;bitparitybytearraychecksumparameterset.cpp&#8221; and &#8220;bitparitybytearraychecksumparametersetedit.cpp&#8221;:</p>
<blockquote><pre>
[...]
  view/libbytearraychecksum/algorithm/modsumbytearraychecksumparameterset.cpp
  view/libbytearraychecksum/algorithm/modsumbytearraychecksumparametersetedit.cpp
# new:
  view/libbytearraychecksum/algorithm/bitparitybytearraychecksumparameterset.cpp
  view/libbytearraychecksum/algorithm/bitparitybytearraychecksumparametersetedit.cpp
[...]
</pre>
</blockquote>
<h4>Step 4: Compile, install and run</h4>
<p>Commands to get this done:</p>
<blockquote><p><code>cd ../../../../../../../build/<br />
make<br />
make install</code>
</p></blockquote>
<p>Running Okteta now should get you this:<br />
<a href="http://frinring.files.wordpress.com/2009/10/bitparitychecksum-with-parameter-after.png"><img src="http://frinring.files.wordpress.com/2009/10/bitparitychecksum-with-parameter-after.png?w=300&#038;h=230" alt="Bit-parity checksum with parameter after being applied" title="Bit-parity checksum with parameter after being applied" width="300" height="230" class="alignnone size-medium wp-image-521" /></a></p>
<p>It did? Great <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Now, please go and write your own special checksum algorithms! Then share your work and send them to me for inclusion in the next Okteta release <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Next tutorial possibly will be: Add an Encoder (used for export of bytes to other formats, for clipboard and file).</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/frinring.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/frinring.wordpress.com/502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/frinring.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/frinring.wordpress.com/502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/frinring.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/frinring.wordpress.com/502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/frinring.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/frinring.wordpress.com/502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/frinring.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/frinring.wordpress.com/502/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=frinring.wordpress.com&blog=251139&post=502&subd=frinring&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://frinring.wordpress.com/2009/10/14/tutorial-add-a-checksum-hashsum-algorithm-to-okteta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/99a2c0597f51fc359467492b816edb6d?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">frinring</media:title>
		</media:content>

		<media:content url="http://frinring.files.wordpress.com/2009/10/bitparitychecksum.png" medium="image">
			<media:title type="html">Bit-Parity checksum</media:title>
		</media:content>

		<media:content url="http://frinring.files.wordpress.com/2009/10/bitparitychecksum-before.png?w=300" medium="image">
			<media:title type="html">Bit-Parity checksum before being applied</media:title>
		</media:content>

		<media:content url="http://frinring.files.wordpress.com/2009/10/bitparitychecksum-after.png?w=300" medium="image">
			<media:title type="html">Bit-Parity checksum after being applied</media:title>
		</media:content>

		<media:content url="http://frinring.files.wordpress.com/2009/10/bitparitychecksum-with-parameter-after.png?w=300" medium="image">
			<media:title type="html">Bit-parity checksum with parameter after being applied</media:title>
		</media:content>
	</item>
		<item>
		<title>UPnP devices coming to the network:/ kioslave</title>
		<link>http://frinring.wordpress.com/2009/10/13/upnp-devices-coming-to-the-network-kioslave/</link>
		<comments>http://frinring.wordpress.com/2009/10/13/upnp-devices-coming-to-the-network-kioslave/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 21:48:50 +0000</pubDate>
		<dc:creator>frinring</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[UPnP]]></category>

		<guid isPermaLink="false">http://frinring.wordpress.com/?p=482</guid>
		<description><![CDATA[Since the Coherence/KDE sprint (Spain, 26 °C, sun), where work was done for some UPnP bindings for KDE, a week has passed (Germany, 4 °C, rain/hail). Besides the weather some other things have changed that week, too, but for the good  
While on Day 1 of the sprint I already managed to have first [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=frinring.wordpress.com&blog=251139&post=482&subd=frinring&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Since the Coherence/KDE sprint (Spain, 26 °C, sun), where work was done for some UPnP bindings for KDE, a week has passed (Germany, 4 °C, rain/hail). Besides the weather some other things have changed that week, too, but for the good <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>While on <a href="http://frinring.wordpress.com/2009/10/04/coherencekde-sprint-day-1/">Day 1</a> of the sprint I already managed to have first UPnP devices show up in the <a href="http://frinring.wordpress.com/2009/04/20/network-kioslave-entered-kdereview/">network:/ kioslave</a>, it was done with hacky prototype code, to have some things working to start from. <a href="http://frinring.wordpress.com/2009/10/09/coherencekde-sprint-day-2/">Day 2</a> didn&#8217;t change much in that regard. </p>
<p>The days since then Frank Scholz, the main developer of Coherence, has been very supportive and has continued adding needed features to the D-Bus API, and I have hammered a little more onto the code for the UPnP backend to the network:/ kioslave. To much success! UPnP devices are now coming and going in the network:/ listing, matching the real devices&#8217; behaviour, with proper name and type.</p>
<p>All that is missing to my full pleasure is the usage of each UPnP device&#8217;s custom icon (So if you know how to set custom icons (i.e. not by name, but delivered from remote, cmp. favicons) for UDSEntries in a kioslave, please tell me!). And forwarding to the presentation url of the UPnP device, if available, but that looks like it needs some discussions with the KIO developers, because of the &#8220;abuse&#8221; of KIO for the network:/ kioslave.</p>
<p>No screenshot today, if you are interested please try it yourself:<br />
The UPnP backend for the network:/ kioslave is based on the utility libkupnp which cares for the wrapping of the D-Bus connection to Coherence. So fetch both<br />
libkupnp at<br />
        http://websvn.kde.org/trunk/playground/network/kupnp/<br />
and the UPnP backend at<br />
        http://websvn.kde.org/branches/work/network-kioslave/adding-upnp-backend/<br />
and compile as usual.</p>
<p>You also need a current version (&gt;=#1440) from trunk of <a href="http://coherence-project.org/">Coherence</a>:</p>
<pre><code>svn co https://coherence.beebits.net/svn/trunk/Coherence
sudo python ./setup.py install
</pre>
<p></code>(No idea how to install Coherence to a user-only prefix, hints welcome!)</p>
<p>If you are interested in Bart's work on UPnP support for Amarok, do not miss his <a href="http://commonideas.blogspot.com/2009/10/kioupnp.html">last blog entry</a> (which seems to have missed planet KDE).</p>
<p>The coming weeks I will see if libkupnp can be extended to be useful for other code interacting with UPnP devices (at least from a UPnP control point's view). For a start I will try a InternetGatewayDevice proxy class, which could be used by programs wanting NAT traversal (Konversation and KTorrent already have some custom implementation, but this could help others). Next would be a MediaServer proxy class, perhaps that could simplify Bart's upnp:/ kioslave.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/frinring.wordpress.com/482/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/frinring.wordpress.com/482/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/frinring.wordpress.com/482/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/frinring.wordpress.com/482/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/frinring.wordpress.com/482/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/frinring.wordpress.com/482/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/frinring.wordpress.com/482/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/frinring.wordpress.com/482/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/frinring.wordpress.com/482/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/frinring.wordpress.com/482/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=frinring.wordpress.com&blog=251139&post=482&subd=frinring&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://frinring.wordpress.com/2009/10/13/upnp-devices-coming-to-the-network-kioslave/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/99a2c0597f51fc359467492b816edb6d?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">frinring</media:title>
		</media:content>
	</item>
		<item>
		<title>Coherence/KDE sprint Day 2</title>
		<link>http://frinring.wordpress.com/2009/10/09/coherencekde-sprint-day-2/</link>
		<comments>http://frinring.wordpress.com/2009/10/09/coherencekde-sprint-day-2/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 14:12:13 +0000</pubDate>
		<dc:creator>frinring</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[UPnP]]></category>

		<guid isPermaLink="false">http://frinring.wordpress.com/?p=470</guid>
		<description><![CDATA[Exactly one week already has passed since I arrived in Barcelona for the Coherence/KDE sprint, and almost four days since I left again, so before it is out-of-date here a short summary of Day 2 (see also Day 1 for some introduction):
Everyone continued hacking on his stuff, e.g. Bart on his kioslave for UPnP MediaCollections, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=frinring.wordpress.com&blog=251139&post=470&subd=frinring&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Exactly one week already has passed since I arrived in Barcelona for the Coherence/KDE sprint, and almost four days since I left again, so before it is out-of-date here a short summary of Day 2 (see also <a href="http://frinring.wordpress.com/2009/10/04/coherencekde-sprint-day-1/">Day 1</a> for some introduction):</p>
<p>Everyone continued hacking on his stuff, e.g. Bart on his kioslave for UPnP MediaCollections, to be used especially by Amarok, and me on the UPnP backend for the network:/ kioslave. Which also involved discussions with Frank about shaping the D-Bus API of Coherence to our needs a little. And how to merge best the UPnP device/service model and objects into the network classes model of the base library of the network:/ kioslave, along with the ones from DNSSD and Co. This merging needs more thoughts definitely.</p>
<p>Lunch was cared for by our host Edward Hervey from Collabora Multimedia leading us to another non-tourist restaurant with good food and local atmosphere.</p>
<p>Other stuff that day was done was demoing the things now working, like the Coherence plugin for the Spykee robot delivering pictures from its built-in webcam via UPnP. Or things that have been working for a while, like each one playing his favourite songs via UPnP on Frank&#8217;s computer, in a kind of battle style. Including controlling the volume from remote.</p>
<div id="attachment_471" class="wp-caption alignnone" style="width: 310px"><a href="http://frinring.files.wordpress.com/2009/10/frank-with-k-scarf.jpg"><img src="http://frinring.files.wordpress.com/2009/10/frank-with-k-scarf.jpg?w=300&#038;h=225" alt="Zaheer, Konqui and me looking what Frank does that makes him wear the K-scarf this way" title="Frank with K-scarf" width="300" height="225" class="size-medium wp-image-471" /></a><p class="wp-caption-text">Zaheer, Konqui and me looking what Frank does that makes him wear the K-scarf this way</p></div>
<p>In some way Coherence is to UPnP what <a href="http://avahi.org/"> Avahi</a> is to DNS-SD, a demon wrapping the specific system and making it accessible via D-Bus. Just that Coherence does a lot more, as UPnP is not only about discovery of services, but also of types of devices and the interfaces/services they implement and how to access them.</p>
<p>As the developers of Coherence are using GNOME-centric desktops the current desktop integration is basically done for GNOME programs, like <a href="http://coherence-project.org/wiki/Totem">Totem</a>, <a href="http://coherence-project.org/wiki/RhythmBox">Rhythmbox</a>, and <a href="http://coherence-project.org/wiki/Nautilus">Nautilus</a>.</p>
<p>Let&#8217;s hope KDE-Libs based programs can catch up to these <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  This was the very purpose of this sprint, and it gave a good foundation. It just left us with quite some work to do. Especially Bart might appreciate help with his kioslave, as he is short on time. So if you want Amarok to as well access other UPnP MediaCollections as well as export it&#8217;s own collection as such in the next time, get in contact with him.</p>
<p>I think I might be able to get the integration into the network:/ kioslave done in October (promises, what promises?). Surely there will be the need for feedback. So please stay tuned, more detailed info about approach and progress to follow&#8230;</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/frinring.wordpress.com/470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/frinring.wordpress.com/470/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/frinring.wordpress.com/470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/frinring.wordpress.com/470/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/frinring.wordpress.com/470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/frinring.wordpress.com/470/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/frinring.wordpress.com/470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/frinring.wordpress.com/470/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/frinring.wordpress.com/470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/frinring.wordpress.com/470/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=frinring.wordpress.com&blog=251139&post=470&subd=frinring&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://frinring.wordpress.com/2009/10/09/coherencekde-sprint-day-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/99a2c0597f51fc359467492b816edb6d?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">frinring</media:title>
		</media:content>

		<media:content url="http://frinring.files.wordpress.com/2009/10/frank-with-k-scarf.jpg?w=300" medium="image">
			<media:title type="html">Frank with K-scarf</media:title>
		</media:content>
	</item>
		<item>
		<title>Coherence/KDE sprint Day 1</title>
		<link>http://frinring.wordpress.com/2009/10/04/coherencekde-sprint-day-1/</link>
		<comments>http://frinring.wordpress.com/2009/10/04/coherencekde-sprint-day-1/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 10:30:32 +0000</pubDate>
		<dc:creator>frinring</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[UPnP]]></category>

		<guid isPermaLink="false">http://frinring.wordpress.com/?p=458</guid>
		<description><![CDATA[Big splash for yesterday evening: &#8220;Breakthrough in the hotel!&#8221;
Barcelona, wonderful city. Crowded with a lot of people, enjoying the life style and atmosphere. This weekend there are six people more, but here for hard work, to do some collaboration on UPnP support in FLOSS software. So is there a better place to stay at then [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=frinring.wordpress.com&blog=251139&post=458&subd=frinring&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Big splash for yesterday evening: &#8220;Breakthrough in the hotel!&#8221;</p>
<p>Barcelona, wonderful city. Crowded with a lot of people, enjoying the life style and atmosphere. This weekend there are six people more, but here for hard work, to do some collaboration on UPnP support in FLOSS software. So is there a better place to stay at then the Collabora Multimedia office here in Barcelona?</p>
<p>Together with Bart Cerneels, from the <a href="http://amarok.kde.org/">Amarok</a> crowd and to most of us known as the <a href="http://static.kdenews.org/jr/akademy-2008-bart.jpg">great organizer</a> of Akademy 2008, I am here to write code to connect to the UPnP world, by using <a href="http://coherence-project.org/">Coherence</a>. If you haven&#8217;t already heard of Coherence before, it is an well developed UPnP-enabling framework, written in Python and accessible via D-Bus by any other program, hiding the UPnP complexity both to the providers and the consumers of UPnP services.<br />
So e.g. Amarok could easily offer access to its own media collections for any UPnP capable client on the network as well as access those of others, at the same time control any other player in the network (MediaRenderer in UPnP terms).<br />
And it is also a comfortable way to add a UPnP backend to the <a href="http://frinring.wordpress.com/2009/04/20/network-kioslave-entered-kdereview/">network:/ kioslave</a>, so the UPnP-only devices and their services are also listed there. I was hoping someone else was going to do this, but, well, scratch your itch&#8230;</p>
<p>Still it feels like boring work to do compared to what some others sitting at the table with us are doing: There is Philippe Normand who is working on <a href="http://base-art.net/Articles/108/">tubing UPnP over the intertubes</a> with the Mirabeau plugin to Coherence. And there is Zaheer Abbas Merali, who is wrapping <a href="http://zaheer.merali.org/articles/2009/07/20/spykee-over-upnp/">standard UPnP services around little next-generation-mars^W indoor robots</a>, so you can access the robot with any standard UPnP client (like the PS3, PSP or XBox). Then there is Sebastian Pölsterl who works to build a UPnP supporting personal video recorder (PVR) based on his DVB-Daemon.<br />
Last but not least with us are Frank Scholz, the founder and main developer of Coherence, and Benjamin Kampmann, official vice-president of marketing for Coherence.</p>
<p>I had a quick start with the code Adriaan de Groot had written at the first Coherence/KDE sprint in Paris this spring. Still I had nothing to show when we left the office in the evening. But when most of us went to spend much money to watch 22 men catch a single ball, just to kick it away again, Bart and I waited for them in the hotel, typing even more code and then, the breakthrough, at least for me:</p>
<p>And it comes with congrats to Ahmed Moustaf! His computer was the first to appear in the network:/ kioslave by being feeded from the Coherence-driven UPnP backend. Sitting in the hotel room I had no longer all the devices available like we have with us in the Collabora office, but another friendly, although unknown person had his computer broadcasting his UPnP services, so there was content. You won&#8217;t see from the documenting screenshot it is from the UPnP, as that is one of the targets of the network:/ kioslave, hiding all the unneeded technical details from the user. And his computer disappeared soon after when I wanted to screenshot some UPnP only listing, was it because we started to browse his media collection and he found out?* <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  So just believe it <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<a href="http://frinring.files.wordpress.com/2009/10/firstupnpdrivennetworkdevice.png"><img src="http://frinring.files.wordpress.com/2009/10/firstupnpdrivennetworkdevice.png?w=300&#038;h=219" alt="First device in network:/ kioslave delivered by the UPnP backend" title="First device in network:/ kioslave delivered by the UPnP backend" width="300" height="219" class="alignnone size-medium wp-image-460" /></a></p>
<p>*Because if there is one thing which seems to suck with UPnP it is the lack of any access control built into the system. Everybody can access everything. Well, hopefully soon KDE programs can, too <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/frinring.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/frinring.wordpress.com/458/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/frinring.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/frinring.wordpress.com/458/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/frinring.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/frinring.wordpress.com/458/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/frinring.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/frinring.wordpress.com/458/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/frinring.wordpress.com/458/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/frinring.wordpress.com/458/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=frinring.wordpress.com&blog=251139&post=458&subd=frinring&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://frinring.wordpress.com/2009/10/04/coherencekde-sprint-day-1/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/99a2c0597f51fc359467492b816edb6d?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">frinring</media:title>
		</media:content>

		<media:content url="http://frinring.files.wordpress.com/2009/10/firstupnpdrivennetworkdevice.png?w=300" medium="image">
			<media:title type="html">First device in network:/ kioslave delivered by the UPnP backend</media:title>
		</media:content>
	</item>
		<item>
		<title>Being Wow&#8217;ed by FLOSS, again</title>
		<link>http://frinring.wordpress.com/2009/09/27/being-wowed-by-floss-again/</link>
		<comments>http://frinring.wordpress.com/2009/09/27/being-wowed-by-floss-again/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 19:45:45 +0000</pubDate>
		<dc:creator>frinring</dc:creator>
				<category><![CDATA[KDE]]></category>

		<guid isPermaLink="false">http://frinring.wordpress.com/?p=447</guid>
		<description><![CDATA[Lydia Pintscher* has written a nice summary about the results of this year&#8217;s Google Summer of Code for KDE. I think it&#8217;s really amazing what has been done. KDE 3 seems so simple and old compared to this.
Or is it just the Oxygen look which makes it look so elaborated?  
* I have heard [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=frinring.wordpress.com&blog=251139&post=447&subd=frinring&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Lydia Pintscher* has written <a href="http://dot.kde.org/2009/09/26/what-i-did-my-summer-holiday">a nice summary</a> about the results of this year&#8217;s Google Summer of Code for KDE. I think it&#8217;s really amazing what has been done. KDE 3 seems so simple and old compared to this.</p>
<p>Or is it just the Oxygen look which makes it look so elaborated? <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>* I have heard some think there are too few women doing FLOSS stuff. Seems, at least by looking at this weekend&#8217;s blog posts on Planet KDE, KDE is doing well and seems a good place not only for small and large, young and old, but also female and male humans. Much better obviously than the BMX community at the BMX ground in my neighbourhood, where when I passed this evening the only two female humans were two mothers waiting while there small boys where doing their jumping. Perhaps they can learn from us? <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/frinring.wordpress.com/447/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/frinring.wordpress.com/447/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/frinring.wordpress.com/447/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/frinring.wordpress.com/447/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/frinring.wordpress.com/447/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/frinring.wordpress.com/447/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/frinring.wordpress.com/447/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/frinring.wordpress.com/447/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/frinring.wordpress.com/447/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/frinring.wordpress.com/447/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=frinring.wordpress.com&blog=251139&post=447&subd=frinring&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://frinring.wordpress.com/2009/09/27/being-wowed-by-floss-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/99a2c0597f51fc359467492b816edb6d?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">frinring</media:title>
		</media:content>
	</item>
		<item>
		<title>Tutorial: Add a Binary Filter to Okteta</title>
		<link>http://frinring.wordpress.com/2009/09/27/tutorial-add-a-binary-filter-to-okteta/</link>
		<comments>http://frinring.wordpress.com/2009/09/27/tutorial-add-a-binary-filter-to-okteta/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 11:21:47 +0000</pubDate>
		<dc:creator>frinring</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Okteta]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://frinring.wordpress.com/?p=409</guid>
		<description><![CDATA[Welcome to the first in hopefully a row of little tutorials showing how you can yourself add the features you need to Okteta, the KDE 4 hex editor.
Although, after writing this one, which took way too much time, I will see how I can make this more economic for me.
For now, you simply have to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=frinring.wordpress.com&blog=251139&post=409&subd=frinring&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Welcome to the first in hopefully a row of little tutorials showing how you can yourself add the features you need to <a href="http://utils.kde.org/projects/okteta">Okteta</a>, the KDE 4 hex editor.<br />
Although, after writing this one, which took way too much time, I will see how I can make this more economic for me.<br />
For now, you simply have to make use of this tutorial, so my time was well spent! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a name="devenvsetup"></p>
<h3>Setup of the development environment</h3>
<p></a><br />
Unless you already have a development environment, including the sources of kdeutils, e.g. after following the <a href="http://techbase.kde.org/Getting_Started">instructions</a> from TechBase, the following little setup should work for you, too:</p>
<p>You need to have installed a proper compiler, cmake, a subversion client and the development packages of qt4 and kdelibs4. You might not need the kdelibs from trunk, version 4.3, perhaps even 4.2 should do it, I do not remember to have used any newer kdelibs API in Okteta so far. (Please report if you experience problems.)</p>
<p>Now get the sources of Okteta:</p>
<blockquote><p><code>svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdeutils -N<br />
svn up kdeutils/okteta</code></p></blockquote>
<p>Build the program in a separate directory (replace &#8220;yourinstallpath&#8221; with a proper path as useful for personal development, e.g. the output of <code>kde4-config --prefix</code>):</p>
<blockquote><p><code>mkdir build<br />
cd build<br />
cmake -DCMAKE_INSTALL_PREFIX=yourinstallpath ../kdeutils<br />
cd okteta<br />
make</code></p></blockquote>
<p>The build will take a while as all those files you just saw when doing the checkout want to get compiled&#8230;</p>
<p>Do a <code>make install</code> to see if the installation works, too.<br />
Then testrun Okteta with <code>yourinstallpath/okteta</code>.<br />
(Or just <code>okteta</code> if you are sure your shell does not outsmart you and instead starts okteta from a path it has cached from a previous start when this version of Okteta was not yet installed)</p>
<p>Hoping that all went smooth we can now turn to&#8230;</p>
<h3>Adding a Binary Filter</h3>
<p>In this tutorial you write a filter which will turn all bytes either to 0&#215;00 or 0xFF, depending on whether their old value is below or above a given level. It will look like this:<br />
<img src="http://frinring.files.wordpress.com/2009/09/levelfilter.png?w=283&#038;h=196" alt="Level Filter" title="Level Filter" width="283" height="196" class="alignnone size-full wp-image-423" /><br />
<span id="more-409"></span><br />
To do so you follow the instructions found in <a href="http://websvn.kde.org/trunk/KDE/kdeutils/okteta/kasten/controllers/view/libbytearrayfilter/README.developers?revision=1028203&amp;view=markup">okteta/kasten/controllers/view/libbytearrayfilter/README.developers</a>:</p>
<h4>Step 1: Creating source files</h4>
<p>Commands to get this done:</p>
<blockquote><p><code>cd ../../kdeutils/okteta/kasten/controllers/view/libbytearrayfilter/filter/<br />
cp template/template_bytearrayfilter.h levelbytearrayfilter.h<br />
cp template/template_bytearrayfilter.cpp levelbytearrayfilter.cpp</code></p></blockquote>
<h4>Step 2: Adapting the code from the template</h4>
<p>&#8220;levelbytearrayfilter.h&#8221; should end up like this:</p>
<blockquote><pre>#ifndef LEVELBYTEARRAYFILTER_H
#define LEVELBYTEARRAYFILTER_H

// lib
#include "nobytearrayfilterparameterset.h"
#include [abstractbytearrayfilter.h]

class LevelByteArrayFilter : public AbstractByteArrayFilter
{
  public:
    LevelByteArrayFilter();

    virtual ~LevelByteArrayFilter();

  public: // AbstractByteArrayFilter API
    virtual bool filter( Okteta::Byte* result, Okteta::AbstractByteArrayModel* model, const Okteta::AddressRange&amp; range ) const;
    virtual AbstractByteArrayFilterParameterSet* parameterSet();

  protected:
    NoByteArrayFilterParameterSet mParameterSet;
};

#endif</pre>
</blockquote>
<p>And the file &#8220;levelbytearrayfilter.cpp&#8221; should end like this:</p>
<blockquote><pre>#include "levelbytearrayfilter.h"

// Okteta core
#include [abstractbytearraymodel.h]
// KDE
#include [KLocale]

LevelByteArrayFilter::LevelByteArrayFilter()
  : AbstractByteArrayFilter(
        i18nc("name of the filter; sets the byte to 0 or 255, depending on a level",
              "LEVEL data") )
{}

AbstractByteArrayFilterParameterSet* LevelByteArrayFilter::parameterSet() { return &#038;mParameterSet; }

bool LevelByteArrayFilter::filter( Okteta::Byte* result,
                                       Okteta::AbstractByteArrayModel* model, const Okteta::AddressRange&amp; range ) const
{
    const unsigned int level = 127;

    int r = 0;
    Okteta::Address m = range.start();
    int nextBlockEnd = FilteredByteCountSignalLimit;
    while( m byte( m++ );
        const Okteta::Byte resultByte = ( byte &gt; level ) ? 255 : 0;
        result[r++] = resultByte;

        if( r &gt;= nextBlockEnd )
        {
            nextBlockEnd += FilteredByteCountSignalLimit;
            emit filteredBytes( r );
        }
    }

    return true;
}

LevelByteArrayFilter::~LevelByteArrayFilter() {}</pre>
</blockquote>
<h4>Step 3: Adding the filter to the library</h4>
<p>The file &#8220;okteta/kasten/controllers/view/libbytearrayfilter/bytearrayfilterfactory.cpp&#8221; should now as both have an include for the file &#8220;filter/levelbytearrayfilter.h&#8221;</p>
<blockquote><pre>
#include "filter/levelbytearrayfilter.h"
</pre>
</blockquote>
<p>as well create a filter &#8220;LevelByteArrayFilter&#8221;</p>
<blockquote><pre>
    result
        &lt;&lt; new AndByteArrayFilter()
        &lt;&lt; new OrByteArrayFilter()
        &lt;&lt; new XOrByteArrayFilter()
        &lt;&lt; new InvertByteArrayFilter()
        &lt;&lt; new ReverseByteArrayFilter()
        &lt;&lt; new RotateByteArrayFilter()
        &lt;&lt; new ShiftByteArrayFilter()
        // new:
        &lt;&lt; new LevelByteArrayFilter();
</pre>
</blockquote>
<p>In the file &#8220;okteta/kasten/controllers/CMakeLists.txt&#8221; the list &#8220;LIBFILTER_SRCS&#8221; should now also include the file &#8220;levelbytearrayfilter.cpp&#8221;:</p>
<blockquote><pre>
  view/libbytearrayfilter/filter/reversebytearrayfilter.cpp
  view/libbytearrayfilter/filter/rotatebytearrayfilter.cpp
  view/libbytearrayfilter/filter/shiftbytearrayfilter.cpp
# new:
  view/libbytearrayfilter/filter/levelbytearrayfilter.cpp
</pre>
</blockquote>
<h4>Step 4: Compile, install and run</h4>
<p>Commands to get this done:</p>
<blockquote><p><code>cd ../../../../../../../build/<br />
make<br />
make install</code></p></blockquote>
<p>If the build and install went well, start Okteta with <code>yourinstallpath/okteta</code> (cmp. remarks at end of section &#8220;Setup of the development environment&#8221; above).</p>
<p>Load some file, select a range, open the Binary Filter tool and select &#8220;LEVEL data&#8221; as filter. It should look like this:<br />
<a href="http://frinring.files.wordpress.com/2009/09/levelfilter-before.png"><img src="http://frinring.files.wordpress.com/2009/09/levelfilter-before.png?w=300&#038;h=215" alt="Level Filter before being applied" title="Level Filter before being applied" width="300" height="215" class="alignnone size-medium wp-image-420" /></a></p>
<p>Now press the &#8220;Filter&#8221; button. It should look like this:<br />
<a href="http://frinring.files.wordpress.com/2009/09/levelfilter-after.png"><img src="http://frinring.files.wordpress.com/2009/09/levelfilter-after.png?w=300&#038;h=215" alt="Level Filter after being applied" title="Level Filter after being applied" width="300" height="215" class="alignnone size-medium wp-image-421" /></a></p>
<p>Now let&#8217;s turn to&#8230;</p>
<h3>Making the Level an editable Parameter</h3>
<h4>Step 1: Creating source files</h4>
<p>Commands to get this done:</p>
<blockquote><p><code>cd ../kdeutils/okteta/kasten/controllers/view/libbytearrayfilter/filter/<br />
cp template/template_bytearrayfilterparameterset.h levelbytearrayfilterparameterset.h<br />
cp template/template_bytearrayfilterparameterset.cpp levelbytearrayfilterparameterset.cpp<br />
cp template/template_bytearrayfilterparametersetedit.h levelbytearrayfilterparametersetedit.h<br />
cp template/template_bytearrayfilterparametersetedit.cpp levelbytearrayfilterparametersetedit.cpp</code></p></blockquote>
<h4>Step 2: Adapting the code from the template</h4>
<p>&#8220;levelbytearrayfilterparameterset.h&#8221; should end up like this:</p>
<blockquote><pre>#ifndef LEVELBYTEARRAYFILTERWITHPARAMETERSET_H
#define LEVELBYTEARRAYFILTERWITHPARAMETERSET_H

// lib
#include [abstractbytearrayfilterparameterset.h]

class LevelByteArrayFilterParameterSet : public AbstractByteArrayFilterParameterSet
{
  public:
    LevelByteArrayFilterParameterSet();

    virtual ~LevelByteArrayFilterParameterSet();

  public: // AbstractByteArrayFilterParameterSet API
    virtual const char* id() const;

  public: // getters
    unsigned char level() const;

  public: // setters
    void setLevel( unsigned int level );

  protected: // parameters
    unsigned char mLevel;
};

#endif</pre>
</blockquote>
<p>&#8220;levelbytearrayfilterparameterset.cpp&#8221; should end up like this:</p>
<blockquote><pre>#include "levelbytearrayfilterparameterset.h"

static const unsigned int DefaultLevel = 127;

LevelByteArrayFilterParameterSet::LevelByteArrayFilterParameterSet()
  : mLevel( DefaultLevel )
{}

const char* LevelByteArrayFilterParameterSet::id() const { return "Level"; }

unsigned char LevelByteArrayFilterParameterSet::level() const { return mLevel; }

void LevelByteArrayFilterParameterSet::setLevel( unsigned int level ) { mLevel = level; }

LevelByteArrayFilterParameterSet::~LevelByteArrayFilterParameterSet() {}</pre>
</blockquote>
<p>&#8220;levelbytearrayfilterparametersetedit.h&#8221; should end up like this:</p>
<blockquote><pre>#ifndef LEVELBYTEARRAYFILTERPARAMETERSETEDIT_H
#define LEVELBYTEARRAYFILTERPARAMETERSETEDIT_H

// lib
#include [abstractbytearrayfilterparametersetedit.h]

class KIntNumInput;

class LevelByteArrayFilterParameterSetEdit : public AbstractByteArrayFilterParameterSetEdit
{
  Q_OBJECT

  public:
    static const char* const Id;

  public:
    LevelByteArrayFilterParameterSetEdit( QWidget* parent = 0 );

    virtual ~LevelByteArrayFilterParameterSetEdit();

  public: // AbstractByteArrayFilterParameterSetEdit API
    virtual void setValues( const AbstractByteArrayFilterParameterSet* parameterSet );
    virtual void getParameterSet( AbstractByteArrayFilterParameterSet* parameterSet ) const;
    virtual bool isValid() const;

  protected Q_SLOTS:
    void onLevelChanged( int value );

  protected:
    KIntNumInput* mLevelEdit;

    bool mIsValid :1;
};

#endif</pre>
</blockquote>
<p>&#8220;levelbytearrayfilterparametersetedit.cpp&#8221; should end up like this:</p>
<blockquote><pre>#include "levelbytearrayfilterparametersetedit.h"

// parameterset
#include "levelbytearrayfilterparameterset.h"
// KDE
#include [KLocale]
#include [KIntNumInput]
// Qt
#include [QtGui/QFormLayout]

const char* const LevelByteArrayFilterParameterSetEdit::Id = "Level";

LevelByteArrayFilterParameterSetEdit::LevelByteArrayFilterParameterSetEdit( QWidget* parent )
  : AbstractByteArrayFilterParameterSetEdit( parent )
{
    QFormLayout* baseLayout = new QFormLayout( this );
    // margin is provided by the container for this widget
    baseLayout-&gt;setMargin( 0 );

    mLevelEdit = new KIntNumInput( this );
    // For demonstration purpose we start at -1, not 0, to show handling of an invalid state
    // Otherwise the range should start at 0 and there is no need to connect to the valueChanged signal
    mLevelEdit-&gt;setRange( -1, 256 );
    // start with the invalid number
    mLevelEdit-&gt;setValue( -1 );
    connect( mLevelEdit, SIGNAL(valueChanged( int )), SLOT(onLevelChanged( int )) );

    const QString levelLabelText =
         i18nc( "@label:spinbox decimal value up to which bytes are set to 0",
                "Level:" );

    baseLayout-&gt;addRow( levelLabelText, mLevelEdit );

    // note start state
    mIsValid = isValid();
}

bool LevelByteArrayFilterParameterSetEdit::isValid() const { return mLevelEdit-&gt;value() != -1; }

void LevelByteArrayFilterParameterSetEdit::setValues( const AbstractByteArrayFilterParameterSet* parameterSet )
{
    const LevelByteArrayFilterParameterSet* template_ParameterSet =
        static_cast( parameterSet );

    mLevelEdit-&gt;setValue( template_ParameterSet-&gt;level() );
}

void LevelByteArrayFilterParameterSetEdit::getParameterSet( AbstractByteArrayFilterParameterSet* parameterSet ) const
{
    LevelByteArrayFilterParameterSet* template_ParameterSet =
        static_cast( parameterSet );

    template_ParameterSet-&gt;setLevel( mLevelEdit-&gt;value() );
}

void LevelByteArrayFilterParameterSetEdit::onLevelChanged( int value )
{
    const bool isValid = ( value != -1 );

    if( mIsValid == isValid )
        return;

    mIsValid = isValid;
    emit validityChanged( isValid );
}

LevelByteArrayFilterParameterSetEdit::~LevelByteArrayFilterParameterSetEdit()
{}</pre>
</blockquote>
<p>Also make the &#8220;LevelByteArrayFilter&#8221; use the &#8220;LevelByteArrayFilterParameterSet&#8221;, by adapting the include notion and the used parameter set class in the file &#8220;levelbytearrayfilter.h&#8221; to now be:</p>
<blockquote><pre>
#include "levelbytearrayfilterparameterset.h"
</pre>
</blockquote>
<blockquote><pre>
    LevelByteArrayFilterParameterSet mParameterSet;
</pre>
</blockquote>
<p>In the file &#8220;levelbytearrayfilter.cpp&#8221; change the variable &#8220;level&#8221; to be not the hardcoded 127, but to take its value from the parameter set:</p>
<blockquote><pre>
    const unsigned int level = mParameterSet.level();
</pre>
</blockquote>
<h4>Step 3: Adding the parameterset to the library</h4>
<p>The file &#8220;okteta/kasten/controllers/view/libbytearrayfilter/bytearrayfilterparameterseteditfactory.cpp&#8221; should now as both have an include for the file &#8220;filter/levelbytearrayfilterparametersetedit.h&#8221;</p>
<blockquote><pre>
#include "filter/levelbytearrayfilterparametersetedit.h"
</pre>
</blockquote>
<p>as well create a widget &#8220;LevelByteArrayFilterParameterSetEdit&#8221; for the &#8220;LevelByteArrayFilterParameterSetEdit::Id&#8221;:</p>
<blockquote><pre>
[...]
    else if( qstrcmp(id,RotateByteArrayFilterParameterSetEdit::Id) == 0 )
        result = new RotateByteArrayFilterParameterSetEdit();
// new:
    else if( qstrcmp(id,LevelByteArrayFilterParameterSetEdit::Id) == 0 )
        result = new LevelByteArrayFilterParameterSetEdit();
[...]
</pre>
</blockquote>
<p>In the file &#8220;okteta/kasten/controllers/CMakeLists.txt&#8221; the list &#8220;LIBFILTER_SRCS&#8221; should now also include the files &#8220;levelbytearrayfilterparameterset.cpp&#8221; and &#8220;levelbytearrayfilterparametersetedit.cpp&#8221;:</p>
<blockquote><pre>
[...]
  view/libbytearrayfilter/filter/rotatebytearrayfilterparameterset.cpp
# new:
  view/libbytearrayfilter/filter/levelbytearrayfilterparameterset.cpp
[...]
  view/libbytearrayfilter/filter/rotatebytearrayfilterparametersetedit.cpp
# new:
  view/libbytearrayfilter/filter/levelbytearrayfilterparametersetedit.cpp
[...]
</pre>
</blockquote>
<h4>Step 4: Compile, install and run</h4>
<p>Commands to get this done:</p>
<blockquote><p><code>cd ../../../../../../../build/<br />
make<br />
make install</code>
</p></blockquote>
<p>Running Okteta now should get you this:<br />
<a href="http://frinring.files.wordpress.com/2009/09/levelfilter-with-parameter-after.png"><img src="http://frinring.files.wordpress.com/2009/09/levelfilter-with-parameter-after.png?w=300&#038;h=215" alt="Level Filter with Parameter after being applied" title="Level Filter with Parameter after being applied" width="300" height="215" class="alignnone size-medium wp-image-426" /></a></p>
<p>It did? Hurra <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Now, please go and write your own special filters! Then share your work and send them to me for inclusion in the next Okteta release <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Next tutorial will be: Add a Checksum/Hashsum algorithm</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/frinring.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/frinring.wordpress.com/409/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/frinring.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/frinring.wordpress.com/409/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/frinring.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/frinring.wordpress.com/409/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/frinring.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/frinring.wordpress.com/409/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/frinring.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/frinring.wordpress.com/409/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=frinring.wordpress.com&blog=251139&post=409&subd=frinring&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://frinring.wordpress.com/2009/09/27/tutorial-add-a-binary-filter-to-okteta/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/99a2c0597f51fc359467492b816edb6d?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">frinring</media:title>
		</media:content>

		<media:content url="http://frinring.files.wordpress.com/2009/09/levelfilter.png" medium="image">
			<media:title type="html">Level Filter</media:title>
		</media:content>

		<media:content url="http://frinring.files.wordpress.com/2009/09/levelfilter-before.png?w=300" medium="image">
			<media:title type="html">Level Filter before being applied</media:title>
		</media:content>

		<media:content url="http://frinring.files.wordpress.com/2009/09/levelfilter-after.png?w=300" medium="image">
			<media:title type="html">Level Filter after being applied</media:title>
		</media:content>

		<media:content url="http://frinring.files.wordpress.com/2009/09/levelfilter-with-parameter-after.png?w=300" medium="image">
			<media:title type="html">Level Filter with Parameter after being applied</media:title>
		</media:content>
	</item>
		<item>
		<title>Call for action: Write your own plugins for Okteta</title>
		<link>http://frinring.wordpress.com/2009/09/25/call-for-action-write-your-own-plugins-for-okteta/</link>
		<comments>http://frinring.wordpress.com/2009/09/25/call-for-action-write-your-own-plugins-for-okteta/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 20:48:35 +0000</pubDate>
		<dc:creator>frinring</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Kasten]]></category>
		<category><![CDATA[Okteta]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://frinring.wordpress.com/?p=387</guid>
		<description><![CDATA[Up to now I have written Okteta, the KDE 4 hex editor, completely on my own. This has pros and cons:
The biggest pro is that I do not have to argue a lot about design decisions, especially as I have some big plans with the co-developed framework Kasten, which Okteta is built on (to serve [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=frinring.wordpress.com&blog=251139&post=387&subd=frinring&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Up to now I have written <a href="http://utils.kde.org/projects/okteta/">Okteta</a>, the KDE 4 hex editor, completely on my own. This has pros and cons:<br />
The biggest <strong>pro</strong> is that I do not have to argue a lot about design decisions, especially as I have some big plans with the co-developed framework Kasten, which Okteta is built on (to serve as testing area) and which might not yet be understood/followed by others (could just be a crazy idea, after all) as I have implemented only parts of it and also added unmarked intermediate shortcuts to get things running already.</p>
<p>The biggest <strong>con</strong> is that Okteta doesn&#8217;t grow as fast as it could.* So there might be some features you, dear Okteta user, are still missing from it. Additionally, remember that I do not really use Okteta myself, it really is almost only a testing area of Kasten for me (I still am happy if Okteta is already a useful tool to many, as this indirectly results in more testers for Kasten). And so I concentrate on things which help to develop Kasten further. I now turned to think about support for very large files, meaning working with data not completely copied to the working memory (just do not hold your breath for this <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ).</p>
<p>So, what about the binary filters (e.g. a bit switcher), your export plugins (e.g. Base64) or even complete tools (I can not even imagine) you are missing from Okteta and hoping for in a future release?</p>
<p>For the coming weeks I am going to show you how <strong>simple</strong> it should be to <strong>help yourself,</strong> in a series of <strong>short tutorials</strong>.</p>
<p>Okteta/Kasten has been designed very <strong>modular</strong>, with a lot of interfaces and plugin-prepared structures. For now everything is hardcoded, but as we have readwrite access to the sources this is of no great problem here <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>There is almost one month left for you to decide if you want to make your hands and keyboard dirty with an addition to Okteta, then the <a href="http://techbase.kde.org/Schedules/KDE4/4.4_Release_Schedule#October_21st.2C_2009:_Soft_Feature_Freeze">soft features freeze</a> will hit the development branch for KDE 4.4. And only November 11th would set the barrier for a basically working solution, so should be enough time to get your plugin done, given it doesn&#8217;t include rocket science. Or you could be still pleased if it only will be part of KDE 4.5 next summer (well, still not assumed to include rocket science). In any case I will be happy to help you where doable.</p>
<p>The <strong>first tutorial</strong> will appear on sunday (September 27th) and teach you <strong>how to write a binary filter</strong> (<i>Update:</i> <a href="http://frinring.wordpress.com/2009/09/27/tutorial-add-a-binary-filter-to-okteta/">online now</a>). So stay tuned if you are in need of a hex editor like Okteta and interested to give the implementation of your needed features yourself a try.</p>
<p>* For sure, the pace of development for Okteta has been quite good, just have a look at the automatic analysis done for Okteta at <a href="http://www.ohloh.net/p/okteta/analyses/latest">ohloh.net</a>. 48,042 lines of code have been gathered in the last two or so years. Which, using LOC while admitting it&#8217;s an evil metric for code work, is estimated to have, taking the given default average salary of $ 55,000 / year, a &#8220;Project Cost&#8221; of some $ 641,343. I just hope I never will write myself this bill. Because the moment I do I am for one in big debt to someone and also in trouble because someone doesn&#8217;t pay my bill. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
Another interesting metric seems behind the assigned property <em>&#8220;Well-commented source code&#8221;</em>: Well, I have spread the code over quite some files, and each and every file has 20 lines comment from the license header. The other comment I often leave is done with this pattern:</p>
<blockquote><p><code>// TODO: some improvement</code></p></blockquote>
<p>currently around 560 times. Instead almost all API is missing proper apidox. So, rather not well-commented. Still, I use <a href="http://api.kde.org/4.x-api/kdeutils-apidocs/okteta/html/classes.html">expressive, thus pretty long names</a> for classes and variables, so comments are not often needed (it&#8217;s obvious what <code>ByteArraySourceCodeStreamEncoderConfigEditorFactory</code> does, or?). But I wonder if this metric takes this into account <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/frinring.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/frinring.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/frinring.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/frinring.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/frinring.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/frinring.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/frinring.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/frinring.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/frinring.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/frinring.wordpress.com/387/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=frinring.wordpress.com&blog=251139&post=387&subd=frinring&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://frinring.wordpress.com/2009/09/25/call-for-action-write-your-own-plugins-for-okteta/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/99a2c0597f51fc359467492b816edb6d?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">frinring</media:title>
		</media:content>
	</item>
		<item>
		<title>Polishing the tools for Okteta 0.4</title>
		<link>http://frinring.wordpress.com/2009/09/19/polishing-the-tools-for-okteta-0-4/</link>
		<comments>http://frinring.wordpress.com/2009/09/19/polishing-the-tools-for-okteta-0-4/#comments</comments>
		<pubDate>Sat, 19 Sep 2009 12:18:56 +0000</pubDate>
		<dc:creator>frinring</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Kasten]]></category>
		<category><![CDATA[Okteta]]></category>

		<guid isPermaLink="false">http://frinring.wordpress.com/?p=378</guid>
		<description><![CDATA[While still avoiding to tackle the next big task for Okteta, supporting very large files, thanks to a strain in my right leg I have found some time to polish the tools a little.
Last night I worked on the input widgets for addresses/offsets and byte strings. Those enable the user to select one from several [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=frinring.wordpress.com&blog=251139&post=378&subd=frinring&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>While still avoiding to tackle the next big task for Okteta, supporting very large files, thanks to a strain in my right leg I have found some time to polish the tools a little.</p>
<p>Last night I worked on the input widgets for addresses/offsets and byte strings. Those enable the user to select one from several formats in which to do the input (auto detection still a TODO). While I wanted to make a widget similar to the one of the searchbar for Konqueror, with the current format to be selectable like the current engine in the left of the searchbar widget, I found this not easy to implement and the searchbar implementation not pleasing my needs (e.g. not focusable with keyboard, no method <code>QComboBox::setEditedIcon()</code> or similar). So I stayed with my old implementation where the format is selected in an external combobox, but which is now placed to the left of the input field and only shows an abbr. of the format type (&#8220;Hex&#8221;, &#8220;Dec&#8221;, &#8230;). The input field itself is a combobox which can and is used to store previous inputs (the popup still lacks a delegate to also show the corresponding format). These widgets are now used all over Okteta, just cmp. the screenshot below.</p>
<p>Already in trunk for some time are support in Kasten for inlined dialogs, with Okteta&#8217;s Goto dialog and the (new for 0.4) Select-range dialog (see screenshot) ported to it. Additionally all tool views are ported to the new AbstractToolWidget in Kasten which has support for default buttons which are activated on the press of the Return key, like you know from the dialogs. So if any widget in a tool view has focus (and doesn&#8217;t eat the Return key itself) one now longer needs to switch the focus to the button but can simply press Return (just seems that the Oxygen style does not give an extra style to default buttons?).</p>
<p>Also switched to use <a href="http://qt.nokia.com/doc/qformlayout.html">QFormLayout</a> where possible. And found the great <a href="http://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/html/classKIntNumInput.html">KIntNumInput</a>, so any units are shown inside the input field (including bytes, as in number of bytes  <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</p>
<p><a href="http://frinring.files.wordpress.com/2009/09/okteta-0-4-toolspolish.png"><img src="http://frinring.files.wordpress.com/2009/09/okteta-0-4-toolspolish.png?w=300&#038;h=231" alt="Polishing the tools for Okteta 0.4" title="Polishing the tools for Okteta 0.4" width="300" height="231" class="alignnone size-medium wp-image-379" /></a></p>
<p>Just the Find and Replace dialogs may stay popup dialogs for a while. For one I have no idea how to best place all the options into an inline-dialog (e.g. the solution in Kate does not follow my workflow) without getting a monster dialog. Even with the Go-to and the Select-range inline-dialogs the window size is sometimes changed, which is a no-no IMHO. And for another on this change I want to implement search-as-you type, which is still lacking a proper foundation for worker threads and locking of document objects. So, support for very large files has a chance to be done before that. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/frinring.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/frinring.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/frinring.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/frinring.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/frinring.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/frinring.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/frinring.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/frinring.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/frinring.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/frinring.wordpress.com/378/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=frinring.wordpress.com&blog=251139&post=378&subd=frinring&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://frinring.wordpress.com/2009/09/19/polishing-the-tools-for-okteta-0-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/99a2c0597f51fc359467492b816edb6d?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">frinring</media:title>
		</media:content>

		<media:content url="http://frinring.files.wordpress.com/2009/09/okteta-0-4-toolspolish.png?w=300" medium="image">
			<media:title type="html">Polishing the tools for Okteta 0.4</media:title>
		</media:content>
	</item>
	</channel>
</rss>