Notes › Tech Notes

Tech Notes

52 articles

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.

What exactly changed between two texts? Line-by-line diffing

Before a sale, twenty minutes of eyeballing a config sync missed worker_connections dropping from 1024 to 64. This note covers when text diffing fits, false differences caused by line endings and indentation, and using line counts to check whether a change got out of hand.

Crontab expressions explained, with predicted run times

Inheriting scheduled jobs left by someone else is risky when a day-of-month and day-of-week restriction is read as and. This note covers the five cron fields and their boundaries, what step values really trigger, silent failures caused by time zones and environment variables, and how to verify run times before shipping.

Batch-extracting phone numbers, emails and ID numbers from text

Picking phone numbers out of 1,800 tickets by hand covered only 400 in two hours, and an 11-digit order number was mistaken for a phone number. This note covers where rule-based extraction produces false positives and misses, why the post-deduplication gap matters, and how much spot-checking and logging is enough.

Was the file tampered with? A one-minute MD5 check

A backup job exited 0, yet two months later the archive reported unexpected end of archive. This note explains what MD5 and SHA-256 can and cannot prove, with hash commands for each platform and how to keep a backup manifest.

Masking phone numbers and ID numbers by hand is too slow

A support log carried four real phone numbers and an ID number, and it was already too late to recall. This note gives a masking rules table for number fields, a three-step process for image redaction and pre-send checks, and several practices that look like redaction but are not.

Why Base64 images can be slower: where Data URI inlining pays off

A listing page took nine seconds because large product images were inlined as Data URIs in the API. This note explains that Base64 is encoding rather than encryption, why it adds a third to the size, and at what scale inlining actually pays off.

Previous 1 2 3 4 Next