Some code snippets written for study.