FIND YOUR NEXT FEW LINES

Results for “File operations & binary data”

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

1473 snippets foundClear filters
JavaScriptUTC date operations

Find the final day of a month

JavaScript: Day zero of the following UTC month selects the previous month’s final day.

JavaScript✓ Tested
TypeScriptUTC date operations

Find the final day of a month

TypeScript: Day zero of the following UTC month selects the previous month’s final day.

TypeScript✓ Tested
C++Ordering & set operations

Find the insertion position for a sorted value

C++: lower_bound returns the first position whose value is not less than the search key.

C++✓ Tested
C#Collections & data structures

Find values common to two collections

C#: Intersect returns distinct values shared by the inputs.

C#✓ Tested
C#Collections & data structures

Find values missing from another collection

C#: Except removes duplicates as it calculates the set difference.

C#✓ Tested
CBinary formats & structured parsing

Format a known timestamp in UTC

C: gmtime converts to UTC calendar fields and strftime formats them.

C✓ Tested
CBinary formats & structured parsing

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
JavaScriptUTC date operations

Format whole seconds as hours minutes and seconds

JavaScript: Use integer divisions and remainders for a nonnegative duration.

JavaScript✓ Tested
TypeScriptUTC date operations

Format whole seconds as hours minutes and seconds

TypeScript: Use integer divisions and remainders for a nonnegative duration.

TypeScript✓ Tested
CSmall algorithms & bit operations

Generate a bounded Fibonacci sequence

C: Keep only the two previous values instead of using exponential recursive calls.

C✓ Tested
SQLRelationships & missing data

Generate every combination of two sets

SQL: CROSS JOIN creates one result per possible pair, so the output size is the product of the input sizes.

SQL✓ Tested
SQL ServerRelationships & missing data

Generate every combination of two sets

SQL Server: CROSS JOIN creates one result per possible pair, so the output size is the product of the input sizes.

SQL Server✓ Tested