FIND YOUR NEXT FEW LINES

Results for “standard”

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

703 snippets foundClear filters
RustNumbers & durations

Saturate arithmetic at the type boundary

Saturate arithmetic at the type boundary in a complete Rust program using the standard library.

Rust✓ Tested
Linux CommandsStreams & byte tools

Save a stream while displaying it

Linux Commands: Use tee to write a copy of standard input to a file.

Linux Commands✓ Tested
GoTesting & reusable helpers

Scan whitespace-separated tokens

Scan whitespace-separated tokens using a complete Go program with explicit sample inputs.

Go✓ Tested
C#Collections & data structures

Search a sorted array efficiently

C#: Array.BinarySearch requires an array sorted with the same comparison rules.

C#✓ Tested
RustVectors & slices

Search a sorted slice

Search a sorted slice in a complete Rust program using the standard library.

Rust✓ Tested
C++Numbers & algorithms

Search a sorted vector

Use binary_search after ensuring C++ values are sorted.

C++✓ Tested
Linux CommandsText processing

Search for text in a file

Find matching lines with their line numbers, ignoring letter case and treating the pattern as literal text.

grep✓ Tested
PythonNumbers & calculations

Select the largest values without sorting everything

Python: Use heapq.nlargest when only a small prefix of the ranking is required.

Python✓ Tested
GoHTTP & URLs

Send a JSON HTTP response

Send a JSON HTTP response using a complete Go program with explicit sample inputs.

Go✓ Tested
RustThreads & shared ownership

Send a value through a channel

Send a value through a channel in a complete Rust program using the standard library.

Rust✓ Tested
GoFiles & paths

Separate a filename extension

Separate a filename extension using a complete Go program with explicit sample inputs.

Go✓ Tested
PythonIteration & sequences

Separate records into two lists

Python: Build two explicit partitions so callers can use both matching and rejected values.

Python✓ Tested