Re: Balanced trees

2014-03-09 Thread Marko Rauhamaa
Steven D'Aprano : > Proof: I create a hash table that accepts unsigned bytes as keys, where The O(f(n)) notation has no meaning when n is limited. This thing is not just pedantry. The discussion was how a balanced tree fares in comparison with hash tables. A simplistic O(1) vs O(log n) was pres

Re: golang OO removal, benefits. over python?

2014-03-09 Thread Rustom Mody
On Monday, March 10, 2014 10:19:20 AM UTC+5:30, flebber wrote: > I was wondering if a better programmer than I could explain if the removal of > OO features in golang really does offer an great benefit over python. That's a strange locution: You are suggesting that go had OOP and it was removed -

golang OO removal, benefits. over python?

2014-03-09 Thread flebber
I was wondering if a better programmer than I could explain if the removal of OO features in golang really does offer an great benefit over python. An article I was reading ran through a brief overview of golang in respect of OO features http://areyoufuckingcoding.me/2012/07/25/object-desorient

Re: Balanced trees

2014-03-09 Thread Steven D'Aprano
On Sun, 09 Mar 2014 18:04:46 -0600, Ian Kelly wrote: > On Sun, Mar 9, 2014 at 4:08 PM, Dan Stromberg > wrote: >> On Sun, Mar 9, 2014 at 2:43 PM, Marko Rauhamaa >> wrote: >>> Dan Stromberg : >>> On Sun, Mar 9, 2014 at 2:32 PM, Marko Rauhamaa wrote: > There is no O(1) hash table. >>

Re: Balanced trees

2014-03-09 Thread Steven D'Aprano
On Sun, 09 Mar 2014 23:32:54 +0200, Marko Rauhamaa wrote: > Dan Stromberg : > >> This is not just a detail: O(1) tends to be beat O(logn) pretty easily >> for large n. > > There is no O(1) hash table. Of course there are. While it is true that hash tables *in general* are not *always* O(1), th

Windows installation problem with 3.3.5

2014-03-09 Thread Mark Lawrence
It looks as if the upgrade from 3.3.4 to 3.3.5 has stolen my copies of py.exe and pyw.exe from c:\windows. Before I raise an issue on the bug tracker could someone please confirm this, as it wouldn't be the first time I've managed to screw something up. -- My fellow Pythonistas, ask not what

Re: gdb unable to read python frame information

2014-03-09 Thread Mark Lawrence
On 10/03/2014 02:54, Wesley wrote: If you don't read the loop from the top, and don't tell me exactly what you want by just keep saying context, please ingore this post. Thanks. Wesley 在 2014年3月10日星期一UTC+8上午9时48分41秒,Mark Lawrence写道: On 10/03/2014 01:06, Wesley wrote: What's information do y

Re: gdb unable to read python frame information

2014-03-09 Thread Wesley
If you don't read the loop from the top, and don't tell me exactly what you want by just keep saying context, please ingore this post. Thanks. Wesley 在 2014年3月10日星期一UTC+8上午9时48分41秒,Mark Lawrence写道: > On 10/03/2014 01:06, Wesley wrote: > > > What's information do you want? > > > > > > I told t

Re: Tuples and immutability

2014-03-09 Thread Steven D'Aprano
On Sun, 09 Mar 2014 17:42:42 -0600, Ian Kelly wrote: > On Sun, Mar 9, 2014 at 4:03 PM, Gregory Ewing > wrote: >> Note that it says "when possible", not "if the implementation feels >> like it". > > That's quite vague, and not much stronger a guarantee than "maybe". It's > technically "possible"

Re: gdb unable to read python frame information

2014-03-09 Thread Mark Lawrence
On 10/03/2014 01:06, Wesley wrote: What's information do you want? I told the OS, gdb and python version. And my operation steps. What do you want more, then, I can type here. Wesley Context, you just keep sending messages like the above which on its own is meaningless. Why should anybod

Re: gdb unable to read python frame information

2014-03-09 Thread Wesley
What's information do you want? I told the OS, gdb and python version. And my operation steps. What do you want more, then, I can type here. Wesley -- https://mail.python.org/mailman/listinfo/python-list

Re: better and user friendly IDE recommended?

2014-03-09 Thread Michael Weylandt
On Mar 9, 2014, at 19:22, Martin Schöön wrote: > What you don't get as far as I can see is code completion, > syntax highlighting etc since Emacs is doing this with > respect to Orgmode and not the programming language you > use. Put (setq org-src-fontify-natively t) In your ~/.emacs or ~/.ema

Re: Balanced trees

