Miscelaneous utilities for C#