Re: subprocess and & (ampersand)

2008-02-01 Thread Albert van der Horst
dows 3.1., I suggest you stay away from .bat files. Better call them .cmd, such that they are executed by cmd.exe (32 bits). It could be part of your problem. > >TJG Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- like all pyramid schemes -- ultim

Re: Sorting Large File (Code/Performance)

2008-02-02 Thread Albert van der Horst
do with it after it's sorted? >I need to isolate all lines that start with two characters (zz to be >particular) Like in? grep '^zz' longfile > aapje You will have a hard time to beat that with python, in every respect. > >Cheers, > >Ira Groetjes Albert -

Re: Sorting Large File (Code/Performance)

2008-02-02 Thread Albert van der Horst
. http://home.hccnet.nl/a.w.m.van.der.horst/ssort.html This is a plain executable, so no hassles and no trial. It is GPL, so you can even hack the source, if you fancy C++. There are a lot of Unix compatible toolkit present for Windows nowadays. Install one, you can spare a dozen Mbytes, ca

Re: too long float

2008-02-02 Thread Albert van der Horst
>-- >"PLEASE DO *NOT* EDIT or poldek will hate you." - packages.dir (PLD) >http://candajon.azorragarse.info/ http://azorragarse.candajon.info/ -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- like all pyramid schemes -- ultimately falters. [EMAIL PROTECTED]&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: Linux Journal Survey

2008-02-02 Thread Albert van der Horst
a /.../bin/ directory. A scripting language is a language whose programs are normally distributed in human-readable form. It is appropriate to call such a program a script. If the first two characters is "#!" and the execution bit is set, it is a script in the linux sense. So as far as

Re: translating Python to Assembler

