FIND YOUR NEXT FEW LINES

Results for “Ordering & set operations”

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

667 snippets foundClear filters
HTMLGetting Started

Give related form fields a shared title

HTML: Learn how to give related form fields a shared title in a complete browser example.

HTML✓ Tested
PythonMappings & sets

Group records by a field

Python: Accumulate related values with defaultdict without checking whether each group exists.

Python✓ Tested
ReactAccessibility & events

Group related form controls semantically

Group related form controls semantically with a small React component and explicit browser behavior.

React✓ Tested
C++Filesystem operations

Handle a failed file open through stream state

C++: An unopened input stream is not an empty successful file read.

C++✓ Tested
PythonFile operations & archives

Hash a file without reading it all at once

Python: Feed fixed-size binary chunks into SHA-256 for files larger than memory.

Python✓ Tested
JavaQueues & collection operations

Initialize a map entry only when absent

Java: Use computeIfAbsent when creating a collection for a new key.

Java✓ Tested
RustMaps & sets

Insert and retrieve a map value

Insert and retrieve a map value in a complete Rust program using the standard library.

Rust✓ Tested
C#File operations & paths

Inspect a file length without reading it

C#: Use FileInfo.Length to retrieve a logical size in bytes.

C#✓ Tested
JavaScriptPromises & iteration protocols

Inspect both successful and failed promise results

JavaScript: allSettled preserves input order and reports failures without rejecting the combined promise.

JavaScript✓ Tested
TypeScriptPromises & iteration protocols

Inspect both successful and failed promise results

TypeScript: allSettled preserves input order and reports failures without rejecting the combined promise.

TypeScript✓ Tested
PythonMappings & sets

Invert a dictionary with unique values

Python: Swap keys and values when the values are hashable and unique.

Python✓ Tested
RustMaps & sets

Iterate over keys in sorted order

Iterate over keys in sorted order in a complete Rust program using the standard library.

Rust✓ Tested