Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #31337
| Path | csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'purpose.': 0.07; 'collections': 0.09; 'confuse': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'def': 0.10; 'subject:error': 0.11; '*evtug*': 0.16; '--boivbhf': 0.16; 'abg': 0.16; 'abj': 0.16; 'abj.': 0.16; 'anzrfcnprf': 0.16; 'arfgrq.': 0.16; 'arire': 0.16; 'arire.': 0.16; 'bar--': 0.16; 'bayl': 0.16; 'boivbhf': 0.16; 'bsgra': 0.16; 'cenpgvpnyvgl': 0.16; 'cersrenoyl': 0.16; 'chevgl.': 0.16; 'clguba,': 0.16; 'cnff': 0.16; 'confusion': 0.16; 'crgref': 0.16; 'defaultdict': 0.16; 'ehyrf.': 0.16; 'ernqnovyvgl': 0.16; 'ershfr': 0.16; 'fcnefr': 0.16; 'fcrpvny': 0.16; 'fubhyq': 0.16; 'fvyragyl.': 0.16; 'fvyraprq.': 0.16; 'fvzcyr': 0.16; 'grzcgngvba': 0.16; 'guna': 0.16; 'gur': 0.16; 'gurer': 0.16; 'gvz': 0.16; 'hayrff': 0.16; 'htyl.': 0.16; 'jnl': 0.16; "lbh'er": 0.16; 'mra': 0.16; 'naq': 0.16; 'ner': 0.16; "nera'g": 0.16; 'nygubhtu': 0.16; 'nzovthvgl,': 0.16; 'oernx': 0.16; 'onq': 0.16; 'orggre': 0.16; 'orngf': 0.16; 'ornhgvshy': 0.16; 'pbhagf.': 0.16; 'pbzcyrk': 0.16; 'pbzcyrk.': 0.16; 'pbzcyvpngrq.': 0.16; 'pnfrf': 0.16; 'qhgpu.': 0.16; 'qrafr.': 0.16; 'rabhtu': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reebef': 0.16; 'rkcynva,': 0.16; 'rkcyvpvg': 0.16; 'rkcyvpvgyl': 0.16; 'rnfl': 0.16; 'snpr': 0.16; 'subject:programming': 0.16; 'subject:random': 0.16; 'svefg': 0.16; 'syng': 0.16; 'tbbq': 0.16; 'terng': 0.16; 'thrff.': 0.16; 'ubaxvat': 0.16; 'uneq': 0.16; "vg'f": 0.16; 'vg.': 0.16; 'vqrn': 0.16; 'vqrn.': 0.16; 'vzcyvpvg.': 0.16; "yrg'f": 0.16; 'zber': 0.16; 'znl': 0.16; 'wrote:': 0.17; 'yield': 0.17; 'code,': 0.18; 'written': 0.20; 'import': 0.21; 'errors': 0.23; 'insert': 0.23; 'this:': 0.23; 'random': 0.24; 'header:In- Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'header:X -Complaints-To:1': 0.28; 'error': 0.30; 'code': 0.31; 'from:addr:yahoo.co.uk': 0.32; 'could': 0.32; 'print': 0.32; 'to:addr:python-list': 0.33; 'received:org': 0.36; 'skip:p 20': 0.36; 'october': 0.37; 'does': 0.37; 'being': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'mark': 0.38; 'nothing': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'mentioned': 0.63; 'start.': 0.84; 'received:2': 0.91 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
| Subject | Re: how to insert random error in a programming |
| Date | Mon, 15 Oct 2012 20:28:46 +0100 |
| References | <CA+b=61AiVYehyGbFyvyTqsfZeio1NoWKtw1SwJV_r_MZ1BcVwA@mail.gmail.com> <CAN1F8qVY3aEETMFhLn9+vTU2XZ+b3d0whzCuJqGvaJg_A+8XAA@mail.gmail.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-Gmane-NNTP-Posting-Host | host-2-97-74-3.as13285.net |
| User-Agent | Mozilla/5.0 (Windows NT 6.0; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 |
| In-Reply-To | <CAN1F8qVY3aEETMFhLn9+vTU2XZ+b3d0whzCuJqGvaJg_A+8XAA@mail.gmail.com> |
| X-Antivirus | avast! (VPS 121015-0, 15/10/2012), Outbound message |
| X-Antivirus-Status | Clean |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2234.1350329274.27098.python-list@python.org> (permalink) |
| Lines | 62 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1350329274 news.xs4all.nl 6966 [2001:888:2000:d::a6]:53406 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:31337 |
Show key headers only | View raw
On 15/10/2012 20:10, Joshua Landau wrote:
> On 15 October 2012 14:55, Debashish Saha <silideba@gmail.com> 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, {æ and æ[0]or object(): True}) [ł[0]] or [lambda: (yield
>> ire(((æ.append(object()), æ[0])[0], ł))), int][(ł>ł[:3])|(ł<=ł[:2])]() or
>> [1]][0]
>> print(list(list(ire([2, 3, 3]))[0]))
>
>
> Note that being random code this does nothing other than confuse people as
> to why it does what it does do even though that is nothing other than the
> mentioned confusion of others into its purpose.
>
>
>
I like clearly written code like this
"
s = """Gur Mra bs Clguba, ol Gvz Crgref
Ornhgvshy vf orggre guna htyl.
Rkcyvpvg vf orggre guna vzcyvpvg.
Fvzcyr vf orggre guna pbzcyrk.
Pbzcyrk vf orggre guna pbzcyvpngrq.
Syng vf orggre guna arfgrq.
Fcnefr vf orggre guna qrafr.
Ernqnovyvgl pbhagf.
Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf.
Nygubhtu cenpgvpnyvgl orngf chevgl.
Reebef fubhyq arire cnff fvyragyl.
Hayrff rkcyvpvgyl fvyraprq.
Va gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff.
Gurer fubhyq or bar-- naq cersrenoyl bayl bar --boivbhf jnl gb qb vg.
Nygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh'er Qhgpu.
Abj vf orggre guna arire.
Nygubhtu arire vf bsgra orggre guna *evtug* abj.
Vs gur vzcyrzragngvba vf uneq gb rkcynva, vg'f n onq vqrn.
Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn.
Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!"""
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])
"
--
Cheers.
Mark Lawrence.
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: how to insert random error in a programming Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-10-15 20:28 +0100
csiph-web