FIND YOUR NEXT FEW LINES

Results for “end”

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

533 snippets foundClear filters
PythonDates & time zones

Count days between calendar dates

Python: Subtract date objects to get an exact calendar-day difference.

Python✓ Tested
PowerShellDates & numeric validation

Count days between calendar dates

PowerShell: Parse an unambiguous format before subtracting date values.

PowerShell✓ Tested
AngularServices & dependency injection

Create a dependency with a provider factory

Create a dependency with a provider factory with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
CDynamic memory & ownership

Create an independent copy of a byte buffer

C: Allocate the exact byte length and copy only after checking the result.

C✓ Tested
JavaScriptArray restructuring

Create independent rows in a matrix

JavaScript: Use a mapping function to create each row instead of sharing one array with fill.

JavaScript✓ Tested
TypeScriptArray restructuring

Create independent rows in a matrix

TypeScript: Use a mapping function to create each row instead of sharing one array with fill.

TypeScript✓ Tested
ReactComponents & props

Customize a renderer through a function prop

Customize a renderer through a function prop with a small React component and explicit browser behavior.

React✓ Tested
CBinary formats & structured parsing

Decode a 16-bit big-endian integer

C: Promote bytes to an unsigned integer type before combining shifted values.

C✓ Tested
ReactAsync work & status

Disable an action while it is pending

Disable an action while it is pending with a small React component and explicit browser behavior.

React✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Distinguish an empty input line from end of input

Bash Scripts: A successful read can return an empty value; its status indicates whether a line was read.

Bash Scripts✓ Tested
GoTesting & reusable helpers

Distinguish end-of-input from other errors

Distinguish end-of-input from other errors using a complete Go program with explicit sample inputs.

Go✓ Tested
Arduino / CBinary values & packets

Encode a value as little-endian bytes

Arduino / C: Store the least significant byte first when the protocol requires it.

Arduino / C✓ Tested