FIND YOUR NEXT FEW LINES

Results for “UTF-8”

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

401 snippets foundClear filters
PostgresGetting Started

Update one row using its primary key

Postgres: Use a precise WHERE condition to change only the intended row in a scratch table.

Postgres✓ Tested
PostgresBulk changes & set operations

Update rows selected by a related table

Postgres: Use EXISTS to limit updates based on an independent eligibility table.

Postgres✓ Tested
PostgresBulk changes & set operations

Update several classifications in one statement

Postgres: A CASE expression computes the new value for each row covered by the update predicate.

Postgres✓ Tested
C#Collections & data structures

Use a last-in first-out stack

C#: Stack is useful for reversible traversal and other nested operations.

C#✓ Tested
C#Types & reliable control flow

Use a switch expression to classify a value

C#: Relational patterns express a small ordered range classification.

C#✓ Tested
Arduino / CGetting Started

Use a wider type for a large count

Arduino / C: Use a wider type for a large count on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
C#Collections & data structures

Use case-insensitive dictionary keys

C#: Choose an ordinal comparer when case-insensitive keys represent identifiers.

C#✓ Tested
Arduino / CArrays & embedded state

Use named states for a controller

Arduino / C: An enum makes state transitions easier to read than unexplained numbers.

Arduino / C✓ Tested
C#Text validation & encoding

Validate a complete identifier with a regex

C#: Use absolute anchors and a timeout so the regex checks the complete input with a bounded execution time.

C#✓ 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
Arduino / CEEPROM & program memory

Validate a small stored payload with a checksum

Arduino / C: Store a checksum with the payload and reject a changed byte.

Arduino / C✓ Tested
C#Types & reliable control flow

Validate an argument at a method boundary

C#: ThrowIfNegative gives callers an explicit argument error for an invalid range.

C#✓ Tested