Re: OpenSource documentation problems

2005-08-31 Thread Paul Rubin
Michael Sparks <[EMAIL PROTECTED]> writes: > > A plausible theory. I have some possibly-illustrative examples > > of what I ran into within the last few weeks. > > Did you take what you learnt, and use that to create better > documentation to be posted on python's SF project as a patch? > I've

Re: global interpreter lock

2005-08-31 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > > Sure. I tried to be helpful there, but maybe I need to be more > > specific. The ref from my previous post, Google-able as "The > > C10K problem" is good but now a little dated. > > That appears to be a discussion on squeezing the most out of a network >

Re: 'isa' keyword

2005-09-01 Thread Paul Rubin
"talin at acm dot org" <[EMAIL PROTECTED]> writes: > membership within a container -- instead we're testing for membership > with a type hierarchy, where 'type' can be defined to mean whatever the > programmer wants. Well, if "type" means a (possibly infinite) set of objects, then you can use "in"

Re: Decrypting GPG/PGP email messages

2005-09-01 Thread Paul Rubin
Alessandro Bottoni <[EMAIL PROTECTED]> writes: > 1) What would you use to decrypt the messages? The GPG module created by > Andrew Kuchling is declared "incomplete" and "no more maintained" on his > web pages (http://www.amk.ca/python/code/gpg) so I think it is out of the > game. I think I'd just

Re: OpenSource documentation problems

2005-09-01 Thread Paul Rubin
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > another problem is that to be able to do really good work on the > documentation, you need to know things well enough to "have the > big picture". and once you have that, you'll find that the docs aren't > really as bad as you once thought they were.

Re: Writing Multithreaded Client-Server in Python.

2005-09-01 Thread Paul Rubin
[EMAIL PROTECTED] writes: > > I suspect he was trying to say that BaseHTTPServer has no mechanism for > > handling state. As you know, of course, this is most relevant across > > multiple successive connections to a server from the same client, and > > has little to do with threads. Usually you wo

Re: Bug in string.find

2005-09-01 Thread Paul Rubin
Ron Adam <[EMAIL PROTECTED]> writes: > All of the following get the center 'd' from the string. > > a = 'abcdefg' > print a[3] # d 4 gaps from beginning > print a[-4]# d 5 gaps from end > print a[3:4] # d > print a[-4:-3] # d > print a[-4:4] # d > print a[3:-3]

Re: OpenSource documentation problems

2005-09-01 Thread Paul Rubin
"Fred L. Drake, Jr." <[EMAIL PROTECTED]> writes: > Ideally, emails to docs at python.org would result in issues being > created somewhere, simply so they don't get lost. It probably > doesn't make sense for those to land in SourceForge automatically, > since then everyone has to read every plea fo

Re: OpenSource documentation problems

2005-09-01 Thread Paul Rubin
Michael Sparks <[EMAIL PROTECTED]> writes: > > I've submitted a number of doc bugs to sourceforge and the ones that > > are simple errors and omissions do get fixed. > > Cool. Better than nothing, but it's only one class of problem, and maybe the easiest kind to report. There's another type

Re: Find day of week from month and year

2005-09-02 Thread Paul Rubin
"Laguna" <[EMAIL PROTECTED]> writes: > I want to find the expiration date of stock options (3rd Friday of the > month) for an any give month and year. I have tried a few tricks with > the functions provided by the built-in module time, but the problem was > that the 9 element tuple need to be popul

Re: OpenSource documentation problems

2005-09-02 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Also, "not that long ago" must mean different things for different people. > I think we've required logins for three years or more. I hope you're not right and that it hasn't really been that long. Yikes ;-). -- http://mail.python.org/mailman/listinfo/python-list

Re: Find day of week from month and year

2005-09-02 Thread Paul Rubin
Peter Hansen <[EMAIL PROTECTED]> writes: > (And, if I were "optimizing", I would of course dispense with the > dynamic creation of the static table upon every execution of > expiration(), and move it outside the function.) Replacing it with a tuple might be enough for that. -- http://mail.python.

Re: Decrypting GPG/PGP email messages

2005-09-03 Thread Paul Rubin
Alessandro Bottoni <[EMAIL PROTECTED]> writes: > I'm going to use my own implementation of OTP because the existing > mechanism are devoted to protect the remote login channel and cannot > be easily adapted to my weird e-mail-based mechanism. Anyway, I'm > going to use a (encrypted) very long pseud

Re: Submitting doc bug reports without SF registration

2005-09-03 Thread Paul Rubin
"Terry Reedy" <[EMAIL PROTECTED]> writes: > 1. A DocImprovement wiki. People could optionally sign up for update > reports on specific wiki pages. > > 2. A new SF tracker, only for doc bugs, that would accept anonymous > submissions. The other trackers require login because most items need >

Re: OpenSource documentation problems

2005-09-04 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > > legitimate. Python's core developers are in a leadership position for > > Python whether they like it or not; and users and volunteers absorb > > the attitudes of the leaders. > > So, what you are saying is because the developers (I explain in > anothe

Re: Code for generating validation codes (in images)

2005-09-04 Thread Paul Rubin
"morphex" <[EMAIL PROTECTED]> writes: > does anyone of you know of some code I can use to generate validation > code images? > > Those images you can see on various login forms used to prevent bots > for performing a brute-force attack.. http://en.wikipedia.org/wiki/CAPTCHA -- http://mail.python

Re: dual processor

2005-09-04 Thread Paul Rubin
"John Brawley" <[EMAIL PROTECTED]> writes: > However, the thought occurs that Python (2.4.1) may not have the ability to > take advantage of the dual processors, so my question: > Does it? No. > If not, who knows where there might be info from people trying to make > Python run 64-bit, on multipl

Re: dual processor

2005-09-04 Thread Paul Rubin
Jeremy Jones <[EMAIL PROTECTED]> writes: > to pass data around between processes. Or an idea I've been tinkering > with lately is to use a BSD DB between processes as a queue just like > Queue.Queue in the standard library does between threads. Or you > could use Pyro between processes. Or CORBA

Re: Magic Optimisation

2005-09-04 Thread Paul Rubin
[EMAIL PROTECTED] writes: > However, it is very ugly. Does anyone have any tips on how I could get > this optimisation to occor magically, via a decorator perhaps? Have you tried psyco? -- http://mail.python.org/mailman/listinfo/python-list

Re: Magic Optimisation

2005-09-04 Thread Paul Rubin
[EMAIL PROTECTED] writes: > My use case involves < 1000 iterators, so psyco is not much help. It > doesn't solve the magic creation of locals from instance vars either. How about using __slots__ to put those instance vars at fixed offsets in the pool object (self then needs to be a new-style class

Re: Job Offer in Paris, France : R&D Engineer (Plone)

2005-09-05 Thread Paul Rubin
Huron <[EMAIL PROTECTED]> writes: > Sopinspace, Society For Public Information Spaces (specialized in Web-based > citizen public debate and collaborative initiatives) is looking for a new > developer / R&D engineer with strong Plone focus. > The position is located in Paris, France (11eme). > > Al

Re: dual processor

2005-09-05 Thread Paul Rubin
Nick Craig-Wood <[EMAIL PROTECTED]> writes: > > of is decrementing a reference count. Only one thread can be allowed to > > DECREF at any given time for fear of leaking memory, even though it will > > most often turn out the objects being DECREF'ed by distinct threads are > > themselves distin

Re: Job Offer in Paris, France : R&D Engineer (Plone)

2005-09-05 Thread Paul Rubin
Huron <[EMAIL PROTECTED]> writes: > > Since you're posting in English, is there any point in responding > > to it in English, and are non-Europeans eligible? > > I'm afraid not. The team is too small to welcome remote work at the present > time ... Working remotely hadn't occurred to me ;-). I

Re: Possible improvement to slice opperations.

2005-09-05 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > Given that Python has a 1's-complement operator already I don;t see > why you can't just leave Python alone and use it, What's the meaning of the 1's complement operator (for example, what is ~1), when ints and longs are the same? -- http://mail.python.o

Re: dual processor

2005-09-05 Thread Paul Rubin
Steve Jorgensen <[EMAIL PROTECTED]> writes: > In this case, it woiuld just be keeping a list of dirty hash tables, and > having a process that pulls the next one from the queue, and cleans it. If typical Python programs spend so enough time updating hash tables for a hack like this to be of any be

Re: dual processor

2005-09-06 Thread Paul Rubin
Steve Jorgensen <[EMAIL PROTECTED]> writes: > Given that Python is highly dependent upon dictionaries, I would > think a lot of the processor time used by a Python app is spent in > updating hash tables. That guess could be right or wrong, bus > assuming it's right, is that a design flaw? That's

Re: python profiling, hotspot and strange execution time

2005-09-06 Thread Paul Rubin
[EMAIL PROTECTED] writes: >I have some scientific application written in python. There is a > good deal of list processing, but also some "simple" computation such > as basic linear algebra involved. I would like to speed things up > implementing some of the functions in C. So I need profiling.

Re: Job Offer in Paris, France : R&D Engineer (Plone)

2005-09-06 Thread Paul Rubin
Huron <[EMAIL PROTECTED]> writes: > > 1) whether there would be legal or procedural obstacles for a > > non-European wanting to work in Paris for a while; and > If you are a member of the EU (the netherlands ?), there no such problem on > our side. Only _you_ would have some paperwork to do. I'm i

