Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 17 of 17 for intSlice (0.48 sec)

  1. src/sort/example_test.go

    	fmt.Println(sort.Float64sAreSorted(s))
    
    	// Output: true
    	// false
    	// false
    }
    
    func ExampleReverse() {
    	s := []int{5, 2, 6, 3, 1, 4} // unsorted
    	sort.Sort(sort.Reverse(sort.IntSlice(s)))
    	fmt.Println(s)
    	// Output: [6 5 4 3 2 1]
    }
    
    func ExampleSlice() {
    	people := []struct {
    		Name string
    		Age  int
    	}{
    		{"Gopher", 7},
    		{"Alice", 55},
    		{"Vera", 24},
    		{"Bob", 75},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 28 17:29:29 UTC 2017
    - 2.8K bytes
    - Viewed (0)
  2. pkg/apis/resource/structured/namedresources/validation/validation.go

    		}
    		if attribute.BoolValue != nil {
    			entries.Insert("bool")
    		}
    		if attribute.IntValue != nil {
    			entries.Insert("int")
    		}
    		if attribute.IntSliceValue != nil {
    			entries.Insert("intSlice")
    		}
    		if attribute.StringValue != nil {
    			entries.Insert("string")
    		}
    		if attribute.StringSliceValue != nil {
    			entries.Insert("stringSlice")
    		}
    		if attribute.VersionValue != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 07 21:26:20 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/util/shufflesharding/shufflesharding_test.go

    		maxCount := permutations * int(math.Ceil(nff))
    		aHand := make([]int, test.handSize)
    		for i := 0; i < test.hashMax; i++ {
    			aHand = dealer.DealIntoHand(uint64(i), aHand)
    			sort.IntSlice(aHand).Sort()
    			handCoordinate := 0
    			for _, card := range aHand {
    				handCoordinate = handCoordinate<<7 + card
    			}
    			handCoordinateMap[handCoordinate]++
    		}
    		numHandsSeen := len(handCoordinateMap)
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jan 25 06:44:08 UTC 2021
    - 6.7K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/ssa/_gen/allocators.go

    	}
    	deriveds := []derived{
    		{
    			name: "BlockSlice",
    			typ:  "[]*Block",
    			base: "ValueSlice",
    		},
    		{
    			name: "IntSlice",
    			typ:  "[]int",
    			base: "Int64Slice",
    		},
    		{
    			name: "Int32Slice",
    			typ:  "[]int32",
    			base: "Int64Slice",
    		},
    		{
    			name: "Int8Slice",
    			typ:  "[]int8",
    			base: "Int64Slice",
    		},
    		{
    			name: "BoolSlice",
    			typ:  "[]bool",
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 17 23:34:11 UTC 2023
    - 6.7K bytes
    - Viewed (0)
  5. src/sort/search.go

    func SearchStrings(a []string, x string) int {
    	return Search(len(a), func(i int) bool { return a[i] >= x })
    }
    
    // Search returns the result of applying [SearchInts] to the receiver and x.
    func (p IntSlice) Search(x int) int { return SearchInts(p, x) }
    
    // Search returns the result of applying [SearchFloat64s] to the receiver and x.
    func (p Float64Slice) Search(x float64) int { return SearchFloat64s(p, x) }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 28 16:40:32 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  6. src/cmd/cgo/internal/testsanitizers/testdata/asan3_fail.go

    	// Access Go pointer out of bounds.
    	int c = a[5];        // BOOM
    	// We shouldn't get here; asan should stop us first.
    	printf("a[5]=%d\n", c);
    }
    */
    import "C"
    
    func main() {
    	cIntSlice := []C.int{200, 201, 203, 203, 204}
    	C.test(&cIntSlice[0])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 486 bytes
    - Viewed (0)
  7. test/typeparam/issue51925.go

    package main
    
    import "fmt"
    
    type IntLike interface {
    	~int | ~int64 | ~int32 | ~int16 | ~int8
    }
    
    func Reduce[T any, U any, Uslice ~[]U](function func(T, U) T, sequence Uslice, initial T) T {
    	result := initial
    	for _, x := range sequence {
    		result = function(result, x)
    	}
    	return result
    }
    
    func min[T IntLike](x, y T) T {
    	if x < y {
    		return x
    	}
    	return y
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Dec 14 17:22:18 UTC 2023
    - 963 bytes
    - Viewed (0)
Back to top