Notes › Tech Notes

Tech Notes

115 articles

Filling a layout with no content: placeholder text that does not look like a template

When a design draft can only be filled with placeholder text, the question is not what to write but how many lines fit. This note gives a way to estimate volume from paragraph and sentence counts, an algorithm for the line-count difference between Chinese and Latin text, and why high-risk spots such as headings and buttons should not use placeholder copy.

Every combination of two columns: splitting, merging and Cartesian products

Colour times size times material means rows multiply rather than add: 5 colours with 4 sizes gives 20 rows, and adding 3 materials makes 60. This note records the errors in hand-filled tables, how to verify a multi-round Cartesian product, and the off-by-one column trap when splitting text into columns.

Testing upload limits: generating a file of an exact size

You need to test an upload limit but cannot find a file that is exactly 10 MB. This note works through the byte difference between MB and MiB, why all-zero content compresses to tens of KB, sparse file logical size versus actual usage, and how to generate a test file by byte count.

A 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.

Previous 1 2 3 ... 7 8 9 Next