Results for “Form behavior”
Small, practical examples. Search by task or narrow things down below.
Set an image’s default command
Use JSON array syntax for a predictable command.
Dockerfile✓ Tested
Sort an integer array with qsort
C: The comparator uses relational comparisons to avoid subtraction overflow.
C✓ Tested
Split values into fixed-size chunks
C#: Enumerable.Chunk creates arrays and allows a shorter final chunk.
C#✓ Tested
Take a page from a stream
Java: Use skip and limit with a known stable input order.
Java✓ Tested
Take a page from an ordered sequence
C#: Apply a stable order before Skip and Take for predictable paging.
C#✓ Tested
Test whether any or all values match
C#: Any and All short-circuit instead of materializing filtered collections.
C#✓ Tested
Translate ASCII lowercase letters to uppercase
Linux Commands: Use tr under a fixed locale for predictable ASCII character ranges.
Linux Commands✓ Tested
Treat dynamic regex input as literal text
Java: Use Pattern.quote so metacharacters in a search term lose their special meaning.
Java✓ Tested
Update a JSON document with mutable nodes
C#: JsonNode permits targeted changes before serializing a document again.
C#✓ Tested
Validate a complete identifier
Java: String.matches requires the regular expression to match the entire input.
Java✓ Tested
Validate a simple C-style ASCII identifier
C: Check the first character separately from subsequent characters and reject empty input.
C✓ Tested
Write object records to a CSV file
PowerShell: Export-Csv uses property names as headers and quotes values when needed.
PowerShell✓ Tested