Re: Off-topic: Usenet archiving history

2009-06-14 Thread David Bolen
Dennis Lee Bieber writes: > Either way -- it was still a change from "expiration at some > date"... Though since (Netcom/Mindspring)Earthlink seems to have > subcontracted NNTP service to Giganews (or some such) it wouldn't > surprise me to learn that service also keeps a mammoth archive...

Re: Perl's @foo[3,7,1,-1] ?

2009-06-14 Thread Lie Ryan
Piet van Oostrum wrote: >> kj (k) wrote: > >> k> Switching from Perl here, and having a hard time letting go... > >> k> Suppose I have an "array" foo, and that I'm interested in the 4th, 8th, >> k> second, and last element in that array. In Perl I could write: > >> k> my @wanted = @foo[3

Re: Off-topic: Usenet archiving history

2009-06-14 Thread Ben Finney
David Bolen writes: > Individual messages could include an Expires: header if they wished, Since we're already well off-topic: NNTP, HTTP, and email, and probably other protocols as well, all deal with messages. They are all consistent in defining a message [0] as having *exactly one* header. E

Re: How to escape # hash character in regex match strings

2009-06-14 Thread Lie Ryan
Brian D wrote: > On Jun 11, 9:22 am, Brian D wrote: >> On Jun 11, 2:01 am, Lie Ryan wrote: >> >> >> >>> 504cr...@gmail.com wrote: I've encountered a problem with my RegEx learning curve -- how to escape hash characters # in strings being matched, e.g.: >>> string = re.escape('123#ab

Re: Make upof Computer

2009-06-14 Thread Mike Kazantsev
On Sun, 14 Jun 2009 00:46:16 -0700 (PDT) "Mr . Waqar Akbar" wrote: ... Judging by the typo in the last subject, someone indeed types all this crap in manually! Oh my god... -- Mike Kazantsev // fraggod.net signature.asc Description: PGP signature -- http://mail.python.org/mailman/listinfo/p

Re: Make-up of computer

2009-06-14 Thread Ben Finney
"Mr . Waqar Akbar" writes: > A computer is a collection of modular electronic components, i.e. > components that can be replaced by other components that may have > different characteristics that are capable of running computer > programs. And also storing and manipulating all sorts of other dig

ANN: pyTenjin 0.8.1 - much faster template engine than Django

2009-06-14 Thread kwatch
I released pyTenjin 0.8.1. http://www.kuwata-lab.com/tenjin/ http://pypi.python.org/pypi/Tenjin/ pyTenjin is the fastest template engine for Python. * Very fast (about 10 times faster than Django template engine) * Easy to learn (no need to learn template-original language) * Full-featured (layou

Re: Good books in computer science?

2009-06-14 Thread Lawrence D'Oliveiro
In message , koranthala wrote: > I do have Mythical Man-Month - a great book indeed. > I was looking for more technical books ... No-one has mentioned Andrew Tanenbaum's "Computer Networks". So much of programming seems to involve networking these days, I think the current (4th) edition is a gr

Re: Measuring Fractal Dimension ?

2009-06-14 Thread Lawrence D'Oliveiro
In message , Peter Billam wrote: > Are there any modules, packages, whatever, that will > measure the fractal dimensions of a dataset, e.g. a time-series ? I don't think any countable set, even a countably-infinite set, can have a fractal dimension. It's got to be uncountably infinite, and there

Re: random number including 1 - i.e. [0,1]

2009-06-14 Thread Lawrence D'Oliveiro
In message , Jussi Piitulainen wrote: > Miles Kaufmann writes: > >> I'm curious what algorithm calls for random numbers on a closed >> interval. > > The Box-Muller transform, polar form. At least Wikipedia says so. Doesn't seem to be necessary, if I interpret the following correctly

Re: random number including 1 - i.e. [0,1]

2009-06-14 Thread Lawrence D'Oliveiro
In message , Esmail wrote: > I'm implementing a Particle Swarm Optimizer. Depending on what paper you > read you'll see mention of required random values "between 0 and 1" > which is somewhat ambiguous. I came across one paper that specified > the range [0,1], so inclusive 1, which was the reason

Re: random number including 1 - i.e. [0,1]

