Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread bartc
to call the file .py or .pyw; the difference between console and graphical programs and so on. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread bartc
Alf P. Steinbach al...@start.no wrote in message news:hcdlsp$9a...@news.eternal-september.org... * bartc: Alf P. Steinbach al...@start.no wrote in message news:hc8pn3$dd...@news.eternal-september.org... [Cross-posted comp.programming and comp.lang.python] You use the highly commercial

Re: Language mavens: Is there a programming with if then else ENDIFsyntax?

2009-11-18 Thread bartc
{..}, and doesn't have endif. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrapping paper, anyone ?

2009-12-16 Thread bartc
simon pianomaes...@gmail.com wrote in message news:a50b1c21-287b-498d-a8c3-51a3a2f94...@k9g2000vbl.googlegroups.com... #!/usr/bin/env python from math import * from random import * import cairo from cairo import Context What's cairo? --

Re: Scripting (was Re: Python books, literature etc)

2010-01-09 Thread bartc
languages, then you're probably doing some programming. And with programs where the runtime is not significant, it could be either... -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: chr(12) Form Feed in Notepad

2010-01-16 Thread bartc
are over, and neither Notepad nor your printer attempts to maintain compatibility with a Teletype model 37. Odd that TXT files under Windows still use the same 13 (carriage return), 10 (linefeed) and 9 (tab) codes that used to work on my ASR 33. So why not code 12 (formfeed)? -- Bartc

Re: chr(12) Form Feed in Notepad

2010-01-16 Thread bartc
Steve Holden st...@holdenweb.com wrote in message news:mailman.1007.1263682208.28905.python-l...@python.org... bartc wrote: Nobody nob...@nowhere.com wrote in message news:pan.2010.01.16.04.24.18.437...@nowhere.com... On Fri, 15 Jan 2010 10:42:43 -0800, W. eWatson wrote: I thought I'd put

Re: chr(12) Form Feed in Notepad

2010-01-17 Thread bartc
Dennis Lee Bieber wlfr...@ix.netcom.com wrote in message news:mailman.1021.1263702437.28905.python-l...@python.org... On Sat, 16 Jan 2010 23:59:52 GMT, bartc ba...@freeuk.com declaimed the following in gmane.comp.python.general: My point was these other control codes from over 30 years ago

Re: basic Class in Python

2010-01-18 Thread bartc
left and right Any particular reason why two, and not one (or three)? In some fonts it's difficult to tell how many as they run together. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Ruby

2010-02-02 Thread bartc
, and use the appropriate syntax. Sometimes this is helpful, sometimes not. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Ruby

2010-02-02 Thread bartc
Jonathan Gardner wrote: On Feb 2, 7:23 am, bartc ba...@freeuk.com wrote: Jonathan Gardner wrote: One of the bad things with languages like perl and Ruby that call without parentheses is that getting a function ref is not obvious. You need even more syntax to do so. In perl: foo(); # Call

Re: Your beloved python features

2010-02-05 Thread bartc
it. That might be true when used to code actual algorithms using basic features. But a lot of Pythonisms would appear mysterious to someone who doesn't know the language (for example, what does :: mean in an array index). Or perhaps pseudo-code is much more advanced these days... -- bartc

Re: Dreaming of new generation IDE

2010-02-05 Thread bartc
to say: if b==0 and i==0 and u==0: drawtext(s) elif b==1 and i==0 and u==0: drawtextb(s) and so on. With half-a-dozen or more booleans, this becomes completely impractical. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Dreaming of new generation IDE

2010-02-06 Thread bartc
Arnaud Delobelle arno...@googlemail.com wrote in message news:m28wb6ypfs@googlemail.com... Gabriel Genellina gagsl-...@yahoo.com.ar writes: En Fri, 05 Feb 2010 19:22:39 -0300, bartc ba...@freeuk.com escribió: Steve Holden st...@holdenweb.com wrote in message news:mailman

Re: lists of variables

2010-02-21 Thread bartc
doesn't work because if you assign a That shows a different outlook. I would have said your first example works as expected and it was the second example that was strange, possibly due to shallow instead of deep copies by Python. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Named loops for breaking

2010-03-11 Thread bartc
infrequently in final code. But they are handy when developing code too: you don't want to waste time refactoring, and generally turning code upside-down, when the code has to be rewritten a dozen times anyway. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Need advice on starting a Python group

