Guides
Step-by-step answers to data tasks developers run into every week, with the exact commands for each database and the gotchas that usually cost an afternoon.
- How to format and validate XML: a broken example, fixed
What well-formed XML means, a broken order document with four mistakes, the error each one produces, the fixed version, and how beautify and minify change the file.
- Unix epoch time explained: seconds, milliseconds and a worked example
What a Unix timestamp counts, how to tell 10-digit seconds from 13-digit milliseconds, 1700000000 converted step by step, code for JavaScript, Python and the shell, and the 2038 limit.
- Business income tax in Pakistan 2026-27: slabs and examples
Non-salaried slabs (15% to 45%) for business people, freelancers and AOPs, worked examples, the 10% surcharge above Rs 10 million, a business-vs-salary comparison, and how withholding tax is adjusted.
- BMI chart for adults: WHO vs Asian cut-offs
BMI in kg/cm and lb/inches with examples, WHO categories and the lower Asian action points (23 and 27.5), healthy weight by height on both scales, and the limits of BMI.
- Loan EMI formula: how monthly instalments are calculated
The reducing-balance formula worked through for a Rs 3 million car loan, the interest/principal split, 3 vs 5 vs 7 years, why a flat 8% equals about 14% reducing, and what prepayment saves.
- How to calculate zakat: nisab, 2.5% and a worked example
What counts as zakatable wealth, which debts to deduct, a worked example, gold vs silver nisab with numbers, the lunar year, and Pakistan's bank zakat deduction and CZ-50 declaration.
- 1 marla in square feet: 225, 250 or 272.25?
Why a marla can be 225, 250 or 272.25 sq ft, the karam and sarsahi behind the revenue marla, 1 to 10 marla and kanal in square feet for each size, and how to check which one your plot uses.
- 1 tola in grams: tola, masha and ratti explained
1 tola = 11.6638 g = 12 masha = 96 ratti, derived from 180 troy grains. Conversion tables, grams to tola-masha-ratti step by step, gold value by karat, and per-tola vs per-10-gram rates.
- Hourly to salary: $15 to $50 an hour per year and after tax
The 2,080-hour formula, a table of yearly, monthly and bi-weekly pay with 2026 take-home in Texas, Florida and California, a hand-worked $20 example, and when the formula misleads.
- GPA vs CGPA: how to calculate CGPA on the 4.0 scale
Quality points and credit hours step by step, why CGPA is not the average of your GPAs, the GPA you need for a target CGPA, the common Pakistani 4.0 scale, and the truth about CGPA to percentage.
- HEX vs RGB vs HSL: color codes explained, with conversions
What each color format means, HEX to RGB and RGB to HSL by hand with worked examples, which to use in CSS, and why 89% of colors don't round-trip exactly through whole-number HSL.
- Take-home salary in Pakistan 2026-27: net pay after tax
Net monthly salary after income tax from Rs 50,000 to Rs 1,000,000, a hand-worked example, what a raise or bonus really adds, and the other deductions on a Pakistani payslip.
- How to calculate overtime pay: time and a half, with examples
The FLSA formula step by step, why bonuses raise your overtime rate, two pay rates, salaried non-exempt workers, California daily overtime and double time, and the 2025-2028 overtime tax deduction.
- $3,000 a month after tax: take-home pay by state (2026)
Line-by-line take-home pay on a $3,000 monthly salary in Texas, Florida, California and New York, a table from $2,000 to $10,000 a month, and what filing status, insurance and a 401(k) change.
- UUID v4 vs v7: which to use as a database key
v7 starts with a timestamp, so IDs sort by creation time. 200,000 rows measured on MySQL 8.4 and SQLite: a 40% smaller primary key, 4x faster inserts, and the privacy trade-off.
- MD5 vs SHA-1 vs SHA-256 vs SHA-512: which hash to use
Output length, measured speed, which hashes are broken and why, test vectors to check any tool, and why passwords need Argon2id, scrypt, bcrypt or PBKDF2 instead.
- Salary tax 2026-27 in Pakistan: slabs and worked examples
The 8 salary slabs for tax year 2027 from FBR's rate card, a step-by-step calculation, monthly tax from Rs 50,000 to Rs 1 million a month, and what changed from 2025-26.
- How to minify SQL without changing what it does
When a one-line query is useful, when it isn't, and six cases where joining lines changed the result on MySQL and SQLite (# comments, /*! */, hints, 5--3, backslashes, GO).
- YAML gotchas: why NO becomes false and 0755 becomes 493
The same YAML loaded by js-yaml, PyYAML and ruamel.yaml gave different values for NO, on, 0755, 12:30 and 3.10. What each parser did, the errors, and the fix.
- Generate TypeScript types from JSON, and when to use Zod instead
Turn a JSON response into interfaces, fix the fields one sample can't describe (null, empty arrays, enums, dates), and validate outside data with Zod. Tested with TypeScript 6.
- Regex cheat sheet: syntax plus 30 tested patterns
Regex syntax and flags on one page, 30 copy-ready patterns tested in JavaScript and Python, and the differences (Urdu digits, $, named groups) that break them.
- How to format PL/SQL and T-SQL code without breaking it
What a generic SQL formatter rejects in Oracle and SQL Server code, a PL/SQL range bug (1..3 became 1. .3) found and fixed, and a checklist for procedural code.
- Common JSON syntax errors: what each message means and how to fix it
Trailing commas, quotes, comments, NaN, bad escapes and HTML responses: 14 error messages from Chrome, Node.js and Python, each with the exact fix.
- How to turn a CSV file into CREATE TABLE and INSERT statements
Column types, quoting, batch size and 5 load problems (INT overflow, Z dates, NULLs, cp850 mojibake, rounding), tested on MySQL 8.4.9 and SQLite.
- How to export a MySQL table to CSV: 4 ways, with or without server access
INTO OUTFILE, mysql --batch, mysqldump and Workbench, tested on MySQL 8.4.9: the escaping options that break CSV, and fixes for errors 1290, 1227 and 1086.
- SQL formatting best practices: 12 rules, with real before and after examples
Keyword case, commas, indentation, aliases, JOINs and CTEs: where the Mozilla and sqlstyle.guide standards agree, where they differ, and what a formatter can and can't fix.
- How to convert a SQL dump file to CSV without restoring the database
mysqldump INSERTs, pg_dump COPY blocks and SQLite .dump: what is inside each, four tested ways to get CSV out, and six problems that silently corrupt the result.
- How to import a CSV file into MySQL, PostgreSQL, SQL Server and SQLite
LOAD DATA, \copy, BULK INSERT and .import with the permission gotchas for each, plus what to do when you can't use a bulk loader at all.