Re: 'complex' function with string argument.

2014-03-18 Thread Christian Gollwitzer
Am 15.03.14 17:26, schrieb Jayanth Koushik: This is regarding the inbuilt 'complex' function. The python docs say: "Note: When converting from a string, the string must not contain whitespace around the central + or - operator. For example, complex('1+2j') is fine, but complex('1 + 2j') raises Va

Re: Question about Source Control

2014-03-18 Thread Chris Angelico
On Tue, Mar 18, 2014 at 5:42 PM, Frank Millman wrote: > Excuse my ignorance, but how does it actually work? Ignorance not only excused, but welcomed. :) However, caveat: I know how git is set up, but not hg. Someone else can fill in the details; for now, I'll explain git and hope that hg is broad

Re: 'complex' function with string argument.

2014-03-18 Thread Chris Angelico
On Tue, Mar 18, 2014 at 6:04 PM, Christian Gollwitzer wrote: > As others have explained, the basic issue is the question how to parse an > expression like > > 1+2i*3 > > is it "complex(1+2i) times 3" or is it sum of 1 and product of complex 2i > and 3? The only way to have it be the forme

Re: Question about Source Control

2014-03-18 Thread Frank Millman
"Ben Finney" wrote in message news:85y508roiw@benfinney.id.au... > "Frank Millman" writes: > >> I feel that I have just not grasped the basics yet, so any assistance >> that >> puts me on the right path is appreciated. > > Here is "Hg Init", a tutorial for Mercurial http://hginit.com/>. >

Re: Question about Source Control

2014-03-18 Thread Chris Angelico
On Tue, Mar 18, 2014 at 5:47 PM, Ben Finney wrote: > (“source control” is not the most common term for this; what we're > talking about is a “version control system”, or VCS. But some Git users > may disagree.) People use different terms depending on their backgrounds, I think. I've heard a good

Re: Ordering in the printout of a dictionary

2014-03-18 Thread Marc Christiansen
Chris Angelico wrote: > On Tue, Mar 18, 2014 at 11:32 AM, Mok-Kong Shen > wrote: >> Is there a way to force a certain ordering of the printout or else >> somehow manage to get at least a certain stable ordering of the >> printout (i.e. input and output are identical)? > > Yes; instead of simply

Re: Balanced trees

2014-03-18 Thread Joshua Landau
On 18 March 2014 01:01, Daniel Stutzbach wrote: > I would love to have include macro-benchmarks. I keep waiting for the PyPy > benchmark suite to get ported to Python 3... *grins* >> "Delete a slice" is fudged from its inclusion of multiplication, which >> is far faster on blists. I admit that

Re: Ordering in the printout of a dictionary

2014-03-18 Thread Chris Angelico
On Tue, Mar 18, 2014 at 6:36 PM, Marc Christiansen wrote: > I would say using pprint.pprint is even easier and it works with your > failing example: > pprint.pprint({True:1,"Hello":2}) > {True: 1, 'Hello': 2} > True. I could try to say that I prefer to offer the simpler approach rather than

Re: Question about Source Control

2014-03-18 Thread Steven D'Aprano
On Tue, 18 Mar 2014 17:47:51 +1100, Ben Finney wrote: > "Frank Millman" writes: > >> I feel that I have just not grasped the basics yet, so any assistance >> that puts me on the right path is appreciated. > > Here is “Hg Init”, a tutorial for Mercurial http://hginit.com/>. > > (“source control

Re: 'complex' function with string argument.

2014-03-18 Thread Steven D'Aprano
On Tue, 18 Mar 2014 08:04:44 +0100, Christian Gollwitzer wrote: > Am 15.03.14 17:26, schrieb Jayanth Koushik: >> This is regarding the inbuilt 'complex' function. The python docs say: >> "Note: When converting from a string, the string must not contain >> whitespace around the central + or - opera

Re: Question about Source Control

2014-03-18 Thread Chris Angelico
On Tue, Mar 18, 2014 at 6:55 PM, Steven D'Aprano wrote: > I don't think that *version* control is the right model to describe what > hg and git do, although it may be appropriate for subversion. hg doesn't > manage *versions*, it manages changes to source code ("changesets"). Meh... Is there any

Re: 'complex' function with string argument.

2014-03-18 Thread Christian Gollwitzer
Hi Steven, Am 18.03.14 09:00, schrieb Steven D'Aprano: On Tue, 18 Mar 2014 08:04:44 +0100, Christian Gollwitzer wrote: Am 15.03.14 17:26, schrieb Jayanth Koushik: This is regarding the inbuilt 'complex' function. The python docs say: "Note: When converting from a string, the string must not c

Re: Venus / GuthVenus for iPhone, Nexus, Droid and Android Jelly Bean

2014-03-18 Thread Chris Angelico
On Tue, Mar 18, 2014 at 2:45 PM, Brad Guth wrote: > You may want to revise that manifesto to read 'suffer and pay dearly' > instead of "GOING TO DIE", unless you meant via natural causes. Don't bother responding to Thrinaxodon, it's a spammer. ChrisA -- https://mail.python.org/mailman/listinfo/

Find and replace multiple RegEx search expressions

2014-03-18 Thread Jignesh Sutar
Hi, I'm trying to delete contents of a .txt log file, matching on multiple re.sub criteria but not sure how to achieve this. Below is an illustration of what I am trying to achieve (of course in this example I can combine the 3 re.sub into a single re expression but my actual code will have a doz

Re: Find and replace multiple RegEx search expressions

2014-03-18 Thread Peter Otten
Jignesh Sutar wrote: > Hi, > > I'm trying to delete contents of a .txt log file, matching on multiple > re.sub criteria but not sure how to achieve this. > > Below is an illustration of what I am trying to achieve (of course in this > example I can combine the 3 re.sub into a single re expressio

Python3 html.parser

2014-03-18 Thread balaji marisetti
Hi, I'm trying to parse a pice of HTML code using `html.parser` in Python3. I want to find out the offset of a particular end tag (let's say ) and then stop processing the remaining HTML code immediately. So I wrote something like this. [code] def handle_endtag(self, tag): if tag == mytag:

