FIND YOUR NEXT FEW LINES

Results for “read file”

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

1171 snippets foundClear filters
RustTesting & reusable patterns

Move a collection out and leave an empty default

Move a collection out and leave an empty default in a complete Rust program using the standard library.

Rust✓ Tested
GoFunctions & types

Mutate a struct through a pointer receiver

Mutate a struct through a pointer receiver using a complete Go program with explicit sample inputs.

Go✓ Tested
GoGetting Started

Name a fixed configuration value

Name a fixed configuration value using a complete Go program with explicit sample inputs.

Go✓ Tested
C++Getting Started

Name a value that stays fixed

C++: Use a constant declaration or the language’s constant naming convention for a fixed limit.

C++✓ Tested
SQLiteQueries & text

Number a sorted result

Assign a row number without changing stored data.

row_number✓ Tested
RustIterators & transformations

Number items while iterating

Number items while iterating in a complete Rust program using the standard library.

Rust✓ Tested
C++Tasks & synchronization

Observe an exception from an asynchronous task

C++: Calling get rethrows an exception captured by the future.

C++✓ Tested
GoConcurrency & cancellation

Observe context cancellation

Observe context cancellation using a complete Go program with explicit sample inputs.

Go✓ Tested
C++Ownership & optional values

Observe shared ownership without extending its lifetime

C++: A weak_ptr can be locked while an owner exists and becomes expired after the last owner is released.

C++✓ Tested
Docker / ComposeCompose service options

Override the image entrypoint in Compose

Docker / Compose: entrypoint and command combine as executable and arguments.

Docker / Compose✓ Tested
RustTesting & reusable patterns

Own a heap-allocated value with Box

Own a heap-allocated value with Box in a complete Rust program using the standard library.

Rust✓ Tested
C++Ownership & optional values

Own one dynamically allocated value with unique_ptr

C++: make_unique allocates a value whose lifetime is tied to its owning smart pointer.

C++✓ Tested