2010-03-12 Thread bartc
finding volunteers. And even when we've had volunteers, hardly anyone shows up! Any suggestions would be appreciated. Try and get a girl or two interested in coming to the meetings... -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-23 Thread bartc
garabik-news-2005...@kassiopeia.juls.savba.sk wrote in message news:h6r4fb$18...@aioe.org... In comp.lang.python James Harris james.harri...@googlemail.com wrote: On 22 Aug, 10:27, David 71da...@libero.it wrote: ... What about 2_1011, 8_7621, 16_c26h or 2;1011, 8;7621, 16;c26h ? They

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-23 Thread bartc
confusing, No issue of what base the base indicator is expressed in. It can be assumed however that .9. isn't in binary? That's a neat idea. But an even simpler scheme might be: .octal.100 .decimal.100 .hex.100 .binary.100 .trinary.100 until it gets to this anyway: .thiryseximal.100 -- Bartc

Re: The rap against while True: loops

2009-10-11 Thread bartc
, then I won't bother. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: len() should always return something

2009-07-24 Thread bartc
]) Should it print 3 (the elements in [10,20,30]), or 1 (treating [10,20,30] as a potential list containing the single element [10,20,30])? -- bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 'for' loop is memory inefficient

2009-08-16 Thread bartc
, but this wouldn't have helped the speed any. Nor the memory consumption. A for-loop, for iterating over a simple sequence, should be one of the fastest things in the language. [Presumably the internal code that created those consecutive integers used a more conventional looping method...] -- Bartc

Re: Normalizing A Vector

2010-08-02 Thread Bartc
): L = math.sqrt((v[0]*v[0]+v[1]*v[1]+v[2]*v[2])) return (v[0]/L,v[1]/L,v[2]/L) (Strangely, changing those divides to multiplies made it slower.) -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Normalizing A Vector

2010-08-02 Thread Bartc
Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote in message news:87fwyxgvuv@dpt-info.u-strasbg.fr... Bartc ba...@freeuk.com writes: def norm3d(v): L = math.sqrt((v[0]*v[0]+v[1]*v[1]+v[2]*v[2])) return (v[0]/L,v[1]/L,v[2]/L) (Strangely, changing those divides to multiplies made

Re: Python why questions

2010-08-09 Thread Bartc
it be more natural to call them a one year old? Zero based counting is perfectly natural. Depends whether you are counting (discrete) things, or measuring them (over a continuous range). You would start counting at 1, but start measuring from 0. -- Bartc -- http://mail.python.org/mailman/listinfo

Re: Python why questions

2010-08-09 Thread Bartc
-based so it's (L-1)/P+1 (integer divide), or 5 pages. If we switch to 0-based counting, it's just L/P ('266' lines require '4' pages), but who's going to explain that to the user? -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: 79 chars or more?

2010-08-17 Thread BartC
useful for being able to write same-line comments with meaningful content... (I've used 80-column hardware (teletypes and such) years ago, I thought such restrictions had vanished long ago) -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: 79 chars or more?

2010-08-18 Thread BartC
listings. Those of you who think old hardcopy terminals did 132 wide obviously don't remember the ASR-33 :-) ASR33s I think might have been 72 columns wide (and punched cards had a similar restriction). However, lineprinter output was more likely to be 132 columns. -- bartc -- http

Re: 79 chars or more?

2010-08-18 Thread BartC
Roy Smith r...@panix.com wrote in message news:roy-181632.07571818082...@news.panix.com... In article qkoao.53872$gq5.12...@hurricane, BartC ba...@freeuk.com wrote: Remember, the old hardcopy terminals used to produce 132-character-wide listings. Those of you who think old hardcopy

Re: Comparisons of incompatible types

2010-12-07 Thread BartC
. So some sorts will make sense, and others (such as or ) won't. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: while True or while 1

2010-12-16 Thread BartC
the other. That's an appreciable difference, which you can't really just dismiss. And you can't tell what the overall effect on a program will be: perhaps the loop will be in a library function , which might be called billions of times. -- Bartc -- http://mail.python.org/mailman/listinfo

Re: while True or while 1

2010-12-16 Thread BartC
Steve Holden st...@holdenweb.com wrote in message news:mailman.54.1292502247.6505.python-l...@python.org... On 12/16/2010 5:44 AM, BartC wrote: One these is 30% faster than the other. That's an appreciable difference, which you can't really just dismiss. shol...@lifeboy ~ $ python -m

Re: Trying to parse a HUGE(1gb) xml file

2010-12-25 Thread BartC
it into the phone socket!). -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to parse a HUGE(1gb) xml file

2010-12-28 Thread BartC
this)? And why not use 1 and 0 for TRUE and FALSE? Even the consumer appliances in my house have 1 and 0 on their power switches! With the advantage that they are internationally recognised. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to decide between PHP and Python

