Name: Johan Thelin
Member since: 2004-05-06 12:14:55
Last Login: 2007-07-11 12:38:34
Homepage: http://www.digitalfanatics.org/e8johan
Notes: Has a formal education in electronics and computer sience and several years of experience from both open source development and software consulting.
This person is:
STL, redux
Funny to see that claiming that the following code is readable stirred up quite a few comments.std::transform( list.begin(), list.end(), std::back_inserter( res ), std::bind2nd( std::plus<int>(), 42 ) );
STL rocks
I've just been writing a small article on the "gems of STL" and found that I really like what I'm seeing. A personal favorite is the transform operation (found in the functional header file). For example, lets do some adding.#include <functional>So, the transform method takes three iterators and an functor. The operators are, from the left, the starting point of the input, the end point of the input and the starting point of the output. The function simply specifies what to do with each list entry to create the output. In this case, std::plus takes two arguments, but we bind the second argument to 2. What this does is that it adds 42 to every item in the list (between begin and end), and replaces the original items (the results are placed from begin and onwards).
#include <list>
...
{
std::list<int> list;
list.push_back( ... ); // Populate
std::transform( list.begin(), list.end(), list.begin(), std::bind2nd( std::plus<int>(), 42 ) );
}
{
std::list<int> list, res;
list.push_back( ... ); // Populate
std::transform( list.begin(), list.end(), std::back_inserter( res ), std::bind2nd( std::plus<int>(), 42 ) );
}QCodeEdit
A spin-off from the Edyuk project has finally been released with a website of its own. The QCodeEdit project looks really promissing. What you get is a code editor with syntax highlighting for a range of languages (yes, you can add support for more languages) developed using Qt - i.e. 100% cross platform - and good looking as well.
Storebror - Big Brother
As the Swedish parliament passed the "FRA law", a.k.a. the big brother law, it is time to change broad band provide. The ISP Bahnhof will not follow the new law and promises to reroute its traffic to avoid it if needed.What a drive!
Congratulations to the entire BMW Sauber F1 team and all the supporters!e8johan certified others as follows:
Others have certified e8johan as follows:
[ Certification disabled because you're not logged in. ]
FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.
Keep up with the latest Advogato features by reading the Advogato status blog.
If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!