Re: [Tutor] MemoryError

2015-12-30 Thread Satya Luzy
Thanks for testing out more of the program. Yes, as you can see, I'm using the continued fraction method on n, which in your case is 459. During the continued fraction process (referring to function cfract(n,boundary)), I set the boundary to store only 50 value of the first iteration. The result

Re: [Tutor] MemoryError

2015-12-30 Thread Alan Gauld
On 30/12/15 06:26, Satya Luzy wrote: > Dear everyone, thank you for all of your support. > To Alan : > It is true that my code still need some improvement on the efficiency part, > and thanks for pointing out which part that needs to be improved. My suggestions won't really do much for

Re: [Tutor] MemoryError

2015-12-30 Thread Satya Luzy
Dear everyone, thank you for all of your support. To Alan : It is true that my code still need some improvement on the efficiency part, and thanks for pointing out which part that needs to be improved. Speaking of the nested loops, with my ability, I don't think I could simplify it, as the nested

Re: [Tutor] MemoryError

2015-12-29 Thread Steven D'Aprano
On Wed, Dec 30, 2015 at 12:00:02AM +0700, Satya Luzy wrote: > Hello, > I am currently working on a program to find the prime factor of n, in which > n is a big integer. Using the Continued Fraction factorization method (I > will provide the source code below, please don't mind the variables).

Re: [Tutor] MemoryError

2015-12-29 Thread Martin A. Brown
Hello there Satya, >I am currently working on a program to find the prime factor of n, in which >n is a big integer. Using the Continued Fraction factorization method (I >will provide the source code below, please don't mind the variables). I do not know the Continued Fraction factorization

Re: [Tutor] MemoryError

2015-12-29 Thread Danny Yoo
> To be honest this is probably a bit beyond the scope of the tutor > list which is aimed at questions about the Python language and > standard library. However I'll make a few observations (and assume > your logic is OK since you did test it on some smaller data first) Just to add to Alan's

Re: [Tutor] MemoryError

2015-12-29 Thread Alan Gauld
On 29/12/15 17:00, Satya Luzy wrote: > Hello, > I am currently working on a program to find the prime factor of n, in which > n is a big integer. Using the Continued Fraction factorization method To be honest this is probably a bit beyond the scope of the tutor list which is aimed at questions

[Tutor] MemoryError

2015-12-29 Thread Satya Luzy
Hello, I am currently working on a program to find the prime factor of n, in which n is a big integer. Using the Continued Fraction factorization method (I will provide the source code below, please don't mind the variables). It works perfectly when factorizing below 10 digits numbers. In my code

Re: [Tutor] MemoryError

2015-12-29 Thread Steven D'Aprano
On Wed, Dec 30, 2015 at 12:00:02AM +0700, Satya Luzy wrote: > Hello, > I am currently working on a program to find the prime factor of n, in which > n is a big integer. Using the Continued Fraction factorization method (I > will provide the source code below, please don't mind the variables).

Re: [Tutor] MemoryError !!! Help Required

2008-04-07 Thread Andreas Kostyrka
Am Montag, den 07.04.2008, 00:32 -0500 schrieb Luke Paireepinart: devj wrote: Hi, I am making a web crawler using Python.To avoid dupliacy of urls,i have to maintain lists of downloaded urls and to-be-downloaded urls ,of which the latter grows exponentially,resulting in a MemoryError

Re: [Tutor] MemoryError !!! Help Required

2008-04-07 Thread W W
I don't have a lot of experience, but I would suggest dictionaries (which use hash values). A possible scenario would be somthing similar to Andreas' visited = dict() url = http://www.monty.com; file = /spam/holyhandgrenade/three.html visited[url] = file unvisited = dict() url =

Re: [Tutor] MemoryError !!! Help Required

2008-04-07 Thread Andreas Kostyrka
Hint: MemoryError suggests that his dicts have filled up his address space (probably). 1-3GB on Linux, 2?GB on Windows. At least for 32bit versions. So storing the whole URL in memory is probably out of question, storing it only in some form of files might be slightly slow, so one compromise

[Tutor] MemoryError !!! Help Required

2008-04-06 Thread devj
Hi, I am making a web crawler using Python.To avoid dupliacy of urls,i have to maintain lists of downloaded urls and to-be-downloaded urls ,of which the latter grows exponentially,resulting in a MemoryError exception .What are the possible ways to avoid this ?? -- View this message in context:

Re: [Tutor] MemoryError !!! Help Required

2008-04-06 Thread Luke Paireepinart
devj wrote: Hi, I am making a web crawler using Python.To avoid dupliacy of urls,i have to maintain lists of downloaded urls and to-be-downloaded urls ,of which the latter grows exponentially,resulting in a MemoryError exception .What are the possible ways to avoid this ?? get more RAM,

Re: [Tutor] MemoryError

2004-12-10 Thread Liam Clarke
Hi Kent, Thanks for the help, it worked third time around! The final product is here if you have an interest - http://www.rafb.net/paste/results/XCYthC70.html But, I think I found a new best friend for this sort of thing - (?Ptext.*?) Being able to label stuff is brilliant. But yeah,

Re: [Tutor] MemoryError

2004-12-10 Thread Kent Johnson
Well, that's a regex only a mother could love. :-) I can see why you were happy to find the (?Ptext) form of grouping. You should compile textObj and urlObj outside of getVals. You could just pull the four lines that create textObj and urlObj outside of the function (into global scope). You

Re: [Tutor] MemoryError

2004-12-09 Thread Kent Johnson
Liam, I'm sorry to hear you so discouraged. It sourds like your program has gotten too big for you to clearly understand what it is doing. An earlier poster suggested that you break your program up into functions. This is a very good idea, especially if you do it from the start. A very powerful

Re: [Tutor] MemoryError

2004-12-09 Thread Jeff Shannon
Liam Clarke wrote: So, I'm going to throw caution to the wind, and try an re approach. It can't be any more unwieldy and ugly than what I've got going at the moment. If you're going to try a new approach, I'd strongly suggest using a proper html/xml parser instead of re's. You'll almost

Re: [Tutor] MemoryError

2004-12-08 Thread Alan Gauld
Traceback: usual bit about in module.. Line 39: seg=codeSt[element:endInd+len(endStr] MemoryError Hehe. Helpful, no? Sometimes seeing the whole traceback gives clues as to whats throwing the wobbly, without the full stack its hard to tell. However before worrying about that I'd add a