2009-06-14 Thread Lawrence D'Oliveiro
In message , Esmail wrote: > Here is part of the specification of an algorithm I'm implementing that > shows the reason for my original query: > > vid = w * vid + c1 * rand( ) * ( pid – xid ) + c2 * Rand( ) * (pgd –xid ) (1a) > > xid = xid + vid (1b) Are the terms meant to be clamped to a parti

Re: TypeError: int argument required

2009-06-14 Thread Lawrence D'Oliveiro
In message , Rhodri James wrote: > 2. That output string has severe "leaning toothpick" syndrome. Python > accepts both single and double quotes to help avoid creating something > so unreadable: use them. Backslashes are more scalable. -- http://mail.python.org/mailman/listinfo/python-list

Re: error: an integer is required

2009-06-14 Thread jeni
On 8 Ιούν, 21:46, Terry Reedy wrote: > madigre...@yahoo.gr wrote: > > I execute my code in linux environment. > > My code is: > > > from os import * > > > def insert_text_file(self, strng): > >      t=open("elements_file.txt", "a") > >      t.write(strng) > >      t.close() > > > I'm getting this

Different types of dicts with letter before the curly braces.

2009-06-14 Thread kindly
I am sure people have thought of this before, but I cant find where. I think that python should adapt a way of defining different types of mapping functions by proceeding a letter before the curly brackets. i.e ordered = o{}, multidict = m{} (like paste multidict). So you could define an order

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread Mike Kazantsev
On Sun, 14 Jun 2009 04:02:47 -0700 (PDT) kindly wrote: > Am I crazy to think this is a good idea? I have not looked deeply > pythons grammer to see if it conflicts with anything, but on the > surface it looks fine. I'd say "on the surface it looks like perl" ;) I'd prefer to use dict() to decla

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread kindly
On Jun 14, 12:25 pm, Mike Kazantsev wrote: > On Sun, 14 Jun 2009 04:02:47 -0700 (PDT) > > kindly wrote: > > Am I crazy to think this is a good idea?  I have not looked deeply > > pythons grammer to see if it conflicts with anything, but on the > > surface it looks fine. > > I'd say "on the surfac

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread Stefan Behnel
Hi, this kind of stuff is commonly discussed on the python-ideas mailing list. You might want to search that list and/or repost this over there. Stefan kindly wrote: > I am sure people have thought of this before, but I cant find where. > I think that python should adapt a way of defining differ

Re: Good books in computer science?

2009-06-14 Thread Roy Smith
In article <7x4ouj7dc5@ruckus.brouhaha.com>, Paul Rubin wrote: > Roy Smith writes: > > In the same vein, Death March, by Ed Yourdon. > > I've been wanting to read "Antipatterns". I didn't think that was so great. It had a lot of hype, which lead to be belie

Re: Off-topic: Usenet archiving history

2009-06-14 Thread David Bolen
Ben Finney writes: > David Bolen writes: > >> Individual messages could include an Expires: header if they wished, > > Since we're already well off-topic: NNTP, HTTP, and email, and probably > other protocols as well, all deal with messages. They are all consistent > in defining a message [0] as

Re: Measuring Fractal Dimension ?

2009-06-14 Thread Arnaud Delobelle
Lawrence D'Oliveiro writes: > In message , Peter Billam wrote: > >> Are there any modules, packages, whatever, that will >> measure the fractal dimensions of a dataset, e.g. a time-series ? > > I don't think any countable set, even a countably-infinite set, can have a > fractal dimension. It's g

Re: Measuring Fractal Dimension ?

2009-06-14 Thread Paul Rubin
Arnaud Delobelle writes: > I think there are attempts to estimate the fractal dimension of a set > using a finite sample from this set. But I can't remember where I got > this thought from! There are image data compression schemes that work like that, trying to detect self-similarity in the data

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread Mike Kazantsev
On Sun, 14 Jun 2009 04:36:17 -0700 (PDT) kindly wrote: > Python already has it for strings r"foo" or u"bar". So I do not think > its going against the grain. Yes, and there's other syntactic sugar like ";" (barely used), mentioned string types, "(element,)", "%s"%var or curly braces themselve

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread Steven D'Aprano
Stefan Behnel wrote: > Hi, > > this kind of stuff is commonly discussed on the python-ideas mailing list. > You might want to search that list and/or repost this over there. Please don't top-post here. If the OP takes this idea to python-ideas, chances are he'll be told to take the concept here