2008-02-03 Thread Albert van der Horst
architectures. So you are disassembling using an Intel disassembler? How can that make sense if you are on a SUN work station with a non-Intel processor? Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- like all pyramid schemes -- ultimately falters. [E

Re: When is min(a, b) != min(b, a)?

2008-02-04 Thread Albert van der Horst
result, is insane. The Nan is forever gone, something not allowed by IEEE only in code that [A case can be made however that min and max just propagate a Nan and don't throw an exception, yet. ] So python should throw. That is practicality *and* purity. >-- >Steven Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- like all pyramid schemes -- ultimately falters. [EMAIL PROTECTED]&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: programming by evolution?

2009-02-19 Thread Albert van der Horst
l the way down. It looks impressive especially from where I stand. ( Formal procedures that take 6 months, and bad fixes because approved changes were no good after all.) So not dead by a margin, and less snake oil than most methodologies I know of. > Xah Groetjes Albert -- -- Albert van

Re: Representing a Tree in Python

2009-05-23 Thread Albert van der Horst
ack links if that has to be done with decent efficiency. The back links can be added as part of the algorithm. > >Thanks once again. Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- like all pyramid schemes -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding a Par construct to Python?

2009-05-27 Thread Albert van der Horst
t;And how is reduce() supposed to know whether or not some arbitrary >function is commutative? Why would it or need it? A Python that understands the ``par'' keyword is supposed to know it can play some tricks with optimizing reduce() if the specific function is commutative. >-- >

Re: What text editor is everyone using for Python

2009-06-01 Thread Albert van der Horst
dentally stumble upon the sequence for "save >file". Exactly. An indication of how one can see one is in emacs is also appreciated. [Especially insidious is helpful help that lands you in emacs-ing help file for powerful searching (not!).] Groetjes Albert -- -- Albert van der Horst

Re: What text editor is everyone using for Python

2009-06-01 Thread Albert van der Horst
er) on a FAT stick. (As they say: "Speak softly, and carry a large stick.") Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- like all pyramid schemes -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: hash and __eq__

2009-06-04 Thread Albert van der Horst
O(Nlog(N)) if the O(N^2) behaviour of qsort is your worry. >-- >Steven Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- like all pyramid schemes -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: What text editor is everyone using for Python

2009-06-04 Thread Albert van der Horst
the word "Quit" in what seems to be some sort of >> status bar? > >Ahhh.. memories of discovering that F7 gets you out of WordPerfect... Memories of Atari 260/520/1040 that had a keyboard with a key actually marked ... HELP. (Sometimes hitting it provided you with help...)

Re: semantics of ** (unexpected/inconsistent?)

2009-12-07 Thread Albert van der Horst
to get a somewhat surprising result. Unary operators -- as long as they are always put up front -- need not have a precedence among themselves, so with this rule they don't need a precedence full stop. ) >Ben Finney Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economi

Re: How to create a docstring for a module?

2009-12-18 Thread Albert van der Horst
you summarize. (Kind of what Ubuntu does: hack?, I have no "hack" but such command could be installed from BSD classical games. ) Groetjes Albert. -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: Dangerous behavior of list(generator)

2009-12-19 Thread Albert van der Horst
situation. >-- >Gabriel Genellina > Groetjes Albert. -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: switch

2009-12-21 Thread Albert van der Horst
I will not promote this style of programming as the ultimate alternative for everything. (And it breaks down at a point, sure.) Bottom line: "Give to the Caesar what belongs to the Caesar..." Not adding a switch to python is a matter of taste, good taste as far as I'm concerned. Addi

Re: which pi formula is given in the decimal module documentation?

2009-12-21 Thread Albert van der Horst
wasn't enough to show off the 5th order convergence. ) >-- >Mark Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: which pi formula is given in the decimal module documentation?

2009-12-21 Thread Albert van der Horst
In article , Albert van der Horst wrote: >In article , >Mark Dickinson wrote: >>On Dec 11, 10:30=A0am, Mark Dickinson wrote: >>> > It looks like an infinite series with term `t`, where`n` =3D (2k-1)^2 >>> > and `d` =3D d =3D 4k(4k+2) for k =3D 1... Does

Re: which pi formula is given in the decimal module documentation?

2009-12-22 Thread Albert van der Horst
In article <00b967e1$0$15623$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: >Nice work! But I have a question... > >On Mon, 21 Dec 2009 20:40:40 +0000, Albert van der Horst wrote: > >> def pi4(): >> ' Calculate pi by a 5th order proce

Re: More On the Strange Problem

2009-12-29 Thread Albert van der Horst
o probably they have different fingerprints. Groetjes Albert. -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: How to validate the __init__ parameters

2010-01-04 Thread Albert van der Horst
ny that you make this distinction. There is less of a distinction than you may think. Even while in embedded programming we anticipate as much as possible. there is also the watch dog timer, that resets the whole system for things unforeseen, hardware failures included. You bet space craft

Re: How to validate the __init__ parameters

2010-01-04 Thread Albert van der Horst
In article , Chris Rebert wrote: >On Mon, Jan 4, 2010 at 10:17 AM, Albert van der Horst > wrote: > >> This triggers a question: I can see the traceback, but it >> would be much more valuable, if I could see the arguments >> passed to the functions. Is there a too

dict's as dict's key.

2010-01-13 Thread Albert van der Horst
i.e. chess. Now we want to look up chess positions.) Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing a string.ishex function

2010-01-22 Thread Albert van der Horst
very wrong. Not with the above statement, but the very act of issuing a statement like that is wrong. The OP didn't specify ishex(). In absence of a specification, border cases are not defined. If the specification was: any character of string s must be a hex character then ishex(''

Re: Is python not good enough?

2010-01-25 Thread Albert van der Horst
compete with anything. It was their own itch they scratched. Then they opened it to the world, which I applaud. If Go was to compete with anything, they would have give it a name that was Googleable. ;-) >-- >Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.c

Re: A simple-to-use sound file writer

