Results for “ratio”
Small, practical examples. Search by task or narrow things down below.
Check whether a future is ready without blocking
C++: A zero-duration wait reports timeout until the producer sets a value.
C++✓ Tested
Copy a file with explicit permissions
Linux Commands: Use install to create parent directories and set the destination mode in one operation.
Linux Commands✓ Tested
Count Unicode code points in a string
JavaScript: String iteration combines surrogate pairs, unlike the UTF-16 length property.
JavaScript✓ Tested
Count Unicode code points in a string
TypeScript: String iteration combines surrogate pairs, unlike the UTF-16 length property.
TypeScript✓ Tested
Create an annotated release tag
Mark a revision with a readable release description.
tag✓ Tested
Encode and decode a file with Base64
Linux Commands: Use GNU base64 for text transport of bytes and --decode for the reverse operation.
Linux Commands✓ Tested
Fit an entire image inside a differently shaped box
CSS: Contain preserves the image aspect ratio while keeping all of it visible inside the specified content box.
CSS✓ Tested
Increment a shared counter atomically
C#: Interlocked performs an indivisible update without a separate lock for this operation.
C#✓ Tested
Initialize structure fields by name
C: Designated initializers make field assignments independent of their declaration order.
C✓ Tested
Inspect a GitHub remote URL
Configure and inspect an example origin without contacting the network.
GitHub✓ Tested
Keep an image and its visible caption together
HTML: Figure and figcaption represent a self-contained illustration with an associated caption.
HTML✓ Tested
List files by extension
Enumerate regular files and return their names in order.
Get-ChildItem✓ Tested