Re: database persistence with mysql, sqlite

2007-09-23 Thread Bryan Olson
n object, then deal them out a few at a time. But as a rule of thumb, the less state on the server the better. > Would SqlAlchemy or SqlObject make things easier with regard to > database persistence? Quite likely, but probably not in the way you propose. The web frameworks that use those toolkits try to do things in robust and portable ways. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Google and Python

2007-09-24 Thread Bryan Olson
Alex Martelli wrote: > Bryan Olson wrote: [...] >> How does Google use Python? As their scripting-language >> of choice. A fine choice, but just a tiny little piece. >> >> Maybe Alex will disagree with me. In my short time at >> Google, I was uber-nobody. &

Re: Google and Python

2007-09-25 Thread Bryan Olson
Alex Martelli wrote: > Bryan Olson <[EMAIL PROTECTED]> wrote: >... >>> YouTube (one of Google's most valuable properties) is essentially >>> all-Python (except for open-source infrastructure components such as >>> lighttpd). Also, at Google

Re: Google and Python

2007-09-25 Thread Bryan Olson
this but one of > these days I want to get around to writing a patch. Windows can do it, but differently. What a surprise. I just looked it up: WSADuplicateSocket() is the key. Windows and Unix modules with the same Python interface would rock. -- --Bryan -- http://mail.python.org/mailman/

Re: database persistence with mysql, sqlite

2007-09-26 Thread Bryan Olson
so apparently supports > the mysql syntax (LIMIT NN, 10) for compatibility reasons. A more reliable form is along the lines: SELECT keyfield, stuff FROM table WHERE keyfield > ? ORDER BY keyfield LIMIT 10 With the right index, it's efficient. -- --Bryan -

Re: database persistence with mysql, sqlite

2007-09-26 Thread Bryan Olson
Lawrence D'Oliveiro wrote: > In Bryan Olson wrote: > >> coldpizza wrote: >>> It turned out that the method above ('SELECT * FROM TABLE LIMIT L1, >>> L2') works ok both with mysql and sqlite3, therefore I have decided to >>> stick with

Re: database persistence with mysql, sqlite

2007-09-26 Thread Bryan Olson
Lawrence D'Oliveiro wrote: > Bryan Olson wrote: > >> Lawrence D'Oliveiro wrote: >>> In Bryan Olson wrote: >>> >>>> coldpizza wrote: >>>>> It turned out that the method above ('SELECT * FROM TABLE LIMIT L1, >>>>

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-27 Thread Bryan Olson
VL trees, red-black trees, 2-3 trees, b-trees, splay trees, or skip-lists. Implementing these is non-trivial, but easily within the ability of many people here. Don't worry about the coding. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Load balancing and passing sockets; was: Re: Google and Python

2007-09-27 Thread Bryan Olson
dia.org/wiki/Round_robin_DNS http://en.wikipedia.org/wiki/Reverse_proxy http://en.wikipedia.org/wiki/Squid_proxy Web apps tend to scale just great, except when they need data that is both shared and modifiable. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: s.split() on multiple separators

2007-09-30 Thread Bryan Olson
7;t quite cut it, try re.split(), or maybe re.findall(). Is one of these what you want? import re c = ' abcde abc cba fdsa bcd ' print re.split('[ce ]', c) print re.split('[ce ]+', c) print re.findall('[^ce ]+', c) -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: which language allows you to change an argument's value?

2007-09-30 Thread Bryan Olson
get changed. Don't rely on undocumented behavior. Modules worth using are by good programmers. Authors of library modules tend to be zealous about not breaking client code. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: transmit an array via socket

2007-10-27 Thread Bryan Olson
. If an unfriendly can connect to our socket, they can feed us a *poison* pickle. The marshal module is at least as bad. The marshaling in RPC facilities tends to be much safer. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: basic threading question

2007-10-31 Thread Bryan Olson
the parameter bindings live. Of course if you pass the same mutable object in multiple threads, that's a different issue. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Yank Bastards KILLED THEIR OWN PEOPLE to stage 911 DRAMA

2007-01-27 Thread bryan rasmussen
See, if the python list mail server was written in Lisp Paul Graham would already have been able to write up a spam filter to ban this guy. Seriously though, shouldn't Thermate be banned by now. Cheers, Bryan Rasmussen On 26 Jan 2007 10:56:44 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED

Re: BYU Physics Prof Finds Thermate in WTC Physical Samples, Building Collapses an Inside Job

2007-01-31 Thread bryan rasmussen
the WTC and been killed. This would explain why trolling duties have been recently taken up by [EMAIL PROTECTED] on this list. Cheers, Bryan Rasmussen On 1/31/07, soutjhyDin <[EMAIL PROTECTED]> wrote: > > <[EMAIL PROTECTED]> wrote in message > news:[EMAI

starship.python.net is down

2007-02-16 Thread Tom Bryan
One of the system administrators had to reboot starship.python.net last night, but it appears that the machine did not come back up properly. starship.python.net is currently down while we investigate. ---Tom -- http://mail.python.org/mailman/listinfo/python-list

string.find returns -1 when string evidently in source file

2007-02-18 Thread bryan rasmussen
p 49 "Page Up" 4b Left 4d Right 4f End 50 Down 51 "Page Down" 52 Insert 53 Delete 54 <00> 56 Help 5b "Left Windows" 5c "Right Windows" 5d Application KEYNAME_DEAD 00b4"ACUTE ACCENT" 00a8"DIAERESIS" 007e"TILDE" 00b0"DEGREE SIGN" ENDKBD the encoding of the file is Unicode, I am able to return instances of individual characters but not whole words. Cheers, Bryan Rasmussen -- http://mail.python.org/mailman/listinfo/python-list

Re: starship.python.net is down

2007-02-26 Thread Tom Bryan
[EMAIL PROTECTED] wrote: > Any news on starship.python.net? It still seems to be down. Yes. Unfortunately, there may be a hardware problem. Stefan, the admin who owns the hosted machine, is working with the host company to determine what's going on. I think that they are still in the "inve

preparing data for visualization

2007-11-12 Thread Bryan . Fodness
File Rev = G Treatment = Dynamic Dose Last Name = Fodness First Name = Bryan Patient ID = 0001 Number of Fields = 4 Number of Leaves = 120 Tolerance = 0.50 Field = 10 Index = 0. Carriage Group = 1 Operator = Collimator = 0.0 Leaf 1A = 0.00 Leaf 2A = 0.00 Leaf 3A = 0.00 Leaf

write iso 9660 with python

2007-11-17 Thread bryan rasmussen
Hi, I need to read in a system of files and write them to an iso 9660, any libraries suited to this task that are up to date? Python 2.4 or 2.5 should be assumed. Cheers, Bryan Rasmussen -- http://mail.python.org/mailman/listinfo/python-list

sys.arg whitespace problem

2007-11-18 Thread bryan rasmussen
whitespace between arguments. Cheers, Bryan Rasmussen -- http://mail.python.org/mailman/listinfo/python-list

Re: Die, thread! Die! (Was Re: "Python" is not a good name)

2007-12-04 Thread bryan rasmussen
Could we name Stackless Die, microthread! Die! then? Cheers, Bryan Rasmussen On Dec 4, 2007 4:04 PM, Shane Geiger <[EMAIL PROTECTED]> wrote: > Die, thread! Die! > > > > grflanagan wrote: > > On Dec 4, 11:53 am, [EMAIL PROTECTED] wrote: > > > >> On Dec 4,

python webserver question

2007-12-17 Thread dale bryan
I am working on a task to display a wireless network nodes using Google Earth (GE) with KML network links. I am using a simple python webserver (see code below) to serve up the python scripts as KML output to GE for this. import BaseHTTPServer import CGIHTTPServer class Handler(CGIHTTPServer.CG

Unicode Regular Expressions

2007-12-23 Thread bryan rasmussen
sions that are loaded from the file conform to Unicode regular expressions. What problems can be expected using Unicode Regex with Python, is there a library I should be using? Cheers, Bryan Rasmussen -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythoncard question

2006-05-04 Thread bryan rasmussen
thisloc = doc.createElementNS("", "word") xexpr= "//word[.='" + word + "']" xp = Evaluate(xexpr,doc.documentElement) if len(xp) < 1: loc.appendChild(thisloc) text = doc.create

refactoring question

2006-05-04 Thread bryan rasmussen
d[.='" + word + "']" xp = Evaluate(xexpr,doc.documentElement) if len(xp) < 1: loc.appendChild(thisloc) text = doc.createTextNode(word) thisloc.appendChild(text) fi = open(folderwords, "w") fi.write(doc.toxml()) Cheers, Bryan Rasmussen -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythoncard question

2006-05-04 Thread bryan rasmussen
oops, sorry about that. I copied the message over in gmail but forgot to change the subject. Sorry, Bryan Rasmussen -- http://mail.python.org/mailman/listinfo/python-list

Re: URLlib2?

2008-02-28 Thread Bryan Olson
uot;, or thwart so-called "bandwidth theft". In these cases, checking the referrer is a weak solution; the better method is based on cookies. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Dual look-up on keys?

2008-03-06 Thread Bryan Olson
ons would run in time len(self). We want an implementation where the find_by's run in O(1 + k) where k is the length of the returned sequence. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Bit twiddling floating point numbers

2008-03-06 Thread Bryan Olson
, before using > ldexp to 'repack' the float. Ah, those are handy. Jeff described his problem: "In particular, I would like to round my float to the n most significant bits." I think this works: from math import frexp, ldexp, floor def round_mantissa(x, nbits):

Re: Python CGI & Webpage with an Image

2008-03-06 Thread Bryan Olson
rodmc wrote: [...] > Python: > > f = open("finish.html") > doc = f.read() > f.close() > print doc You might need to start with: print "Content-Type: text/html" print Is "finish.html" in the right place? When you browse to your script, can you see that you're getti

Re: Dual look-up on keys?

2008-03-06 Thread Bryan Olson
[EMAIL PROTECTED] wrote: > Bryan Olson wrote: >> How can we efficiently implement an abstract data type, call it >> 'DoubleDict', where the state of a DoubleDict is a binary >> relation, that is, a set of pairs (x, y); and the operations on >> a Doubl

Re: Python CGI & Webpage with an Image

2008-03-06 Thread Bryan Olson
RL it used to get the page, which in the case of the CGI script is the path to the script, not the path to the html file. If server logs are hard to get or read, try my runcgi.py script: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/550822 -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: What c.l.py's opinions about Soft Exception?

2008-03-09 Thread Bryan Olson
be a huge change to Python, so I doubt it will get traction here. Still, I'd say it's worth more consideration and discussion. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: SOAP access to SharePoint

2008-03-11 Thread bryan rasmussen
with Microsoft XML Schema validation, this may seem tedious but it is likely to be less tedious than relying on any APIs to agree in the wide wonderful world of Soap based WebServices. Cheers, Bryan Rasmussen On Tue, Mar 11, 2008 at 10:38 PM, Paul Watson <[EMAIL PROTECTED]> wrote: >

Re: Creating a file with $SIZE

2008-03-13 Thread Bryan Olson
ates, random data is a usually a better choice. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: How to send a var to stdin of an external software

2008-03-13 Thread Bryan Olson
solutions are to make either the input or output stream a disk file, or to create another thread (or process) to be an active reader or writer. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: How to send a var to stdin of an external software

2008-03-13 Thread Bryan Olson
underlying file descriptors. (MS-Windows async mechanisms are not as well exposed by the Python standard library.) -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Socket Performance

2008-03-14 Thread Bryan Olson
x > Send-3: yyy > Receive-6: xxxyyy Can happen, though I think the problem with Dennis's code is the other way. The recv in leng = ntoh(socket.recv(2)) might return one byte of data, not two. The latter recv is similar. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Socket Performance

2008-03-14 Thread Bryan Olson
sult, taking the occasional measurements still isn't a bad idea (but don't tell my algorithms students). -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Spaces in path name

2008-03-14 Thread Bryan Olson
ath.isfile(ANT_CMD): > error('"%s" does not exist' % ANT_CMD) There you don't want the quotes within the string. On my MS-Win box: >>> import os >>> os.path.isfile(r'C:\Program Files\Windows NT\dialer.exe') True

Re: Spaces in path name

2008-03-14 Thread Bryan Olson
it took them years to fix many common cases where their own software choked on the paths. I got into the habit of installing everything under c:\bin rather than C:\Program Files. I still do that just to avoid writing essays into my PATH variable. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a file with $SIZE

2008-03-14 Thread Bryan Olson
s contrary to the stated requirement but usually better for stated application, will prevent compression but not prevent fragmentation. I'm not entirely clear on what the OP is doing. If he's testing network throughput just by creating this file on a remote server, the seek-way-past-end

Re: escape string to store in a database?

2008-03-14 Thread Bryan Olson
It is currently available on line at: http://www.seas.upenn.edu/~zives/03f/cis550/codd.pdf Anyone have a particularly good and easily accessible source to recommend on SQL? -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a file with $SIZE

2008-03-14 Thread Bryan Olson
Robert Bossy wrote: > Bryan Olson wrote: >> Robert Bossy wrote: >>>> Robert Bossy wrote: >>>>> Indeed! Maybe the best choice for chunksize would be the file's buffer >>>>> size... >> >> That bit strikes me as s

Re: Socket Performance

2008-03-15 Thread Bryan Olson
ecause I want to send two pickles. "Two pickles" sounds like a tasty snack, but also suggests you may be playing hopscotch in a minefield. This is a helpful group. Give us more to go on, and you are likely to receive thousands of dollars worth of consulting for free. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert int to float

2008-03-16 Thread Bryan Olson
plex numbers, in which case the float() method will raise a TypeError, while the 1.0* method will return the complex result. It may not be what van Brakel wants here, but it's an alternative to keep in mind. And I find it easier to type. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: win32: emulating select() on pipes

2008-03-18 Thread Bryan Olson
x27;s the source. If you put together a simple working example, I hope you'll post it. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: finding items that occur more than once in a list

2008-03-18 Thread Bryan Olson
seen.add(x) return mults I've typically used dicts for such things, as in: def multiples(lst): h = {} for x in lst: h[x] = h.get(x, 0) + 1 return set([x for x in h if h[x] > 1]) -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: finding items that occur more than once in a list

2008-03-18 Thread Bryan Olson
xplicitly stored link fields. Perhaps I'm mistaken. The amortized doubling breaks that. > I don't think you are mistaken, but if I'm wrong I'd be grateful for a > link to further details. Arnaud Delobelle offered a good Wikipedia link, and for more background look up "amortized analysis. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: How to send a var to stdin of an external software

2008-03-21 Thread Bryan Olson
ary test data. >> >> q = Queue.Queue() >> thread.start_new_thread(readtoq, (cat.stdout, q)) >> cat.stdin.write(myVar) >> cat.stdin.close() >> cat.wait() >> myNewVar = q.get() >> >> assert myNewVar == myVar >> pri

Re: finding items that occur more than once in a list

2008-03-21 Thread Bryan Olson
Arnaud Delobelle wrote: > Bryan Olson wrote: [...] >> Arnaud Delobelle offered a good Wikipedia link, and for more background >> look up "amortized analysis. > > Hrvoje Niksic provided the link :). Oops, careless thread-following. Hrvoje Niksic it was. > I still

Re: What Programming Languages Should You Learn Next?

2008-03-21 Thread Bryan Olson
sometimes a bit like watching ESPN show the world championship of a game at which I usually beat my friends. There are levels beyond levels beyond my level. And I'm a pro. It is to the shame of my alma mater that they denied tenure to Dr. Sasaki. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: finding items that occur more than once in a list

2008-03-22 Thread Bryan Olson
[EMAIL PROTECTED] wrote: > John Machin wrote: >> On Mar 22, 1:11 am, [EMAIL PROTECTED] wrote: >>> A collision sequence is not so rare. >>>>>> [ hash( 2**i ) for i in range( 0, 256, 32 ) ] >>> [1, 1, 1, 1, 1, 1, 1, 1] >> Bryan did qualify his rem

Re: finding items that occur more than once in a list

2008-03-22 Thread Bryan Olson
Arnaud Delobelle wrote: > Bryan Olson wrote: >> We mean that the party supplying the keys deliberately chose >> them to make the hash table inefficient. In this thread the goal >> is efficiency; a party working toward an opposing goal is an >> adversary. > > Th

Re: Testing for an empty dictionary in Python

2008-03-23 Thread Bryan Olson
, so an instance is usually best named something else. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Breaking the barrier of a broken paradigm... part 1

2008-03-25 Thread Bryan Olson
quot;,usrHome > print "theUsr is: ",theUsr > > os.system('/usr/bin/chmod 750 ' + usrHome) > os.system('/usr/bin/chown ' + theUsr + ' ' + usrHome) > > #I know that I can't optimize the line below further... or... can I? > > sys.exit("Thanks for using pyDirFixr...") Given the Unixy nature of your code, you probably want to sys.exit(0) for success and 1 or 2 for failure. Happy hacking, -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: How to send a var to stdin of an external software

2008-03-25 Thread Bryan Olson
ction with bash. I'll see if it make a great load average and/or > I/O time. Hmmm... you might try increasing the buffer size. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Start Python at client side from web app

2009-01-21 Thread Bryan Olson
don't know of any open-source implementation. Do you plan to have just one public key for verifying the downloaded Python scripts, hard-coded into the extension? -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Securing a database

2009-01-23 Thread Bryan Olson
whopping bunch of other techniques going vastly beyond that description. Look up DRM technology companies, such as CloakWare, Macrovision, and Cryptography Research. If you have a modest number of customers, hardware solutions and/or strict contractual commitments might offer practical sol

Re: Why GIL? (was Re: what's the point of rpython?)

2009-01-23 Thread Bryan Olson
Carl Banks wrote: [...] BTW, class instances are usually immutable and thus don't require a mutex in the system I described. Then you are describing a language radically different from Python. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Why GIL? (was Re: what's the point of rpython?)

2009-01-23 Thread Bryan Olson
Paul Rubin wrote: Bryan Olson writes: BTW, class instances are usually immutable and thus don't require a mutex in the system I described. Then you are describing a language radically different from Python. That one threw me for a minute too, but I think the idea is that the class ins

Re: Why GIL? (was Re: what's the point of rpython?)

2009-01-23 Thread Bryan Olson
Carl Banks wrote: Paul Rubin wrote: Bryan Olson writes: BTW, class instances are usually immutable and thus don't require a mutex in the system I described. Then you are describing a language radically different from Python. That one threw me for a minute too, but I think the idea is

Re: Why GIL? (was Re: what's the point of rpython?)

2009-01-23 Thread Bryan Olson
Carl Banks wrote: Bryan Olson wrote: Paul Rubin wrote: Bryan Olson writes: BTW, class instances are usually immutable and thus don't require a mutex in the system I described. Then you are describing a language radically different from Python. That one threw me for a minute too,

Doc for extended call syntax; was: Re: unzip array of arrays?

2009-01-24 Thread Bryan Olson
extended call syntax whether or not is defined with * and ** arguments. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Securing a database

2009-01-25 Thread Bryan Olson
kt83...@gmail.com wrote: Thank you very much Bryan. It does look like this is out of my league. As Peter Pearson noted, "It is out of *everyone's* league." And Peter used to work for Cryptography Research, a small company that scored as high in this league as anyone. Maybe

Re: Doc for extended call syntax; was: Re: unzip array of arrays?

2009-01-27 Thread Bryan Olson
Python's extended call syntax. Great. I think I grock the extended call syntax, and when the question came up I was surprised not to be able to find where I learned it. Mark, where exactly does one look to see this "full description"? -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Why GIL? (was Re: what's the point of rpython?)

2009-01-27 Thread Bryan Olson
Paul Rubin wrote: Bryan Olson writes: An object's __dict__ slot is *not* mutable; thus we could gain some efficiency by protecting the object and its dict with the same lock. I do not see a major win in Mr. Banks' point that we do not need to lock the object, just its dict. I

Re: Ordered dict by default

2009-02-05 Thread Bryan Olson
s really not. http://en.wikipedia.org/wiki/Ordered_set A list is an ordered collection, for example. True. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Ordered dict by default

2009-02-05 Thread Bryan Olson
terms of the key order. "Ordered Dictionaries" are a bit fuzzy. :) A few bits fuzzy. Is the following True or False if dict is insert-ordered? dict(a=6, b=7) == dict(b=7, a=6) -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode and hashlib

2008-12-01 Thread Bryan Olson
MD5 has fallen and SHA-1 is falling. Python's hashlib also includes the stronger SHA-2 family. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode and hashlib

2008-12-02 Thread Bryan Olson
Scott David Daniels wrote: Bryan Olson wrote: ... I think that's good behavior, except that the error message is likely to end beginners to look up the obscure buffer interface before they find they just need mystring.decode('utf8') or bytes(mystring, 'utf8'). Oops,

Re: Reverse zip() ?

2008-12-02 Thread Bryan Olson
value argument. Perhaps that's what you want? -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Reverse zip() ?

2008-12-02 Thread Bryan Olson
ess? A: Use zip()! | >>> a2, b2 = zip(*z) | >>> a2 | (1, 2, 3) | >>> b2 | (4, 5, 6) zip as its own inverse might be even easier to comprehend if we call zip by its more traditional name, "transpose". -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Overriding a method at the instance level on a subclass of a builtin type

2008-12-02 Thread Bryan Olson
newly-assigned class be 'heap types', which the native dict is not. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Obama's Birth Certificate - Demand that US presidential electors investigate Obama's eligibility

2008-12-02 Thread Bryan Olson
ial Proceedings of every other State. And the Congress may by general Laws prescribe the Manner in which such Acts, Records and Proceedings shall be proved, and the Effect thereof." These haters seek to make Obama prove his records in ways others have not had to, and beyond any manner pr

Re: python an sqlite objects

2008-12-04 Thread Bryan Olson
field's declared type. sqlite3 is different; it will try to make an exception to the field's declared type and store the object as the type with which it came in. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Off Topic: Re: Obama's Birth Certificate - Demand that US presidential electors investigate Obama's eligibility

2008-12-04 Thread Bryan Olson
[EMAIL PROTECTED] wrote: Bryan Olson wrote: [EMAIL PROTECTED] wrote: This message is not about the meaningless computer printout called More importantly, it's not about Python. I'm setting follow-ups to talk.politics. I set the follow-ups header appropriately, as per established

Re: python an sqlite objects

2008-12-04 Thread Bryan Olson
e running version of Python is 3 or higher, import sys assert sys.version_info[0] >= 3 -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Bidirectional Networking

2008-12-12 Thread Bryan Olson
l. SocketServer is built on top of 'socket', which has the list() and accept() calls to create the queue and get connections from it, respectively. The traditional listen queue size, and sometimes the system maximum, is 5. If you want to use SocketServer, read about ThreadingMixIn and ForkingMixIn. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Bidirectional Networking

2008-12-13 Thread Bryan Olson
Emanuele D'Arrigo wrote: Hey Bryan, thank you for your reply! Bryan Olson wrote: Is it possible then to establish both a server and a client in the same application? Possible, and not all that hard to program, but there's a gotcha. Firewalls, including home routers and software

Re: Bidirectional Networking

2008-12-14 Thread Bryan Olson
Emanuele D'Arrigo wrote: Bryan Olson wrote: Software firewalls will often simply refuse incoming connections. The basic protection of the garden-variety home router comes from "network address translation" (NAT), in which case TCP connections initiated from the inside will

Re: Bidirectional Networking

2008-12-14 Thread Bryan Olson
d could easily reach the limit. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: socket and subprocess problem

2008-12-15 Thread Bryan Olson
It's still a race condition even if the side you want to win almost always does. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: socket and subprocess problem

2008-12-15 Thread Bryan Olson
all to listen() returns, but before he calls accept(). -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Thread Locking issue - Can't allocate lock (sem_init fail)

2008-12-15 Thread Bryan Olson
duce performance but keep the number of lock objects to a > minumum. That's probably a reasonable strategy whether or not you can create a million locks. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: socket and subprocess problem

2008-12-18 Thread Bryan Olson
successfully started a listening socket initiate a connection. I'd swear James copied my response, except his came first. Even the formatting came out similar. I hadn't seen his response when I wrote mine, and wouldn't have bothered posing the same thing again. -- --Br

Re: Twisted for non-networking applications

2008-12-22 Thread Bryan Olson
reads. The reactor pattern describes event-driven I/0, not parallel processing. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Event Driven programming - Doubts

2008-12-22 Thread Bryan Olson
ready list, invoking the corresponding callbacks one by one. After the last callback returns, the framework loops back to select() again. select() is not the only call to do multi-source I/O, and I'm not an expert on these frameworks, so take the above as a simplified general description

Re: Very basic question

2008-12-23 Thread Bryan Olson
;t immediately followed by another '/' with '* 1.0 /', that might work... or maybe someone fill find counter-examples. Python 3 does what you want. The / operator is float division. The // operator is still integer division. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: select.select and socket.setblocking

2009-01-03 Thread Bryan Olson
and recv()] are atomic, so one process gets the new connection; what happens in the other depends on whether we use a blocking or non-blocking socket, and clearly we want non-blocking. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Testing if an index is in a slice

2009-01-03 Thread Bryan Olson
for i in range(-3, n + 5) if inslice(i, slc, n)] s2 = sorted(range(n)[slc]) assert s1 == s2 -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: socket send help

2009-01-03 Thread Bryan Olson
tead of the empty string is that a firewall might *not* be blocking your server. The Python sockets module interprets the empty string as INADDR_ANY, which means to bind to all available adapters including the loopback, A.K.A localhost, A.K.A '127.0.0.1'. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Doubt on creating threads

2009-01-03 Thread Bryan Olson
nd is insignificant. My out-dated Pentium 4 desktop can create and destroy a few thousand threads per second under WinXP; more under recent Linux. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Testing if an index is in a slice

2009-01-04 Thread Bryan Olson
ide = slc.indices(len) if stride < 0: return (start >= index > stop) and ((start-index) % -stride == 0) else: return (start <= index < stop) and ((index-start) % stride == 0) (Hint: help(slice) is your friend.) I should really think about abandoning my st

Re: socket send help

2009-01-05 Thread Bryan Olson
Gabriel Genellina wrote: Bryan Olson escribió: Gabriel Genellina wrote: greyw...@gmail.com escribió: [...] A simple server: from socket import * myHost = '' Try with myHost = '127.0.0.1' instead - a firewall might be blocking your server. Just a nit: I

Re: socket send help

2009-01-07 Thread Bryan Olson
Gabriel Genellina wrote: James Mills escribió: Bryan Olson wrote: I thought a firewall would block an attempt to bind to any routeable address, but not to localhost. So using INADDR_ANY would be rejected. No. My understanding is that firewalls block network traffic, not system calls

Re: socket.error 24: too many open files

2009-01-07 Thread Bryan Olson
uggestions would be much appreciated. Is it possible you keep accumulating MySQLdb connection or cursor objects and don't close() them? (I don't know the innards of MySQLdb, but it's something to check.) One thing you might try is to regularly log the filno() of your sock

In Python 2.6, bytes is str

2008-10-05 Thread Bryan Olson
0]'. I'm thinking I should just avoid using 'bytes' in Python 2.6. If there's another Python release between 2.6 and 3.gold, I'd advocate removing the pre-defined 'bytes', or maybe defining it as something else. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

fcgi.py on windows?

2008-10-16 Thread bryan rasmussen
As per the subject, anyone know of a version of fcgi.py out there somewhere that works on windows yet. Best Regards, Bryan Rasmussen -- http://mail.python.org/mailman/listinfo/python-list

<    2   3   4   5   6   7   8   >