2011-01-06 Thread BartC
with a broader instruction set. One with zero instructions might be even simpler than that: http://en.wikipedia.org/wiki/Zero_instruction_set_computer -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems of Symbol Congestion in Computer Languages

2011-02-20 Thread BartC
that syllable was stressed anyway.) -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: auto increment

2011-03-04 Thread BartC
the resulting bugs. I agree. Out of curiosity, what resulting bugs? Probably things like i=(++i)+(--i), although more of being indeterminate than a bug. That assumes that ++i was intended for use in an expression, rather than just be a statement. -- Bartc -- http://mail.python.org

Re: having both dynamic and static variables

2011-03-04 Thread BartC
is not considered 'pythonic'; certainly it's a crude, if effective, way of getting extra performance). -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: having both dynamic and static variables

2011-03-09 Thread BartC
is another. But then, the dividing line between constants and 'variables' can get confused when the values involved are complex (strings and such), so might be understandable up to a point. -- bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Postfix conditionals

2014-02-03 Thread BartC
to avoid. Switch is attractive for an interpreted language because - provided all cases are constants, a bit of a problem in Python, because as soon as you give a name to something, it's no longer constant - it can be implemented very efficiently.) -- Bartc -- https://mail.python.org/mailman

Re: Postfix conditionals

2014-02-04 Thread BartC
GöktuğKayaalp s...@gkayaalp.com wrote in message news:mailman.6377.1391490975.18130.python-l...@python.org... BartC b...@freeuk.com writes: Göktuğ Kayaalp s...@gkayaalp.com wrote in message news:mailman.4966.1388953508.18130.python-l...@python.org... AFAIK, we do not have postfix

Re: f python?

2012-04-08 Thread BartC
strings have simplified all kids of text manipulation, lexical scanning, and data storage/communication code resulting in immeasurable savings over the years. They both have their uses. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: f python?

2012-04-10 Thread BartC
. And depending on the memory management arrangements, such a length need not be stored at all. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie, homework help, please.

2012-04-21 Thread BartC
(vertinchlines): newtext.append() for s in newtext: print (s) -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie, homework help, please.

2012-04-21 Thread BartC
: print (lines) The text handling is clunky (I had to learn the Python as I went along), but with these things you just want to get something working first, then you can tweak. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie, homework help, please.

2012-04-21 Thread BartC
the output you're getting that has too many asterisks. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie, homework help, please.

2012-04-21 Thread BartC
someone wesbr...@gmail.com wrote in message news:9533449.630.1335042672358.JavaMail.geo-discussion-forums@ynmf4... On Saturday, April 21, 2012 3:44:49 PM UTC-5, BartC wrote: Hi, Bart: Thank you, your post is working now, maybe, I did something wrong, unfortunately, you are right, my setup

Re: Python Interview Questions

2012-07-10 Thread BartC
they're being paid for? There's also the risk of mixing up software created at home, with that done at work, with all the intellectual property issues that might arise. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread BartC
variables. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Encapsulation, inheritance and polymorphism

2012-07-20 Thread BartC
multiple systems of exponents. (A few years ago the biggest number I'd heard of was Skewes' Number (something like 10^10^10^34), but even that is trivial to write using conventional exponents as I've just shown. Graham's Number is in a different class altogether.) -- Bartc -- http

Re: simplified Python parsing question

2012-08-03 Thread BartC
' too. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Python CPU

2011-04-02 Thread BartC
be interesting to see how well it works. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Fibonacci series recursion error

2011-05-01 Thread BartC
in practice. Yes, it generates lots of calls. About 22000 for fib(20), and 330 million for fib(40). That's why it's popular for benchmarks that measure performance of function calls. Using an iterative algorithm wouldn't work quite so well... -- Bartc -- http://mail.python.org/mailman/listinfo

Re: why indentation should be part of the syntax

2014-03-03 Thread BartC
, another source of errors. Having an undifferentiated } to close all kinds of blocks doesn't help either. -- Bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Functional programming

2014-03-04 Thread BartC
will be different! For a static language such as this, type-discipline is important. And even if the compiler gets it right, a human reading the code would have trouble determining the return type, except in trivial examples like this. Putting in an explicit return type is the simplest way to go. -- Bartc

Re: Functional programming

