FIND YOUR NEXT FEW LINES

Results for “C++”

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

3000 snippets foundClear filters
JavaFile operations & binary data

Load a small properties configuration

Java: Use a Reader to make the configuration character encoding explicit.

Java✓ Tested
Bash ScriptsFunction scope & composition

Load functions from a trusted local script

Bash Scripts: Source executes a file in the current shell so its function definitions remain available.

Bash Scripts✓ Tested
Docker / ComposeCompose service options

Load service variables from an env file

Docker / Compose: env_file supplies runtime environment values.

Docker / Compose✓ Tested
JavaQueues & collection operations

Locate a value in a sorted array

Java: Use Arrays.binarySearch only after establishing ascending order.

Java✓ Tested
C#Collections

Look up a dictionary value

Use TryGetValue for a C# dictionary lookup with a fallback.

C#✓ Tested
Bash ScriptsFunctions & arguments

Look up values in an associative array

Use named keys for a small in-memory configuration table.

dictionary✓ Tested
RustGetting Started

Loop over an inclusive range

Loop over an inclusive range in a complete Rust program using the standard library.

Rust✓ 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
Docker / ComposeGetting Started

Make a Compose service’s filesystem read-only

Docker / Compose: Make a Compose service’s filesystem read-only in a small Compose file.

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
PostgresConstraints & defaults

Make a pair of columns unique together

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

Postgres✓ Tested