Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.035 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'result,': 0.07; 'random': 0.14; 'entry.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'roy': 0.16; 'wrote:': 0.18; 'wed,': 0.18; '(but': 0.19; 'import': 0.22; 'print': 0.22; 'subject:Code': 0.24; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'message- id:@mail.gmail.com': 0.30; 'received:google.com': 0.35; 'thanks': 0.36; "i'll": 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'skip:l 50': 0.60; "you're": 0.61; 'smith': 0.68; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=zdspmtSscEKQmJoxkgwX4nw4eb+lG+SQB2vKU5vh+9w=; b=yQKQ5nmVAXAqW2U41vDKNG6H0ud3vhmQQcf3qrQglDtnrF+7s5VyVXplsahmebMOVv /L1Ht5C+hUQVW1tKS5/UA6Z5CIkbT/GL/1p6iaTEg4AjdzPmj3tEvorKQN5vq54rDWdc T5UD5BsjwO9jp+EFn8w1E3i5SNNhwNIZELodJ/dp4SDgtsM/HwJtHvMJwWV0MKV/rRM/ EMXLysL/W0lu2c4csASGX5esgeYpp9onMbqXGNZQxZY63h1aeJb3TbJ3jHDmBQmsLO5n kxYW2cvptUriV6IjXGcvMFXMaWsnTEF8WMboEcc2snGQknmIWpFC6211Rsq0Jt+MZuhz Qpyw== MIME-Version: 1.0 X-Received: by 10.68.13.104 with SMTP id g8mr5196205pbc.33.1381284602262; Tue, 08 Oct 2013 19:10:02 -0700 (PDT) In-Reply-To: References: <68365e43-498f-4ad2-bac3-6a02938159c7@googlegroups.com> Date: Wed, 9 Oct 2013 13:10:02 +1100 Subject: Re: Code golf challenge: XKCD 936 passwords From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1381284610 news.xs4all.nl 15935 [2001:888:2000:d::a6]:50350 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:56462 On Wed, Oct 9, 2013 at 12:38 PM, Roy Smith wrote: > If you're willing to accept a sub-optimal random number generator: > > # Python-2, sorry > import os > print list(set(open('/usr/share/dict/words')))[os.getpid():][:4] So that steps by your pid? That's going to drastically reduce the entropy in the result, which is kinda the point of XKCD 936. I'll call that one dubious... though it's still better than Rob's entry. (But thanks Rob, I do like that one :) ) ChrisA