FIND YOUR NEXT FEW LINES

Results for “tr”

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

1534 snippets foundClear filters
RustIterators & transformations

Partition values into two collections

Partition values into two collections in a complete Rust program using the standard library.

Rust✓ Tested
CStructures & function interfaces

Pass a function as a callback

C: A typed function pointer permits behavior to be supplied to another function.

C✓ Tested
Bash ScriptsInput streams & redirection

Pass a variable to standard input

Bash Scripts: A here-string supplies the expanded value followed by a newline.

Bash Scripts✓ Tested
C#Types & reliable control flow

Pass behavior as a function delegate

C#: Func describes a callable with typed parameters and a return value.

C#✓ Tested
jQueryEvent control

Pass values through a custom event

jQuery: trigger passes its extra argument array after the event object.

jQuery✓ Tested
C#Types & reliable control flow

Perform cleanup even after an exception

C#: A finally block runs after a handled failure as well as after success.

C#✓ Tested
Docker / ComposeExecution & file transfer

Pipe input into a container process

Docker / Compose: The interactive flag keeps standard input open without allocating a terminal.

Docker / Compose✓ Tested
jQueryEvent control

Prevent navigation from a handled link

jQuery: preventDefault cancels the browser action without cancelling event bubbling.

jQuery✓ Tested
Linux CommandsTransforming text

Print a selected range of lines

Linux Commands: Use sed -n with a line address to suppress other output.

Linux Commands✓ Tested
Linux CommandsTransforming text

Print the final lines of a file

Linux Commands: Use tail -n for a fixed-size suffix of a log.

Linux Commands✓ Tested
C#Collections & data structures

Process a FIFO queue

C#: Queue removes elements in the order they were enqueued.

C#✓ Tested
C#Collections & data structures

Process items by numeric priority

C#: PriorityQueue removes the item with the smallest priority value first.

C#✓ Tested