2014-03-09 Thread Ian Kelly
On Sun, Mar 9, 2014 at 4:08 PM, Dan Stromberg wrote: > On Sun, Mar 9, 2014 at 2:43 PM, Marko Rauhamaa wrote: >> Dan Stromberg : >> >>> On Sun, Mar 9, 2014 at 2:32 PM, Marko Rauhamaa wrote: There is no O(1) hash table. >>> >>> http://stackoverflow.com/questions/2771368/can-hash-tables-really

Re: better and user friendly IDE recommended?

2014-03-09 Thread Michael Weylandt
On Mar 9, 2014, at 19:58, Michael Weylandt wrote: > On Mar 9, 2014, at 19:22, Martin Schöön wrote: >> What you don't get as far as I can see is code completion, >> syntax highlighting etc since Emacs is doing this with >> respect to Orgmode and not the programming language you >> use. > > Put

Re: Tuples and immutability

2014-03-09 Thread Ian Kelly
On Sun, Mar 9, 2014 at 4:03 PM, Gregory Ewing wrote: > Ian Kelly wrote: >> >> In my view the second one is wrong. a += b should be understood as >> being equivalent to a = a + b, but with the *possible* and by no means >> guaranteed optimization that the operation may be performed in-place. > > >

Re: better and user friendly IDE recommended?

2014-03-09 Thread Martin Schöön
Den 2014-02-14 skrev Martin Schöön : > Den 2014-02-14 skrev Rustom Mody : >> On Friday, February 14, 2014 2:57:13 AM UTC+5:30, Martin Schöön wrote: >>> Den 2013-09-17 skrev rusi >>> > On Wednesday, September 11, 2013 7:44:04 PM UTC+5:30, >>> > mnishpsyched wrote: >>> > Just saw this >>> > http://

Re: Tuples and immutability

2014-03-09 Thread Terry Reedy
On 3/9/2014 6:03 PM, Gregory Ewing wrote: Ian Kelly wrote: In my view the second one is wrong. a += b should be understood as being equivalent to a = a + b, but with the *possible* and by no means guaranteed optimization that the operation may be performed in-place. This interpretation is at

Re: Making Labels from python

2014-03-09 Thread Ulrich Goebel
Many thanks for the moment. I will try reportlab the next days. Am 09.03.2014 22:29, schrieb Ulrich Goebel: Hallo, has anybody an idea how to make small formated documents redy to print with python? I would like to print address labels as firstname lastname street and number cip

Re: Making Labels from python

2014-03-09 Thread Terry Reedy
On 3/9/2014 5:29 PM, Ulrich Goebel wrote: Hallo, has anybody an idea how to make small formated documents redy to print with python? I would like to print address labels as firstname lastname street and number cip and city The best should be to form a PDF and send it to the label

Re: Making Labels from python

2014-03-09 Thread Marko Rauhamaa
Ben Finney : > The most reliable “ready to print” document formats are: > > * plain text > * PDF You might also consider PostScript. It can be emitted from any programming language without any special support (and any special support would probably only get in the way). A possibility is also the

Re: Making Labels from python

2014-03-09 Thread Irmen de Jong
On 9-3-2014 22:29, Ulrich Goebel wrote: > Hallo, > > has anybody an idea how to make small formated documents redy to print with > python? > > I would like to print address labels as > >firstname lastname >street and number >cip and city > > The best should be to form a PDF and sen

Re: Balanced trees

2014-03-09 Thread Marko Rauhamaa
Dan Stromberg : > On Sun, Mar 9, 2014 at 2:43 PM, Marko Rauhamaa wrote: There is no O(1) hash table. > [...] > > it's still amortized O(1). So we are in perfect agreement. Hash tables are a useful family of techniques but involve quite a bit of cost/benefit heuristics. You can only claim O

Re: Making Labels from python

2014-03-09 Thread Ben Finney
Ulrich Goebel writes: > has anybody an idea how to make small formated documents redy to print > with python? The most reliable “ready to print” document formats are: * plain text * PDF All others, AFAIK, are significantly less reliable for that purpose. The “ReportLab PDF library” is a compr

Re: Balanced trees

2014-03-09 Thread Dan Stromberg
On Sun, Mar 9, 2014 at 2:43 PM, Marko Rauhamaa wrote: > Dan Stromberg : > >> On Sun, Mar 9, 2014 at 2:32 PM, Marko Rauhamaa wrote: >>> There is no O(1) hash table. >> >> http://stackoverflow.com/questions/2771368/can-hash-tables-really-be-o1 > > Please elaborate. A hash table of fixed size is O(

Re: Making Labels from python