2010-01-25 Thread Albert van der Horst
rested in frequencies above audible (organ builders aren't), you need an infinity of squares to build a perfect sawtooth. But then you need an inifinity of sines to build a perfect square wave. > Mel. Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic gro

Re: easy question, how to double a variable

2009-10-02 Thread Albert van der Horst
In article , daggerdvm wrote: >you brain needs error checking! Whose brain? At least I know this: Your brain is beyond repair. Go for a brain transplant. Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters.

Re: Modifying Class Object

2010-02-22 Thread Albert van der Horst
sly substitute "assembler language address" for it. When someone says: "pointers are bad" what really meant is "manipulating assembler language addresses in a high level language is bad". (Everybody agrees, but sometimes you must use e.g. c as sort of assembler.)

Re: How to measure elapsed time under Windows?

2010-02-22 Thread Albert van der Horst
unts the (3 Ghz) clock cycles in a 64 bit timer. Subtract two samples and you're done. Is there a mechanism in Python to do something similar, embedded assembler or something? (This is not a general solution, but at least it would work on Windows, that is i86 only.) > >-- Paul -

Re: Bizarre arithmetic results

2010-02-22 Thread Albert van der Horst
does the literal version return the signed magnitude and the >variable version return a complex? > >Cheers, >Terrence > -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with floats and calculations

2010-02-28 Thread Albert van der Horst
than comparing > > a = b > >one uses > > abs(a - b) < epsilon > > Since Decimal() also has "infinite" series values (1.0/3.0), an >epsilon comparison may also be called for. Not may be. >-- > Wulfraed Den

Re: Writing an assembler in Python

2010-03-02 Thread Albert van der Horst
bly code? I have a pentium assembler in perl on my website below. (postit-fixup principle). You could borrow some idea's, if you can read perl. The main purpose is to have a very simple and straightforward assembler at the expense of ease of use. Groetjes Albert -- -- Albert van der Horst, U

Re: Docstrings considered too complicated

2010-03-02 Thread Albert van der Horst
lated the conventions established already at the time. No nothing clever, nothing conscious, just reinventing the wheel badly. Next time you tell me that the MSDOS "file" system was well thought out :-) > Mel. Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS

Re: Which mock library do you prefer?

2010-03-03 Thread Albert van der Horst
on an object with great effort, and expecting error detection where the errors cannot in fact occur etc. etc. Not that coming up with good use cases is easy, but at least they are naturally related to your objects. > >with regards, >Maxim Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: Docstrings considered too complicated

2010-03-11 Thread Albert van der Horst
manual for MSDOS 6.0 (1993) states the FCB stuff as "superseded" (not obsolete or obsolescent). It states: "A programmer should not use a superseded function except to maintain compatibility with versions of MS-DOS earlier than version 2.0." FCB did *not* support paths, bu

Re: My four-yorkshireprogrammers contribution

2010-03-11 Thread Albert van der Horst
of 9000 and 7400 series TTL logic chips! There was the 74 computer in Elektuur (now Elektor). That was a quite respectable computer, built (you guessed) from 74-series chips. How many were built, I don't know. > >-- >Greg Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NE

Re: Python dos2unix one liner

2010-03-12 Thread Albert van der Horst
itten in C. Although Forthers thought it was straightforward comprehensible code, it was a winner in the iocc. > >-- >mph Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about typing: ints/floats

2010-03-13 Thread Albert van der Horst
is a flot or >> you explicitly cast your expression to be a double, then the value >> will be a fraction. otherwise you will the quotient. > >int + int gives int >float + float gives float >int + float gives float You skip a step here that the OP may have missed. a = 1 a += 1.222 This invokes the calculation 1 + 1.222 which is int + float. Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: Reverse engineering CRC?

2010-03-13 Thread Albert van der Horst
u can have an indication, if the intention is to detect machine errors (transmission or disk errors) or they want you to prevent tampering with the file. In the latter case it may be a one-way hash. Then it is near impossible, as this is the design criterion for a one-way hash. >-- >Greg G

Re: subtraction is giving me a syntax error

2010-03-22 Thread Albert van der Horst
this issue. Any ideas? Make a hex-dump of your file. How does line 70 look? If you see 0900 66 66 96 48 0A -- ff.H. you know you are doing something illegal. > >Thanks in advance Groetjes Albert P.S. With all due respect, error messages come not any clearer than that! -- -

Re: Tkinter: The good, the bad, and the ugly!

