[erlang-questions] Reservoir sampling gen_server

Robert Schonberger <>
Sat Mar 28 07:36:33 CET 2009


hi everyone,I wanted to give my brain a bit of an exercise this morning, and
so I wrote a gen_server that, given an arbitrary number of inputs, can
provide a statistically random sample of those inputs.

The inputs are passed via handle_cast, and a retrieval via handle_call. If
you're interested in keeping a sample of a large amount of data, this could
be interesting for you.

Any comments would be appreciated, and patches / advice more so,

http://schonberger.org/2009/03/28/reservoir-sampling-gen-server-in-erlang.html

Thanks,
Robert

-- 
Robert Schonberger

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090328/01349a41/attachment.html>


More information about the erlang-questions mailing list