browse/
75 results
languages/python-default-arguments-why-a-function-remembers-the-last-call.md
Python default arguments: why a function remembers the last call
Call a small Python function twice and the second call remembers the first. The cause is a default value like `basket=[]`, which Python…
ai/temperature-why-a-chatbot-answers-differently-each-time.md
Temperature: why a chatbot answers differently each time
Ask a chatbot the same question twice and the answers can differ. That is not a bug: the model chooses each next word using chance, and a…
security/caesar-cipher-why-25-guesses-break-it-and-what-real-encryption-does-in.md
Caesar cipher: why 25 guesses break it, and what real encryption does instead
The Caesar cipher swaps each letter for one a fixed distance along the alphabet. Slide the key yourself, then play the attacker and break…
software-design/dependency-injection-why-a-test-passes-at-9am-and-fails-at-3pm.md
Dependency injection: why a test passes at 9am and fails at 3pm
A test that passes in the morning and fails in the afternoon, with no change to the code, is a puzzle many beginners meet. The cause is…
computer-science/big-o-how-to-tell-if-your-code-will-survive-1-000-times-more-data.md
Big O: how to tell if your code will survive 1,000 times more data
Your code works on 10 items, then crawls on 10,000. Big O is the short way programmers describe how the number of steps grows as the input…
computers/time-slices-how-one-cpu-core-runs-many-programs-at-once.md
Time slices: how one CPU core runs many programs at once
Your computer runs far more programs than it has processor cores. How? The operating system's scheduler gives each program a short time…
web/http-requests-and-responses-what-a-404-and-a-301-really-say.md
HTTP requests and responses: what a 404 and a 301 really say
Every web page starts as two short pieces of plain text: a request from your browser and a response from a server. Learn to read them and…
ai/overfitting-why-a-perfect-score-on-practice-questions-can-still-fail.md
Overfitting: why a perfect score on practice questions can still fail
A model that scores perfectly on the examples it learned from can still fail badly on new ones. That failure is called overfitting, and you…
security/two-factor-codes-how-your-phone-and-a-website-agree-on-6-digits.md
Two-factor codes: how your phone and a website agree on 6 digits
Your phone shows a 6-digit code that changes every 30 seconds, yet it never talks to the website. How do both sides agree on the number?…
software-design/pure-functions-why-the-same-call-can-give-two-different-answers.md
Pure functions: why the same call can give two different answers
Call a function twice with the same input and get two different answers? Python isn't broken. The function is doing something extra, called…
computer-science/recursion-why-fib-30-makes-2-7-million-calls-and-how-a-notebook-fixes.md
Recursion: why fib(30) makes 2.7 million calls, and how a notebook fixes it
A function that calls itself sounds like an endless loop, but it works when every call gets a smaller problem and one case is simple enough…
databases/database-transactions-why-moving-money-is-all-or-nothing.md
Database transactions: why moving money is all or nothing
Paying someone is really two changes in a database: take money from one account, add it to another. If the power dies between them, money…