Re: Python3 html.parser

2014-03-18 Thread Peter Otten
balaji marisetti wrote: > Hi, > > I'm trying to parse a pice of HTML code using `html.parser` in Python3. > I want to find out the offset of a particular end tag (let's say ) and > then stop processing > the remaining HTML code immediately. So I wrote something like this. > > [code] > def handle

Re: Question about Source Control

2014-03-18 Thread Steven D'Aprano
On Tue, 18 Mar 2014 19:08:17 +1100, Chris Angelico wrote: > On Tue, Mar 18, 2014 at 6:55 PM, Steven D'Aprano > wrote: >> I don't think that *version* control is the right model to describe >> what hg and git do, although it may be appropriate for subversion. hg >> doesn't manage *versions*, it ma

Re: 'complex' function with string argument.

2014-03-18 Thread Marko Rauhamaa
Christian Gollwitzer : > The same problem arises with unary minus, but it's less annoying > because -(a*b) = (-a)*b. >>> -1**2 -1 Marko -- https://mail.python.org/mailman/listinfo/python-list

Unexpected comparisons in dict lookup

2014-03-18 Thread Steven D'Aprano
I stumbled across this unexpected behaviour with Python 2.7 and 3.3. When you look up a key in a dict, the key is sometimes compared against other keys twice instead of just once. First, a class that reports when it is being tested for equality, with a fixed hash so that we get collisions insid

Re: 'complex' function with string argument.

2014-03-18 Thread Mark H Harris
On 3/17/14 11:52 PM, Steven D'Aprano wrote: On Mon, 17 Mar 2014 11:18:56 -0500, Mark H Harris wrote: Who knows, beats me. With respect, that's just because you would make a lousy language designer :-) Ouch;-) "How should one spell a complex number?" There is perfectly good syntax

Re: HOLY SH*T! HUMANS ORIGINATED IN THE DEVONIAN

2014-03-18 Thread Juha Nieminen
In comp.lang.c++ ASSODON wrote: > THRINAXODON DANCED WITH JOY AS HE WAS GRANTED $600,000,000,000.000! I find it interesting, from a psychological perspective, that you are not even *pretending* that you are not lying and making stuff up. You pretty much imply it as clearly as it possibly can be,

Re: HOLY SH*T! HUMANS ORIGINATED IN THE DEVONIAN

2014-03-18 Thread Danyelle Davis
Don't feed the trolls. Actually talking to it makes it think you actually care.. On Mon, Mar 17, 2014 at 4:50 AM, ASSODON wrote: > === > >BREAKING NEWS > === > > > RICHARD LEAKEY JUST DIED DUE TO HEART FAILURE! > > > THE REASONS DESCRIBED BY THE

extract stream title from the output of mplayer

2014-03-18 Thread Jabba Laci
Hi, I have a simple command-line radio player and I want to extract song titles from the output of mplayer. Example: $ mplayer http://relay2.slayradio.org:8000/ It produces a streamed output of this form: MPlayer2 UNKNOWN (C) 2000-2012 MPlayer Team mplayer: could not connect to socket mplayer:

Re: Question about Source Control

2014-03-18 Thread Mark H Harris
On 3/17/14 8:06 AM, Frank Millman wrote: All my source code resides on an old Linux server, which I switch on in the morning and switch off at night, but otherwise hardly ever look at. It uses 'samba' to allow sharing with Windows, and 'nfs' to allow sharing with other Linux machines. hi Frank,

