some simple utilities written in c++