Search Options

Results per page
Sort
Preferred Languages
Advance

Results 121 - 130 of 947 for asSlice (0.47 sec)

  1. cmd/kubeadm/app/util/crypto/crypto.go

    )
    
    // CreateRandBytes returns a cryptographically secure slice of random bytes with a given size
    func CreateRandBytes(size uint32) ([]byte, error) {
    	bytes := make([]byte, size)
    	if _, err := rand.Read(bytes); err != nil {
    		return nil, err
    	}
    	return bytes, nil
    }
    
    // EncryptBytes takes a byte slice of raw data and an encryption key and returns an encrypted byte slice of data.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Jul 04 08:41:27 UTC 2021
    - 2.1K bytes
    - Viewed (0)
  2. src/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305.go

    	}
    
    	return c.open(dst, nonce, ciphertext, additionalData)
    }
    
    // sliceForAppend takes a slice and a requested number of bytes. It returns a
    // slice with the contents of the given slice followed by that many bytes and a
    // second slice that aliases into it and contains only the extra bytes. If the
    // original slice has sufficient capacity then no allocation is performed.
    func sliceForAppend(in []byte, n int) (head, tail []byte) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 09 20:10:44 UTC 2021
    - 2.8K bytes
    - Viewed (0)
  3. src/sort/example_interface_test.go

    		{"Michael", 17},
    		{"Jenny", 26},
    	}
    
    	fmt.Println(people)
    	// There are two ways to sort a slice. First, one can define
    	// a set of methods for the slice type, as with ByAge, and
    	// call sort.Sort. In this first example we use that technique.
    	sort.Sort(ByAge(people))
    	fmt.Println(people)
    
    	// The other way is to use sort.Slice with a custom Less
    	// function, which can be provided as a closure. In this
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Sep 24 14:40:37 UTC 2017
    - 1.5K bytes
    - Viewed (0)
  4. src/go/types/index.go

    		if x.mode != variable {
    			check.errorf(x, NonSliceableOperand, invalidOp+"cannot slice %s (value not addressable)", x)
    			x.mode = invalid
    			return
    		}
    		x.typ = &Slice{elem: u.elem}
    
    	case *Pointer:
    		if u, _ := under(u.base).(*Array); u != nil {
    			valid = true
    			length = u.len
    			x.typ = &Slice{elem: u.elem}
    		}
    
    	case *Slice:
    		valid = true
    		// x.typ doesn't change
    	}
    
    	if !valid {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 16:17:05 UTC 2024
    - 11.2K bytes
    - Viewed (0)
  5. test/fixedbugs/issue5515.go

    package main
    
    type T uint32
    
    func main() {
            b := make([]T, 8)
            b[0] = 0xdeadbeef
            rs := Slice(b)
            sort(rs)
    }
    
    type Slice []T
    
    func (s Slice) Swap(i, j int) {
            tmp := s[i]
            s[i] = s[j]
            s[j] = tmp
    }
    
    type Interface interface {
            Swap(i, j int)
    }
    
    func sort(data Interface) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 12 03:23:21 UTC 2013
    - 597 bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/util/shufflesharding/shufflesharding_test.go

    		hand         []int
    		expectedSize int
    	}{
    		{
    			"nil slice",
    			nil,
    			6,
    		},
    		{
    			"empty slice",
    			make([]int, 0),
    			6,
    		},
    		{
    			"size: 6 cap: 6 slice",
    			make([]int, 6),
    			6,
    		},
    		{
    			"size: 6 cap: 12 slice",
    			make([]int, 6, 12),
    			6,
    		},
    		{
    			"size: 4 cap: 4 slice",
    			make([]int, 4),
    			6,
    		},
    		{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jan 25 06:44:08 UTC 2021
    - 6.7K bytes
    - Viewed (0)
  7. test/typeparam/issue47896.go

    package main
    
    import (
    	"database/sql"
    )
    
    // Collection generic interface which things can be added to.
    type Collection[T any] interface {
    	Add(T)
    }
    
    // Slice generic slice implementation of a Collection
    type Slice[T any] []*T
    
    func (s *Slice[T]) Add(t *T) {
    	*s = append(*s, t)
    }
    
    type Scanner interface {
    	Scan(...interface{}) error
    }
    
    type Mapper[T any] func(s Scanner, t T) error
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 1.4K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/tensorflow/tests/tf_data_fuse_map_and_batch.mlir

      // CHECK: %[[NPC:.*]] = "tf.Const"() <{value = dense<1> : tensor<i64>}>
      // CHECK: %[[TSLICE:.*]] = "tf.TensorSliceDataset"
      %3 = "tf.TensorSliceDataset"(%2) {device = "", output_shapes = [#tf_type.shape<>], metadata = ""} : (tensor<3xi32>) -> tensor<*x!tf_type.variant>
      // CHECK: "tf.MapAndBatchDataset"(%[[TSLICE]], %[[BSIZE:.*]], %[[NPC]]
      // CHECK-SAME: f = @"__inference_Dataset_map_<lambda>_80",
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Oct 30 06:52:55 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  9. src/text/template/exec_test.go

    	// Slicing.
    	{"slice[:]", "{{slice .SI}}", "[3 4 5]", tVal, true},
    	{"slice[1:]", "{{slice .SI 1}}", "[4 5]", tVal, true},
    	{"slice[1:2]", "{{slice .SI 1 2}}", "[4]", tVal, true},
    	{"slice[-1:]", "{{slice .SI -1}}", "", tVal, false},
    	{"slice[1:-2]", "{{slice .SI 1 -2}}", "", tVal, false},
    	{"slice[1:2:-1]", "{{slice .SI 1 2 -1}}", "", tVal, false},
    	{"slice[2:1]", "{{slice .SI 2 1}}", "", tVal, false},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 22:23:55 UTC 2024
    - 60.1K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_security/test_tutorial003_an.py

        assert response.json() == {"detail": "Not authenticated"}
        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    def test_inactive_user():
        response = client.get("/users/me", headers={"Authorization": "Bearer alice"})
        assert response.status_code == 400, response.text
        assert response.json() == {"detail": "Inactive user"}
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 8K bytes
    - Viewed (0)
Back to top