Re: Perl's @foo[3,7,1,-1] ?

2009-06-14 Thread Steven D'Aprano
kj wrote: > OK, I see: if Python allowed foo[3,7,1,-1], then foo[3] would be > ambiguous: does it mean the fourth element of foo, or the tuple > consisting of this element alone? I suppose that's good enough > reason to veto this idea... There's nothing ambiguous about it. obj.__getitem__(x) alr

Re: Good books in computer science?

2009-06-14 Thread Steven D'Aprano
Nathan Stoddard wrote: > The best way to become a good programmer is to program. Write a lot of > code; work on some large projects. This will improve your skill more than > anything else. I think there are about 100 million VB code-monkeys who prove that theory wrong. Seriously, and without den

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread Colin J. Williams
Stefan Behnel wrote: Hi, this kind of stuff is commonly discussed on the python-ideas mailing list. You might want to search that list and/or repost this over there. Stefan kindly wrote: I am sure people have thought of this before, but I cant find where. I think that python should adapt a wa

Re: Good books in computer science?

2009-06-14 Thread Graham Ashton
On 2009-06-14 03:34:34 +0100, Paul Rubin said: Roy Smith writes: In the same vein, Death March, by Ed Yourdon. I've been wanting to read "Antipatterns". I bought it but couldn't get into it. Light on meat, heavy on boredom (for me - these things are always s

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread Diez B. Roggisch
The analogy with raw strings is faulty: r"" changes the way the compiler interprets the characters between the quotes, it doesn't create a different type of object. But u"" does, as does the new bytestring-literal in Python3. So there is precedent. Diez -- http://mail.python.org/mailman/listi

Re: Good books in computer science?

2009-06-14 Thread Graham Ashton
On 2009-06-14 14:04:02 +0100, Steven D'Aprano said: Nathan Stoddard wrote: The best way to become a good programmer is to program. Write a lot of code; work on some large projects. This will improve your skill more than anything else. I think there are about 100 million VB code-monkeys who

Re: Question about None

2009-06-14 Thread Steven D'Aprano
John Yeung wrote: > Paul LaFollette is probably thinking along the lines of formal logic > or set theory. It's a little bit confused because programming isn't > quite the same as math, and so it's a common question when designing > and implementing programming languages how far to take certain >

Re: Good books in computer science?

2009-06-14 Thread Christof Donat
Hi, > Which are the classic books in computer science which one should > peruse? >From having read this discussion up to now I'd recomend you to read code written by good programmers. Christof -- http://mail.python.org/mailman/listinfo/python-list

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread Aaron Brady
On Jun 14, 4:02 am, kindly wrote: > I am sure people have thought of this before, but I cant find where. > I think that python should adapt a way of defining different types of > mapping functions by proceeding a letter before the curly brackets. > i.e   ordered = o{},  multidict = m{}  (like past

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread kindly
On Jun 14, 1:59 pm, Steven D'Aprano wrote: > Stefan Behnel wrote: > > Hi, > > > this kind of stuff is commonly discussed on the python-ideas mailing list. > > You might want to search that list and/or repost this over there. > > Please don't top-post here. > > If the OP takes this idea to python-i

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread Aaron Brady
On Jun 14, 6:30 am, kindly wrote: > On Jun 14, 1:59 pm, Steven D'Aprano snip > I am glad the ordered dict will be in 2.7 and 3.1. I > was just imagining what would be the next step in definition of > structures. New languages like clojure have adopted the dict as top > level.  I imagine immutable/

Re: Measuring Fractal Dimension ?

2009-06-14 Thread Steven D'Aprano
Lawrence D'Oliveiro wrote: > In message , Peter Billam wrote: > >> Are there any modules, packages, whatever, that will >> measure the fractal dimensions of a dataset, e.g. a time-series ? > > I don't think any countable set, even a countably-infinite set, can have a > fractal dimension. It's go

Re: Question about None

2009-06-14 Thread Scott David Daniels
Steven D'Aprano wrote: ... or {1}∩0. (If that character between the set and zero ends up missing, it's meant to be INTERSECTION u'\u2229'.) Note that you can write this in a quite readable way in ASCII: "it's meant to be the character u'\N{INTERSECTION}'." --Scott David Daniels scott.dani..

persistent composites

2009-06-14 Thread Aaron Brady
Hi, please forgive the multi-posting on this general topic. Some time ago, I recommended a pursuit of keeping 'persistent composite' types on disk, to be read and updated at other times by other processes. Databases provide this functionality, with the exception that field types in any given tabl

Re: Question about None

2009-06-14 Thread Mel
John Yeung wrote: > And I accept your answer, as well as Steven's and Paul's for that > matter. I still think it is understandable (and people may choose to > understand in a condescending way, if they wish) that someone might > not get the difference between what you are saying and the statement

Re: persistent composites

2009-06-14 Thread kindly
On Jun 14, 3:27 pm, Aaron Brady wrote: > Hi, please forgive the multi-posting on this general topic. > > Some time ago, I recommended a pursuit of keeping 'persistent > composite' types on disk, to be read and updated at other times by > other processes.  Databases provide this functionality, with

Re: Good books in computer science?

2009-06-14 Thread rustom
On Jun 14, 6:04 pm, Steven D'Aprano wrote: > I think there are about 100 million VB code-monkeys who prove that theory > wrong. > > Seriously, and without denigrating any specific language, you can program by > (almost) mindlessly following a fixed number of recipes and patterns. This > will get

Re: Good books in computer science?

2009-06-14 Thread Steven D'Aprano
Graham Ashton wrote: > On 2009-06-14 14:04:02 +0100, Steven D'Aprano > said: > >> Nathan Stoddard wrote: >> >>> The best way to become a good programmer is to program. Write a lot of >>> code; work on some large projects. This will improve your skill more >>> than anything else. >> >> I think

Re: persistent composites

2009-06-14 Thread Steven D'Aprano
Aaron Brady wrote: > Some time ago, I recommended a pursuit of keeping 'persistent > composite' types on disk, to be read and updated at other times by > other processes. Databases provide this functionality, with the > exception that field types in any given table are required to be > uniform.

Re: Question about None

2009-06-14 Thread Piet van Oostrum
> John Yeung (JY) wrote: >JY> I've never heard a mathematician use the term "bottom". It certainly >JY> could be that I just haven't talked to the right types of >JY> mathematicians. "Bottom" is a term from lattice theory, which is a branch of mathematics. -- Piet van Oostrum URL: http:

shoehorn c-structured data into Numpy

2009-06-14 Thread Helmut Fritz
Hello there everyone, I used to be on this a long time ago but then I got so much spam I gave up. But this strategy has come a little unstuck. I have binary output from a Fortran program that is in a big-endian C-structured binary file. The output can be very variable and many options create dif

Re: Question about None

2009-06-14 Thread Andre Engels
On Sat, Jun 13, 2009 at 7:23 PM, John Yeung wrote: > Paul LaFollette is probably thinking along the lines of formal logic > or set theory.  It's a little bit confused because programming isn't > quite the same as math, and so it's a common question when designing > and implementing programming lan

Re: Generating a unique filename in the face of unicode filename

2009-06-14 Thread Martin v. Löwis
> where line 175 is the assignment to self.unique_name. After a little > back-and-forth with his user it turns out that her computer's hostname > contains non-ASCII data, so presumably self.hostname is a unicode object. Most likely, it is not. It's rather the hostname encoded in the ANSI code pag

waling a directory with very many files

2009-06-14 Thread tom
i can traverse a directory using os.listdir() or os.walk(). but if a directory has a very large number of files, these methods produce very large objects talking a lot of memory. in other languages one can avoid generating such an object by walking a directory as a liked list. for example, in c, p

Re: persistent composites

2009-06-14 Thread Aaron Brady
On Jun 14, 8:24 am, Steven D'Aprano wrote: > Aaron Brady wrote: > > Some time ago, I recommended a pursuit of keeping 'persistent > > composite' types on disk, to be read and updated at other times by > > other processes.  Databases provide this functionality, with the > > exception that field typ

Re: Question about None

2009-06-14 Thread Paul LaFollette
Thank you all for your thoughtful and useful comments. Since this has largely morphed into a discussion of my 3rd question, perhaps it would interest you to hear my reason for asking it. John is just about spot on. Part of my research involves the enumeration and generation of various combinatori

Re: Question about None

2009-06-14 Thread Arnaud Delobelle
Steven D'Aprano writes: > So-called "vacuous truth". It's often useful to have all([]) return true, > but it's not *always* useful -- there are reasonable cases where the > opposite behaviour would be useful: > > if all(the evidence points to the Defendant's guilt) then: > the Defendant is gui

