Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 102 for SLICE (0.05 sec)

  1. src/slices/iter.go

    // returns the extended slice.
    func AppendSeq[Slice ~[]E, E any](s Slice, seq iter.Seq[E]) Slice {
    	for v := range seq {
    		s = append(s, v)
    	}
    	return s
    }
    
    // Collect collects values from seq into a new slice and returns it.
    func Collect[E any](seq iter.Seq[E]) []E {
    	return AppendSeq([]E(nil), seq)
    }
    
    // Sorted collects values from seq into a new slice, sorts the slice,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 21:40:32 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  2. doc/next/6-stdlib/3-iter.md

    - [All](/pkg/slices#All) returns an iterator over slice indexes and values.
    - [Values](/pkg/slices#Values) returns an iterator over slice elements.
    - [Backward](/pkg/slices#Backward) returns an iterator that loops over
      a slice backward.
    - [Collect](/pkg/slices#Collect) collects values from an iterator into
      a new slice.
    - [AppendSeq](/pkg/slices#AppendSeq) appends values from an iterator to
      an existing slice.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 18:34:13 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  3. pkg/slices/slices.go

    }
    
    // SortFunc sorts the slice x in ascending order as determined by the less function.
    // This sort is not guaranteed to be stable.
    // The slice is modified in place but returned.
    func SortFunc[E any](x []E, less func(a, b E) int) []E {
    	if len(x) <= 1 {
    		return x
    	}
    	slices.SortFunc(x, less)
    	return x
    }
    
    // SortStableFunc sorts the slice x while keeping the original order of equal element.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 15 06:28:11 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  4. src/os/dir.go

    // Readdirnames returns an empty slice, it will return a non-nil error
    // explaining why. At the end of a directory, the error is [io.EOF].
    //
    // If n <= 0, Readdirnames returns all the names from the directory in
    // a single slice. In this case, if Readdirnames succeeds (reads all
    // the way to the end of the directory), it returns the slice and a
    // nil error. If it encounters an error before the end of the
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  5. 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)
  6. tests/associations_has_one_test.go

    		t.Errorf("account's number should not be saved")
    	}
    }
    
    func TestHasOneAssociationForSlice(t *testing.T) {
    	users := []User{
    		*GetUser("slice-hasone-1", Config{Account: true}),
    		*GetUser("slice-hasone-2", Config{Account: false}),
    		*GetUser("slice-hasone-3", Config{Account: true}),
    	}
    
    	DB.Create(&users)
    
    	// Count
    	AssertAssociationCount(t, users, "Account", 2, "")
    
    	// Find
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:49:45 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  7. 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)
  8. tensorflow/compiler/mlir/tfrt/tests/ifrt/lower_to_ifrt_restore_variable.mlir

    // single variable
    
    // CHECK-LABEL:   func.func @restore_single() {
    // CHECK-NEXT:     [[PREFIX:%.*]] = "tf.Const"() <{value = dense<"restore_ariables"> : tensor<!tf_type.string>}> : () -> tensor<!tf_type.string>
    // CHECK-NEXT:     [[SLICE:%.*]] = "tf.Const"() <{value = dense<""> : tensor<1x!tf_type.string>}> : () -> tensor<1x!tf_type.string>
    // CHECK-NEXT:     [[NAME:%.*]] = "tf.Const"() <{value = dense<"y"> : tensor<1x!tf_type.string>}> : () -> tensor<1x!tf_type.string>
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 31 20:44:15 UTC 2024
    - 8.8K bytes
    - Viewed (0)
  9. doc/next/6-stdlib/99-minor/encoding/binary/60023.md

    The new [Encode] and [Decode] functions are byte slice equivalents
    to [Read] and [Write].
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 18:58:26 UTC 2024
    - 157 bytes
    - Viewed (0)
  10. pkg/apis/resource/namedresources.go

    	VersionValue *string
    }
    
    // NamedResourcesIntSlice contains a slice of 64-bit integers.
    type NamedResourcesIntSlice struct {
    	// Ints is the slice of 64-bit integers.
    	Ints []int64
    }
    
    // NamedResourcesStringSlice contains a slice of strings.
    type NamedResourcesStringSlice struct {
    	// Strings is the slice of strings.
    	Strings []string
    }
    
    // NamedResourcesRequest is used in ResourceRequestModel.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Apr 22 12:18:45 UTC 2024
    - 3.8K bytes
    - Viewed (0)
Back to top