Results for “lock”
Small, practical examples. Search by task or narrow things down below.
Format a timestamp
Extract a year and month from ISO timestamp text.
strftime✓ Tested
Format a timestamp with to_char
Produce a fixed numeric date string.
to_char✓ Tested
Generate and measure a short output pulse
Arduino / C: delayMicroseconds can create a short blocking pulse on an output pin.
Arduino / C✓ Tested
Keep a control fixed to the viewport during scrolling
CSS: Fixed positioning normally uses the viewport when no ancestor establishes a different fixed containing block.
CSS✓ Tested
Observe shared ownership without extending its lifetime
C++: A weak_ptr can be locked while an owner exists and becomes expired after the last owner is released.
C++✓ Tested
Perform cleanup even after an exception
C#: A finally block runs after a handled failure as well as after success.
C#✓ Tested
Position a badge relative to its container
CSS: A positioned ancestor establishes the containing block for an absolutely positioned child.
CSS✓ Tested
Protect a shared container with a mutex
C++: A scoped lock_guard releases the mutex when its scope ends.
C++✓ Tested
Read one character from serial input
Wait for an incoming byte without blocking the main loop.
Serial.available✓ Tested
Repeat an action a fixed number of times
Use a counter and delay for a simple finite sequence.
for loop✓ Tested
Run cleanup after a handled exception
Java: A finally block executes whether the protected operation succeeds or fails.
Java✓ Tested
Set explicit grid row heights
CSS: Grid-template-rows controls each declared row’s block-axis track size.
CSS✓ Tested