FIND YOUR NEXT FEW LINES

Results for “C”

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

3000 snippets foundClear filters
Bash ScriptsParameter expansion

Assign a default to an empty or unset variable

Bash Scripts: The colon-equals expansion both supplies and assigns a fallback value.

Bash Scripts✓ Tested
Arduino / CData & storage

Average a fixed set of readings

Accumulate sample values without overflowing a 16-bit total.

array✓ Tested
PythonFunctions & error handling

Avoid a shared mutable default argument

Python: Create a fresh list inside the function when the optional argument is omitted.

Python✓ Tested
C#Asynchronous work & URI handling

Await multiple tasks while preserving result order

C#: Task.WhenAll returns results in the same order as the supplied tasks.

C#✓ Tested
TypeScriptUtilities & async

Await several independent results

Preserve input order while awaiting multiple promises.

Promise.all✓ Tested
AngularLists & control flow

Bind a narrowed value using an @if alias

Bind a narrowed value using an @if alias with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularTemplates & bindings

Bind a style property

Bind a style property with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
C++Containers & compound values

Build a minimum-priority queue

C++: Supply greater as the comparator because priority_queue defaults to the largest value first.

C++✓ Tested
SQLSubqueries & ranked selection

Build a query from several named stages

SQL: Separate row selection from aggregation using two common table expressions.

SQL✓ Tested
SQL ServerSubqueries & ranked selection

Build a query from several named stages

SQL Server: Separate row selection from aggregation using two common table expressions.

SQL Server✓ Tested
PostgresSubqueries & ranked selection

Build a query from several named stages

Postgres: Separate row selection from aggregation using two common table expressions.

Postgres✓ Tested
SQLiteSubqueries & ranked selection

Build a query from several named stages

SQLite: Separate row selection from aggregation using two common table expressions.

SQLite✓ Tested