Re: Job Offer in Paris, France : R&D Engineer (Plone)

2005-09-06 Thread Paul Rubin
"Terry Reedy" <[EMAIL PROTECTED]> writes: > > Do you even realize you're having this conversation over the Python > > mailing list/newsgroup, rather than by private email? > > Did you consider asking *that* question privately ;-? Hehe, good comeback. Seriously, I figured enough other clpy people

Re: Replacement for lambda - 'def' as an expression?

2005-09-06 Thread Paul Rubin
Sybren Stuvel <[EMAIL PROTECTED]> writes: > An example: > > def generate_randomizer(n, m): > randomizer = def(x): > return x ** n % m > > return randomizer You're a little bit confused; "name" doesn't necessarily mean "persistent name". You could write the above as: def gener

Re: Replacement for lambda - 'def' as an expression?

2005-09-06 Thread Paul Rubin
"Terry Reedy" <[EMAIL PROTECTED]> writes: > Are you claiming that including a reference to the more humanly readable > representation of a function (its source code) somehow detracts from the > beauty of the function concept? Huh? Anonymous functions mean you can use functions as values by spel

Re: dual processor

2005-09-06 Thread Paul Rubin
Jorgen Grahn <[EMAIL PROTECTED]> writes: > I feel the recent SMP hype (in general, and in Python) is a red herring. Why > do I need that extra performance? What application would use it? How many mhz does the computer you're using right now have? When did you buy it? Did you buy it to replace a

