Re: Perl Hacker, Python Initiate

2011-02-02 Thread Tom Boland
if you want to do dns lookups on a large number of hosts, then try looking at gnu adns, or if you don't mind each request blocking until it's complete, then see Alain's response below. I have written some scripts myself which do massively parallel dns lookups quickly using twisted. If this i

Re: efficient way of splitting a list in to lists where the sum of the values in each does not exceed n

2010-11-24 Thread Tom Boland
n Wed, Nov 24, 2010 at 8:34 AM, Tom Boland wrote: I'm trying to find a _nice_ way of taking a list of integers, and splitting them in to lists where the sum of the values does not exceed a threshold. for instance: l = [1, 2, 3, 4, 5, 6] n = 6 nl = [1,2,3], [4], [5], [6] I don't mi

efficient way of splitting a list in to lists where the sum of the values in each does not exceed n

2010-11-24 Thread Tom Boland
I'm trying to find a _nice_ way of taking a list of integers, and splitting them in to lists where the sum of the values does not exceed a threshold. for instance: l = [1, 2, 3, 4, 5, 6] n = 6 nl = [1,2,3], [4], [5], [6] I don't mind if it's done like playing blackjack/pontoon (the card gam