FIND YOUR NEXT FEW LINES

Results for “number”

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

183 snippets foundClear filters
C++Text validation & parsing

Replace text using captured regex groups

C++: Numbered replacement groups can rearrange a known two-part name.

C++✓ Tested
C++Numbers & algorithms

Search a sorted vector

Use binary_search after ensuring C++ values are sorted.

C++✓ Tested
Linux CommandsText processing

Search for text in a file

Find matching lines with their line numbers, ignoring letter case and treating the pattern as literal text.

grep✓ Tested
SQLWindow analytics

Select the top row in each group with a tie-breaker

SQL: Filter an outer query on ROW_NUMBER because window functions are not evaluated in WHERE.

SQL✓ Tested
SQL ServerWindow analytics

Select the top row in each group with a tie-breaker

SQL Server: Filter an outer query on ROW_NUMBER because window functions are not evaluated in WHERE.

SQL Server✓ Tested
PostgresWindow analytics

Select the top row in each group with a tie-breaker

Postgres: Filter an outer query on ROW_NUMBER because window functions are not evaluated in WHERE.

Postgres✓ Tested
SQLiteWindow analytics

Select the top row in each group with a tie-breaker

SQLite: Filter an outer query on ROW_NUMBER because window functions are not evaluated in WHERE.

SQLite✓ Tested
CNumbers & memory

Set and test bit flags

Use unsigned masks to combine and test C flags.

C✓ Tested
Bash ScriptsLoops & decisions

Sum a range of integers

Use an arithmetic loop without launching external processes.

arithmetic✓ Tested
JavaNumbers & dates

Sum integer values

Reduce a Java integer stream to its sum.

Java✓ Tested
SQLExpressions & aggregates

Sum values per category

Calculate a grouped total.

SUM✓ Tested
C++Numbers & algorithms

Sum vector values

Use std::accumulate with a wide initial value.

C++✓ Tested