2014-03-04 Thread BartC
for records then, because it would be impossible to change a field of a record.) -- Bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Functional programming

2014-03-05 Thread BartC
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote in message news:5315eec0$0$29985$c3e8da3$54964...@news.astraweb.com... On Tue, 04 Mar 2014 13:30:04 +, BartC wrote: Isn't creating classes in Python similar to creating types elsewhere? Depends on the type: I suppose you can

Re: Iterative vs. Recursive coding

2010-08-25 Thread BartC
at random until the code compiled? *wink* You underestimate how much programming (of applications) can be done without needing any of this stuff. Needless to say, I didn't last long !-) And rightly so :) I guess they wanted code that could be maintained by anybody. -- Bartc --- news

Re: Speed-up for loops

2010-09-03 Thread BartC
), then iterated between the values of the list! So Python had the distinction of being one of the slowest languages in which to do nothing (ie. running an empty loop). -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Speed-up for loops

2010-09-05 Thread BartC
in it without relying on accelerators, and not have to wait two and a half minutes (or whatever) for a simple test to complete. -- bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Speed-up for loops

2010-09-05 Thread BartC
Steven D'Aprano st...@remove-this-cybersource.com.au wrote in message news:4c83b425$0$28657$c3e8...@news.astraweb.com... On Sun, 05 Sep 2010 12:28:47 +0100, BartC wrote: It would be nice if you could directly code low-level algorithms in it without relying on accelerators, and not have

Re: Speed-up for loops

2010-09-06 Thread BartC
Stefan Behnel stefan...@behnel.de wrote in message news:mailman.470.1283712666.29448.python-l...@python.org... BartC, 05.09.2010 19:09: All those compilers that offer loop unrolling are therefore wasting their time... Sometimes they do, yes. Modifying the OP's code a little: a = 0 for i

Re: Speed-up for loops

2010-09-06 Thread BartC
Stefan Behnel stefan...@behnel.de wrote in message news:mailman.485.1283772019.29448.python-l...@python.org... BartC, 06.09.2010 12:38: (2) Integer arithmetic seems to go straight from 32-bits to long integers; why not use 64-bits before needing long integers? You are making assumptions

Re: Speed-up for loops

2010-09-07 Thread BartC
Steven D'Aprano steve-remove-t...@cybersource.com.au wrote in message news:4c85adfe$0$5$c3e8...@news.astraweb.com... On Mon, 06 Sep 2010 11:38:22 +0100, BartC wrote: Manually unrolling such a loop four times (ie. 4 copies of the body, and counting only to 25 million) increased the speed

Re: Speed-up for loops

2010-09-07 Thread BartC
David Cournapeau courn...@gmail.com wrote in message news:mailman.546.1283897932.29448.python-l...@python.org... On Sun, Sep 5, 2010 at 8:28 PM, BartC ba...@freeuk.com wrote: One order of magnitude (say 10-20x slower) wouldn't be so bad. That's what you might expect for a dynamically typed

Re: Speed-up for loops

2010-09-08 Thread BartC
Steven D'Aprano st...@remove-this-cybersource.com.au wrote in message news:4c878be5$0$3$c3e8...@news.astraweb.com... On Tue, 07 Sep 2010 11:00:03 +0100, BartC wrote: for i in xrange(1): a = a + f(i) With Python 3 and def f(x): return x+1, unrolling this loop 4x improved speed

Re: Speed-up for loops

2010-09-09 Thread BartC
Stefan Behnel stefan...@behnel.de wrote in message news:mailman.563.1283921317.29448.python-l...@python.org... BartC, 08.09.2010 03:45: Getting back to the OP's code again (trivial and pointless as it might seem), I got these results: C (gcc 3.4.5 -O3) 0.8 secs C (DMC-o) 2.3 secs C (lccwin32

Re: sequence multiplied by -1

2010-09-26 Thread BartC
that there is a more meaningful symantics. Simply put, a sequence multiplied by -1 can give a reversed sequence. Then for any sequence seq, and integer n0, we can have seq * -n producing (seq * -1) * n. Any thoughts? Gimmicky. Best to define multiplication only by unsigned or positive values. -- Bartc

Re: Strong typing vs. strong testing

2010-09-28 Thread BartC
the standard units are radians, and mm. Every other calculation uses implied units. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Strong typing vs. strong testing

2010-10-01 Thread BartC
hard to find a language that has no compiler generating faster code than C... But those implementers have to try very hard to beat C. Meanwhile C can be plenty fast without doing anything special. When Intel will realize that 99% of its users are running VM Which one? -- Bartc -- http

