Some useful algorithms and techniques.