2014-03-09 Thread Gary Herron
On 03/09/2014 02:29 PM, Ulrich Goebel wrote: Hallo, has anybody an idea how to make small formated documents redy to print with python? I would like to print address labels as firstname lastname street and number cip and city The best should be to form a PDF and send it to the labe

Re: Tuples and immutability

2014-03-09 Thread Gregory Ewing
Ian Kelly wrote: In my view the second one is wrong. a += b should be understood as being equivalent to a = a + b, but with the *possible* and by no means guaranteed optimization that the operation may be performed in-place. This interpretation is at odds with the Language Reference, section 6

Re: Balanced trees

2014-03-09 Thread Marko Rauhamaa
Dan Stromberg : > On Sun, Mar 9, 2014 at 2:32 PM, Marko Rauhamaa wrote: >> There is no O(1) hash table. > > http://stackoverflow.com/questions/2771368/can-hash-tables-really-be-o1 Please elaborate. Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Balanced trees

2014-03-09 Thread Dan Stromberg
On Sun, Mar 9, 2014 at 2:32 PM, Marko Rauhamaa wrote: > Dan Stromberg : > >> This is not just a detail: O(1) tends to be beat O(logn) pretty easily >> for large n. > > There is no O(1) hash table. http://stackoverflow.com/questions/2771368/can-hash-tables-really-be-o1 -- https://mail.python.org/

Making Labels from python

2014-03-09 Thread Ulrich Goebel
Hallo, has anybody an idea how to make small formated documents redy to print with python? I would like to print address labels as firstname lastname street and number cip and city The best should be to form a PDF and send it to the label printer. So the PDF could be given the page

Re: Balanced trees

2014-03-09 Thread Marko Rauhamaa
Dan Stromberg : > This is not just a detail: O(1) tends to be beat O(logn) pretty easily > for large n. There is no O(1) hash table. Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Balanced trees

2014-03-09 Thread Dan Stromberg
On Sun, Mar 9, 2014 at 1:27 AM, Marko Rauhamaa wrote: > Dan Stromberg : > >> On Sat, Mar 8, 2014 at 1:21 PM, Marko Rauhamaa wrote: >>> If I had to choose between a hash table and AVL (or RB) tree in the >>> standard library, it would definitely have to be the latter. It is more >>> generally usab

Re: Tuples and immutability

2014-03-09 Thread Chris Angelico
On Mon, Mar 10, 2014 at 6:57 AM, Joshua Landau wrote: > I would probably implement it closer to home. Inside > tuple.__getitem__, there would be something like > > if context_is_augmented_assignment(): > raise TypeError(message+warning) > else: > raise TypeError(message) >

Re: Tuples and immutability

2014-03-09 Thread Joshua Landau
On 9 March 2014 18:13, Chris Angelico wrote: > I think I see what you're saying here. But ignore "top-level"; this > should just be a part of the exception message, no matter what. I don't think I was clear, but yes. That. > What you're saying is that this should notice that it's doing an > augm

Re: image processing in python and opencv

2014-03-09 Thread Gary Herron
On 03/09/2014 10:56 AM, Varsha Holla wrote: i have no idea how to retrieve indexed images stored in ordered dictionary, using its values like : blue,green,red mean along with contrast, energy, homogeneity and correlation. as i have calculated the euclidean distance and i don't know how to disp

Re: Problem using py-bt, py-locals, etc. during GDB debugging [solved]

2014-03-09 Thread Terry Reedy
On 3/9/2014 10:46 AM, Wesley wrote: I hit a problem alike yours. Cannot fix according your method. Here is snippet: root@localhost python]# gdb python 40290 GNU gdb (GDB) 7.7 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later

Re: gdb unable to read python frame information

2014-03-09 Thread Terry Reedy
On 3/9/2014 10:57 AM, Mark Lawrence wrote: On 09/03/2014 03:49, Wesley wrote: Anybody has suggestions? Don't expect crazy things. Send suggestions to the right place (a gdb list for a gdb enhancement). This really makes me crazy... What makes you crazy? The supposed fact that GnuDeBug d

Re: Tuples and immutability

