random k-sample of a file
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Thu Oct 9 16:44:38 PDT 2008
Walter Bright wrote:
> Andrei Alexandrescu wrote:
>> No go if the file is a stream. Can it be done in one pass?
>
> No, because without knowing the number of lines, you cannot produce a
> uniform distribution.
>
> Unless you're willing to make a guess based on the file size.
I am getting revenge for "I never use anything in std.algorithm" :o).
Andrei
More information about the Digitalmars-d
mailing list