Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #64629
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <vincent@vincentdavis.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.014 |
| X-Spam-Evidence | '*H*': 0.97; '*S*': 0.00; 'else:': 0.03; 'ascii': 0.09; 'lookup': 0.09; 'received:209.85.219': 0.09; 'subject:string': 0.09; 'python': 0.11; 'def': 0.12; 'jan': 0.12; '23,': 0.16; 'bytearray': 0.16; 'nameerror:': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'to:name:python-list@python.org': 0.22; '>': 0.26; 'defined': 0.27; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'factor': 0.31; 'noted': 0.31; 'extend': 0.32; 'run': 0.32; 'received:209.85': 0.35; 'convert': 0.35; 'subject:lists': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'sequence': 0.36; 'method': 0.36; 'should': 0.36; 'received:209': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'first': 0.61; 'name': 0.63; 'skip:\xe2 10': 0.65; 'n):': 0.84; 'otten': 0.84; '8bit%:33': 0.91 |
| X-Google-DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=Kxi+uHXRbtaMW+dufg/GunzpVe4ZwXJktd8oJkJexh0=; b=errHjL0519QRnUADnY7dA/VIwRZCTc3b430H1Fgi9lkrTBn0Vjvg1jnJosNm7Cg9rJ Xe2jZplgQMiYWrn6vy8xJZ5Z79q2I4iRx5iceoe8uPhgN/GtpuorUJJZMChlRVhOWzNE vn5uT73vsouaS28KBmCGN8FcdVFkOD6AT91XNjb6pn2UNXBDoWetVnsoMs0ohkrcjpC3 bMjY9o4kyK6DgHUVb5J6TpBdZVNsD+2e14dzTyB8eDskD1TWqq6rGTFwfVfIyN7gHj90 H7VXnQPIT/rvS4wNK49v+6OtbVOYjyURrKganLqu7gWGVOdjoOf7I9ecDcxheeLd1mqD QemQ== |
| X-Gm-Message-State | ALoCoQniSpOyM/yNAwguCTSdbGmCHsIZq8QfOKQW0/gHKAv9MliFjfvTu2VAG8uo8C5XGC1AUmq6 |
| X-Received | by 10.182.146.104 with SMTP id tb8mr2319845obb.54.1390506637205; Thu, 23 Jan 2014 11:50:37 -0800 (PST) |
| MIME-Version | 1.0 |
| In-Reply-To | <lbrlel$vpq$1@ger.gmane.org> |
| References | <CALyJZZVU+j64Jn7fqqzLmwW+KcM=43UMKjo=HW7umnq8MSP2Uw@mail.gmail.com> <lbrjjq$96p$1@ger.gmane.org> <lbrlel$vpq$1@ger.gmane.org> |
| From | Vincent Davis <vincent@vincentdavis.net> |
| Date | Thu, 23 Jan 2014 13:50:17 -0600 |
| Subject | Re: generate De Bruijn sequence memory and string vs lists |
| To | "python-list@python.org" <python-list@python.org> |
| Content-Type | multipart/alternative; boundary=f46d04451a392b38c004f0a88e4d |
| 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 | <https://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 | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.5905.1390506641.18130.python-list@python.org> (permalink) |
| Lines | 72 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1390506641 news.xs4all.nl 2953 [2001:888:2000:d::a6]:35200 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:64629 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
On Thu, Jan 23, 2014 at 12:02 PM, Peter Otten <__peter__@web.de> wrote: > > I just noted that the first Python loop can be eliminated: > > def debruijn(k, n): > a = k * n * bytearray([0]) > sequence = bytearray() > extend = sequence.extend # factor out method lookup > def db(t, p): > if t > n: > if n % p == 0: > extend(a[1: p+1]) > else: > a[t] = a[t - p] > db(t + 1, p) > for j in xrange(a[t - p] + 1, k): > a[t] = j > db(t + 1, t) > db(1, 1) > return sequence.translate(_mapping) I am not really sure what _mapping should be. The code above does not run because NameError: global name '_mapping' is not defined I tried to get the bytearray sequence to convert to ascii but don't know how to. Vincent Davis
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: generate De Bruijn sequence memory and string vs lists Vincent Davis <vincent@vincentdavis.net> - 2014-01-23 13:50 -0600
csiph-web