FIND YOUR NEXT FEW LINES

Results for “k”

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

1871 snippets foundClear filters
RustFunctions & data types

Implement a method on a struct

Implement a method on a struct in a complete Rust program using the standard library.

Rust✓ Tested
CSSInteraction & themes

Include padding in element width

Use border-box to keep CSS padding and borders inside the declared width.

CSS✓ Tested
SQLRelationships & missing data

Include zero counts for missing relationships

SQL: Count the non-null child key after a left join so a missing relationship produces zero.

SQL✓ Tested
SQL ServerRelationships & missing data

Include zero counts for missing relationships

SQL Server: Count the non-null child key after a left join so a missing relationship produces zero.

SQL Server✓ Tested
PostgresRelationships & missing data

Include zero counts for missing relationships

Postgres: Count the non-null child key after a left join so a missing relationship produces zero.

Postgres✓ Tested
SQLiteRelationships & missing data

Include zero counts for missing relationships

SQLite: Count the non-null child key after a left join so a missing relationship produces zero.

SQLite✓ Tested
Bash ScriptsGetting Started

Increase an integer variable

Bash Scripts: Increase an integer variable with a small standalone Bash program.

Bash Scripts✓ Tested
Bash ScriptsText parsing & arithmetic

Increment a counter without an unexpected errexit

Bash Scripts: An assignment avoids the zero-result exit status of a standalone arithmetic post-increment.

Bash Scripts✓ Tested
GoConcurrency & cancellation

Increment an atomic counter

Increment an atomic counter using a complete Go program with explicit sample inputs.

Go✓ Tested
JavaQueues & collection operations

Initialize a map entry only when absent

Java: Use computeIfAbsent when creating a collection for a new key.

Java✓ Tested
GoConcurrency & cancellation

Initialize a resource only once

Initialize a resource only once using a complete Go program with explicit sample inputs.

Go✓ Tested
AngularLifecycle & observable data

Initialize component data with ngOnInit

Initialize component data with ngOnInit with a standalone Angular component and explicit browser behavior.

Angular✓ Tested