some programming snippets