Results for “library”
Small, practical examples. Search by task or narrow things down below.
Copy a stream and count its bytes
Copy a stream and count its bytes using a complete Go program with explicit sample inputs.
Go✓ Tested
Copy entries into another map
Copy entries into another map using a complete Go program with explicit sample inputs.
Go✓ Tested
Copy nested mutable data independently
Python: Use deepcopy when changes to nested lists must not affect the original object.
Python✓ Tested
Copy text into a fixed buffer
Use snprintf and check for truncation when copying a C string.
C✓ Tested
Count days between calendar dates
Python: Subtract date objects to get an exact calendar-day difference.
Python✓ Tested
Count days between two dates
Java: Use ChronoUnit.DAYS for an elapsed count rather than a Period day component.
Java✓ Tested
Count matched elements
jQuery: Learn how to count matched elements in a complete browser example.
jQuery✓ Tested
Count matching values
Count even numbers in a fixed C array.
C✓ Tested
Count newline characters
Count newline bytes in a C file while retaining EOF as an int.
C✓ Tested
Count occurrences in a list
Count how often each value appears using Counter from the standard library.
count✓ Tested
Count repeated words
Count repeated words using a complete Go program with explicit sample inputs.
Go✓ Tested
Count the items in a collection
Python: Read the collection’s length instead of hard-coding the loop limit.
Python✓ Tested