FIND YOUR NEXT FEW LINES

Results for “date arithmetic”

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

292 snippets foundClear filters
Arduino / CData & storage

Map an input range to an output range

Scale an integer reading to a different interval.

map✓ Tested
jQueryEvents

Mirror input text

Update a result as the user types using a jQuery input event.

jQuery✓ Tested
JavaScriptArray traversal & selection

Pair corresponding array items by position

JavaScript: Validate equal lengths before zipping when missing counterparts would be an error.

JavaScript✓ Tested
TypeScriptArray traversal & selection

Pair corresponding array items by position

TypeScript: Validate equal lengths before zipping when missing counterparts would be an error.

TypeScript✓ Tested
C#LINQ transformations

Pair corresponding collection elements

C#: Zip stops at the shorter sequence, so validate lengths separately if mismatches are an error.

C#✓ Tested
PythonFunctions & error handling

Parse a typed command-line option

Python: Use argparse to validate and convert an integer option.

Python✓ Tested
JavaNumbers & dates

Parse an integer safely

Handle invalid Java integer input with NumberFormatException.

Java✓ Tested
CNumbers & memory

Parse an integer with validation

Validate range and trailing characters when parsing a C integer with strtol.

C✓ Tested
JavaScriptObject behavior & collections

Prevent runtime changes to top-level properties

JavaScript: Object.freeze prevents ordinary top-level mutations; Reflect.set reports the rejected update without throwing.

JavaScript✓ Tested
TypeScriptObject behavior & collections

Prevent runtime changes to top-level properties

TypeScript: Object.freeze prevents ordinary top-level mutations; Reflect.set reports the rejected update without throwing.

TypeScript✓ Tested
GitRemotes & collaboration

Pull without creating a merge commit

Update a branch only when its upstream can be fast-forwarded.

pull✓ Tested
C#Data & dates

Read a JSON property

Parse a JSON document and dispose it after reading in C#.

C#✓ Tested