Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 489 for random (0.28 sec)

  1. android/guava-tests/test/com/google/common/graph/NetworkMutationTest.java

      @Test
      public void undirectedNetwork() {
        testNetworkMutation(NetworkBuilder.undirected());
      }
    
      private static void testNetworkMutation(NetworkBuilder<? super Integer, Object> networkBuilder) {
        Random gen = new Random(42); // Fixed seed so test results are deterministic.
    
        for (int trial = 0; trial < NUM_TRIALS; ++trial) {
          MutableNetwork<Integer, Object> network =
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Apr 10 19:42:18 GMT 2024
    - 4.5K bytes
    - Viewed (0)
  2. internal/crypto/key.go

    // (crypto/rand) is used.
    func GenerateIV(random io.Reader) (iv [32]byte) {
    	if random == nil {
    		random = rand.Reader
    	}
    	if _, err := io.ReadFull(random, iv[:]); err != nil {
    		logger.CriticalIf(context.Background(), errOutOfEntropy)
    	}
    	return iv
    }
    
    // SealedKey represents a sealed object key. It can be stored
    // at an untrusted location.
    type SealedKey struct {
    	Key       [64]byte // The encrypted and authenticated object-key.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Mar 19 20:28:10 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  3. android/guava-tests/benchmark/com/google/common/primitives/UnsignedLongsBenchmark.java

    import com.google.caliper.Benchmark;
    import java.util.Random;
    
    /**
     * Benchmarks for certain methods of {@code UnsignedLongs}.
     *
     * @author Eamonn McManus
     */
    public class UnsignedLongsBenchmark {
      private static final int ARRAY_SIZE = 0x10000;
      private static final int ARRAY_MASK = 0x0ffff;
      private static final Random RANDOM_SOURCE = new Random(314159265358979L);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.3K bytes
    - Viewed (0)
  4. src/main/java/org/codelibs/fess/helper/AccessTokenHelper.java

    public class AccessTokenHelper {
    
        protected static final String BEARER = "Bearer";
    
        protected Random random = new SecureRandom();
    
        public String generateAccessToken() {
            return RandomStringUtils.random(ComponentUtil.getFessConfig().getApiAccessTokenLengthAsInteger(), 0, 0, true, true, null, random);
        }
    
        public String getAccessTokenFromRequest(final HttpServletRequest request) {
    Java
    - Registered: Mon Apr 29 08:04:11 GMT 2024
    - Last Modified: Thu Feb 22 01:37:57 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  5. guava-tests/benchmark/com/google/common/collect/MultipleSetContainsBenchmark.java

      @BeforeExperiment
      void setUp() {
        if (emptySetProportion + singletonSetProportion > 1.01) {
          throw new SkipThisScenarioException();
        }
    
        Random rng = new Random();
        for (int i = 0; i < 0x1000; i++) {
          double setSize = rng.nextDouble();
          if (setSize < emptySetProportion) {
            sets[i] = ImmutableSet.of();
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 20:09:59 GMT 2024
    - 2.3K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/hash/BloomFilterTest.java

      private static final int NUM_PUTS = 100_000;
      private static final ThreadLocal<Random> random =
          new ThreadLocal<Random>() {
            @Override
            protected Random initialValue() {
              return new Random();
            }
          };
    
      private static final int GOLDEN_PRESENT_KEY = random.get().nextInt();
    
      @AndroidIncompatible // OutOfMemoryError
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Nov 09 22:49:56 GMT 2023
    - 21.3K bytes
    - Viewed (0)
  7. android/guava-tests/benchmark/com/google/common/base/AsciiBenchmark.java

      @Param({"20", "2000"})
      int size;
    
      @Param({"2", "20"})
      int nonAlphaRatio; // one non-alpha char per this many chars
    
      @Param boolean noWorkToDo;
    
      Random random;
      String testString;
    
      @BeforeExperiment
      void setUp() {
        random = new Random(0xdeadbeef); // fix the seed so results are comparable across runs
    
        int nonAlpha = size / nonAlphaRatio;
        int alpha = size - nonAlpha;
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.8K bytes
    - Viewed (0)
  8. internal/crypto/key_test.go

    	}
    }
    
    var generateKeyTests = []struct {
    	ExtKey     [32]byte
    	Random     io.Reader
    	ShouldPass bool
    }{
    	{ExtKey: [32]byte{}, Random: nil, ShouldPass: true},              // 0
    	{ExtKey: [32]byte{}, Random: rand.Reader, ShouldPass: true},      // 1
    	{ExtKey: [32]byte{}, Random: shortRandom(32), ShouldPass: true},  // 2
    	{ExtKey: [32]byte{}, Random: shortRandom(31), ShouldPass: false}, // 3
    }
    
    func TestGenerateKey(t *testing.T) {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Feb 02 00:13:57 GMT 2024
    - 6.8K bytes
    - Viewed (0)
  9. android/guava-tests/benchmark/com/google/common/collect/MultisetIteratorBenchmark.java

        treeMultiset = TreeMultiset.create();
    
        Random random = new Random();
    
        int sizeRemaining = size;
    
        // TODO(kevinb): generate better test contents for multisets
        for (int i = 0; sizeRemaining > 0; i++) {
          // The JVM will return interned values for small ints.
          Integer value = random.nextInt(1000) + 128;
          int count = Math.min(random.nextInt(10) + 1, sizeRemaining);
          sizeRemaining -= count;
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.6K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/math/MathBenchmarking.java

       * result is chosen from those possibilities uniformly at random.
       *
       * <p>Zero is treated as having log2 == 0.
       */
      static double randomDouble(int maxExponent) {
        double result = RANDOM_SOURCE.nextDouble();
        result = Math.scalb(result, RANDOM_SOURCE.nextInt(maxExponent + 1));
        return RANDOM_SOURCE.nextBoolean() ? result : -result;
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.1K bytes
    - Viewed (0)
Back to top