added a few snippets for cpp and java