Check out http://www.l5-series.com/ an independent crowd-funded mini-series. Crowd-funded entertainment is here!
L5 Release Trailer from Studio Hemogoblin on Vimeo.
Check out http://www.l5-series.com/ an independent crowd-funded mini-series. Crowd-funded entertainment is here!
L5 Release Trailer from Studio Hemogoblin on Vimeo.
C++03: what’s the problem with a static variable inside a function like:
class A;
void f()
{
static A;
[...]
}
?
Apparently nothing, but unfortunately seems that the initialization is not thread safe (it is with gcc apparently). Fortunately this behaviour is corrected in C++11, where the standard clearly says that initialization is done in a thread safe manner.
This was smartly point out by a coworker, here’s some more information in stackoverflow
It’s funny because I introduced an static tbb::mutex to address a concurrency problem we were having with libjpeg: while using libjpeg concurrently we were observing that the generated jpg were perfectly correct when compared every RGB point, but the encoding was changing and producing different bytestreams. There must be some multithread unsafe code inside libjpeg that we have not yet identified.
By the way, the fix I proposed consisting on enclosing the libjpeg calling code was working fine and the produced jpgs went back to be deterministic, but certainly is suprising to find that with the standard in hand, the fix just introduced another concurrency bug!
Happy 2012 programming!
Reinstalled Debian in my laptop, somehow Btrfs was doing strange things like reporting disk full with several GB of free space. Also for some workloads with smaller files felt a little slow despite the intel 320 ssd drive. In all, several months with Btrfs, not a bad experience, didn’t loose any data, and Btrfs seems very powerful and promising. Currently I’m back to ext4 for some time
For daily C++ I use vim + ctags + cscope, sometimes I also use the nice diagrams generated by doxygen to visualize class interactions, and call graphs. Yesterday I was just trying to find all references to some Class:insert method, oh, good luck with that with a codebase full of std::map etc. I thought, oh well, cscope can’t do such a level of C++ parsing, next time I boot Windows I’ll try Visual Studio, probably they do some more detailed C++ parsing. I’m not super familiar with VS. but when I tried right click-> find all references to this particular Class::insert function it gives me all kinds of std::map::inserts and the like. I guess it’s time we build some smart C++ code navigator, probably the C++ parser of the llvm project could be a nice start for this, cscope is unable to help in this kind of problems since it doesn’t know which type is the variable that is calling insert. But I was surprised that VS is not any better.
When you want a boost::python::object to manage a pointer to PyObject* pyobj one does:
boost::python::object o(boost::python::handle<>(pyobj));
In this case, the o object, manages the pyobj, it won’t increase the reference count on construction.
Otherwise, to use a borrowed reference:
boost::python::object o(boost::python::handle<>(boost::python::borrowed(pyobj)));
In this case, Py_INCREF is called, so pyobj is not destructed when object o goes out of scope.
Great stuff, I specially enjoyed the asian humor touches and the sexual tension.
http://www.imdb.com/title/tt0762073/
I’ve just released the source code of the high performance asynchronous web crawler ‘Mycelium’ in github.