Results for “run”
Small, practical examples. Search by task or narrow things down below.
Calculate a page count with ceiling division
TypeScript: Use Math.ceil for a nonnegative item count and a positive page size.
TypeScript✓ Tested
Calculate a page count without an overflowing addition
C: Divide first and add one only when a nonzero remainder remains.
C✓ Tested
Calculate a product with Aggregate
C#: Supply a seed to define the result for an empty sequence.
C#✓ Tested
Calculate a SHA-256 checksum
Calculate a file checksum so you can compare it with a hash from a trusted source and detect changed contents.
checksum✓ Tested
Calculate a SHA-256 content digest
Java: Hash UTF-8 bytes and format the result as lowercase hexadecimal.
Java✓ Tested
Calculate a SHA-256 text digest
Calculate a SHA-256 text digest using a complete Go program with explicit sample inputs.
Go✓ Tested
Calculate a simple total
Python: Multiply a unit price by a quantity, then add a delivery fee.
Python✓ Tested
Calculate a simple total
C#: Multiply a unit price by a quantity, then add a delivery fee.
C#✓ Tested
Calculate a simple total
Java: Multiply a unit price by a quantity, then add a delivery fee.
Java✓ Tested
Calculate a simple total
JavaScript: Multiply a unit price by a quantity, then add a delivery fee.
JavaScript✓ Tested
Calculate a simple total
TypeScript: Multiply a unit price by a quantity, then add a delivery fee.
TypeScript✓ Tested
Calculate a simple total
PowerShell: Calculate a simple total using PowerShell 7.
PowerShell✓ Tested