Re: dual processor

2005-09-06 Thread Paul Rubin
Thomas Bellman <[EMAIL PROTECTED]> writes: > And I'm fairly certain that 'sort' won't start spending CPU time > until it has collected all its input, so you won't gain much > there either. For large input, sort uses the obvious in-memory sort, external merge algorithm, so it starts using cpu once

Re: Function returns a function

2005-09-06 Thread Paul Rubin
James Stroud <[EMAIL PROTECTED]> writes: > Any ideas on how to do this with a regular function, or is the way I've done > it the pythonic choice? I think you're trying to do something like this: def FunctionMaker(avar, func, label): def callback(): avar.set(label)

Re: dual processor

2005-09-06 Thread Paul Rubin
[EMAIL PROTECTED] (Bengt Richter) writes: > >And I'm fairly certain that 'sort' won't start spending CPU time > >until it has collected all its input, so you won't gain much > >there either. > > > Why wouldn't a large sequence sort be internally broken down into parallel > sub-sequence sorts and me

Re: Function returns a function

2005-09-06 Thread Paul Rubin
Aldo Cortesi <[EMAIL PROTECTED]> writes: > The lexical scope within which a function is declared is > made available to the function when it is run. This is done > by storing the values of free variables within the declared > function in the func_closure attribute of the created > function object.

Re: Ode to python

2005-09-06 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Python or C? C is simply a pawn. > Venomous problem? Pythons squeeze and constrict, until the problem is > gone. Don't quit your day job. -- http://mail.python.org/mailman/listinfo/python-list

Re: Replacement for lambda - 'def' as an expression?

2005-09-07 Thread Paul Rubin
Simo Melenius <[EMAIL PROTECTED]> writes: > But if you could do anonymous blocks, you could just write something > like: > > def generate_randomizer (n, m): > return def (x): > return pow (x, n, m) Yes, as it stands you can already say: def generate_randomizer(n, m): return l