Re: extract stream title from the output of mplayer

2014-03-18 Thread Chris Angelico
On Wed, Mar 19, 2014 at 4:03 AM, Jabba Laci wrote: > I have a simple command-line radio player and I want to extract song > titles from the output of mplayer. > > ICY Info: StreamTitle='Alexander 'Taxim' Nev - Unsound minds feat. > SAM';StreamUrl='http://www.SLAYRadio.org/'; > > At the end it show

Re: extract stream title from the output of mplayer

2014-03-18 Thread Jabba Laci
> Python. (Or s/guess/hop/ if you prefer!) There are many ways this > could be done; what have you tried, what partly worked, what did > something unexpected? Hi, I managed to solve the problem. In the man of mplayer I found how to quit after X seconds: "-endpos X". See my solution below. Best,

Re: Balanced trees

2014-03-18 Thread Dan Stromberg
On Mon, Mar 17, 2014 at 3:05 PM, Marko Rauhamaa wrote: > Joshua Landau : > >> The thing we really need is for the blist containers to become stdlib >> (but not to replace the current list implementation). > > Very interesting. Downloaded blist but didn't compile it yet. It *could* > be the missing

Re: Unexpected comparisons in dict lookup

2014-03-18 Thread Ian Kelly
On Tue, Mar 18, 2014 at 8:20 AM, Steven D'Aprano wrote: > I stumbled across this unexpected behaviour with Python 2.7 and 3.3. When > you look up a key in a dict, the key is sometimes compared against other > keys twice instead of just once. >From what I can see in the code, it adds a perturbatio

Controlling buffer alignment in file.read()

2014-03-18 Thread Haralanov, Mitko
Hi all, I am using Python to read from a binary device file which requires that all read sizes are in 8byte multiples and the user's buffer is 8byte aligned. I am currently using a file object and the file.read() method. However, the issue is that the file.read() method allocates the buffer pas

Re: Question about Source Control

2014-03-18 Thread Dave Angel
Steven D'Aprano Wrote in message: > On Tue, 18 Mar 2014 19:08:17 +1100, Chris Angelico wrote: > >> On Tue, Mar 18, 2014 at 6:55 PM, Steven D'Aprano >> wrote: >>> I don't think that *version* control is the right model to describe >>> what hg and git do, although it may be appropriate for subve

Re: Balanced trees

2014-03-18 Thread Marko Rauhamaa
Dan Stromberg : > The results are at > http://stromberg.dnsalias.org/~strombrg/python-tree-and-heap-comparison/2014-03/ Unfortunately I'm having a hard time understanding the results. The 50/50 get/set ratio is most interesting to me. I'm seeing (under cpython-3.3): Size: 1048576, duratio

mobile friendly docs?

