[Tutor] seeking help to a problem w/ sockets

2008-04-26 Thread James Duffy
I have a problem w/ a file transfer receiver. They way it works is it binds a port for incoming transfer , when the file transfer is complete. It closes the connection and the socket, then loops back and restarts the bind and listen. I have it set so that the socket is reuseable, which is why this

Re: [Tutor] 6x6 word square solver too slow

2008-04-26 Thread R. Alan Monroe
> I'd suggest googling for 'trie'. Tries are method of > indexing sets of strings by prefix. Ah, will look it up. > As I recall, English words are more similar at the > front, so once you have an indexing scheme you'll > probably to do even less work if you index and search > from the back of t

Re: [Tutor] Help with Recurring Function

2008-04-26 Thread Alan Gauld
"Sanhita Mallick" <[EMAIL PROTECTED]> wrote being calculated correctly as checked by the "print" statement. But when we do norm_ted = (2 * ted) / mag It might be an integer division issue. Try norm_ted = (2*ted) / float(mag) Just a thought... -- Alan Gauld Author of the Learn to

Re: [Tutor] Help with Recurring Function

2008-04-26 Thread Sanhita Mallick
Hi Kent. sum_norm_ted is sum over each i, and all j. That is why it is initialize to zero at the beginning of each i loop. The inner loop IS running - which I checked by all the print statements. The value of "ted" and "mag" ARE being calculated correctly as checked by the "print" statement. But

Re: [Tutor] Best way to convert list of ints to a string?

2008-04-26 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote And for intList = [0,1,2,3,4,5,6,7,8,9], this is 2X slower than ''.join(map(str, intList)) . But for intList = 1000*[0,1,2,3,4,5,6,7,8,9], ''.join(itertools.imap(str, intList)) has a very small edge. Thanks, Kent, both of those are in my "never knew"