Computing Stirling numbers of first and second kind