Re: [lang] Shuffling arrays (was: [RNG] Scope of "Commons RNG")

2016-10-07 Thread sebb
On 27 September 2016 at 12:22, Gilles wrote: > Hi. > > On Tue, 27 Sep 2016 12:53:33 +0200, Emmanuel Bourg wrote: >> >> Le 27/09/2016 à 01:14, Gilles a écrit : >> > * Shuffling algorithm (cf. Commons Math's "o.a.c.m.MathArrays"), This should go in

Re: [lang] Shuffling arrays

2016-09-30 Thread Gilles
On Fri, 30 Sep 2016 11:34:10 -0500, Matt Sicker wrote: I thought he meant that if your code works with either Random or SecureRandom, you're doing it wrong. They both have very different use cases, and the fact that SecureRandom extends Random contributes to the confusion. Indeed. [I should

Re: [lang] Shuffling arrays

2016-09-30 Thread Gilles
On Fri, 30 Sep 2016 15:02:40 +0200, Emmanuel Bourg wrote: Le 28/09/2016 à 15:28, Gilles a écrit : Conversely, using "SecureRandom" in place of a deterministic RNG is only useful in toy applications since the main feature (of non-secure RNGs) one usually needs is reproducibility. I guess the

Re: [lang] Shuffling arrays

2016-09-30 Thread Matt Sicker
I thought he meant that if your code works with either Random or SecureRandom, you're doing it wrong. They both have very different use cases, and the fact that SecureRandom extends Random contributes to the confusion. On 30 September 2016 at 08:02, Emmanuel Bourg wrote: > Le

Re: [lang] Shuffling arrays

2016-09-30 Thread Emmanuel Bourg
Le 28/09/2016 à 15:28, Gilles a écrit : > Conversely, using "SecureRandom" in place of a deterministic > RNG is only useful in toy applications since the main feature > (of non-secure RNGs) one usually needs is reproducibility. I guess the Tomcat developers will love hearing they are building a

Re: [lang] Shuffling arrays

2016-09-28 Thread Jochen Wiedmann
On Wed, Sep 28, 2016 at 4:55 PM, Gilles wrote: > Do you mean that CL must define its own interface, say Yes, of course. Btw: Note, that commons-crypto does the same [1]. Jochen 1:

Re: [lang] Shuffling arrays

2016-09-28 Thread Gary Gregory
I would expect that we provide implementations of this new interface for all JRE random classes. On Wed, Sep 28, 2016 at 7:55 AM, Gilles wrote: > On Wed, 28 Sep 2016 15:55:34 +0200, Jochen Wiedmann wrote: > >> On Wed, Sep 28, 2016 at 1:40 PM, Gilles

Re: [lang] Shuffling arrays

2016-09-28 Thread Gilles
On Wed, 28 Sep 2016 15:55:34 +0200, Jochen Wiedmann wrote: On Wed, Sep 28, 2016 at 1:40 PM, Gilles wrote: If not, then random utilities are not best located in Commons Lang, because indeed the no-dep requirement forces you to go through "java.util.Random" which

Re: [lang] Shuffling arrays

2016-09-28 Thread Jochen Wiedmann
On Wed, Sep 28, 2016 at 1:40 PM, Gilles wrote: > If not, then random utilities are not best located in Commons Lang, > because indeed the no-dep requirement forces you to go through > "java.util.Random" which is bad (TM) for several reasons, mentioned > here, there,

Re: [lang] Shuffling arrays

2016-09-28 Thread Gilles
On Wed, 28 Sep 2016 13:47:49 +0200, Emmanuel Bourg wrote: Le 28/09/2016 à 13:40, Gilles a écrit : If not, then random utilities are not best located in Commons Lang, because indeed the no-dep requirement forces you to go through "java.util.Random" which is bad (TM) for several reasons,

Re: [lang] Shuffling arrays

2016-09-28 Thread Emmanuel Bourg
Le 28/09/2016 à 13:40, Gilles a écrit : > If not, then random utilities are not best located in Commons Lang, > because indeed the no-dep requirement forces you to go through > "java.util.Random" which is bad (TM) for several reasons, mentioned > here, there, and everywhere. I agree

Re: [lang] Shuffling arrays

2016-09-28 Thread Gilles
On Tue, 27 Sep 2016 18:41:59 -0700, Gary Gregory wrote: +1: [lang] is a low-level library, which should not have any deps. This is fine as a requirement. But then why don't you draw all the conclusions from that, including that its scope must be limited, lest the goal is for CL to contain all

Re: [lang] Shuffling arrays

2016-09-27 Thread Gary Gregory
+1: [lang] is a low-level library, which should not have any deps. Gary On Tue, Sep 27, 2016 at 5:55 PM, Brent Worden wrote: > There are no good reasons for a component such as commons-lang to have any > runtime dependencies beside Java itself. The commons-lang install

Re: [lang] Shuffling arrays

2016-09-27 Thread Brent Worden
There are no good reasons for a component such as commons-lang to have any runtime dependencies beside Java itself. The commons-lang install base is enormous with very diverse usage patterns. Having it coupled to another libraries, regardless of the maintainer, invites all kinds of classloading

Re: [lang] Shuffling arrays

2016-09-27 Thread Gilles
On Tue, 27 Sep 2016 13:57:04 +0200, Emmanuel Bourg wrote: Le 27/09/2016 à 13:22, Gilles a écrit : I (strongly) suggest ArraysUtils.shuffle(Object[] array, o.a.c.rng.UniformRandomProvider rnd) That's not possible, because we don't want to add external dependencies to commons-lang. I

Re: [lang] Shuffling arrays

2016-09-27 Thread Emmanuel Bourg
Le 27/09/2016 à 13:22, Gilles a écrit : > I (strongly) suggest > > ArraysUtils.shuffle(Object[] array, o.a.c.rng.UniformRandomProvider rnd) That's not possible, because we don't want to add external dependencies to commons-lang. > Moreover, the default RNG should be a good one, i.e. not >

Re: [lang] Shuffling arrays (was: [RNG] Scope of "Commons RNG")

2016-09-27 Thread Gilles
Hi. On Tue, 27 Sep 2016 12:53:33 +0200, Emmanuel Bourg wrote: Le 27/09/2016 à 01:14, Gilles a écrit : * Shuffling algorithm (cf. Commons Math's "o.a.c.m.MathArrays"), This should go in the ArrayUtils class of commons-lang, with a java.util.Random parameter. I don't get that. The idea is

Re: [lang] Shuffling arrays (was: [RNG] Scope of "Commons RNG")

2016-09-27 Thread Emmanuel Bourg
Le 27/09/2016 à 01:14, Gilles a écrit : >>> * Shuffling algorithm (cf. Commons Math's "o.a.c.m.MathArrays"), >> >> This should go in the ArrayUtils class of commons-lang, with a >> java.util.Random parameter. > > I don't get that. > The idea is to parameterize the utilities with a