Jan 31, 2008

Nokia to acquire Trolltech to accelerate software strategy

A news from Trolltech:
Today, Nokia has made a public tender offer for all the shares in Trolltech. We think this is great news for both you and us. In Trolltech, we have for a long time had a vision of “Qt Everywhere”. Being acquired* by Nokia, we will continue to provide you with the most advanced cross-platform software framework for desktop and devices in the market. There will be further investments in Qt and Qtopia and an even better long-term security in your decision to choose Trolltech for your business.
http://trolltech.com/company/newsroom/announcements/press.2008-01-28.4605718236

Well I am not still sure whether it is gut for users or not... Let's hope it is not :)
Thanks God, KDE have an agreement with Trolltech:
In particular, should Trolltech ever discontinue making regular releases of the Qt Free Edition for any reason — including a buyout or merger of Trolltech or the liquidation of Trolltech — the Qt Free Edition will be released under the BSD license and optionally under one or more other Open Source Licenses designated by the Board of the Foundation.
http://www.kde.org/whatiskde/kdefreeqt_announcement_20040723.php

Jan 22, 2008

Fedora 8 and KNetworkManager. Part 2

It seems OpenSUSE ships already a new version of KNetworkManager.
As far as I understand Fedora needs to have the new DBus Qt 3 bindings (currently Fedora has an old version of dbus-qt), which OpenSUSE also provides.

Jan 18, 2008

stringstream bug? Part 2

It actually appeared to be a correct behavior!
See gcc bug#31456.
The following example works as expected:

#include <iostream>
#include <sstream>

using namespace std;

int main()
{
ostringstream ss("Test",ios::out | ios::app );
cout << "#1: " << ss.str() << endl;

ss << "--";
cout << "#2: " << ss.str() << endl;
return 0;
}

Output:

#1: Test
#2: Test--

stringstream bug?

What the hell happened to std::stringstream. I have just noticed this while helping my colleague to debug his code.

#include <iostream>
#include <sstream>

using namespace std;

int main()
{
stringstream ss("Test");
cout << "#1: " << ss.str() << endl;

ss << "another string";
cout << "#2: " << ss.str() << endl;
return 0;
}

Output:

#1: Test
#2: another string

stringstream has eaten the initial string, which was provided as a parameter to the constructor.

OS: Fedora 8
Compiler: g++ (GCC) 4.1.2 20070925 (Red Hat 4.1.2-33)

this one is nice:

#include <iostream>
#include <sstream>

using namespace std;

int main()
{
ostringstream ss("Test");
cout << "#1: " << ss.str() << endl;

ss << "--";
cout << "#2: " << ss.str() << endl;
return 0;
}

Output:

#1: Test
#2: --st

XML schema forever!

Recently I've redesigned a configuration file for one of my projects. It is an XML file and was designed in a hurry. Now I have implemented it in a proper way, I believe, with some structure changes and with a custom XML schema. I am using, by the way, the xerces-c DOMBuilder interface. DOMBuilder - an interface introduced by the W3C DOM Level 3.0 Abstract Schemas and Load and Save Specification (http://www.w3.org/TR/2002/WD-DOM-Level-3-ASLS-20020409/).
Once again it was proven that with a properly written schema one can avoid a lot of "stupid" errors (when user or third-party application modifies XML configuration files) and improve security of the application. That's simply because the configuration file is validated and checked for errors even before the application starts to read configuration entries from it.
XML Schema 1.1 is a really powerful language, you can describe XML files in a very precise manner. I always thought that and once again it appeared to be a very true! I actually can't imagine someone doing XML development without using the schema. It will be a nightmare.

Unfortunately if your development platform is Linux you will face some leak of good XML editors - by "good", I also mean "free". :)
And, worth to be mentioned, a leak of tools for XML schema documentation generation. I found so-far only one tool, which is free and does generate HTML documentation from "*.xsd" files. Its name is xsddoc. And that all :(
May be I misused google, but I didn't find anything comparable for Linux. The output of xsddoc is not very sharming, as I would expect it, but at least it does the job and does it very well.

Jan 14, 2008

Is StatSVN dead?

When SVN user looks for a descent SVN statistics tool, StatSVN will definitely come up in the search.
Two years ago I have also looked for a free SVN statistic tools and StatSVN was my choice. In this post I will shortly describe my experience with the tool.
First of all, StatSVN is easy in use tool written in Java, and it has extremely simple installation :)
BTW, I am using StatSVN v.0.3.1.