Re: discussion

2010-10-01 Thread BartC
firstdigit=n//(10**(digits-1)) if firstdigit!=lastdigit: return False if digits==2: return True middledigits=n//10-firstdigit*(10**(digits-2)) return fpalindrome(middledigits) print fpalindrome(12345678987654321) -- Bartc -- http://mail.python.org/mailman/listinfo/python

Re: Strong typing vs. strong testing

2010-10-01 Thread BartC
Pascal J. Bourguignon p...@informatimago.com wrote in message news:87zkuyjawh@kuiper.lan.informatimago.com... BartC b...@freeuk.com writes: Pascal J. Bourguignon p...@informatimago.com wrote in message When Intel will realize that 99% of its users are running VM Which one? Any

Re: Strong typing vs. strong testing

2010-10-01 Thread BartC
seconds, for my own interpreted, dynamic language, and 0.6 seconds for C.) -- bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Strong typing vs. strong testing

2010-10-01 Thread BartC
Pascal J. Bourguignon p...@informatimago.com wrote in message news:877hi1iq2o@kuiper.lan.informatimago.com... BartC b...@freeuk.com writes: (defun fib (n) (if ( n 2) n (+ n (fib (- n 1)) (fib (- n 2)) ) )) But it gave the wrong results and it took ages to figure out why

Re: if the else short form

2010-10-06 Thread BartC
using if-else chains, so this is no longer a compact construction useful in an expression. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: if the else short form

2010-10-06 Thread BartC
Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote in message news:i8j0dg$lh...@lust.ihug.co.nz... In message i8i1h8$dc...@news.eternal-september.org, BartC wrote: x = (One,Two,Three) [i-1] While this works for i = 1,2,3, it goes funny for i=0,-1,-2, and generates an error

Re: if the else short form

2010-10-07 Thread BartC
On Thu, 07 Oct 2010 01:36:33 +0100, BartC wrote: However, as I mentioned, one problem here is having to evaluate all the items in the list before selecting one: ... x = {1 : fna(), 2 : fnb(), 3 : fnc()}.get(i, None Of The Above) Mel mwil...@the-wire.com wrote in message news:i8j56e$ub

Re: Many newbie questions regarding python

2010-10-08 Thread BartC
. 2 - If I declare a class with some member variables, is is strictly necessary This is where I bail out... -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: if the else short form

2010-10-08 Thread BartC
: x = (One,Two,Three)[i-1] if 1=i=3 else Other NevilleDNZ neville...@gmail.com wrote: BartC b...@freeuk.com wrote: Probably there are workarounds here too, but I suspect the syntax won't be quite as pert as the Algol68-style example: x = (i | Zero, One, Two | None of the above) # 0-based

Re: Strong typing vs. strong testing

2010-10-12 Thread BartC
that if angles are just numbers. The definition of a radian is length/length (or m/m) which simplifies to dimensionless. -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Strong typing vs. strong testing

2010-10-12 Thread BartC
RG rnospa...@flownet.com wrote in message news:rnospamon-20651e.17410012102...@news.albasani.net... In article i92dvd$ad...@news.eternal-september.org, BartC b...@freeuk.com wrote: Thomas A. Russ t...@sevak.isi.edu wrote in message But radians are dimensionless. But they are still units

Re: Strong typing vs. strong testing

2010-10-13 Thread BartC
RG rnospa...@flownet.com wrote in message news:rnospamon-ee76e8.18291912102...@news.albasani.net... In article i930ek$uv...@news.eternal-september.org, BartC b...@freeuk.com wrote: RG rnospa...@flownet.com wrote in message Likewise, all of the following are the same number written

Re: pythagorean triples exercise

2010-10-24 Thread BartC
the largest c you will need by computing the square root of a*a+b*b. If square roots have to be used, you might as well use the two-loop algorithm, as you're nearly there. A simpler estimate for the largest c is just a+b, although it might involve a few extra iterations. -- Bartc -- http

Re: Is Unladen Swallow dead?

2010-11-18 Thread BartC
was so low that cluttering up CPython with a JIT system and LLVM probably is a lose. LLVM. Ok, that explains a lot. (LLVM is a huge, complex system). -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Raspberry pi, python and robotics

2014-09-05 Thread BartC
oscilloscope wasn't directly useful for the complex non-repeating signals you get with computer boards. -- Bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: (test) ? a:b

2014-10-22 Thread BartC
have unintended side-effects. -- Bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: (test) ? a:b