Re: shoehorn c-structured data into Numpy

2009-06-14 Thread MRAB
Helmut Fritz wrote: Hello there everyone, I used to be on this a long time ago but then I got so much spam I gave up. But this strategy has come a little unstuck. I have binary output from a Fortran program that is in a big-endian C-structured binary file. The output can be very variable

Re: persistent composites

2009-06-14 Thread Jaime Fernandez del Rio
On Sun, Jun 14, 2009 at 4:27 PM, Aaron Brady wrote: > > Before I go and flesh out the entire interfaces for the provided > types, does anyone have a use for it? A real-world application of persistent data structures can be found here: http://stevekrenzel.com/persistent-list Jaime -- (\__/) ( O

Re: Question about None

2009-06-14 Thread Andre Engels
On Sun, Jun 14, 2009 at 6:49 PM, Paul LaFollette wrote: > Now, suppose that I want to generate, say, the set of all ordered > trees with N nodes.   I need to be able to represent the empty ordered > tree, i.e. the tree with with zero nodes.  There are a lot of ways I > could do this.  The problem i

Re: waling a directory with very many files

2009-06-14 Thread Tim Golden
tom wrote: i can traverse a directory using os.listdir() or os.walk(). but if a directory has a very large number of files, these methods produce very large objects talking a lot of memory. in other languages one can avoid generating such an object by walking a directory as a liked list. for exa