2011-01-14 Thread Albert van der Horst
y are more bluetooth experts than GUI-experts, what would you say?) > >Adam Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter: The good, the bad, and the ugly!

2011-01-17 Thread Albert van der Horst
In article , Adam Skutt wrote: >On Jan 14, 5:17=A0pm, Albert van der Horst >wrote: >> >> I really don't follow that. You need a tremendous set to write gimp. >> Obviously you won't write gimp in Python. >> > >You need a tremendous set to write /the

Re: Tkinter: The good, the bad, and the ugly!

2011-01-17 Thread Albert van der Horst
u rank the widgets in order of most to least commonly >used, I expect that you'll see actual use drop away rapidly and at an >accelerated rate. E.g. the widget in second place might be used roughly >half as often as the widget in first place place, the widget in third >place one

Re: examples of realistic multiprocessing usage?

2011-01-17 Thread Albert van der Horst
t its under an equally permissive license, I can't = >borrow ideas and/or code from it. You have been brain washed by the Intellectual Properties congsy. Of course you can read through code to borrow idea's from it. >Hope it's of some help to you, though. > >Cheers >Philip=

Re: examples of realistic multiprocessing usage?

2011-01-20 Thread Albert van der Horst
In article , Adam Tauno Williams wrote: >On Mon, 2011-01-17 at 13:55 +0000, Albert van der Horst wrote: >> In article , >> Philip Semanchuk wrote: >> >> >I grepped through the code to see that it's using = >> >multiprocessing.Listener. I

Re: Is there any library for indexing binary data?

2010-04-04 Thread Albert van der Horst
e or two disk accesses per search. > >-- >ShenLei > Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: sum for sequences?

2010-04-06 Thread Albert van der Horst
bvious thing for someone versed in numerical computing do is looking whether sum() gives any guarantees for order and whether there may be a special sum() for floating point. (This is not very realistic, because such a person would have skimmed the math library a long time ago, but anyway.) Met

Re: (a==b) ? 'Yes' : 'No'

2010-04-06 Thread Albert van der Horst
n it? > >You spoke to soon :) > >Peter Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: (a==b) ? 'Yes' : 'No'

