FIND YOUR NEXT FEW LINES

Results for “library”

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

653 snippets foundClear filters
GoTesting & reusable helpers

Clamp a value to an allowed interval

Clamp a value to an allowed interval using a complete Go program with explicit sample inputs.

Go✓ Tested
PythonFile operations & archives

Clean up a temporary directory automatically

Python: Use TemporaryDirectory as a context manager so cleanup also happens after exceptions.

Python✓ Tested
jQueryGetting Started

Clear a container’s contents

jQuery: Learn how to clear a container’s contents in a complete browser example.

jQuery✓ Tested
GoMaps & sets

Clear all map entries

Clear all map entries using a complete Go program with explicit sample inputs.

Go✓ Tested
GoMaps & sets

Clone a map before editing it

Clone a map before editing it using a complete Go program with explicit sample inputs.

Go✓ Tested
RustGetting Started

Clone an owned value explicitly

Clone an owned value explicitly in a complete Rust program using the standard library.

Rust✓ Tested
jQueryInsertion & wrapping

Clone markup without sharing its identity

jQuery: clone creates a separate node; change duplicated IDs before inserting.

jQuery✓ Tested
jQueryAnimation completion

Collapse a panel after an animation

jQuery: slideUp hides the panel when the transition completes.

jQuery✓ Tested
RustTesting & reusable patterns

Collect borrowed values into owned strings

Collect borrowed values into owned strings in a complete Rust program using the standard library.

Rust✓ Tested
PythonFunctions & error handling

Collect independent asynchronous results

Python: Use asyncio.gather to await multiple coroutines while preserving input order.

Python✓ Tested
jQueryTraversal & selection

Collect matching ancestors

jQuery: parents can return several ancestors, ordered from the nearest outward.

jQuery✓ Tested
jQueryForm serialization & state

Collect repeated form field names

jQuery: serializeArray preserves multiple values as name-value records.

jQuery✓ Tested