Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 489 for random (0.18 sec)

  1. guava-tests/test/com/google/common/primitives/ImmutableIntArrayTest.java

      }
    
      private static final Random RANDOM = new Random(42);
    
      public void testLength() {
        assertThat(ImmutableIntArray.of().length()).isEqualTo(0);
        assertThat(ImmutableIntArray.of(0).length()).isEqualTo(1);
        assertThat(ImmutableIntArray.of(0, 1, 3).length()).isEqualTo(3);
        assertThat(ImmutableIntArray.of(0, 1, 3).subArray(1, 1).length()).isEqualTo(0);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Thu Jun 01 09:32:35 GMT 2023
    - 20.2K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/collect/ConcurrentHashMultisetBasherTest.java

        }
      }
    
      private static class MutateTask implements Callable<int[]> {
        private final ConcurrentHashMultiset<String> multiset;
        private final ImmutableList<String> keys;
        private final Random random = new Random();
    
        private MutateTask(ConcurrentHashMultiset<String> multiset, ImmutableList<String> keys) {
          this.multiset = multiset;
          this.keys = keys;
        }
    
        @Override
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 5.8K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/collect/CollectionBenchmarkSampleData.java

      private final SpecialRandom random;
      private final double hitRate;
      private final int size;
    
      private final Set<Element> valuesInSet;
      private final Element[] queries;
    
      CollectionBenchmarkSampleData(int size) {
        this(true, new SpecialRandom(), 1.0, size);
      }
    
      CollectionBenchmarkSampleData(
          boolean isUserTypeFast, SpecialRandom random, double hitRate, int size) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Apr 17 15:49:06 GMT 2023
    - 4.2K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/internal/ws/WebSocketWriterTest.kt

      private val serverWriter =
        WebSocketWriter(
          isClient = false,
          sink = data,
          random = random,
          perMessageDeflate = false,
          noContextTakeover = false,
          minimumDeflateSize = 0L,
        )
      private val clientWriter =
        WebSocketWriter(
          isClient = true,
          sink = data,
          random = random,
          perMessageDeflate = false,
          noContextTakeover = false,
          minimumDeflateSize = 0L,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  5. android/guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java

      int factorialBound;
    
      @BeforeExperiment
      void setUp() {
        for (int i = 0; i < ARRAY_SIZE; i++) {
          factorials[i] = RANDOM_SOURCE.nextInt(factorialBound);
          slowFactorials[i] = RANDOM_SOURCE.nextInt(factorialBound);
          binomials[i] = RANDOM_SOURCE.nextInt(factorials[i] + 1);
        }
      }
    
      /** Previous version of BigIntegerMath.factorial, kept for timing purposes. */
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 3.3K bytes
    - Viewed (0)
  6. android/guava-tests/benchmark/com/google/common/math/IntMathBenchmark.java

          exponent[i] = randomExponent();
          factorial[i] = RANDOM_SOURCE.nextInt(50);
          binomial[i] = RANDOM_SOURCE.nextInt(factorial[i] + 1);
          positive[i] = randomPositiveBigInteger(Integer.SIZE - 1).intValue();
          nonnegative[i] = randomNonNegativeBigInteger(Integer.SIZE - 1).intValue();
          ints[i] = RANDOM_SOURCE.nextInt();
        }
      }
    
      @Benchmark
      int pow(int reps) {
        int tmp = 0;
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 3.2K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java

        hasher.putChar((char) 0x0201);
        hasher.assertBytes(new byte[] {1, 2});
      }
    
      public void testString() {
        Random random = new Random();
        for (int i = 0; i < 100; i++) {
          byte[] bytes = new byte[64];
          random.nextBytes(bytes);
          String s = new String(bytes, UTF_16LE); // so all random strings are valid
          assertEquals(
              new TestHasher().putUnencodedChars(s).hash(),
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.8K bytes
    - Viewed (0)
  8. guava-tests/benchmark/com/google/common/collect/MinMaxPriorityQueueBenchmark.java

      private Queue<Integer> queue;
    
      private final Random random = new Random();
    
      @BeforeExperiment
      void setUp() {
        queue = heap.create(comparator.get());
        for (int i = 0; i < size; i++) {
          queue.add(random.nextInt());
        }
      }
    
      @Benchmark
      void pollAndAdd(int reps) {
        for (int i = 0; i < reps; i++) {
          // TODO(kevinb): precompute random #s?
          queue.add(queue.poll() ^ random.nextInt());
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Apr 19 19:24:36 GMT 2023
    - 4.3K bytes
    - Viewed (0)
  9. guava-tests/benchmark/com/google/common/collect/InternersBenchmark.java

        for (int i = 0; i < reps; i++) {
          String unused = interner.intern(Double.toHexString(Math.random()));
        }
        return reps;
      }
    
      @Benchmark
      int strongInterner(int reps) {
        Interner<String> interner = Interners.newStrongInterner();
        for (int i = 0; i < reps; i++) {
          String unused = interner.intern(Double.toHexString(Math.random()));
        }
        return reps;
      }
    
      @Benchmark
      int stringIntern(int reps) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Mar 04 04:06:35 GMT 2022
    - 1.4K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/hash/HashingTest.java

      }
    
      public void testCombineOrdered_randomHashCodes() {
        Random random = new Random(7);
        List<HashCode> hashCodes = Lists.newArrayList();
        for (int i = 0; i < 10; i++) {
          hashCodes.add(HashCode.fromLong(random.nextLong()));
        }
        HashCode hashCode1 = Hashing.combineOrdered(hashCodes);
        Collections.shuffle(hashCodes, random);
        HashCode hashCode2 = Hashing.combineOrdered(hashCodes);
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 26.5K bytes
    - Viewed (0)
Back to top