Re: Today's fun and educational Python recipe

2011-05-05 Thread nn
On May 4, 2:17 pm, Raymond Hettinger wrote: > Here's a 22-line beauty for a classic and amazing > algorithm:http://bit.ly/bloom_filter > > The wiki article on the algorithm is brief and > well-written:http://en.wikipedia.org/wiki/Bloom_filter > > It turns out that people in the 1970's were prett

Re: Today's fun and educational Python recipe

2011-05-04 Thread Chris Angelico
On Thu, May 5, 2011 at 5:02 AM, Irmen de Jong wrote: > I think that often, the cleverness of people is inversely proportional to > the amount of CPU power and RAM that they have in their computer. As Mark Rosewater is fond of saying, restrictions breed creativity. Lack of computational resources

Re: Today's fun and educational Python recipe

2011-05-04 Thread Raymond Hettinger
On May 4, 5:26 pm, Terry Reedy wrote: > The test would be more convincing to many with 10 other geographic > names (hard to come by, I know), or other english names or words or even > with longer random strings that matched the lengths of the state names. > But an average of 5/10 false pos

Re: Today's fun and educational Python recipe

2011-05-04 Thread Terry Reedy
On 5/4/2011 5:39 PM, Raymond Hettinger wrote: The 512 bits in h are progressively eaten-up between iterations. So each pass yields a different (array index, bit_mask) pair. Yeh, obvious now that I see it. It's easy to use the interactive prompt to show that different probes are produced on

Re: Today's fun and educational Python recipe

2011-05-04 Thread Ben Finney
Grant Edwards writes: > On 2011-05-04, Irmen de Jong wrote: > > I think that often, the cleverness of people is inversely > > proportional to the amount of CPU power and RAM that they have in > > their computer. > > True. > > Unfortunately the difficulty in debugging and maintaining code is > of

Re: Today's fun and educational Python recipe

2011-05-04 Thread Raymond Hettinger
On May 4, 12:27 pm, Paul Rubin wrote: > Raymond Hettinger writes: > > Here's a 22-line beauty for a classic and amazing algorithm: > >http://bit.ly/bloom_filter > > The use of pickle to serialize the keys is a little bit suspicious if > there might be a reason to dump the filter to disk and re-us

Re: Today's fun and educational Python recipe

2011-05-04 Thread Raymond Hettinger
On May 4, 12:42 pm, Terry Reedy wrote: > On 5/4/2011 2:17 PM, Raymond Hettinger wrote: > > > Here's a 22-line beauty for a classic and amazing algorithm: > >http://bit.ly/bloom_filter > > > The wiki article on the algorithm is brief and well-written: > >http://en.wikipedia.org/wiki/Bloom_filter >

Re: Today's fun and educational Python recipe

2011-05-04 Thread Terry Reedy
On 5/4/2011 2:17 PM, Raymond Hettinger wrote: Here's a 22-line beauty for a classic and amazing algorithm: http://bit.ly/bloom_filter The wiki article on the algorithm is brief and well-written: http://en.wikipedia.org/wiki/Bloom_filter As I understand the article, the array of num_bits should

Re: Today's fun and educational Python recipe

2011-05-04 Thread Irmen de Jong
On 04-05-11 21:13, Raymond Hettinger wrote: It turns out that people in the 1970's were pretty smart :-) I think that often, the cleverness of people is inversely proportional to the amount of CPU power and RAM that they have in their computer. The Google guys have plenty of CPU power *and* p

Re: Today's fun and educational Python recipe

2011-05-04 Thread Paul Rubin
Raymond Hettinger writes: > Here's a 22-line beauty for a classic and amazing algorithm: > http://bit.ly/bloom_filter The use of pickle to serialize the keys is a little bit suspicious if there might be a reason to dump the filter to disk and re-use it in another run of the program. Pickle repre

Re: Today's fun and educational Python recipe

2011-05-04 Thread Grant Edwards
On 2011-05-04, Irmen de Jong wrote: > On 04-05-11 20:17, Raymond Hettinger wrote: >> Here's a 22-line beauty for a classic and amazing algorithm: >> http://bit.ly/bloom_filter >> >> The wiki article on the algorithm is brief and well-written: >> http://en.wikipedia.org/wiki/Bloom_filter >> >> It t

Re: Today's fun and educational Python recipe

2011-05-04 Thread Raymond Hettinger
> > It turns out that people in the 1970's were pretty smart :-) > > I think that often, the cleverness of people is inversely proportional > to the amount of CPU power and RAM that they have in their computer. The Google guys have plenty of CPU power *and* plenty of cleverness :-) According to t

Re: Today's fun and educational Python recipe

2011-05-04 Thread Irmen de Jong
On 04-05-11 20:17, Raymond Hettinger wrote: Here's a 22-line beauty for a classic and amazing algorithm: http://bit.ly/bloom_filter The wiki article on the algorithm is brief and well-written: http://en.wikipedia.org/wiki/Bloom_filter It turns out that people in the 1970's were pretty smart :-)