Friday, February 20, 2026

Leading vs Trailing zeros

There is a pattern that repeats itself across all domains — in binary arithmetic and in the arithmetic of life. Position is everything. Not what you have, but where you place it.

Duryodhan and Arjuna stood before the same choice on the eve of Kurukshetra. On one side, Krishna himself. On the other, the Narayani Sena — vast, glittering, countable. Duryodhan, ever the strategist, chose the army. He put Krishna behind him. Arjuna chose Krishna, and so Krishna rode before him — not as a warrior, but as a charioteer, a guide, a voice.

Duryodhan's logic was impeccable. By every measurable calculation he had the stronger hand. But he had placed the infinite behind him and the finite before him, and spent the rest of his life wondering why the finite kept failing.

Arjuna's choice looked like weakness — choosing one unarmed man over a hundred thousand soldiers. But when despair overtook him on the battlefield and his bow slipped from his hands, that one unarmed man spoke. And what he said became the Bhagavad Gita.

The leading zeros of life — wealth, armies, strategy, calculation — are not worthless. But place them before God and they obscure everything. Place God before you and even the zeros find their proper position, their proper value.

Duryodhan had Krishna. He just put him in the wrong place.


Tuesday, June 03, 2025

Nvidia bitches

NVIDIA bitches need servants, not dreamers. There is no time in the interview to discuss your thoughts or ideas or even tell anecdotes about previous interviews with other NVIDIA bitches. Bitches come per-instructed about the process of interviewing. After the couple of questions they would straight away jump to Hacker-fucking-Rank, another POS website created by a code-coolie. This asshole in single-handedly responsible for destroying the world as the current NVIDIA CEO who says we have reached a tipping point. This "genius" would be considered in  the history of humanity as someone who took the first step in destroying his own race.

Saturday, May 31, 2025

classic problems in CS: producer, consumer, event driven programming, blocking vs non blocking, parallel programming, synchronous ipc bad etc...

Race conditions, deadlocks, resource hogging are the kind of problems you will have to deal with in production issue debugging.

 

1. Producer–Consumer Problem

  • What: One or more producers generate data, and one or more consumers process it.

  • Why classic: It models pipelines and buffers in OS, I/O, and multithreading.

  • Challenge: Managing a shared buffer with thread safety, avoiding deadlocks or race conditions.

  • Modern Usage: Logging systems, data ingestion pipelines, concurrent queues, asyncio tasks.


 

2. Event-Driven Programming

  • What: Program flow controlled by events like I/O, signals, or user actions.

  • Examples: GUI frameworks, network servers (e.g., Node.js), embedded systems.

  • Key Idea: Handlers (callbacks) respond to events asynchronously.

  • Pitfall: Callback hell, hard-to-debug flow.

    3. Blocking vs Non-Blocking I/O


    BlockingNon-blocking
    ThreadWaits (halts)Continues immediately
    RiskFreezes UI / threadNeeds polling or async model
    UseSimple scriptsReal-time systems, UI, servers

4. Parallel Programming

  • What: Running multiple computations simultaneously (threads or processes).

  • Goal: Speed up workloads like ML training, video processing, simulations.

  • Challenge: Thread safety, synchronization, avoiding contention.

  • In Python: GIL limits threading → use multiprocessing for true parallelism.

    5. Synchronous IPC: Problems

  • MsgReceive() in QNX or similar synchronous IPC:

    • Blocks caller until a message arrives.

    • Problem: If a thread is blocked on MsgReceive(), it can’t respond to new events → UI hangs.

    • Fix: Use async messaging, polling with timeout, or delegate to worker th

  • 6. Deadlocks, Starvation, and Race Conditions

  • Deadlock: Two threads waiting on each other → system freeze.

  • Starvation: One thread never gets scheduled.

  • Race Condition: Two threads modifying shared data without sync → nondeterministic bugs.

 

Friday, May 09, 2025

Major Types of Machine Learning Tasks

 In machine learning, especially classification:? are there other kinds of machine learning?

Q: In machine learning, especially classification:? are there other kinds of machine learning?

