Some code snippets for fast calculations on large data sets