Dienstag, 25. Oktober 2011

< The Matrix has got you. >

New Scientist has written an article about a nice study from the ETH Zurich, that shows how interconnected the global capitalistic network we live in has become.

Small teaser from the paper, page 6:


In detail, nearly 4/10 of the control over the economic value of TNCs in the world is held, via a complicated web of ownership relations, by a group of 147 TNCs in the core, which has almost full control over itself. The top holders within the core can thus be thought of as an economic “super-entity” in the global network of corporations. A relevant additional fact at this point is that 3/4 of the core are financial intermediaries.


Here is the article:
http://www.newscientist.com/article/mg21228354.500-revealed--the-capitalist-network-that-runs-the-world.html

and the study itself:
http://arxiv.org/PS_cache/arxiv/pdf/1107/1107.5728v2.pdf

Freitag, 21. Oktober 2011

< dlsym(), ISO, C++, gimme a break >

Today, while trying to implement a simple class that can dynamically load new C++ classes into a running program using dlopen() and dlsym() on Ubuntu 11.04 using g++ 4.5.2, I came across this error:

algorithm.cc: In static member function ‘static algo::algorithm& algo::algorithm::load(const std::string&)’:
algorithm.cc:24:67: error: ISO C++ forbids casting between pointer-to-function and pointer-to-object

Couldn't be clearer, could it? According to ISO, there is no way you can convert a pointer-to-object into a pointer-to-function - PERIOD! But wait! We can fix that by adding four simple green lines (comments not counted):

#include "algo/algorithm.h" 
#include <assert.h> 
#define dlsym __gimme_a_break__ 
#include <dlfcn.h> 
#undef dlsym 
#include <string>

// redeclare dlsym to be a function returning a function
// pointer instead of void *
extern "C" void *(*dlsym(void *handle, const char *symbol))();

algo::algorithm &
algo::algorithm::load(const std::string &algo)
{
    // to at least get the illusion of safety...
    assert(sizeof(void *) == sizeof(void (*)()));
    std::string nm = "libalgo-" + algo + ".so";
    void *lib = dlopen(nm.c_str(), RTLD_NOW);
    assert(lib != 0);
    algo::algorithm *(*mk)() =
        reinterpret_cast<algo::algorithm *(*)()>(dlsym(lib, "make"));
    algo::algorithm *a = mk();
    assert(a != 0);
    return *a;
}   // load()


Voilà, everyone is happy again (except the language advocates maybe)...

Freitag, 7. Oktober 2011

< Eurozone Banking Stresstest >

Breakingviews has done it's own interactive banking stress test, but with government bonds marked to market:

http://www.breakingviews.com/credible-eu-bank-tests-need-a-higher-pass-mark/1609896.article

In the worstcase scenario (all of the PIIGS countries needing a really short haircut) and under the current Basel II accord, 53 banks would fail the test. I don't know how meaningful the results are, but it is still fun to play around with ;-)

Mittwoch, 5. Oktober 2011

< IWF, EFSF, ESM, WTF?!? >

http://www.openeurope.org.uk/docs/draftesmtreaty.pdf

I won't comment this draft treaty at all - I'll just mention two quotes that seem to fit the bill:

"Insanity is when one is doing the same thing over and over again and expecting different results."
-- Albert Einstein

"It is well enough that people of the nation do not understand our banking and monetary system, for if they did, I believe there would be a revolution before tomorrow morning."
-- Henry Ford