random k-sample of a file

BCS ao at pathlink.com
Thu Oct 9 17:37:18 PDT 2008


Reply to Andrei,

> 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
> 

"Et tu, Brute!" - (Julius Caesar, Act III, Scene I).





More information about the Digitalmars-d mailing list