FIND YOUR NEXT FEW LINES

Results for “as”

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

2533 snippets foundClear filters
JavaEncoding & structured values

Convert bytes to hexadecimal and back

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

Java✓ Tested
Arduino / CSensor calculations

Convert Celsius to Fahrenheit

Arduino / C: Use floating-point constants to avoid integer division.

Arduino / C✓ Tested
TypeScriptUTC date operations

Convert epoch milliseconds to whole seconds

TypeScript: JavaScript Date stores milliseconds while many APIs use Unix seconds.

TypeScript✓ Tested
JavaDates & time zones

Convert epoch seconds into an instant

Java: Instant represents a UTC timeline point independent of the default timezone.

Java✓ Tested
PythonText validation & encoding

Convert hexadecimal text to bytes

Python: Use bytes.fromhex for a readable byte representation and hex for the reverse conversion.

Python✓ Tested
PythonGetting Started

Convert known numeric text to an integer

Python: Convert a trusted literal to an integer before adding. Validate external input before converting it.

Python✓ Tested
JavaGetting Started

Convert known numeric text to an integer

Java: Convert a trusted literal to an integer before adding. Validate external input before converting it.

Java✓ Tested
TypeScriptGetting Started

Convert known numeric text to an integer

TypeScript: Convert a trusted literal to an integer before adding. Validate external input before converting it.

TypeScript✓ Tested
C++Getting Started

Convert known numeric text to an integer

C++: Convert a trusted literal to an integer before adding. Validate external input before converting it.

C++✓ Tested
CGetting Started

Convert known numeric text to an integer

C: Convert a trusted literal to an integer before adding. Validate external input before converting it.

C✓ Tested
Linux CommandsTransforming text

Convert tab stops to spaces

Linux Commands: Use expand with a fixed tab width when preparing plain-text alignment.

Linux Commands✓ Tested
PowerShellDates & numeric validation

Convert Unix seconds into an aware UTC timestamp

PowerShell: DateTimeOffset.FromUnixTimeSeconds creates a value with an explicit UTC offset.

PowerShell✓ Tested