Re: Question about None

2009-06-14 Thread MRAB
Andre Engels wrote: On Sun, Jun 14, 2009 at 6:49 PM, Paul LaFollette wrote: Now, suppose that I want to generate, say, the set of all ordered trees with N nodes. I need to be able to represent the empty ordered tree, i.e. the tree with with zero nodes. There are a lot of ways I could do this.

Re: waling a directory with very many files

2009-06-14 Thread tom
On Jun 14, 1:35 pm, Tim Golden wrote: > > If you're on Windows, you can use the win32file.FindFilesIterator > function from the pywin32 package. (Which wraps the Win32 API > FindFirstFile / FindNextFile pattern). thanks, tim. however, i'm not using windows. freebsd and os x. -- http://mail.pyth

Re: Question about None

2009-06-14 Thread Aaron Brady
On Jun 14, 10:02 am, Arnaud Delobelle wrote: snip > guilt, it doesn't mean they will be convicted.  There needs to be enough > evidence to convince the jury.  So it would be something like: > > if sum(guilt_weight(e) for e in evidence) > GUILT_THRESHOLD: >    the defendant is guilty >    ... > > -

weakrefs, threads,, and object ids

2009-06-14 Thread Jeremy
Hello, I'm using weakrefs in a small multi-threaded application. I have been using object IDs as dictionary keys with weakrefs to execute removal code, and was glad to find out that this is in fact recommended practice (http://docs.python.org/library/weakref.html) > This simple example shows how

Re: Good books in computer science?

2009-06-14 Thread Benjamin Kaplan
On Sun, Jun 14, 2009 at 9:04 AM, Steven D'Aprano < st...@removethis.cybersource.com.au> wrote: > Nathan Stoddard wrote: > > > The best way to become a good programmer is to program. Write a lot of > > code; work on some large projects. This will improve your skill more than > > anything else. > >

Re: Question about None

2009-06-14 Thread Paul Rubin
Andre Engels writes: > I don't see why that would be the case. Something of the type "thingy" > is ONE thingy. Nothing is ZERO thingies, so it is not something of the > type "thingy". A car is a single car. Nothing is zero cars, which is > not a car, just like two cars is not a car. That seems to

Re: waling a directory with very many files

2009-06-14 Thread Tim Golden
tom wrote: On Jun 14, 1:35 pm, Tim Golden wrote: If you're on Windows, you can use the win32file.FindFilesIterator function from the pywin32 package. (Which wraps the Win32 API FindFirstFile / FindNextFile pattern). thanks, tim. however, i'm not using windows. freebsd and os x. Presumably,

Re: Question about None

2009-06-14 Thread Andre Engels
On Sun, Jun 14, 2009 at 9:37 PM, Paul Rubin wrote: > Andre Engels writes: >> I don't see why that would be the case. Something of the type "thingy" >> is ONE thingy. Nothing is ZERO thingies, so it is not something of the >> type "thingy". A car is a single car. Nothi

