FIND YOUR NEXT FEW LINES

Results for “numeric”

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

131 snippets foundClear filters
GoErrors & validation

Reject non-finite numeric input

Reject non-finite numeric input using a complete Go program with explicit sample inputs.

Go✓ Tested
HTMLInput constraints

Require numeric values on a chosen step

HTML: The step interval is measured from the minimum value when one is provided.

HTML✓ Tested
Docker / ComposeGetting Started

Run a Compose service as a numeric user

Docker / Compose: Run a Compose service as a numeric user in a small Compose file.

Docker / Compose✓ Tested
Docker / ComposeExecution & file transfer

Run a one-off process with a numeric user ID

Docker / Compose: The user option overrides the image’s default identity.

Docker / Compose✓ Tested
Docker / ComposeDockerfile patterns

Set copied files’ numeric ownership

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

Docker / Compose✓ 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
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
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
JavaScriptNumbers & numeric validation

Validate a finite numeric value without coercion

JavaScript: Number.isFinite rejects numeric strings as well as NaN and infinity.

JavaScript✓ Tested