In article ,
Nick Cash wrote:
> >> # Python-2, sorry
> >> import os
> >> print list(set(open('/usr/share/dict/words')))[os.getpid():][:4]
>
> > So that steps by your pid?
>
> Not really. It seems to rely on list(set(...)) kinda randomizing order...
> which is definitely not safe without hash
On Tue, Oct 8, 2013, at 18:27, Rob Day wrote:
> On 08/10/13 07:17, Chris Angelico wrote:
> > Who's up for some fun? Implement an XKCD-936-compliant password
> > generator in Python 3, in less code than this:
> >
> > print(*__import__("random").sample(open("/usr/share/dict/words").read().split("\n")
>> # Python-2, sorry
>> import os
>> print list(set(open('/usr/share/dict/words')))[os.getpid():][:4]
> So that steps by your pid?
Not really. It seems to rely on list(set(...)) kinda randomizing order... which
is definitely not safe without hash randomization.
But this brings up an interest
On Tue, 08 Oct 2013 23:27:51 +0100, Rob Day wrote:
> print("imploring epsilon decamp graveyard's") # Chosen by fair random
> sampling, guaranteed to be random
>
> Comments don't count as code, right? ;)
"cat cat cat cat..."
That's the trouble with random, you can never quite tell.
--
Steven
In article ,
Chris Angelico wrote:
> 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 p
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
On Monday, October 7, 2013 8:17:21 PM UTC-10, Chris Angelico wrote:
> > print(*__import__("random").sample(open("/usr/share/dict/words").read().spli
> > t("\n"),4))
In article <68365e43-498f-4ad2-bac3-6a0293815...@googlegroups.com>,
sprucebond...@gmail.com wrote:
> import random as r
> print(*
On 08/10/13 07:17, Chris Angelico wrote:
Who's up for some fun? Implement an XKCD-936-compliant password
generator in Python 3, in less code than this:
print(*__import__("random").sample(open("/usr/share/dict/words").read().split("\n"),4))
print("imploring epsilon decamp graveyard's")
# Chose
On Wed, Oct 9, 2013 at 7:27 AM, wrote:
> On Tuesday, October 8, 2013 5:47:56 AM UTC-10, rand...@fastmail.us wrote:
>> Importing random as r doesn't actually save anything, since " as r" is
>> the same five characters you saved from the one use of it.
>
> I realize, it just looks nicer than the or
On Tuesday, October 8, 2013 5:47:56 AM UTC-10, rand...@fastmail.us wrote:
> Importing random as r doesn't actually save anything, since " as r" is
> the same five characters you saved from the one use of it.
I realize, it just looks nicer than the original __import__, and since it
doesn't add any
On 10/07/2013 11:17 PM, Chris Angelico wrote:
Who's up for some fun? Implement an XKCD-936-compliant password
generator in Python 3, in less code than this:
print(*__import__("random").sample(open("/usr/share/dict/words").read().split("\n"),4))
Second challenge: Use it for generating all your p
On 10/08/2013 09:07 AM, Tim Chase wrote:
On 2013-10-08 15:36, Denis McMahon wrote:
On Tue, 08 Oct 2013 08:33:48 -0400, Roy Smith wrote:
In the old days, it used to be /usr/dict/words. Port Python to
v6, and save another 6 characters :-)
Doesn't matter where it is, a link to it exists at "/w"
On 2013-10-08 17:17, Chris Angelico wrote:
> Who's up for some fun? Implement an XKCD-936-compliant password
> generator in Python 3, in less code than this:
>
> print(*__import__("random").sample(open("/usr/share/dict/words").read().split("\n"),4))
>
> Second challenge: Use it for generating all
On 2013-10-08 15:36, Denis McMahon wrote:
> On Tue, 08 Oct 2013 08:33:48 -0400, Roy Smith wrote:
> > In the old days, it used to be /usr/dict/words. Port Python to
> > v6, and save another 6 characters :-)
>
> Doesn't matter where it is, a link to it exists at "/w" now ;)
You prodigal...wasting
On Tue, Oct 8, 2013, at 2:45, sprucebond...@gmail.com wrote:
> On Monday, October 7, 2013 8:17:21 PM UTC-10, Chris Angelico wrote:
> > print(*__import__("random").sample(open("/usr/share/dict/words").read().split("\n"),4))
> > # 87
>
> import random as r
> print(*r.sample(open("/usr/share/dict/wo
On Tue, 08 Oct 2013 08:33:48 -0400, Roy Smith wrote:
> In article ,
> Chris Angelico wrote:
>
>> On Tue, Oct 8, 2013 at 5:48 PM, wrote:
>> > And if we were actually trying then that filename should just be
>> > "/w".
>> > Would get rid of another 19 chars.
>>
>> I'm working this on the assum
In article ,
Chris Angelico wrote:
> On Tue, Oct 8, 2013 at 5:48 PM, wrote:
> > And if we were actually trying then that filename should just be "/w".
> > Would get rid of another 19 chars.
>
> I'm working this on the assumption that the dictionary file already
> exists (that's where it is o
On 08/10/2013 07:48, sprucebond...@gmail.com wrote:
On Monday, October 7, 2013 8:45:39 PM UTC-10, spruce...@gmail.com wrote:
On Monday, October 7, 2013 8:17:21 PM UTC-10, Chris Angelico wrote:
Who's up for some fun? Implement an XKCD-936-compliant password
generator in Python 3, in less code t
On Tue, Oct 8, 2013 at 6:02 PM, Steve Simmons wrote:
> Typical MUD Master - making up rules as you go along :-)
Totally. Under the auspices of Rule Zero:
http://tvtropes.org/pmwiki/pmwiki.php/Main/RuleOfFun
:)
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
Chris Angelico wrote:
>On Tue, Oct 8, 2013 at 5:48 PM, wrote:
>> And if we were actually trying then that filename should just be
>"/w". Would get rid of another 19 chars.
>
>I'm working this on the assumption that the dictionary file already
>exists (that's where it is on my Debian Linux system
On Tue, Oct 8, 2013 at 5:48 PM, wrote:
> And if we were actually trying then that filename should just be "/w". Would
> get rid of another 19 chars.
I'm working this on the assumption that the dictionary file already
exists (that's where it is on my Debian Linux systems, for instance)
and shoul
On Monday, October 7, 2013 8:45:39 PM UTC-10, spruce...@gmail.com wrote:
> On Monday, October 7, 2013 8:17:21 PM UTC-10, Chris Angelico wrote:
>
> > Who's up for some fun? Implement an XKCD-936-compliant password
>
> >
>
> > generator in Python 3, in less code than this:
>
> >
>
> >
>
> >
On Monday, October 7, 2013 8:17:21 PM UTC-10, Chris Angelico wrote:
> Who's up for some fun? Implement an XKCD-936-compliant password
>
> generator in Python 3, in less code than this:
>
>
>
> print(*__import__("random").sample(open("/usr/share/dict/words").read().split("\n"),4))
>
>
>
> Sec
23 matches
Mail list logo