tag:blogger.com,1999:blog-17292034733058092452024-03-16T11:50:57.731-07:00Dominik Seichter's blog: KRename, KBarcode, PoDoFoInformation about the development of KBarcode, KRename and PoDoFo - and other OpenSource projects I'm involved in.Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.comBlogger32125tag:blogger.com,1999:blog-1729203473305809245.post-23406653973641180582015-12-20T05:52:00.001-08:002015-12-20T05:53:26.844-08:00Software analysis using JQAssistantLast week, I was playing a bit with a very interesting tool: <a href="http://jqassistant.org/">JQAssistant</a>.
<b>JQAssistant</b> parses and analyses source files and loads them into a <a href="http://neo4j.com/">Neo4j</a> graph database. By default, JQAssistant will analyze Java source code files, but <b>JQAssistant</b> is built using a plugin based architecture. So, there are various plugins available. For example, there are plugins to analyse Maven Files, XML Files or JUnit test results. Hopefully, there will also be other language plugins be added in the future. Especially, C++ would be nice!<br />
So, why would you want to have your source code in a graph database? Because this gives you a very powerful way to analyze your source code!
<b>JQAssistant</b> creates a graph database with nodes and relations such as:
<br />
<ul>
<li>TYPE declares METHOD</li>
<li>TYPE declares FIELD</li>
<li>TYPE extends TYPE</li>
<li>TYPE implements TYPE</li>
<li>METHOD invokes METHOD</li>
<li>METHOD throws METHOD</li>
<li>METHOD reads FIELD</li>
<li>METHOD writes FIELD</li>
<li>METHOD annotated_by METHOD</li>
<li>...</li>
</ul>
Each of the nodes also has properties like full qualified name, visibility, md5 hash (of classes) or signature and cyclomatic complexity for methods. As you can see, a big graph with lot's of information is created. This graph can now be queried for certain properties using the powerful <b>Neo4j</b> language. Several examples that come to my mind are:
<br />
<ul>
<li>It can be used to ensure architecture guidelines, such as "<i>frontend classes may only call service layer classes, but not backend classes</i>".</li>
<li>Ensure naming guidelines, "<i>e.g. all Service classes must end in *Service or *ServiceImpl and frontend classes in a certain package must only be *Model or *Controller</i>".</li>
<li>All unit tests must call an Assert.* method - otherwise the test does not test anything.</li>
<li>What are the most complex methods in my code that are not called from unit tests?</li>
<li>Analyze properties of your source, e.g. number of classes, methods etc.</li>
</ul>
<br />
Important to note is that there is a <b>Maven</b> plugin to execute <a href="http://jqassistant.org/">JQAssistant</a> during builds. This allows you to run <b>JQAssistant</b> queries during the build and for example let's you fail the built if certain architecture guidelines are not met.
<br />
We are doing this for QualityCheck already, even though we have only implemented a very simple check so far. This checks verifies that all unit tests match our name pattern <code>".*(Test|Test_.*)"</code>. Here is the relevant <b>JQAssistant</b> configuration <i>my-rules.xml</i>.
<br />
<pre><jqa:jqassistant-rules xmlns:jqa="http://www.buschmais.com/jqassistant/core/analysis/rules/schema/v1.0">
<constraint id="my-rules:TestClassName">
<requiresConcept refId="junit4:TestClass" />
<description>All JUnit test classes must have a name with suffix "Test".</description>
<cypher><![CDATA[
MATCH
(t:Junit4:Test:Class)
WHERE NOT
t.name =~ ".*(Test|Test_.*)"
RETURN
t AS InvalidTestClass
]]></cypher>
</constraint>
<group id="default">
<includeConstraint refId="my-rules:TestClassName" />
</group>
</jqa:jqassistant-rules>
</pre>
<b>JQAssistant</b> is even more useful for applications using <a href="http://qualitycheck.sf.net/">QualityCheck</a>! For example, <b>QualityCheck</b> encourages you to use the methods from Check.*, such as <code>Check.notNull</code> in all public methods of your classes and annotate methods usings <code>@ArgumentsChecked</code>.
So, you could use <b>JQAssistant</b>> to find methods, annotated with <code>@ArgumentsChecked</code>, but who do not call any Check.* methods:
<br />
<pre>--
-- Find all methods having @ArgumentsChecked but not calling Check.* methods
--
MATCH
(checkType:Type),
(type:Type)-[:DECLARES]->(method:Method)-[:ANNOTATED_BY]->()-[:OF_TYPE]->(checkAnnotationType:Type)
WHERE
checkType.fqn = 'net.sf.qualitycheck.Check' AND
method.visibility = 'public' AND
checkAnnotationType.fqn='net.sf.qualitycheck.ArgumentsChecked' AND
NOT type.fqn =~ ".*(Test|Test_.*)" AND
NOT (method:Method)-[:INVOKES]->(:Method)<-[:DECLARES]-(checkType:Type)
RETURN
method.signature AS Method, type.fqn as Type;
</pre>
Additionally, the other way round should be checked, i.e. find all methods who call Check.* but that do not have the annotation.
<br />
<pre>--
-- Find methods calling Check.* but not having @ArgumentsChecked in all non-test classes
--
MATCH
(checkType:Type)-[:DECLARES]->(checkMethod:Method),
(type:Type)-[:DECLARES]->(method:Method)-[:INVOKES]->(checkMethod:Method),
(checkAnnotationType:Type)
WHERE
checkType.fqn = 'net.sf.qualitycheck.Check' AND
method.visibility = 'public' AND
checkAnnotationType.fqn='net.sf.qualitycheck.ArgumentsChecked' AND
NOT type.fqn =~ ".*(Test|Test_.*)" AND
NOT (method:Method)-[:ANNOTATED_BY]->()-[:OF_TYPE]->(checkAnnotationType:Type)
RETURN
checkMethod.name AS CHECK_METHOD_CALLED, method.signature AS Method, type.fqn as Type;
</pre>
As a software architect, you should now create a third rule, which indicates which methods must use check and must have the annotation, i.e. all public methods in classes call "*ServiceImpl".
<br />
I hope this was a small introduction and gave you a small impression of the power of this tool.
I would be happy to get some feedback on this and also share some questions that arise for the future of this.
<br />
<ul>
<li>Is there C++ support planned? Is someone working on a C++ plugin to parse C++ code?</li>
<li>How does this perform with big systems? Does anyone have used this on a larger system?</li>
<li>Is there a <a href="http://www.sonarqube.org/">Sonar Qube</a> integration? Can I show failed checks as violations or in charts in Sonar?
</li>
<li>What are your use cases and queries?</li>
</ul>
Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com2tag:blogger.com,1999:blog-1729203473305809245.post-56396076740594805752015-10-22T12:34:00.000-07:002015-10-23T08:33:57.231-07:00Visualize dependencies of binaries and libraries on Linux<div align="justify">
<b>Update4: </b><i>Albert Astals Cid</i> mentioned that KDE maintains also a version of that script: <a href="https://quickgit.kde.org/?p=kde-dev-scripts.git&a=blob&h=c54fefcb02ee1036e7d1c5e8d935264af0280a95&hb=900952ec2103e1d6e417b41d87288eac598294ea&f=draw_lib_dependencies">draw_lib_dependencies</a><br />
<b><br /></b>
<b>Update3: </b><i>Marco Nelissen </i>fixed an issue, that caused dependency resolution to break, as soon MAXDEPTH was reached once. This issue was fixed now and I am quite happy that this old script is still useful and even get's improved. The updated version can also be found at <a href="http://krename.sf.net/data/scripts/dependencies.sh">dependencies.sh</a>. Version below fixed as well.</div>
<div align="justify">
<b><br /></b></div>
<div align="justify">
<b>Update2:</b> <i>pfee</i> made some more fixes. The script parses now the dependcies tree correctly using readelf and ldd so that only direct dependencies apear in the graph. The updated version can also be found at <a href="http://krename.sf.net/data/scripts/dependencies.sh">dependencies.sh</a></div>
<br />
<br />
<div align="justify">
<b>Update:</b> Thanks to the feedback from <i>pfee</i>, I made some fixes to the script. The script is now also available for direct download <a href="http://krename.sf.net/data/scripts/dependencies.sh">dependencies.sh</a></div>
<br />
<br />
<div align="justify">
Sometimes it is useful to know the library dependencies of an application or a library on Linux (or Unix). Especially OpenSource applications depend on lot's of libraries which in turn depend on other libraries again. So it is not always quite clear which dependencies your software has.</div>
<br />
<br />
<div align="justify">
Imagine you want to package up your software for a customer and need to know on which libraries your software depends. Usually you know which libraries were used during development, but what are the dependencies of these libraries? You have to package <b>all</b> dependencies so that the customer can use and/or install your software.</div>
<br />
<br />
<div align="justify">
I created a bash-script which uses ldd to find the dependencies of a binary on Linux and <a href="http://www.graphviz.org/">Graphviz</a> to create a dependency graph out of this information. <a href="http://www.benedikthauptmann.de/">Benedikt Hauptmann</a> had the idea to show dependencies as a graph - so I cannot take credits for that. Using this script I created the depency graph of <b>TFORMer</b>, the report generator we are developing at <a href="http://www.tec-it.com/">TEC-IT</a>. The result is a nice graph showing all the dependencies a user has to have installed before using TFORMer.</div>
<br />
<br />
<a href="http://bp0.blogger.com/_Yp5wtzmTeNk/R72e4TJEWfI/AAAAAAAAAAk/0ByOWCDjmFI/s1600-h/tfprint.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5169462637339367922" src="http://bp0.blogger.com/_Yp5wtzmTeNk/R72e4TJEWfI/AAAAAAAAAAk/0ByOWCDjmFI/s320/tfprint.png" style="cursor: hand; cursor: pointer; display: block; margin: 0px auto 10px; text-align: center;" /></a><br />
<br />
<div align="justify">
Another beautiful graph is the one of <a href="http://podofo.sf.net/">PoDoFo</a>. See below the graph of PoDoFo.</div>
<br />
<br />
<a href="http://bp1.blogger.com/_Yp5wtzmTeNk/R72fgjJEWgI/AAAAAAAAAAs/B5Fkg0ievzE/s1600-h/podofo.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5169463328829102594" src="http://bp1.blogger.com/_Yp5wtzmTeNk/R72fgjJEWgI/AAAAAAAAAAs/B5Fkg0ievzE/s320/podofo.png" style="cursor: hand; cursor: pointer; display: block; margin: 0px auto 10px; text-align: center;" /></a><br />
<br />
<div align="justify">
The dependencies of Firefox are way more complex than the examples shown above...</div>
<br />
<br />
<a href="http://bp2.blogger.com/_Yp5wtzmTeNk/R72gHzJEWhI/AAAAAAAAAA0/52GZaYAAw7Q/s1600-h/firefox.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5169464003138968082" src="http://bp2.blogger.com/_Yp5wtzmTeNk/R72gHzJEWhI/AAAAAAAAAA0/52GZaYAAw7Q/s320/firefox.png" style="cursor: hand; cursor: pointer; display: block; margin: 0px auto 10px; text-align: center;" /></a><br />
<br />
<div align="justify">
If you want to create a graph of your favorite application or library your self, get the script from here. I pulished the simple source code below. <a href="http://www.graphviz.org/">Graphviz</a> is the only requirement. Usage is very simple, just pass an application or library as first parameter and the output image as second argument. The script will always create a PNG image:</div>
<pre>./dependencies.sh /usr/bin/emacs emacs.png
./dependencies.sh /usr/local/lib/libpodofo.so \
podofo.png</pre>
<br />
<br />
<br />
<div align="justify">
The code of the script is as follows: (Warning: the style sheet cuts of some lines, so better download the script from <a href="http://krename.sf.net/data/scripts/dependencies.sh">dependencies.sh</a>)</div>
<br />
<!-- Generator: GNU source-highlight 2.4<br />by Lorenzo Bettini<br />http://www.lorenzobettini.it<br />http://www.gnu.org/software/src-highlite --><br />
<pre style="font-size: 8pt;"><tt><i><span style="color: #9a1900;">#!/bin/bash</span></i>
<i><span style="color: #9a1900;"># This is the maximum depth to which dependencies are resolved</span></i>
<span style="color: #009900;">MAXDEPTH</span><span style="color: #990000;">=</span><span style="color: #993399;">14</span>
<i><span style="color: #9a1900;"># analyze a given file on its</span></i>
<i><span style="color: #9a1900;"># dependecies using ldd and write</span></i>
<i><span style="color: #9a1900;"># the results to a given temporary file</span></i>
<i><span style="color: #9a1900;">#</span></i>
<i><span style="color: #9a1900;"># Usage: analyze [OUTPUTFILE] [INPUTFILE]</span></i>
<b><span style="color: black;">function analyze</span></b>
{
<b><span style="color: blue;">local</span></b> <span style="color: #009900;">OUT</span><span style="color: #990000;">=</span>$<span style="color: #993399;">1</span>
<b><span style="color: blue;">local</span></b> <span style="color: #009900;">IN</span><span style="color: #990000;">=</span>$<span style="color: #993399;">2</span>
<b><span style="color: blue;">local</span></b> <span style="color: #009900;">NAME</span><span style="color: #990000;">=</span><span style="color: #009900;">$(basename</span> <span style="color: #009900;">$IN)</span>
<b><span style="color: blue;">for</span></b> i <b><span style="color: blue;">in</span></b> <span style="color: #009900;">$LIST</span>
<b><span style="color: blue;">do</span></b>
<b><span style="color: blue;">if</span></b> <span style="color: #990000;">[</span> <span style="color: red;">"$i"</span> <span style="color: #990000;">==</span> <span style="color: red;">"$NAME"</span> <span style="color: #990000;">];</span>
<b><span style="color: blue;">then</span></b>
<i><span style="color: #9a1900;"># This file was already parsed</span></i>
<b><span style="color: blue;">return</span></b>
<b><span style="color: blue;">fi</span></b>
<b><span style="color: blue;">done</span></b>
<i><span style="color: #9a1900;"># Put the file in the list of all files</span></i>
<span style="color: #009900;">LIST</span><span style="color: #990000;">=</span><span style="color: red;">"$LIST $NAME"</span>
<span style="color: #009900;">DEPTH</span><span style="color: #990000;">=</span>$<span style="color: #990000;">[</span><span style="color: #009900;">$DEPTH</span> <span style="color: #990000;">+</span> <span style="color: #993399;">1</span><span style="color: #990000;">]</span>
<b><span style="color: blue;">if</span></b> <span style="color: #990000;">[</span> <span style="color: #009900;">$DEPTH</span> -ge <span style="color: #009900;">$MAXDEPTH</span> <span style="color: #990000;">];</span>
<b><span style="color: blue;">then</span></b>
echo <span style="color: red;">"MAXDEPTH of $MAXDEPTH reached at file $IN."</span>
echo <span style="color: red;">"Continuing with next file..."</span></tt></pre>
<pre><tt><span style="font-size: 10.6666669845581px;"><span style="color: red;"> </span></span></tt><i style="font-size: 8pt;"><span style="color: #9a1900;"># Fix by Marco Nelissen for the case that MAXDEPTH was reached</span></i></pre>
<pre><tt><span style="font-size: 10.6666669845581px;"><span style="color: red;"> </span></span><span style="color: #009900; font-size: 8pt;">DEPTH</span><span style="color: #990000; font-size: 8pt;">=</span><span style="font-size: 8pt;">$</span><span style="color: #990000; font-size: 8pt;">[</span><span style="color: #009900; font-size: 8pt;">$DEPTH</span><span style="color: red; font-size: 10.6666669845581px;"> - </span><span style="color: #993399; font-size: 8pt;">1</span><span style="color: #990000; font-size: 8pt;">]</span><span style="color: #009900; font-size: 8pt;">
</span><span style="font-size: 8pt;"> </span><b style="font-size: 8pt;"><span style="color: blue;">return</span></b><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">fi</span></b><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">"Parsing file: $IN"</span><span style="font-size: 8pt;">
</span><span style="color: #009900; font-size: 8pt;">$READELF</span><span style="font-size: 8pt;"> </span><span style="color: #009900; font-size: 8pt;">$IN</span><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">&></span><span style="font-size: 8pt;"> </span><span style="color: #009900; font-size: 8pt;">$READELFTMPFILE</span><span style="font-size: 8pt;">
</span><span style="color: #009900; font-size: 8pt;">ELFRET</span><span style="color: #990000; font-size: 8pt;">=</span><span style="font-size: 8pt;">$</span><span style="color: #990000; font-size: 8pt;">?</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">if</span></b><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">[</span><span style="font-size: 8pt;"> </span><span style="color: #009900; font-size: 8pt;">$ELFRET</span><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">!=</span><span style="font-size: 8pt;"> </span><span style="color: #993399; font-size: 8pt;">0</span><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">];</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">then</span></b><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">"ERROR: ELF reader returned error code $RET"</span><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">"ERROR:"</span><span style="font-size: 8pt;">
cat </span><span style="color: #009900; font-size: 8pt;">$TMPFILE</span><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">"Aborting..."</span><span style="font-size: 8pt;">
rm </span><span style="color: #009900; font-size: 8pt;">$TMPFILE</span><span style="font-size: 8pt;">
rm </span><span style="color: #009900; font-size: 8pt;">$READELFTMPFILE</span><span style="font-size: 8pt;">
rm </span><span style="color: #009900; font-size: 8pt;">$LDDTMPFILE</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">exit</span></b><span style="font-size: 8pt;"> </span><span style="color: #993399; font-size: 8pt;">1</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">fi</span></b><span style="font-size: 8pt;">
</span><span style="color: #009900; font-size: 8pt;">DEPENDENCIES</span><span style="color: #990000; font-size: 8pt;">=</span><span style="color: #009900; font-size: 8pt;">$(cat</span><span style="font-size: 8pt;"> </span><span style="color: #009900; font-size: 8pt;">$READELFTMPFILE</span><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">|</span><span style="font-size: 8pt;"> grep NEEDED </span><span style="color: #990000; font-size: 8pt;">|</span><span style="font-size: 8pt;"> awk </span><span style="color: red; font-size: 8pt;">'{if (substr($NF,1,1) == "[") print substr($NF, 2, length($NF) - 2); else print $NF}'</span><span style="color: #990000; font-size: 8pt;">)</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">for</span></b><span style="font-size: 8pt;"> DEP </span><b style="font-size: 8pt;"><span style="color: blue;">in</span></b><span style="font-size: 8pt;"> </span><span style="color: #009900; font-size: 8pt;">$DEPENDENCIES</span><span style="color: #990000; font-size: 8pt;">;</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">do</span></b><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">if</span></b><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">[</span><span style="font-size: 8pt;"> -n </span><span style="color: red; font-size: 8pt;">"$DEP"</span><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">];</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">then</span></b><span style="font-size: 8pt;">
ldd </span><span style="color: #009900; font-size: 8pt;">$IN</span><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">&></span><span style="font-size: 8pt;"> </span><span style="color: #009900; font-size: 8pt;">$LDDTMPFILE</span><span style="font-size: 8pt;">
</span><span style="color: #009900; font-size: 8pt;">LDDRET</span><span style="color: #990000; font-size: 8pt;">=</span><span style="font-size: 8pt;">$</span><span style="color: #990000; font-size: 8pt;">?</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">if</span></b><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">[</span><span style="font-size: 8pt;"> </span><span style="color: #009900; font-size: 8pt;">$LDDRET</span><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">!=</span><span style="font-size: 8pt;"> </span><span style="color: #993399; font-size: 8pt;">0</span><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">];</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">then</span></b><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">"ERROR: ldd returned error code $RET"</span><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">"ERROR:"</span><span style="font-size: 8pt;">
cat </span><span style="color: #009900; font-size: 8pt;">$TMPFILE</span><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">"Aborting..."</span><span style="font-size: 8pt;">
rm </span><span style="color: #009900; font-size: 8pt;">$TMPFILE</span><span style="font-size: 8pt;">
rm </span><span style="color: #009900; font-size: 8pt;">$READELFTMPFILE</span><span style="font-size: 8pt;">
rm </span><span style="color: #009900; font-size: 8pt;">$LDDTMPFILE</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">exit</span></b><span style="font-size: 8pt;"> </span><span style="color: #993399; font-size: 8pt;">1</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">fi</span></b><span style="font-size: 8pt;">
</span><span style="color: #009900; font-size: 8pt;">DEPPATH</span><span style="color: #990000; font-size: 8pt;">=</span><span style="color: #009900; font-size: 8pt;">$(grep</span><span style="font-size: 8pt;"> </span><span style="color: #009900; font-size: 8pt;">$DEP</span><span style="font-size: 8pt;"> </span><span style="color: #009900; font-size: 8pt;">$LDDTMPFILE</span><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">|</span><span style="font-size: 8pt;"> awk </span><span style="color: red; font-size: 8pt;">'{print $3}'</span><span style="color: #990000; font-size: 8pt;">)</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">if</span></b><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">[</span><span style="font-size: 8pt;"> -n </span><span style="color: red; font-size: 8pt;">"$DEPPATH"</span><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">];</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">then</span></b><span style="font-size: 8pt;">
echo -e </span><span style="color: red; font-size: 8pt;">" </span><span style="color: #cc33cc; font-size: 8pt;">\"</span><span style="color: red; font-size: 8pt;">$NAME</span><span style="color: #cc33cc; font-size: 8pt;">\"</span><span style="color: red; font-size: 8pt;"> -> </span><span style="color: #cc33cc; font-size: 8pt;">\"</span><span style="color: red; font-size: 8pt;">$DEP</span><span style="color: #cc33cc; font-size: 8pt;">\"</span><span style="color: red; font-size: 8pt;">;"</span><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">>></span><span style="font-size: 8pt;"> </span><span style="color: #009900; font-size: 8pt;">$OUT</span><span style="font-size: 8pt;">
analyze </span><span style="color: #009900; font-size: 8pt;">$OUT</span><span style="font-size: 8pt;"> </span><span style="color: #009900; font-size: 8pt;">$DEPPATH</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">fi</span></b><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">fi</span></b><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">done</span></b><span style="font-size: 8pt;">
</span><span style="color: #009900; font-size: 8pt;">DEPTH</span><span style="color: #990000; font-size: 8pt;">=</span><span style="font-size: 8pt;">$</span><span style="color: #990000; font-size: 8pt;">[</span><span style="color: #009900; font-size: 8pt;">$DEPTH</span><span style="font-size: 8pt;"> - </span><span style="color: #993399; font-size: 8pt;">1</span><span style="color: #990000; font-size: 8pt;">]</span><span style="font-size: 8pt;">
}
</span><i style="font-size: 8pt;"><span style="color: #9a1900;">########################################</span></i><span style="font-size: 8pt;">
</span><i style="font-size: 8pt;"><span style="color: #9a1900;"># main #</span></i><span style="font-size: 8pt;">
</span><i style="font-size: 8pt;"><span style="color: #9a1900;">########################################</span></i><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">if</span></b><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">[</span><span style="font-size: 8pt;"> $</span><i style="font-size: 8pt;"><span style="color: #9a1900;"># != 2 ];</span></i><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">then</span></b><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">"Usage:"</span><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">" $0 [filename] [outputimage]"</span><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">""</span><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">"This tools analyses a shared library or an executable"</span><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">"and generates a dependency graph as an image."</span><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">""</span><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">"GraphViz must be installed for this tool to work."</span><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">""</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">exit</span></b><span style="font-size: 8pt;"> </span><span style="color: #993399; font-size: 8pt;">1</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">fi</span></b><span style="font-size: 8pt;">
</span><span style="color: #009900; font-size: 8pt;">DEPTH</span><span style="color: #990000; font-size: 8pt;">=</span><span style="color: #993399; font-size: 8pt;">0</span><span style="font-size: 8pt;">
</span><span style="color: #009900; font-size: 8pt;">INPUT</span><span style="color: #990000; font-size: 8pt;">=</span><span style="font-size: 8pt;">$</span><span style="color: #993399; font-size: 8pt;">1</span><span style="font-size: 8pt;">
</span><span style="color: #009900; font-size: 8pt;">OUTPUT</span><span style="color: #990000; font-size: 8pt;">=</span><span style="font-size: 8pt;">$</span><span style="color: #993399; font-size: 8pt;">2</span><span style="font-size: 8pt;">
</span><span style="color: #009900; font-size: 8pt;">TMPFILE</span><span style="color: #990000; font-size: 8pt;">=</span><span style="color: #009900; font-size: 8pt;">$(mktemp</span><span style="font-size: 8pt;"> -t</span><span style="color: #990000; font-size: 8pt;">)</span><span style="font-size: 8pt;">
</span><span style="color: #009900; font-size: 8pt;">LDDTMPFILE</span><span style="color: #990000; font-size: 8pt;">=</span><span style="color: #009900; font-size: 8pt;">$(mktemp</span><span style="font-size: 8pt;"> -t</span><span style="color: #990000; font-size: 8pt;">)</span><span style="font-size: 8pt;">
</span><span style="color: #009900; font-size: 8pt;">READELFTMPFILE</span><span style="color: #990000; font-size: 8pt;">=</span><span style="color: #009900; font-size: 8pt;">$(mktemp</span><span style="font-size: 8pt;"> -t</span><span style="color: #990000; font-size: 8pt;">)</span><span style="font-size: 8pt;">
</span><span style="color: #009900; font-size: 8pt;">LIST</span><span style="color: #990000; font-size: 8pt;">=</span><span style="color: red; font-size: 8pt;">""</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">if</span></b><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">[</span><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">!</span><span style="font-size: 8pt;"> -e </span><span style="color: #009900; font-size: 8pt;">$INPUT</span><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">];</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">then</span></b><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">"ERROR: File not found: $INPUT"</span><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">"Aborting..."</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">exit</span></b><span style="font-size: 8pt;"> </span><span style="color: #993399; font-size: 8pt;">2</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">fi</span></b><span style="font-size: 8pt;">
</span><i style="font-size: 8pt;"><span style="color: #9a1900;"># Use either readelf or dump</span></i><span style="font-size: 8pt;">
</span><i style="font-size: 8pt;"><span style="color: #9a1900;"># Linux has readelf, Solaris has dump</span></i><span style="font-size: 8pt;">
</span><span style="color: #009900; font-size: 8pt;">READELF</span><span style="color: #990000; font-size: 8pt;">=</span><span style="color: #009900; font-size: 8pt;">$(type</span><span style="font-size: 8pt;"> readelf </span><span style="color: #993399; font-size: 8pt;">2</span><span style="color: #990000; font-size: 8pt;">></span><span style="font-size: 8pt;"> /dev/null</span><span style="color: #990000; font-size: 8pt;">)</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">if</span></b><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">[</span><span style="font-size: 8pt;"> $</span><span style="color: #990000; font-size: 8pt;">?</span><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">!=</span><span style="font-size: 8pt;"> </span><span style="color: #993399; font-size: 8pt;">0</span><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">];</span><span style="font-size: 8pt;"> </span><b style="font-size: 8pt;"><span style="color: blue;">then</span></b><span style="font-size: 8pt;">
</span><span style="color: #009900; font-size: 8pt;">READELF</span><span style="color: #990000; font-size: 8pt;">=</span><span style="color: #009900; font-size: 8pt;">$(type</span><span style="font-size: 8pt;"> dump </span><span style="color: #993399; font-size: 8pt;">2</span><span style="color: #990000; font-size: 8pt;">></span><span style="font-size: 8pt;"> /dev/null</span><span style="color: #990000; font-size: 8pt;">)</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">if</span></b><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">[</span><span style="font-size: 8pt;"> $</span><span style="color: #990000; font-size: 8pt;">?</span><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">!=</span><span style="font-size: 8pt;"> </span><span style="color: #993399; font-size: 8pt;">0</span><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">];</span><span style="font-size: 8pt;"> </span><b style="font-size: 8pt;"><span style="color: blue;">then</span></b><span style="font-size: 8pt;">
echo Unable to find ELF reader
</span><b style="font-size: 8pt;"><span style="color: blue;">exit</span></b><span style="font-size: 8pt;"> </span><span style="color: #993399; font-size: 8pt;">1</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">fi</span></b><span style="font-size: 8pt;">
</span><span style="color: #009900; font-size: 8pt;">READELF</span><span style="color: #990000; font-size: 8pt;">=</span><span style="color: red; font-size: 8pt;">"dump -Lv"</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">else</span></b><span style="font-size: 8pt;">
</span><span style="color: #009900; font-size: 8pt;">READELF</span><span style="color: #990000; font-size: 8pt;">=</span><span style="color: red; font-size: 8pt;">"readelf -d"</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">fi</span></b><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">"Analyzing dependencies of: $INPUT"</span><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">"Creating output as: $OUTPUT"</span><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">""</span><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">"digraph DependencyTree {"</span><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">></span><span style="font-size: 8pt;"> </span><span style="color: #009900; font-size: 8pt;">$TMPFILE</span><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">" </span><span style="color: #cc33cc; font-size: 8pt;">\"</span><span style="color: red; font-size: 8pt;">$(basename $INPUT)</span><span style="color: #cc33cc; font-size: 8pt;">\"</span><span style="color: red; font-size: 8pt;"> [shape=box];"</span><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">>></span><span style="font-size: 8pt;"> </span><span style="color: #009900; font-size: 8pt;">$TMPFILE</span><span style="font-size: 8pt;">
analyze </span><span style="color: #009900; font-size: 8pt;">$TMPFILE</span><span style="font-size: 8pt;"> </span><span style="color: red; font-size: 8pt;">"$INPUT"</span><span style="font-size: 8pt;">
echo </span><span style="color: red; font-size: 8pt;">"}"</span><span style="font-size: 8pt;"> </span><span style="color: #990000; font-size: 8pt;">>></span><span style="font-size: 8pt;"> </span><span style="color: #009900; font-size: 8pt;">$TMPFILE</span><span style="font-size: 8pt;">
</span><i style="font-size: 8pt;"><span style="color: #9a1900;">#cat $TMPFILE # output generated dotfile for debugging purposses</span></i><span style="font-size: 8pt;">
dot -Tpng </span><span style="color: #009900; font-size: 8pt;">$TMPFILE</span><span style="font-size: 8pt;"> -o</span><span style="color: #009900; font-size: 8pt;">$OUTPUT</span><span style="font-size: 8pt;">
rm </span><span style="color: #009900; font-size: 8pt;">$LDDTMPFILE</span><span style="font-size: 8pt;">
rm </span><span style="color: #009900; font-size: 8pt;">$TMPFILE</span><span style="font-size: 8pt;">
</span><b style="font-size: 8pt;"><span style="color: blue;">exit</span></b><span style="font-size: 8pt;"> </span><span style="color: #993399; font-size: 8pt;">0</span><span style="font-size: 8pt;">
</span></tt></pre>
Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com23tag:blogger.com,1999:blog-1729203473305809245.post-88871742856249981012013-08-05T12:41:00.000-07:002013-08-05T12:41:03.950-07:00Java: Test Coverage for Private ConstructorsIt is good practice to add private constructors to utility classes that are not thought to be instantiated. This is usually the case for final classes that only have static methods or provide constants (in the latter case I would suggest to use an interface).
<br />
<br />
Following this practice usually gives a bad surprise when looking at your Cobertura code-coverage report (or similar). The tool reports that the constructor is not covered - of course, because you cannot call it! This lowers your overall percentage for line-coverage and is a drawback when you otherwise try to achieve 100% line-coverage and also enforce this using <code>mvn verify</code> or similar methods.
<br />
<br />
<a href="http://4.bp.blogspot.com/-IoilZus7hH0/USiWvjkP9VI/AAAAAAAAAFU/AqY9T3KFFsk/s1600/nocoverage.png" imageanchor="1"><img border="0" src="http://4.bp.blogspot.com/-IoilZus7hH0/USiWvjkP9VI/AAAAAAAAAFU/AqY9T3KFFsk/s1600/nocoverage.png" /></a>
<br />
<br />
<a href="http://qualitycheck.sourceforge.net/">Quality-Check</a> contains a module called <b>Quality-Test</b> in its newest snapshot release. It includes a small utility class <code>CoverageForPrivateConstructor</code> which allows us to write a little JUnit-Test to provide line-coverage for the private constructor.
<br />
<code>
</code>
<pre><code>
</code></pre>
<pre><code>@Test
public void giveMeCoverageForMyPrivateConstructor() throws Exception {
CoverageForPrivateConstructor.giveMeCoverage(StaticCheck.class);
}
</code></pre>
<code>
</code>
<br />
<br />
This result in a code-coverage report with full test coverage also for the private constructor. Nice, isn't it?
<br />
<br />
<a href="http://4.bp.blogspot.com/-7Bb77JKoK6k/USiXWJyjmNI/AAAAAAAAAFk/PbOJvNzezmE/s1600/coverage.png" imageanchor="1"><img border="0" src="http://4.bp.blogspot.com/-7Bb77JKoK6k/USiXWJyjmNI/AAAAAAAAAFk/PbOJvNzezmE/s1600/coverage.png" /></a>
Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com1tag:blogger.com,1999:blog-1729203473305809245.post-19473424800633906092013-08-05T12:36:00.001-07:002013-08-05T12:39:02.631-07:00Quality-Test and Blueprint<a href="http://qualitycheck.sf.net/">Quality-Check</a> and <b>Quality-Test</b> version 1.3 have been released. As a major addtion, <b>Quality-Test</b> includes a new module for test-data generation called "<b>Blueprint</b>".
<br />
<br />
A complete introduction into the <b>Blueprint </b>module will be given here in a later post. For now, two small examples will show, how easy it is to construct objects (i.e. blueprint objects) for your unit-tests.
We use the class description and a configuration<i> as a blueprin</i>t to construct an actual object, which is ready to be used in the test-case.
<br />
<code><br /></code>
<code>
final NameDTO name = Blueprint.random().with("gender", Gender.Male).construct(NameDTO.class); </code><br />
<code><br /></code>
<code>final Address address = Blueprint.def().with(String.class, "Default").with("zipCode", 12345L).construct(Address.class);
</code>
<br />
<br />
As you can see, <b>Blueprint </b>contains two default configurations, which either fill all attributes using default or random values. Basically, <b>Blueprint </b>will walk the object tree and fill all attributes with default values specified by the current configuration. Therefore, you won't get any NullPointerExceptions in your test-cases, as all attributes are filled with values. You have to define only those values on which your functional test-case actually depends. Everything else is handled by blueprint.
<br />
<br />
If you have questions regarding Blueprint, drop me a mail. A more lengthy introduction will follow soon. So far, best is you simply <a href="http://search.maven.org/#artifactdetails%7Cnet.sf.qualitycheck%7Cquality-test%7C1.3%7Cjar">try it out</a>.Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com0tag:blogger.com,1999:blog-1729203473305809245.post-49635454942525498652013-03-04T11:22:00.000-08:002013-03-04T11:22:02.797-08:00Building Static PoDoFo 0.9.1 with MSVC 2012<p>Just found this nice article about building <a href="http://podofo.sf.net">PoDoFo</a> using Visual Studio:
<a href="http://johnbugbee.com/2012/12/30/building-static-podofo-0-9-1-with-msvc-2012/">http://johnbugbee.com/2012/12/30/building-static-podofo-0-9-1-with-msvc-2012/</a>.
</p>
<p>As this is a frequently asked question, I though I post it here. It might be of use to some of you. Please note, so, <b>PoDoFo</b> as of 0.9.2 has a dependency on <b>OpenSSL</b> which is not mentioned in the article as it focuses on 0.9.1. We are currently discussing about replacing <b>OpenSSL</b> in favour of <b>LibCrypto++</b>.
</p>Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com1tag:blogger.com,1999:blog-1729203473305809245.post-15073037360831138192013-02-23T02:05:00.001-08:002013-02-23T02:05:32.738-08:00PoDoFo 0.9.2 Bug-Fix Release Available<p>
<b>PoDoFo 0.9.2</b> has been released today and is available for download at our download section. This release collects many bug fixes which were made over the last two years. The biggest addition is the new encryption support based on <a href="http://www.openssl.org">OpenSSL</a>. Please note that OpenSSL is now a mandatory requirement.
</p>
<p>
Get downloads from <a href="http://podofo.sf.net">podofo.sf.net</a>
</p>
Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com1tag:blogger.com,1999:blog-1729203473305809245.post-73742820500193429252012-12-15T05:28:00.001-08:002012-12-15T05:28:38.317-08:00KBarcode-kde4 port ready and released<p><a href="http://www.kbarcode.net">KBarcode</a> has been ported to KDE4/Qt4 by Fanda. Also some of the older bugs related to GUI have been fixed. It seems stable. The new version of <b>KBarcode</b> for KDE4/Qt4 has been renamed to <b>KBarcode-kde4</b> so that users can have the old KBarcode for KDE3/Qt3 as well as the new KBarcode for KDE4/Qt4 installed on one system.</p>
<p>KBarcode-kde4 uses Akonadi. KCommand and related stuff has been ported to QUndoCommand and so on ... Spellchecking was ported to Sonnet but the new implementation of Sonnet in KBarcode-kde4 is odd and complicated so it will be deprecated and replaced in a future version.</p>
<p>KBarcode-kde4 is currently in a beta stage. It is not in Ubuntu or Debian repositories yet. At the moment (2012-12-14) only a deb package for amd64 architecture exists. Download the deb package kbarcode-kde4_3.0.0b2-1_amd64.deb from <a href="https://sourceforge.net/projects/kbarcode/files/Development/3.0.0b2/kbarcode-kde4_3.0.0b2-1_amd64.deb">https://sourceforge.net/projects/kbarcode/files/Development/3.0.0b2/kbarcode-kde4_3.0.0b2-1_amd64.deb</a> and follow instructions in <a href="https://sourceforge.net/projects/kbarcode/files/Development/3.0.0b2/README-INSTALL.txt">https://sourceforge.net/projects/kbarcode/files/Development/3.0.0b2/README-INSTALL.txt</a> to install it.</p>
<p>The source code can be found in the source tarball at <a href="http://sourceforge.net/projects/kbarcode/files/Development/3.0.0b2/kbarcode-kde4_3.0.0b2.tar.gz/download">http://sourceforge.net/projects/kbarcode/files/Development/3.0.0b2/kbarcode-kde4_3.0.0b2.tar.gz/download</a> or in the GIT repository at <a href="https://gitorious.org/kbarcode-kde4/kbarcode-kde4/commits/master">https://gitorious.org/kbarcode-kde4/kbarcode-kde4/commits/master</a>.
</p>
<p>Thank you very much for your work Fanda!</p>Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com4tag:blogger.com,1999:blog-1729203473305809245.post-29730796525372601462012-09-12T13:28:00.001-07:002012-09-12T13:28:47.612-07:00Quality-Check 0.10 releasedWe releases <a href="http://qualitycheck.sourceforge.net/">Quality-Check 0.10</a> today! The new release includes several new checks such as:
<br />
<ul>
<li><code>Check.instanceOf</code></li>
<li><code>Check.isNumber</code></li>
<li><code>Check.isNumeric</code></li>
<li><code>Check.notNaN</code></li>
</ul>
<br />
Most importantly you should check-out our enhanced <a href="http://qualitycheck.sourceforge.net/">webpage</a> and especially our <a href="http://qualitycheck.sourceforge.net/comparison.html">comparison</a>, where we compare <tt>Check</tt> with other classes like <tt>org.springframework.util.Assert</tt>
<a href="http://static.springsource.org/spring/docs/3.1.x/javadoc-api/org/springframework/util/Assert.html">[1]</a>
or
<tt>com.google.common.base.Preconditions</tt>
<a href="http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/base/Preconditions.html">[2]</a>
or
<tt>org.apache.commons.lang3.Validate</tt>
<a href="http://commons.apache.org/lang/api/org/apache/commons/lang3/Validate.html">[3].</a>
Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com2tag:blogger.com,1999:blog-1729203473305809245.post-85784430895830066262012-09-05T12:24:00.001-07:002012-09-05T12:27:05.332-07:00Quality-Check for JavaAndré Rouél and I startet a new OpenSource project to avoid technical errors in Java applications: Quality-Check.<br />
<div>
<br /></div>
<div>
The goal of quality-check is to provide a small Java library for basic runtime code quality checks. It provides similar features to <a href="http://static.springsource.org/spring/docs/3.1.x/javadoc-api/org/springframework/util/Assert.html">org.springframework.util.Assert</a> or <a href="http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/base/Preconditions.html">com.google.common.base.Preconditions</a> without the need to include big libraries or frameworks such as Spring or Guava. </div>
<div>
The package quality-check tries to replace these libraries and provide all the basic code quality checks.<br />
<br /></div>
<h4>
Example</h4>
<br />
<pre>/**
* Sets the given object if it is not null.
*
* @throws IllegalArgumentException
* if the given argument is {@code null}
*/
public void setObject(final Object object) {
if (object != null) {
throw new IllegalArgumentException("Argument 'object' must not be null.");
}
this.object = object;
}
</pre>
<div>
<br />
<br />
can be replaces by:<br />
<br /></div>
<pre>/**
* Sets the given object if it is not null.
*/
<b>@ArgumentsChecked</b>
public void setObject(final Object object) {
this.object = <b>Check.notNull</b>(object);
}
</pre>
<div>
<br />
It is now available in <a href="http://search.maven.org/#search%7Cga%7C1%7Cqualitycheck">Maven Central</a> so adding it to your project is as simple as putting these five lines into your pom.xml:
</div>
<div>
<dependency><br />
<groupid>net.sf.qualitycheck</groupid><br />
<artifactid>quality-check</artifactid><br />
<version>0.9</version><br />
</dependency><br />
</div>
<div>
<br />
Please take also a look at our <a href="http://qualitycheck.sourceforge.net/">webpage</a> or our project at
<a href="https://github.com/before/quality-check">GitHub</a>.
</div>
Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com3tag:blogger.com,1999:blog-1729203473305809245.post-21355208719188679862012-07-15T01:26:00.001-07:002012-07-15T01:26:35.047-07:00PoDoFoColor Lua Scripting<label></label>
<br />
sdaau wrote in with some news about podofocolor, I'd like to share:<br />
<br />
<i>I just found about podofocolor on
http://domseichter.blogspot.dk/2011/01/modifying-and-analyzing-colors-in-pdf.html
- and I got really interested in "Analyzing colors - Find out, which
colorspaces or colors are used in a PDF". I couldn't find an example of
how to do that on that page, and I assumed the only way to do is through
Lua. <br />
<br />
Unfortunately, while there are some PPA builds for Ubuntu ( see
http://sdaaubckp.svn.sf.net/viewvc/sdaaubckp/offext-call-scripts/podofo.sh
), those do not have Lua built-in, so I rebuilt podofo and utils on
Lucid, and posted the executables here - since they are statically
linked, they may be useful to others as well: <br />
<br />
http://sdaaubckp.sourceforge.net/post/libpodofo-utils-lucid/<br />
<br />
I have also recorded the steps to building those executables in
http://sdaaubckp.svn.sf.net/viewvc/sdaaubckp/source-build-scripts/get-podofo-src.sh
<br />
<br />
The above directory also contains a modification of the example.lua script:<br />
<br />
http://sdaaubckp.sourceforge.net/post/libpodofo-utils-lucid/example-colorlist.lua<br />
<br />
... which can be used to simply print out any color encountered in a PDF, by using this command line:<br />
<br />
$ ./libpodofo-utils-lucid/podofocolor lua example-colorlist.lua /path/to/mytest.pdf /dev/null<br />
<br />
<<xxxx>]/Info 2 0 R/Root 1 0 R/Size 16>><br />
Processing page 1...<br />
-> Lua is parsing page: 1<br />
Reading object 6 0 R with type: Number<br />
set_non_stroking_color_gray: 1<br />
set_non_stroking_color_cmyk: 0.233887 1 1 0.218994<br />
....<br />
<br />
Note that it is important to add `/dev/null` as output file - otherwise,
both the color report _and the pdf in its entirety_ will be dumped to
the terminal - making the report about colors impossible to read.<br />
<br />
I would have appreciated a lot a similar guide/explanation on the
blogspot webpage (or in a help/readme); and I'd be very happy if some of
this here can contribute towards more detailed examples in then
documentation. <br />
<br />
Many thanks for the great software, <br />
Cheers! </xxxx></i><br />
<br />
The original post can be found here: <a href="http://sourceforge.net/tracker/?func=detail&aid=3539970&group_id=154028&atid=790133">http://sourceforge.net/tracker/?func=detail&aid=3539970&group_id=154028&atid=790133</a><br />
If you also have interesting PoDoFo stuff to share, feel free to drop me a mail.<br />Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com2tag:blogger.com,1999:blog-1729203473305809245.post-758301125976741972012-07-15T01:14:00.000-07:002012-07-15T01:14:10.504-07:00KBarcode KDE4 Port Status UpdateFanda provided some updates on the status of the KBarcode-KDE4 port:<br />
<br />
<i>The version tagged as "port-1.0" on <a href="http://gitorious.org/kbarcode-kde4" target="_blank">gitorious.org/<span class="il">kbarcode</span>-kde4</a> works and has the most of the <span class="il">Kbarcode</span>'s functionality except a database support. It compiles succesfully with few compile warnings and uses all of the <span class="il">Kbarcode</span>'s
source files except gnubarkodeengine.cpp and gnubarkodeengine.h . But
it still uses QT3 support classes like Q3Canvas, Q3SqlCursor,
Q3DataTable, Q3SimpleRichText, etc. I am currently working on porting
the QT3 support classes to pure QT4. I have already ported Q3Canvas and
related stuff to QGraphicsScene (which proved to be the most difficult
porting) but I haven't pushed it to the online repository on <a href="http://gitorious.org/kbarcode-kde4" target="_blank">gitorious.org/<span class="il">kbarcode</span>-kde4</a> yet.</i><br />
I am so glad to this project to be continued! It looks much prettier than the KDE3 version and even did import my old KBarcode3 label files without any problems.<br />
<br />
Want some screenshots? Here you got.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-UAJOzJl_Q84/UAJ7lZKpLOI/AAAAAAAAAEs/Zqk7-EFMtwo/s1600/kbarcode01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-UAJOzJl_Q84/UAJ7lZKpLOI/AAAAAAAAAEs/Zqk7-EFMtwo/s1600/kbarcode01.png" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-jmhjSV8cu9g/UAJ7mPk7FaI/AAAAAAAAAE0/DnsKXTiAalQ/s1600/kbarcode02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="219" src="http://3.bp.blogspot.com/-jmhjSV8cu9g/UAJ7mPk7FaI/AAAAAAAAAE0/DnsKXTiAalQ/s320/kbarcode02.png" width="320" /></a> </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-DolJnidbXiA/UAJ7m-aRkoI/AAAAAAAAAE8/KmzC3WdCTKE/s1600/kbarcode03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://2.bp.blogspot.com/-DolJnidbXiA/UAJ7m-aRkoI/AAAAAAAAAE8/KmzC3WdCTKE/s320/kbarcode03.png" width="300" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-D9pUKMOJ0Gc/UAJ7n2IonzI/AAAAAAAAAFE/9YbAyrKyNtI/s1600/kbarcode04.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="213" src="http://3.bp.blogspot.com/-D9pUKMOJ0Gc/UAJ7n2IonzI/AAAAAAAAAFE/9YbAyrKyNtI/s320/kbarcode04.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br />
<br />Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com6tag:blogger.com,1999:blog-1729203473305809245.post-34594575781072192372011-02-06T02:12:00.000-08:002011-02-06T02:49:20.470-08:00Directory Management with KRenameYesterday, I got a very interesting e-mail from Todd about using <b>KRename</b>. His request required one new feature which was added to <a href="http://domseichter.blogspot.com/2010/02/building-krename-trunk-from-svn.html">KRename SVN</a> and makes <b>KRename</b> even more powerful. So, I think his usecase is interesting enough to be shown here.<br /><br />First of all, he has several files which he wants to sort into different directories based on parts of their names. If the filename contains the word "essay" it is supposed to go into a subdirectory called "essay/" and the same should be done for the memo's. His example list of files looks like this:<br /><br /><code><br />Work Essay for fred.txt<br />Work Essay for bob.odt<br />Work Essay for alice.doc<br />Work Memo for mary.odt<br />Work Memo for ben.txt<br />Work Memo for carey.doc<br /></code><br /><br />At the end, we want a directory and file structure like this:<br /><code><br />Essay/Work Essay for fred.txt<br />Essay/Work Essay for bob.odt<br />Essay/Work Essay for alice.doc<br />Memo/Work Memo for mary.odt<br />Memo/Work Memo for ben.txt<br />Memo/Work Memo for carey.doc<br /></code><br /><br /><br />You can create directories in <b>KRename</b> during renaming of files using the <b>[dirsep]</b> operator or by simply using a <b>/</b> (slash) in the template. So, the template <i>newdir[dirsep]$</i> will create a new directory called <i>newdir</i> and move all files to this directory. The token $ is <b>KRename'</b> way of saying, "insert the original filename here".<br /><br />Now, one can combine this feature with the powerful regular expressions. Just go to the "Search and Replace ..." dialog and enter the regular expression <b>Work ([\w]+) for</b> and replace it with <b>\1[direp]Work \1 for</b>. The backreference <b>\1</b> inserts a matched string from the regular expression into the results. Thereby, we can include either "memo" or "essay" in the new directory name. The matched part is indicated by brackets in the regular expression.<br /><br />To make this work, one new feature was added to <b>KRename</b>. The dialog contains a new checkbox which allows to enable processing of <b>KRename</b> tokens in the replacement string of find and replace. We need this feature to process the <i>[dirsep]</i> token correctly and create a new directory<br />See the screenshots below.<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Yp5wtzmTeNk/TU57bW5fAzI/AAAAAAAAAEc/SLwscdAMBaA/s1600/krename_regexp1.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 144px;" src="http://1.bp.blogspot.com/_Yp5wtzmTeNk/TU57bW5fAzI/AAAAAAAAAEc/SLwscdAMBaA/s320/krename_regexp1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5570525499037254450" /></a><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Yp5wtzmTeNk/TU57lIZIfsI/AAAAAAAAAEk/uj9SrPbIdWY/s1600/krename_regexp2.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 159px;" src="http://1.bp.blogspot.com/_Yp5wtzmTeNk/TU57lIZIfsI/AAAAAAAAAEk/uj9SrPbIdWY/s320/krename_regexp2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5570525666942156482" /></a><br /><br /><br />If you have similar interesting usecases for <b>KRename</b> or questions on how to do thinks, do not hesitate to write a mail to our <a href="mailto:krename-users@lists.sf.net">mailinglist</a>!Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com7tag:blogger.com,1999:blog-1729203473305809245.post-57827259428732514552011-01-30T03:58:00.000-08:002011-01-30T04:11:35.149-08:00Modifying and analyzing colors in PDF files using podofocolor<h2>What is <i>podofocolor</i>?</h2><br /><br /><i>Podofocolor</i> is the newest addition to the podofo-tools package. It is a command-line tool to analyze and/or modify all colors in a PDF file. This can be done using predefined rules or based on a custom Lua script.<br /><br />Basically, <i>podofocolor</i> opens a PDF file and goes through every page or vector graphics object (e.g. an XObject) and looks at every PDF command. Whenever it encounters a colorspace definition or a PDF command, which sets a color for a following PDF operation like “draw a line” or “fill area with color”, an action can be performed. These actions are either predefined actions or can be defined by implementing a C++ interface or more likely by providing a Lua script. Predefined actions are “convert this color to grayspace” or “print color name to stdout”; however more complicated actions can be easily created as well. As can be seen by the “grayscale”-action, the most powerful feature of the tool is to replace colors in a PDF file. Custom color conversion algorithms can be implemented in Lua and be immediately applied to any PDF file.<br /><br /><h2>How is it useful?</h2><br /><br />There are different use-cases for such a tool and I assume users will come up with even more options. Possible usage scenarios that come to my mind can be categorized in two areas: analyzing colors and modifying colors.<br /><ul><br /> <li>Analyzing colors<br /> <ul><br /> <li>Find out, which colorspaces or colors are used in a PDF</li><br /> <li>Verify that certain colors are not used in a PDF</li><br /> <li>Verify that only CMYK or ICC-based colors are used in a PDF</li><br /> </ul><br /> </li><br /> <li>Modifying colors<br /> <ul><br /> <li>Convert colorspace of a PDF (e.g. convert it to grayscale or CMYK)</li><br /> <li>Convert colors in a PDF to certain corporate colors</li><br /> <li>Split one PDF file into four different PDF files, where each file represents one component of the CMYK colors used in the PDF. As a result, you will receive one PDF containing only the cyan color channel, one containing the yellow one, etc..</li><br /> </ul><br /> </li><br /></ul><br /><br /><h2>Usage</h2><br /><br />The usage of the command-line tools is simple:<br /><code><br /> ./podofocolor [converter] input.pdf output.pdf<br /></code><br />Different values are possible to be used as a converter. The table below lists all converters which are currently available:<br /><table><br /> <tr><br /> <td><b>Converter</b></td><br /> <td> </td><br /> <td><b>Description</b></td><br /> </tr><br /> <tr><br /> <td>dummy</td><br /> <td> </td><br /> <td>This is an example implementation of a converter in C++, which will convert all colors in a PDF to RGB red.</td><br /> </tr><br /> <tr><br /> <td>grayscale</td><br /> <td> </td><br /> <td>The grayscale converter changes all colors to its grayscale equivalents in a grayscale colorspace.</td><br /> </tr><br /> <tr><br /> <td>lua <code>planfile</code></td><br /> <td> </td><br /> <td>The Lua converter is the most powerful one. It takes a lua file as another parameter. This Lua file provides the color conversion descriptions implemented as Lua functions.</td><br /> </tr><br /></table><br />For example, to convert the colors in a PDF file using the included example.lua file, you would use the following command:<br /><code><br /> ./podofocolor lua example.lua input.pdf output.pdf<br /></code><br /><br /><br /><h2>Writing own converters</h2><br /><br />For the tool to be really useful, you will have to create your own converter. This can either be done by implementing the C++ interface IConverter or by creating a small and simple Lua script. If you consider creating a C++ implementation of the interface, the included Doxygen comments will be enough to get you started (Yes, it is that simple! For example, the grayscale converter consists of only 44 lines of source code and most other conversions will be the same size), so we will skip the C++ part and go straight to Lua.<br /><br />Lua is a very simple, yet powerful, scripting language. To get started, it is best to download the example.lua file included in PoDoFo. It contains all the necessary function definitions, which you can adapt to your needs.<br /><br />We will start with a short example: whenever <i>podofocolor</i> finds a definition of a stroking color on a PDF page (i.e. a color which is used when drawing lines or curves), it will call one function in the Lua script. The function called depends on the colorspace of the color definition. Currently, there are three different functions that can be called. set_stroking_color_gray will be called when a grayscale color is defined. Similarly, set_stroking_color_rgb or set_stroking_cmyk are called. <br />The example below shows an implementation of set_stroking_color_rgb with a rather simple implementation. The function gets the three parameters r, g, and b, which refer to the values of the red, green, and blue color components. The values are in the range of 0.0 to 1.0 as it is common in PDF files, where (0.0, 0.0, 0.0) is black and (1.0, 0.0, 0.0) is red. Now to the concrete function implementation: It checks if the passed color is black, if yes it returns a tuple with four values – which is a CMYK color – and thereby converts any occurrence of RGB black to CMYK black. For all other color values a tuple with three values is returned and the RGB color is not changed. Another option would have been to return a tuple with a single value and thereby convert the color to a gray value.<br /><br /><code><br />function set_stroking_color_rgb (r,g,b)<br /> -- convert all black rgb values to cmyk,<br /> -- leave other as they are<br /> if r == 0 and<br /> g == 0 and<br /> b == 0 then<br /> return { 0.0, 0.0, 0.0, 1.0 }<br /> else<br /> return { r,g,b }<br /> end<br />end<br /></code><br /><br />Other functions in the script provide information about pages, objects, etc...<br /><br /><h2>Limitations</h2><br /><br />Currently this tool does not convert images embedded in the PDF file. First of all, the focus of the tools is on modifying colors in PDF files and secondly, there are other tools, which can modify colors in images and/or work with images embedded in PDF files. If there is demand for such a feature, it can be easily added. <i>Podofoimgextract</i>, another PoDoFo-tool, is a good example of how easy it is to work with images using the PoDoFo API.<br /><br /><h2>Download</h2><br /><br /><i>Podofocolor</i> is currently available in SVN trunk. Instructions on how to get and build PoDoFo trunk can be found on our <a href="http://podofo.sf.net">website</a>. It works on all supported platforms, including Windows and Unix systems. We are interested in your feedback! Feel free to drop a mail containing your feedback, comments, or suggestions to our mailing-list <a href="mailto:podofo-users@lists.sourceforge.net">podofo-users@lists.sourceforge.net</a>.Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com13tag:blogger.com,1999:blog-1729203473305809245.post-64943654461210647992010-09-15T07:00:00.000-07:002010-09-15T07:14:28.598-07:00New sort modes in KRenameAn often requested feature in <a href="http://www.krename.net">KRename</a> was to have more possibilities to sort the files before renaming. This was indeed a major limitation, as it is often eligible to sort files by date or some other criteria.<br /><br />Some time ago, I found finally time to add sorting by date and today I finished a new powerful <b>custom sorting</b> feature, which allows to use any token to be used for sorting, which is supported by one of the plugins provided by <b>KRename</b>. This means sorting is now possible by almost any criteria, like <b>[filesize]</b>, <b>[creationdate]</b>, <b>[user]</b> or even <b>[##tagTrack]</b>. Of course, you can choose whether you want to sort ascending, descending or by numbers.<br /><br />The screenshot below shows the new selection of sorting options in <b>KRename</b>.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Yp5wtzmTeNk/TJDTFnVhbvI/AAAAAAAAADo/wpmv59FrIAQ/s1600/krename_sort3.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 196px; height: 271px;" src="http://2.bp.blogspot.com/_Yp5wtzmTeNk/TJDTFnVhbvI/AAAAAAAAADo/wpmv59FrIAQ/s320/krename_sort3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5517141636940918514" /></a><br /><br />If you click on "Custom...", you get a dialog like the one below, to specify what sorting criteria you want to use.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Yp5wtzmTeNk/TJDTVeSNXjI/AAAAAAAAADw/lkq1NA2rzog/s1600/krename_sort1.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 130px;" src="http://1.bp.blogspot.com/_Yp5wtzmTeNk/TJDTVeSNXjI/AAAAAAAAADw/lkq1NA2rzog/s320/krename_sort1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5517141909389008434" /></a><br /><br />The final result might look like this, see the screenshot of Dolphin as a proof that we really sort by <b>[filesize]</b>:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Yp5wtzmTeNk/TJDUOAKF7PI/AAAAAAAAAD4/h7U-tRWZoJU/s1600/krename_sort2.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 206px;" src="http://4.bp.blogspot.com/_Yp5wtzmTeNk/TJDUOAKF7PI/AAAAAAAAAD4/h7U-tRWZoJU/s320/krename_sort2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5517142880554446066" /></a><br /><br />This feature is currently only available in <a href="http://domseichter.blogspot.com/2010/02/building-krename-trunk-from-svn.html">KRename SVN trunk</a>. Still, I would be interested in your <a href="mailto:krename-users@lists.sf.net">feedback</a>.Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com1tag:blogger.com,1999:blog-1729203473305809245.post-77864405756283634482010-08-17T09:43:00.001-07:002010-08-19T02:17:46.828-07:00KBarcode4-light releasedWhere is <a href="http://www.kbarcode.net">KBarcode</a> for KDE4? Well, there are porting efforts under way in <a href="https://kbarcode.svn.sf.net/svnroot/kbarcode/trunk">SVN</a>, but these are sadly far from completion.<br /><br />If you just want to create barcodes easily and save them as image or a PDF, rescue might be near in the form of <a href="https://sourceforge.net/projects/kbarcode/files/KBarcode4-light/0.2/kbarcode4-light-0.2.tar.gz/download">KBarcode4-light</a>. <b>KBarcode4-light</b> is a simple barcode generator for KDE4. It supports many 1D and 2D barcode formats and can export them as images or PDF files.<br /><br />It is similar to <a href="http://www.kbarcode.net">KBarcode</a> for KDE3, but less powerful. <b>KBarcode4-light</b> allows only to create single barcodes. As the port for KBarcode is not yet ready and no one knows when it will be ready, <b>KBarcode4-light</b> provides basic barcode generation for KDE. An additional benefit is that it provides an easy to use interface for Barcode Writer in Pure Postscript.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Yp5wtzmTeNk/TGq9QndfdJI/AAAAAAAAADY/0DlxecQRXEo/s1600/kbarcode4-light1.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 277px;" src="http://2.bp.blogspot.com/_Yp5wtzmTeNk/TGq9QndfdJI/AAAAAAAAADY/0DlxecQRXEo/s320/kbarcode4-light1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5506421587582088338" /></a><br /><br />It is written in Python using the amazing PyQt4 Qt bindings and based on <a href="http://www.terryburton.co.uk/barcodewriter/">Barcode Writer in Pure Postscript</a> by Terry Burton.<br /><br /><b>KBarcode4-light</b> <a href="https://sourceforge.net/projects/kbarcode/files/KBarcode4-light/0.2/kbarcode4-light-0.2.tar.gz/download">downloads</a> are available. It requires Python and PyQt bindings for Qt4, as well as Ghostscript in your PATH. Please submit any feedback to the <b>KBarcode</b> <a href="mailto:kbarcode-users@lists.sf.net">mailing list</a>.<br /><br /><b>UPDATE:</b> Due to a small bug, a new fixed version 0.2 is available for <a href="https://sourceforge.net/projects/kbarcode/files/KBarcode4-light/0.2/kbarcode4-light-0.2.tar.gz/download">downloads</a>.Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com3tag:blogger.com,1999:blog-1729203473305809245.post-84120662503939524282010-08-07T07:53:00.000-07:002010-08-07T07:55:26.447-07:00podofocrop: PDF cropping in 10 lines of codeThe <a href="http://podofo.sf.net">PoDoFo</a> tools family got a new member during the last week: <b>podofocrop</b>. This little tool crops the white margins of pages in PDF files.<br /><br />I use tools like these a lot, for example when writing scientific papers or the like, because I try to include all figures as PDF files to have better quality in the final PDF. To do so, it is often necessary to remove the margin around the figure before including it. This is exactly what <b>podofocrop</b> is doing.<br /><br />The figure below illustrates what <b>podofocrop</b> is doing. Figure (a) shows the input PDF file, we can see a page with a little bit of text and a big white margin. In the next step, Figure (b), <b>podofocrop</b> calculates the bounding box for the final PDF, i.e. the area on the page that has content and the size to which we want to crop the PDF. <a href="http://www.ghostscript.com/">Ghostscript</a> is used for this step and has to be in your PATH. Finally, the PDF is cropped and the new page is much smaller without any disturbing margins.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Yp5wtzmTeNk/TF1zl9p58mI/AAAAAAAAADQ/wWoHylXw93U/s1600/podofocrop.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 158px;" src="http://4.bp.blogspot.com/_Yp5wtzmTeNk/TF1zl9p58mI/AAAAAAAAADQ/wWoHylXw93U/s320/podofocrop.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5502681415759295074" /></a><br /><br />If you are interested, get <b>podofocrop</b> from the <a href="http://podofo.sourceforge.net/download.html">PoDoFo SVN</a>. In case of questions, please contact the <a href="http://podofo.sourceforge.net/support.html">mailing list</a>.<br /><br /><b>Please note:</b> Windows support is still experimental and untested so far. It will compile but there are no guarantees that it will work. Help with the Windows port would be greatly appreciated.<br /><br />At the end, let we give you one little detail on the implementation, because it is so amazingly simple using <a href="http://podofo.sf.net">PoDoFo</a>. If you remove the code for parsing command line arguments, communication with Ghostscript and error handling, you see that the tool has only a few lines:<br /><br /><code><br /> std::vector<PdfRect> cropBoxes = get_crop_boxes_from_gs( pszInput );<br /> PdfVariant var;<br /> PdfMemDocument doc;<br /> doc.Load( pszInput );<br /><br /> for( int i=0;i<doc.GetPageCount(); i++ ) <br /> {<br /> PdfPage* pPage = doc.GetPage( i ); <br /> cropBoxes[i].ToVariant( var );<br /> pPage->GetObject()->GetDictionary().AddKey( PdfName("MediaBox"), var );<br /> }<br /><br /> doc.Write( pszOutput );<br /></code>Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com5tag:blogger.com,1999:blog-1729203473305809245.post-31520481866907415372010-07-21T04:00:00.000-07:002010-07-21T04:02:00.799-07:00KRename post on SourceForge.net BlogThe <a href="http://sourceforge.net/blog/">SourceForge.net Developers Blog</a> has a nice little post about <a href="http://sourceforge.net/blog/master-file-renaming-tasks-with-krename/">KRename</a>.<br /><br />Take a look!Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com0tag:blogger.com,1999:blog-1729203473305809245.post-71258167008636554082010-05-29T08:37:00.000-07:002010-05-29T08:56:10.930-07:00Organising publications using KRenameI have to work with lot's of scientific publications at the moment. That means, I have a large directory with many PDFs that are related to my work. Sometimes, it is cumbersome to find the right PDF or publication to look something up. Of course, I could rename every PDF after I downloaded it by hand, but - you might guess it - I am to lazy for this.<br /><br />But help is in sight! I added a plugin to <a href="http://www.krename.net">KRename</a>, which can rename files based on meta-data included in PDF files. Organising a large set of publications is now a matter of adding the PDF files to KRename and using the template "<span style="font-style:italic;">[pdfAuthor] - [pdfTitle]</span>". Convenient, isn't it? The screenshot below shows <a href="http://www.krename.net">KRename</a> while renaming a few PDF files.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Yp5wtzmTeNk/TAE4kT_QxUI/AAAAAAAAADI/vzGx2KB3aoE/s1600/krename_podofo2.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 239px;" src="http://1.bp.blogspot.com/_Yp5wtzmTeNk/TAE4kT_QxUI/AAAAAAAAADI/vzGx2KB3aoE/s320/krename_podofo2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5476720818351293762" /></a><br /><br />The supported tags are [pdfPages] (number of pages), [pdfProducer], [pdfTitle], [pdfSubject], [pdfKeyword], [pdfCreator] and, [pdfAuthor]. If you have an idea for further meta-tags, do not hesitate to contact me. It should be quite easy to add more information, the current implementation is a matter of 10 lines thanks to the <a href="http://podofo.sf.net">PoDoFo</a> library used. <br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Yp5wtzmTeNk/TAE4B9f6_qI/AAAAAAAAAC4/EzpQm--vaBc/s1600/krename_podofo1.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 239px;" src="http://1.bp.blogspot.com/_Yp5wtzmTeNk/TAE4B9f6_qI/AAAAAAAAAC4/EzpQm--vaBc/s320/krename_podofo1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5476720228198710946" /></a><br /><br /><br />A pity is that many PDF authors do not add proper meta-data to their PDF files. So, if you are writing on a publication at the moment, please make sure you add your information to the PDF metatags.<br /><br />This feature is currently only available in <a href="http://domseichter.blogspot.com/2010/02/building-krename-trunk-from-svn.html">KRename SVN trunk</a>.Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com1tag:blogger.com,1999:blog-1729203473305809245.post-18345915551191978332010-04-29T15:33:00.000-07:002010-04-29T15:45:26.248-07:00PoDoFo Base 14 Font supportToday has seen a major contribution to the <a href="http://podofo.sf.net">PoDoFo</a> PDF library.<br /><br />I integrated a patch by <a href="http://www.pdf3d.co.uk/">Ian Curington and his developers</a>, which brings support for using the base 14 fonts in PDF files. What are the base 14 fonts, you might ask? <br /><br />Every PDF viewer has to ship with these 14 fonts, therefore one can achieve much smaller file sizes, as these particular 14 fonts do not have to be embedded into the PDF. Still, the PDF is displayed the same on every system (<span style="font-style:italic;">should be displayed ...</span>), as every PDF viewer has the same font metrics for these fonts. Among the base 14 fonts are Helvetica, Times, Courier and Symbol.<br /><br />This contribution makes the base 14 fonts available to everyone creating PDFs using <a href="http://podofo.sf.net">PoDoFo</a>. As the base 14 fonts are automatically used, whenever you request a PdfFont like Helvetica, this should result in much smaller file sizes for PDFs created with PoDoFo, which only use these fonts. An <a href="http://krename.sourceforge.net/data/podofo-base14.pdf">example</a> which does also compare one of the base 14 fonts (Helvetica) to a TrueType font (Arial) is also provided. Okular has some problem displaying the symbol fonts, which I have yet to investigate.<br /><br />If you would like to try the change, please grab the latest <a href="http://podofo.sf.net">PoDoFo</a> from <a href="http://podofo.sourceforge.net/download.html#svn">SVN</a>. The change is not included in the latest <a href="http://podofo.sourceforge.net/download.html#podofo">0.8.0 release</a>.Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com1tag:blogger.com,1999:blog-1729203473305809245.post-46543750569813387322010-04-06T12:32:00.000-07:002010-04-06T12:44:56.944-07:00A web-radio plasmoid for your desktopSince I am in Limerick, Ireland, I started to listen quite a lot to <a href="http://www.rte.ie/radio/">RTÉ 2XM</a>, which is a great web-radio station of the public broadcasting service in Ireland (<a href="http://dynamic.rte.ie/av/live/radio/0304.asx">Click for webstream</a>).<br /><br />RTÉ has a quite nice <a href="http://www.rte.ie/radio/gadgets/player.html">applet</a> for the Windows Vista or Windows 7 sidebar. Unfortunately, the do not <span style="font-style:italic;">yet</span> offer one for KDE and Plasma. Instead of waiting for the applet, I wrote a little web-radio applet by myself yesterday.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Yp5wtzmTeNk/S7uNYPUZsgI/AAAAAAAAACg/c7235vE6xzA/s1600/plasmaradio1.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 278px;" src="http://3.bp.blogspot.com/_Yp5wtzmTeNk/S7uNYPUZsgI/AAAAAAAAACg/c7235vE6xzA/s320/plasmaradio1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5457110821057966594" /></a><br /><br />The plamoid has a simple list of radio stations and a play and a stop button. Easy, isn't it? Of course you can configure the list of stations. If you <a href="http://krename.sourceforge.net/data/plasmaradio-0.1.tar.gz">download</a> and install it, it comes preconfigured with all the RTÉ stations and my favourite Austrian station <a href="http://fm4.orf.at">FM4</a>.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Yp5wtzmTeNk/S7uORXlFGlI/AAAAAAAAACo/jW0WGx0fJ9s/s1600/plasmaradio2.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 154px;" src="http://4.bp.blogspot.com/_Yp5wtzmTeNk/S7uORXlFGlI/AAAAAAAAACo/jW0WGx0fJ9s/s320/plasmaradio2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5457111802527947346" /></a><br /><br />You can download the plasmoid from here: <a href="http://krename.sourceforge.net/data/plasmaradio-0.1.tar.gz">http://krename.sourceforge.net/data/plasmaradio-0.1.tar.gz</a>.<br /><br />To install the plasmoid, follow the following steps after downloading it:<br /><code><br />tar xvfz plasmaradio-0.1.tar.gz<br />cd plasmaradio-0.1<br />mkdir build<br />cd build<br />cmake -DCMAKE_INSTALL_PREFIX=$KDEDIRS ..<br />make<br />make install<br /></code><br /><br />I would be happy to receive some feedback on this little piece of code. By the way, I think it really shows what great stuff can be done in so little time using the KDE4 API.Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com9tag:blogger.com,1999:blog-1729203473305809245.post-77086311812121737532010-02-24T09:09:00.000-08:002010-02-24T09:19:33.207-08:00Detection of architecture violations in C/C++ applicationsIn a small project, I am experimenting with a cleaner and in this case layered architecture for certain parts of <a href="http://podofo.sf.net">PoDoFo</a>. I think it is a quite usual problem, to have an architecture and a grown application and you would like to check whether the sources adhere to the previously defined architecture. Therefore, it is important to have tools to check for architecture violations. These can be used to validate the architecture at certain points of time or even after each commit to the source repository on a continuous integration server.<br /><br />I did not know any tool which can easily do this kind of validations for C/C++ source code, so I came up with a small bash script that does exactly this. The only configuration needed are some rules that define the architecture. Architecture is in this case a layered architecture where certain modules are only allowed to include certain other modules. See image 1 for a small UML diagram of the architecture. <br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Yp5wtzmTeNk/S4VfjUsatKI/AAAAAAAAACY/zPs_Y5_4EqY/s1600-h/podofo_layers_architecture.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 270px; height: 320px;" src="http://3.bp.blogspot.com/_Yp5wtzmTeNk/S4VfjUsatKI/AAAAAAAAACY/zPs_Y5_4EqY/s320/podofo_layers_architecture.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5441860785202181282" /></a><br /><br />These rules can be edited at the top of the script:<br /><code><br />RULES="content->structure \<br /> content->datatype \<br /> content->io \<br /> content->util \<br /> structure->datatype \<br /> structure->io \<br /> structure->util \<br /> datatype->io \<br /> datatype->util \<br /> io->util \<br /> content->fontconfig \<br /> content->Carbon \<br /> util->\.\. \<br /> src->.* \<br /> .*->tr1 \<br /> .*->sys" <br /></code><br />As you can see, it is also possible to use regular expressions. Also, I had to add some rules for includes like fontconfig (external libraries) that are not available in the UML diagram above. <br /><br />The script produces quite a lot of output, but grepping for "violation" shows only the important results:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Yp5wtzmTeNk/S4Vdcpy3JcI/AAAAAAAAACQ/tSkxxw96U2M/s1600-h/check_architecture.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 163px;" src="http://1.bp.blogspot.com/_Yp5wtzmTeNk/S4Vdcpy3JcI/AAAAAAAAACQ/tSkxxw96U2M/s320/check_architecture.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5441858471584015810" /></a><br /><br />If you are interested you can get the bash script from here: <a href="http://krename.sourceforge.net/data/check_architecture.sh">check_architecture.sh</a> The script should be self-explaining and pretty easy to adapt to your needs.Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com1tag:blogger.com,1999:blog-1729203473305809245.post-12245179536323150692010-02-14T06:31:00.000-08:002010-02-14T06:37:35.566-08:00Building KRename trunk from SVNI just noticed that there is no up to date documentation on how to build KRename trunk from SVN on our <a href="http://www.krename.net">website</a>. Well, everyone who is interested in getting the latest version of KRename and does not want to wait for the next release - these are the steps to get KRename trunk from SVN and build it.<br /><br /><code><br />svn co https://krename.svn.sourceforge.net/svnroot/krename/trunk krename<br />cd krename<br />mkdir build<br />cd build<br />cmake -DCMAKE_INSTALL_PREFIX=$KDEDIR ../<br />make<br />sudo make install<br /></code><br /><br />This assumes that $KDEDIR is an environment variable pointing to your KDE installation. You can set $KDEDIR using the following bash command:<br /><code><br />export KDEDIR=/usr<br /></code><br /><br />Most other KDE applications can be built the same way.Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com1tag:blogger.com,1999:blog-1729203473305809245.post-56178140071017733402010-02-06T07:02:00.000-08:002010-02-06T07:10:56.407-08:00Generic web-service queries on your desktop using PlasmaSome days ago, I applied for a new passport. In Munich, where I currently live, you apply for the passport at the city hall and usually can pick the passport up there 3 weeks later. I was surprised to see that they have a new service: You get an ID number with which you can check the status of your passport via a web-service. So, if you check regularly, the web-service will tell you when your<br />passport is ready to pick it up.<br /><br />What is the usual you do in cases like that? Of course, you write a Plasmoid that checks the web-service periodically and informs you when your passport is ready. This plasmoid - <span style="font-weight: bold;">PersonalKwery</span> - can be seen in screenshot 1.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Yp5wtzmTeNk/S22FZM-GwTI/AAAAAAAAAB4/jaegHLhBgHg/s1600-h/personalkwery1.jpeg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 149px;" src="http://2.bp.blogspot.com/_Yp5wtzmTeNk/S22FZM-GwTI/AAAAAAAAAB4/jaegHLhBgHg/s320/personalkwery1.jpeg" alt="" id="BLOGGER_PHOTO_ID_5435146993330995506" border="0" /></a><br /><br />Thinking further about this quick hack, I came to the conclusion that with only a little bit of work, I could create a generic plasmoid that can query webservices and display the result on your desktop. I managed to create a plasmoid that takes the following configuration:<br /><ul><br /><li>Base URL of the web-service</li><br /><li>Attributes to the URL (like the ID number of my passport, or arguments to a Google query)</li><br /><li>An optional XSLT to transform the results</li><br /><li>An interval, how often the query should be performed</li><br /></ul><br /><br />With this little configuration you can easily query many web-services. Of course, most users won't be in the mood to create their own XSLT transformations! Therefore it is possible to store the configurations as XML and share them - for example over "get hot new stuff". In this case, users can<br />download predefined web-service queries and only have to enter a few necessary attribute values. The screenshot below shows the configuration dialog for a query:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Yp5wtzmTeNk/S22Fyc17QCI/AAAAAAAAACI/YUDJyF6T1D4/s1600-h/personalkwery3.jpeg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 280px;" src="http://4.bp.blogspot.com/_Yp5wtzmTeNk/S22Fyc17QCI/AAAAAAAAACI/YUDJyF6T1D4/s320/personalkwery3.jpeg" alt="" id="BLOGGER_PHOTO_ID_5435147427088384034" border="0" /></a><br /><br />Another small example is a simple query, that get's your current internet IP address.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Yp5wtzmTeNk/S22Fo_NuDCI/AAAAAAAAACA/tb0f1RYaUnM/s1600-h/personalkwery2.jpeg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 239px; height: 70px;" src="http://1.bp.blogspot.com/_Yp5wtzmTeNk/S22Fo_NuDCI/AAAAAAAAACA/tb0f1RYaUnM/s320/personalkwery2.jpeg" alt="" id="BLOGGER_PHOTO_ID_5435147264516295714" border="0" /></a><br /><br />Of course, the tool is not perfect yet and can be made more user friendly. If you are interested, you can get the tarball here: <a href="http://krename.sourceforge.net/data/personalkwery/personalkwery-0.1.tar.gz">personalkwery-0.1.tar.gz.<br /></a>Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com3tag:blogger.com,1999:blog-1729203473305809245.post-30655040193239061262009-11-29T01:35:00.002-08:002009-11-29T01:59:09.541-08:00"Modifiers" in KRename<a href="http://www.digikam.org/drupal/blog/135">Andi Clemens</a> did some amazing work on the batch renamer included and integrated into digiKam. I really like the simple UI and some of the features he included. I think I can get some inspiration from him for KRename (e.g. syntax highlighting).<br /><br />Lately he posted over the topic of <a href="http://www.digikam.org/drupal/node/487">"Modifiers" in the digiKam rename tool</a>, which he added to digiKams renamer and was not able to find in KRename. Modifiers are a way to convert a token, let's say the name of a directory or the artist of a mp3 in some way before inserting it. For example if you insert the name of the directory into the new filename and the directory name is in all uppercase and to match the look of the new filename, you want it to be inserted in lowercase. In digiKam's renamer it is achieved by the token:<br /><code>[dir.]{lower}</code><br /><br />In KRename you would use:<br /><code>[%dirname.]</code><br /><br />So contrary to Andi's post, KRename has modifiers, too. You can add a modifier before any token (after the opening bracket and before the actual name of the token). The modifierst are those used to insert filename's and convert there case. To list the most important ones: <table><br /><tr><td>$</td><td>No conversion, insert the token as it is</td></tr><br /><tr><td>%</td><td>Convert to lowercase</td></tr><br /><tr><td>&</td><td>Convert to uppercase</td></tr><br /><tr><td>*</td><td>Convert every first letter in a word to uppercase</td></tr><br /><tr><td>##</td><td>Format a number with leading zeros</td></tr><br /></table><br /><br />So you can even use modifierst to format numbers for tokens that return number. For example [##tagTrack] will insert the track number of a MP3 formatted with one leading zero if the track number is less than 10.<br /><br />It is true that KRename does not have a really readable syntax for modifiers here, I think appending {upper} or {lower} like digiKam does it, is a good idea. But there are several other places, too, where the KRename syntax could be improved. I hope that this post will help a few people that also did not know about this feature.<br /><br /><a href="http://1.bp.blogspot.com/_Yp5wtzmTeNk/SxJFDbI3T4I/AAAAAAAAABw/cMhJTqZ81E0/s1600/krename_modifiers.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 223px;" src="http://1.bp.blogspot.com/_Yp5wtzmTeNk/SxJFDbI3T4I/AAAAAAAAABw/cMhJTqZ81E0/s320/krename_modifiers.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5409462027552247682" />Modifiers in action</a>Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com5tag:blogger.com,1999:blog-1729203473305809245.post-39078085406324550382008-11-11T10:47:00.001-08:002008-11-11T10:57:24.643-08:00KRename on WindowsSome time ago - during a longer trip by train - I booted the Windows XP installed on my Eee PC and tried to port <a href="http://www.krename.net">KRename</a> to Windows. Thanks to the efforts of the <a href="http://windows.kde.org/">KDE on Windows team</a> it was only a matter of about 1-2 hours. <br /><br />You don't believe it? Well see the screenshots:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Yp5wtzmTeNk/SRnT1-b_M_I/AAAAAAAAABg/G8G4JNzK4I8/s1600-h/krename_win01.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 187px;" src="http://2.bp.blogspot.com/_Yp5wtzmTeNk/SRnT1-b_M_I/AAAAAAAAABg/G8G4JNzK4I8/s320/krename_win01.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5267474163433419762" /></a><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Yp5wtzmTeNk/SRnT--hDOuI/AAAAAAAAABo/kn-6lC5zQ2I/s1600-h/krename_win02.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 187px;" src="http://2.bp.blogspot.com/_Yp5wtzmTeNk/SRnT--hDOuI/AAAAAAAAABo/kn-6lC5zQ2I/s320/krename_win02.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5267474318073477858" /></a><br /><br />I am really impressed how easy it is to get KDE on Windows installed and start compiling using Visual Studio. The only changes necessary were related to some Unix syscalls in the Permissions and Date&Time plugin. To try KRename out, it is best to get a current snapshot from <a href="https://krename.svn.sourceforge.net/svnroot/krename">SVN</a> (I justed checked in the changes necessary for compilation on Win32).<br />A pre-compiled binary can be found <a href="http://krename.sourceforge.net/data/krename_win32/krename-20081111.exe">here</a>. It requires a working installation of KDE 4.1 for Windows. Simply copy it to %KDEDIR%/bin and it should work. If there is interest I might try to provide a real setup for Windows or create more regularly SVN builds.Dominik Seichterhttp://www.blogger.com/profile/07438239121288182199noreply@blogger.com5