Re: sorting 1172026 entries

2012-05-07 Thread Ian Kelly
On Mon, May 7, 2012 at 3:52 PM, Cameron Simpson wrote: > | (or add 50% or something) each > | time, meaning that as n increases, the frequency of reallocations > | decreases - hence the O(1) amortized time. > > Hmm, yes. But it is only O(1) for doubling. If one went with a smaller > increment (to

Re: indexed property? Can it be done?

2012-05-07 Thread Chris Angelico
On Tue, May 8, 2012 at 2:18 PM, Charles Hixson wrote: > Not as clean as what I'm hoping for, but so far I haven't come up with any > way except functions that doesn't directly expose the data...and if I must > use that approach, then the class doesn't buy me anything for the overhead.) C++ and Ja

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-07 Thread alex23
Even worse, here's what Risinger had to say when Leighton asked them to stop sending him email: "probably best not to feed the troll, Pascal -- especially one overwrought and lost in high dudgeon -- they tend to brickwall common reason and simple social advices." "Luke has made his decision -- an

Re: indexed property? Can it be done?

2012-05-07 Thread Ian Kelly
On Mon, May 7, 2012 at 9:15 PM, Charles Hixson wrote: > class Node: > >    def    __init__(self, nodeId, key, value, downRight, downLeft, parent): >        dirty    =    True >        dlu    =    utcnow() >        self.node    =    [nodeId, downLeft, [key], [value], [downRight], > parent, dirty, d

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-07 Thread alex23
On May 8, 1:54 pm, Steven D'Aprano wrote: > Seriously, this was a remarkably ham-fisted and foolish way to "resolve" > a dispute over the direction of an open source project. That's the sort > of thing that gives open source a bad reputation. The arrogance and sense of entitlement was so thick yo

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-07 Thread Chris Angelico
On Tue, May 8, 2012 at 1:54 PM, Steven D'Aprano wrote: > A.k.a. "we had to destroy the project in order to save it". > > http://technogems.blogspot.com.au/2012/05/pyjamas-hijacked.html Great summary, very handily peppered with links to appropriate posts. > Seriously, this was a remarkably ham-fi

Re: Creating a directory structure and modifying files automatically in Python

2012-05-07 Thread John Nagle
On 5/7/2012 9:09 PM, Steve Howell wrote: On May 7, 8:46 pm, John Nagle wrote: On 5/6/2012 9:59 PM, Paul Rubin wrote: Javierwrites: Or not... Using directories may be a way to do rapid prototyping, and check quickly how things are going internally, without needing to resort to complex dat

Re: indexed property? Can it be done?

2012-05-07 Thread Charles Hixson
On 05/07/2012 08:44 PM, Dan Sommers wrote: On Mon, 07 May 2012 20:15:36 -0700 Charles Hixson wrote: class Node: def__init__(self, nodeId, key, value, downRight, downLeft, parent): dirty=True dlu=utcnow() self.node=[nodeId, downLeft, [k

Re: indexed property? Can it be done?

2012-05-07 Thread Charles Hixson
On 05/07/2012 08:33 PM, Chris Rebert wrote: On Mon, May 7, 2012 at 8:15 PM, Charles Hixson wrote: class Node: def__init__(self, nodeId, key, value, downRight, downLeft, parent): dirty=True dlu=utcnow() self.node=[nodeId, downLeft, [k

Re: Creating a directory structure and modifying files automatically in Python

2012-05-07 Thread Steve Howell
On May 7, 8:46 pm, John Nagle wrote: > On 5/6/2012 9:59 PM, Paul Rubin wrote: > > > Javier  writes: > >> Or not... Using directories may be a way to do rapid prototyping, and > >> check quickly how things are going internally, without needing to resort > >> to complex database interfaces. > > > db

Re: indexed property? Can it be done?

2012-05-07 Thread Dan Sommers
On Mon, 07 May 2012 20:15:36 -0700 Charles Hixson wrote: > class Node: > > def__init__(self, nodeId, key, value, downRight, downLeft, > parent): dirty=True > dlu=utcnow() > self.node=[nodeId, downLeft, [key], [value], > [downRight], parent, dir

Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-07 Thread Steven D'Aprano
A.k.a. "we had to destroy the project in order to save it". http://technogems.blogspot.com.au/2012/05/pyjamas-hijacked.html Seriously, this was a remarkably ham-fisted and foolish way to "resolve" a dispute over the direction of an open source project. That's the sort of thing that gives open

Re: Creating a directory structure and modifying files automatically in Python

2012-05-07 Thread John Nagle
On 5/6/2012 9:59 PM, Paul Rubin wrote: Javier writes: Or not... Using directories may be a way to do rapid prototyping, and check quickly how things are going internally, without needing to resort to complex database interfaces. dbm and shelve are extremely simple to use. Using the file syst

Re: indexed property? Can it be done?

2012-05-07 Thread Chris Rebert
On Mon, May 7, 2012 at 8:15 PM, Charles Hixson wrote: > class Node: > >    def    __init__(self, nodeId, key, value, downRight, downLeft, parent): >        dirty    =    True >        dlu    =    utcnow() >        self.node    =    [nodeId, downLeft, [key], [value], [downRight], > parent, dirty, d

indexed property? Can it be done?

2012-05-07 Thread Charles Hixson
class Node: def__init__(self, nodeId, key, value, downRight, downLeft, parent): dirty=True dlu=utcnow() self.node=[nodeId, downLeft, [key], [value], [downRight], parent, dirty, dlu] Note that node[3] is a list of keys (initially 1) and no

Re: How do I run a python program from an internet address?

2012-05-07 Thread Steven D'Aprano
On Mon, 07 May 2012 16:20:35 -0700, Albert wrote: > I have a small text based python program that I want to make available > to people who might be behind a firewall or can't install python on > their office computers, but can access the internet. It is just an > algorithm that makes a handful of

Re: How do I run a python program from an internet address?

2012-05-07 Thread Chris Angelico
On Tue, May 8, 2012 at 9:20 AM, Albert wrote: > I have a small text based python program that I want to make available > to people who might be behind a firewall or can't install python on > their office computers, but can access the internet.  It is just an > algorithm that makes a handful of str

How do I run a python program from an internet address?

2012-05-07 Thread Albert
I have a small text based python program that I want to make available to people who might be behind a firewall or can't install python on their office computers, but can access the internet. It is just an algorithm that makes a handful of straightforward calculations on some input that the user p

RELEASED: Pymacs 0.25

2012-05-07 Thread François Pinard
Hello to everybody, and Emacs users in the Python community. Pymacs 0.25 is now available. There has been a while, so I advise current Pymacs users to switch with caution. - Python 3 is now supported. This required new installation mechanics, and a Python pre-processor written for the circum

try/except KeyboardInterrupt vs signal handler for SIGINT

2012-05-07 Thread Rafael Durán Castañeda
Hi, I was wondering which approach is better to stop several servers from just on python application when 'ctrl-c' is pressed, a try/except KeyboardInterrupt or just registering a SIGINT handler and exit when the signal is triggered. Any advantage/disadvantage from one approach over the other

Re: sorting 1172026 entries

2012-05-07 Thread Cameron Simpson
On 07May2012 11:02, Chris Angelico wrote: | On Mon, May 7, 2012 at 10:31 AM, Cameron Simpson wrote: | > I didn't mean per .append() call (which I'd expect to be O(n) for large | > n), I meant overall for the completed list. | > | > Don't the realloc()s make it O(n^2) overall for large n? The list

Re: Workshop on Design Patterns and Advanced OOPS, Bangalore

2012-05-07 Thread Terry Reedy
On 5/7/2012 6:23 AM, Exam Aya wrote: For anyone working on object oriented programing languages like C++, Java, C#, Python, PHP, etc. this workshop is a must. It goes through the set of design patterns that started it all - Go4 - (Gang of 4) patterns. The workshop will very interactive and each

Re: key/value store optimized for disk storage

2012-05-07 Thread Steve Howell
On May 6, 10:21 pm, John Nagle wrote: > On 5/4/2012 12:14 AM, Steve Howell wrote: > > > On May 3, 11:59 pm, Paul Rubin  wrote: > >> Steve Howell  writes: > >>>      compressor = zlib.compressobj() > >>>      s = compressor.compress("foobar") > >>>      s += compressor.flush(zlib.Z_SYNC_FLUSH) > >

Re: return respective values when mutiple keys are passed in dictionary

2012-05-07 Thread Arnaud Delobelle
On 7 May 2012 12:31, Nikhil Verma wrote: > HI All > > I was clearing my concepts on dictionary and stuck in this problem. > I have a dictionary which i have formed by using zip function on two list so > that one list (which i have hardcoded) becomes the keys and the other list > becomes its values

Re: return respective values when mutiple keys are passed in dictionary

2012-05-07 Thread Chris Angelico
On Mon, May 7, 2012 at 9:31 PM, Nikhil Verma wrote: > mydict = {'a':'apple' , 'b':'boy' ,'c' : 'cat', 'd':'duck','e':'egg'} > > Now if i do :- > > mydict.get('a') > 'apple' > > What i want is some i pass keys in get and in return i should have all the > values of those keys which i pass. > > #

Re: PyTextile Question

2012-05-07 Thread dinkypumpkin
On Friday, 4 May 2012 04:39:47 UTC+1, Josh English wrote: > However, when I convert my multiple-paragraph text object with textile, my > original line breaks are preserved. Since I'm going to HTML, I d'nt want my > line breaks preserved. I think any Textile implementation will preserve line bre

Re: [SOLVED] for-loop: weird behavior

2012-05-07 Thread ferreirafm
The problem has been solved opening the file for iteration in the second loop. I didn't realized such Python behavior. Any comments are appreciated. Fred -- View this message in context: http://python.6.n6.nabble.com/SOLVED-for-loop-weird-behavior-tp4953214p4957597.html Sent from the Python - p

Re: return respective values when mutiple keys are passed in dictionary

2012-05-07 Thread Виталий Волков
You can try to use map(mydict.get, ('a', 'b', 'c')) and then make join On May 7, 2012 2:33 PM, "Nikhil Verma" wrote: > HI All > > I was clearing my concepts on dictionary and stuck in this problem. > I have a dictionary which i have formed by using zip function on two list > so that one list (whi

return respective values when mutiple keys are passed in dictionary

2012-05-07 Thread Nikhil Verma
HI All I was clearing my concepts on dictionary and stuck in this problem. I have a dictionary which i have formed by using zip function on two list so that one list (which i have hardcoded) becomes the keys and the other list becomes its values. Now i want to know how can i get the values of key

Workshop on Design Patterns and Advanced OOPS, Bangalore

2012-05-07 Thread Exam Aya
Workshop on Design Patterns and Advanced OOPS Date: Sunday , 13th May, 2012 At Bangalore Hurry Register Online Now https://docs.google.com/spreadsheet/viewform?formkey=dGlMMnEtYmJVY2M3bEhNZG5WY3BHTkE6MA#gid=0 About the workshop: For anyone working on object oriented programing languages like

problem in event handling on change of variable value.

2012-05-07 Thread Nadhiya A
Hi, I want know how can I control Canoe tool from Python. I want to use Python as the mediator for linking CANoe and Matlab. Please give me some inputs regarding this. Thanks & Regards Nadhiya.A Larsen & Toubro Limited www.larsentoubro.com This Email may contain confidential or privileged in

Scrapy - importing files from local, rather than www

2012-05-07 Thread nbw
Hi everyone, I'm new to Python (loving it!) and Scrapy. I have a question I just can't seem to get my head around. I can get a simple Scrapy spider to pick up URLs and download them fine, but the HTML files I have are stored locally. The reason for this, is for some reason when I "Save As" the page

Re: new to Python - modules to leverage Perl scripts?

2012-05-07 Thread Cameron Simpson
On 07May2012 09:16, Peter Otten <__pete...@web.de> wrote: | Rogelio wrote: | > I've got quite a few Perl scripts that I would like to leverage, and | > I'd like to make some Python wrapper scripts for them. | > | > The Perl scripts shell into various network appliances, run certain | > commands, a

Re: new to Python - modules to leverage Perl scripts?

2012-05-07 Thread Peter Otten
Rogelio wrote: > I've got quite a few Perl scripts that I would like to leverage, and > I'd like to make some Python wrapper scripts for them. > > The Perl scripts shell into various network appliances, run certain > commands, and then output those commands into a file. > > I recently found out

Override path to python during installation (setuptools)

2012-05-07 Thread Yegor Yefremov
I'm trying to add lava-test package to Buildroot. After "cross-compilation" I get following path in the /usr/bin/lava: #!/home/user/MyProjects/versioned/buildroot/output/host/usr/bin/python instead of #!/usr/bin/python I use following command to install lava_test package: +define LAVA_TEST_INS