FIND YOUR NEXT FEW LINES

Results for “pre”

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

429 snippets foundClear filters
Linux CommandsArchives & checksums

Create a compressed tar archive

Bundle a directory into a gzip-compressed tar archive, preserving the directory structure.

tar✓ Tested
HTMLMetadata & document links

Declare a preferred canonical URL

HTML: A canonical link identifies the preferred public URL for duplicate representations of a document.

HTML✓ Tested
HTMLMetadata & document links

Declare an indexing preference for a draft page

HTML: A robots meta element can request noindex while allowing link following.

HTML✓ Tested
JavaFile operations & binary data

Delete a known temporary file if present

Java: deleteIfExists returns whether a file was removed and still reports other I/O errors.

Java✓ Tested
JavaPrecise numeric calculations

Divide decimal values with controlled precision

Java: Choose both scale and rounding for a quotient that does not terminate in base ten.

Java✓ Tested
RustNumbers & durations

Express a duration in milliseconds

Express a duration in milliseconds in a complete Rust program using the standard library.

Rust✓ Tested
Linux CommandsArchives & checksums

Extract a compressed tar archive

Extract a trusted gzip-compressed tar archive into a dedicated destination directory.

tar✓ Tested
PythonMappings & sets

Find values present in exactly one set

Python: Use symmetric difference when either side can contain unmatched values.

Python✓ Tested
C++Ordering & set operations

Group matching values while preserving their order

C++: stable_partition keeps the relative order within both predicate groups.

C++✓ Tested
ReactAccessibility & events

Handle an Escape key press

Handle an Escape key press with a small React component and explicit browser behavior.

React✓ Tested
PythonNumbers & calculations

Insert a value while preserving sorted order

Python: Use insort on an already sorted list; insertion still shifts later list elements.

Python✓ Tested
C++Text validation & parsing

Iterate over all regular-expression matches

C++: A regex iterator yields successive matches without manually updating an offset.

C++✓ Tested