Random Lines from a File

Update 2011-07-18: As Ernesto correctly points out in the comments, this algorithm selects N independent random lines from a file.

The following is my python implementation of choosing N random lines with equal probability from a file. This implementation is both memory and time efficient unlike other solutions. This problem …

more ...

The Night Before Google

Twas the night before Google, when all through the house
Not a creature was stirring, not even a mouse;

Tomorrow’s outfit was picked from the closet with care,
In hopes that the first impressions are fair;

It would be interesting to complete “The Night Before Google” however it could …

more ...