FIND YOUR NEXT FEW LINES

Results for “mem”

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

68 snippets foundClear filters
JavaQueues & collection operations

Find shared set members

Java: Copy a set before retainAll when the original must remain unchanged.

Java✓ Tested
C++Ordering & set operations

Find sorted set members missing from another set

C++: set_difference writes elements present in the first sorted input but absent from the second.

C++✓ Tested
C++Ordering & set operations

Find the common members of two sorted sets

C++: set_intersection requires both input ranges to be sorted under the same comparator.

C++✓ Tested
Arduino / CText & bounded buffers

Keep a serial message in flash memory

Arduino / C: The F macro keeps a literal out of scarce SRAM.

Arduino / C✓ Tested
Arduino / CGetting Started

Keep fixed text in flash memory

Arduino / C: Keep fixed text in flash memory on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
ReactPerformance & rendering

Memoize a component with stable props

Memoize a component with stable props with a small React component and explicit browser behavior.

React✓ Tested
ReactPerformance & rendering

Memoize a derived collection

Memoize a derived collection with a small React component and explicit browser behavior.

React✓ Tested
ReactPerformance & rendering

Memoize a sorted copy of state

Memoize a sorted copy of state with a small React component and explicit browser behavior.

React✓ Tested
ReactPerformance & rendering

Memoize an object passed to a provider

Memoize an object passed to a provider with a small React component and explicit browser behavior.

React✓ Tested
PythonStructured data & serialization

Parse quoted CSV from an in-memory string

Python: Use StringIO with csv.reader so quoted commas are handled correctly.

Python✓ Tested
JavaText validation & formatting

Process the lines of an in-memory string

Java: Use String.lines to handle common line terminators without retaining them.

Java✓ Tested
RustTesting & reusable patterns

Read bytes through an in-memory cursor

Read bytes through an in-memory cursor in a complete Rust program using the standard library.

Rust✓ Tested