some simple utils written in c++