Re: Job Offer in Paris, France : R&D Engineer (Plone)

2005-09-07 Thread Paul Rubin
"Adriaan Renting" <[EMAIL PROTECTED]> writes: > Not to discourage you, working abroad can realy be a nice thing to > do, but expect a lot of paperwork, and a lot of contradicting > answers. The basic thing is, that most european goventments aren't > set up to deal with expats, most immigrants are e

Re: PEP-able? Expressional conditions

2005-09-07 Thread Paul Rubin
Terry Hancock <[EMAIL PROTECTED]> writes: > def ternary(condition, true_result, false_result): > if condition: > return true_result > else: > return false_result > > Almost as good, and you don't have to talk curmudgeons into providing > it for you. Not the

Re: encryption with python

2005-09-07 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Basically I will like to combine a social security number (9 digits) > and a birth date (8 digits, could be padded to be 9) and obtain a new > 'student number'. It would be better if the original numbers can't be > traced back, they will be kept in a database anyways. Ho

Re: encryption with python

2005-09-07 Thread Paul Rubin
James Stroud <[EMAIL PROTECTED]> writes: > Then your best bet is to take a reasonable number of bits from an sha hash. > But you do not need pycrypto for this. The previous answer by "ncf" is good, > but use the standard library and take 9 digits to lessen probability for > clashes > > import s

Re: generator object, next method

2005-09-08 Thread Paul Rubin
Duncan Booth <[EMAIL PROTECTED]> writes: > 1) Every time you access gen.next you create a new method-wrapper object. Why is that? I thought gen.next is a callable and gen.next() actually advances the iterator. Why shouldn't gen.next always be the same object? -- http://mail.python.org/mailman/l

Re: PEP-able? Expressional conditions

2005-09-08 Thread Paul Rubin
Terry Hancock <[EMAIL PROTECTED]> writes: > > Not the same at all. It evaluates both the true and false results, > > which may have side effects. > > If you are depending on that kind of nit-picking behavior, > you have a serious design flaw, a bug waiting to bite you, > and code which shouldn't

Re: pretty windows installer for py scripts

2005-09-08 Thread Paul Rubin
Christophe <[EMAIL PROTECTED]> writes: > > Any recommendations on a windows packager/installer that's free? I need > > it to allow non-tech users to install some python scripts... you know, > > "Click Next"... "Click Next"... "Click Finish"... "You're Done!" and > > everything just magically works

Re: killing thread after timeout

2005-09-08 Thread Paul Rubin
Bryan Olson <[EMAIL PROTECTED]> writes: > First, a portable worker-process timeout: In the child process, > create a worker daemon thread, and let the main thread wait > until either the worker signals that it is done, or the timeout > duration expires. As the Python Library Reference states in > s

Python Jabber client?

2005-09-08 Thread Paul Rubin
Is there such a thing as a general purpose Python Jabber client? I'm imagining one that uses tkinter. A little Googling finds a couple of Jabber protocol libraries written in Python, a few half-finished projects, and a client for the Sharp Zaurus, but I didn't spot any simple portable ones that a

Re: Python compiled?

2005-09-10 Thread Paul Rubin
Tim Roberts <[EMAIL PROTECTED]> writes: > I doubt it. C#, VB.NET, VBscript, Javascript and Perl have not suffered > from being interpreted. Are you kidding? -- http://mail.python.org/mailman/listinfo/python-list

Re: global interpreter lock

