Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 319 for newInt (0.1 sec)

  1. pkg/registry/core/service/portallocator/allocator_test.go

    	}
    }
    
    func TestForEach(t *testing.T) {
    	pr, err := net.ParsePortRange("10000-10200")
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	testCases := []sets.Int{
    		sets.NewInt(),
    		sets.NewInt(10000),
    		sets.NewInt(10000, 10200),
    		sets.NewInt(10000, 10099, 10200),
    	}
    
    	for i, tc := range testCases {
    		r, err := NewInMemory(*pr)
    		if err != nil {
    			t.Fatal(err)
    		}
    
    		for port := range tc {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 08 07:15:02 UTC 2024
    - 14K bytes
    - Viewed (0)
  2. misc/cgo/gmp/fib.go

    	// Keep the fibbers in dedicated operating system
    	// threads, so that this program tests coordination
    	// between pthreads and not just goroutines.
    	runtime.LockOSThread()
    
    	i := big.NewInt(n)
    	if n == 0 {
    		c <- i
    	}
    	for {
    		j := <-c
    		out <- j.String()
    		i.Add(i, j)
    		c <- i
    	}
    }
    
    func main() {
    	c := make(chan *big.Int)
    	out := make(chan string)
    	go fibber(c, out, 0)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 10 22:32:35 UTC 2023
    - 919 bytes
    - Viewed (0)
  3. pkg/registry/core/service/allocator/bitmap_test.go

    			max:       65535,
    			reserved:  256,
    		},
    	}
    	for _, tc := range testCases {
    		t.Run(tc.name, func(t *testing.T) {
    			subTests := []sets.Int{
    				sets.NewInt(),
    				sets.NewInt(0),
    				sets.NewInt(0, 2, 5),
    				sets.NewInt(0, 1, 2, 3, 4, 5, 6, 7),
    			}
    
    			for i, ts := range subTests {
    				m := tc.allocator(tc.max, "test", tc.reserved)
    				for offset := range ts {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 10 08:56:31 UTC 2022
    - 13.3K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/ir/const.go

    // NewBool returns an OLITERAL representing b as an untyped boolean.
    func NewBool(pos src.XPos, b bool) Node {
    	return NewBasicLit(pos, types.UntypedBool, constant.MakeBool(b))
    }
    
    // NewInt returns an OLITERAL representing v as an untyped integer.
    func NewInt(pos src.XPos, v int64) Node {
    	return NewBasicLit(pos, types.UntypedInt, constant.MakeInt64(v))
    }
    
    // NewString returns an OLITERAL representing s as an untyped string.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 18:53:26 UTC 2023
    - 4K bytes
    - Viewed (0)
  5. src/crypto/rsa/boring.go

    	b := pubCache.Get(pub)
    	if b != nil && publicKeyEqual(&b.orig, pub) {
    		return b.key, nil
    	}
    
    	b = new(boringPub)
    	b.orig = copyPublicKey(pub)
    	key, err := boring.NewPublicKeyRSA(bbig.Enc(b.orig.N), bbig.Enc(big.NewInt(int64(b.orig.E))))
    	if err != nil {
    		return nil, err
    	}
    	b.key = key
    	pubCache.Put(pub, b)
    	return key, nil
    }
    
    type boringPriv struct {
    	key  *boring.PrivateKeyRSA
    	orig PrivateKey
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 18 00:30:19 UTC 2022
    - 3.3K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/walk/builtin.go

    		//     panicmakeslicecap()
    		// }
    		nif := ir.NewIfStmt(base.Pos, ir.NewBinaryExpr(base.Pos, ir.OGT, typecheck.Conv(l, types.Types[types.TUINT64]), ir.NewInt(base.Pos, i)), nil, nil)
    		niflen := ir.NewIfStmt(base.Pos, ir.NewBinaryExpr(base.Pos, ir.OLT, l, ir.NewInt(base.Pos, 0)), nil, nil)
    		niflen.Body = []ir.Node{mkcall("panicmakeslicelen", nil, init)}
    		nif.Body.Append(niflen, mkcall("panicmakeslicecap", nil, init))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 22:35:22 UTC 2024
    - 31.2K bytes
    - Viewed (0)
  7. src/crypto/x509/hybrid_pool_test.go

    	if err != nil {
    		t.Fatalf("tls connection failed: %s", err)
    	}
    	googChain := c.ConnectionState().PeerCertificates
    
    	rootTmpl := &x509.Certificate{
    		SerialNumber:          big.NewInt(1),
    		Subject:               pkix.Name{CommonName: "Go test root"},
    		IsCA:                  true,
    		BasicConstraintsValid: true,
    		NotBefore:             time.Now().Add(-time.Hour),
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 20:48:11 UTC 2024
    - 3.7K bytes
    - Viewed (0)
  8. src/crypto/rand/util_test.go

    	for i := 0; i < 32; i++ {
    		max := int64(1 << uint64(i))
    		t.Run(fmt.Sprintf("max=%d", max), func(t *testing.T) {
    			reader := &countingReader{r: rand.Reader}
    
    			_, err := rand.Int(reader, big.NewInt(max))
    			if err != nil {
    				t.Fatalf("Can't generate random value: %d, %v", max, err)
    			}
    			expected := (i + 7) / 8
    			if reader.n != expected {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 05 01:35:39 UTC 2022
    - 3.5K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apimachinery/pkg/util/sets/int.go

    //
    // Deprecated: use generic Set instead.
    // new ways:
    // s1 := Set[int]{}
    // s2 := New[int]()
    type Int map[int]Empty
    
    // NewInt creates a Int from a list of values.
    func NewInt(items ...int) Int {
    	return Int(New[int](items...))
    }
    
    // IntKeySet creates a Int from a keys of a map[int](? extends interface{}).
    // If the value passed in is not actually a map, this will panic.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Oct 20 03:47:18 UTC 2022
    - 3.8K bytes
    - Viewed (0)
  10. src/crypto/x509/x509_test_import.go

    	rsaPriv, err := x509.ParsePKCS1PrivateKey(block.Bytes)
    	if err != nil {
    		panic("Failed to parse private key: " + err.Error())
    	}
    
    	template := x509.Certificate{
    		SerialNumber: big.NewInt(1),
    		Subject: pkix.Name{
    			CommonName:   "test",
    			Organization: []string{"Σ Acme Co"},
    		},
    		NotBefore: time.Unix(1000, 0),
    		NotAfter:  time.Unix(100000, 0),
    		KeyUsage:  x509.KeyUsageCertSign,
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 28 18:17:57 UTC 2021
    - 1.7K bytes
    - Viewed (0)
Back to top