FIND YOUR NEXT FEW LINES

Results for “read only”

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

990 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
C#File operations & paths

Move a file to a new filename

C#: File.Move changes the file path without loading its contents.

C#✓ 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
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
HTMLLinks & accessibility

Name an icon button

Give a button containing only a symbol an accessible name.

HTML✓ Tested
C#Types & reliable control flow

Narrow an object using a type pattern

C#: A successful is pattern introduces a strongly typed local variable.

C#✓ Tested
C++Filesystem operations

Normalize a path without touching the filesystem

C++: lexically_normal removes redundant dot components using path syntax alone.

C++✓ Tested
C#Text validation & encoding

Normalize canonically equivalent Unicode strings

C#: Normalize to NFC before an ordinal comparison of equivalent character sequences.

C#✓ 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