FIND YOUR NEXT FEW LINES

Results for “ram”

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

480 snippets foundClear filters
Bash ScriptsGetting Started

Use a fallback for an unset variable

Bash Scripts: Use a fallback for an unset variable with a small standalone Bash program.

Bash Scripts✓ 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
RustNumbers & durations

Use a nonnegative remainder for cyclic indexing

Use a nonnegative remainder for cyclic indexing in a complete Rust program using the standard library.

Rust✓ 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
RustFunctions & data types

Use an associated constructor

Use an associated constructor in a complete Rust program using the standard library.

Rust✓ Tested
C#Collections & data structures

Use case-insensitive dictionary keys

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

C#✓ Tested
RustGetting Started

Use if to produce a value

Use if to produce a value in a complete Rust program using the standard library.

Rust✓ 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
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
GoErrors & validation

Validate UTF-8 bytes

Validate UTF-8 bytes using a complete Go program with explicit sample inputs.

Go✓ Tested
C#Getting Started

Visit every item in a collection

C#: Print each element in the collection’s original order.

C#✓ Tested
GoConcurrency & cancellation

Wait for concurrent workers

Wait for concurrent workers using a complete Go program with explicit sample inputs.

Go✓ Tested