FIND YOUR NEXT FEW LINES

Results for “library”

Small, practical examples. Search by task or narrow things down below.

653 snippets foundClear filters
GoDates & times

Display an instant at a fixed offset

Display an instant at a fixed offset using a complete Go program with explicit sample inputs.

Go✓ Tested
JavaPrecise numeric calculations

Display an integer as unsigned

Java: Use unsigned conversion methods when interpreting a fixed-width bit pattern.

Java✓ Tested
jQueryForm serialization & state

Distinguish current state from initial markup

jQuery: prop reads the live checked state; attr reads the original checked attribute.

jQuery✓ Tested
GoTesting & reusable helpers

Distinguish end-of-input from other errors

Distinguish end-of-input from other errors using a complete Go program with explicit sample inputs.

Go✓ Tested
GoMaps & sets

Distinguish missing keys from zero values

Distinguish missing keys from zero values using a complete Go program with explicit sample inputs.

Go✓ Tested
RustStrings & Unicode

Distinguish UTF-8 bytes from characters

Distinguish UTF-8 bytes from characters in a complete Rust program using the standard library.

Rust✓ Tested
JavaPrecise numeric calculations

Divide decimal values with controlled precision

Java: Choose both scale and rounding for a quotient that does not terminate in base ten.

Java✓ Tested
JavaPrecise numeric calculations

Divide negative integers with floor rounding

Java: floorDiv and floorMod provide consistent floor-based quotient and remainder.

Java✓ Tested
PythonGetting Started

Divide using a fractional number

Python: Use a floating-point operand to preserve the fractional part of a division.

Python✓ Tested
JavaGetting Started

Divide using a fractional number

Java: Use a floating-point operand to preserve the fractional part of a division.

Java✓ Tested
GoFunctions & types

Embed a struct for shared fields

Embed a struct for shared fields using a complete Go program with explicit sample inputs.

Go✓ Tested
JavaEncoding & structured values

Encode a form query parameter

Java: URLEncoder uses application/x-www-form-urlencoded rules, including plus signs for spaces.

Java✓ Tested