FIND YOUR NEXT FEW LINES

Results for “Numeric parsing & calculations”

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

232 snippets foundClear filters
SQL ServerReporting & grouped calculations

Group by more than one field

SQL Server: Each distinct combination of grouping fields produces its own row.

SQL Server✓ Tested
PostgresReporting & grouped calculations

Group by more than one field

Postgres: Each distinct combination of grouping fields produces its own row.

Postgres✓ Tested
SQLiteReporting & grouped calculations

Group by more than one field

SQLite: Each distinct combination of grouping fields produces its own row.

SQLite✓ Tested
Arduino / CSensor calculations

Ignore small movements around a center value

Arduino / C: Values inside the deadband become zero while others keep their direction.

Arduino / C✓ Tested
Bash ScriptsText parsing & arithmetic

Increment a counter without an unexpected errexit

Bash Scripts: An assignment avoids the zero-result exit status of a standalone arithmetic post-increment.

Bash Scripts✓ Tested
PythonNumbers & calculations

Insert a value while preserving sorted order

Python: Use insort on an already sorted list; insertion still shifts later list elements.

Python✓ Tested
C++Text validation & parsing

Inspect a substring without allocating a copy

C++: A string_view refers to existing storage and must not outlive that storage.

C++✓ Tested
Arduino / CSensor calculations

Interpolate between two calibration points

Arduino / C: Compute a fractional position before scaling to the output interval.

Arduino / C✓ Tested
C++Text validation & parsing

Iterate over all regular-expression matches

C++: A regex iterator yields successive matches without manually updating an offset.

C++✓ Tested
Arduino / CSensor calculations

Maintain a rolling sum in a circular window

Arduino / C: Subtract the overwritten sample before adding the next one.

Arduino / C✓ Tested
RustParsing & byte data

Parse a Boolean literal

Parse a Boolean literal in a complete Rust program using the standard library.

Rust✓ Tested
CBinary formats & structured parsing

Parse a bounded simple record with sscanf

C: A width limit protects the destination buffer and the consumed count detects trailing junk.

C✓ Tested