I am an ardent vim
user. A forked version of vim called neovim
recently caught my attention. It has more features like support for language server protocol
that provides auto-complete
, etc. LunarVim
provides neovim configuration files so that it behaves as an IDE...
Continue reading → Tags : vim neovim lunarvim
Windows Subsystem for Linux (WSL2) provides native Linux environment for Windows. It’s great alternative to cygwin
which can’t run native Linux apps. However WSL2 doesn’t have out-of-box connectivity with internet once you connect with vpn
...
Continue reading → Tags : vpn wsl windows
I grew up in India with a diet of basmati rice and superstition. I have seen pedestrians freezing at the sight of a black cat crossing their path for fear of bad luck. Lemon and chilis hang in front of vehicles to ward off bad spirits. I fondly remember numerous advertisements proclaiming protection from evil eyes. Recently I stumbled upon an ad that refreshed my memories...
Continue reading → Tags : superstition rationalism python
After the outbreak of Covid-19 pandemic and Fall of Kabul, year 2022 was supposed to instill normalcy back into the world. However world looks more topsy-turvy than before with the advent of war between Ukraine and Russia...
Continue reading → Tags : ukraine afghanistan russia war
When you develop AWS lambda functions, you might feel the need to install additional python
libraries. This can be achieved using Lambda layers that can be included in any lambda function...
Continue reading → Tags : docker aws python
Lots of website have added dark themes
to their platform. Twitter also has a dark mode which I really love while reading at night. Also there are benefits of using dark mode for the eyes...
Continue reading → Tags : jekyll
You are given a 0-indexed binary array nums
of length n
. nums
can be divided at index i
(where 0 <= i <= n
) into two arrays (possibly empty) numsleft and numsright..
Continue reading → Tags : leetcode hashmap array java python
Badminton sport has a low learning curve unlike tennis. Even your granny can hit a birdie. I grew up playing badminton but decided to try my luck with tennis. “Playing tennis would be a cakewalk”, I thought. However my hubris was soon deflated...
Continue reading → Tags : tennis recreation badminton sports
In this leetcode problem, we are asked to find the length of the longest string of characters in a provided string that does not contain repeating characters. In other words, in the string abcabcbb
the longest substring without repeating characters is abc
(with a length of 3)...
Continue reading → Tags : leetcode two pointers set
One of the nifty feature in any code development is the ability to debug your application using break points. Submitting a Spark job while waiting for it to complete will waste a lot of time debugging. Spark jobs can be debugging with break points
and step over
and step into
and step out
commands...
Continue reading → Tags : spark pyspark docker vscode
“Marriages are made in heaven” is an old adage quite prevalent across all cultures. Whether heaven harbors any interest in the mortal affair has still scant empirical evidence. However, there is a rare marriage that not only invites heaven’s fury but also is consummated by mutual suicide...
Continue reading → Tags : science annihilation matter antimatter audio
There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take course bi first if you want to take course ai...
Continue reading → Tags : leetcode graph bfs java python
You are given a string s and an integer k, a k duplicate removal consists of choosing k adjacent and equal letters from s and removing them, causing the left and the right side of the deleted substring to concatenate together...
Continue reading → Tags : leetcode stack python java scala javascript
Today I walked a little further,
further than yesterday.
while my feet ache and plead,
I dragged ‘em without paying any heed...
Continue reading → Tags : poetry friends audio
Questions involving the binary tree data structure are very popular in tech interviews, and can be challenging and varied! A binary tree is a data structure consisting of a collection of nodes (starting at a root node), where each node consists of a value (data), together with a directed edges to at most two nodes (the “left child” and “right child”), with the additional conditions that no two edges point to the same node and no edge points to the root. I recently solved an interesting problem on binary tree...
Continue reading → Tags : leetcode java python javascript scala
Ternary string is an interesting problem that could be solved using two pointers techniques. It’s a convenient way to keep track of multiple indices. This helps in making decisions based on two values...
Continue reading → Tags : codeforces two pointers java python
It’s one of the most popular questions on leetcode that seems very easy at first. Coin change is a classic dynamic programming problem. I will proceed with an obvious (albeit wrong) solution and subsequently proceed to an efficient correct solution...
Continue reading → Tags : leetcode dp java python
I was an intern working in Upstate New York. Public transport required hopping multiple trains & buses and was woefully tedious. I found some other interns who were willing to split the fare with me for Uber. Even a ride in Uber consumed more than two hours. Occasionally I used to steal a quick nap. After a siesta of a few hours, I had always woken up with a gaggle of laughter. My peers often pulled my leg, “You were snoring like a pig”. However, I dismissed my faux pas as just a mere nuisance...
Continue reading → Tags : snoring sleep apnea diary lettetrs audio
When the alarm clock breaks my slumber, I roll down on my bed, blindly crawling towards my alarm clock as if it was a bomb to diffuse it. After multiple snoozes, I relinquished my dreams and come to my senses. Gulping water after I wake up is my first activity. Next, I excuse myself to the bathroom for “nature call”. All living things from a simple bacteria to a giant dinosaur needs to perform two basic life function; eat and excrete...
Continue reading → Tags : virus diary letters audio
There’s an interesting problem I recently solved on leetcode based on dynamic programming. My Github repository contains list of all problems that I have solved. I often start with a brute force approach without fretting about time complexity. Later I try to improve my algorithm for a better efficient solution...
Continue reading → Tags : leetcode dp java python
This is my first time visiting Mexico city, also known as CDMX. Initially I was scared to come here because of Narcos. However during my brief two weeks stay I have felt safe. With my limited Spanish, I decided to book an Airbnb experience for a bike tour...
Continue reading → Tags : cdmx mexico travel bike
Do you believe in ghosts? I did when I was a kid. I was infatuated with the paranormal. Sometimes I used to wander around desolate buildings with other kids concocting horror stories. I loquaciously gossiped about ghosts in school which earned me a sizeable audience. I was convinced that someday I would stumble upon an innocuous spirit that would instill some unearthly powers in me...
Continue reading → Tags : diary letters infrasound
AWS CDK is a great framework to programmatically deploy cloudformation stack. If you are unfamiliar with AWS CDK, I would recommend first to check out Getting started with AWS CDK...
Continue reading → Tags : aws cdk cloudformation typescript tutorial
Cloudformation service in AWS allows you to describe an entire set of resources required to make a pipeline. The cloudformation template can be described in JSON or YAML format. Updating the cloudformation template was not a pleasant experience. I wanted to discover alternative ways to generate cloudformation template programmatically...
Continue reading → Tags : aws cdk cloudformation typescript python
What’s a nationality? The idea of the nation-state is pretty modern. Ancient lands were usually under the suzerainty of kings & queens. While most emperors spilled blood to expand their kingdom, the common man was seldom concerned about borders...
Continue reading → Tags : diary letters
If you are not living under a cave, you probably have already heard about carcinogens. News is often awash with headlines alerting perils of carcinogens. In a nutshell, these are substances that have the potential to cause cancer. Not all carcinogens cause cancer. Not all cancer is caused by carcinogens. Cancer is a complicated group of diseases. Of course, it’s not my forte to expound on the subject of cancer. However, we should try to understand how carcinogens are identified and what we should do to protect ourselves...
Continue reading → Tags : diary letters carcinogen meditation
Today I tried to meditate again. I used Insight Timer app for background sound. However I think I’ll just stick to Youtube as it has more varieties. I struggled for 20 minutes sitting cross-legged as my mind wandered in the labyrinth of thoughts. I guess it will take more practice to hone my skill. Have you ever wondered how monks can meditate for countless hours or days?..
Continue reading → Tags : diary letters
Did you remember we watched The Time Machine movie together? The protagonist loses his fiancée when a mugger kills her. He then builds a time machine to travel back in time to save her. Of course multiple movies have been made romanticizing the concept of time machine...
Continue reading → Tags : time diary letters
Today the sleep was better. Yesterday I was sleep deprived. Hunger is the best ingredient to make any food delicious. Likewise a sound sleep is like a manna from heaven
for me...
Continue reading → Tags : diary letters
I didn’t have proper sleep today. I could barely keep my eyes open. Empty stomach and a heavy mind is a disaster for sound sleep. Yesterday I was brooding too much while trying to sleep. I guess I need to filter noises in my mind. Proper sleep is the basic physiological need in Maslow’s pyramid. I guess it’s a blessed day not to have a insomnia...
Continue reading → Tags : diary letters
Recently I finished watching web-series Scam 1992. It’s based on story of Harshad Mehta, a famous Indian stockbrocker who made fortunes in stocks. Despite his iconic success & failure, the series rekindled my interest in world of “stocks”. I guess the famous dialogue “Risk Hai Toh Ishq Hai” has stuck with me...
Continue reading → Tags : stocks python finance money google selenium
I am currently reading The Emperor of Maladies. This is a fascination book where Siddhartha Mukherjee not only educate its readers about cancer disease but also shares interesting tidbits. Werner Bezwoda was an infamous oncologist who fudged data about bone marrow transplant in women with metastatic breast cancer...
Continue reading → Tags : pseudoscience cancer breast cancer bone marrow
Poetry is a great dependency management tool in python. It’s better than managing a flat file like requirements.txt
. There are also other great tools like pipenv. However I found poetry much simpler in resolving dependencies...
Continue reading → Tags : windows python poetry bug
Dynamodb is a great NoSQL service by AWS. One of the most common use case is to export data to s3. There are multiple ways to export data to s3. For this tutorial we will leverage lambda function to achieve our goal...
Continue reading → Tags : aws lambda function dynamodb s3
I recently came across a Youtube video of a famous Indian actress Genelia Deshmukh promoting homeopathic products. The Bollywood couple, Riteish and Genelia Deshmukh, has invested in Welcome Cure, a Homeopathy treatment service platform. Science has repeatedly dismissed homeopathy as quakery or at best placebo, but that has not deter companies or Indian government to continue to fund and research in homeopathy...
Continue reading → Tags : pseudoscience homeopathy ayurveda india audio
This is my Part 1 of the review of Carl Sagan's book, Demon-Haunted World. This is more of my commentary rather than a review of the book.
I have begun to realize how many posts on Facebook, Whatsapp, etc contains pseudoscience and misinformation. Few posts are easy to debunk. Magic water curing cancer is a no-brainer. However other posts are too meticulous to debunk. I thought it might be fruitful for me as a layman to learn critical & skeptical thinking from a famous astrophysicist, Carl Sagan...
Continue reading → Tags : pseudoscience books review religion audio
I was looking to write a scala script to fetch large data from Oracle database. I was earlier using the Alteryx software to fetch data (around 1 million rows) from oracle which took around 7 minutes. Licensed softwares like Alteryx or Informatica, etc are great, but I was looking for a free solution...
Continue reading → Tags : jdbc scala oracle database
It feels great to sleep at night. I have a small but a cozy room. It’s not lavish or splending. It doesn’t even hoard much furniture. However it’s as peaceful as it can get...
Continue reading → Tags : sleep rambling human rights
Jobs failed! Screamed an automatic failure alert in email inbox. Existing python scripts were failing in the server which fetched data from Oracle database. I wondered if the credentials had changed...
Continue reading → Tags : kerberos projects python docker oracle database
India is currently witnessing multiple protests against the Citizenship Amendment Act (CAA) passed by the BJP (the ruling party of India). In a nutshell it fast tracks citizenship to few religiously persecuted refugees like Hindu, Sikh, Jain, Buddhist, Christian and Parsi from neighbouring countries...
Continue reading → Tags : faiz india urdu bjp nationalism caa nrc npr
Graph are data structures made of vertices & edges. There are lots of interesting problems that can be solved using graphs. Part 1 covers the basic for creating a template for graph data structure...
Continue reading → Tags : graph java implementation
I recently came across a simple telephonic interview problem. The problem was to sort an array recursively. But even numbers need to be placed before odd numbers. At first glance it was obvious that it was a simple case of implementation of merge sort...
Continue reading → Tags : programming interview merge sort sort java code
When I was a kid, I was perturbed at the outbreaks of new diseases. There was no Swine Flue before twenty first century or HIV before tenth century. Why nature was hell-bent in pulling diseases out of a hat everytime humans make progress in science?..
Continue reading → Tags : biology evolution antibiotics
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists...
Continue reading → Tags : programming leetcode code
I wanted to decode an old debate that I saw on ndtv. It was about a controversy erupted by the comments of a junior Indian education minister, Satyapal Singh. He is India’s Minister of State for Human Resource Development. He had claimed that evolution is “scientifically wrong” because he never saw an ape turning into human being...
Continue reading → Tags : pseudoscience evolution india ndtv news debate
Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero...
Continue reading → Tags : leetcode two pointers java
I might slip into a cesspool of hate in criticizing India’s most successful movie, Baahubali 2: The Conclusion. One of my Telugu colleague eyes beamed with pride when she told me how she watched first day first show & how this movie has propelled Telugu movies in the same league of Hollywood...
Continue reading → Tags : baahubali movies
Recently, my roommate, had his job contract terminated. He found a new job in another city which meant I had to hunt for a new roommate. So I quickly posted an ad on Sulekha, a popular website in USA among Indians...
Continue reading → Tags : rent scam
The sun’s rays had already crept through my window & drenched my room with light. Sleep taste sweetest when you resist it. It is but with a heavy heart that I relinquish my sleep & pull myself together...
Continue reading → Tags : meditation rambling
On a brisk day, I was carpooling with my manager. Amidst the roaring traffic, was the familiar melodious voice on the radio. We have grown accustomed to the RJ who played songs that was music to our ears. As my manager revved up the engine, with the occasional drip in audio of the AM, often we broke into conversation...
Continue reading → Tags : india pakistan cow vigilantism
It was just another day in Bangalore. I caught the bus from the /Kormangala bus depot. Amid exhausting heat & nudging elbows, I somehow managed to grab a seat in the bus. Securing a seat in the Indian bus during peak time is considered a fortune. This often attracts resentful eyes. However my Indian genes have made me immune to both pani puri & judgment...
Continue reading → Tags : story india fiction bangalore sci-fi
Browsers have made browsing insanely easy. Toolbar fetches webpage magically. However, under the hood, lots of requests
are exchanged. These requests are based on REST
architecture.
What is REST? REST is REpresentational State Transfer. Loosely speaking it defines how resources are exchanged based on item of request. Two most common HTTP Request Methods are POST
and GET
. Using tshark, we can see the headers exchange as you browse the web...
Continue reading → Tags : tshark rest http get post
I finally divorced Windows
soon after I fell in love with Linux. Ubuntu was my first love. I met her on Distrowatch
. But she spoke no English. So I spent hours gawking at her sleaky terminal trying to learn her language, bash
...
Continue reading → Tags : arch linux install
Any deterministic general sorting algorithm has average case time complexity O(nlogn) . However, certain sorting algorithm can run faster in O(n) but with limitation. Instead of comparision-based sort, each element is looked individually by its value. Radix sort is one fine example of integer sorting...
Continue reading → Tags : lsd radix sort sorting cplusplus
Imagine a sunset, with a tired sun sinking over a meadow. The chirping of birds steals your attention as they return to their homes. And while the sun disappears, you sink back and relish your sourrounding...
Continue reading → Tags : programming general
“If you’ve got nothing to hide, you’ve got nothing to fear”. This is the most common retort used by governments to espouse Mass surveillance. They do it in the pretext of security. But even if you’re not a fugitive, you have the right to protect your privacy...
Continue reading → Tags : privacy surveillance snooping
“India’s Daughter”, a documentary on Gang rape of 2012 has been officially banned. The Indian government went all gun to arrest the release of the documentary in India & abroad. BBC, Google, Youtube have all been sent legal notices to comply with the government’s diktat. Congratulations! We have shown the world that we will silence anything that will make us uncomfortable...
Continue reading → Tags : bbc india ban
Different religion tells us about plethora of beautiful tales about the genesis of humans. We humans, like any other trivial species, descended not from heaven (sigh!) but due to mitosis in single cell organisms...
Continue reading → Tags : code cryptography cipher monoalphabetic
Often we meet,
Avoiding prying eyes secretly,
In between stretches a velvet sky,
Only gulf in between us apparently...
Continue reading → Tags : poetry romance moon audio
I was lying around on a secluded meadow. Under the open sky I gazed at the clouds scudding by. Suddenly it seemed that I was drifting away. A scathing sound began to wreak the whole place. And the mischievous alarm pulled me out of my dreams...
Continue reading → Tags : god religion science audio
I walked miles on my feet and hope,
against all weather, people and slope,
But after some distance I could not keep,
enough pace as the way was steep...
Continue reading → Tags : poetry happiness
I once complained to my friend of his desktop on his computer. His desktop was a tangled mess of icons. “It’s easier this way.”, he chuckled, “I can quickly find all the softwares I need.”. I showed him my desktop which was spick and span.”Doesn’t it consumes time in finding the softwares you need?”, he asked...
Continue reading → Tags : emacs editor
It was just another day in Gurgaon. The hot scorching sun was parading the city. The inescapable life of riding with the autowalas is the common sight of this concrete jungle. Though I am a FOSS enthusiast, my first job landed me to just another India’s IT company. I vividly remember the countless occasions when ViM saved my day...
Continue reading → Tags : vi vim editor code
Once a friend of mine asked if I could Hack. I asked him what he meant by hacking. Bemused at such a lame question he replied, “Don’t you know what hacking is?”. On insisting he reluctantly explained, “breaking into website or stealing passwords of Facebook, etc”. I was crestfallen at the rampant misconception about hacking...
Continue reading → Tags : hacking hackers code
As I lay on my cosy bed,
a hanging moon did my curtains lit,
under my pillow sank my weary head,
and slumber weaved its sleepy knit...
Continue reading → Tags : poetry sleep
The Debian claimed to be the Universal Operating System. Impressed by the stability and the community, I decided to switch to Debian. Earlier I used Fedora which handled all the hassles for me. Unlike Fedora, I had manually configure it to connect to the internet. But I soon realized it was not as difficult as it earlier seemed to be...
Continue reading → Tags : debian usb modem
After a ruckus the government agreed to roll back the proposed decision to increase FDI in retail sector. This could have paved way for the behemoth giants like Walmart to enter India. Indian Inc. was largely disappointed with the lack of much needed retail reform while the opposition parties including the local shopkeeper rejoiced over the fear of Walmart...
Continue reading → Tags : india walmart fdi