Re: expression in an if statement

2010-08-18 Thread Frederic Rentsch
On Thu, 2010-08-19 at 00:12 +0200, Thomas Jollans wrote: > On Wednesday 18 August 2010, it occurred to John Nagle to exclaim: > > On 8/18/2010 11:24 AM, ernest wrote: > > > Hi, > > > > > > In this code: > > > > > > if set(a).union(b) == set(a): pass > > > > > > Does Python compute set(a) twice?

Simple hack to get $5000 to your Paypal account

2010-08-18 Thread Hot sex
Simple hack to get $5000 to your Paypal account At http://simplelivevideos.tk i have hidden the Paypal Form link in an image. in that website on Right Side below search box, click on image and enter your name and Paypal ID. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python "why" questions

2010-08-18 Thread Russ P.
On Aug 18, 7:58 pm, Steven D'Aprano wrote: > On Wed, 18 Aug 2010 14:47:08 -0700, Russ P. wrote: > > Is the top team in the league the number 1 team -- or the number 0 team? > > I have yet to hear anyone call the best team the number 0 team! > > Why is the top team the one with the lowest number?

Re: expression in an if statement

2010-08-18 Thread Daniel Kluev
On Thu, Aug 19, 2010 at 9:12 AM, Thomas Jollans wrote: > I doubt any actual Python implementation optimizes this -- how could it? > The > object "set" is clearly being called twice, and it happens to be called > with > the object "a" as a sole argument twice. What if "set" has side effects? A > c

Re: Simple Problem but tough for me if i want it in linear time

2010-08-18 Thread Tim Chase
On 08/18/10 21:47, Steven D'Aprano wrote: Frankly, I think the OP doesn't really know what he wants, other than premature optimization. It's amazing how popular that is :) You see, the trick to prematurely optimizing is to have a good algorithm for prematurely optimizing...the real question th

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread Elizabeth D Rather
On 8/18/10 2:23 PM, Standish P wrote: On Aug 17, 6:38 pm, John Passaniti wrote: You asked if Forth "borrowed" lists from Lisp. It did not. In Lisp, lists are constructed with pair of pointers called a "cons cell". That is the most primitive component that makes up a list. Forth has no such

Re: Python "why" questions

2010-08-18 Thread Steven D'Aprano
On Wed, 18 Aug 2010 14:47:08 -0700, Russ P. wrote: > Is the top team in the league the number 1 team -- or the number 0 team? > I have yet to hear anyone call the best team the number 0 team! Why is the top team the one with the lowest number? > Unfortunately, we're stuck with this goofy number

Re: Simple Problem but tough for me if i want it in linear time

2010-08-18 Thread Steven D'Aprano
On Wed, 18 Aug 2010 16:03:58 +0200, Frederic Rentsch wrote: > On Mon, 2010-08-16 at 23:17 +, Steven D'Aprano wrote: >> On Mon, 16 Aug 2010 20:40:52 +0200, Frederic Rentsch wrote: >> >> > How about >> > >> [obj for obj in dataList if obj.number == 100] >> > >> > That should create a lis

Re: Python "why" questions

2010-08-18 Thread Dan Sommers
On Wed, 18 Aug 2010 16:56:22 -0400, AK wrote: > Contrast this with _one_ example that was repeated in this thread of > there being ground floor, 1st floor, 2nd, and so on. However! Consider > that ground floor is kind of different from the other floors. It's the > floor that's not built up over gr

How to see intermediate fail results from unittest as tests are running?

