Iterating over a text file

It's a simple task -- you want iterate over all the lines in a file and perform an action on each one. In Python it's as simple as:for line in open("somefile.txt"):    print lineHow about C++11. How hard can it be? This stackoverflow post gives us a starting point. We... [Read More]
Tags: Boost C++ C++11

Thoughts on Steve Jobs Biography

I recently finished reading biography of Steve Jobs by Walter Isaacson. It's a great book that shows Jobs not only from his side but also as perceived by his friends and enemies. After reading the book, I can certainly say that Steve Jobs was a complicated person. I can't say... [Read More]

Fun with Intel TBB and Boost.Proto

Intel Threading Building BlocksAs the hardware engineers cram more and more cores into the processors, software engineers are left to ponder about how to best exploit these new capabilities. Intel offers an open source C++ library they call Threading Building Blocks (TBB). Akin to competing solutions (OpenMP, GCD, PPL), the... [Read More]
Tags: Boost TBB C++ C++11

Deferring execution

Go language has defer statements which allow for postponing execution of a function or method call until the end of the current function. Similarly, D has scope guard statements which allow statement execution to be delayed until the end of the scope (optionally specified to only execute under successful or failed scenarios).GoDlock(l)// unlocking happens... [Read More]
Tags: Go Boost C++ D C++11