FIND YOUR NEXT FEW LINES

Results for “Dates & precise numbers”

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

184 snippets foundClear filters
CNumbers & memory

Parse an integer with validation

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

C✓ Tested
PythonStrings & dates

Parse and format a date

Convert a date string into a datetime object, then format it in a different, human-readable order.

date✓ Tested
C#Data & dates

Read a JSON property

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

C#✓ Tested
GitRemotes & additional checkouts

Rename a configured remote

Git: Renaming a remote updates its associated configuration and remote-tracking references.

Git✓ Tested
Docker / ComposeContainer lifecycle

Rename a container without recreating it

Docker / Compose: rename updates the container name while preserving its identity.

Docker / Compose✓ Tested
PythonStrings & dates

Replace text in a string

Replace every occurrence of a substring and keep the result in a new string. The original string is unchanged.

string✓ Tested
GitMerging & replaying changes

Replay an unpublished branch on a newer base

Git: Rebase updates the base of local feature commits when their changes do not conflict.

Git✓ Tested
PowerShellFunctions & parameter validation

Restrict a function parameter to known choices

PowerShell: ValidateSet rejects unsupported values before the function body executes.

PowerShell✓ Tested
PostgresDates & series

Round a timestamp down to its month

Group dates by a calendar boundary.

date_trunc✓ Tested
C++Numbers & algorithms

Search a sorted vector

Use binary_search after ensuring C++ values are sorted.

C++✓ Tested
Linux CommandsText processing

Search for text in a file

Find matching lines with their line numbers, ignoring letter case and treating the pattern as literal text.

grep✓ Tested
C#Data & dates

Serialize an object to JSON

Serialize a small anonymous C# object with System.Text.Json.

C#✓ Tested