2014-03-18 Thread klo uo
Hi, let me quickly introduce my concern - I was happy to see main python.org portal rendered nicely on mobile, but docs are still hardly accessible, while sphinx allows better experience if user instructs it to. So I browsed Python MLs (sorry if this is not the right one, I'd be happy to forward

Re: Balanced trees

2014-03-18 Thread Dan Stromberg
On Tue, Mar 18, 2014 at 1:55 PM, Marko Rauhamaa wrote: > Dan Stromberg : > >> The results are at >> http://stromberg.dnsalias.org/~strombrg/python-tree-and-heap-comparison/2014-03/ > > Unfortunately I'm having a hard time understanding the results. > > The 50/50 get/set ratio is most interesting t

Re: Question about Source Control

2014-03-18 Thread Gregory Ewing
Frank Millman wrote: These are the kind of stumbling blocks that prevented me from succeeding in my previous attempt. I have a vague recollection that I set it up on machine A, but then hit a problem because machines B and C both accessed the same directory, but with different names For deali

Re: Balanced trees

2014-03-18 Thread Marko Rauhamaa
Dan Stromberg : > dict was able to do 1048576 operations on a dictionary before taking > more than 120 seconds to complete - it took 75.3 seconds to do 1048576 > operations. > > AVL_tree was able to do 262144 operations on a dictionary before > taking more than 120 seconds to complete - it took 66

Re: Balanced trees

2014-03-18 Thread Dan Stromberg
On Tue, Mar 18, 2014 at 3:03 PM, Marko Rauhamaa wrote: > Dan Stromberg : > For a proper comparison, I'd like a fixed, identical dataset and set of > operations run against each data structure. > > How about this test program: I used to do essentially this, but it was time-prohibitive and produced

Re: Controlling buffer alignment in file.read()

2014-03-18 Thread Gregory Ewing
Haralanov, Mitko wrote: I am using Python to read from a binary device file which requires that all read sizes are in 8byte multiples and the user's buffer is 8byte aligned. Is there a way that I can get file.read() to use an 8byte aligned buffer? For control at that level you'd be better off

RE: Controlling buffer alignment in file.read()

2014-03-18 Thread Haralanov, Mitko
> For control at that level you'd be better off using > direct system calls, i.e. os.open() and os.read(), > then you can read exacty the number of bytes you want. > The problem is not controlling the number of bytes read. That part seems to be working. The issue is that the buffer into which th

Re: Balanced trees

2014-03-18 Thread Marko Rauhamaa
Dan Stromberg : > On Tue, Mar 18, 2014 at 3:03 PM, Marko Rauhamaa wrote: >> Dan Stromberg : >> For a proper comparison, I'd like a fixed, identical dataset and set >> of operations run against each data structure. >> >> How about this test program: > > I used to do essentially this, but it was ti

Re: Controlling buffer alignment in file.read()

2014-03-18 Thread Gregory Ewing
Haralanov, Mitko wrote: The problem is not controlling the number of bytes read. That part seems to be working. The issue is that the buffer into which the data is placed needs to be of certain alignment (8byte-aligned). Python does not seem to have a way that allows me to control that. Hmmm,

Re: Controlling buffer alignment in file.read()

2014-03-18 Thread Dan Stromberg
On Tue, Mar 18, 2014 at 1:23 PM, Haralanov, Mitko wrote: > Hi all, > > I am using Python to read from a binary device file which requires that all > read sizes are in 8byte multiples and the user's buffer is 8byte aligned. > > I am currently using a file object and the file.read() method. However

Re: Balanced trees

2014-03-18 Thread Chris Kaynor
> > On Tue, Mar 18, 2014 at 1:55 PM, Marko Rauhamaa wrote: > Dan Stromberg : >> > The results are at >> > >> http://stromberg.dnsalias.org/~strombrg/python-tree-and-heap-comparison/2014-03/ > > Size: 1048576, duration: 75.3, dictionary type: dict > [...] > Size: 262144, duration: 66.

Re: Balanced trees

2014-03-18 Thread Steven D'Aprano
On Wed, 19 Mar 2014 01:11:33 +0200, Marko Rauhamaa wrote: > Dan Stromberg : >> Rather than throw out unbalanced binary tree altogether, it makes more >> sense to run it until it gets "too slow". > > I disagree strongly. You should throw out unbalanced binary trees and > linked lists and the like

Re: Balanced trees

2014-03-18 Thread Steven D'Aprano
On Tue, 18 Mar 2014 15:21:28 -0700, Dan Stromberg wrote: > On Tue, Mar 18, 2014 at 3:03 PM, Marko Rauhamaa > wrote: >> Dan Stromberg : >> For a proper comparison, I'd like a fixed, identical dataset and set of >> operations run against each data structure. >> >> How about this test program: > >

Re: Question about Source Control

2014-03-18 Thread Terry Reedy
On 3/18/2014 5:51 PM, Gregory Ewing wrote: Frank Millman wrote: These are the kind of stumbling blocks that prevented me from succeeding in my previous attempt. I have a vague recollection that I set it up on machine A, but then hit a problem because machines B and C both accessed the same direc

[no subject]

2014-03-18 Thread Nathan Bruce
Hi I was wondering how much your oxycontins are for what mg and quantity. Also do you guys sell dilaudid? Thank you -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about Source Control

2014-03-18 Thread Tim Chase
On 2014-03-18 21:38, Terry Reedy wrote: > At least with hg, one should best test the code in the working > directory *before* committing to the local repository. I don't know if this is a hg-vs-git way of thinking, but I tend to frequently commit things on a private development branch regardless

Re: Question about Source Control

2014-03-18 Thread Chris Angelico
On Wed, Mar 19, 2014 at 1:12 PM, Tim Chase wrote: > On 2014-03-18 21:38, Terry Reedy wrote: >> At least with hg, one should best test the code in the working >> directory *before* committing to the local repository. > > I don't know if this is a hg-vs-git way of thinking, but I tend to > frequentl

Greetings from Al-Madinah International University

2014-03-18 Thread marwa kotb
Al Salam Alaykom w rahmat allah w barkato Dear : mr \ mrs We are pleased that on behalf of the Al-Madinah International University [MEDIU] greetings and best wishes for you continued success , coupled with the sincere invitations for your further success and development and growth. Al-Mad

Re: Question about Source Control

2014-03-18 Thread Frank Millman
"Frank Millman" wrote in message news:lg6s09$irl$1...@ger.gmane.org... > Hi all > > I know I *should* be using a Source Control Management system, but at > present I am not. I tried to set up Mercurial a couple of years ago, but I > think I set it up wrongly, as I got myself confused and found