- Sort Score
- Result 10 results
- Languages All
Results 31 - 40 of 125 for shuffled (0.69 sec)
-
pkg/test/loadbalancersim/loadbalancer/roundrobin.go
var lbConns []*WeightedConnection for _, conn := range conns { for i := uint32(0); i < conn.Weight; i++ { lbConns = append(lbConns, conn) } } // Shuffle the connections. rand.Shuffle(len(lbConns), func(i, j int) { lbConns[i], lbConns[j] = lbConns[j], lbConns[i] }) return &roundRobin{ weightedConnections: newLBConnection("RoundRobinLB", lbConns), } }
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Thu Feb 03 18:19:25 UTC 2022 - 1.5K bytes - Viewed (0) -
src/math/rand/v2/example_test.go
words := strings.Fields("ink runs from the corners of my mouth") rand.Shuffle(len(words), func(i, j int) { words[i], words[j] = words[j], words[i] }) fmt.Println(words) } func ExampleShuffle_slicesInUnison() { numbers := []byte("12345") letters := []byte("ABCDE") // Shuffle numbers, swapping corresponding entries in letters at the same time. rand.Shuffle(len(numbers), func(i, j int) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Oct 30 17:09:26 UTC 2023 - 4.4K bytes - Viewed (0) -
src/math/rand/rand.go
m[i] = m[j] m[j] = i } return m } // Shuffle pseudo-randomizes the order of elements. // n is the number of elements. Shuffle panics if n < 0. // swap swaps the elements with indexes i and j. func (r *Rand) Shuffle(n int, swap func(i, j int)) { if n < 0 { panic("invalid argument to Shuffle") } // Fisher-Yates shuffle: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 22 22:09:08 UTC 2024 - 16.9K bytes - Viewed (0) -
src/math/rand/example_test.go
words := strings.Fields("ink runs from the corners of my mouth") rand.Shuffle(len(words), func(i, j int) { words[i], words[j] = words[j], words[i] }) fmt.Println(words) } func ExampleShuffle_slicesInUnison() { numbers := []byte("12345") letters := []byte("ABCDE") // Shuffle numbers, swapping corresponding entries in letters at the same time. rand.Shuffle(len(numbers), func(i, j int) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Oct 26 16:24:57 UTC 2022 - 4.2K bytes - Viewed (0) -
src/math/rand/rand_test.go
if !bytes.Equal(b1, b2) { t.Errorf("mismatch after re-seed:\n%x\n%x", b1, b2) } } func TestShuffleSmall(t *testing.T) { // Check that Shuffle allows n=0 and n=1, but that swap is never called for them. r := New(NewSource(1)) for n := 0; n <= 1; n++ { r.Shuffle(n, func(i, j int) { t.Fatalf("swap called, n=%d i=%d j=%d", n, i, j) }) } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 18:42:28 UTC 2024 - 16.9K bytes - Viewed (0) -
guava-tests/test/com/google/common/collect/CollectionBenchmarkSampleData.java
Collections.shuffle(tmp, random); queryList.addAll(tmp.subList(0, extras)); } // now add bad queries while (queryList.size() < numQueries) { Element candidate = newElement(); if (!elementsInSet.contains(candidate)) { queryList.add(candidate); } } Collections.shuffle(queryList, random); return queryList.toArray(new Element[0]);
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Mon Apr 17 15:49:06 UTC 2023 - 4.2K bytes - Viewed (0) -
docs/en/docs/js/custom.js
} return true; }); } window.addEventListener("scroll", loadVisibleTermynals); createTermynals(); loadVisibleTermynals(); } function shuffle(array) { var currentIndex = array.length, temporaryValue, randomIndex; while (0 !== currentIndex) { randomIndex = Math.floor(Math.random() * currentIndex); currentIndex -= 1;
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Sat May 08 17:50:56 UTC 2021 - 6.6K bytes - Viewed (0) -
src/internal/fuzz/mutators_byteslice.go
return nil } dst := m.rand(len(b)) n := m.chooseLen(len(b) - dst) rb := byte(m.rand(256)) for i := dst; i < dst+n; i++ { b[i] = rb } return b } // byteSliceShuffleBytes shuffles a chunk of bytes in b. func byteSliceShuffleBytes(m *mutator, b []byte) []byte { if len(b) <= 1 { return nil } dst := m.rand(len(b)) n := m.chooseLen(len(b) - dst) if n <= 2 { return nil }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Nov 19 18:23:43 UTC 2021 - 7.7K bytes - Viewed (0) -
src/math/rand/v2/rand_test.go
p := make([]int, n) // re-usable slice for Shuffle generator tests := [...]struct { name string fn func() int }{ {name: "Int32N", fn: func() int { return int(r.Int32N(int32(nfact))) }}, {name: "Perm", fn: func() int { return encodePerm(r.Perm(n)) }}, {name: "Shuffle", fn: func() int { // Generate permutation using Shuffle. for i := range p { p[i] = i }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 18:42:28 UTC 2024 - 17.4K bytes - Viewed (0) -
platforms/software/security/src/main/java/org/gradle/security/internal/PublicKeyDownloadService.java
Collections.shuffle(servers); tryDownloadKeyFromServer(toLongIdHexString(keyId), servers, builder, keyring -> findMatchingKey(keyId, keyring, builder)); } @Override public void findByFingerprint(byte[] fingerprint, PublicKeyResultBuilder builder) { List<URI> servers = new ArrayList<>(keyServers); Collections.shuffle(servers);
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Fri Apr 12 08:49:35 UTC 2024 - 6.9K bytes - Viewed (0)