Nov 19, 2007

Fedora 8 and cURL

Yesterday I've discovered that one module of my project doesn't work, namely, it was a file upload using cURL library. The module suppose to upload files to an https url without checking of peer (insecure upload). I set parameters like CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST to 0. But I got an error in anyway:
Exception: couldn't transfer the InputSandbox file:
"***" to "https://***". Http error code: 0
Curl error: peer certificate cannot be authenticated
with known CA certificates.
Everything was perfectly working for a year or so. But after I have moved to Fedora8 my unit tests of the module started to fail.
I spent several hours and finally found the seed of the problem. If you get similar error while having insecure transfer, that would most probably mean, you are facing an Issue described here and here and here (Bug 387991). It has something to do with cURL with NSS as the SSL engine (instead of OpenSSL).
If you face this problem, one of the solution would be to rebuild cURL with OpenSSL support or wait until developers of Fedora and cURL fix it.

Nov 15, 2007

initializing vector with ostream_iterator

To someone it could be useful :)
When you try to compile the following code:


vector<int> v( istream_iterator<int>(cin), istream_iterator<int>() );


you actually end up with several error messages. Here g++ compile (for example), will follow the standard, and will identify the definition of v as a forward declaration of a function accepting two istream_iterator parameters and returning a vector of integers.

  • #1. Solution which works for g++ 4.1< (the extra set of parenthesis for the last argument of vector's ctor)
     vector<int> v( istream_iterator<int>(cin), (istream_iterator<int>()) );


but this doesn't really works with g++3.2

  • #2. Solution for g++ 3.2> - actually a general solution, which should work always:

typedef istream_iterator<int> in_iter;
in_iter b(cin);
in_iter e;
vector<int> v( b, e );

Bjarne Stroustrup's FAQ

I've just found a very nice FAQ from the FATHER of C++. I read it long time ago, but there are a lot of new staff added.
No comments - "mustread!"(c)

Nov 10, 2007

Useful Eclipse plug-ins for C++ Developers

With this post I would like to share my preferences of plug-ins for Eclipse.
Most of the time I do a C++ development (mostly under Linux). Since I came from Windows world and I was using the best development environment ever made - MS Visual Studio :) I wanted to find something similar in the Linux world. I tried emacs, KDevelop and Eclipse. I wont compare all of them, probably I will do that some time later, I will just conclude that I choose Eclipse and CDT.
Well, currently I am suing the following useful plug-ins:
Also I don't use the original code formating mechanism of Eclipse CDT, rather I use AStyle as an external tool, which is much more powerful. Here I have an instraction for you how to use AStyle in Eclipse:
  • Select the dropdown button for "External Tools", then click on "Externals Tools..."
  • Select "Program" in the Configurations window then click the New button
  • For the "Name" call it "AStyle", for the "Location" put the full path and filename for AStyle (i.e. /usr/bin/astyle)
  • For "Arguments", put the AStyle arguments to get the code formatted to your style. I like ANSI style and 3 spaces for indentation, hence, the arguments would be "--style=ansi -s3" (no quotes) or use --options=####
  • Now put your cursor at the end of the "Arguments" and click the "Variables" button and then select the resource_loc" and click OK
  • Your arguments should look like "--style=ansi -s3 ${resource_loc}" (no quotes)
  • Now click the "Refresh" tab, and click the check-box "Refresh resources upon completion" and then click the "The Selected Resource" radio button.
  • Click the "Apply" button then the "Close" button.

Nov 9, 2007

Fedora 8 and Compiz

Yet another problem with the new Fedora 8 :(
When Compiz is enabled after the reboot (or close/open session) each new window appears without the window title. A restart of Compiz (re-enable of it) helps...

Fedora 8 and KNetworkManager

Yesterday when I get my new Fedora 8 installation ready I found out a very very very upsetting thing - I used KDE (as I always do) but nm-applet appears in my tray :( Unfortunately I also found that KNetworkManager is just a wrapper for nm-applet. VERY BAD news!

Here we get some official explanation:
Since knetworkmanager does not work with the version of NetworkManager available in this release, the KDE Live images use nm-applet from NetworkManager-gnome as a replacement. The gnome-keyring-daemon facility saves passwords for these encryption technologies. The knetworkmanager package in this release is a script that calls nm-applet. The knetworkmanagerpackage will be updated to provide a KDE frontend when a compatible version is available.

Nov 8, 2007

Fedora 8 is out

Today, just right know the Fedora 8 has been released :)
http://fedoraproject.org/

Guess what I am going to do with my Fedora 7 installed on my laptop :) Now I know how I will spend this evening...

Nov 1, 2007

The First!

This is my First post to my First blog :)

to be continued...