Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 368 for random (0.17 sec)

  1. guava-tests/test/com/google/common/hash/HashTestUtils.java

          assertHashLongEquivalence(hashFunction, random);
          assertHashStringEquivalence(hashFunction, random);
          assertHashStringWithSurrogatesEquivalence(hashFunction, random);
        }
      }
    
      private static void assertHashBytesEquivalence(HashFunction hashFunction, Random random) {
        int size = random.nextInt(2048);
        byte[] bytes = new byte[size];
        random.nextBytes(bytes);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 25.3K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/hash/HashTestUtils.java

          assertHashLongEquivalence(hashFunction, random);
          assertHashStringEquivalence(hashFunction, random);
          assertHashStringWithSurrogatesEquivalence(hashFunction, random);
        }
      }
    
      private static void assertHashBytesEquivalence(HashFunction hashFunction, Random random) {
        int size = random.nextInt(2048);
        byte[] bytes = new byte[size];
        random.nextBytes(bytes);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 25.3K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/primitives/ImmutableLongArrayTest.java

      }
    
      private static final Random RANDOM = new Random(42);
    
      public void testLength() {
        assertThat(ImmutableLongArray.of().length()).isEqualTo(0);
        assertThat(ImmutableLongArray.of(0).length()).isEqualTo(1);
        assertThat(ImmutableLongArray.of(0, 1, 3).length()).isEqualTo(3);
        assertThat(ImmutableLongArray.of(0, 1, 3).subArray(1, 1).length()).isEqualTo(0);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Jun 01 09:32:35 GMT 2023
    - 19K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/primitives/ImmutableDoubleArrayTest.java

      }
    
      private static final Random RANDOM = new Random(42);
    
      public void testLength() {
        assertThat(ImmutableDoubleArray.of().length()).isEqualTo(0);
        assertThat(ImmutableDoubleArray.of(0).length()).isEqualTo(1);
        assertThat(ImmutableDoubleArray.of(0, 1, 3).length()).isEqualTo(3);
        assertThat(ImmutableDoubleArray.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
    - 21.3K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/util/concurrent/AtomicLongMapTest.java

    import java.util.Map;
    import java.util.Random;
    import java.util.Set;
    import junit.framework.TestCase;
    
    /**
     * Tests for {@link AtomicLongMap}.
     *
     * @author mike nonemacher
     */
    @GwtCompatible(emulated = true)
    public class AtomicLongMapTest extends TestCase {
      private static final int ITERATIONS = 100;
      private static final int MAX_ADDEND = 100;
    
      private final Random random = new Random(301);
    
      @J2ktIncompatible
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 17.4K bytes
    - Viewed (0)
  6. cmd/benchmark-utils_test.go

    }
    
    // randomly picks a character and returns its equivalent byte array.
    func getRandomByte() []byte {
    	const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
    	// seeding the random number generator.
    	rand.Seed(UTCNow().UnixNano())
    	// pick a character randomly.
    	return []byte{letterBytes[rand.Intn(len(letterBytes))]}
    }
    
    // picks a random byte and repeats it to size bytes.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Dec 23 15:46:00 GMT 2022
    - 8.2K bytes
    - Viewed (0)
  7. android/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 May 03 12:43:13 GMT 2024
    - Last Modified: Wed Apr 19 19:24:36 GMT 2023
    - 4.3K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java

        sink.assertBytes(new byte[] {1, 2, 0, 0}); // padded with zeros
      }
    
      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 Sink(4).putUnencodedChars(s).hash(),
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.5K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/collect/MinMaxPriorityQueueTest.java

        long seed = new Random().nextLong();
        Random random = new Random(seed);
        insertRandomly(elements, q, random);
        return seed;
      }
    
      private static void insertRandomly(
          ArrayList<Integer> elements, MinMaxPriorityQueue<Integer> q, Random random) {
        while (!elements.isEmpty()) {
          int selectedIndex = random.nextInt(elements.size());
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Mar 07 18:34:03 GMT 2024
    - 36.1K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/cache/Striped64.java

       * class-unloading when ThreadLocals are not removed.
       */
      static final ThreadLocal<int @Nullable []> threadHashCode = new ThreadLocal<>();
    
      /** Generator of new random hash codes */
      static final Random rng = new Random();
    
      /** Number of CPUS, to place bound on table size */
      static final int NCPU = Runtime.getRuntime().availableProcessors();
    
      /** Table of cells. When non-null, size is a power of 2. */
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 11.5K bytes
    - Viewed (0)
Back to top