Search Options

Results per page
Sort
Preferred Languages
Advance

Results 111 - 120 of 947 for asSlice (0.3 sec)

  1. src/html/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: Sat Feb 24 21:59:12 UTC 2024
    - 57.6K bytes
    - Viewed (0)
  2. src/internal/unsafeheader/unsafeheader.go

    // Package unsafeheader contains header declarations for the Go runtime's slice
    // and string implementations.
    //
    // This package allows packages that cannot import "reflect" to use types that
    // are tested to be equivalent to reflect.SliceHeader and reflect.StringHeader.
    package unsafeheader
    
    import (
    	"unsafe"
    )
    
    // Slice is the runtime representation of a slice.
    // It cannot be used safely or portably and its representation may
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 01 16:14:17 UTC 2020
    - 1.1K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/sys/unix/sysvshm_unix.go

    	// Retrieve the size of the shared memory to enable slice creation
    	var info SysvShmDesc
    
    	_, err := SysvShmCtl(id, IPC_STAT, &info)
    	if err != nil {
    		// release the shared memory if we can't find the size
    
    		// ignoring error from shmdt as there's nothing sensible to return here
    		shmdt(addr)
    		return nil, err
    	}
    
    	// Use unsafe to convert addr into a []byte.
    	b := unsafe.Slice((*byte)(unsafe.Pointer(addr)), int(info.Segsz))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 16:12:58 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  4. docs_src/security/tutorial003_py310.py

            "full_name": "John Doe",
            "email": "******@****.***",
            "hashed_password": "fakehashedsecret",
            "disabled": False,
        },
        "alice": {
            "username": "alice",
            "full_name": "Alice Wonderson",
            "email": "alice@example.com",
            "hashed_password": "fakehashedsecret2",
            "disabled": True,
        },
    }
    
    app = FastAPI()
    
    
    def fake_hash_password(password: str):
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jan 07 14:11:31 UTC 2022
    - 2.4K bytes
    - Viewed (0)
  5. src/internal/types/testdata/examples/inference.go

    	// last.
    	related2(1.2, []float64{})
    	related2(1.0, []int{})
    	related2 /* ERROR "Slice (type []int) does not satisfy interface{[]Elem}" */ (float64(1.0), []int{}) // TODO(gri) better error message
    }
    
    type List[P any] []P
    
    func related3[Elem any, Slice []Elem | List[Elem]]() Slice { return nil }
    
    func _() {
    	// related3 can be instantiated explicitly
    	related3[int, []int]()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 02 16:49:45 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  6. src/cmd/internal/bio/buf.go

    	return r.f
    }
    
    func (w *Writer) File() *os.File {
    	return w.f
    }
    
    // Slice reads the next length bytes of r into a slice.
    //
    // This slice may be backed by mmap'ed memory. Currently, this memory
    // will never be unmapped. The second result reports whether the
    // backing memory is read-only.
    func (r *Reader) Slice(length uint64) ([]byte, bool, error) {
    	if length == 0 {
    		return []byte{}, false, nil
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 11 17:15:15 UTC 2020
    - 3.1K bytes
    - Viewed (0)
  7. src/internal/types/testdata/fixedbugs/issue64406.go

    package issue64406
    
    import (
    	"unsafe"
    )
    
    func sliceData[E any, S ~[]E](s S) *E {
    	return unsafe.SliceData(s)
    }
    
    func slice[E any, S ~*E](s S) []E {
    	return unsafe.Slice(s, 0)
    }
    
    func f() {
    	s := []uint32{0}
    	_ = sliceData(s)
    	_ = slice(&s)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 29 20:34:33 UTC 2023
    - 403 bytes
    - Viewed (0)
  8. pkg/registry/rbac/role/policybased/storage_test.go

    		nil,
    		nil,
    		[]*rbacv1.ClusterRole{{ObjectMeta: metav1.ObjectMeta{Name: "alice-role"}, Rules: []rbacv1.PolicyRule{{APIGroups: []string{"*"}, Resources: []string{"*"}, Verbs: []string{"*"}}}}},
    		[]*rbacv1.ClusterRoleBinding{{RoleRef: rbacv1.RoleRef{Name: "alice-role", APIGroup: "rbac.authorization.k8s.io", Kind: "ClusterRole"}, Subjects: []rbacv1.Subject{{Name: "alice", Kind: "User", APIGroup: "rbac.authorization.k8s.io"}}}},
    	)
    
    	role := &rbac.Role{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Apr 09 13:47:19 UTC 2021
    - 6.3K bytes
    - Viewed (0)
  9. docs_src/security/tutorial003.py

            "full_name": "John Doe",
            "email": "******@****.***",
            "hashed_password": "fakehashedsecret",
            "disabled": False,
        },
        "alice": {
            "username": "alice",
            "full_name": "Alice Wonderson",
            "email": "alice@example.com",
            "hashed_password": "fakehashedsecret2",
            "disabled": True,
        },
    }
    
    app = FastAPI()
    
    
    def fake_hash_password(password: str):
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat May 14 11:59:59 UTC 2022
    - 2.4K bytes
    - Viewed (0)
  10. src/syscall/dir_plan9.go

    // returning the remaining slice of b..
    func pstring(b []byte, s string) []byte {
    	b = pbit16(b, uint16(len(s)))
    	n := copy(b, s)
    	return b[n:]
    }
    
    // gbit8 reads an 8-bit number from b and returns it with the remaining slice of b.
    func gbit8(b []byte) (uint8, []byte) {
    	return uint8(b[0]), b[1:]
    }
    
    // gbit16 reads a 16-bit number in little-endian order from b and returns it with the remaining slice of b.
    //
    //go:nosplit
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 19:32:38 UTC 2024
    - 5.2K bytes
    - Viewed (0)
Back to top