Re: Computer Language Shootout

2005-11-30 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > "Be Nice!" *is* one of paragraph headings in the FAQ section "How can I > help?" yeah, we've noticed that it's not one of the headings in the FAQ section "How can we encourage you to contribute". -- http://mail.python.org/mailman/listinfo/python-list

Re: Computer Language Shootout

2005-11-30 Thread igouy
Fredrik Lundh wrote: > Bengt Richter wrote: > > > That's not just blunt and concise, it looks like the modus operandi > > of a typical volunteer/employee-exploiter (or perhaps spoiled brat, > > the typical precursor to the former). > > careful. his faq requires you to "be nice". > > "Be Nice!"

Re: Computer Language Shootout

2005-11-30 Thread Fredrik Lundh
Bengt Richter wrote: > That's not just blunt and concise, it looks like the modus operandi > of a typical volunteer/employee-exploiter (or perhaps spoiled brat, > the typical precursor to the former). careful. his faq requires you to "be nice". -- http://mail.python.org/mailman/listinfo/py

Re: Computer Language Shootout

2005-11-30 Thread igouy
[EMAIL PROTECTED] wrote: > This is a direct translation of the D code, maybe it's not the faster > Python implementation, and surely it's not the shorter one. But Psyco > makes it much faster (Psyco likes "low level" style code). And if you contributed the program like this http://shootout.alioth

Re: Computer Language Shootout

2005-11-30 Thread bearophileHUGS
malv: >Hi bearophileH, bearophile is enough :-) >Could you post some more information about ShedSkink? ShedSkin (SS) is a Python -> C++ compiler (or translator) written in Python, created by Mark Dufour. Its development was initially "financed" by the summer of code by Google. It contains some

Re: Computer Language Shootout

2005-11-30 Thread Fredrik Lundh
"malv" wrote: > Could you post some more information about ShedSkink? http://sourceforge.net/projects/shedskin/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Computer Language Shootout

2005-11-30 Thread igouy
[EMAIL PROTECTED] wrote: > Bengt Richter wrote: > > On 29 Nov 2005 14:08:12 -0800, [EMAIL PROTECTED] wrote: > > > > >We don't scrape programs from news-groups, if you'd like the program to > > >be shown on the shootout then please attach the source code to a > > >tracker item. > > You asked for so

Re: Computer Language Shootout

2005-11-30 Thread malv
Hi bearophileH, Thank you for the code example. Could you post some more information about ShedSkink? malv -- http://mail.python.org/mailman/listinfo/python-list

Re: Computer Language Shootout

2005-11-29 Thread bonono
Bengt Richter wrote: > >Interestingly, I find this response quite compatible with the > >personality of this group. > Which "this"? ;-) > I meant his response. -- http://mail.python.org/mailman/listinfo/python-list

Re: Computer Language Shootout

2005-11-29 Thread Bengt Richter
On 29 Nov 2005 18:34:34 -0800, [EMAIL PROTECTED] wrote: > >Bengt Richter wrote: >> On 29 Nov 2005 14:08:12 -0800, [EMAIL PROTECTED] wrote: >> >> >We don't scrape programs from news-groups, if you'd like the program to >> >be shown on the shootout then please attach the source code to a >> >tracker

Re: Computer Language Shootout

2005-11-29 Thread bonono
Bengt Richter wrote: > On 29 Nov 2005 14:08:12 -0800, [EMAIL PROTECTED] wrote: > > >We don't scrape programs from news-groups, if you'd like the program to > >be shown on the shootout then please attach the source code to a > >tracker item. > You asked for something, got a response, and then you h

Re: Computer Language Shootout

2005-11-29 Thread Bengt Richter
On 29 Nov 2005 14:08:12 -0800, [EMAIL PROTECTED] wrote: >We don't scrape programs from news-groups, if you'd like the program to >be shown on the shootout then please attach the source code to a >tracker item. You asked for something, got a response, and then you haughtily[1] declare that it's not

Re: Computer Language Shootout

2005-11-29 Thread igouy
We don't scrape programs from news-groups, if you'd like the program to be shown on the shootout then please attach the source code to a tracker item. Please follow the FAQ instructions http://shootout.alioth.debian.org/faq.php#contribute [EMAIL PROTECTED] wrote: > This is a direct translation o

