FIND YOUR NEXT FEW LINES

Results for “Dates & numeric validation”

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

303 snippets foundClear filters
Docker / ComposeDockerfile patterns

Set copied files’ numeric ownership

Docker / Compose: COPY --chown sets ownership while adding the file.

Docker / Compose✓ Tested
ReactForms & validation

Show a field-specific validation message

Show a field-specific validation message with a small React component and explicit browser behavior.

React✓ Tested
PythonDates & time zones

Skip weekends when advancing dates

Python: Walk calendar dates and count only Monday through Friday.

Python✓ Tested
Linux CommandsSorting & joining records

Sort lines by numeric value

Linux Commands: Use sort -n so 10 sorts after 2 instead of before it.

Linux Commands✓ Tested
JavaScriptArrays

Sort numbers numerically

Supply a numeric comparator instead of JavaScript string sorting.

JavaScript✓ Tested
CSSInteraction selectors

Style a control that fails native validation

CSS: Invalid reflects the input’s current constraint-validation result.

CSS✓ Tested
JavaScriptArrays

Sum numeric values

Provide an initial accumulator for JavaScript reduce, including empty arrays.

JavaScript✓ Tested
GitInspecting the working tree

Summarize added and removed lines numerically

Git: Numstat provides tab-separated counts suitable for processing.

Git✓ Tested
Bash ScriptsText parsing & arithmetic

Test numeric divisibility with a remainder

Bash Scripts: The modulo operator computes an integer remainder.

Bash Scripts✓ Tested
ReactForms & validation

Use native required-field validation

Use native required-field validation with a small React component and explicit browser behavior.

React✓ Tested
Arduino / CSerial protocols

Validate a complete numeric serial command

Arduino / C: Check for digits, an end pointer, and an application-specific range.

Arduino / C✓ Tested
Bash ScriptsLoops & decisions

Check whether input is a nonnegative integer

Reject empty input and nonnumeric characters before arithmetic.

validation✓ Tested