FIND YOUR NEXT FEW LINES

Results for “only”

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

621 snippets foundClear filters
C#Getting Started

Print a number with two decimal places

C#: Format a small decimal value consistently for display.

C#✓ Tested
C#Collections & data structures

Process a FIFO queue

C#: Queue removes elements in the order they were enqueued.

C#✓ Tested
C#File operations & paths

Process a file as a lazy line sequence

C#: ReadLines avoids allocating one string containing the entire file.

C#✓ Tested
RustVectors & slices

Process a slice in bounded chunks

Process a slice in bounded chunks in a complete Rust program using the standard library.

Rust✓ Tested
C#Collections & data structures

Process items by numeric priority

C#: PriorityQueue removes the item with the smallest priority value first.

C#✓ Tested
RustErrors & optional values

Propagate a parsing error with question mark

Propagate a parsing error with question mark in a complete Rust program using the standard library.

Rust✓ Tested
GoConcurrency & cancellation

Protect a shared counter

Protect a shared counter using a complete Go program with explicit sample inputs.

Go✓ Tested
RustThreads & shared ownership

Protect shared mutable state with a mutex

Protect shared mutable state with a mutex in a complete Rust program using the standard library.

Rust✓ Tested
RustErrors & optional values

Provide a default for a missing value

Provide a default for a missing value in a complete Rust program using the standard library.

Rust✓ Tested
C#Types & reliable control flow

Provide a fallback for a nullable value

C#: The null-coalescing operator supplies a default only when the left side is null.

C#✓ Tested
GitRemotes & additional checkouts

Push one selected release tag

Git: Naming a single tag avoids pushing every local tag unintentionally.

Git✓ Tested
RustMaps & sets

Query an ordered map’s key range

Query an ordered map’s key range in a complete Rust program using the standard library.

Rust✓ Tested