Results for “Input streams & redirection”
Small, practical examples. Search by task or narrow things down below.
Read one character from serial input
Wait for an incoming byte without blocking the main loop.
Serial.available✓ Tested
Refuse to overwrite an existing file with redirection
Bash Scripts: Noclobber makes a plain greater-than redirection fail when the target already exists.
Bash Scripts✓ Tested
Reject NaN and infinite numeric inputs
Python: Use isfinite before computations that require an ordinary finite float.
Python✓ Tested
Reject non-finite numeric input
Reject non-finite numeric input using a complete Go program with explicit sample inputs.
Go✓ Tested
Render untrusted-looking input as literal text
Render untrusted-looking input as literal text with a small React component and explicit browser behavior.
React✓ Tested
Require an input value
Require an input value with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Reuse controlled-input bindings
Reuse controlled-input bindings with a small React component and explicit browser behavior.
React✓ Tested
Select the contents of an input
Select the contents of an input with a small React component and explicit browser behavior.
React✓ Tested
Share two-way state through a model input
Share two-way state through a model input with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Show the current value of a range input
HTML: Mirror range input events into a labeled output for a native slider.
HTML✓ Tested
Treat dynamic regex input as literal text
Java: Use Pattern.quote so metacharacters in a search term lose their special meaning.
Java✓ Tested
Type a function’s inputs and output
Catch mismatched arguments during compilation.
function✓ Tested