Re: Financial time series data

2010-09-03 Thread Trent Nelson
On 03-Sep-10 1:48 PM, Frederic Rentsch wrote: And do let us know if you get an answer from Yahoo. Hacks like this are unreliable. They fail almost certainly the next time a page gets redesigned, which can be any time. Indeed -- see my other post (regarding ystockquote.py). There's a CSV

Re: Financial time series data

2010-09-03 Thread Trent Nelson
On 03-Sep-10 7:29 AM, Virgil Stokes wrote: A more direct question on accessing stock information from Yahoo. First, use your browser to go to: http://finance.yahoo.com/q/cp?s=%5EGSPC+Components Now, you see the first 50 rows of a 500 row table of information on S&P 500 index. You can LM click

Re: IDLE / Black frame on Mac

2010-09-03 Thread Ned Deily
In article , Kristoffer Follesdal wrote: > *Forgot to tell that I am using a Mac with Snow Leopard. Which version of Python 3.1.2? From the python.org installer? MacPorts? Built from source - if so, which version of Tk? -- Ned Deily, n...@acm.org -- http://mail.python.org/mailman/lis

Re: Queue cleanup

2010-09-03 Thread Paul Rubin
Lawrence D'Oliveiro writes: >> GC's for large systems generally don't free (or even examine) individual >> garbage objects. They copy the live objects to a new contiguous heap >> without ever touching the garbage, and then they release the old heap. > > And suddenly you’ve doubled the memory requ

Re: Queue cleanup

2010-09-03 Thread MRAB
On 04/09/2010 03:21, Paul Rubin wrote: Lawrence D'Oliveiro writes: Java has considerably greater reputation for reliability than C or C++. Wonder why Sun’s licence explicitly forbade its use in danger-critical areas like nuclear power plants and the like, then? Probably because Sun lawyers

Google Adsense Earnings, google adsense tips

2010-09-03 Thread chinnamma
Recently I found I had a a small amount of websites I had basically abandoned, Mostly as the products had befall with a reduction of desirable and were Veto longer worth the effort of promoting. I unfaltering more exactly than Accede to the sites simply sit in attendance price me hosting money - I

Google Adsense Earnings, google adsense tips

2010-09-03 Thread chinnamma
I'm pretty certain with the purpose of we all can promote to this allegation - "I know quite a luck approaching AdSense". This of track will be authentic in a convinced context. For illustration what time you are conversation to an recluse, someone who doesn't apply AdSense to his or her website, s

Google Adsense Earnings, google adsense tips

2010-09-03 Thread chinnamma
It's an untoward information with the purpose of many AdSense users are getting their accounts terminated by the time they've complete nothing unsuitable. Considering the money individual can promote to from operational AdSense employment, the loss of one's bank account can be a real blow. Especial

Google Adsense Earnings, google adsense tips

2010-09-03 Thread chinnamma
If you control a website and wish to promote it for money at home, therefore the Google AdSense syllabus is inescapable merely in support of you. It has befall a bonus in support of a luck of sites whether they are small or sizeable or form. Taking part in information, this has befall such a all th

Re: Queue cleanup

2010-09-03 Thread Paul Rubin
Lawrence D'Oliveiro writes: >> Java has considerably greater reputation for reliability than C or C++. > > Wonder why Sun’s licence explicitly forbade its use in danger-critical > areas like nuclear power plants and the like, then? Probably because Sun lawyers demanded it. Is there a Sun C or C+

Re: Queue cleanup

2010-09-03 Thread Lawrence D'Oliveiro
In message <7xr5heufhb@ruckus.brouhaha.com>, Paul Rubin wrote: > Java has considerably greater reputation for reliability than C or C++. Wonder why Sun’s licence explicitly forbade its use in danger-critical areas like nuclear power plants and the like, then? > Ada is a different story, but

Re: Queue cleanup

2010-09-03 Thread Lawrence D'Oliveiro
In message <7xmxs2uez1@ruckus.brouhaha.com>, Paul Rubin wrote: > Lawrence D'Oliveiro writes: > >> Whereas garbage collection will happen at some indeterminate time long >> after the last access to the object, when it very likely will no longer >> be in the cache, and have to be brought back i

Re: Queue cleanup

2010-09-03 Thread Lawrence D'Oliveiro
In message <7xiq2que93@ruckus.brouhaha.com>, Paul Rubin wrote: > Lawrence D'Oliveiro writes: >> >>> Refcounting is susceptable to the same pauses for reasons already >>> discussed. >> >> Doesn’t seem to happen in the real world, though. > > def f(n): > from time import time >

