Build small. Understand deeply.
Time zones, data and recovery. Practical foundations for the apps we build.
Explore the notes32
What should you prepare first for an AI agent contest with a deadline? Notes from the AI TOP 100 preliminary round
On 31 October I took part in the preliminary round of Kakao's AI TOP 100, where an AI agent is built and submitted within five hours, and I submitted just before the deadline. Leaving the problem itself out, this note covers how I split the work with two AI tools, what went well, the material that came after the last deploy, running short of credit, what testing in the real channel showed, and nine things I will change next time.
I searched for C++. Why did the server receive 'C '?
A search for C++ reached the server as C followed by two spaces. In a query string, + means a space only to functions that read the form format; to percent-encoding functions such as encodeURIComponent and decodeURIComponent it is just a +. Using real runs on Node.js v24.21.0 and Python 3.9.6, this note shows how to pair the function that writes a query with the one that reads it so that + signs and spaces come back intact.
When you run a .ts file directly with node, who checks the types?
Node.js 24 runs a TypeScript file directly with node app.ts, but it only blanks out the types and never checks them. Real runs on Node.js v24.21.0 show code with the wrong types printing 1000100 and exiting with 0, an enum and an interface imported without type failing with a SyntaxError, and a tsconfig.json paths alias being ignored. The note then sets out how to hand type checking to tsc as a separate step.
Same string, yet regex test() says true one time and false the next. Where should you look?
A regex object with the g flag remembers in lastIndex where its last search ended. Real runs on Node.js v24.21.0 show test() alternating between true and false on the same string and filter() dropping rows, then set out how each method treats lastIndex and how to fix it depending on what you want.
I sent Cache-Control: no-cache. Why does the browser still store the response?
no-cache does not prevent storing; it prevents reuse without checking with the server. The same steps, run on Chromium 152, show how no-cache, no-store and max-age differ in a server log and in cache-only reads. The note also covers which to choose and fetch's cache option.
I declared a FOREIGN KEY in SQLite. Why can an order for a missing customer still get in?
SQLite's foreign key check is off by default and must be turned on for each connection. Real runs on sqlite3 3.54.0, Python 3.12.14 and Node.js v24.21.0 compare when an order for a missing customer goes in and when it is refused, then cover the transactions and typos that silently leave the check off, and PRAGMA foreign_key_check for finding rows already in the file.
Do cookies stay separate when two apps run on different localhost ports?
If two apps that use the same cookie name run on localhost:4371 and localhost:4372, logging in to one overwrites the other's cookie and logging out of one ends both. Cookies are stored per host name and ignore the port. Using server logs from two Node.js servers opened in a Chromium 152-based browser, this note shows the behaviour, why SameSite=Strict and __Host- do not split ports either, and how to choose between separate cookie names and separate host names.
I changed the environment variable and restarted. Why does my Next.js page still show the old URL?
You change NEXT_PUBLIC_API_BASE and restart next start, yet the page still calls the old API URL. Building with value A and starting with value B on Next.js 16.4.3 shows that NEXT_PUBLIC_ variables and prerendered pages keep the build value, and only a server variable without NEXT_PUBLIC_ reads the value at request time. With real runs, this note shows how to tell which values are frozen at build and three ways to fix it.
If you change only the case of a file name, which name does git remember?
Rename button.js to Button.js on a Mac, and git status stays quiet with nothing to commit. On case-insensitive APFS, core.ignoreCase makes git keep using the old name written in the index. Using real runs on git 2.54.0, this note shows how to see which name is left and how to get the rename into a commit with git mv. With core.ignorecase set to false, git mv stops, and adding after a plain mv leaves two names in the commit.
I edited the copy, so why did the original object change too?
Changing the address on a copy made with { ...user } changed the original's address as well. Spread and Object.assign create only a new outer object and share the nested objects and arrays with the original. With real runs on Node.js v24.21.0, this note shows how to copy only the path you change, and what structuredClone and a JSON round trip each keep and lose.
I added set -e, so why does my script keep running after a command fails?
set -e does not stop on every failure. Execution continues after a failing command early in a pipeline, a command used as a test in if, && or ||, any function called from there, and a line like local v=$(…) that combines a declaration with a command substitution. Using real runs on macOS's Bash 3.2.57 and the GNU Bash manual, this note finds the cause of each and fixes them with pipefail, || return and a split declaration.
Why does Python's round(2.5) give 2 instead of 3?
Python's round() sends exact halfway values to the even side, so round(2.5) is 2. round(2.675, 2) giving 2.67 has a different cause: the binary float that is actually stored. Using Python 3.12.14 output, this note separates the two causes, shows how to round money with a Decimal built from a string and ROUND_HALF_UP, and compares JavaScript's Math.round().
Every note31
Every title in this box, by year.
202629 notes
- What should you prepare first for an AI agent contest with a deadline? Notes from the AI TOP 100 preliminary roundAI agents / Contest retrospective
- I searched for C++. Why did the server receive 'C '?Web / URL
- When you run a .ts file directly with node, who checks the types?Node.js / TypeScript
- Same string, yet regex test() says true one time and false the next. Where should you look?JavaScript / RegExp
- I sent Cache-Control: no-cache. Why does the browser still store the response?Web / HTTP caching
- I declared a FOREIGN KEY in SQLite. Why can an order for a missing customer still get in?SQLite
- Do cookies stay separate when two apps run on different localhost ports?Web / Cookies
- I changed the environment variable and restarted. Why does my Next.js page still show the old URL?Web / Next.js
- If you change only the case of a file name, which name does git remember?Git / CLI
- I edited the copy, so why did the original object change too?Web / JavaScript
- I added set -e, so why does my script keep running after a command fails?Shell / Bash
- Why does Python's round(2.5) give 2 instead of 3?Python
- Promise.all rejected, so why do the other requests keep running?Web / JavaScript
- Why did the last digit of an order ID from my API change?Web / JavaScript
- Why won't ^0.2.3 in package.json move up to 0.3.0?Tools / npm
- Why does my Python function remember the last call's value?Python
- Why doesn't await inside forEach pause the loop?JavaScript
- Why does sort() put 10 before 9 in a number array?JavaScript
- I added it to .gitignore, so why does Git keep committing it?Git
- Why did a field vanish from the JSON I sent?JavaScript
- Why fetch doesn't reach catch on a 404Web
- Using Meta Muse from Korea, and running Claude Code on its computerAI Agents
- SQLite backups: once the file exists, try restoring itSQLite
- When an app's date slips by a day: separate storage time from display timeJavaScript
- Why a CORS error can mean the server never saw the POSTWeb
- Why the request after a POST redirect is sometimes a GETWeb
- Why Does My AI Keep Going in Circles? Harnesses, Loops, and Graphs ExplainedAI Agents
- Error Messages in Personal Apps: Tell Users What to Do NextApps
- When Vibe Coding Stalls, the Problem Is the Map, Not the ModelAI