Results for “as”
Small, practical examples. Search by task or narrow things down below.
Find the last day of a month
Java: Use YearMonth so leap years and month lengths are handled by the calendar library.
Java✓ Tested
Find the least common multiple with the standard library
C++: std::lcm combines positive integer periods into a common cycle.
C++✓ Tested
Fit as many columns as possible
Use auto-fit and minmax for a CSS grid that responds to its available width.
CSS✓ Tested
Format a bounded duration as hours minutes and seconds
PowerShell: TimeSpan can format duration components with escaped separators.
PowerShell✓ Tested
Format a fractional value as a percentage
Format a fractional value as a percentage with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Format a nonnegative integer amount as whole and fractional units
C: Keep the calculation in integer minor units and use two digits for the remainder.
C✓ Tested
Format an integer as padded hexadecimal
Format an integer as padded hexadecimal in a complete Rust program using the standard library.
Rust✓ Tested
Format text in lowercase
Format text in lowercase with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Format whole seconds as hours minutes and seconds
JavaScript: Use integer divisions and remainders for a nonnegative duration.
JavaScript✓ Tested
Format whole seconds as hours minutes and seconds
TypeScript: Use integer divisions and remainders for a nonnegative duration.
TypeScript✓ Tested
Generate and measure a short output pulse
Arduino / C: delayMicroseconds can create a short blocking pulse on an output pin.
Arduino / C✓ Tested
Handle a filename that begins with a dash
Linux Commands: Use -- to terminate command options before an unusual filename.
Linux Commands✓ Tested