Stable version of StreamSampling task with console application to show how it works.