Collect some snippets in python, c++ and sagemath