Notes › Tech Notes

Tech Notes

118 articles

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.

What is \u4e2d? Converting Chinese text to and from Unicode escapes

A properties file full of \uXXXX escapes makes Chinese searches miss everything. This note separates four layers: code point escapes, HTML entities, URL percent-encoding and actual mojibake, with concrete numbers for Han code points, byte counts and surrogate pairs.

Binary and hex conversions keep going wrong: base 2, 8, 10 and 16

Reading 0x0E12 in a log as decimal sends the whole investigation the wrong way. This note explains that a base is just another way to write the same number, three manual methods (repeated division, positional expansion, grouping by four bits), and three traps: mismatched prefixes, lost precision on large numbers, and signed bit width.

Turning API JSON into a spreadsheet: export to Excel or CSV

Paste API JSON into Excel and it collapses into one column, usually because of structure and field types. This note covers how arrays of objects map to rows and columns, how to split nested and one-to-many data into two tables, and irreversible traps such as order numbers turning into scientific notation and garbled Chinese in CSV.

MD5 is broken: using SHA-256 as a fingerprint for files and data

When a hash does not match, the team may spend hours checking the CDN only to find the download was a 404 page. This note separates integrity checks, tamper detection and password storage, compares MD5 and SHA-256 in length and status, and shows a practical HMAC signing flow.

Regular expressions you cannot read or debug: live match highlighting

A seemingly correct phone-number regex caught just one of 2,000 lines because the m flag was missing in multiline text. This note covers the real boundaries of common symbols, greedy versus lazy matching, and tracking down dead anchors and catastrophic backtracking.

Chinese in URLs turns into %E4%BA%86: URL encoding and decoding

Landing page links open from a chat app with empty parameters, often because spaces were encoded as %20 or +, or an unescaped ampersand cut the query string short. This note covers the byte-level basis of percent-encoding, how three encoding rules differ, and how to recognise double encoding.

Previous 1 2 3 ... 8 9 Next