FIND YOUR NEXT FEW LINES

Results for “lock”

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

39 snippets foundClear filters
SQLiteDates & time

Format a timestamp

Extract a year and month from ISO timestamp text.

strftime✓ Tested
PostgresDates & series

Format a timestamp with to_char

Produce a fixed numeric date string.

to_char✓ Tested
Arduino / CDigital signals & interrupts

Generate and measure a short output pulse

Arduino / C: delayMicroseconds can create a short blocking pulse on an output pin.

Arduino / C✓ Tested
CSSPositioning & stacking

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
C++Ownership & optional values

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
C#Types & reliable control flow

Perform cleanup even after an exception

C#: A finally block runs after a handled failure as well as after success.

C#✓ Tested
CSSPositioning & stacking

Position a badge relative to its container

CSS: A positioned ancestor establishes the containing block for an absolutely positioned child.

CSS✓ Tested
C++Tasks & synchronization

Protect a shared container with a mutex

C++: A scoped lock_guard releases the mutex when its scope ends.

C++✓ Tested
Arduino / CSerial communication

Read one character from serial input

Wait for an incoming byte without blocking the main loop.

Serial.available✓ Tested
Arduino / CTiming & control

Repeat an action a fixed number of times

Use a counter and delay for a simple finite sequence.

for loop✓ Tested
JavaRecords & reliable control flow

Run cleanup after a handled exception

Java: A finally block executes whether the protected operation succeeds or fails.

Java✓ Tested
CSSGrid placement

Set explicit grid row heights

CSS: Grid-template-rows controls each declared row’s block-axis track size.

CSS✓ Tested