Re: Queue cleanup

2010-09-03 Thread Lawrence D'Oliveiro
In message <7xvd6sv0n4@ruckus.brouhaha.com>, Paul Rubin wrote: > Lawrence D'Oliveiro writes: >>> AddrObj = PyTuple_GetItem(TheBufferInfo, 0); >>> LenObj = PyTuple_GetItem(TheBufferInfo, 1); >>> >>> the first PyTuple_GetItem succeeds and the second one fails. >> >> Admittedl

Re: New to python - parse data into Google Charts

2010-09-03 Thread alistair
On Sep 3, 12:51 pm, Mike Kent wrote: > On Sep 3, 1:52 pm, alistair wrote: > > > I'm new to python and my programming years are a ways behind me, so I > > was looking for some help in parsing a file into a chart using the > > Google Charts API. > > Try this:http://pygooglechart.slowchop.com/ Than

Re: Date Parsing Question

2010-09-03 Thread David Bolen
Gavin writes: > python-dateutil seems to work very well if everything is in English, > however, it does not seem to work for other languages and the > documentation does not seem to have any information about locale > support. Probably because I don't think there is much built in. You'll want t

Re: IDLE / Black frame on Mac

2010-09-03 Thread Kristoffer Føllesdal
*Forgot to tell that I am using a Mac with Snow Leopard. -- http://mail.python.org/mailman/listinfo/python-list

Re: Does MySQLdb rollback on control-C? Maybe not.

2010-09-03 Thread John Nagle
On 9/3/2010 12:41 PM, Mike Kent wrote: On Sep 3, 12:22 am, John Nagle wrote: I would expect MySQLdb to rollback on a control-C, but it doesn't seem to have done so. Something is broken. I wouldn't expect it to, I'd expect to roll back on an exception, or commit if not. MySQL does

Re: Help needed with Windows Service in Python