Re: Good books in computer science?

2009-06-14 Thread Chris Jones
On Sun, Jun 14, 2009 at 09:04:02AM EDT, Steven D'Aprano wrote: > Nathan Stoddard wrote: > > > The best way to become a good programmer is to program. Write a lot of > > code; work on some large projects. This will improve your skill more than > > anything else. > > I think there are about 100 mil

Re: Question about None

2009-06-14 Thread Paul Rubin
Andre Engels writes: > > That seems to confuse values with collections of them.  A car is not > > the same as a one-element list of cars.  Nothing is not the same as a > > zero-element list of cars. > > So you are of the opinion that "nothing" _is_ a car? Eh? No of course not. a != b and b !

Re: shoehorn c-structured data into Numpy

2009-06-14 Thread Scott David Daniels
MRAB wrote: Helmut Fritz wrote: I have binary output from a Fortran program that is in a big-endian C-structured binary file. The output can be very variable and many options create different orderings in the binary file. So I'd like to keep the header-reading in python. Anyhoo, I've so fa

Re: Question about None

2009-06-14 Thread Andre Engels
On Sun, Jun 14, 2009 at 10:21 PM, Paul Rubin wrote: > Andre Engels writes: >> > That seems to confuse values with collections of them.  A car is not >> > the same as a one-element list of cars.  Nothing is not the same as a >> > zero-element list of cars. >> >> So y

Re: waling a directory with very many files

2009-06-14 Thread Andre Engels
On Sun, Jun 14, 2009 at 6:35 PM, tom wrote: > i can traverse a directory using os.listdir() or os.walk(). but if a > directory has a very large number of files, these methods produce very > large objects talking a lot of memory. > > in other languages one can avoid generating such an object by walk

Re: Good books in computer science?

2009-06-14 Thread dads
I'm wanting to purchase some of the titles that have been raised in this thread. When I look they are very expensive books which is understandable. Do you think getting earlier editions that are cheaper is a daft thing or should I fork out the extra £10-£30 to get the latest edition? -- http://ma

Re: Question about None

2009-06-14 Thread Paul Rubin
Andre Engels writes: > I was making a point that I don't agree that "nothing" would match any > type. The reason was that anything of the type car is one car, not two > cars or zero cars, but "nothing" is zero cars. You don't agree with > me, so apparently you are of the opinion that "nothing" wou

Re: Measuring Fractal Dimension ?

2009-06-14 Thread Kay Schluehr
On 14 Jun., 16:00, Steven D'Aprano wrote: > Incorrect. Koch's snowflake, for example, has a fractal dimension of log > 4/log 3 ≈ 1.26, a finite area of 8/5 times that of the initial triangle, > and a perimeter given by lim n->inf (4/3)**n. Although the perimeter is > infinite, it is countably inf

python-2.6.2 Exception: TypeError: "'NoneType' object is not callable" in ignored

2009-06-14 Thread Poor Yorick
The following code produces an error (python-2.6.2). Either of the following eliminates the error: . assign something besides mod1 (the newly-created module) to d1 . remove the call to shelve.open Why is there an error produced in the first place? What is the interaction between d1, m

Re: Different types of dicts with letter before the curly braces.

2009-06-14 Thread Rhodri James
On Sun, 14 Jun 2009 12:02:47 +0100, kindly wrote: I am sure people have thought of this before, but I cant find where. I think that python should adapt a way of defining different types of mapping functions by proceeding a letter before the curly brackets. i.e ordered = o{}, multidict = m{}

Re: Good books in computer science?

2009-06-14 Thread Rhodri James
On Sun, 14 Jun 2009 14:19:13 +0100, Graham Ashton wrote: On 2009-06-14 14:04:02 +0100, Steven D'Aprano said: Nathan Stoddard wrote: The best way to become a good programmer is to program. Write a lot of code; work on some large projects. This will improve your skill more than anythi

Re: Good books in computer science?

2009-06-14 Thread Lawrence D'Oliveiro
In message <0050ecf7$0$9684$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: > Graham Ashton wrote: > >> On 2009-06-14 14:04:02 +0100, Steven D'Aprano >> said: >> >>> Nathan Stoddard wrote: >>> The best way to become a good programmer is to program. Write a lot of code; work on so

