- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 334 for randomOp (0.18 sec)
-
android/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(),
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Tue Jul 23 14:22:54 UTC 2024 - 3.8K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/internal/ws/RealWebSocketTest.kt
// zero effect on the behavior of the WebSocket API which is why tests are only written once // from the perspective of a single peer. private val random = Random(0) private val client2Server = Pipe(8192L) private val server2client = Pipe(8192L) private val taskFaker = TaskFaker() private val client = TestStreams(true, taskFaker, server2client, client2Server)
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Thu Apr 11 01:59:58 UTC 2024 - 18.5K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/internal/http2/HuffmanTest.kt
val s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" for (i in s.indices) { assertRoundTrip(s.substring(0, i).encodeUtf8()) } val random = Random(123456789L) val buf = ByteArray(4096) random.nextBytes(buf) assertRoundTrip(buf.toByteString()) } private fun assertRoundTrip(data: ByteString) { val encodeBuffer = Buffer() encode(data, encodeBuffer)
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Thu Jan 04 05:32:07 UTC 2024 - 1.8K bytes - Viewed (0) -
guava-tests/test/com/google/common/hash/BloomFilterTest.java
assertTrue(BloomFilter.optimalNumOfBits(n, fpp) >= 0); } } // some random values Random random = new Random(0); for (int repeats = 0; repeats < 10000; repeats++) { assertTrue(BloomFilter.optimalNumOfBits(random.nextInt(1 << 16), random.nextDouble()) >= 0); } // and some crazy values (this used to be capped to Integer.MAX_VALUE, now it can go bigger
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Oct 21 14:28:19 UTC 2024 - 21.2K bytes - Viewed (0) -
android/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) {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Mar 04 04:06:35 UTC 2022 - 1.4K bytes - Viewed (0) -
guava-tests/test/com/google/common/io/RandomAmountInputStream.java
import java.io.IOException; import java.io.InputStream; import java.util.Random; /** Returns a random portion of the requested bytes on each call. */ class RandomAmountInputStream extends FilterInputStream { private final Random random; public RandomAmountInputStream(InputStream in, Random random) { super(checkNotNull(in)); this.random = checkNotNull(random); } @Override
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 1.2K bytes - Viewed (0) -
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) {
Registered: Thu Oct 31 13:40:30 UTC 2024 - Last Modified: Thu Feb 22 01:53:18 UTC 2024 - 2.1K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/hash/AbstractNonStreamingHashFunctionTest.java
new StreamingVersion().newHasher(52), new NonStreamingVersion().newHasher(), new NonStreamingVersion().newHasher(123)); Random random = new Random(0); for (int i = 0; i < 200; i++) { RandomHasherAction.pickAtRandom(random).performAction(random, hashers); } HashCode[] codes = new HashCode[hashers.size()]; for (int i = 0; i < hashers.size(); i++) { codes[i] = hashers.get(i).hash();
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 4.4K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/graph/GraphMutationTest.java
} @Test public void undirectedGraph() { testGraphMutation(GraphBuilder.undirected()); } private static void testGraphMutation(GraphBuilder<? super Integer> graphBuilder) { Random gen = new Random(42); // Fixed seed so test results are deterministic. for (int trial = 0; trial < NUM_TRIALS; ++trial) { MutableGraph<Integer> graph = graphBuilder.allowsSelfLoops(true).build();
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Aug 18 16:17:46 UTC 2017 - 4.2K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/io/RandomAmountInputStream.java
import java.io.IOException; import java.io.InputStream; import java.util.Random; /** Returns a random portion of the requested bytes on each call. */ class RandomAmountInputStream extends FilterInputStream { private final Random random; public RandomAmountInputStream(InputStream in, Random random) { super(checkNotNull(in)); this.random = checkNotNull(random); } @Override
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Dec 04 17:37:03 UTC 2017 - 1.2K bytes - Viewed (0)