FIND YOUR NEXT FEW LINES

Results for “struct”

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

152 snippets foundClear filters
JavaScriptArray restructuring

Calculate differences between adjacent readings

JavaScript: Slice off the first value and compare each remaining value with its predecessor.

JavaScript✓ Tested
TypeScriptArray restructuring

Calculate differences between adjacent readings

TypeScript: Slice off the first value and compare each remaining value with its predecessor.

TypeScript✓ Tested
C#Collections & data structures

Combine collections as a distinct set

C#: Union retains each value once across both inputs.

C#✓ Tested
JavaScriptArray restructuring

Concatenate arrays without mutating either input

JavaScript: concat creates a shallow combined sequence.

JavaScript✓ Tested
TypeScriptArray restructuring

Concatenate arrays without mutating either input

TypeScript: concat creates a shallow combined sequence.

TypeScript✓ Tested
CBinary formats & structured parsing

Convert ASCII text to lowercase safely

C: Cast to unsigned char before calling ctype functions on a possibly signed char.

C✓ Tested
PowerShellStructured formats & encodings

Convert between hexadecimal text and bytes

PowerShell: Use the .NET hexadecimal helpers instead of parsing byte pairs manually.

PowerShell✓ Tested
JavaEncoding & structured values

Convert bytes to hexadecimal and back

Java: Use HexFormat for a standard-library representation of raw bytes.

Java✓ 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
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
JavaEncoding & structured values

Decode a form query parameter

Java: URLDecoder reverses form encoding and treats plus as a space.

Java✓ Tested