2010-04-06 Thread Albert van der Horst
weight>=100 ? 60 : 44 ) ) ) ; And not stamp = ( weight>=1000 ? 120 : weight>=500 ) ? 100 : weight>=250 ) ? 80 ... Now Python stamp =( 120

Re: C-style static variables in Python?

2010-04-15 Thread Albert van der Horst
ng those function objects seems the right thing to do, instead of an obscure technique. (I'm not sure the Python compiler could take advantage of this, I know I could in my Forth compiler, under circumstances.) > >regards > Steve >-- >Steve Holden +1 571 484 6266 +1 800 494 3119 Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: lambda with floats

2010-04-15 Thread Albert van der Horst
Regards, >> Pat > >I should stop making a habit of responding to myself, BUT. This isn't >quite an acre in square feet. I just saw the 43xxx and assumed it >was, and then realized it couldn't be, because it wasn't divisible by >10. (I used to measu

Re: Usable street address parser in Python?

2010-04-21 Thread Albert van der Horst
e a book containing information about how the spelling of a street should be officially using a limited number of characters. > > John Nagle Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential --

Re: Python dot-equals (syntax proposal)

2010-05-02 Thread Albert van der Horst
prose will be applicable on very little assignements (use >case 3). I'm not sure it's worth it. Note how related it is to the requirement to have a _radd_ operator. It amounts to the argument that a op= b requires that a and b have somewhat "similar" "type&q

Re: matching strings in a large set of strings

2010-05-02 Thread Albert van der Horst
oblem, but you get >into trade offs between executing things in python as opposed to C if >you start to hand code things in python. There are a lot of possibility, but they depend a great deal on secondary conditions, like how often the 83 M dataset changes. Groetjes Albert -- --

Re: strange interaction between open and cwd

2010-05-12 Thread Albert van der Horst
bination with symlinks all the time. Like symlinks to a directory tree on a mounted volume, where one is not supposed to check out. Or symlinking happyd.sco,v to HAPPYD.SCO,v effectively making file names case-insensitive. > >-- >Grant > Groetjes Albert -- -- Albert van der Horst

Re: Picking a license

2010-05-14 Thread Albert van der Horst
o release everything (see my website, it is a *lot*) under GPL. If someone wants to use it they can, if someone wants to use it commercially, they can too, as long as they pay me a little bit too. Really, I'm reasonable. Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS

Re: Picking a license

2010-05-15 Thread Albert van der Horst
you're blasted. But some warriors fight for a right cause ... This really has nothing to do with anything. The meek will inherit the world, yes, but only after the second coming. > >Regards, >Pat Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic grow

Re: function that counts...

2010-05-21 Thread Albert van der Horst
rds. > >-- >Grant Edwards grant.b.edwardsYow! Hand me a pair of > at leather pants and a CASIO > gmail.comkeyboard -- I'm living >

Re: help need to write a python spell checker

2010-05-21 Thread Albert van der Horst
a newsgroup "fair use"? Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: Ugly modification of a class, can it be done better ?

2010-05-23 Thread Albert van der Horst
in complication. Python can handle variable functions just fine, if that is the proper solution to your problem. (In c they are called function pointers and they are unruly.) def a(b,c): return b+c def p(q,r): return q*r x=a x(3,5) 8 x=p x(3,5) 15 >-- >Steven Sorry, but couldn't respond t

Re: function that counts...

2010-05-26 Thread Albert van der Horst
nd back. def x(i) : return x(i/10)+i%10 if i else 0 or if you can't stand recursion: def x(i): s= 0 while i: s += i%10 i /= 10 return s (All untested but you get the idea.) > >bye -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being expon

Re: function that counts...

2010-06-09 Thread Albert van der Horst
In article , Albert van der Horst wrote: >In article <4bf442cd$0$31377$4fafb...@reader1.news.tin.it>, >superpollo wrote: >>... how many positive integers less than n have digits that sum up to m: >> >>In [197]: def prttn(m, n): >> tot = 0 >>

Re: C interpreter in Lisp/scheme/python

2010-06-14 Thread Albert van der Horst
y". The outcome would be extremely interesting, but ... > >Bolega Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: GUIs - A Modest Proposal

2010-06-15 Thread Albert van der Horst
d my Mother will laugh at me. Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy questions from a python beginner

2010-08-06 Thread Albert van der Horst
rces and one should be very adamant about it. I've written a Perl interpreter for those sources, and a Python interpreter would be even easier. If I'm doing Python, I don't miss macro possibilities, but sometimes my code gets repetitive. If I ever get bored by repetitio

Re: Nice way to cast a homogeneous tuple

2010-08-07 Thread Albert van der Horst
. It is unfortunate that cast's in Python share the same name, but it is kind of unavoidable because it is about the proper CS name to use. >Uli Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is python not written in C++ ?

2010-08-07 Thread Albert van der Horst
assembler like C." (We went on whether Forth would be a suitable high level assembler for Haskell. It would beat C++ -- not C -- for implementing Python, that much I'm sure.) Undoubtedly C is the right choice to implement Python. Groetjes Albert -- -- Albert van der Horst,

Re: Why is python not written in C++ ?

2010-08-07 Thread Albert van der Horst
t; >I suspect the same effect contributed to Java's success as well. "Look, >it's got curly braces and semicolons. It's just like C!" Of course! Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: measuring a function time

2010-08-07 Thread Albert van der Horst
. There is an alternative, for once the semicolon comes in handy: >>>from time import * >>> x=time(); function(); print time()-x 6.551980773430 > >The best way to time small code snippets and fast functions is with the >timeit module. > >-- >Steven Gr

Re: easy question on parsing python: "is not None"

2010-08-08 Thread Albert van der Horst
f a field contains (a reference to) king, it means the piece \ is standing on that field" Even a fresh convert from the Java language would not insert the string instead of the name of the object. (In practive you want black kings and white kings to be different objects, probably.) > >

Re: preferring [] or () in list of error codes?

2009-06-19 Thread Albert van der Horst
t. That alone is sufficient reason not to use it here. [Yes I know { } doesn't denote a set. I tried it. I don't know how to denote a set ... ] >-- >Steven Groetjes Albert. -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: Good books in computer science?

2009-06-27 Thread Albert van der Horst
t compared to a good algorithm, apparently. >-- >Steven Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: Good books in computer science?

2009-06-27 Thread Albert van der Horst
it's clearly untrue: many people do >without understanding. Many people can cook, some people are expert cooks, This is even a classical lack of logic skills. Feynman says a->b, and you attack b->a. >-- >Steven > Groetjes Albert -- -- Albert van der Horst, UTRECHT,T

Re: Good books in computer science?

2009-06-27 Thread Albert van der Horst
Numerical Recipe's in FORTRAN/Pascal/C" (Have they done Python yet?) > >Structure and Interpretation of Computer Programs by Harold Abelson >and Gerald Jay Sussman (online at mitpress.mit.edu/sicp) Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Econom

Re: question of style

2009-07-16 Thread Albert van der Horst
saved generations of physicists of loosing track (and their minds.) Also ... For me there is nothing more clear than a regular expression search that returns None if nothing matches. Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential --

Re: question of style

2009-07-16 Thread Albert van der Horst
ic "is_empty" predicate >> We have that already. It's spelled __bool__ or __nonzero__ > >That's fine, but under the "explicit is better than implicit" >principle, it's preferable to call that predicate explicitly: >"if bool(x): ..." rather than "if x:". Also, after many years of Maybe I'm missing something here, but if self.higher contains 0, wouldn't bool(self.higher) evaluate to False? So how does this help? Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: Clarity vs. code reuse/generality

2009-07-16 Thread Albert van der Horst
rom scratch. Then *you* have to explain them about the benefits of reuse. (The other benefits, of course.) > >I'd love to know your opinions on this. You're welcome. >kj Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being expo

Re: Clarity vs. code reuse/generality

2009-07-16 Thread Albert van der Horst
ands it. The purpose of code is 1) to communicate with the Exactly. And the OP teaches to scientist. They know sense in that meaning. Maybe you don't, but that is irrelevant. Groetjes Albert. -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: Clarity vs. code reuse/generality

2009-07-17 Thread Albert van der Horst
gone up... Current issues read like the first years >of Discover magazine) I dropped my subscription when power was expressed in multiples of US hair dryers. (I could calculate that back, and was appalled by the energy wastage of US hair dryers. ;-) ) >-- > Wulfraed Dennis Lee

