FIND YOUR NEXT FEW LINES

Results for “TOP”

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

60 snippets foundClear filters
SQLSubqueries & ranked selection

Include every row tied for the highest score

SQL: Compare with MAX rather than limiting to an arbitrary number of rows.

SQL✓ Tested
SQL ServerSubqueries & ranked selection

Include every row tied for the highest score

SQL Server: Compare with MAX rather than limiting to an arbitrary number of rows.

SQL Server✓ Tested
PostgresSubqueries & ranked selection

Include every row tied for the highest score

Postgres: Compare with MAX rather than limiting to an arbitrary number of rows.

Postgres✓ Tested
SQLiteSubqueries & ranked selection

Include every row tied for the highest score

SQLite: Compare with MAX rather than limiting to an arbitrary number of rows.

SQLite✓ Tested
PythonNumbers & calculations

Select the largest values without sorting everything

Python: Use heapq.nlargest when only a small prefix of the ranking is required.

Python✓ Tested
C++Ordering & set operations

Sort only the smallest requested prefix

C++: partial_sort orders the selected prefix without guaranteeing the order of the remainder.

C++✓ Tested
Arduino / CTiming & control

Blink without blocking the loop

Use elapsed millis time instead of delay for a repeating action.

millis✓ Tested
JavaScriptArray traversal & selection

Check whether any item matches

JavaScript: some stops once a predicate succeeds.

JavaScript✓ Tested
TypeScriptArray traversal & selection

Check whether any item matches

TypeScript: some stops once a predicate succeeds.

TypeScript✓ Tested
JavaScriptArray traversal & selection

Check whether every item matches

JavaScript: every stops at the first failed predicate and returns true for an empty array.

JavaScript✓ Tested
TypeScriptArray traversal & selection

Check whether every item matches

TypeScript: every stops at the first failed predicate and returns true for an empty array.

TypeScript✓ Tested
CStrings & byte buffers

Compare binary buffers including zero bytes

C: memcmp checks an explicit byte length rather than stopping at a string terminator.

C✓ Tested