JSON Merge Patch Application (RFC 7386)
Apply RFC 7386 merge patches without mutating the target, treating null as deletion, replacing arrays and rejecting unsafe object keys.
Page 46 of 50
Apply RFC 7386 merge patches without mutating the target, treating null as deletion, replacing arrays and rejecting unsafe object keys.
Resolve, assign and delete values with RFC 6901 JSON Pointers, including escape handling, array indexes and prototype pollution guards.
Apply Gregorian leap-year rules and return the exact number of days in any month, including February in leap and common years.
Compute edit distance over Unicode code points and reconstruct insert, delete and substitute steps from the dynamic-programming matrix.
Compare two multi-line strings with a longest-common-subsequence diff and return ordered equal, delete, and insert operations.
Validate payment card numbers with the Luhn algorithm, tolerate spaces and hyphens, and compute the missing check digit.
Rotate a square matrix clockwise or counter-clockwise in place using a transpose and row reversal, with square-shape validation.
Cache expensive function results by a custom key with per-entry TTL, bounded size, eviction, hit statistics, and manual invalidation.
Validate, sort and merge closed numeric intervals, combining overlapping and exactly touching ranges without mutating the input array.
Implement a dependency-free binary min-heap with a custom comparator for O(log n) priority queue pushes and pops.
Compute ISO 7064 mod-97 check digits and validate long number strings without exceeding JavaScript safe integer precision.
Build a flat seven-column calendar grid for any month, honoring a configurable first weekday and blank padding cells.
Sort file names and labels naturally so item2 comes before item10, using Intl.Collator with a deterministic tie-break.
Build inclusive numeric ranges with positive or negative steps, validate inputs and stream large ranges lazily through a generator.
Read and copy-on-write nested values with dot and bracket paths while blocking proto, constructor and prototype segments.
Wrap sync and async functions so initialization runs at most once, sharing the cached result or in-flight promise.
Turn integers into 1st, 2nd, 3rd and 11th using Intl.PluralRules ordinal categories with a safe fallback.
Estimate password entropy from character pools, unique characters and common patterns to produce a five-level score.
Calculate relative change between two numbers and format the result with fixed decimals, an explicit plus sign and locale-free output.
Build small reusable data pipelines with pipe in left-to-right order and compose in reverse, including argument validation.
Choose singular or plural forms by CLDR plural category, including custom two and few forms for non-English locales.
Run many async tasks with a fixed concurrency limit while keeping results in input order and rejecting invalid pool sizes.
Sort arrays in place with a three-way partition that groups equal keys, avoiding quadratic behavior when many duplicate values are present.
Find the k-th smallest value in average linear time with randomized quickselect, zero-based ranks and a non-mutating input copy.
Parse a raw HTTP header block with obsolete line folding, duplicate fields, Set-Cookie arrays, case-insensitive names and size limits.
Escape every regular-expression metacharacter so user input can be matched literally, with a helper that rejects stateful flags.
Format timestamps as localized labels such as yesterday or in 2 hours, reusing cached Intl.RelativeTimeFormat instances.
Uniformly sample a fixed number of items from arrays or one-pass iterables using reservoir sampling with an injectable random source.
Parse Retry-After delay-seconds or HTTP-date values into milliseconds, clamp them to a maximum and correct for server clock skew.
Convert integers from 1 to 3999 into Roman numerals and parse valid numerals back to numbers with subtraction and validation.
Encode repeated characters into compact count-letter runs and decode them back with strict validation of malformed input.
Compute the maximum of every fixed-size window in O(n) using a monotonic deque, with clear handling of invalid sizes.
Normalize accented text into clean URL slugs with NFKD decomposition, diacritic stripping, length limits and a safe fallback value.
A tiny dependency-free spy that records calls, supports return stubs and resolved values, and resets between tests.
Sort records by several key selectors and directions with a guaranteed original-index tiebreak, so equal rows never swap positions.
Track the minimum of a numeric stack in constant time using a parallel minimum stack, without scanning elements.
Read an async iterable stream into a string while enforcing a hard byte ceiling and destroying the source as soon as it overflows.
Render double-brace placeholders from a plain object, raising clear errors for missing keys instead of silently printing undefined.
Implement takeWhile and dropWhile helpers that stop testing after the first failure and never mutate the source array.
Create readable fixtures with layered overrides, per-item variation and reset support, keeping tests free of duplicated object literals.
Limit function execution frequency with configurable leading and trailing edges, plus cancel and flush controls for cleanup.
Store weighted words in a case-insensitive trie and return autocomplete suggestions ranked by weight and prefix match.
Shorten UI text by grapheme clusters so emoji and combining marks stay intact, with an ellipsis budget included.
Find two array indices whose values sum to a target in one pass using a hash map, with validation for non-numeric input.
Remove duplicate objects from an array using a key function or property name, preserving original order and first occurrences.
Normalize HTTP URLs by removing default ports and fragments, sorting query pairs and dropping tracking parameters for stable cache keys.
Generate time-ordered UUIDv7 identifiers with a 48-bit millisecond prefix and a 12-bit counter that keeps values increasing.
Compute a weighted mean from value and weight arrays, rejecting length mismatches, non-finite numbers and invalid total weight.
Trim, collapse and optionally preserve line breaks while removing zero-width characters that break search and comparison.
Compute fixed monthly payments and a full amortization table with Decimal rounding, then total the interest paid.
Fan out jobs to a bounded asyncio queue, run a fixed worker pool, and shut down cleanly with sentinel values and task_done.
Relax all edges to compute shortest paths from one source, rebuild the route, and report a reachable negative cycle.
Find lower and upper insertion bounds in sorted sequences with optional key functions, plus exact search and duplicate counting.
Size a Bloom filter from an expected item count and false-positive rate, then add and test members using double hashing.
Estimate a confidence interval for any statistic by resampling with replacement, using a seeded random generator for repeatable runs.
Find a strict majority in one pass with constant memory, verify the candidate, and collect every value above one third.
Distribute keys across nodes with a SHA-256 consistent hash ring, virtual replicas, node add and remove, and minimal key movement.
Extract a safe basename from Content-Disposition headers, honoring RFC 5987 encoding and rejecting traversal segments.
Generate repeatable fake users from a seeded random source, with per-call overrides and stable identifiers for snapshots.
Track a smoothed moving average with a period-derived smoothing factor, plus a windowed simple average for comparison.
Compute file checksums in fixed-size chunks, support alternate hashlib algorithms, and verify expected digests in constant time.
Convert seconds into compact day, hour, minute, and second strings and parse those strings back with strict validation.
Abstract time behind a Clock protocol, provide a fake clock that can advance instantly, and drive a TTL cache without sleeping.
Normalize half-open intervals, merge overlaps or adjacent ranges, and reject invalid bounds with clear validation errors.
Apply RFC 6902 add, remove, replace, move, copy, and test operations through JSON Pointers while leaving the input document unchanged.
Compute edit distance in O(n*m) time and O(min(n,m)) space, calculate similarity, and suggest the closest matching candidate.
Memoize async loader results with a per-key TTL and lock so concurrent misses trigger one upstream call instead of a herd.
Cancel running asyncio workers, catch CancelledError for cleanup, and report how many items were processed before shutdown.
Limit concurrent asyncio tasks with a semaphore, keep input order in the results, and report per-task failures without cancelling the batch.
Run coroutines in an asyncio.TaskGroup so the first failure cancels siblings, then inspect the raised ExceptionGroup.
Encode integers with Crockford Base32 and decode human-typed values that contain hyphens or confusable letters like O and I.
Encode payloads as Base58 with a double SHA-256 checksum, preserve leading zero bytes, and reject corrupted input on decode.
Group any iterable into fixed-size lists lazily, preserve the final partial batch, and stop cleanly when the source is exhausted.
Wrap state changes in a context manager that commits on success, restores a snapshot on any exception, and re-raises the error.
Parse five-field cron expressions and compute the next run times, including weekday and month boundaries.
Detect a CSV delimiter and quote style from a sample, then parse rows into dictionaries without hard-coding comma assumptions.
Stream CSV rows with the csv module, validate required headers, convert typed fields, and route rejected rows to a separate file.
Enforce types and ranges on dataclass fields at construction time, normalize values, and raise one error listing every invalid field.
Split a Decimal amount across integer weights while keeping cent-level totals exact, distributing leftover cents deterministically.
Merge nested configuration mappings layer by layer, replacing scalars and lists while keeping the default tree untouched.
Race several async replicas, return the first successful result, cancel the losing tasks, and report a clear failure.
Compute shortest distances between every pair of nodes and reconstruct routes with a next-hop matrix in O(n^3) time.
Select the k largest or smallest scores with heapq, keep memory bounded at k entries, and sort ties by name for stable output.
Validate webhook payload signatures with HMAC-SHA256, constant-time comparison, and a timestamp window that blocks replay attacks.
Flag usernames that mix Latin with Cyrillic or Greek letters used as lookalikes, and explain each suspicious character.
Resume an interrupted HTTP download with a Range request, appending only missing bytes and restarting when the server ignores it.
Normalize and validate IBAN values with length, character, and mod-97 checksum rules before persisting account data.
Normalize hyphens and spaces, then verify ISBN-10 and ISBN-13 check digits with the official weighted modulo rules.
Convert nested JSON objects to dotted key paths and reconstruct them, rejecting conflicting paths instead of silently overwriting.
Iterate JSON Lines files lazily, skip blank lines, report malformed records with line numbers, and cap record size to avoid memory spikes.
Reduce floating-point drift with Kahan and Neumaier compensated summation, and see where plain left-to-right addition loses a value.
Fit a straight line through paired x and y values using least squares, then compute the coefficient of determination and predict new points.
Parse RFC 8288 Link headers into named relations while respecting commas inside quoted titles and target URLs.
Configure Python logging with a rotating file handler that caps file size, keeps numbered backups, and flushes each record.
Build a thread-safe LRU cache on OrderedDict with capacity eviction, hit and miss counters, and a memoize decorator for pure functions.
Run operator-supplied regular expressions with the regex module timeout, an input length cap, and explicit failure handling.
Resolve user-supplied relative paths under a fixed root, reject absolute or traversal inputs, and verify the final path stays inside.
Extract gzipped tar archives after rejecting absolute paths, parent traversal, and link members that escape the destination.
Parse and compare semantic version strings with prerelease precedence, then sort a mixed release list correctly.
Apply a batch of stock updates inside one SQLite transaction with validation, ON CONFLICT upserts, and rollback on any bad row.