Re: A Bug By Any Other Name ...

2009-07-17 Thread Albert van der Horst
special characters can be run together to denote a different operator. Examples abound : +:= ** A consequence is that 'a*-b' would be illegal. It would become 'a*(-b)' Worse is that x=-q would be illegal. Because unlike in algol 68 in python whitespace is relevant, we co

Re: missing 'xor' Boolean operator

2009-07-25 Thread Albert van der Horst
or that only works and requires that both operands are booleans. That one we have already! It is called != . (a!=b)!=c and a!=(b!=c) are the same for booleans, so can indeed be expressed a!=b!=c (associativy of xor) > >JM > Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: Why aren't OrderedDicts comparable with < etc?

2009-07-25 Thread Albert van der Horst
the object's id. This is one of the non-backwards compatible changes >in 3k. Now comparing two of the same thing that don't have an obvious >ordering is an error. Is a dict "greater than" if it has a larger >size? if its max key is larger? what does "max key"

Re: A Bug By Any Other Name ...

2009-08-02 Thread Albert van der Horst
In article , J. Cliff Dyer wrote: >On Fri, 2009-07-17 at 20:53 +0000, Albert van der Horst wrote: >> Because unlike in algol 68 in python whitespace is relevant, >> we could get by with requiring whitespace: >> x= -q # okay >>

Re: Colour of output text

