Re: how to insert random error in a programming

2012-10-15 Thread Steven D'Aprano
On Mon, 15 Oct 2012 18:21:55 -0700, alex23 wrote: > On Oct 16, 5:52 am, Chris Angelico wrote: >> Surely there's a shorter way to rot13 a piece of text? CODE GOLF! > > In Python2: "a piece of string".encode('rot13') :) And in Python 3, unfortunately there has been a right-royal mess made of the

Re: how to insert random error in a programming

2012-10-15 Thread Roy Smith
In article , rusi wrote: > On Oct 15, 9:00 pm, John Gordon wrote: > > In Debashish Saha > > writes: > > > > > how to insert random error in a programming? > > > > Open the program source file and replace the Nth character with a random > >

Re: how to insert random error in a programming

2012-10-15 Thread rusi
On Oct 15, 9:00 pm, John Gordon wrote: > In Debashish Saha > writes: > > > how to insert random error in a programming? > > Open the program source file and replace the Nth character with a random > character. I'm reminded of a description of vi: A program wi

Re: how to insert random error in a programming

2012-10-15 Thread alex23
On Oct 16, 5:52 am, Chris Angelico wrote: > Surely there's a shorter way to rot13 a piece of text? CODE GOLF! In Python2: "a piece of string".encode('rot13') :) > At very least, a single cryptic expression in place of your nice clear > loops MUST be an improvement. > > d = dict((chr(i+c),chr((i+

Re: how to insert random error in a programming

2012-10-15 Thread Steven D'Aprano
On Mon, 15 Oct 2012 19:25:38 +0530, Debashish Saha wrote: > how to insert random error in a programming? While editing the source code, have your cat walk across the keyboard. I really think you need to explain your question better. -- Steven -- http://mail.python.org/mailman/listi

Re: how to insert random error in a programming

2012-10-15 Thread Joshua Landau
On 15 October 2012 20:51, Chris Angelico wrote: > On Tue, Oct 16, 2012 at 6:28 AM, Mark Lawrence > wrote: > > I like clearly written code like this > > > > " > > d = {} > > for c in (65, 97): > > for i in range(26): > > d[chr(i+c)] = chr((i+13) % 26 + c) > > > > print "".join([d.get(

Re: how to insert random error in a programming

2012-10-15 Thread Victor Stinner
Try fuzzing. Examples: http://pypi.python.org/pypi/fusil/ http://peachfuzzer.com/ Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: how to insert random error in a programming

2012-10-15 Thread Mark Lawrence
On 15/10/2012 20:51, Chris Angelico wrote: On Tue, Oct 16, 2012 at 6:28 AM, Mark Lawrence wrote: I like clearly written code like this " d = {} for c in (65, 97): for i in range(26): d[chr(i+c)] = chr((i+13) % 26 + c) print "".join([d.get(c, c) for c in s]) Surely there's a sh

Re: how to insert random error in a programming

2012-10-15 Thread Chris Angelico
On Tue, Oct 16, 2012 at 6:28 AM, Mark Lawrence wrote: > I like clearly written code like this > > " > d = {} > for c in (65, 97): > for i in range(26): > d[chr(i+c)] = chr((i+13) % 26 + c) > > print "".join([d.get(c, c) for c in s]) Surely there's a shorter way to rot13 a piece of tex

Re: how to insert random error in a programming

2012-10-15 Thread Mark Lawrence
On 15/10/2012 20:10, Joshua Landau wrote: On 15 October 2012 14:55, Debashish Saha wrote: how to insert random error in a programming? You could always just *write* the code with random errors from the start. Try random code, like this: from collections import defaultdict as ð def ire(ł

Re: how to insert random error in a programming

2012-10-15 Thread Joshua Landau
On 15 October 2012 14:55, Debashish Saha wrote: > how to insert random error in a programming? > You could always just *write* the code with random errors from the start. Try random code, like this: from collections import defaultdict as ð > def ire(ł, æ=[]): > yield [ð(bool, {

Re: how to insert random error in a programming

2012-10-15 Thread Chris Angelico
On Tue, Oct 16, 2012 at 4:18 AM, Serhiy Storchaka wrote: > On 15.10.12 17:04, Chris Angelico wrote: >> On Tue, Oct 16, 2012 at 12:55 AM, Debashish Saha wrote: >>> how to insert random error in a programming? >> >> how to ask question good in forumming? >>

Re: how to insert random error in a programming

2012-10-15 Thread Emile van Sebille
Debashish Saha wrote: how to insert random error in a programming? Make the changes late in the day then leave for the weekend? Emile -- http://mail.python.org/mailman/listinfo/python-list

Re: how to insert random error in a programming

2012-10-15 Thread Gary Herron
On 10/15/2012 06:55 AM, Debashish Saha wrote: how to insert random error in a programming? Drink several beers before you start programming. :-) -- Dr. Gary Herron Department of Computer Science DigiPen Institute of Technology (425) 895-4418 -- http://mail.python.org/mailman/listinfo

Re: how to insert random error in a programming

2012-10-15 Thread Serhiy Storchaka
On 15.10.12 17:04, Chris Angelico wrote: > On Tue, Oct 16, 2012 at 12:55 AM, Debashish Saha wrote: >> how to insert random error in a programming? > > how to ask question good in forumming? > http://www.catb.org/~esr/faqs/smart-questions.html > > But here's

Re: how to insert random error in a programming

2012-10-15 Thread Jean-Michel Pichavant
- Original Message - [snip a huge list of advices example and insights] > Then list the description on the homework > assignment. > > -- > > DaveA Like the youngsters write: "/bow" JM -- http://mail.python.org/mailman/listinfo/python-list

Re: how to insert random error in a programming

2012-10-15 Thread John Gordon
In Debashish Saha writes: > how to insert random error in a programming? Open the program source file and replace the Nth character with a random character. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted

Re: how to insert random error in a programming

2012-10-15 Thread Neal Becker
Debashish Saha wrote: > how to insert random error in a programming? Apparently, giving it to Microsoft will work. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to insert random error in a programming

2012-10-15 Thread Mark Lawrence
On 15/10/2012 14:55, Debashish Saha wrote: how to insert random error in a programming? Just use some of my code, it's far more random than that suggested by others who've replied to your query. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to insert random error in a programming

2012-10-15 Thread Dave Angel
On 10/15/2012 09:55 AM, Debashish Saha wrote: > how to insert random error in a programming? I don't see how this phrase makes any sense without a lot more context. If I add the words "I'd like to know" in front of the phrase, and "session." at the end (and add

Re: how to insert random error in a programming

2012-10-15 Thread Jean-Michel Pichavant
- Original Message - > how to insert random error in a programming? > -- > http://mail.python.org/mailman/listinfo/python-list > Here's an example from random raise Except(randome.randinteger(0,10,'error']): return -- http://mail.python.org/mailman/listinfo/python-list

Re: how to insert random error in a programming

2012-10-15 Thread Chris Angelico
On Tue, Oct 16, 2012 at 12:55 AM, Debashish Saha wrote: > how to insert random error in a programming? how to ask question good in forumming? http://www.catb.org/~esr/faqs/smart-questions.html But here's one way to do it: raise random.choice((OSError,IOError,ZeroDivis

how to insert random error in a programming

2012-10-15 Thread Debashish Saha
how to insert random error in a programming? -- http://mail.python.org/mailman/listinfo/python-list