Major Types of Machine Learning Tasks

TypeDescriptionExample Use Case
1. ClassificationPredict discrete labels (categories)Handwritten digit recognition (0–9)
2. RegressionPredict continuous valuesPredict house price from features
3. ClusteringGroup similar data without labelsCustomer segmentation
4. Dimensionality ReductionCompress data while preserving structurePCA for visualization or compression
5. Anomaly DetectionFind rare or unusual patternsCredit card fraud detection
6. Reinforcement LearningLearn through interaction with an environmentTraining a robot or game AI
7. Generative ModelingCreate new data like images, text, audioText generation, image synthesis

Saturday, December 21, 2024

Why Reddit is the rat poison of Internet

I have previously written a post about how Twitter is the rat poison of the internet, but now it is is fair to say that a new rat poison has been invented and thrust on the Internet. It is called Reddit. It is absolutely mind boggling how Reddit was able to get funded even after so many similar websites already there. For example Quora, witch is probably not a poison,  just a harmful substance. 

But Reddit has reached new levels of poison, at the same level as maybe potassium cyanide. Like Twitter, it has the potential to kill you instantly. There are posts on Reddit where past users have posts like - "How this forum ruined me."

Subredit, what the heck is that term anyway? But if we have learnt anything, it is that money and bro-entrepreneurship combination of Silicon Valley can get people high on previously unknown substances. Founders of these companies - the likes of Jack Dorsey Steve Huffman, are the later adherents of Steve Jobs, who being still grounded in a bit older generation, got people high on Iphones, which still provided some value and had probably taken substantial time and money to develop as it is not just software but also hardware.

But Twitter and Reddit are the rat poison at the level of the lethality of potassium cyanide.

Tuesday, April 23, 2024

Crisis In Indian Education System

We are growing a generation of Indians, who don't know about Shivaji, Kalidasa, and Guru Gobind Singh. I call this Owl Gandhi generation. This is the generation that was educated in English medium schools. 

Just recently I happened to give example of Kalidasa to a recent immigrant to the U.S from India, and the man seemed to possess no idea about Kalidasa. I had to rekindle his memory by telling him about "the man who was cutting the branch he was sitting on." And the man barely remembered the parable. And he seemed to know nothing about the conext of the story.  No idea about who was Vidyottama. 

Similarly, a few years back, I happened to be in the middle of conversation with a man who was "bhakta" of Warren Buffet. I thought this man, being from Bombay, will have some idea of Shivaji. So I mentioned in the context of an example. I was shocked that he possessed barely a rudimentary idea of Shivaji's dialogue with a captured beauty.

What is going on in India. Have we raised a generation on comic books, Aesop's Fables, and startrack TV serial. It is a generation that knows a lot about foreign brands and symbols. A generation that knows the imported secular idea of separation of church and state, and so on and so forth. But a little about its own culture?

Your thoughts welcome.

Thursday, January 11, 2024

Irrespective of the religion you follow don't be a materialistic idolater

We tend to categorize the world as black and white and simplify reality. The other day I was thinking about a situation. I thought I had a beer with Ravana (the demon king of Indian epics) in Lanks. The situation is as follows.

Lanka is surrounded by Rama's armies led by Hanuman. Ravana is distraught. He has these nightmares and imagines that he is going to be dead. He laments that Rama, from a far northern land, wants to destroy Lanka. But he doesn't want to give up his interest in getting Sita.Here Sita is the metaphor for his self interests, it could be in real world a guy wanting to build his wealth at any cost. Even if he has to sacrifice some innocent people on the way. It is like kind of guy who believes in my way or highway come what may. He won't hesitate to kill some innocents on the way. He could be a Hindu or Muslim or Christian, it doesn't matter. Evil exits everywhere, just as good does. Mohamed sacrificed a lot of people in Arabia to get his booty.Arabia was a desert land, it needed fools from South Asia or Europe to come and spend money there. It's like you legalize prostitution in Las Vegas to make people come to this hopeless infertile land

What happens next and what Ravana asks from me will be described later.