Fast powerset function

2007-07-12 Thread Arash Arfaee
I need a powerset generator function. It's really slow with recursion. Does anybody have any idea or code(!!) to do it in an acceptable time? Thanks -Arash -- http://mail.python.org/mailman/listinfo/python-list

Re: Fast powerset function

2007-07-18 Thread Arash Arfaee
Hi All With your help I found lots of good method and algorithm. Also I found out if I exchange all for loop with while loop it make the program much faster and also it consumes less memory (almost half!) Just wanna thank you all. Cheers, Arash On 7/13/07, Mark Dickinson <[EMAIL PROTECTED]> wrot

How to check if an item exist in a nested list

2007-07-19 Thread Arash Arfaee
Hi All, Is there any way to check if an item in specific location in a multiple dimension nested exist? For example something like: if M_list[line][row][d] exist: do_something_0 else: do_something_1 One way is to check the length of each dimension. Does any body know a simpler way? is there

TypeError: 'int' object is not callable for max(2,3)

2007-07-25 Thread Arash Arfaee
Hi all, I have a problem. if I enter max(2,3) before I run my program in command line it returns 3. However if I start to debug my program, I have this error: [Dbg]>>> max(2,3) Traceback (most recent call last): File "", line 1, in TypeError: 'int' object is not callable Any idea what should b

psyco problem on mac wingide

2008-01-19 Thread Arash Arfaee
Hello All, I have no problem using psyco on python shell on my new Mac, however I cannot import it from WingIDE. I copied psyco directory into mac python folder. Does wingide installs another python shell? Thanks, Arash -- http://mail.python.org/mailman/listinfo/python-list

problem With Psyco on Wingide mac

2008-01-21 Thread Arash Arfaee
Hello All, I am trying to use psyco with wingide on mac. when I open Mac Python shell I can import psyco, but not inside the wingide. Even python shell on wingide cannot import psyco. Can anybody help me to solvethis problem? Thanks, Arash -- http://mail.python.org/mailman/listinfo/python-list

psyco on mac

2008-01-25 Thread Arash Arfaee
Hello, I have problem installing psyco on my mac. Can anybody help me? Thanks, Arash -- http://mail.python.org/mailman/listinfo/python-list

malloc (error code=12)

2009-01-21 Thread Arash Arfaee
Hi All, I am writing a multiprocessing program using python 2.6. It works in most cases, however when my input is large sometimes I get this message again and again: Python(15492,0xb0103000) malloc: *** mmap(size=393216) failed (error code=12) *** error: can't allocate region and at the and I ha

Re: malloc (error code=12)

2009-01-21 Thread Arash Arfaee
Very BIG Jesse It works on a huge Boolean function. And thanks Roger. Do you think it will be solved if I run it over another OS like windows? Cheers, Arash On Wed, Jan 21, 2009 at 7:19 PM, Jesse Noller wrote: > On Wed, Jan 21, 2009 at 9:38 PM, Arash Arfaee wrote: > > &

Re: multiprocessing vs thread performance

2009-01-07 Thread Arash Arfaee
Hi All , Does anybody know any tutorial for python 2.6 multiprocessing? Or bunch of good example for it? I am trying to break a loop to run it over multiple core in a system. And I need to return an integer value as the result of the process an accumulate all of them. the examples that I found the

adding in-place operator to Python

2008-09-23 Thread Arash Arfaee
Hi All, Is there anyway to add new in-place operator to Python? Or is there any way to redefine internal in-place operators? Thanks. Cheers, Arash -- http://mail.python.org/mailman/listinfo/python-list

Re: adding in-place operator to Python

2008-09-25 Thread Arash Arfaee
find what is wrong here? Cheers, Arash On Tue, Sep 23, 2008 at 11:06 AM, Terry Reedy <[EMAIL PROTECTED]> wrote: > Arash Arfaee wrote: > >> Hi All, >> >> Is there anyway to add new in-place operator to Python? Or is there any >> way to redefine internal in-pla