New
Recent questions on different topics.
Fast, idiomatic ways to check if a string contains a substring in Bash. Use [[ *substring* ]], case, or =~ for regex. Also covers quoting and portability.
Learn javascript date format for '10-Aug-2010' using manual mapping, Intl.DateTimeFormat, or date-fns. Covers js date to string format functions, js string to date parsing, date string javascript examples, and locale-aware options.
Learn how to add new keys to a Python dictionary using assignment, update(), setdefault(), and merge operators. No dict.add() method—use these efficient idioms for key-value pairs with examples and pitfalls.
Learn to loop through arrays in JavaScript with for loops, for...of (Java enhanced for equivalent), and forEach. Examples, comparisons, sparse arrays handling, and best practices for iteration.
Java compound assignment operators (+=, -=, *=, /=) implicitly cast the promoted result back to the left-hand type, so i += j compiles without an explicit cast.
Learn how to get the full current URL in JavaScript using window.location.href and document.URL. Capture on page load, parse parts like protocol, host, pathname, search, hash with examples and pitfalls.
Pretty-print JSON in shell scripts using jq, Python's json.tool, php or json_pp. One-line examples for bash, curl, NDJSON and safe in-place file updates.
Learn to use git add -p for partial commits in Git. Stage only specific lines like 15 out of 30 changes, verify with git diff --staged, and commit cleanly. Perfect for atomic git commits and better code reviews.
Learn the most efficient way to iterate over Java Map entries using entrySet(), Java 8 forEach, and streams. Avoid keySet() lookups for better performance. Covers HashMap ordering and safe removal.
Learn how to view complete Git file history including content changes using git log -p -- file, git show for specific commits, and git diff tools. See exact diffs, patches, and file snapshots in each commit.
Discover the optimal sock pairing algorithm using in-place sorting like heapsort for O(n log n) time under log-space constraints. Compare with hashing, radix methods, and practical tips for 30 pairs. Relates to element distinctness.
Plain-English guide to Big O notation and algorithm complexity. Learn common time complexities (O(1), O(log n), O(n), O(n^2)) and simple rules of thumb.
Fix MissingArgumentException when sending 'Null' from AS3 to ColdFusion SOAP: use new String('Null'), CDATA, or server-side checks, and test with SOAP traces.
Learn how to resolve merge conflicts in Git step-by-step. Use git status to spot issues, edit files to remove markers, git add resolved files, and commit. Tips for git mergetool, aborting merges, and prevention.
How Docker containers differ from VMs: kernel sharing, namespaces, cgroups, layered images for lightweight isolation, fast startup and consistent deployments.
Easily undo a git rebase with multiple commits using git reflog to find the pre-rebase state and git reset --hard to recover your branch. Skip manual cherry-picking for fast, error-free recovery.
Learn the most efficient way to deep clone objects in JavaScript with structuredClone(). Beats JSON.parse(JSON.stringify()) on speed, handles circular refs. Compare Lodash cloneDeep, performance benchmarks, and best practices for js clone object.
Learn how to get a Unix timestamp in JavaScript using Date.now() for milliseconds or Math.floor(Date.now() / 1000) for seconds. Covers js get timestamp, conversions, Node.js examples, pitfalls, and helper functions for accurate date and time representation.
Understand the difference between px, dp (dip), and sp units in Android UI development. Learn when to use android dp for layouts, android sp for text, and px for pixels, with conversion formulas and best practices.
Reset your local Git branch to exactly match the remote repository using git fetch origin, git reset --hard origin/branch, and git clean -fdx. Discard all local changes safely with step-by-step guide and backups.