Essential Database Design: Five Fields Every Table Must Have

Essential Fields Be it relational or not, every table should have these 5 fields: created_at (default now()) updated_at (default now()) deleted_at (default null) created_by (not null) updated_by (not null) Just to be clear, every table should have these 5 fields and not must. Adding these fields have other side-effects such as bloat, performance and disk size. But, if you’re having these problems, i hope you’re profitable. Why should you include this fields ?...

April 17, 2024 · 4 min · Me

Speeding up the GPT - KV cache

The common optimization trick for speeding up transformer inference is KV caching 1 2. This technique is so prominent that huggingface library has use_cache flag is enabled by default 6. A few days ago, I read an awesome blog post on GPT in 60 Lines of NumPy. So, i thought, why not extend it to use the KV cache technique? So, let’s roll up our sleeves and start working on it....

February 12, 2023 · 8 min · Me

LC contest problems summary

Biweekly-66 (27th Nov, 2021) 2085. Count Common Words With One Occurrence Hint 1 Use hashmap (Counter) 2086. Minimum Number of Buckets Required to Collect Rainwater from Houses" Hint 1 First put the bucket at best place and the remove those covering home. Hint 2 Answer is (best bucket cnt + remaining house). Hint 3 Corner case: check for each house is coverable 2087. Minimum Cost Homecoming of a Robot in a Grid Hint djikstra will fail....

November 28, 2021 · Me

Hugo commands

run local server hugo server -D Create New Post hugo new content/posts/{post-name}.md Hugo build/export the site hugo -d ../becoming-the-unbeatable relative imports example: static\icons\favicon.png relative imports: icons\favicon.png fix for label image icon: small_icon.jpg instead of icon: small_icon.png github issue: https://github.com/adityatelange/hugo-PaperMod/issues/622

November 28, 2021 · Me