Re: Good books in computer science?

2009-06-14 Thread MRAB
Rhodri James wrote: On Sun, 14 Jun 2009 14:19:13 +0100, Graham Ashton wrote: On 2009-06-14 14:04:02 +0100, Steven D'Aprano said: Nathan Stoddard wrote: The best way to become a good programmer is to program. Write a lot of code; work on some large projects. This will improve your skill

Re: TypeError: int argument required

2009-06-14 Thread Rhodri James
On Sun, 14 Jun 2009 10:43:30 +0100, Lawrence D'Oliveiro wrote: In message , Rhodri James wrote: 2. That output string has severe "leaning toothpick" syndrome. Python accepts both single and double quotes to help avoid creating something so unreadable: use them. Backslashes are more scal

Re: Measuring Fractal Dimension ?

2009-06-14 Thread Peter Billam
>> In message , Peter Billam wrote: >>> Are there any modules, packages, whatever, that will >>> measure the fractal dimensions of a dataset, e.g. a time-series ? > Lawrence D'Oliveiro wrote: >> I don't think any countable set, even a countably-infinite set, can >> have a fractal dimension. It's

Re: Question about None

2009-06-14 Thread Terry Reedy
Steven D'Aprano wrote: So-called "vacuous truth". It's often useful to have all([]) return true, but it's not *always* useful -- there are reasonable cases where the opposite behaviour would be useful: if all(the evidence points to the Defendant's guilt) then: the Defendant is guilty execute(th

Re: Question about None

2009-06-14 Thread Terry Reedy
Mel wrote: John Yeung wrote: And I accept your answer, as well as Steven's and Paul's for that matter. I still think it is understandable (and people may choose to understand in a condescending way, if they wish) that someone might not get the difference between what you are saying and the sta

Re: Question about None

2009-06-14 Thread Terry Reedy
Paul LaFollette wrote: Thank you all for your thoughtful and useful comments. Since this has largely morphed into a discussion of my 3rd question, perhaps it would interest you to hear my reason for asking it. John is just about spot on. Part of my research involves the enumeration and generati

Re: waling a directory with very many files

2009-06-14 Thread Christian Heimes
tom schrieb: > i can traverse a directory using os.listdir() or os.walk(). but if a > directory has a very large number of files, these methods produce very > large objects talking a lot of memory. > > in other languages one can avoid generating such an object by walking > a directory as a liked l

Re: waling a directory with very many files

2009-06-14 Thread Terry Reedy
tom wrote: i can traverse a directory using os.listdir() or os.walk(). but if a directory has a very large number of files, these methods produce very large objects talking a lot of memory. in other languages one can avoid generating such an object by walking a directory as a liked list. for exa

Re: python-2.6.2 Exception: TypeError: "'NoneType' object is not callable" in ignored

2009-06-14 Thread John Machin
Poor Yorick pooryorick.com> writes: > > The following code produces an error (python-2.6.2). Either of the following > eliminates the error: > > . assign something besides mod1 (the newly-created module) to d1 > > . remove the call to shelve.open [snip] > > $ python2.6 test1.p

Re: python-2.6.2 Exception: TypeError: "'NoneType' object is not callable" in ignored

2009-06-14 Thread Terry Reedy
Poor Yorick wrote: The following code produces an error (python-2.6.2). You forgot to post the error traceback. -- http://mail.python.org/mailman/listinfo/python-list

Re: waling a directory with very many files

2009-06-14 Thread Christian Heimes
Andre Engels wrote: > What kind of directories are those that just a list of files would > result in a "very large" object? I don't think I have ever seen > directories with more than a few thousand files... I've seen directories with several hundreds of thousand files. Depending on the file syste

Re: waling a directory with very many files

2009-06-14 Thread MRAB
Christian Heimes wrote: tom schrieb: i can traverse a directory using os.listdir() or os.walk(). but if a directory has a very large number of files, these methods produce very large objects talking a lot of memory. in other languages one can avoid generating such an object by walking a directo

Re: waling a directory with very many files

2009-06-14 Thread Christian Heimes
Terry Reedy wrote: > You did not specify version. In Python3, os.walk has become a generater > function. So, to answer your question, use 3.1. I'm sorry to inform you that Python 3.x still returns a list, not a generator. ython 3.1rc1+ (py3k:73396, Jun 12 2009, 22:45:18) [GCC 4.3.3] on linux2

Re: TypeError: int argument required

2009-06-14 Thread Lawrence D'Oliveiro
In message , Rhodri James wrote: > On Sun, 14 Jun 2009 10:43:30 +0100, Lawrence D'Oliveiro > wrote: > >> In message , Rhodri >> James wrote: >> >>> 2. That output string has severe "leaning toothpick" syndrome. Python >>> accepts both single and double quotes to help avoid creating something

Re: walking a directory with very many files

2009-06-14 Thread Lawrence D'Oliveiro
In message , Andre Engels wrote: > On Sun, Jun 14, 2009 at 6:35 PM, tom wrote: > >> in other languages one can avoid generating such an object by walking >> a directory as a liked list. I suppose it depends how well-liked it is. Nerdy lists may work better, but they tend not to be liked. > Wha

Re: Question about None

2009-06-14 Thread Aaron Brady
On Jun 14, 12:37 pm, Paul Rubin wrote: > Andre Engels writes: snip > > type "thingy". A car is a single car. Nothing is zero cars, which is > > not a car, just like two cars is not a car. > > That seems to confuse values with collections of them.  A car is not > the

Re: python-2.6.2 Exception: TypeError: "'NoneType' object is not callable" in ignored

2009-06-14 Thread Dave Angel
Poor Yorick wrote: The following code produces an error (python-2.6.2). Either of the following eliminates the error: . assign something besides mod1 (the newly-created module) to d1 . remove the call to shelve.open Why is there an error produced in the first place? What is the int

Re: waling a directory with very many files

2009-06-14 Thread Tim Chase
i can traverse a directory using os.listdir() or os.walk(). but if a directory has a very large number of files, these methods produce very large objects talking a lot of memory. in other languages one can avoid generating such an object by walking a directory as a liked list. for example, in c,

Re: python-2.6.2 Exception: TypeError: "'NoneType' object is not callable" in ignored

2009-06-14 Thread Poor Yorick
Terry Reedy wrote: > Poor Yorick wrote: >> The following code produces an error (python-2.6.2). > > You forgot to post the error traceback. > There was no traceback, but following John Machin's prodding, I read back through some older posts (including one of yours) which I hadn't guessed were rel

Re: uncompress base64-gzipped string

2009-06-14 Thread Lawrence D'Oliveiro
In message , John Machin wrote: > What a long journey: parse xml, base64 decode, gunzip, > and you're still not home; next stop is struct.unpack ... Binary data in an XML file?? Were these the same folks who worked on OOXML, by any chance? -- http://mail.python.org/mailman/listinfo/python-lis

Re: matplotlib installation

2009-06-14 Thread Lawrence D'Oliveiro
In message , David Cournapeau wrote: > Basically, there are some functions which are erroneously "declared" > in the .lib, but they don't actually exist in the MS C runtime. Isn't this a MinGW bug? -- http://mail.python.org/mailman/listinfo/python-list

Cisco certification

2009-06-14 Thread Asim Saeed
if you wnat to know about cisco certification it books and dump http://ciscocity.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

RE: Good books in computer science?

2009-06-14 Thread Phil Runciman
>Rhodri James wrote: >> On Sun, 14 Jun 2009 14:19:13 +0100, Graham Ashton >> wrote: >> >>> On 2009-06-14 14:04:02 +0100, Steven D'Aprano >>> said: >>> Nathan Stoddard wrote: > The best way to become a good programmer is to program. Write a lot of > code; work on some large p

Re: Good books in computer science?

2009-06-14 Thread Steven D'Aprano
On Mon, 15 Jun 2009 10:39:50 +1200, Lawrence D'Oliveiro wrote: >> Shame on you for deliberately cutting out my more serious and nuanced >> answer while leaving a silly quip. > > Can't have been very "serious and nuanced" if it could be summed up by > such a "silly quip" though, could it? But it

Re: Specify the sorting direction for the various columns/

2009-06-14 Thread Oni
Thanks for the answers. My goal was to try to avoid hard coding and add a little shine to the code I have inherited. But its too far gone already and time is short. So have used Mike's answer. Mike answer with minor changes: import datetime import pprint import operator import time entries = [{

  1   2   >