FIND YOUR NEXT FEW LINES

Results for “z”

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

416 snippets foundClear filters
PythonDates & time zones

Read an ISO week number

Python: Use isocalendar because ISO week years can differ from calendar years near January.

Python✓ Tested
JavaDates & time zones

Read an ISO week year and week number

Java: Use ISO week fields together because a week can belong to the previous calendar year.

Java✓ Tested
Arduino / CEEPROM & program memory

Read and total a flash lookup table

Arduino / C: Array size can be computed at compile time even for a flash-resident table.

Arduino / C✓ Tested
PythonFile operations & archives

Read compressed text directly

Python: Open gzip data in text mode with an explicit encoding.

Python✓ Tested
PythonStructured data & serialization

Read elements from trusted XML

Python: Use ElementTree to inspect a small trusted XML document.

Python✓ Tested
RustFiles & paths

Read file metadata without reading its contents

Read file metadata without reading its contents in a complete Rust program using the standard library.

Rust✓ Tested
PythonStructured data & serialization

Read one JSON document per line

Python: Parse nonempty JSON Lines records independently instead of loading a JSON array.

Python✓ Tested
jQueryForm serialization & state

Refresh a cached data attribute deliberately

jQuery: After the first read, data caches a parsed value; removeData forces a new attribute read.

jQuery✓ Tested
jQueryForm serialization & state

Remove an optional attribute entirely

jQuery: removeAttr removes the attribute instead of setting a string that might still activate it.

jQuery✓ Tested
PythonStructured data & serialization

Represent a record with a dataclass

Python: Generate initialization and convert a typed record to a dictionary.

Python✓ Tested
HTMLImages & embedded documents

Reserve an image’s display dimensions

HTML: Width and height attributes supply a known display size and aspect ratio before decoding finishes.

HTML✓ Tested
jQueryForm serialization & state

Restore a form’s original default values

jQuery: Call the native reset method through the underlying form element.

jQuery✓ Tested