Misc functions I find useful.