My highly sophisticated rule of thumb for eyeballing time complexity is to find the cheapest unit of work and count how many times it runs. I find it a bit more reliable than counting the nested loops . This is easy to see why: left = 0 0...n .each do |right| while bad left += 1 end end Here, right and left only move forward once , so the total amount of movement is 2n , linear time. Similarly, a…
The principal use of bread, unlike some western households, should not be sopping. There are no meat juices, runny eggs or olive oils on my plate that require an eatable towel to clear it. At our house, bread comes out toasty, gets buttered or turned into dahi toasts and bread pohas, and gets consumed while it is still hot. Not until much later in life, sadly, did I realize I was pretty lucky to…
I prefer front-loading hard things when I have a rough plan for when I want them done — especially when I know a bunch of smaller things will follow. But just front-loading isn’t enough. I like to front-load and push hard to get a first cut well ahead of my own rational expectations. It’s not just about horizontal slices, spikes, or underpromising and overdelivering — though it is some of that…
Our lives, ultimately, are meant to serve. Figuring out what that means takes a long time and we’ll get it wrong many times. Maybe we’ll never get it completely right. The very first service, is to yourself. If you are sick, broken, mentally unstable, financially unstable, physically unstable, or stuck in a war or a ditch… you don't get to help anyone. Help yourself first. But do it so you are in…
The Apple pencil's double-tap to erase feature completely breaks my brain and habit from using pencils from years past. The tap is far too sensitive and it keeps switching over to erase-mode as I readjust the pencil in my hand (a very normal thing to do). I've been trying to get used to it for months, but no cigar. I have now turned it off. It's simpler and more reliable to tap on the erase button…
I learnt how to drive a year ago (when I turned 30) and I managed to gather a lot of practice through a car I borrowed for a couple of months. Despite all my mental might, I was unable to suppress walking the skill-spectrum of driving and its perception of adulthood and the associated ego that it carried along. The spectrum goes roughly like this – I can drive now, but I kind of suck and I keep…