FIND YOUR NEXT FEW LINES

Results for “Errors & optional values”

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

354 snippets foundClear filters
CGetting Started

Handle three possible outcomes

C: Check high, normal and low values with an ordered conditional chain.

C✓ Tested
Arduino / CGetting Started

Hello World: Blink

Arduino / C: Blink the built-in LED slowly and then quickly, repeating both rates in loop().

Arduino / C✓ 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
PostgresRows & writes

Inspect deleted rows

Return values from the rows a DELETE removes.

DELETE✓ Tested
JavaScriptObjects & JSON

Iterate over object entries

Read JavaScript property names and values using Object.entries.

JavaScript✓ Tested
JavaStrings

Join strings with a separator

Build a Java string from several values using String.join.

Java✓ Tested
C++Strings

Join strings with a separator

Use an output string stream to join C++ values without a trailing separator.

C++✓ Tested
PostgresWindows & text

Join text rows in a chosen order

Combine values using string_agg.

string_agg✓ Tested
PythonMappings & sets

Keep only the most recent items

Python: Use a bounded deque to discard the oldest item as new values arrive.

Python✓ Tested
Docker / ComposeCompose service options

Load service variables from an env file

Docker / Compose: env_file supplies runtime environment values.

Docker / Compose✓ Tested
SQLConstraints & defaults

Make a pair of columns unique together

SQL: A composite primary key permits repeated individual values while forbidding a duplicate combination.

SQL✓ Tested
SQL ServerConstraints & defaults

Make a pair of columns unique together

SQL Server: A composite primary key permits repeated individual values while forbidding a duplicate combination.

SQL Server✓ Tested