Results for “Serial.available”
Small, practical examples. Search by task or narrow things down below.
Read one JSON document per line
Python: Parse nonempty JSON Lines records independently instead of loading a JSON array.
Python✓ Tested
Refresh a cached data attribute deliberately
jQuery: After the first read, data caches a parsed value; removeData forces a new attribute read.
jQuery✓ Tested
Remove an optional attribute entirely
jQuery: removeAttr removes the attribute instead of setting a string that might still activate it.
jQuery✓ Tested
Represent a record with a dataclass
Python: Generate initialization and convert a typed record to a dictionary.
Python✓ Tested
Restore a form’s original default values
jQuery: Call the native reset method through the underlying form element.
jQuery✓ Tested
Return a small immutable named record
Python: Use NamedTuple when callers need both tuple behavior and named fields.
Python✓ Tested
Search the stream for a message marker
Arduino / C: find consumes input through a matching marker or until timeout.
Arduino / C✓ Tested
Set several selected options
jQuery: Passing an array to val selects matching values in a multiple select.
jQuery✓ Tested
Store an object associated with an element
jQuery: data retains JavaScript values without serializing them into HTML attributes.
jQuery✓ Tested
Write a JSON file
Save a dictionary as readable, indented JSON while preserving Unicode characters.
json✓ Tested
Add a fixed hostname mapping
Docker / Compose: extra_hosts adds an entry to the container’s hosts file.
Docker / Compose✓ Tested
Advance an index around a fixed collection
Arduino / C: Modulo wraps a bounded nonnegative index to zero.
Arduino / C✓ Tested