FIND YOUR NEXT FEW LINES

Results for “z”

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

416 snippets foundClear filters
Linux CommandsArchives & checksums

Compress a file and keep the original

Create a gzip-compressed copy of a file while leaving the uncompressed original in place.

gzip✓ Tested
Linux CommandsArchive integrity & packaging

Compress a stream to a chosen filename

Linux Commands: Use gzip -c to leave the source file untouched and choose the destination explicitly.

Linux Commands✓ Tested
C++Tasks & synchronization

Convert a duration to another unit explicitly

C++: duration_cast converts units and truncates fractional integer units.

C++✓ Tested
PythonDates & time zones

Convert a duration to hours and minutes

Python: Use divmod to split nonnegative whole seconds into display components.

Python✓ Tested
Bash ScriptsVariables & text

Convert a string to lowercase

Normalize a text value using Bash expansion.

lowercase✓ Tested
PythonDates & time zones

Convert a Unix timestamp to aware UTC

Python: Supply timezone.utc so the result does not depend on the machine time zone.

Python✓ Tested
PythonDates & time zones

Convert an aware datetime to another offset

Python: Use astimezone for conversion; replacing tzinfo alone does not convert an instant.

Python✓ Tested
JavaDates & time zones

Convert epoch seconds into an instant

Java: Instant represents a UTC timeline point independent of the default timezone.

Java✓ Tested
PythonDates & time zones

Count days between calendar dates

Python: Subtract date objects to get an exact calendar-day difference.

Python✓ Tested
JavaDates & time zones

Count days between two dates

Java: Use ChronoUnit.DAYS for an elapsed count rather than a Period day component.

Java✓ Tested
jQueryForm serialization & state

Delete a cached data entry

jQuery: removeData removes the jQuery cache value for the selected key.

jQuery✓ Tested
C++Tasks & synchronization

Deliver a result through a promise and future

C++: A promise sets a shared state and its future retrieves the value.

C++✓ Tested