copyiptcandxmp updated

I have updated the script formerly called “fixgpsandtags” so that it can now be used to more generally copy IPTC and XMP data to processed images. Therefore it is now called “copyiptcandxmp”. Such a step is often necessary because raw processing tools ignore XMP or IPTC completely. This script simplifies the process because several patterns can be specified how the original raw file name can be deduced from the processed file name. ...

June 3, 2012 · updated April 30, 2021 · 1 min

Relative RPath Settings with CMake

The run-time search path (rpath) defines paths to search for dynamic libraries when executing a program. It is a mechanism on Linux parallel to the LD_LIBRARY_PATH environment variable, which is another hint to find dynamic libraries. Usually, it is a good idea to make software which you built relocatable. This means that created binaries can be moved around and they still work after the location change. This includes the ability to still find the correct versions of dynamic libraries. One simple way to achieve this is by setting the rpath relative to the current location of the binary. In CMake this can be achieved like this: ...

February 16, 2012 · updated April 30, 2021 · 1 min

Using Dependency Tracking in Jenkins with CMake-based C++ Projects

If you are building multiple related software projects with a continuous integration server one important aspect is to be notified when changes in an upstream job break the build or tests for a downstream job. This involves knowing which exact build numbers of the upstream and the downstream job are involved. The Jenkins continuous integration server uses the notion of file fingerprints for this purpose. The upstream job is built by Jenkins and produces one or several so called artifacts, the results of the build process. The artifacts are archived by Jenkins and fingerprints (hash sums) for each artifact are created and stored along with the build number of the job. When the downstream job starts to build it downloads the (most recent) artifacts from the upstream job and uses them for its purposes, i.e. building and running the own source code. By comparing the fingerprints of the downloaded artifacts with the stored fingerprints Jenkins knows which version of each upstream job was involved in a build and can track which upstream build number broke the downstream job. Jenkins will only issue notifications if this fingerprinting mechanism is properly configured, triggering a build after another is not sufficient to receive these notifications. Moreover, the Blame Upstream Commiters plugin needs to be used and enabled for each downstream job or the global property hudson.upstreamCulprits (will this ever be renamed?) needs to be set. ...

July 31, 2011 · updated April 30, 2021 · 6 min

Gcov Coverage Reports in Jenkins

I am currently evaluating the applicability and limitations of the Jenkins continuous integration server for C++ development. Besides several limitations which are mainly caused by the complexity of C++, Jenkins provides a solid basis for continuous integration of C++ projects. One thing which I was not happy with so far was the missing integration of open-source coverage tools for Linux. Here, Gcov can be used to generate more or less precise coverage reports for projects compiled with GCC. Unfortunately, Gcov itself does not provide tools to export the results in any common or even nicely readable format. Until now, the only working solution I found was to use the Gcov front-end LCOV to generate a HTML report. This report is nice to read but it cannot be tracked by Jenkins with the drawback that no trend report for the code coverage can be generated. Nevertheless, I’ve wrapped the creation of such a HTML report in a CMake function and worked with it so far. ...

April 9, 2011 · updated April 30, 2021 · 2 min

Evaluation of Default Arguments in Python

Today I stumbled upon a very subtle problem with default arguments in python. I noticed that loading a python module already instantiated one of my classes even though I could not find an installation of this class. In the end it turned out to be a default argument for a function: def foo(arg=MyClass()): pass As I am currently programming a lot in C++ this did not look suspicious to me. But from python’s point of view it absolutely makes sense that the default value for arg is already constructed at module load time and not only on a call to that functions. Moreover it is important to remember that this default argument is constructed only once for all calls to a function as stated here. ...

January 19, 2011 · updated April 30, 2021 · 1 min

Boost bind and smart pointers

I’ve seen this several times causing troubles: boost::shared_ptr<Foo> p(new Foo); boost::thread t(boost::bind(&Foo::method, p.get())) This prevents the livecycle management of shared_ptr or any other smart pointer to be effective in the thread. Hence, p may get destructed even though the thread is still active. Boost bind can handle smart pointers, so instead use the smart pointer itself as the instance argument for bind: boost::thread t(boost::bind(&Foo::method, p))

January 9, 2011 · updated April 30, 2021 · 1 min

bash: Home Directory Not Replaced With Tilde (~)

After switching my computers to Arch Linux, reusing the existing home directories, I had the problem that the bash did not replace the user’s home directory with the tilde character (~) in the prompt. The solutions for this problem is easy: somewhere in the bash-internals a check tests whether the output of pwd matches the contents of $HOME. $HOME, in turn, is filled from the user definition in /etc/passwd. pwd always returns the current working directory without a trailing slash, but the entry for my user in /etc/passwd contained a trailing slash. Removing this slash from the file solves the problem and the prompt uses ~ again for the home directory. ...

December 30, 2010 · updated April 30, 2021 · 1 min

Ubuntu Default Browser in Thunderbird

Since the update to Ubuntu/Kubuntu Maverick Meerkat I was a bit puzzled why Thunderbird refused to open links in mails with my default browser Firefox even though it was set in the KDE settings and registered as a protocol-handler for http and https in the Thunderbird settings. It seems that there must be another setting in Thunderbird to use the default browser selected for the freedesktop environment which is now used. So updating the alternatives helped in Ubuntu: ...

November 13, 2010 · updated April 30, 2021 · 1 min

Menü Titanic

Speiseplan gestern in der Mensa: Frühlingsröllchen, Chili-Pfeffer-Dip, Reis, Eisberg mit Möhren, Kokosquark

August 27, 2010 · updated April 30, 2021 · 1 min

Ignoring Warnings from System Headers

Compiling C and C++ code with the highest warning levels is a good practice and helps spotting potential errors. For GCC the flags -Wall -Wextra will generate a lot of useful warning messages about unused parameters etc. Unfortunately, this is not the common practice and often the own compiler settings concerning the warning level results in dozens of warnings from system headers on which the own code relies, making it impossible to spot warnings from your own code in the endless mass of console output. ...

August 20, 2010 · updated April 30, 2021 · 1 min