Re: Computer Language Shootout

2005-11-29 Thread bearophileHUGS
This is a direct translation of the D code, maybe it's not the faster Python implementation, and surely it's not the shorter one. But Psyco makes it much faster (Psyco likes "low level" style code). ShedSkink is (almost) able to compile it too, producing a really fast executable (with some "smart a

Computer Language Shootout

2005-11-29 Thread igouy
We don't have Python implementations for one program, and a couple of the Python programs we do have show Error. http://shootout.alioth.debian.org/benchmark.php?test=all&lang=python&lang2=python Please contribute missing Python programs or faster more-elegant Python programs. Please follow the

Re: code for Computer Language Shootout

2005-03-29 Thread igouy
We've made it somewhat easier to contribute programs. No need to subscribe to the mailing-list. No need for a user-id or login. See the FAQ "How can I contribute a program?" http://shootout.alioth.debian.org/faq.php -- http://mail.python.org/mailman/listinfo/python-list

Re: code for Computer Language Shootout

2005-03-18 Thread Bryan
import sys import string def show(seq, table=string.maketrans('ACBDGHK\nMNSRUTWVYacbdghkmnsrutwvy', 'TGVHCDM\nKNSYAAWBRTGVHCDMKNSYAAWBR')): seq = seq.translate(table)[::-1] for i in range(0, len(seq), 60): print seq[i:i+60] couldn't you chang

Re: code for Computer Language Shootout

2005-03-16 Thread Raymond Hettinger
> > . import string, itertools, sys > > . > > . t = string.maketrans('ACBDGHKMNSRUTWVYacbdghkmnsrutwvy', > > . 'TGVHCDMKNSYAAWBRTGVHCDMKNSYAAWBR') > > . > > . for h,b in itertools.groupby( file(sys.argv[1]), lambda x: x[0] in > > ">;" ): > > . if h: > > . print "".j

Re: code for Computer Language Shootout

2005-03-16 Thread Jacob Lee
On Wed, 16 Mar 2005 16:45:53 -0800, bearophileHUGS wrote: > Michael Spencer's version is nice, this is a bit shortened version. The > main() isn't useful for this very short loop, and you can use shorter > variable names to make lines shorter (this code isn't much readable, > it's just for the Sho

Re: code for Computer Language Shootout

2005-03-16 Thread bearophileHUGS
Michael Spencer's version is nice, this is a bit shortened version. The main() isn't useful for this very short loop, and you can use shorter variable names to make lines shorter (this code isn't much readable, it's just for the Shootout, "production quality" code has probably to be more readable.

Re: code for Computer Language Shootout

2005-03-16 Thread Michael Spencer
Steven Bethard wrote: Michael Spencer wrote: def output(seq, linelength = 60): if seq: iterseq = iter(seq) while iterseq: print "".join(islice(iterseq,linelength)) Worth noting: "while iterseq" only works because for this case, you have a list iterator, which provi

RE: code for Computer Language Shootout

2005-03-16 Thread Delaney, Timothy C (Timothy)
Jacob Lee wrote: >> # alias methods to avoid repeated lookup >> join = ''.join I would actually do the alias here sometimes, but give it a semantically-useful name ... nosep_join = ''.join ... Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: code for Computer Language Shootout

2005-03-16 Thread Steven Bethard
Michael Spencer wrote: def output(seq, linelength = 60): if seq: iterseq = iter(seq) while iterseq: print "".join(islice(iterseq,linelength)) Worth noting: "while iterseq" only works because for this case, you have a list iterator, which provides a __len__ method.

Re: code for Computer Language Shootout

2005-03-16 Thread Michael Spencer
F. Petitjean wrote: Le Tue, 15 Mar 2005 23:21:02 -0800, Michael Spencer a écrit : def output(seq, linelength = 60): if seq: iterseq = iter(seq) while iterseq: print "".join(islice(iterseq,linelength)) I suppose you mean : print "".join( str(item) for item

Re: code for Computer Language Shootout

2005-03-16 Thread Raymond Hettinger
Consider keeping the alias for append because it occurs in the innermost loop. For maximum readability, write: addline = seq.append Move the ''.join() to the show() function. That eliminates a little redundancy. The test dataset doesn't use the semi-colon comment field. So, consider reversin

Re: code for Computer Language Shootout

2005-03-16 Thread F. Petitjean
Le Tue, 15 Mar 2005 23:21:02 -0800, Michael Spencer a écrit : > Jacob Lee wrote: >> On Tue, 15 Mar 2005 21:38:48 -0800, Michael Spencer wrote: >> >> Good call. >> >> > > How about this then: > > basetable = string.maketrans('ACBDGHKMNSRUTWVYacbdghkmnsrutwvy', > 'T

Re: code for Computer Language Shootout

2005-03-15 Thread Michael Spencer
Jacob Lee wrote: On Tue, 15 Mar 2005 21:38:48 -0800, Michael Spencer wrote: string.translate is a good idea. Note you can handle upper-casing and translation in one operation by adding a mapping from lower case to the complement i.e., table = string.maketrans('ACBDGHK\nMNSRUTWVYacbdghkmnsrutwvy',

Re: code for Computer Language Shootout

2005-03-15 Thread Steven Bethard
Jacob Lee wrote: So here's a tentative contest version of the code: import sys import string def show(seq, table=string.maketrans('ACBDGHK\nMNSRUTWVYacbdghkmnsrutwvy', 'TGVHCDM\nKNSYAAWBRTGVHCDMKNSYAAWBR')): seq = seq.translate(table)[::-1] for i in ra

Re: code for Computer Language Shootout

2005-03-15 Thread Jacob Lee
On Tue, 15 Mar 2005 22:45:48 -0700, Steven Bethard wrote: > # table as default argument value so you don't have to do > # a global lookup each time it's used > > def show(seq, table=string.maketrans('ACBDGHK\nMNSRUTWVY', > 'TGVHCDM\nKNSYAAWBR') > seq = s

Re: code for Computer Language Shootout

2005-03-15 Thread Jacob Lee
On Tue, 15 Mar 2005 21:38:48 -0800, Michael Spencer wrote: > string.translate is a good idea. Note you can handle upper-casing and > translation in one operation by adding a mapping from lower case to the > complement i.e., > > table = string.maketrans('ACBDGHK\nMNSRUTWVYacbdghkmnsrutwvy', >

Re: code for Computer Language Shootout

2005-03-15 Thread Steven Bethard
Jacob Lee wrote: There are a bunch of new tests up at shootout.alioth.debian.org for which Python does not yet have code. I've taken a crack at one of them, a task to print the reverse complement of a gene transcription. Since there are a lot of minds on this newsgroup that are much better at optim

Re: code for Computer Language Shootout

2005-03-15 Thread Robert Kern
Here's my solution to the problem[1]: [1] http://shootout.alioth.debian.org/benchmark.php?test=revcomp import sys import string basetable = string.maketrans('ACBDGHKMNSRUTWVYacbdghkmnsrutwvy', 'TGVHCDMKNSYAAWBRTGVHCDMKNSYAAWBR') def revcomp(seqlines, linelength=60, base

Re: code for Computer Language Shootout

2005-03-15 Thread Michael Spencer
Jacob Lee wrote: There are a bunch of new tests up at shootout.alioth.debian.org for which Python does not yet have code. I've taken a crack at one of them, a task to print the reverse complement of a gene transcription. Since there are a lot of minds on this newsgroup that are much better at optim

Re: code for Computer Language Shootout

2005-03-15 Thread Robert Kern
Jacob Lee wrote: By the way - is there a good way to find out the maximum memory a program used (in the manner of the "time" command)? Other than downloading and running the shootout benchmark scripts, of course. Inserting appropriate pauses with raw_input() and recording the memory usage using to

code for Computer Language Shootout

2005-03-15 Thread Jacob Lee
There are a bunch of new tests up at shootout.alioth.debian.org for which Python does not yet have code. I've taken a crack at one of them, a task to print the reverse complement of a gene transcription. Since there are a lot of minds on this newsgroup that are much better at optimization than I, I