📝 Notes
93 articlesWho appears in only one of two lists? Intersection, difference and union
Two lists never quite match. This note explains what intersection, difference and union each answer, why A minus B differs from B minus A, how to rule out false differences from trailing spaces, case and invisible characters, and gives a set of counts you can check against.
Adding a prefix and numbering to a hundred lines by hand
A hundred-plus line list needs quotes and commas on every line, or sequential numbers, and manual edits miss the most. This note covers prefix and suffix patterns, start values and steps, character deletion and slicing by position, and when to switch to find-and-replace or spreadsheet formulas.
Copied text full of blank lines and stray spaces: the right cleanup order
Text copied from PDFs, web pages and Excel carries full-width spaces, tabs, blank lines and BOMs; running the cleanup steps in the wrong order makes it worse. This note sorts six whitespace characters by origin and explains why sequence determines the final result.
Making a perler bead pattern: turning a photo into a colour chart and grid
Turning a photo into perler beads raises three questions: how many cells, which colour codes, and how many beads of each colour. This note covers the relationship between grid size and finished dimensions, the colour shift that quantisation inevitably brings, and why colour counts matter for buying supplies.
PNG to SVG still blurs when enlarged: what vectorisation can and cannot do
Converting a logo from PNG to SVG seemed to promise unlimited scaling, but the edges still showed jaggies. This note explains the difference between wrapping and tracing, how raster and vector images record information, and how threshold, colour levels and node count limit what vectorisation can achieve.
Long JSON where you cannot find a field: tree view, folding and search
Scrolling through tens of thousands of characters of nested API JSON in an editor is painfully slow. This note separates formatting from locating structure: nesting levels, array indexes and path notation, plus what folding, keyword search and copying a node path each solve.
Copied web text arrives full of tags: stripping HTML down to plain text
Copying text from a web page or CMS into a document often brings a pile of tags and whitespace that will not delete. This note explains the difference between clipboard, source and rendered forms, when to keep structure versus flatten to plain text, and a working order for cleanup.
Chinese kinship terms: naming the son of the paternal aunt
Forgetting how to address a relative at New Year usually means the relationship chain was not unpacked: the older male cousin of my mother is a biaoju, not a biaoshu. This note gives a rule for tang versus biao (the son of the paternal aunt is a biaoge), explains that it only covers same-generation blood relatives, why titles are not symmetric, regional variation and when the terms apply.
How many calories do you burn a day? Calculating BMR
Six weeks of fat loss with no movement on the scale usually is not a willpower problem but an unclear basal metabolic rate. This note covers the relationship between BMR and TDEE, a step-by-step comparison of two common formulas, why activity multipliers get overestimated, and how much to eat once the number is known.
Mixed casing styles: batch-converting camelCase, snake_case and more
A database column named created_time, an API field CreateTime and a frontend createTime: three spellings of one field will cause trouble eventually. This note covers where each naming style fits, platform differences from case sensitivity, and how to batch-convert and verify the result.
Adding pinyin to Chinese text: conversion with tone marks
Adding pinyin to a classical poem for a child, the hard part is pronunciation, not layout: the character for plant in one line reads zhòng, not zhǒng. This note covers where the tone mark goes, when ü drops its dots, tone sandhi versus original tones, and how to check characters with four readings, surnames, place names and the GB/T 28039 romanisation convention.
Counting words and characters for papers and copy: characters, lines, paragraphs
Word count in submission guidelines means at least four things: Chinese characters, words, characters including spaces, and characters excluding spaces. This note compares all four on the same sentence, shows which count spaces actually inflate, why soft returns and combining marks make numbers disagree, and gives pre-submission checks.