FIND YOUR NEXT FEW LINES

Results for “close”

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

21 snippets foundClear filters
HTMLNative disclosure & dialogs

Open and close a modal dialog

HTML: showModal places a dialog in the top layer and makes the rest of the document inert.

HTML✓ Tested
ReactRefs & DOM interaction

Open and close a native dialog

Open and close a native dialog with a small React component and explicit browser behavior.

React✓ Tested
GoConcurrency & cancellation

Range over a closed channel

Range over a closed channel using a complete Go program with explicit sample inputs.

Go✓ Tested
RustThreads & shared ownership

Read a channel until all senders close

Read a channel until all senders close in a complete Rust program using the standard library.

Rust✓ Tested
CArray transformations

Remove one array element and close the gap

C: memmove handles the overlap while the logical length shrinks by one.

C✓ Tested
JavaRecords & reliable control flow

Run a task on an executor and close it

Java: Java 21 ExecutorService supports try-with-resources to shut down after submitted work.

Java✓ Tested
PythonNumbers & calculations

Compare floating-point calculations with tolerance

Python: Use isclose instead of exact equality for results affected by floating-point rounding.

Python✓ Tested
jQueryTraversal & selection

Find the nearest matching ancestor

Read a parent row attribute using jQuery closest.

jQuery✓ Tested
PythonNumbers & calculations

Clamp a numeric value between bounds

Python: Combine min and max for a closed interval when lower is no greater than upper.

Python✓ Tested
JavaScriptPromises & iteration protocols

Clean up a generator after an early break

JavaScript: Breaking a for-of loop closes a generator and runs its finally block.

JavaScript✓ Tested
TypeScriptPromises & iteration protocols

Clean up a generator after an early break

TypeScript: Breaking a for-of loop closes a generator and runs its finally block.

TypeScript✓ Tested
CFile positioning & lifecycle

Copy a file in bounded binary chunks

C: Check read, write, and close errors while copying without loading the entire file.

C✓ Tested