Results for “if”
Small, practical examples. Search by task or narrow things down below.
Read a stream again from its beginning
C: rewind returns a seekable stream to offset zero and clears its error and EOF indicators.
C✓ Tested
Read bytes from a chosen file offset
C: Check fseek before reading so an unsupported or invalid seek is not ignored.
C✓ Tested
Read characters without confusing EOF with a byte
C: Store fgetc in int so every unsigned-char value remains distinguishable from EOF.
C✓ Tested
Register cleanup through DestroyRef
Register cleanup through DestroyRef with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Remove collection items that satisfy a condition
Java: Use removeIf on a mutable collection to avoid changing it manually inside a for-each loop.
Java✓ Tested
Remove one known scratch file
C: Check remove’s return value instead of assuming deletion succeeded.
C✓ Tested
Rename a container without recreating it
Docker / Compose: rename updates the container name while preserving its identity.
Docker / Compose✓ Tested
Rename a known file
C: The standard rename function reports failure through its return value.
C✓ Tested
Render an observable with AsyncPipe
Render an observable with AsyncPipe with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Replace bytes at a known position in a binary file
C: Open in update mode and seek before writing a fixed-size replacement.
C✓ Tested
Rerun an effect when its dependency changes
Rerun an effect when its dependency changes with a small React component and explicit browser behavior.
React✓ Tested
Restart an existing container
Docker / Compose: restart starts the same container again while retaining its writable layer.
Docker / Compose✓ Tested