2009-08-02 Thread Albert van der Horst
me entry should show up, e.g. TERM=xterm infocmp $TERM should fetch information about your terminal, from the same source as curses does. Possible problems are: - your operating system/configurations lies to curses about the terminal or your terminal is not specified at all - curses has not been properly installed and cannot find the database Groetjes Albert > >JM > > -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: Overlap in python

2009-08-05 Thread Albert van der Horst
t overlap. (In you case the second step is not needed.) > >Thank you very much! >Jay -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: Annoying octal notation

2009-09-03 Thread Albert van der Horst
any of it has become vindicated over time. (Yes, nineteen hundred sixty eight was the year that language was conceived.) > >James Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&

Re: Annoying octal notation

2009-09-03 Thread Albert van der Horst
he co-inventor of Unix.) >> >Maybe it was because they were working on minicomputers, not mainframes, >so there was less processing power and storage available. Not just any minicomputers: PDP11. Octal notation is friendly with the PDP11 instruction set. Groetjes Albert -- --

Re: Annoying octal notation

2009-09-03 Thread Albert van der Horst
, people in the D community are trying to improve things, but it's >a slow and painful process, and often it goes nowhere. There's lot of >politics. There is legacy code, of course. > >Bye, >bearophile Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS

Re: Annoying octal notation

2009-09-03 Thread Albert van der Horst
ad. The more so because the new Python interpreter will warn you with a nice friendly message. The sacrifice asked from you is small, but all in all it is big win for humanity at large. >Derek D. Martin Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being expon

Re: IDE for python similar to visual basic

2009-09-07 Thread Albert van der Horst
o put it. What I resent is that it leads to a non-professional attitude of the graphical part. Programming is over, lets now kludge some screens together. No. The graphics part has to be carefully designed, carefully tested, and carefully "written", even if it is using a graphical tool. So,

Re: What python can NOT do?

2009-09-07 Thread Albert van der Horst
p; 0xAD has more overhead than 17 + 123 So what do you mean here? > >-- >Steven Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does this group have so much spam?

2009-09-09 Thread Albert van der Horst
(No business men is.). So being Jewish is probably criminal. Were does it end? Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: IDE for python similar to visual basic

2009-09-24 Thread Albert van der Horst
In article , Nobody wrote: >On Mon, 07 Sep 2009 23:56:17 +0000, Albert van der Horst wrote: >> >> In view of the above this is not quite the correct way to put it. >> >> What I resent is that it leads to a non-professional attitude >> of the graphical pa

Re: Creating a local variable scope.

2009-09-24 Thread Albert van der Horst
o learn if and how Python gets around that. > >Bye, >bearophile Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: Fibonacci: How to think recursively

2010-09-01 Thread Albert van der Horst
unduely inefficient, as each call splits into two calls. If one insists on recursion (untested code, just for the idea.). def fib2( n ): ' return #rabbits last year, #rabbits before last ' if n ==1 : return (1,1) else penult, ult = fib2( n-1 ) return

Re: Saving (unusual) linux filenames

2010-09-01 Thread Albert van der Horst
name had a space it it.... I'd rather have it fail for spaces than for comma's. > >> Surely that's a bad idea. > >Of course it's a bad idea. That doesn't stop people from doing it. > >-- >Grant Edwards grant.b.edwardsYow! ! Now I understand > at advanced MICROBIOLOGY and > gmail.comth' new TAX REFORM laws!! -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: "Strong typing vs. strong testing"

2010-09-28 Thread Albert van der Horst
ok. And six months later >you Mars mission will crash. A mission failure is a failure of management. The Ariadne crash was. Management must take care that engineering mistakes don't lead to mission failure. In the Ariadne case it was not so much engineering mistakes, but management actually standing in the way of good engineering practice. >__Pascal Bourguignon__ http://www.informatimago.com/ Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

Re: sequence multiplied by -1

2010-10-06 Thread Albert van der Horst
;m glad that Guido apparently >agrees with me. The important thing is that manipulations are the same such that a += b a += c a += d can be replaced by a = b + c + d without much thought to what a b c and + represent. In other words reuse of the important brain resource of pattern recognition. >-- >Steven Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   >