7
votes
1answer
4k views

OAuth Provider token generation

I'm currently creating an OAuth provider in Java using Jersey. To the best of my knowledge Jersey does not provide a method to create oauth tokens so I'm creating my own. For those unfamiliar with ...
4
votes
3answers
132 views

Extending java.util.Random.nextInt(int) into nextLong(long)

In java.util.Random the Oracle implementation of nextInt(int) is as follows: public int nextInt(int n) { if (n <= 0) throw new IllegalArgumentException("n must be positive"); if ...
1
vote
4answers
98 views

Can you review my random number wrapper class

I made this class to handle any min max integer value and return a random number in the entered parameter range. I tested it to work with all combinations(I think). But is this totally wrong or ...
1
vote
1answer
78 views

Discrete random variable generator

There is my SSCCE to generate a value of discrete random variable. values is set of value the RV can take and procents is equivalent to discrete pdf. Can you anticipate any issue with this snippet? ...
1
vote
2answers
51 views

Shuffling algorithm suitable?

Just checking that this shuffling algorithm is suitable. Or maybe there could be improvements? public static void shuffleArray(Object[] arr, Random rnd){ int lastIndex = arr.length - 1; for ...