Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-10 Thread Ho Yeung Lee
I updated the code in msdn forum, I calculated from the end of file Discover file 4550 takes a long time to run, Assume it runs a whole day a file, 4550 days I guess need 12 years to finish full combination if only run at home. Hope Python sympy can be faster than cmaple in Amazon instance --

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-09 Thread Ho Yeung Lee
Sorry my calculation is wrong, it should have around 14 billions of combinations after using program to count. -- https://mail.python.org/mailman/listinfo/python-list

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-09 Thread meInvent bbird
https://social.msdn.microsoft.com/Forums/vstudio/en-US/5f0a9a51-a256-4671-a5fc-e213949e7204/how-to-refactor-3-nested-for-loop-into-smaller-for-loop-assume-each-of-them-independent?forum=csharpgeneral since when i dsolve a differential ideal used near 5GB memory for one ideal , i feel that i need

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-09 Thread Chris Angelico
On Mon, Oct 10, 2016 at 9:40 AM, Marko Rauhamaa wrote: > Chris Angelico : >> Yeah, if it's just for progress status. Of course, that does assume >> that the run() function doesn't have anything particularly costly in >> it. If it does, well, dis gonna take a while > > Dealing with multigigabyt

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-09 Thread Marko Rauhamaa
Chris Angelico : > Yeah, if it's just for progress status. Of course, that does assume > that the run() function doesn't have anything particularly costly in > it. If it does, well, dis gonna take a while Dealing with multigigabyte data streams is not over the top nowadays. Marko -- https:/

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-09 Thread Chris Angelico
On Mon, Oct 10, 2016 at 4:57 AM, BartC wrote: > On 09/10/2016 18:33, Jussi Piitulainen wrote: >> >> Chris Angelico writes: >> >>> On Mon, Oct 10, 2016 at 12:26 AM, Dennis Lee Bieber wrote: {This response is delayed as I'm waiting for the program to complete so I can get the run

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-09 Thread BartC
On 09/10/2016 18:33, Jussi Piitulainen wrote: Chris Angelico writes: On Mon, Oct 10, 2016 at 12:26 AM, Dennis Lee Bieber wrote: {This response is delayed as I'm waiting for the program to complete so I can get the run time} {Well... it's been near 24 hours and still merrily scrolling sums on m

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-09 Thread Jussi Piitulainen
Chris Angelico writes: > On Mon, Oct 10, 2016 at 12:26 AM, Dennis Lee Bieber wrote: >> {This response is delayed as I'm waiting for the program to complete so I >> can get the run time} >> {Well... it's been near 24 hours and still merrily scrolling sums on my >> console -- so I'm going to kill th

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-09 Thread Chris Angelico
On Mon, Oct 10, 2016 at 12:26 AM, Dennis Lee Bieber wrote: > {This response is delayed as I'm waiting for the program to complete so I > can get the run time} > {Well... it's been near 24 hours and still merrily scrolling sums on my > console -- so I'm going to kill the running program} Eight BIL

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-09 Thread Gregory Ewing
Chris Angelico wrote: Fascinating! What about: except sys.intern('type error') ? Or does interning of strings not exist yet :) Even if it was, I don't think there was any guarantee that the "official" strings representing those exceptions would be interned. You were supposed to use the provide

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-08 Thread Steve D'Aprano
On Sun, 9 Oct 2016 12:53 pm, Chris Angelico wrote: >> They're caught by identity, though - "except 'type error'" fails to >> catch TypeError, and vice versa. > > Fascinating! What about: except sys.intern('type error') ? Or does > interning of strings not exist yet :) >>> intern Unhandled except

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-08 Thread Steve D'Aprano
On Sun, 9 Oct 2016 05:45 am, Random832 wrote: > On Sat, Oct 8, 2016, at 07:29, Steve D'Aprano wrote: >> The oldest version I have access to is the *extremely* primitive 0.9. Not >> surprisingly, it doesn't have xrange -- but it lacks a lot of things, >> including globals(), map(), named exceptions

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-08 Thread Chris Angelico
On Sun, Oct 9, 2016 at 5:45 AM, Random832 wrote: > On Sat, Oct 8, 2016, at 07:29, Steve D'Aprano wrote: >> The oldest version I have access to is the *extremely* primitive 0.9. Not >> surprisingly, it doesn't have xrange -- but it lacks a lot of things, >> including globals(), map(), named excepti

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-08 Thread Random832
On Sat, Oct 8, 2016, at 07:29, Steve D'Aprano wrote: > The oldest version I have access to is the *extremely* primitive 0.9. Not > surprisingly, it doesn't have xrange -- but it lacks a lot of things, > including globals(), map(), named exceptions, "" strings ('' is okay), > exponentiation, and mor

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-08 Thread Random832
On Sat, Oct 8, 2016, at 06:12, BartC wrote: > The OP's code however is a good demonstration of how crazy Python's > original for-range loop was: you need to construct a list of N elements > just to be able to count to N. How many years was it until xrange was > introduced? Python 1.4 had it, an

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-08 Thread Alain Ketterlin
meInvent bbird writes: > how to refactor nested for loop into smaller for loop assume each of them > independent? > > because memory is not enough > > for ii in range(1,2000): > for jj in range(1,2000): > for kk in range(1,2000): > print run(ii,jj,kk) n =

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-08 Thread Steve D'Aprano
On Sat, 8 Oct 2016 09:12 pm, BartC wrote: > The OP's code however is a good demonstration of how crazy Python's > original for-range loop was: you need to construct a list of N elements > just to be able to count to N. How many years was it until xrange was > introduced? Python 1.4 (that's 1996)

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-08 Thread BartC
On 08/10/2016 11:54, Chris Angelico wrote: On Sat, Oct 8, 2016 at 9:12 PM, BartC wrote: On 08/10/2016 11:03, Chris Angelico wrote: On Sat, Oct 8, 2016 at 8:58 PM, meInvent bbird wrote: how to refactor nested for loop into smaller for loop assume each of them independent? because memory

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-08 Thread Chris Angelico
On Sat, Oct 8, 2016 at 9:12 PM, BartC wrote: > On 08/10/2016 11:03, Chris Angelico wrote: >> >> On Sat, Oct 8, 2016 at 8:58 PM, meInvent bbird >> wrote: >>> >>> how to refactor nested for loop into smaller for loop assume each of them >>> i

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-08 Thread BartC
On 08/10/2016 11:03, Chris Angelico wrote: On Sat, Oct 8, 2016 at 8:58 PM, meInvent bbird wrote: how to refactor nested for loop into smaller for loop assume each of them independent? because memory is not enough for ii in range(1,2000): for jj in range(1,2000): for kk in range(1,2000

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-08 Thread Chris Angelico
On Sat, Oct 8, 2016 at 8:58 PM, meInvent bbird wrote: > how to refactor nested for loop into smaller for loop assume each of them > independent? > > because memory is not enough > > for ii in range(1,2000): > for jj in range(1,2000): > for kk in range(1,2000): >

how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-08 Thread meInvent bbird
how to refactor nested for loop into smaller for loop assume each of them independent? because memory is not enough for ii in range(1,2000): for jj in range(1,2000): for kk in range(1,2000): print run(ii,jj,kk) -- https://mail.python.org/mailman/listinfo/python-list