Results for “Dates & precise numbers”
Small, practical examples. Search by task or narrow things down below.
Generate a half-open range of dates
Java: datesUntil includes the starting date and excludes the end date.
Java✓ Tested
Generate numbers with a recursive CTE
Build a bounded sequence using SQL recursion.
recursive CTE✓ Tested
Show line numbers beside matches
Linux Commands: Use grep -n so a result identifies its position in the source file.
Linux Commands✓ Tested
Skip weekends when advancing dates
Python: Walk calendar dates and count only Monday through Friday.
Python✓ Tested
Sort a sequence of numbers
PowerShell: Sort a sequence of numbers using PowerShell 7.
PowerShell✓ Tested
Sort numbers numerically
Supply a numeric comparator instead of JavaScript string sorting.
JavaScript✓ Tested
Add calendar days with GNU date
Linux Commands: Anchor date arithmetic at a fixed UTC date to avoid local daylight-saving ambiguity.
Linux Commands✓ Tested
Advance a calendar date
Advance a calendar date using a complete Go program with explicit sample inputs.
Go✓ Tested
Advance a date by a number of days
Python: Use timedelta so month and year boundaries are handled automatically.
Python✓ Tested
Bound a command execution time
Linux Commands: Use timeout and handle status 124 as an expected time limit.
Linux Commands✓ Tested
Calculate a page count with ceiling division
JavaScript: Use Math.ceil for a nonnegative item count and a positive page size.
JavaScript✓ Tested
Calculate a page count with ceiling division
TypeScript: Use Math.ceil for a nonnegative item count and a positive page size.
TypeScript✓ Tested