Results for “save file”
Small, practical examples. Search by task or narrow things down below.
Round halfway floating-point values away from zero
C++: std::round has an explicit halfway rule different from truncation.
C++✓ Tested
Run a command in a running container
Execute an additional process inside an existing container.
exec✓ Tested
Run a one-off container
Run a command and remove its stopped container automatically.
run✓ Tested
Run a process as an unprivileged user
Docker / Compose: Run a process as an unprivileged user using a locally available Ubuntu image.
Docker / Compose✓ Tested
Run a task on a thread and join it
C++: Join before reading a result written by the worker thread.
C++✓ Tested
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
Run an image by its local immutable ID
Docker / Compose: Resolve the local image ID before invoking it.
Docker / Compose✓ Tested
Run cleanup after a handled exception
Java: A finally block executes whether the protected operation succeeds or fails.
Java✓ Tested
Run cleanup after a promise settles
JavaScript: finally runs after success or failure and normally preserves the original outcome.
JavaScript✓ Tested
Run cleanup after a promise settles
TypeScript: finally runs after success or failure and normally preserves the original outcome.
TypeScript✓ Tested
Run cleanup after an AJAX failure
jQuery: always runs on success or failure and can clear loading state.
jQuery✓ Tested
Run cleanup around a custom context
Python: Use try/finally inside a contextmanager so cleanup runs even on failure.
Python✓ Tested