FIND YOUR NEXT FEW LINES

Results for “all”

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

1115 snippets foundClear filters
SQLiteConstraints & defaults

Reject a negative quantity with CHECK

SQLite: Combine NOT NULL and CHECK because an unknown NULL check result is normally accepted.

SQLite✓ Tested
Arduino / CEEPROM & program memory

Reject an unsupported settings version

Arduino / C: A version byte lets firmware fall back when stored settings use another format.

Arduino / C✓ Tested
SQLConstraints & defaults

Reject duplicate business identifiers

SQL: A UNIQUE constraint protects a business key independently of the primary key.

SQL✓ Tested
SQL ServerConstraints & defaults

Reject duplicate business identifiers

SQL Server: A UNIQUE constraint protects a business key independently of the primary key.

SQL Server✓ Tested
PostgresConstraints & defaults

Reject duplicate business identifiers

Postgres: A UNIQUE constraint protects a business key independently of the primary key.

Postgres✓ Tested
SQLiteConstraints & defaults

Reject duplicate business identifiers

SQLite: A UNIQUE constraint protects a business key independently of the primary key.

SQLite✓ Tested
C++Numeric parsing & calculations

Reject infinite and NaN numeric values

C++: std::isfinite excludes special floating-point values.

C++✓ Tested
CNumeric parsing & arithmetic

Reject NaN and infinite values

C: isfinite detects whether a floating-point value is an ordinary finite number.

C✓ Tested
ReactRefs & DOM interaction

Remember the previously committed value

Remember the previously committed value with a small React component and explicit browser behavior.

React✓ Tested
C++Containers & compound values

Remove a map entry and inspect the number removed

C++: erase by key reports whether a unique-key map contained the entry.

C++✓ Tested
CStrings

Remove a trailing line ending

Use strcspn to terminate a C string at its first newline or carriage return.

C✓ Tested
CArray transformations

Remove adjacent duplicates from a sorted array

C: Compact equal neighbors with a write index after sorting or otherwise establishing order.

C✓ Tested