getopt vs. optparse

Last week I was getting the MessageBroker started for the DustBot project. I needed some code for logging, and starting the server. Since I wanted to have a simple way to specify command line parameters for the MessageBroker I thought about writing some getopt code to do this. This was the time I stumbled upon Poco. Poco is a C++ library that helps to build networking application. One such module provides easy networking to C++. In addition it also provides some helper classes to easily set up a deamon application including parsing the command line parameters.

To parse the command line parameters with Poco was much easier then with getopt and was done very quickly. At this point I thought why do I not have something like this in Python? After a quick search I found optparse a Python module that helps to parse the command line parameters in a much easier way then getopt. To check if it works as easy as it looked like I integrated it into the regexplace script I posted earlier (Change of multiple files). The new version is uploaded to the wiki and can be downloaded from here.
If you need to parse command line parameters with python I recommend the optparse module. Since it really works well and is much easier to use then getopt.

AOL moves to Jabber?

GOOD NEWS, EVERYONE!

This post (AOL adopting xmpp aka jabber) looks very promising.
I hope that AOL will adopt jabber. This way I would be freed once more from a proprietary protocol that I have to use.

Managed C++ vs. C++/CLI vs. C++

When I started my latest project where I needed some basic C libraries to access the Hardware. I thought I will use a Windows Forms Application with C++. I hoped this offers me writing normal C++ code and still use the new UI code from MS. In addition it would possible to port the application since the underlying C library is platform independent and C++ if correctly separated from the UI code should compile as well.

To bad it was not as easy as I hoped it will. The next time I might just chose an MFC Application where I can write native C++ code and I don’t have to bother with some magic C++ addition.

I had quite a hard time to figure out how I need to structure my application that it will work in managed mode. After some googeling I figured out that there are two different things: Managed C++ and C++/CLI. Managed C++ was the old addition from MS. With Visual Studio 2005 they added C++/CLI which is an ECMA standard and has a similar scope as Managed C++. The keywords of C++/CLI are no more marked with two underlines in front as it was with Managed C++. At the end I found an overview that explained me the strange keywords that I found in the new generated code.

The following links give a good overview about the differences between the C++ and C++/CLI:

The result of all this is that my application will not be portable at all since all the code is infected with CLI code. It would have been possible to separate the C++ code from the CLI code in such a way that it could be reused on an other platform but since it is only a prototype and it just has to work on windows. I will leave that for an other time. To separate C++ code from C++/CLI code it is necessary to write some glue code since CLI does not support all features from C++.

Cryptography Libraries

Yesterday evening i stumbled over cryptolib. A crypto library that looks quite good and feature rich. In addition the library has bindings to a lot of different languages for example: C/C++, Python, Java, C#, Delphi,…

In the past I got some experience with OpenSSL which worked well but has almost no documentation at least for the development interface. The cryptolib has a very nice documentation as far as I can tell. It is very easy to read not the usual library gibberish that is almost as boring as sitting in a waiting room.

The library is distributed under a dual license one opensource license the Sleepycat license and a commercial license. But it is still free to be used for small and research application without a buying a license.

The documentation of the library has also some interesting information about the usage of cryptography in applications. It describes how security is used today and who this could be improved.

Change of Multiple Files

Today needed to change the namespace of my project. Since this would lead to go through all the sourcefiles and change the namespace I was looking for a tool that helps me with this. After a few search request I found in the beginning only windows tools. Then I found a python script that helped in the ActiveState Python Cookbook.

I made some small changes to the script to get it easier to use.

  • use of getopt to get the command line parameters.
  • added ignore regex to specify files/directories that should be ignored
  • changed the use of the regex for the files. now match is used instead of search

The script can be found here

An example how to to use the script you find here.

An other way to solve this problem would be using a full featured development environment. But since the project was setup with vim this was not an option.

CPPUnit

For the DustBot project here at the University I needed a test framework for C++. I found CPPUnit what looked like what I was looking for but it took me almost a day to figure out how to use it. The example in the CPPUnit Cookbook shows everything you need to now but there was no complete ready to use example. What I wanted was just an easy example ready to use. I found on Wikipedia (CPPUnit) a simple example but this was not complete there was the TestRunner missing.

I wrote a short example/tutorial with a few comments how to setup a test framework for your C++ application. You will find the tutorial here and the example code here.

Mario Galaxy

Mario Galaxy
Yesterday I found finally time to start playing Mario Galaxy and all I can say is WOHAAAAAAAAAA. Nintendo did a great job on this game. The control is very easy even if you have to walk on the walls and your stand on very small planets where you get around very quickly.

I only got about 6 stars yet but I could already fly around as Bee Mario. I am very excited to see what more brilliant ideas they have come up with.

Yaom

Yaom LogoI haven’t talked about my project yet. As a short introduction Yaom has the goal to be a media center that satisfies my personal needs of a media center. I tried other open source media centers before. Every one has it good points and they are quite major sometimes. I tried to improve them but some time they just did not fit for what i wanted. So I decided to do it my self.
The main goal is to have every functionality as a plugin, that if a plugin can’t do what you want it should be easy to replace it.

At the moment I have a kernel with a configuration backend working, both will be used by the plugins. The rest of the functionality shold be implemented in the plugins not should not be fixed in the application.

Today I just got the file loader for the audio backend working. It now loads the files and stores the meta information of the audio files with the help of kaa.metadata into the data base. For the database access I use the object-relational mapper Storm from Canonical. It is quiet easy to use so far.

Chines Dinner Scene

Chinese Dinner SceneI just finished today a chines dinner scene for a gift card. I removed the invitation text from the chines fan. I kinda like the result, if I would have more time I would try to improve the spring roles and I would tweak the materials of the spring roles and the dumplings a bit to get a more realistic feeling. But it has to be finished now and I’m satisfied with the result.

It took me about 3 evening to create the scene. I used materials from the Blender Open Material Repository. The dishes use the whitemarble material with changes in the scaling of the marble structure. The wood materials are from the Blender Material Database. The Teapot I got from the Blender Model Repository. All other objects I created by my self.

Getting started!

I just set up the blog on the enterprise lab. I will write about my projects here.

« Previous Page