2010-08-18 Thread Margie Roginski
Hi, I am using unittest in a fairly basic way, where I have a single file that simply defines a class that inherits from unittest.TestCase and then within that class I have a bunch of methods that start with "test". Within that file, at the bottom I have: if __name__ == "__main__": unittest.

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread Keith Thompson
Standish P writes: > On Aug 18, 12:30 pm, Elizabeth D Rather wrote: [...] >> Mostly it had a "snowball's chance" because it was never picked up by >> the CS gurus who, AFAIK, never really took a serious look at it. > > Its quite possible that the criticism is unfair, but dont you think > that in

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread Standish P
On Aug 17, 6:38 pm, John Passaniti wrote: > You asked if Forth "borrowed" lists from Lisp.  It did not.  In Lisp, > lists are constructed with pair of pointers called a "cons cell". > That is the most primitive component that makes up a list.  Forth has > no such thing; in Forth, the dictionary (

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread Standish P
On Aug 18, 12:30 pm, Elizabeth D Rather wrote: > On 8/18/10 12:09 AM, spinoza wrote: > > > On Aug 18, 1:21 am, Standish P  wrote: > >>> Garbage collection doesn't use a stack. It uses a "heap", which is in > >>> the abstract a collection of memory blocks of different lengths, > >>> divided int

Re: Unsupported Format Character '&' (0x26)

2010-08-18 Thread Andrew Evans
nvm I got it by adding s and d respectively after each value eg %(query)s thank you all On Wed, Aug 18, 2010 at 4:35 PM, Andrew Evans wrote: > I get an error message "Unsupported Format Character '&' (0x26)" I narrowed > it down to these two variables > > any idea how to fix it? > > SEARCH_UR

Re: expression in an if statement

2010-08-18 Thread Thomas Jollans
On Wednesday 18 August 2010, it occurred to John Nagle to exclaim: > On 8/18/2010 11:24 AM, ernest wrote: > > Hi, > > > > In this code: > > > > if set(a).union(b) == set(a): pass > > > > Does Python compute set(a) twice? > > CPython does. Shed Skin might optimize. Don't know > about Iron

Re: exception handling with sqlite db errors

2010-08-18 Thread CM
On Aug 12, 3:31 pm, a...@pythoncraft.com (Aahz) wrote: > In article > <2a47b306-45d1-474a-9f8e-5b71eba62...@p11g2000prf.googlegroups.com>, > > CM  wrote: > > >Maybe it's not much of an issue, but I think it would be a shame if > >occasional hangs/crashes could be caused by these (rare?) database >

Re: Python "why" questions

2010-08-18 Thread Mark Lawrence
On 18/08/2010 22:47, Russ P. wrote: On Aug 18, 2:01 pm, AK wrote: On 08/17/2010 10:15 PM, Russ P. wrote: On Aug 7, 5:54 am, "D'Arcy J.M. Cain"wrote: Would said beginner also be surprised that a newborn baby is zero years old or would it be more natural to call them a one year old? Z

Re: Python "why" questions

2010-08-18 Thread Russ P.
On Aug 18, 2:01 pm, AK wrote: > On 08/17/2010 10:15 PM, Russ P. wrote: > > > > > On Aug 7, 5:54 am, "D'Arcy J.M. Cain"  wrote: > > >> Would said beginner also be surprised that a newborn baby is zero years > >> old or would it be more natural to call them a one year old?  Zero > >> based counting

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread John Nagle
On 8/18/2010 1:32 PM, Paul Rubin wrote: Elizabeth D Rather writes: Processors seldom could multitask, so it wasn't recognized that the stack could be a performance bottleneck Lol. Forth supported multitasking on every processor it was implemented on in the 70's, with blazing speed compared to

Re: expression in an if statement

2010-08-18 Thread John Nagle
On 8/18/2010 11:24 AM, ernest wrote: Hi, In this code: if set(a).union(b) == set(a): pass Does Python compute set(a) twice? CPython does. Shed Skin might optimize. Don't know about Iron Python. John Nagle -- http://mail.python.org/mailman/listinf

Re: Python "why" questions

2010-08-18 Thread AK
On 08/17/2010 10:15 PM, Russ P. wrote: On Aug 7, 5:54 am, "D'Arcy J.M. Cain" wrote: Would said beginner also be surprised that a newborn baby is zero years old or would it be more natural to call them a one year old? Zero based counting is perfectly natural. You're confusing continuous and

Re: Python "why" questions

2010-08-18 Thread AK
On 08/17/2010 10:15 PM, Russ P. wrote: On Aug 7, 5:54 am, "D'Arcy J.M. Cain" wrote: Would said beginner also be surprised that a newborn baby is zero years old or would it be more natural to call them a one year old? Zero based counting is perfectly natural. You're confusing continuous and

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread Paul Rubin
Elizabeth D Rather writes: >> Processors seldom could multitask, so it wasn't recognized that the >> stack could be a performance bottleneck > Lol. Forth supported multitasking on every processor it was > implemented on in the 70's, with blazing speed compared to competitive > techniques. I have

q.join() is probably the wrong method for you

2010-08-18 Thread Raymond Hettinger
The join() method is all about waiting for all the tasks to be done. If you don't care whether the tasks have actually finished, you can periodically poll the unfinished task count: stop = time() + timeout while q.unfinished_tasks and time() < stop: sleep(1) This loop will exist either

Re: subprocess.Popen calling httpd reload never finishes

2010-08-18 Thread Nan
On Aug 18, 12:37 pm, Albert Hopkins wrote: > On Wed, 2010-08-18 at 06:58 -0700, Nan wrote: > > Ah, I'd been told that there would be no conflict, and that this was > > just reloading the configuration, not restarting Apache. > > > I do need the web app to instruct Apache to reload because just bef

Re: when 'myArray * 'myObject' is not equal to 'myObject' * 'myArray'

2010-08-18 Thread Nobody
On Wed, 18 Aug 2010 05:56:27 -0700, Duim wrote: > Although I'm sure somewhere this issue is discussed in this (great) > group, I didn't know the proper search words for it (although I > tried). > > I'm using python (2.6) scientifically mostly, and created a simple > class to store time series (my

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-18 Thread cbr...@cbrownsystems.com
On Aug 18, 11:50 am, John Posner wrote: > On 8/18/2010 1:38 PM, cbr...@cbrownsystems.com wrote: > > >>> To go the other way, if d = 1, then there exists integers (not > >>> neccessarily positive) such that > > >>> a*x + b*y + c*z = 1 > > That fact is non-trivial, although the proof isn't *too* har

Re: assigning variables from list data

2010-08-18 Thread Aahz
In article , Chris Hare wrote: > >cursor.execute('select * from net where NetNumber > 0') Unless your table is guaranteed to never change layout, I suggest that instead listing fields is a Good Idea: cursor.execute('select netNumber, netType, from net where NetNumber > 0') Then the tuple

Re: scipy / stats : quantiles using sample weights from survey data

2010-08-18 Thread Aahz
In article <94bb6313-1b09-4eeb-9969-07d76048a...@m35g2000prn.googlegroups.com>, Christopher Barrington-Leigh wrote: > >There is a function scipy.stats.mstats.mquantiles that returns >quantiles for a vector of data. >But my data should not be uniformly weighted in an estimate of the >distribution

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread Elizabeth D Rather
On 8/18/10 12:09 AM, spinoza wrote: On Aug 18, 1:21 am, Standish P wrote: Garbage collection doesn't use a stack. It uses a "heap", which is in the abstract a collection of memory blocks of different lengths, divided into two lists, generally represented as linked lists: 1. A list of bl

Re: Problem Creating NewLines in PDF

2010-08-18 Thread MRAB
Andrew Evans wrote: Hello ty for the fast replies This is the string I am using for the PDF I was able to create new lines using the HTML "br" tag which is what I wanted a method to create new lines search_str="Position: (%d) - Keyword: (%s) - Domain (%s) " % (idx+1, target_keyword, session

Re: Python 2.7 support for PyWin32

2010-08-18 Thread Terry Reedy
On 8/18/2010 8:33 AM, Mark Lawrence wrote: On 18/08/2010 12:54, paulo.jpi...@gmail.com wrote: Hi everyone, does anyone know when PyWin is going to support Python 2.7? I tried to look for information, but to no avail. Thanks in advance, Paulo It was created on 2009-07-08!!! See:- http://sou

Re: Problem Creating NewLines in PDF

2010-08-18 Thread Andrew Evans
Hello ty for the fast replies This is the string I am using for the PDF I was able to create new lines using the HTML "br" tag which is what I wanted a method to create new lines search_str="Position: (%d) - Keyword: (%s) - Domain (%s) " % (idx+1, target_keyword, session.target_domain)

Re: Problem Creating NewLines in PDF

2010-08-18 Thread MRAB
Andrew Evans wrote: Hello yes This line doesn't seem to want to accept a list for some strange reason story.append(Paragraph(str(result_list), para)) From the documentation it appears that you need to pass a string. You're just passing the result of str(result_list), which isn't giving you

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-18 Thread John Posner
On 8/18/2010 1:38 PM, cbr...@cbrownsystems.com wrote: To go the other way, if d = 1, then there exists integers (not neccessarily positive) such that a*x + b*y + c*z = 1 That fact is non-trivial, although the proof isn't *too* hard [1]. I found it interesting to demonstrate the simpler cas

Re: Using re.sub with %s

2010-08-18 Thread MRAB
Thomas Jollans wrote: On Wednesday 18 August 2010, it occurred to Brandon Harris to exclaim: Having trouble using %s with re.sub test = '/my/word/whats/wrong' re.sub('(/)word(/)', r'\1\%s\2'%'1000', test) return is /my/@0/whats/wrong This has nothing to do with %, of course: re.sub('(/)wo

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread Alex McDonald
On 18 Aug, 11:09, spinoza wrote: > On Aug 18, 1:21 am, Standish P wrote: > > > This you might want to take this to the Forth people because they are > > marketing their language as a cure for all that plagues programming > > today. > > No, they're not. That I agree with. > Stack based lang

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-18 Thread cbr...@cbrownsystems.com
On Aug 18, 10:52 am, Baba wrote: > Hi Chas > > Thanks for that and i agree on your last remark :) > > re the number of required consecutive passes required: > > The number of required consecutive passes is equal to the smallest > number because after that you can get any amount of nuggets by just

Re: expression in an if statement

2010-08-18 Thread Peter Otten
ernest wrote: > In this code: > > if set(a).union(b) == set(a): pass > > Does Python compute set(a) twice? >>> a = "abc" >>> b = "def" >>> _set = set >>> def set(x): ... print "computing set(%r)" % x ... return _set(x) ... >>> if set(a).union(b) == set(a): pass ... computing set('abc')

expression in an if statement

2010-08-18 Thread ernest
Hi, In this code: if set(a).union(b) == set(a): pass Does Python compute set(a) twice? Thanks in advance. Ernest -- http://mail.python.org/mailman/listinfo/python-list

Re: Using re.sub with %s

2010-08-18 Thread Thomas Jollans
On Wednesday 18 August 2010, it occurred to Brandon Harris to exclaim: > Having trouble using %s with re.sub > > test = '/my/word/whats/wrong' > re.sub('(/)word(/)', r'\1\%s\2'%'1000', test) > > return is /my/@0/whats/wrong > This has nothing to do with %, of course: >>> re.sub('(/)word(/)', r

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-18 Thread Baba
Hi Chas Thanks for that and i agree on your last remark :) re the number of required consecutive passes required: The number of required consecutive passes is equal to the smallest number because after that you can get any amount of nuggets by just adding the smallest nugget pack to some other n

Re: Problem Creating NewLines in PDF

2010-08-18 Thread Andrew Evans
Hello yes This line doesn't seem to want to accept a list for some strange reason story.append(Paragraph(str(result_list), para)) *cheers -- http://mail.python.org/mailman/listinfo/python-list

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-18 Thread cbr...@cbrownsystems.com
On Aug 17, 2:44 pm, Baba wrote: > On Aug 16, 6:28 pm, "cbr...@cbrownsystems.com" > > wrote: > > First, suppose d = gcd(x, y, z); then for some x', y', z' we have that > > x = d*x', y = d*y', z = d*z'; and so for any a, b, c: > >    could you explain the notation? > >    what is the difference btw

Re: 79 chars or more?

2010-08-18 Thread Neil Cerutti
On 2010-08-18, D'Arcy J.M. Cain wrote: > The other thing that jumps out at me is having the input format > different than the output format. In any case you need a > better date input function. There's no reason in this day and > age to force users into a particular input form. You should > thi

Using re.sub with %s

2010-08-18 Thread Brandon Harris
Having trouble using %s with re.sub test = '/my/word/whats/wrong' re.sub('(/)word(/)', r'\1\%s\2'%'1000', test) return is /my/@0/whats/wrong however if I cast a value with letters as opposed to numbers re.sub('(/)word(/)', r'\1\%s\2'%'gosh', test) return is /my/gosh/whats/wrong Any help wou

Re: Problem Creating NewLines in PDF

2010-08-18 Thread MRAB
Andrew Evans wrote: Hello I am generating a PDF in web2py but its ignoring my line breaks. randname = random.randrange(1, 10001) styles = getSampleStyleSheet() title = "My Title" doc = SimpleDocTemplate("primer.pdf") story = [] story.append(Paragraph(strf

Problem Creating NewLines in PDF

2010-08-18 Thread Andrew Evans
Hello I am generating a PDF in web2py but its ignoring my line breaks. randname = random.randrange(1, 10001) styles = getSampleStyleSheet() title = "My Title" doc = SimpleDocTemplate("primer.pdf") story = [] story.append(Paragraph(strftime("%a, %d %b %Y %H:

Re: subprocess.Popen calling httpd reload never finishes

2010-08-18 Thread Albert Hopkins
On Wed, 2010-08-18 at 06:58 -0700, Nan wrote: > Ah, I'd been told that there would be no conflict, and that this was > just reloading the configuration, not restarting Apache. > > I do need the web app to instruct Apache to reload because just before > this it's creating new VirtualHosts that need

Re: Python 2.7 support for PyWin32

2010-08-18 Thread paulo.jpi...@gmail.com
Thanks for the heads up. My error was to only look for the green download button. There you still get 2.6 as default download. -- Paulo On Aug 18, 4:28 pm, Tim Golden wrote: > On 18/08/2010 12:54, paulo.jpi...@gmail.com wrote: > > > Hi everyone, > > > does anyone know when PyWin is going to sup

Required Buy Palm Jumeirah aprt AND Springs villa, 050-8320722

2010-08-18 Thread PETER WONG F H (+971 50 8320722)
Dear I have a client who is looking to buy apartment and Villa : 1. the palm jumeirah 3 bed + maid room sea view only (any building) 2. springs type 3E 3. springs type 3M 4. springs type 4E Please send me your direct availabilities, or call me, viewing tomorrow, thank you! P

Re: 79 chars or more?

2010-08-18 Thread D'Arcy J.M. Cain
On Wed, 18 Aug 2010 10:57:00 +0200 Jean-Michel Pichavant wrote: > D'Arcy J.M. Cain wrote: > > You can extend this if there are complicated sub-calls. Probably > > overkill for this example but here is the idea. > > > >self.expiration_date = translate_date( > > find( > >

Re: 79 chars or more?

2010-08-18 Thread D'Arcy J.M. Cain
On Wed, 18 Aug 2010 23:18:06 +1200 Lawrence D'Oliveiro wrote: > Might I suggest (guessing at the argument keywords here) : > > self.expiration_date = translate_date \ > ( > TheText = find(response, 'MPNExpirationDate').text, > ToFormat ='%Y-%m-%d', > FromFormat =

Re: Python 2.7 support for PyWin32

2010-08-18 Thread Tim Golden
On 18/08/2010 12:54, paulo.jpi...@gmail.com wrote: Hi everyone, does anyone know when PyWin is going to support Python 2.7? I tried to look for information, but to no avail. Thanks in advance, Paulo It already does and has done for a while: http://sourceforge.net/projects/pywin32/files/

Re: Simple Problem but tough for me if i want it in linear time

2010-08-18 Thread Frederic Rentsch
On Mon, 2010-08-16 at 23:17 +, Steven D'Aprano wrote: > On Mon, 16 Aug 2010 20:40:52 +0200, Frederic Rentsch wrote: > > > How about > > > [obj for obj in dataList if obj.number == 100] > > > > That should create a list of all objects whose .number is 100. No need > > to cycle through a

Re: 79 chars or more?

2010-08-18 Thread AK
On 08/18/2010 05:11 AM, Stefan Schwarzer wrote: Hi Lie, On 2010-08-18 12:02, Lie Ryan wrote: On 08/17/10 12:59, AK wrote: On 08/16/2010 10:42 PM, James Mills wrote: My personal opinion (despite monitors being wider) is the horizontal scrolling isn't worth it. Stick to a 80-char width. But..

Re: subprocess.Popen calling httpd reload never finishes

2010-08-18 Thread Nan
On Aug 17, 8:14 pm, Albert Hopkins wrote: > On Tue, 2010-08-17 at 12:55 -0700, Nan wrote: > > Hi folks -- > > > I have a Python script running under Apache/mod_wsgi that needs to > > reload Apache configs as part of its operation.  The script continues > > to execute after the subprocess.Popen cal

Re: 79 chars or more?

2010-08-18 Thread BartC
"Roy Smith" wrote in message news:roy-181632.07571818082...@news.panix.com... In article , "BartC" wrote: >> Remember, the old hardcopy terminals used to produce >> 132-character-wide >> listings. > > Those of you who think "old hardcopy terminals" did 132 wide obviously > don't remember

error Compile libxml2 from python 2.6.4

2010-08-18 Thread Mauricio Martinez Garcia
Hi!. Have the next error on install libxml2. python/bin/python setup.py install failed to find headers for libxml2: update includes_dir This my version of python ==> /bscs/bscs/prod/523/WORK/MP/NORTEL/IN/MEXICO/CDRS/ATS/MONITOREO/reportes_Milton/python/bin/python Python 2.6.5 (r265:79063, J

when 'myArray * 'myObject' is not equal to 'myObject' * 'myArray'

2010-08-18 Thread Duim
Although I'm sure somewhere this issue is discussed in this (great) group, I didn't know the proper search words for it (although I tried). I'm using python (2.6) scientifically mostly, and created a simple class to store time series (my 'Signal' class). I need this class to have a possibility to

Re: Python 2.7 support for PyWin32

2010-08-18 Thread Mark Lawrence
On 18/08/2010 12:54, paulo.jpi...@gmail.com wrote: Hi everyone, does anyone know when PyWin is going to support Python 2.7? I tried to look for information, but to no avail. Thanks in advance, Paulo It was created on 2009-07-08!!! See:- http://sourceforge.net/projects/pywin32/files/pywin32/

Re: 79 chars or more?

2010-08-18 Thread Roy Smith
In article <4c6b9...@dnews.tpgi.com.au>, Lie Ryan wrote: > On 08/17/10 12:59, AK wrote: > > On 08/16/2010 10:42 PM, James Mills wrote: > >> On Tue, Aug 17, 2010 at 12:35 PM, AK wrote: > >>> As monitors are getting bigger, is there a general change in opinion on > >>> the 79 chars limit in sourc

Re: 79 chars or more?

2010-08-18 Thread Roy Smith
In article , "BartC" wrote: > >> Remember, the old hardcopy terminals used to produce 132-character-wide > >> listings. > > > > Those of you who think "old hardcopy terminals" did 132 wide obviously > > don't remember the ASR-33 :-) > > ASR33s I think might have been 72 columns wide (and punche

Python 2.7 support for PyWin32

2010-08-18 Thread paulo.jpi...@gmail.com
Hi everyone, does anyone know when PyWin is going to support Python 2.7? I tried to look for information, but to no avail. Thanks in advance, Paulo -- http://mail.python.org/mailman/listinfo/python-list

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-18 Thread News123
On 08/17/2010 11:44 PM, Baba wrote: > On Aug 16, 6:28 pm, "cbr...@cbrownsystems.com" > wrote: > >> First, suppose d = gcd(x, y, z); then for some x', y', z' we have that >> x = d*x', y = d*y', z = d*z'; and so for any a, b, c: >> > > >could you explain the notation? > >what is the diff

Re: 79 chars or more?

2010-08-18 Thread Lawrence D'Oliveiro
In message <4c6a9c72.4040...@sschwarzer.net>, Stefan Schwarzer wrote: > self.expiration_date = translate_date( > find(response, 'MPNExpirationDate').text, > '%Y-%m-%d', > '%m%d%Y') Might I suggest (guessing at the argument keywords here) : self.e

Re: String substitution VS proper mysql escaping

2010-08-18 Thread Tim Chase
On 08/18/10 04:50, Cameron Simpson wrote: ("nikos",) is a single element tuple. ["nikos"] is a single element list. ["nikos",] is also a single element list, just written like the tuple. You don't see the ["nikos",] form very often because ["nikos"] is not ambiguous. I most frequently see/use

Re: 79 chars or more?

2010-08-18 Thread BartC
"Roy Smith" wrote in message news:roy-319e47.09055017082...@news.panix.com... In article , Lawrence D'Oliveiro wrote: In message , AK wrote: > As monitors are getting bigger, is there a general change in opinion on > the 79 chars limit in source files? WHAT 79-character limit in source

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread spinoza1111
On Aug 18, 1:21 am, Standish P wrote: > > Garbage collection doesn't use a stack. It uses a "heap", which is in > > the abstract a collection of memory blocks of different lengths, > > divided into two lists, generally represented as linked lists: > > > 1.  A list of blocks that are free and may b

Re: String substitution VS proper mysql escaping

2010-08-18 Thread Cameron Simpson
On 18Aug2010 12:07, Nik Gr wrote: | Στις 18/8/2010 7:31 πμ, ο/η Cameron Simpson έγραψε: | >On 17Aug2010 20:15, Νίκος wrote: | >| === | >| cursor.execute( ''' SELECT host, hits, date FROM visitors WHERE page = | >| '%s' ORDER BY date DESC ''' % (page) ) | >| ==

Re: Working with PDFs?

2010-08-18 Thread Anssi Saari
writes: > - Pull out text from each PDF page (to search for specific words) > - Combine separate pdf documents into one document > - Add bookmarks (with destination settings) PDF Shuffler is a Python app which does PDF merging and splitting very well. I don't think it does anything else, though,

Re: 79 chars or more?

2010-08-18 Thread Stefan Schwarzer
Hi Lie, On 2010-08-18 12:02, Lie Ryan wrote: > On 08/17/10 12:59, AK wrote: >> On 08/16/2010 10:42 PM, James Mills wrote: >>> My personal opinion (despite monitors being wider) is >>> the horizontal scrolling isn't worth it. Stick to a 80-char width. >> >> But.. why horizontal scrolling, isn't aut

Re: String substitution VS proper mysql escaping

2010-08-18 Thread Nik Gr
Στις 18/8/2010 7:31 πμ, ο/η Cameron Simpson έγραψε: On 17Aug2010 20:15, Νίκος wrote: | === | cursor.execute( ''' SELECT host, hits, date FROM visitors WHERE page = | '%s' ORDER BY date DESC ''' % (page) ) | === | | Someone told me NOT to d

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread Nick Keighley
On 17 Aug, 21:37, Elizabeth D Rather wrote: > On 8/17/10 10:19 AM, Standish P wrote > > On Aug 17, 12:32 pm, John Passaniti  wrote: > >>> It is true that the other languages such as F/PS also have borrowed > >>> lists from lisp in the name of nested-dictionaries and mathematica > >>> calls them n

Re: 79 chars or more?

2010-08-18 Thread Jean-Michel Pichavant
D'Arcy J.M. Cain wrote: On Tue, 17 Aug 2010 16:28:02 +0200 Stefan Schwarzer wrote: I'd probably reformat this to self.expiration_date = translate_date( find(response, 'MPNExpirationDate').text, '%Y-%m-%d', '%m%d%Y') or even self.expiration_date

Re: Python Developer - HFT Trading firm - Chicago, IL

2010-08-18 Thread Matteo Landi
Hi Rich, I think it's better for you to post the message here ( http://www.python.org/community/jobs/ ). Regards, On Tue, Aug 17, 2010 at 6:07 PM, Rich Moss wrote: > > Python developer needed for math/trading applications and research at > leading HFT firm. The person we are searching for will h

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread Nick Keighley
On 17 Aug, 18:34, Standish P wrote: > On Aug 16, 11:09 am, Elizabeth D Rather wrote: > > On 8/15/10 10:33 PM, Standish P wrote: > > > >>> If Forth is a general processing language based on stack, is it > > >>> possible to convert any and all algorithms to stack based ones and > > >>> thus avoid m

Re: 79 chars or more?

2010-08-18 Thread Lawrence D'Oliveiro
In message , Martin Gregorie wrote: > 1) ssh terminal windows generally come up as 24 x 80 My terminal windows come up by default at something like 40 lines by 100 characters. > 2) at 24 x 80 I can get more ssh terminal windows on the desktop with >minimal overlap than I can do with longer/

Re: 79 chars or more?

2010-08-18 Thread Lie Ryan
On 08/17/10 12:59, AK wrote: > On 08/16/2010 10:42 PM, James Mills wrote: >> On Tue, Aug 17, 2010 at 12:35 PM, AK wrote: >>> As monitors are getting bigger, is there a general change in opinion on >>> the 79 chars limit in source files? I've experimented with 98 characters >>> per line and I find

use of gtk in a nautilus extension

2010-08-18 Thread Nils
Hi, I am having some trouble opening a simple message/dialog to the user from a natilus extension.. I have written a simple nautilus extension using python. It adds one MenuItem to the context menu. for testing I wanted to open a simple dialog when the user clicks this menuitem. (The code can be f

Re: Call Java Code from python

2010-08-18 Thread Stefan Schwarzer
Hi Bidda, On 2010-08-18 09:19, Bidda Gowda wrote: > I have a project coming up where i have to integrate our existing > Python based web application with Java Programs. Basically i should be > able to call Java programs which comes in the form of jars. Whats the > best way to call these jars from

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-18 Thread John Nagle
On 8/17/2010 11:20 AM, Standish P wrote: On Aug 17, 1:17 am, torb...@diku.dk (Torben Ægidius Mogensen) wrote: Standish P writes: [Q] How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ? Because a stack has push and pop, it is able to release and allocate

Call Java Code from python

2010-08-18 Thread Bidda Gowda
Hi, I have a project coming up where i have to integrate our existing Python based web application with Java Programs. Basically i should be able to call Java programs which comes in the form of jars. Whats the best way to call these jars from python ? I looked at jpype and tried with small progra