2014-10-23 Thread BartC
Dennis Lee Bieber wlfr...@ix.netcom.com wrote in message news:mailman.15097.1414022143.18130.python-l...@python.org... On Wed, 22 Oct 2014 19:08:40 +0100, BartC b...@freeuk.com declaimed the following: Comparing: x = cond ? f() : g(); # C version with x = [f(), g()] [cond] (Should

Re: Opportunity missed by Python ?

2011-10-13 Thread BartC
available, and they re-invent C! https://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/client/samples/spirodraw/Spirodraw.dart -- Bartc -- http://mail.python.org/mailman/listinfo/python-list

Re: Lists and arrays

2013-04-22 Thread BartC
[4] list: [a,1,2] When I do it like this: list=array[0]+ array[3]+ array[4] I get an error: TypeError: unsupported operand type(s) for +: 'numpy.ndarray' and 'numpy.ndarray' You're calculating a+1+2. Probably a isn't something that can be added to 1+2. -- Bartc -- http://mail.python.org

Re: Python is DOOMED! Again!

2015-01-26 Thread BartC
complex calculation performed in floating point, which then has to be converted to ... BTW how *do* you represent a raise of 10% exactly if not with binary floating point? -- Bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Sudoku solver

2015-03-28 Thread BartC
algorithm is not great, as it makes an interesting new benchmark.) -- Bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Sudoku solver

2015-03-29 Thread BartC
On 29/03/2015 13:01, BartC wrote: On 29/03/2015 11:35, Steven D'Aprano wrote: Anyway, we don't really know where the confusion lies. Perhaps the description is misleading, or I'm just confused, or Bart's idea of brute force is not the same as my idea of brute force, or perhaps he really

Re: Sudoku solver

2015-03-30 Thread BartC
uses a byte-code dispatch loop, and it is still dynamically typed. So what extra stuff is going on in CPython?) -- Bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Sudoku solver

2015-03-29 Thread BartC
and post it. (Most of it seems to be preoccupied with multiple ways of indexing the board or grid.) (If it's of any interest, this non-Python code is here: http://pastebin.com/5cXd2Pef ) -- Bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Sudoku solver

2015-03-29 Thread BartC
On 29/03/2015 04:06, Steven D'Aprano wrote: On Sun, 29 Mar 2015 10:50 am, BartC wrote: But using X *and* my own brute-force algorithm, the same puzzle took 2 seconds to solve - faster than C! But, when you tell me that your very own personal interpreted language, which I assume nobody else

Re: Sudoku solver

2015-03-29 Thread BartC
On 29/03/2015 00:12, Chris Angelico wrote: On Sun, Mar 29, 2015 at 10:50 AM, BartC b...@freeuk.com wrote: Using the OP's algorithm, and testing with the 'hard' puzzle posted by Ian Kelly, I got these approximate results: Python 3.1: 1700 seconds (normal Python interpreter) PyPy

Re: Proposal for new minor syntax

2015-03-28 Thread BartC
On 28/03/2015 09:53, Steven D'Aprano wrote: On Sat, 28 Mar 2015 10:08 am, BartC wrote: An alternate syntax might be: hello = .string() That should have been .strip() loop_node =. next Why propose that? Every other augmented assignment has the operator on the left hand side

Re: Sudoku solver

2015-03-29 Thread BartC
On 29/03/2015 19:03, Marko Rauhamaa wrote: BartC b...@freeuk.com: As Chris mentioned, when I say 'faster than C', I mean X running my algorithm was faster then C running Marko's algoritim (on Ian's data). This was just an illustration of algorithm being more important than language

Re: Sudoku solver

2015-03-29 Thread BartC
On 29/03/2015 22:19, Mark Lawrence wrote: On 29/03/2015 21:59, BartC wrote: On 29/03/2015 00:12, Chris Angelico wrote: On Sun, Mar 29, 2015 at 10:50 AM, BartC b...@freeuk.com wrote: Using the OP's algorithm, and testing with the 'hard' puzzle posted by Ian Kelly, I got these approximate

Re: Sudoku solver

2015-03-29 Thread BartC
On 29/03/2015 22:21, Mark Lawrence wrote: On 28/03/2015 23:50, BartC wrote: On 28/03/2015 03:39, Sayth wrote: Good test for pypy to see where it's speed sits between C and Python. Python 3.1: 1700 seconds (normal Python interpreter) PyPy: 93 seconds C unoptimised: 17

  1   2   3   4   5   6   7   8   9   10   >