Tech Notes
52 articlesA 30 MB text file you cannot open or send: split it by line count
Logs and exports tens of megabytes large will not open or send, so this note splits them by line count, by size and by delimiter. It covers where each cut lands, why UTF-8 Chinese characters only break when splitting by bytes, and how line and byte counts verify nothing was lost.
Filenames without paths: batch-extracting from hundreds of lines
A backup log contains hundreds of full paths, but the report only needs filenames. This note covers mis-slicing caused by Windows backslashes versus Unix slashes, UNC paths, trailing slashes and drive letters, plus how to decide on extensions and deduplication.
Quotes and angle brackets breaking the page: HTML entity encoding traps
Double escapes and literal tag text on a page usually mean one encoding layer too many. This note explains which layer escapes what, when to encode versus decode, and gives a table of common entities and their code points.
HTML squeezed onto one line: when to beautify and when to minify
Inherited HTML that is one long line is unreadable, yet beautifying and minifying are not symmetrical operations. This note covers how indent width affects version diffs, what minification discards, and why whitespace in email templates cannot be changed casually.
Who 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.
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.
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.
Where is this IP? What location and ISP lookups can and cannot tell you
A platform warns that your account signed in hundreds of kilometres away; does that mean it was stolen? This note explains how public IP addresses are allocated, what database resolves location, and the limits: city-level accuracy, CDN and proxy effects, and no way to identify an individual.
Minified JavaScript you cannot read: beautify and format it
Production JavaScript is often minified into a single line, and the stack trace only gives an offset like 1:45210. This note covers what build minification gives up, the cost of four different ways to read it, and a practical debugging order using string anchors, semicolons and missing source maps.