Requirements
  • Java v.1.4.x. (I recommend to use Sun's Java machine, I had some problems with machines from other vendors).
  • The SVN command-line client v.13.0 or higher.
Installation and Usage
Here you can read a detailed installation and usage instruction.

Experience

#1 Multiple projects and tags

In my project I have one SVN repository for several projects. I have something like the following:

  • SVN repository
    • Project #1
      • branches
      • tags
      • trunk
    • Project #2
      • branches
      • tags
      • trunk
I wanted to have tags of the projects to be recognized and published in reports. Unfortunately StatSVN determins tags by looking at your repository's /tags directory. To be able to use this feature, you must generate a log file from the root of your repository, so that the log contains information from both the /tags and the /trunk. The checked out version does not have to contain the tags directory. With my svn layout this feature didn't work, of course.
What I did to fix it, I've just hacked a bit the svn log output file (before giving it to StatSVN) by processing it with the following command:

sed -i "s/\/$PROJECT_NAME\/tags\//\/tags\//g" svn.log

It worked for me, since I am generating statistics for each project independently.
Newer version of StatSVN, which hasn't been yet released, supports "-tags-dir" options. This option allows to use another top-level directory than 'tags'. This actually should be a solution to multiple projects in one SVN repository, like I have, or to custom SVN layouts.

#2 Broken Font
At the very beginning I had an issue with StatSVN - font of the charts' labels was broken, "mirrored" and was difficult to read.
I think it had something to do with the version of Java runtime environment I've been using at that time, since StatSVN uses JFreeChart to generate charts. I believe I was using something from GNU or maybe IcedTea, I don't already remember it. Anyway, after I get Sun JRE installed, my problems with the font disappeared.

#3 Source code statistics
I think, the functionality StatSVN still misses is a kind of integration with SLOCCount or something. I therefore use an external call for SLOCCount in order to get a better LOC calculation. Because SLOC from StatSVN is not really what I need.
By the way there is a nice comment of Jason Kealey (StatSVN developer) on the subject:
For the moment, we measure physical lines of code; language independant
(similar to wc -l). Whitespace is not ignored. Comments are not ignored.
StatCVS computes the LOC in the same way, but since we're contacting the
repository, we have the possibility to implement other models.

My personal opinion is that LOC should not be the basis of any profound
analysis. We have the simplest form of LOC implemented in StatSVN that's
enough to give you an overview of what's happening. Regardless of the
method, if the method is known, developers can cheat the metric. Yes, the
metrics are artificially inflated by whitespace and comments, but hopefully
the inflation is uniform across the codebase.
#4 Integration with Trac
As far as I know there is no integration with Trac possible, and no work is done there, besides this attempt.

#5 Style sheet
The default style sheet of StatSVN isn't really nice. I suggest something like this.

Looking at the name of the topic "Is StatSVN dead?", I would answer "I dunno". The last version of StatSVN was released on 2007-03-10, almost a year ago. One can think that the project is dead. Probably project was suspended for some time, that's may be true. But now one can see some activity on the field. So let's see and hope that we get a new version of StatSVN very soon!

So far that's it. I'll post some more information later :)

Jan 9, 2008

The new James Bond girl!

Ladies and Gentlemen, please welcome the new James Bond girl - Olga Kurylenko!

It was released that former model Olga Kurylenko will play as the James Bond girl with Daniel Craig in Bond 22. By the way, the 28-year-old Ukrainian, recently played in Hitman (Nika Boronina), so she obviously has some action :) experience already.


Source (BBC News).

Jan 8, 2008

Visual C++ 2008 Feature Pack Beta

Recently MS has released Visual C++ 2008 Feature Pack Beta.
Well, this pack actually contains two main points worth to be mentioned, namely, MFC libraries extensions and TR1 implementation from MS.

MFC got the following additions:


  • Office Ribbon style interface

  • Office 2007, Office 2003 and Office XP look and feel

  • Modern Visual Studio-style docking toolbars and panes

  • Fully customizable toolbars and menus

  • A rich set of advanced GUI controls

  • Advanced MDI tabs and groups

  • And much more!


What can I say... Pretty impressive! Sorry guys but I really thought that MFC were already dead for several years or so.
Me, and guys I know who develop software for Windows don't use MFC in anyway, why should we, when there is ATL/WTL or Qt?

TR1
Effective C++, Third Edition (Scott Meyers):
TR1 ("Technical Report 1") is a specification for new functionality being added to C++'s standard library. This functionality takes the form of new class and function templates for things like hash tables, reference-counting smart pointers, regular expressions, and more. TR1 itself is just a document. As I write this in early 2005, the document has not been finalized, and its URL is subject to change.
I can't describe it better as Scott Meyers did!

The current TR1 draft is dated 24 June 2005.
Now back to the Visual C++ 2008 Feature Pack Beta and its TR1 part.
It seems to me that this implementation of TR1 is actually implementation from MS and not an extract of BOOST TR1 as I thought it could be. :) The following quote is the reason for my conclusion (see this document):

The following are known issues that are planned to be fixed in the final release
of TR1 for Visual Studio 2008:

* mem_fn() does not support member functions with non-default calling conventions.

* Nested bind() expressions do not compile.

* bind() expressions with explicit result types do not compile.

* bind() expressions involving function objects with templated function call
operators do not compile.

Jan 3, 2008

Happy New Year!

"Smoking a cigar is time you devote to yourself" (Gerhard "Geraldo" Dannemann)

I am actually a non-smoker, namely, I don't smoke at all :)
But once a year I like to smoke one or two gut cigars. And I usually do this on the last day of the year.
This time I was tasting Dannemann Cigars -
Tubes Brazil.
This cigar has a rich aromatic flavor, actually I was expecting a strong one, but it appears to be totally opposite with a very delicate and soft taste. Very tasty! I took two of this type. :D

HAPPY NEW YEAR to everybody!

Jan 1, 2008

Change Eclipse UI font size and type

Unfortunately the chang of the font size is not yet possible from within Eclipse itself (for some of UI components like Menu and Navigator for example), at least for Eclipse version 3.2.0.
The UI font size can only be changed via the X resource mechanism. If you are using a gtk or gtk2 build, then the font size should automatically adapt to the settings of your theme or your personal preferences.

Use xfontsel to select a font. For example:

-misc-fixed-medium-r-normal-*-10-*-*-*-c-*-iso8859-1

Modify a config file: ~/.Xdefaults

Eclipse*fontList:-misc-fixed-medium-r-normal-*-10-*-*-*-c-*-iso8859-1

Use the following command to apply the font:

xrdb ~/.Xdefaults