FIND YOUR NEXT FEW LINES

Results for “pre”

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

429 snippets foundClear filters
TypeScriptRegular expressions & URL encoding

Build a URL query string from values

TypeScript: URLSearchParams handles query escaping and repeated parameter appends.

TypeScript✓ Tested
CArray transformations

Calculate a cumulative sum for each position

C: Keep a running total and store each prefix result in a separate output array.

C✓ Tested
AngularGetting Started

Calculate a value in a template

Calculate a value in a template with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
ReactGetting Started

Calculate a value inside JSX

Calculate a value inside JSX with a small React component and explicit browser behavior.

React✓ Tested
C#Dates & precise numbers

Calculate an integer beyond the 64-bit range

C#: Use BigInteger for arbitrary-precision integer arithmetic.

C#✓ Tested
JavaPrecise numeric calculations

Calculate beyond the long integer range

Java: Use BigInteger when a fixed-width primitive type would overflow.

Java✓ Tested
C#Dates & precise numbers

Calculate the number of calendar days between dates

C#: Subtract DayNumber values when the inputs are calendar dates.

C#✓ Tested
C#Dates & precise numbers

Clamp a number to inclusive bounds

C#: Math.Clamp returns the nearest endpoint when the value lies outside the range.

C#✓ Tested
JavaPrecise numeric calculations

Compare floating-point results with a tolerance

Java: For this bounded example, compare the absolute difference against a chosen error threshold.

Java✓ Tested
SQLiteTables & writes

Compute a generated column

Store inputs and derive a value from them.

generated column✓ Tested
C#Dates & precise numbers

Convert a timestamp to a different fixed offset

C#: ToOffset changes the displayed local time while retaining the same instant.

C#✓ Tested
C#Dates & precise numbers

Convert Unix seconds to an offset-aware timestamp

C#: DateTimeOffset preserves the UTC offset explicitly.

C#✓ Tested