various c++ code snippets.