2010-09-03 Thread Ian
On 02/09/2010 20:55, Edward Kozlowski wrote: On Sep 2, 2:38 pm, Ian wrote: On 02/09/2010 20:06, Edward Kozlowski wrote: On Sep 2, 10:22 am, Ian Hobsonwrote: Hi All, I am attempting to create a Windows Service in Python. I have the framework (from Mark Hammond and Andy Robinason's b

Date Parsing Question

2010-09-03 Thread Gavin
Hi, I'm using the python-dateutil package : http://labix.org/python-dateutil to parse a set of randomly formatted strings into dates. Because the formats are varied, I can't use time.strptime() because I don't know what the format is upfront. python-dateutil seems to work very well if everythin

Re: Help needed with Windows Service in Python

2010-09-03 Thread Ian
On 03/09/2010 01:38, Mark Hammond wrote: I expect that the Windows Event Log might have some clues, as would attempting to use it in "debug" mode. Thanks Mark. The error log holds the trackback - it identified the line with the typo. Now the typo is fixed, the service starts and stops proper

Re: Speed-up for loops

2010-09-03 Thread Stefan Behnel
BartC, 03.09.2010 22:17: for i in range(N): which (if I understood correctly) actually created a list of N objects, populated it with the values 0, 1, 2...N-1 (presumably using a more sensible loop), then iterated between the values of the list! I guess what applies here is "special cases aren

Re: Speed-up for loops

2010-09-03 Thread BartC
"Michael Kreim" wrote in message news:mailman.362.1283422325.29448.python-l...@python.org... I was comparing the speed of a simple loop program between Matlab and Python. My Codes: $ cat addition.py imax = 10 a = 0 for i in xrange(imax): a = a + 10 print a Unfortunately my Pyt

Re: what should __iter__ return?

2010-09-03 Thread MRAB
On 03/09/2010 20:35, ernest wrote: Hi, What is better: def __iter__(self): for i in len(self): yield self[i] or def __iter__(self): return iter([self[i] for i in range(len(self))]) The first one, I would say is more correct, however what if in a middle of an iteration the

Re: what should __iter__ return?

2010-09-03 Thread Thomas Jollans
On Friday 03 September 2010, it occurred to ernest to exclaim: > Hi, > > What is better: > > def __iter__(self): > for i in len(self): > yield self[i] > > or > > def __iter__(self): > return iter([self[i] for i in range(len(self))]) > > The first one, I would say is more correc

Re: Speed-up for loops

2010-09-03 Thread Nobody
On Fri, 03 Sep 2010 11:21:36 +0200, Michael Kreim wrote: > An anonymous Nobody suggested to use Numpy. I did not do this, because I > am very very new to Numpy and I did not figure out a Numpy specific way > to do this. Maybe a Numpy expert has something for me? The problem with giving examples

Re: New to python - parse data into Google Charts

2010-09-03 Thread Mike Kent
On Sep 3, 1:52 pm, alistair wrote: > I'm new to python and my programming years are a ways behind me, so I > was looking for some help in parsing a file into a chart using the > Google Charts API. > Try this: http://pygooglechart.slowchop.com/ -- http://mail.python.org/mailman/listinfo/python-li

Re: MySQL Problem

2010-09-03 Thread Ian
On 03/09/2010 14:29, Victor Subervi wrote: This is an addendum to my last post. Please observe the following: mysql> select * from spreadsheets where Temp=1; +-++---+-++--+ | ID | Client | Multi | Item| Markup | Temp | +-+

Re: Does MySQLdb rollback on control-C? Maybe not.

2010-09-03 Thread Mike Kent
On Sep 3, 12:22 am, John Nagle wrote: >     I would expect MySQLdb to rollback on a control-C, but it doesn't > seem to have done so.   > Something is broken. I wouldn't expect it to, I'd expect to roll back on an exception, or commit if not. Perhaps this will help you. I use it in production

what should __iter__ return?

2010-09-03 Thread ernest
Hi, What is better: def __iter__(self): for i in len(self): yield self[i] or def __iter__(self): return iter([self[i] for i in range(len(self))]) The first one, I would say is more correct, however what if in a middle of an iteration the object changes in length? Then, the iter

Re: bisection method: Simulating a retirement fund

2010-09-03 Thread Carl Banks
On Sep 2, 1:37 pm, Baba wrote: > level: beginner In this economy, simulating the value of retirement funds with bisection is easy. Look: def retirement_fund_value(n_years,initial_value): for i in xrange(n_years): value /= 2 # <- bisect value of fund return value Carl Banks --

Re: Performance: sets vs dicts.

2010-09-03 Thread Robert Kern
On 9/3/10 12:08 PM, John Bokma wrote: Terry Reedy writes: On 9/1/2010 8:11 PM, John Bokma wrote: [...] Right. And if 'small values of n' include all possible values, then rejecting a particular O(log n) algorithm as 'unacceptable' relative to all O(1) algorithms is pretty absurd. I have

New to python - parse data into Google Charts

2010-09-03 Thread alistair
I'm new to python and my programming years are a ways behind me, so I was looking for some help in parsing a file into a chart using the Google Charts API. The file is simply a text file containing: Date, Total Accesses, Unique Accesses. I'd like date across the bottom, access numbers on the vert

Re: Financial time series data

2010-09-03 Thread Frederic Rentsch
On Fri, 2010-09-03 at 16:48 +0200, Virgil Stokes wrote: > On 03-Sep-2010 15:45, Frederic Rentsch wrote: > > On Fri, 2010-09-03 at 13:29 +0200, Virgil Stokes wrote: > >> A more direct question on accessing stock information from Yahoo. > >> > >> First, use your browser to go to: http://finance.yaho

Re: bisection method: Simulating a retirement fund

2010-09-03 Thread MRAB
On 03/09/2010 09:06, Baba wrote: On Sep 2, 11:10 pm, MRAB wrote: Why are you saving 'fund' in SavingsRecord if you're returning just the last and discarding others? Basically you're returning the final value of fund. Hi MRAB ok i agree that this is not be ideal. I should shorten this to ONL

Re: Performance: sets vs dicts.

2010-09-03 Thread John Bokma
Terry Reedy writes: > On 9/1/2010 8:11 PM, John Bokma wrote: [...] > Right. And if 'small values of n' include all possible values, then > rejecting a particular O(log n) algorithm as 'unacceptable' relative > to all O(1) algorithms is pretty absurd. I have little time, but want to reply to th

Re: Performance: sets vs dicts.

2010-09-03 Thread ru...@yahoo.com
On 09/02/2010 02:47 PM, Terry Reedy wrote: > On 9/1/2010 10:57 PM, ru...@yahoo.com wrote: > >> So while you may "think" most people rarely read >> the docs for basic language features and objects >> (I presume you don't mean to restrict your statement >> to only sets), I and most people I know *do*

pyqt signals

2010-09-03 Thread luca72
Hello i have write this but i not able to connect the emit of the class Socket to the Form class, can you help me? class Socket(QtNetwork.QTcpSocket): def __init__(self, parent=None): super(Socket, self).__init__(parent) self.connect(self, QtCore.SIGNAL("readyRead()"), self.leg

Re: Where do I report a bug to the pythonware PIL

2010-09-03 Thread Robert Kern
On 9/3/10 4:35 AM, jc.lopes wrote: Does anyone knows what is the proper way to submit a bug report to pythonware PIL? http://mail.python.org/mailman/listinfo/image-sig -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own

Re: Where do I report a bug to the pythonware PIL

2010-09-03 Thread Alex Willmer
On Sep 3, 10:35 am, "jc.lopes" wrote: > Does anyone knows what is the proper way to submit a bug report to > pythonware PIL? > > thanks > JC Lopes The Python Image SIG list http://mail.python.org/mailman/listinfo/image-sig "Free Support: If you don't have a support contract, please send your que

IDLE / Black frame on Mac

2010-09-03 Thread Kristoffer Føllesdal
Hi I am new to python and have installed python 3.1.2. I have began using IDLE and like it very good. But when an IDLE window is active. There is a thick black frame around the white text field. Is there some way I can get rid of this frame? The frame is very distracting when I write. Kristoffer

Re: Financial time series data

2010-09-03 Thread Frederic Rentsch
On Fri, 2010-09-03 at 13:29 +0200, Virgil Stokes wrote: > A more direct question on accessing stock information from Yahoo. > > First, use your browser to go to: http://finance.yahoo.com/q/cp?s=% > 5EGSPC+Components > > Now, you see the first 50 rows of a 500 row table of information on > S&P 50

Re: MySQL Problem

2010-09-03 Thread Victor Subervi
On Fri, Sep 3, 2010 at 9:25 AM, Richard Arts wrote: > These are also mere suggestions. > > The statements you use in your print statement and the one you use to > feed the cursor differ slightly. The latter is missing quotes around > your search criterium. > > Isn't it possible to fetch results r

Re: MySQL Problem

2010-09-03 Thread Victor Subervi
This is an addendum to my last post. Please observe the following: mysql> select * from spreadsheets where Temp=1; +-++---+-++--+ | ID | Client | Multi | Item| Markup | Temp | +-++---+-++--

Re: Speed-up for loops

2010-09-03 Thread Tim Wintle
On Fri, 2010-09-03 at 08:52 +0200, Ulrich Eckhardt wrote: > Tim Wintle wrote: > > [..] under the hood, cpython does something like this (in psudo-code) > > > > itterator = xrange(imax) > > while 1: > > next_attribute = itterator.next > > try: > > i = next_attribute() > > except: > >

Re: MySQL Problem

2010-09-03 Thread Richard Arts
These are also mere suggestions. The statements you use in your print statement and the one you use to feed the cursor differ slightly. The latter is missing quotes around your search criterium. Isn't it possible to fetch results row by row and see if the missing row is in the set? That way you c

Re: python database

2010-09-03 Thread Mike Kent
On Sep 3, 2:36 am, shai garcia wrote: > can you pls help me to make a database program in python? It's better if you do your homework yourself. You learn more that way. Now, if you have a specific question about some detail of your assignment, and can show us that you've really tried to do the

Re: Financial time series data

2010-09-03 Thread Nanjundi
On Sep 2, 1:12 pm, Virgil Stokes wrote: >   Has anyone written code or worked with Python software for downloading > financial time series data (e.g. from Yahoo financial)? If yes,  would you > please contact me. > > --Thanks, > V. Stokes matplotlib has a finance module you can refer to. (matplot

Re: MySQL Problem

2010-09-03 Thread Victor Subervi
On Thu, Sep 2, 2010 at 3:02 PM, Ian wrote: > On 02/09/2010 19:34, Victor Subervi wrote: > >> for some reason running the command through python *omits* this one data!! >> The only difference is that a flag in spreadsheets (Temp) is set to 1. Why >> on earth doesn't it work in python?? >> > Some

Re: Speed-up for loops

2010-09-03 Thread Hrvoje Niksic
Ulrich Eckhardt writes: > Tim Wintle wrote: >> [..] under the hood, cpython does something like this (in psudo-code) >> >> itterator = xrange(imax) >> while 1: >> next_attribute = itterator.next >> try: >> i = next_attribute() >> except: >> break >> a = a + 10 > > There is one th

Re: Financial time series data

2010-09-03 Thread Virgil Stokes
A more direct question on accessing stock information from Yahoo. First, use your browser to go to: http://finance.yahoo.com/q/cp?s=%5EGSPC+Components Now, you see the first 50 rows of a 500 row table of information on S&P 500 index. You can LM click on 1 -50 of 500 |First|Previous|Next

Re: Speed-up for loops

2010-09-03 Thread python
Michael, Thanks for summarizing and sharing your results. Very interesting. Regards, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Python for embedded systems development

2010-09-03 Thread VGNU Linux
Hi, Is there anyone using python for embedded systems development ? I have no idea where to start with. Google was of little help. Will appreciate if someone could guide me on "from where to start". Regards Vgnu -- http://mail.python.org/mailman/listinfo/python-list

Where do I report a bug to the pythonware PIL

2010-09-03 Thread jc.lopes
Does anyone knows what is the proper way to submit a bug report to pythonware PIL? thanks JC Lopes -- http://mail.python.org/mailman/listinfo/python-list

Re: Speed-up for loops

2010-09-03 Thread Stefan Behnel
Michael Kreim, 03.09.2010 11:21: So finally I followed the recommendation of Tim Wintle to use cython. I did not know this before, but I figured out the following: additionWintle2.pyx: > def addition(): cdef long imax = 10 cdef long a = 0 cdef long i for i in xrange(imax

Re: Speed-up for loops

2010-09-03 Thread Michael Kreim
Hi, thanks a lot for your answers. I learn a lot and I like to sum up your suggestions and show you the results of the time command on my machine: Original code by me: imax = 10 a = 0 for i in xrange(imax): a = a + 10 print a => runs (wall clock time): 1:55.14 Peter Otten suggeste

Re: PyPy and RPython

2010-09-03 Thread sarvi
Well then, wouldn't it make sense for PyPy to use Shedskin and its definition of Restricted Python? I have heard repeatedly that PyPy RPython is very difficult to use. Then why isn't PyPy using Shedskin to compile its PyPy-Jit? Sarvi On Sep 2, 11:59 pm, John Nagle wrote: > On 9/2/2010 10:30 PM,

Re: bisection method: Simulating a retirement fund

2010-09-03 Thread Baba
On Sep 2, 11:10 pm, MRAB wrote: > > Why are you saving 'fund' in SavingsRecord if you're returning just the > last and discarding others? Basically you're returning the final value > of fund. Hi MRAB ok i agree that this is not be ideal. I should shorten this to ONLY return SavingsRecord[-1] >

pyqt unhandled RuntimeError \"no access to protected functions or signals for objects not created from Python

2010-09-03 Thread luca72
Hello i have also write to pyqt mailing list but maybe you can help me to solve this question: I have write a tcpserver but wheni try to read by the signal readyRead() e get the error this the part of the program: def nuova_connessione(self): print 'Nuova connessione'

Re: Speed-up for loops

2010-09-03 Thread Stefan Behnel
Ulrich Eckhardt, 03.09.2010 08:52: Tim Wintle wrote: [..] under the hood, cpython does something like this (in psudo-code) itterator = xrange(imax) while 1: next_attribute = itterator.next try: i = next_attribute() except: break a = a + 10 There is one thing that strikes

Re: PyPy and RPython

2010-09-03 Thread John Nagle
On 9/2/2010 10:30 PM, sarvi wrote: On Sep 2, 2:19 pm, John Nagle wrote: On 9/2/2010 1:29 AM, sarvi wrote: When I think about it these restrictions below seem a very reasonable tradeoff for performance. Yes. And I can use this for just the modules/sections that are performance critica

Re: python database

2010-09-03 Thread Ben Finney
shai garcia writes: > can you pls help me to make a database program in python? Thank you for your interest in Python, and I hope you will have much success as you learn about it. Your best way of using this forum to help you is to ask *specific* questions about problems as you go along. Do you

Re: PyPy and RPython

2010-09-03 Thread Stefan Behnel
sarvi, 03.09.2010 07:30: It should technically be possible to allow Python to call a module written in RPython? What's "Python" here? CPython? Then likely yes. I don't see a benefit, though. It should also compile RPython to a python module.so right? Why (and how) would CPython do that? I