Quite often I have a desire to take a list and put it into a random
order. So I wrote a program to do it. Now, I've spend a reasonable
amount of time fettling the algorithm, but it's still basically a Perl
program.
(Algorithm: set up a list 0..n of indices; iterate a over 0..n, each
time
Roger Burton West ro...@firedrake.org writes:
Over a 180K-entry corpus, it's taking around four and a half seconds, as
against the 0.6 seconds of my Perl program.
I was going to suggest you tell it to use /dev/urandom somehow. Except
that it already is.
--random-source=FILE
On 9 Dec 2009, at 12:19, Roger Burton West wrote:
[...]
Over a 180K-entry corpus, it's taking around four and a half
seconds, as
against the 0.6 seconds of my Perl program.
Impressive. The source for the GNU utility is sure to be, umm,
instructive. I'll go and have a giggle now...
On Wed, Dec 09, 2009 at 01:28:16PM +, Peter Corlett wrote:
Incidentally, how long does your Perl program take if you use shuffle()
from List::Util instead?
About 0.3 seconds.
I don't think List::Util was part of the core when I wrote mine.
R
On 9 Dec 2009, at 12:19, Roger Burton West wrote:
[...]
Now GNU sort has grown a -R option which does basically the same
thing.
GNU sort is in C, so that might be faster, right?
You know, I wish I hadn't looked at the source now. It seems to mainly
involve using a random comparison
On 9 Dec 2009, at 13:32, Peter Corlett wrote:
[an identical copy of another message that I sent just the once.]
Here's some more software hate: Apple's Mail.app. No need to elaborate.
Roger Burton West writes:
... take a list and put it into a random order... a Perl program. Now
GNU sort has grown a -R option which does basically the same thing.
GNU sort is in C, so that might be faster, right?
The doc for -R says:
-R, --random-sort
sort by random hash of keys
On Wed, Dec 09, 2009 at 02:24:40PM +, Smylers wrote:
It seems that Debian includes a shuf command in coreutils, which is even
faster than bogosort -n.
Why don't people tell me these things?
Oh. You did. Never mind then.
R
Roger Burton West writes:
On Wed, Dec 09, 2009 at 02:24:40PM +, Smylers wrote:
It seems that Debian includes a shuf command in coreutils, which is
even faster than bogosort -n.
Why don't people tell me these things?
Oh. You did. Never mind then.
Not so fast -- there's definitely
Smylers smyl...@stripey.com writes:
But then shuf is a single command optimized for a single purpose, with
no unrelated features bolted on -- can't see that kind of thing catching
on ...
GNU is *not* Unix.
Matthew
--
I must take issue with the term a mere child, for it has been my
On Wed, Dec 09, 2009 at 02:24:40PM +, Smylers wrote:
Roger Burton West writes:
... take a list and put it into a random order... a Perl program. Now
GNU sort has grown a -R option which does basically the same thing.
GNU sort is in C, so that might be faster, right?
The doc for -R
I've been having a particularly bad day with Magento today and I'm feeling in a
ranty mood, so here goes.
Magento is a PHP online store application, designed to be enterprise. Three
things in that sentence should make you want to scream. As far as I can tell,
it's designed to generate
On 9 Dec 2009, at 16:33, James Laver wrote:
[...]
It's just a gigantic ball of hate and it dragged me off my lunch
TWICE today to fix the fucking thing.
http://twitter.com/techpractical/status/6496487194
Lunch, huh? Not an unreasonable response to Magento, mind.
FOAD.
I could comment on
13 matches
Mail list logo