FIND YOUR NEXT FEW LINES

Results for “library”

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

653 snippets foundClear filters
GoErrors & validation

Parse an email address syntax

Parse an email address syntax using a complete Go program with explicit sample inputs.

Go✓ Tested
JavaPrecise numeric calculations

Parse an integer in another base

Java: Supply an explicit radix to Integer.parseInt.

Java✓ Tested
JavaNumbers & dates

Parse an integer safely

Handle invalid Java integer input with NumberFormatException.

Java✓ Tested
CNumbers & memory

Parse an integer with validation

Validate range and trailing characters when parsing a C integer with strtol.

C✓ Tested
PythonDates & time zones

Parse an ISO calendar date

Python: Use date.fromisoformat and inspect the calendar components.

Python✓ Tested
PythonStrings & dates

Parse and format a date

Convert a date string into a datetime object, then format it in a different, human-readable order.

date✓ Tested
RustIterators & transformations

Parse only valid integers

Parse only valid integers in a complete Rust program using the standard library.

Rust✓ Tested
PythonStructured data & serialization

Parse quoted CSV from an in-memory string

Python: Use StringIO with csv.reader so quoted commas are handled correctly.

Python✓ Tested
JavaStream transformations

Partition a collection by a predicate

Java: Use partitioningBy to retain both matching and nonmatching values.

Java✓ Tested
RustIterators & transformations

Partition values into two collections

Partition values into two collections in a complete Rust program using the standard library.

Rust✓ Tested
jQueryEvent control

Pass values through a custom event

jQuery: trigger passes its extra argument array after the event object.

jQuery✓ Tested
jQueryHTTP requests

Post a JSON request body

jQuery: JSON.stringify and application/json send a JSON document.

jQuery✓ Tested