Results for “values”
Small, practical examples. Search by task or narrow things down below.
Parse a GUID without an exception
C#: TryParse reports malformed values with a boolean return.
C#✓ Tested
Parse a JSON string
Convert a JSON string into a Python dictionary and read values by key.
json✓ Tested
Parse an enum name without throwing
C#: Combine TryParse and IsDefined when only named declared values should be accepted.
C#✓ Tested
Partition a collection by a predicate
Java: Use partitioningBy to retain both matching and nonmatching values.
Java✓ Tested
Print a floating-point value with fixed precision
Choose the number of decimal places in serial output.
float✓ Tested
Read a small INI configuration
Python: Use ConfigParser typed accessors for configuration values stored as text.
Python✓ Tested
Read checked options
Collect checked checkbox values with jQuery map and get.
jQuery✓ Tested
Read rows from CSV text
Parse CSV into objects with named properties.
CSV✓ Tested
Reject infinity and NaN
C#: Double.IsFinite distinguishes usable finite numeric inputs from special values.
C#✓ Tested
Reject one outlier with a median-of-three filter
Arduino / C: Sorting three values leaves the median in the middle.
Arduino / C✓ Tested
Remove an indexed element and compact the array
Bash Scripts: Unsetting an element leaves a gap; reassigning the values creates consecutive indices.
Bash Scripts✓ Tested
Remove duplicates from a list
Remove repeated hashable values while preserving the order in which they first appeared.
list✓ Tested