FIND YOUR NEXT FEW LINES

Results for “z”

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

416 snippets foundClear filters
JavaDates & time zones

Parse a date with an explicit input pattern

Java: Use DateTimeFormatter for a non-ISO date representation.

Java✓ Tested
PythonDates & time zones

Parse an ISO calendar date

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

Python✓ 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
C++Tasks & synchronization

Pass an argument into a worker thread

C++: Thread arguments are copied by default; std::ref explicitly passes a reference.

C++✓ Tested
JavaScriptObject behavior & collections

Prevent runtime changes to top-level properties

JavaScript: Object.freeze prevents ordinary top-level mutations; Reflect.set reports the rejected update without throwing.

JavaScript✓ Tested
TypeScriptObject behavior & collections

Prevent runtime changes to top-level properties

TypeScript: Object.freeze prevents ordinary top-level mutations; Reflect.set reports the rejected update without throwing.

TypeScript✓ Tested
PythonStructured data & serialization

Produce compact deterministic JSON

Python: Sort dictionary keys and remove separator whitespace for a reproducible representation.

Python✓ Tested
C++Tasks & synchronization

Protect a shared container with a mutex

C++: A scoped lock_guard releases the mutex when its scope ends.

C++✓ Tested
CSSResponsive conditions & sizing

Provide a fallback for an unset custom property

CSS: The second var argument supplies a value when the custom property is unavailable.

CSS✓ Tested
JavaFile operations & binary data

Read a file length in bytes

Java: Files.size inspects metadata without loading the file into a Java string.

Java✓ Tested
PythonStructured data & serialization

Read a small INI configuration

Python: Use ConfigParser typed accessors for configuration values stored as text.

Python✓ Tested
PythonStructured data & serialization

Read a tab-separated table

Python: Select a delimiter explicitly rather than splitting lines manually.

Python✓ Tested