Re: Non-blocking connect

2008-05-02 Thread mp
Thanks Roy. I was just trying to understand someone else's code, but in the end it turns out that this was just a bug. What weirded me out was how injecting a print statement preventing the error from occurring, but now I get it. Without blocking, the connection handshake occurs in parallel after

Non-blocking connect

2008-05-02 Thread mp
Code is at bottom. Basically, if I turn off socket blocking prior to connecting, I get a "Socket is not connected" error when I try to send data. However, if I do not turn off blocking, OR if I place a print statement anywhere before the send call, it works! WTF? I'd like to understand what's goin

Re: Can you determine the sign of the polar form of a complex number?

2007-10-17 Thread schaefer . mp
Just to clarify what I'm after: If you plot (-3)^n where n is a set of negative real numbers between 0 and -20 for example, then you get a discontinuos line due to the problem mentioned above with fractional exponents. However, you can compute what the correct absolute value of the the missing poi

Can you determine the sign of the polar form of a complex number?

2007-10-17 Thread schaefer . mp
To compute the absolute value of a negative base raised to a fractional exponent such as: z = (-3)^4.5 you can compute the real and imaginary parts and then convert to the polar form to get the correct value: real_part = ( 3^-4.5 ) * cos( -4.5 * pi ) imag_part = ( 3^-4.5 ) * sin( -4.5 * pi ) |z

Re: negative base raised to fractional exponent

2007-10-17 Thread schaefer . mp
On Oct 17, 4:05 am, Ken Schutte <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Does anyone know of an approximation to raising a negative base to a > > fractional exponent? For example, (-3)^-4.1 since this cannot be > > computed without using imaginary numbers. Any help is appreciat

negative base raised to fractional exponent

2007-10-16 Thread schaefer . mp
Does anyone know of an approximation to raising a negative base to a fractional exponent? For example, (-3)^-4.1 since this cannot be computed without using imaginary numbers. Any help is appreciated. -- http://mail.python.org/mailman/listinfo/python-list

Non-Blocking IO

2007-08-31 Thread mp
rite(fin.fileno(),'blah') fin.flush() print os.read(fout.fileno(),256) Calling try3() yields the error: File "./test.py", line 54, in try3 print os.read(fout.fileno(),256) OSError: [Errno 35] Resource temporarily unavailable If anyone could help me accomplish t

Re: Character encoding

2006-11-07 Thread mp
it occurs. It doesn't take too much code. > > On Nov 7, 1:34 pm, "mp" <[EMAIL PROTECTED]> wrote: > > I have html document titles with characters like >,  , and > > ‡. How do I decode a string with these values in Python? > > > > Thanks -- http://mail.python.org/mailman/listinfo/python-list

Character encoding

2006-11-07 Thread mp
I have html document titles with characters like >,  , and ‡. How do I decode a string with these values in Python? Thanks -- http://mail.python.org/mailman/listinfo/python-list

mx.DateTime to datetime.datetime

2006-07-28 Thread mp
Is there a constructor for an mx.DateTime object which takes a datetime.datetime object? It seems like a pretty common thing to do but I didn't see such a constructor in the mx.DateTime docs. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Python framework questions

2006-07-05 Thread mp
there other options? Second, is a cgi-bin directory really necessary? Are there security issues with configuring Apache to allow cgi-bin execution in other directories? Thanks MP -- http://mail.python.org/mailman/listinfo/python-list

Modify one character in a string

2006-05-24 Thread mp
se and what function should I use to modify a single character once in that file mode? Thanks MP -- http://mail.python.org/mailman/listinfo/python-list

symbolic links, aliases, cls clear

2006-03-29 Thread mp
to find the command 'clear'? i'm using os x. thanks mp -- http://mail.python.org/mailman/listinfo/python-list