2014-03-09 Thread Chris Angelico
On Mon, Mar 10, 2014 at 4:54 AM, Joshua Landau wrote: > On 28 February 2014 14:43, Chris Angelico wrote: >> On Sat, Mar 1, 2014 at 1:41 AM, Joshua Landau wrote: >>> Would it be better to add a check here, such that if this gets raised >>> to the top-level it includes a warning ("Addition was inp

Re: Tuples and immutability

2014-03-09 Thread Joshua Landau
On 28 February 2014 14:43, Chris Angelico wrote: > On Sat, Mar 1, 2014 at 1:41 AM, Joshua Landau wrote: >> Would it be better to add a check here, such that if this gets raised >> to the top-level it includes a warning ("Addition was inplace; >> variable probably mutated despite assignment failur

image processing in python and opencv

2014-03-09 Thread Varsha Holla
i have no idea how to retrieve indexed images stored in ordered dictionary, using its values like : blue,green,red mean along with contrast, energy, homogeneity and correlation. as i have calculated the euclidean distance and i don't know how to display the images which are similar. thanks in a

Re: gdb unable to read python frame information

2014-03-09 Thread Mark Lawrence
On 09/03/2014 03:49, Wesley wrote: Anybody has suggestions? This really makes me crazy... What makes you crazy? You keep sending messages with no context. We might be smart, but we're not (yet :) mind readers. -- My fellow Pythonistas, ask not what our language can do for you, ask what

Re: How is unicode implemented behind the scenes?

2014-03-09 Thread Mark Lawrence
On 09/03/2014 10:32, Rustom Mody wrote: On Sunday, March 9, 2014 2:09:32 PM UTC+5:30, wxjm...@gmail.com wrote: Le dimanche 9 mars 2014 03:40:28 UTC+1, MRAB a écrit : On 2014-03-09 02:08, Dan Stromberg wrote: OK, I know that Unicode data is stored in an encoding on disk. But how is it stored in

Re: Problem using py-bt, py-locals, etc. during GDB debugging [solved]

2014-03-09 Thread Wesley
I hit a problem alike yours. Cannot fix according your method. Here is snippet: root@localhost python]# gdb python 40290 GNU gdb (GDB) 7.7 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are

[RELEASED] Python 3.3.5

2014-03-09 Thread Georg Brandl
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On behalf of the Python development team, I'm very happy to announce the release of Python 3.3.5. Python 3.3.5 includes fixes for these important issues: * a 3.3.4 regression in zipimport (see http://bugs.python.org/issue20621) * a 3.3.4 regression e

Re: How is unicode implemented behind the scenes?

2014-03-09 Thread Rustom Mody
On Sunday, March 9, 2014 2:09:32 PM UTC+5:30, wxjm...@gmail.com wrote: > Le dimanche 9 mars 2014 03:40:28 UTC+1, MRAB a écrit : > > On 2014-03-09 02:08, Dan Stromberg wrote: > > > OK, I know that Unicode data is stored in an encoding on disk. > > > But how is it stored in RAM? > > > I realize I sho

Re: Tuples and immutability

2014-03-09 Thread Marko Rauhamaa
Ian Kelly : > In my view the second one is wrong. a += b should be understood as > being equivalent to a = a + b, but with the *possible* and by no means > guaranteed optimization that the operation may be performed in-place. Some call it an optimization, others call it a side effect. Anyway, th

Re: Balanced trees

2014-03-09 Thread Marko Rauhamaa
Dan Stromberg : > On Sat, Mar 8, 2014 at 1:21 PM, Marko Rauhamaa wrote: >> If I had to choose between a hash table and AVL (or RB) tree in the >> standard library, it would definitely have to be the latter. It is more >> generally usable, has fewer corner cases and probably has an equal >> perfor

Re: Balanced trees

2014-03-09 Thread Marko Rauhamaa
Roy Smith : > Marko Rauhamaa wrote: > >> If I had to choose between a hash table and AVL (or RB) tree in the >> standard library, it would definitely have to be the latter. It is more >> generally usable, has fewer corner cases and probably has an equal >> performance even in hash tables' sweet

Re: process.popen with Japanese args => UTF8 JAVA

2014-03-09 Thread Cameron Simpson
On 09Mar2014 16:52, Jun Tanaka wrote: > I have tried to process.popen to run java program with Japanese language. > test.java is compiled with utf8 > '日本語' below means Japanese in Japanese. > but it does not work. Anyone who knows this matter well. Please help. > Jun > > python code>>

Re: How is unicode implemented behind the scenes?

2014-03-09 Thread wxjmfauth
Le dimanche 9 mars 2014 03:40:28 UTC+1, MRAB a écrit : > On 2014-03-09 02:08, Dan Stromberg wrote: > > > OK, I know that Unicode data is stored in an encoding on disk. > > > > > > But how is it stored in RAM? > > > > > > I realize I shouldn't write code that depends on any relevant > > > impl

Re: process.popen with Japanese args => UTF8 JAVA

2014-03-09 Thread Ben Finney
Jun Tanaka writes: > I have tried to process.popen to run java program with Japanese language. > test.java is compiled with utf8 > '日本語' below means Japanese in Japanese. > but it does not work. What are you expecting to happen, and what happens instead? What error (if any) is produced? -- htt