The harbour town had one bakery, one bridge and one clock that was always five minutes slow. Every morning the baker opened the shutters before the first ferry arrived, and the smell of warm bread drifted down the hill to the water. People who lived there said that you could tell the season by the loaves in the window: dark rye in the winter, seeded rolls in the spring, and flat bread with olives when the tourists came. A small team can build a useful product when it keeps the work simple. Start with the problem that a real person has today, write down what they need to finish, and build only the part that gets them there. Then measure what happens. If the numbers are good, add the next feature. If the numbers are bad, find out why before writing more code. Most of the time, the answer is boring: a button was hard to find, a page was slow, or a message did not say what to do next. The library on the hill closes at six in the evening, but the reading room stays open for another hour. Students sit at the long tables with their laptops and their notebooks, and the librarian walks past every ten minutes to turn down the lights near the windows. In the corner there is a shelf of maps, and on the top shelf there is a globe that nobody is allowed to spin. When you read a recipe, check the time before you check the ingredients. A stew that needs three hours is not a dinner for a Tuesday. Chop the onions, the carrots and the celery into pieces of the same size so that they cook at the same speed. Add the salt early, add the herbs late, and taste the pot before you serve it. If the sauce is too thin, let it simmer with the lid off. If it is too thick, add a little water and stir. Computers do not read letters. They read numbers, and a program that works with text must first decide how to turn the text into numbers. The simplest choice is to give every character its own number. That works, but it makes the sequences long, and long sequences cost time and memory. A better choice is to give common groups of characters their own numbers, so that a word like the or and takes one step instead of three. These groups are called tokens, and the list of all of them is called the vocabulary. The tokenizer is a separate program from the model. It is built before the model is trained, from a large pile of text, and then it is frozen. After that, the model only ever sees the numbers that the tokenizer produces. If a word is common in the pile, it gets a token of its own. If a word is rare, it is cut into smaller pieces that the tokenizer already knows. Because the smallest pieces are single bytes, any text at all can be written down, even a word that nobody has used before. The trade is easy to state. A bigger vocabulary means shorter sequences, but every token needs a row in the tables that the model keeps, and rare tokens are seen so seldom that the model learns little about them. A smaller vocabulary means longer sequences, which cost more at every step. Teams pick a size between the two, test it, and keep it for the whole life of the model. Engineers measure a tokenizer with a few simple ratios. How many tokens does a page of English need? How many does a page of code need? How many does a page of numbers need? The answers differ, and they differ for a reason: the tokenizer saw some kinds of text far more often than others, and those kinds got the longest and most useful pieces. Text that looks different from the training pile is cut into more and smaller pieces, and the same idea costs more tokens. Weather in the mountains changes faster than weather on the coast. In the morning the valley is clear, by noon a cloud sits on the ridge, and by evening the wind turns and brings rain from the west. Hikers who start early can finish before the rain, and hikers who start late should carry a coat. The hut at the top has a stove, a kettle and twelve beds, and the keeper writes the temperature on a board by the door. Please read the notes below before you run the script. The first line sets the name of the project. The second line sets the folder where the files will be written. If the folder does not exist, the script creates it. If the folder already has files in it, the script stops and asks you what to do, because it never deletes anything without being told to. Rivers carry stones from the mountains to the sea. A stone that starts the size of a fist is the size of a coin when it reaches the delta, and it is the size of a grain of sand by the time the tide takes it. Nothing is lost along the way. The stone is only cut into smaller and smaller pieces, and each piece goes where the water takes it. Every spring the village holds a market on the square, and every spring it rains for the first hour. The farmers put up their canvas roofs, the children run between the stalls, and the old man who sells honey tells anyone who will listen that the rain is good for the flowers. By noon the sun comes out, the roofs are folded away, and the square fills with people who have walked in from the hills. Good notes are short. Write the date, write what you decided, and write why you decided it. A month later you will not remember the reason, and the reason is the part you will need. If you wrote down only the decision, you will have to guess, and you might guess wrong. If you wrote down the reason, you can check whether it is still true and change the decision when it is not. The train to the coast leaves from the third platform, and it is usually on time. It stops at every small station, so the journey takes almost two hours, but nobody minds because the window seats look out over the fields. A woman with a basket of apples sits across from a student with a thick book, and neither of them says a word until the conductor comes by to check the tickets. Before you change a program, read it. Find the function that does the work, find the tests that cover it, and run the tests to see that they pass. Then make one small change and run the tests again. If a test fails, the change is the first thing to suspect, because the code was working a minute ago. Small steps make mistakes easy to find, and large steps hide them. Our neighbour keeps bees on the roof of the garage. In summer the air above the garden hums, and in winter the hives are wrapped in old blankets and left alone. He sells the honey to the corner shop, and he gives a jar to anyone who helps him carry the boxes in the autumn. Last year he gave away forty jars and kept six for himself. A cache is a place where you keep something you will need again, so that you do not have to go and fetch it a second time. A cook keeps salt next to the stove. A programmer keeps the result of a slow calculation in memory. A library keeps the most popular books near the door. The idea is always the same: pay the cost of the first trip once, and make the later trips cheap. The price of a service usually follows the cost of providing it. A shop pays for its shelves and its staff, so it charges for the goods. A railway pays for its tracks and its engines, so it charges for the distance. A web service pays for its machines and its power, so it charges for the work the machines do. When the work can be counted, the bill can be counted too, and a bill that can be counted can be checked. On the last night of the festival the whole town walks down to the river with paper lanterns. Each lantern has a name written on it, and the names are of people who are far away or no longer here. The lanterns float slowly toward the bridge, and the crowd goes quiet. Then someone starts to sing, and one by one the others join in, until the song fills the valley. If you cannot explain an idea in plain words, you probably do not understand it yet. Try it on a friend who has never heard of the subject. Watch where their face changes, because that is where you skipped a step. Go back, add the step, and try again. After three or four rounds the explanation is shorter than the first draft, and you understand the idea better than you did when you started. Language models read and write tokens. A request to a model is cut into tokens, the model reads all of them, and then it writes its answer one token at a time. Each new token depends on everything that came before it, so the answer cannot be written in parallel. This is why a long answer takes longer than a short one, and why a service that charges by the amount of work charges more for the tokens it writes than for the tokens it reads. The engineer who counts tokens before shipping a product is the engineer who is not surprised by the bill. Count the tokens in the longest prompt, count the tokens in a typical answer, and multiply by the number of requests you expect. Then change one thing at a time. Shorten the instructions, keep the beginning of the prompt the same on every request, and ask for the answer in the form that needs the fewest words. def count_words(text): counts = {} for word in text.split(): word = word.lower().strip(".,;:!?") if word: counts[word] = counts.get(word, 0) + 1 return counts def top_words(text, limit=10): counts = count_words(text) ranked = sorted(counts.items(), key=lambda item: (-item[1], item[0])) return ranked[:limit] class Counter: def __init__(self, start=0): self.value = start def increment(self, amount=1): self.value += amount return self.value def reset(self): self.value = 0 def read_lines(path): with open(path, "r", encoding="utf-8") as handle: for line in handle: line = line.rstrip("\n") if line: yield line def parse_row(line): parts = line.split(",") if len(parts) != 3: raise ValueError("expected three fields, got " + str(len(parts))) name, count, price = parts return {"name": name, "count": int(count), "price": float(price)} def total(rows): result = 0.0 for row in rows: result += row["count"] * row["price"] return result if __name__ == "__main__": rows = [parse_row(line) for line in read_lines("orders.csv")] print("total:", total(rows)) function sumPrices(items) { let total = 0; for (const item of items) { if (typeof item.price === "number") { total += item.price * item.count; } } return total; } const items = [ { name: "tea", price: 3.5, count: 2 }, { name: "bread", price: 2.25, count: 4 }, ]; console.log(sumPrices(items)); async function loadJson(url) { const response = await fetch(url); if (!response.ok) { throw new Error("request failed: " + response.status); } return response.json(); } SELECT name, count(*) AS orders, sum(price) AS revenue FROM orders WHERE created_at >= '2026-01-01' GROUP BY name HAVING count(*) > 10 ORDER BY revenue DESC LIMIT 20; {"name": "tea", "price": 3.5, "tags": ["drink", "hot"], "stock": 120} {"name": "bread", "price": 2.25, "tags": ["food", "fresh"], "stock": 48} {"name": "jam", "price": 4.0, "tags": ["food", "sweet"], "stock": 0} for file in *.txt; do echo "$file: $(wc -l < "$file") lines" done if (value == null) { return defaultValue; } for (int i = 0; i < length; i++) { sum += values[i]; } def moving_average(values, window): if window <= 0: raise ValueError("window must be positive") result = [] for i in range(len(values)): start = max(0, i - window + 1) chunk = values[start:i + 1] result.append(sum(chunk) / len(chunk)) return result def merge_dicts(first, second): merged = dict(first) for key, value in second.items(): if key in merged and isinstance(merged[key], dict) and isinstance(value, dict): merged[key] = merge_dicts(merged[key], value) else: merged[key] = value return merged try: value = int(text) except ValueError: value = None else: print("parsed", value) import json import os from pathlib import Path data = json.loads(Path("config.json").read_text()) print(data["name"], os.getcwd()) Order 1001 shipped on 2026-03-04 with 12 items for a total of 148.50 dollars. Order 1002 shipped on 2026-03-05 with 3 items for a total of 27.90 dollars. Order 1003 shipped on 2026-03-05 with 40 items for a total of 512.00 dollars. Order 1004 shipped on 2026-03-06 with 7 items for a total of 63.25 dollars. id year value share 101 2019 12345.67 0.125 102 2020 23456.78 0.250 103 2021 34567.89 0.375 104 2022 45678.90 0.500 105 2023 56789.01 0.625 106 2024 67890.12 0.750 107 2025 78901.23 0.875 108 2026 89012.34 1.000 3.14159 2.71828 1.41421 1.61803 0.57721 6.02214 1.38065 9.80665 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 20000 50000 100000 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 2026-01-15 2026-02-03 2026-03-21 2026-04-09 2026-05-30 2026-06-18 0x00 0x01 0x0f 0x10 0x7f 0x80 0xff 0x1000 0xffff Total: 1,234,567 units, 98.6 percent complete, 45 minutes left. Temperatures this week: 12, 14, 9, 7, 15, 18, 21 degrees. Distances: 0.5 km, 1.2 km, 3.8 km, 12.4 km, 42.195 km. Version 1.2.3, version 2.0.1, version 10.4.17, build 20260315. Item 7001 costs 19.99, item 7002 costs 24.50, item 7003 costs 5.00, item 7004 costs 105.75. Latency: 12 ms, 15 ms, 11 ms, 230 ms, 14 ms, 13 ms, 12 ms, 16 ms (median 13.5 ms). Counts per day: 120 135 128 142 150 98 77 131 140 146 152 160 101 80. Prices: 0.15 0.30 0.60 1.25 2.50 5.00 10.00 15.00 per million. Phone-free sample ids: A100 B200 C300 D400 E500 F600 G700 H800 J900. 한국의 가을은 맑고 시원합니다. 아침에는 공기가 차갑지만 낮에는 햇살이 따뜻해서 산책하기에 좋습니다. 저는 매일 아침 일곱 시에 일어나서 따뜻한 차를 마시고 신문을 읽습니다. 도서관은 오후 여섯 시에 문을 닫지만 열람실은 한 시간 더 열려 있습니다. 학생들은 긴 책상에 앉아서 공부를 하고 사서는 십 분마다 한 번씩 책상 사이를 걸어 다닙니다. 오늘은 친구와 함께 시장에 가서 신선한 채소와 과일을 샀습니다. 빵집 주인은 매일 아침 첫 배가 도착하기 전에 문을 열고 따뜻한 빵을 구웠습니다. 기차는 오 분 늦게 도착했지만 승객들은 아무도 불평하지 않았습니다. 컴퓨터는 글자를 읽지 못하고 숫자만 읽을 수 있기 때문에 글을 숫자로 바꾸는 방법이 필요합니다. 토큰은 글을 잘게 나눈 조각이고 어휘는 그 조각들의 목록입니다. 자주 쓰는 단어는 하나의 조각으로 처리하고 드문 단어는 여러 개의 작은 조각으로 나눕니다. 이 프로그램은 파일을 읽어서 단어의 수를 세고 가장 많이 나온 단어를 보여 줍니다. 비가 오는 날에는 우산을 가지고 가고 집에 돌아오면 젖은 옷을 말립니다. 저녁에는 가족과 함께 밥을 먹고 오늘 있었던 일에 대해서 이야기를 나눕니다. 내일은 일찍 일어나서 강가를 따라 달리고 돌아와서 아침을 먹을 생각입니다. 겨울이 오면 산 위에는 눈이 쌓이고 마을에는 조용한 아침이 찾아옵니다. 시장에서 산 사과는 달고 아삭아삭해서 아이들이 아주 좋아했습니다. 선생님은 칠판에 오늘 배울 내용을 쓰고 학생들에게 차례대로 질문을 했습니다. 버스를 타고 한 시간쯤 가면 바다가 보이는 작은 마을에 도착합니다. 좋은 프로그램은 짧고 읽기 쉬우며 실수가 생기면 금방 찾을 수 있어야 합니다. 모델은 글을 한 번에 읽지만 답은 한 조각씩 차례로 씁니다.