2005-09-10 Thread Paul Rubin
Michael Sparks <[EMAIL PROTECTED]> writes: > > But I think to do it on Erlang's scale, Python needs user-level > > microthreads and not just OS threads. > > You've just described Kamaelia* BTW, except substitute micro-thread > with generator :-) (Also we call the queues outboxes and inboxes, and

Re: encryption with python

2005-09-10 Thread Paul Rubin
Kirk Job Sluder <[EMAIL PROTECTED]> writes: > You have a client on the phone who needs access to information, but has > forgotten or lost the 10-digit unique ID and the PIN you gave them two > years ago. How do you provide that client with the information he or > she needs? This is the kind of di

Re: encryption with python

2005-09-10 Thread Paul Rubin
Kirk Job Sluder <[EMAIL PROTECTED]> writes: > I'm more than happy to agree to disagree on this, but I see it > differently. In aviation there certainly is a bit of risk-benefit > analysis going on in thinking about whether the cost of a given safety > is justified given the benefits in risk reduct

Re: First release of Shed Skin, a Python-to-C++ compiler.

2005-09-10 Thread Paul Rubin
Mark Dufour <[EMAIL PROTECTED]> writes: > After nine months of hard work, I am proud to introduce my baby to the > world: an experimental Python-to-C++ compiler. Wow, looks really cool. But why that instead of Pypy? -- http://mail.python.org/mailman/listinfo/python-list

Re: encryption with python

2005-09-10 Thread Paul Rubin
James Stroud <[EMAIL PROTECTED]> writes: > Yes and no. Yes, you are theoretically correct. No, I don't think > you have the OP's original needs in mind (though I am mostly > guessing here). The OP was obviously a TA who needed to assign > students a number so that they could "anonymously" check th

Re: Fun with decorators and unification dispatch

2005-09-10 Thread Paul Rubin
"talin at acm dot org" <[EMAIL PROTECTED]> writes: > # Declare that "Factor" is a generic function > Factorial = Function() Was the comment a typo for Factorial? > # Define Factorial( 0 ) > @Arity( 0 ) > def Factorial(): > return 1 Overriding old definition of Factorial > # Define Factorial

Re: Software bugs aren't inevitable

2005-09-14 Thread Paul Rubin
"Paddy" <[EMAIL PROTECTED]> writes: > A work colleague circulated this interesting article about reducing > software bugs by orders of magnitude: > http://www.spectrum.ieee.org/WEBONLY/publicfeature/sep05/0905ext.html This gets a not found error. Got a different link? > Some methods they talk

Re: Software bugs aren't inevitable

2005-09-14 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > It is a "mere implementation detail" that (for most computer systems, and > most programming languages) stack space is at a premium and a deeply > recursive function can run out of stack space while the heap still has > lots of free memory. Every serio

Re: working with VERY large 'float' and 'complex' types

2005-09-14 Thread Paul Rubin
"Todd Steury" <[EMAIL PROTECTED]> writes: > or 1.#INDj. However I really need these numbers to be calculated (although > precision isn't key). Is there a way to get python to increase the size > limit of float and complex numbers? Python just uses machine doubles by default. You might be able

Re: ezPyCrypto

2005-09-14 Thread Paul Rubin
[EMAIL PROTECTED] writes: > My goal is to encrypt a nine-digit number so that it can be safely used > as a student ID number. Why don't you just use the build in stdlib functions as other people have proposed? -- http://mail.python.org/mailman/listinfo/python-list

Re: Software bugs aren't inevitable

2005-09-15 Thread Paul Rubin
"Paddy" <[EMAIL PROTECTED]> writes: > As I write, the main article starts here: > http://www.spectrum.ieee.org/sep05/2164 > With the sidebar here: > http://www.spectrum.ieee.org/sep05/2164/extsb1 Thanks, the article is slightly interesting but it doesn't say much. I'm sure a lot more is going

Re: working with VERY large 'float' and 'complex' types

2005-09-15 Thread Paul Rubin
Mikael Olofsson <[EMAIL PROTECTED]> writes: > > print 'z = %.5fE%d' % (10.**c, m) > > Nice approach. We should never forget that we do have mathematical > skills beside the computers. But, shouldn't you switch c and m in the > last row? Yeah, doh. c=characteristic, m=mantissa. -- http://mai

Re: Software bugs aren't inevitable

2005-09-15 Thread Paul Rubin
François Pinard <[EMAIL PROTECTED]> writes: > This being said, for one, I always found _insane_ presenting recursion > to new programmers using such examples, which are both very easily, > and much better written non-recursively. It does not help beginners > at taking recursion any seriously. I d

Re: Software bugs aren't inevitable

2005-09-16 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > But there is a difference: writing assembly is *hard*, which is why we > prefer not to do it. Are you suggesting that functional programming is > significantly easier to do than declarative? I think you mean imperative. Yes, there is a community that

Re: encryption with python?

2005-09-16 Thread Paul Rubin
Robert Kern <[EMAIL PROTECTED]> writes: > > http://www.nightsong.com/phr/crypto/p3.py > > [Ed Hotchkiss wrote:] > > Awesome. I just started Python today so I'd have no idea ... how good is > > this encryption compared to PGP? p3.py's functionality is nothing like PGP: it just encrypts character s

Re: Wanted: mutable bitmap

2005-09-17 Thread Paul Rubin
Tom Anderson <[EMAIL PROTECTED]> writes: > One thing that would be rather useful in various bits of programming > i've done would be a mutable bitmap type. > Am i right in thinking there's no such thing in the standard library? > Is there an implementation out there somewhere else? Is there a hack

Re: Roguelike programmers needed

2005-09-17 Thread Paul Rubin
[EMAIL PROTECTED] writes: > I'm pretty sure we'll be using PyGames for the graphics, although a > traditional ASCII roguelike interface would be nice to have too. ??!!! How can you call it roguelike if it's not ascii ??? -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a list of Mondays for a year

2005-09-18 Thread Paul Rubin
Chris <[EMAIL PROTECTED]> writes: > Is there a way to make python create a list of Mondays for a given year? > mondays = ['1/3/2005','1/10/2005','1/17/2005','1/24/2005', > '1/31/2005','2/7/2005', ... ] This is pretty inefficient but it's conceptually the simplest: def mondays(year): from ca

Re: How to write this iterator?

2005-09-19 Thread Paul Rubin
Hmm, here's an approach using the .throw() operation from PEP 342. It's obviously untested, since that feature is not currently part of Python, probably incorrect, and maybe just insane. I renamed "append" to "insert_iterator" since "append" usually means put something at the end, not in the middl

Re: How to write this iterator?

2005-09-19 Thread Paul Rubin
Paul Rubin <http://[EMAIL PROTECTED]> writes: > Hmm, here's an approach using the .throw() operation from PEP 342. > It's obviously untested, since that feature is not currently part of > Python, probably incorrect, and maybe just insane. Pardon the unintentional "sh

Re: C#3.0 and lambdas

2005-09-19 Thread Paul Rubin
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > "Is anyone truly attached to nested tuple function parameters; 'def > fxn((a,b)): print a,b'? /.../ > > Would anyone really throw a huge fit if they went away? I am willing > to write a PEP for their removal in 2.6 with a deprecation

Re: C#3.0 and lambdas

2005-09-19 Thread Paul Rubin
Michael Ekstrand <[EMAIL PROTECTED]> writes: > > def drawline((x1, y1), (x2, y2)): > > # draw a line from x1, y1 to x2, y2 > > foo(x1, y1) > > bar(x2, y2) > > Yow! I did not know you could even do this. > > My vote would be +1 for keeping them in the language... they look far > too u

Re: Best Encryption for Python Client/Server

2005-09-20 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > > Here's my mission: simple P2P class with encryption of whatever type > > of file is being sent, and authentication via encrypted user > > name/password. So any type of file or login being sent over the net, > > any communication between the scripts shoul

Re: Crypto.Cipher.ARC4, bust or me doing something wrong?

2005-09-21 Thread Paul Rubin
Michael Sparks <[EMAIL PROTECTED]> writes: > I'm looking at using this library and to familiarise myself writing > small tests with each of the ciphers. When I hit Crypto.Cipher.ARC4 I've > found that I can't get it to decode what it encodes. This might be a > case of PEBKAC, but I'm trying the fol

Re: Crypto.Cipher.ARC4, bust or me doing something wrong?

2005-09-21 Thread Paul Rubin
Michael Sparks <[EMAIL PROTECTED]> writes: > Rather than re-inventing wheels I thought I'd pick a library sit down > and see how pycrypt's meant to be used before actually going anyway. > (Amongst other reasons, this is why I suspected me, rather than the > library :-) Pycrypt doesn't operate at a

Re: unusual exponential formatting puzzle

2005-09-21 Thread Paul Rubin
Neal Becker <[EMAIL PROTECTED]> writes: > Like a puzzle? I need to interface python output to some strange old > program. It wants to see numbers formatted as: > > e.g.: 0.23456789E01 Yeah, that was normal with FORTRAN. > My solution is to print to a string with the '% 16.9E' format, then >

Re: Intermediate to expert book

2005-09-21 Thread Paul Rubin
Tony Houghton <[EMAIL PROTECTED]> writes: > Can anyone recommend a good book for intermediate up to expert level? Python Cookbook (2nd ed.) by Alex Martelli, if you really want a dead tree book. It's not so much about Python itself, as how to accomplish various things with it. If you just want t

Re: multi threading in multi processor (computer)

2005-02-12 Thread Paul Rubin
John Lenton <[EMAIL PROTECTED]> writes: > and buying more, cheap computers gives you more processing power than > buying less, multi-processor computers. The day is coming when even cheap computers have multiple cpu's. See hyperthreading and the coming multi-core P4's, and the finally announced C

Re: Kill GIL

2005-02-13 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > > Threads are also good for handling blocking I/O. > > Actually, this is one of the cases I was talking about. I find it > saner to convert to non-blocking I/O and use select() for > synchronization. That solves the problem, without introducing any of > the

Re: Pythonic poker client

2005-02-13 Thread Paul Rubin
[EMAIL PROTECTED] writes: > I'm assuming that I need to figure out the port it uses, find the > server, analyze the packets for commands, and then build an app that > masquerades as the real client. > > Anyone have any experience with this? If you mean you want to write your own real-money poker

Re: AES crypto in pure Python?

2005-02-14 Thread Paul Rubin
[EMAIL PROTECTED] writes: > I'm looking for an implementation of AES (the Advanced Encryption > Standard) in pure Python. I'm aware of pycrypto, but that uses C code. > I'm hoping to find something that only uses Python...I'm willing to > trade speed for portability, since my application is desig

Re: Scan document pages to a compressed PDF

2005-02-14 Thread Paul Rubin
Ed Suominen <[EMAIL PROTECTED]> writes: > What's the best way currently to do CCITT4 compression (e.g., of > intermediate TIFF-format images) from Python? PIL doesn't seem to support > CCITT4 compression, and the read-only patch [1] that's available won't help > in my case. I'd like to incorporate

Re: is there a safe marshaler?

2005-02-14 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > Pickle and marshal are not safe. They can do harmful things if fed > > maliciously constructed data. That is a pity, because marshal is fast. > > I think marshal could be fixed; the only unsafety I'm aware of is that > it doesn't always act rati

Re: is there a safe marshaler?

2005-02-14 Thread Paul Rubin
Irmen de Jong <[EMAIL PROTECTED]> writes: > > There's another issue with marshal that makes it unsuitable for Pyro, > > which is that its data format is (for legitimate reasons) not > > guaranteed to be the same across different Python releases. That > > means that if the two ends of the Pyro appl

Re: parsing IMAP responses?

2005-02-14 Thread Paul Rubin
Grant Edwards <[EMAIL PROTECTED]> writes: > The imaplib module return values are mostly useless as-is: > they're just whatever string the server sent (or in some cases > a list of strings). You've got to parse them using the IMAP > syntax before you can do much with them. > > Is there a library

Re: array of bits?

2005-02-14 Thread Paul Rubin
MM <[EMAIL PROTECTED]> writes: > What is the best structure/way to create an array of bits (actually > true/false flags) of an arbitrary length ranging from about 20 upto > about 500. Speed of access more of an issue than compactness. Use a normal list: [False, False, True, False, True, ... ] . --

Re: Kill GIL (was Re: multi threading in multi processor (computer))

2005-02-14 Thread Paul Rubin
[EMAIL PROTECTED] (Aahz) writes: > >[phr] The day is coming when even cheap computers have multiple cpu's. > >See hyperthreading and the coming multi-core P4's, and the finally > >announced Cell processor. > > > >Conclusion: the GIL must die. > > It's not clear to what extent these processors will

Re: is there a safe marshaler?

2005-02-14 Thread Paul Rubin
Irmen de Jong <[EMAIL PROTECTED]> writes: > > What do you do about the security issue if you're using pickle? Do > > you have to trust the other end to not send you malicious pickles? > > I do nothing about it. > Yes, you have to trust the other end. > So you have to use your own -or Pyro's- auth

Re: is there a safe marshaler?

2005-02-14 Thread Paul Rubin
Irmen de Jong <[EMAIL PROTECTED]> writes: > > Well, ok, if you trust then other end then I think it's enough to just > > authenticate all the pickles (say using hmac.py) without needing > > something as heavyweight as SSL. > > An interesting idea that hadn't crossed my mind yet. Pyro *does* > alr

Re: Inheritance error in python 2.3.4???

2005-02-14 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > The problem is that I actually do need them to be private to the > outside world... but not to subclasses. I guess what I actually need > is something like "protected" in C++ but I don't think I'm going to > get that luxury. The only way to ma

Re: is there a safe marshaler?

2005-02-14 Thread Paul Rubin
Irmen de Jong <[EMAIL PROTECTED]> writes: > > Note you should also put sequence numbers in the messages, to stop > > the attacker from fooling you by selectively deleting or replaying > > messages. > > Thanks for the tip. I'll think about this. Hmm, you also want a random blob in each packet (inc

Re: is there a safe marshaler?

2005-02-14 Thread Paul Rubin
Irmen de Jong <[EMAIL PROTECTED]> writes: > I know a bit about this stuff, but not nearly enough to come > up with a water tight design by myself, so it's much easier > and safer to rely on trusted work by others. Yeah, at this point I think it's safest to just use SSL. If I use Pyro for anything

Re: newbie question convert C to python

2005-02-14 Thread Paul Rubin
[EMAIL PROTECTED] writes: > How do i handle this piece of code in python: > > # define vZero 15 > # define vOne 20 > > unsigned int vTable[Zero][One] > > if(vGroup[vZero][vOne] == 0) > { > vGroup[vZero][vOne]-- > . > . > } Simplest might be with a dic

low-end persistence strategies?

2005-02-15 Thread Paul Rubin
I've started a few threads before on object persistence in medium to high end server apps. This one is about low end apps, for example, a simple cgi on a personal web site that might get a dozen hits a day. The idea is you just want to keep a few pieces of data around that the cgi can update. Imm

SHA1 broken

2005-02-15 Thread Paul Rubin
FYI. >From : The research team of Xiaoyun Wang, Yiqun Lisa Yin, and Hongbo Yu (mostly from Shandong University in China) have been quietly circulating a paper announcing their results: * collisions in the the full

Re: low-end persistence strategies?

2005-02-16 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > Maybe ZODB helps. I think it's way too heavyweight for what I'm envisioning, but I haven't used it yet. I'm less concerned about object persistence (just saving strings is good enough) than finding the simplest possible approach to dealing with co

Re: low-end persistence strategies?

2005-02-16 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > > I think it's way too heavyweight for what I'm envisioning, but I > > haven't used it yet. I'm less concerned about object persistence > > (just saving strings is good enough) than finding the simplest > > possible approach to dealing with concurre

Re: low-end persistence strategies?

2005-02-16 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > It has to be installed. And it has C-modules - but I don't see that > as a problem. Of course this is my personal opinion - but it's > certainly easier installed than to cough up your own transaction > isolated persistence layer. I started using it

Re: low-end persistence strategies?

2005-02-16 Thread Paul Rubin
Tom Willis <[EMAIL PROTECTED]> writes: > Sounds like you want pickle or cpickle. No, the issue is how to handle multiple clients trying to update the pickle simultaneously. -- http://mail.python.org/mailman/listinfo/python-list

Re: low-end persistence strategies?

2005-02-16 Thread Paul Rubin
"Michele Simionato" <[EMAIL PROTECTED]> writes: > What about bsddb? On most Unix systems it should be already > installed and on Windows it comes with the ActiveState distribution > of Python, so it should fullfill your requirements. As I understand it, bsddb doesn't expose the underlying Sleepyca

Re: SHA1 broken

2005-02-16 Thread Paul Rubin
Irmen de Jong <[EMAIL PROTECTED]> writes: > > Also, the new findings only apply to hash collisions, not to the > > invertibility of SHA1 hashes - thus, as Schneier points out, uses of > > keyed hashes (such as HMAC) are not compromised by this. > > What about HMAC-MD5? HMAC-MD5 and HMAC-SHA1 shou

Re: low-end persistence strategies?

2005-02-16 Thread Paul Rubin
"Michele Simionato" <[EMAIL PROTECTED]> writes: > The documentation hides this fact (I missed that) but actually > python 2.3+ ships with the pybsddb module which has all the > functionality you allude too. Check at the test directory for bsddb. Thanks, this is very interesting. It's important f

<    7   8   9   10   11   12   13   14   15   16   >