Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 90 for clip (0.06 sec)

  1. src/slices/slices.go

    	if n < 0 {
    		panic("cannot be negative")
    	}
    	if n -= cap(s) - len(s); n > 0 {
    		s = append(s[:cap(s)], make([]E, n)...)[:len(s)]
    	}
    	return s
    }
    
    // Clip removes unused capacity from the slice, returning s[:len(s):len(s)].
    func Clip[S ~[]E, E any](s S) S {
    	return s[:len(s):len(s)]
    }
    
    // TODO: There are other rotate algorithms.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 29 14:01:59 UTC 2024
    - 13.6K bytes
    - Viewed (0)
  2. src/slices/slices_test.go

    		t.Errorf("len(%v) = %d, want 3", s1, len(s1))
    	}
    	if cap(s1) < 6 {
    		t.Errorf("cap(%v[:3]) = %d, want >= 6", orig, cap(s1))
    	}
    	s2 := Clip(s1)
    	if !Equal(s1, s2) {
    		t.Errorf("Clip(%v) = %v, want %v", s1, s2, s1)
    	}
    	if cap(s2) != 3 {
    		t.Errorf("cap(Clip(%v)) = %d, want 3", orig, cap(s2))
    	}
    }
    
    func TestReverse(t *testing.T) {
    	even := []int{3, 1, 4, 1, 5, 9} // len = 6
    	Reverse(even)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 13:32:06 UTC 2024
    - 33.2K bytes
    - Viewed (0)
  3. src/cmd/go/main.go

    			telemetry.Inc("go/subcommand:" + strings.ReplaceAll(cfg.CmdName, " ", "-") + "-" + strings.Join(args[used:], "-"))
    			help.Help(os.Stdout, append(slices.Clip(args[:used]), args[used+1:]...))
    			base.Exit()
    		}
    		helpArg := ""
    		if used > 0 {
    			helpArg += " " + strings.Join(args[:used], " ")
    		}
    		cmdName := cfg.CmdName
    		if cmdName == "" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:09:11 UTC 2024
    - 10K bytes
    - Viewed (0)
  4. samples/bookinfo/src/productpage/templates/productpage.html

                  </svg>
                  {% endfor %}
                  {% for n in range(5 - review.rating.stars) %}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jun 03 19:54:05 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  5. src/cmd/go/internal/load/test.go

    		ptest.EmbedFiles = str.StringList(p.EmbedFiles, p.TestEmbedFiles)
    		ptest.Internal.OrigImportPath = p.Internal.OrigImportPath
    		ptest.Internal.PGOProfile = p.Internal.PGOProfile
    		ptest.Internal.Build.Directives = append(slices.Clip(p.Internal.Build.Directives), p.Internal.Build.TestDirectives...)
    	} else {
    		ptest = p
    	}
    
    	// External test package.
    	if len(p.XTestGoFiles) > 0 {
    		pxtest = &Package{
    			PackagePublic: PackagePublic{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 14:01:23 UTC 2024
    - 28.2K bytes
    - Viewed (0)
  6. src/image/jpeg/scan.go

    		case 3:
    			dst, stride = d.blackPix[8*(by*d.blackStride+bx):], d.blackStride
    		default:
    			return UnsupportedError("too many components")
    		}
    	}
    	// Level shift by +128, clip to [0, 255], and write to dst.
    	for y := 0; y < 8; y++ {
    		y8 := y * 8
    		yStride := y * stride
    		for x := 0; x < 8; x++ {
    			c := b[y8+x]
    			if c < -128 {
    				c = 0
    			} else if c > 127 {
    				c = 255
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 25 00:46:29 UTC 2024
    - 15.7K bytes
    - Viewed (0)
  7. platforms/documentation/docs/src/docs/css/base.css

        font-family: "Ubuntu Mono", courier, monospace;
        text-shadow: none;
    }
    
    .signature .literal {
        color: #04598D;
        padding-left: 0.1em;
    }
    
    .sr-only {
        border: 0;
        clip: rect(0, 0, 0, 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
    }
    
    /*
     * Code highlighting
     */
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Sat May 25 05:15:02 UTC 2024
    - 30.5K bytes
    - Viewed (0)
  8. src/crypto/tls/quic_test.go

    	cli.conn.Start(context.Background())
    	for cli.conn.NextEvent().Kind != QUICNoEvent {
    	}
    	err := cli.conn.Close()
    	if !errors.Is(err, alertCloseNotify) {
    		t.Errorf("conn.Close() = %v, want alertCloseNotify", err)
    	}
    }
    
    func TestQUICCanceledWaitingForTransportParams(t *testing.T) {
    	config := testConfig.Clone()
    	config.MinVersion = VersionTLS13
    	cli := newTestQUICClient(t, config)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 17:23:54 UTC 2024
    - 19.3K bytes
    - Viewed (0)
  9. platforms/core-runtime/messaging/src/main/java/org/gradle/internal/remote/internal/inet/SocketConnection.java

                            BufferCaster.cast(buffer).limit(0);
                            return -1;
                        }
                        throw e;
                    }
                    BufferCaster.cast(buffer).flip();
    
                    if (nread < 0) {
                        return -1;
                    }
                }
    
                int count = Math.min(buffer.remaining(), max);
                buffer.get(dest, offset, count);
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue May 28 13:09:37 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  10. guava/src/com/google/common/primitives/UnsignedBytes.java

        checkNotNull(array);
        checkPositionIndexes(fromIndex, toIndex, array.length);
        for (int i = fromIndex; i < toIndex; i++) {
          array[i] = flip(array[i]);
        }
        Arrays.sort(array, fromIndex, toIndex);
        for (int i = fromIndex; i < toIndex; i++) {
          array[i] = flip(array[i]);
        }
      }
    
      /**
       * Sorts the elements of {@code array} in descending order, interpreting them as unsigned 8-bit
       * integers.
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Fri Jun 07 22:25:23 UTC 2024
    - 18.3K bytes
    - Viewed (0)
Back to top