<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Abhishek Sundararajan</title>
    <subtitle>Books. What else?</subtitle>
    <link rel="self" type="application/atom+xml" href="https://asun9.com/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://asun9.com"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-01-11T00:00:00+00:00</updated>
    <id>https://asun9.com/atom.xml</id>
    <entry xml:lang="en">
        <title>Books 2026</title>
        <published>2026-01-11T00:00:00+00:00</published>
        <updated>2026-01-11T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/books-2026/"/>
        <id>https://asun9.com/notes/books-2026/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/books-2026/">&lt;p&gt;Tracking all that I read in 2026&lt;&#x2F;p&gt;
&lt;h1 id=&quot;january&quot;&gt;January&lt;&#x2F;h1&gt;
&lt;h2 id=&quot;the-switch-elmore-leonard&quot;&gt;The Switch, Elmore Leonard&lt;&#x2F;h2&gt;
&lt;p&gt;Not too nasty, which was unexpected. Only the deserving die in this one. Altogether, a serviceable Leonard.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;52-pickup-elmore-leonard&quot;&gt;52 Pickup, Elmore Leonard&lt;&#x2F;h2&gt;
&lt;p&gt;Nasty little crime thriller. SA makes me uncomfortable and the hints of it in this one was more than enough to make me want to never re-visit this again. But it&#x27;s Elmore Leonard. Of course I devoured it as soon as I read the first line.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;lord-of-the-rings-jrr-tolkein&quot;&gt;Lord of the Rings, JRR Tolkein&lt;&#x2F;h2&gt;
&lt;p&gt;Read this in a delirium, in 6 days, before the work week starts. That’s a close repeat of my experience with LOTR the first time I read it, 20 years ago. This time, I even shed some tears when King Théoden died, can you believe it. Then, two decades ago, it was Aragorn that captured my imagination. Now it’s Samwise Gamgee. Maybe that tells you what matters as you age: friendship, loyalty, good food. You know, the simple virtues.   &amp;gt; ‘Come, Mr. Frodo!’ he cried. ‘I can’t carry it for you, but I can carry you and it as well. So up you get! Come on, Mr. Frodo dear! Sam will give you a ride. Just tell him where to go, and he’ll go.’&lt;&#x2F;p&gt;
&lt;p&gt;A fellowship is formed to see the end of the ring. Then the fellowship is broken involuntarily. And we follow some of the members as they go on their separate adventures. Aragorn, Gimli, and Legolas are always together. As are Frodo and Sam. Merry and Pippin for a brief while and then they are taken apart.  We follow each. But not Gandalf. Or Boromir. In fact the only interiority we observe are the little people - Gimli (though not a Hobbit, still small in stature), Merry, Pippin, Frodo, and Sam. I wonder why that is. Maybe it’s because the Halflings are our surrogates as they get to know Middle-earth? That’s probably it. As the story stands, and given his deeply Catholic worldview, it’s just as likely that Tolkien’s point is that history is made by the humble. I’m tempted to say the meek inherit Middle-earth, but the story is too melancholy to allow that conclusion. They save it, but don’t get to keep it. And the world is passes into a lesser age.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;mahaviri-nityananda-misra&quot;&gt;Mahaviri, Nityananda Misra&lt;&#x2F;h2&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Some software, 2025</title>
        <published>2025-12-23T00:00:00+00:00</published>
        <updated>2025-12-23T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/software-2025/"/>
        <id>https://asun9.com/software-2025/</id>
        
        <content type="html" xml:base="https://asun9.com/software-2025/">&lt;p&gt;One of things that make me happy are deep conversations. Happy is the appropriate word, I would think, if I were to describe that experience later to others. At the moment of connection, it’s more accurate to say my attention is narrow and judgement suspended, and I am completely engaged. I am in a flow state. Such conversations are few and far between, and thankfully there are many other opportunities in life to enter into that zone. Like using new tools, getting fluent with them, building with them. By tool, I mean both an instrument that allows one to get some job done, but also in this context, the job it self. Lego. Ikea furniture. Woodworking. Video games. Meditation. Seeing people use their tools with a feeling for craft, that does something to me. Take a look at master watchmakers or &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=eD1bI4LGobw&quot;&gt;knife makers&lt;&#x2F;a&gt;. Tell me it doesn’t make you want to immediately build something. Good software makes me feel that way. In 2025, I found three: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;ghostty.org&#x2F;&quot;&gt;Ghostty&lt;&#x2F;a&gt;, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;helix-editor.com&#x2F;&quot;&gt;Helix&lt;&#x2F;a&gt;, and &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;anthropics&#x2F;claude-code&quot;&gt;Claude Code&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;If I spent my career using one set of tools, working more or less the same way, there was a tsunami called Claude Code this year that wiped all that out. I am hard pressed to think of another product that has decisively changed the way I work. At the beginning it was not even clear that I was more productive with it than doing things by hand. But I found it enthralling to use, finding ways to work around the tasteless code it produces, figuring out ways to create guard rails. I make liberal use of plan mode, and I find that the result is still valuable even if I throw away any code that Claude Code produces: I have clarified my thinking about something. The more I work with it, the less I trust it to be right in many cases, but in every case it&#x27;s useful. There&#x27;s no going back now.  No one in my org codes by hand anymore. Well, there are a few holdouts, and we don’t force people to use these tools. But they will give in eventually. It’s via Claude Code that I learned to enjoy living on the terminal. I now judge other terminal agents by the UX standards that Claude Code has set. Do you have a plan mode? What about subagents? Skills? No? Pass.&lt;&#x2F;p&gt;
&lt;p&gt;About a couple of times a week, Claude Code on my iTerm terminal would get into an infinite scrolling mode and become unresponsive to key presses. Giving up on Claude Code was not an option. So I shopped around for other terminals and picked Ghostty because someone recommended that as a solution on slack. It also helped that Mitchell Hashimoto’s writing resonated with me, in particular, his blog post on &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;mitchellh.com&#x2F;writing&#x2F;non-trivial-vibing&quot;&gt;vibe coding a UI feature&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;The UX on Ghostty blew my mind. It was not as feature rich as iTerm, but I never used any of the fancy features anyway. What I want from a terminal are reasonable shortcuts for opening window panes and tabs, navigating between them, and closing them. Ghostty uses GPU for rendering, and on MacOS this done using Metal. Ghostty seems to cache rendered characters into a texture atlas on the GPU. When a character needs to be displayed, it&#x27;s simply copied from the cache to the screen instantly. Ghostty uses a custom-built terminal core written in Zig. It interacts as directly as possible with the operating system&#x27;s windowing primitives. All of this is to say, Ghostty owns the entire stack from the window creation to the PTY (pseudoterminal) communication. The end result is that all this design choices shaves milliseconds off input latency from the moment a key is pressed, to a character appearing on screen. Who knew the effect would be so mesmerizing? The phrase buttery smooth comes to mind. I haven’t found myself going back to iTerm or even exploring other terminal emulators at all.&lt;&#x2F;p&gt;
&lt;p&gt;Ghostty gave me such a good experience that I wanted to do other things on the terminal alone. And what do I do on my computer most of the time? Aside from browsing, it’s reading and writing code. That led me to Helix.&lt;&#x2F;p&gt;
&lt;p&gt;Helix is a modal editor. I had been unhappy with VSCode for a while, especially its performance on large code bases or opening large files. I played around with Zed and while I admit it was performant, it still left me with an empty feeling. It would do, however. But then along came Ghostty and it opened up my mind to the possibilities of TUIs. Around the same time, I read Julia Evans’s post about moving to Helix and I decided to check it out. You know, just some fooling around. I just never went back to VSCode and Zed. Learning modal editors was like discovering a game, a new way of seeing and navigating a world I thought I was already familiar with. Helix has sane defaults, key bindings that make sense. They were easy to memorize because they mapped to semantic understanding of what navigating a code base meant. Who knew that navigating a file with &lt;code&gt;Alt+n&lt;&#x2F;code&gt; and &lt;code&gt;Alt+p&lt;&#x2F;code&gt; and &lt;code&gt;Alt+i&lt;&#x2F;code&gt; - moving up and down the syntax tree - would be faster not just because there&#x27;s no mouse scrolling, but because it fills in your mental model of the code as you go? I am not sure I even made a conscious decision to memorize them, but here we are. Now it’s second nature. Those early days of exploration, I sometimes even found myself dreaming about Helix.&lt;&#x2F;p&gt;
&lt;p&gt;So why these three, out of the many softwares that come and go? Part of it is that the friction to get deadly with them was just enough - not too much, certainly not too little. But the larger part is that these are made by people who clearly use them for their daily work, and that shows in UX choices that feel inevitable. Good tools make it easy to form habits, moves you reach for without thinking. That&#x27;s the same thing that happens in a good conversation: the boundary between you and the thing you&#x27;re engaged with starts to blur. Flow, again.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Tale as old as time</title>
        <published>2025-12-06T00:00:00+00:00</published>
        <updated>2025-12-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/tale-as-old-as-time/"/>
        <id>https://asun9.com/notes/tale-as-old-as-time/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/tale-as-old-as-time/">&lt;p&gt;The little menace woke us up a couple of nights ago with a scream. I saw her sitting, looking into the distance, shaking and saying &quot;I want to go home.&quot; The mother, panicking for a brief moment, tried to soothe her. A nightmare. This was a first. As mommy held her I whispered, &quot;it&#x27;s okay kanna, naan irukken. We will protect you.&quot; That, to my surprise, seemingly calmed her down. She snuggled next to me, resting her head on mine. Then a minute or two later, she said &quot;I love you appa.&quot; It took her a while to fall asleep. And when it happened, her little hands were holding my finger.&lt;&#x2F;p&gt;
&lt;p&gt;With my sleep ruined, and it being close to my waking time anyway, I got up soon after, and spent some time noodling around. I had ICLR review deadlines to meet. Some time around 7 am, I could hear sounds from the bedroom, and I knew the little menace was up. This was my second favourite part of the day, to greet the boss in the morning. The first place goes to the evenings, when I pick her up from day care, where she would unfailingly greet me with a smile and a bear hug the moment she spies me.&lt;&#x2F;p&gt;
&lt;p&gt;As I walk into the bedroom, she looks at me groggily, and says, &quot;Go away, I want my amma.&quot;&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Helix aide-mémoire</title>
        <published>2025-11-23T00:00:00+00:00</published>
        <updated>2025-11-23T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/helix-aide-memoir/"/>
        <id>https://asun9.com/notes/helix-aide-memoir/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/helix-aide-memoir/">&lt;p&gt;You should be in NOR mode about 90% of the time. With coding agents, this is likely to be 99%, or even a 100%.
The trick with modal editors is to make it a habit to switch to NOR mode from INS often. Be liberal with that ESC press.&lt;&#x2F;p&gt;
&lt;p&gt;You will want to use Helix exclusively to get fluent with it, so make it the default Unix editor. Drop VScode, Zed, TextEdit and any other WYSIWYG editors.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;navigation&quot;&gt;Navigation&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;code&gt;option+p&lt;&#x2F;code&gt;(p == previous), &lt;code&gt;option+n&lt;&#x2F;code&gt; (n == next) = select previous block and next block. You gotta select a work or character first, which you will via &lt;code&gt;w&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;option+i&lt;&#x2F;code&gt; = go to beginning of selection, but in NOR mode (in comparison to just i)
This uses the LSP to navigate the code blocks.&lt;&#x2F;p&gt;
&lt;p&gt;To navigate via paragraphs or functions, &lt;code&gt;]f&lt;&#x2F;code&gt; or &lt;code&gt;]p&lt;&#x2F;code&gt; to go to the next paragraph, and &lt;code&gt;[f&lt;&#x2F;code&gt; or &lt;code&gt;[p&lt;&#x2F;code&gt; for the previous paragraph.&lt;&#x2F;p&gt;
&lt;p&gt;Then there is &lt;code&gt;h,j,k,l&lt;&#x2F;code&gt;.
Do &lt;code&gt;10k&lt;&#x2F;code&gt; to jump 10 lines up.
&lt;code&gt;120j&lt;&#x2F;code&gt; to go down the page 120 lines.&lt;&#x2F;p&gt;
&lt;p&gt;Use &lt;code&gt;w&lt;&#x2F;code&gt;, &lt;code&gt;e&lt;&#x2F;code&gt;, &lt;code&gt;b&lt;&#x2F;code&gt; to navigate word by word, forward and backwards.&lt;&#x2F;p&gt;
&lt;p&gt;To navigate through all the changes you have introduced, use &lt;code&gt;]g&lt;&#x2F;code&gt; and &lt;code&gt;[g&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;gg&lt;&#x2F;code&gt; and &lt;code&gt;ge&lt;&#x2F;code&gt;: Go to beginning and end of the file.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;g10g&lt;&#x2F;code&gt; or &lt;code&gt;g41g&lt;&#x2F;code&gt; and so on: go to line 10, line 41 etc.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;gw&lt;&#x2F;code&gt; will show labels at each word, and you can type the label to select that word.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;gs&lt;&#x2F;code&gt; and &lt;code&gt;gl&lt;&#x2F;code&gt;: Go to the first non white space character of the current line, and the end of the line.&lt;&#x2F;p&gt;
&lt;p&gt;To cycle through buffers - files that you have opened - use &lt;code&gt;gn&lt;&#x2F;code&gt; and &lt;code&gt;gp&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Use &lt;code&gt;gd&lt;&#x2F;code&gt; to navigate to a function definition. &lt;code&gt;gr&lt;&#x2F;code&gt; to go to all the references.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;splits&quot;&gt;Splits&lt;&#x2F;h2&gt;
&lt;p&gt;To create a vertical split, go to command mode and type &quot;vs&quot;.
In file picker mode, select a file and do &lt;code&gt;ctrl+v&lt;&#x2F;code&gt; and it will open that file in a new split.
&lt;code&gt;ctrl+w+q&lt;&#x2F;code&gt; closes a split.&lt;&#x2F;p&gt;
&lt;p&gt;To navigate between splits, &lt;code&gt;ctrl+w+w&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;selection&quot;&gt;Selection&lt;&#x2F;h2&gt;
&lt;p&gt;Go up and down the syntax tree via &lt;code&gt;option+o&lt;&#x2F;code&gt; and &lt;code&gt;option+i&lt;&#x2F;code&gt;.
Select the entire file&#x2F;buffer: &lt;code&gt;%&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Click &lt;code&gt;v&lt;&#x2F;code&gt; to go into selection mode, and now when you navigate via &lt;code&gt;w&lt;&#x2F;code&gt; or &lt;code&gt;b&lt;&#x2F;code&gt; or our friends &lt;code&gt;h,j,k,l&lt;&#x2F;code&gt;, the selection should stay. Press ESC or semi-colon exit this mode.&lt;&#x2F;p&gt;
&lt;p&gt;To select a line, press &lt;code&gt;x&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;To select all text between a pair of quotes, you would do &lt;code&gt;mi&quot;&lt;&#x2F;code&gt;. To select all text between brackets, &lt;code&gt;mi(&lt;&#x2F;code&gt; or &lt;code&gt;mi{&lt;&#x2F;code&gt;, or &lt;code&gt;mi[&lt;&#x2F;code&gt;.
To surround a selection with some text, such as double quotes, you would make the selection, and then do &lt;code&gt;ms&quot;&lt;&#x2F;code&gt;. Or with parentheses, do &lt;code&gt;ms(&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;To select a word, with your cursor on some character in the word, you would do &lt;code&gt;miw&lt;&#x2F;code&gt;. Lowercase &lt;code&gt;w&lt;&#x2F;code&gt; selects a sequence of letters, numbers and underscores.
If you do &lt;code&gt;miW&lt;&#x2F;code&gt;, the uppercase &lt;code&gt;W&lt;&#x2F;code&gt; ensures all contiguous non-whitespace characters are selected.&lt;&#x2F;p&gt;
&lt;p&gt;Combining the above information, if you want surround a word with quotes, you would hit these series of characters: &lt;code&gt;miWms&quot;&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;misc&quot;&gt;Misc&lt;&#x2F;h2&gt;
&lt;p&gt;To insert a new line above or below the current line, you will use &lt;code&gt;[+space&lt;&#x2F;code&gt; and &lt;code&gt;]+space&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;space+y&lt;&#x2F;code&gt; to copy any selection to the system clipboard. &lt;code&gt;cmd+v&lt;&#x2F;code&gt; to paste from system clipboard.&lt;&#x2F;p&gt;
&lt;p&gt;Once you have a selection, to make edits at the end, press &lt;code&gt;a&lt;&#x2F;code&gt;. To make edits at the beginning of the selection, press &lt;code&gt;i&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;To delete a selection, press &lt;code&gt;d&lt;&#x2F;code&gt;. To delete a selection and go into INS mode, press &lt;code&gt;c&lt;&#x2F;code&gt;.
To undo, &lt;code&gt;u&lt;&#x2F;code&gt;. To redo, &lt;code&gt;U&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;space+f&lt;&#x2F;code&gt; for fuzzy searching files, &lt;code&gt;space+&#x2F;&lt;&#x2F;code&gt; for fuzzy searching text through the project. Both are great - fast and miles ahead of VSCode.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>The Delhi Sultanate</title>
        <published>2025-09-13T00:00:00+00:00</published>
        <updated>2025-09-13T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/delhi-sultanate/"/>
        <id>https://asun9.com/delhi-sultanate/</id>
        
        <content type="html" xml:base="https://asun9.com/delhi-sultanate/">&lt;p&gt;Book: &lt;strong&gt;The Delhi Sultanate: A Political and Military History&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Peter Jackson&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;h1 id=&quot;1&quot;&gt;1.&lt;&#x2F;h1&gt;
&lt;p&gt;In 1200 CE, the North Indian landscape was dominated by warring Hindu kingdoms, the successor states to the Gurjara-Pratihara polity that had ruled the region with their capital at Kanauj, today in modern-day Uttar Pradesh. Despite not presenting a united front, these kingdoms offered significant resistance to Muhammad bin Sam of Ghori as he expanded the Ghurid empire eastwards. Gradually though, the Ghurids won. A case could be made that the Afghans had a military advantage through their use of Turks. That is, they had an abundance of horses and a lifetime of practice in warring. They secured major victories, such as at Tarain (1192 CE) against Prithviraja and Govindaraja, and against Jayachandra of the Gahadavalas (1194 CE). The native Indian kingdoms did not just roll over however, and direct Muslim rule was only patchy. For example, the Rajput hill fortresses kept reverting to Hindu rulers, requiring recapture by subsequent Muslim rulers, as it was with Gwalior or Ranthambor.&lt;&#x2F;p&gt;
&lt;p&gt;But the military advantage was real. This was reinforced by ideology. The Ghurids and the broader Islamic world&#x27;s expansionist framework made it easier for them to incorporate fresh troops of steppe warriors into their ranks.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;2&quot;&gt;2.&lt;&#x2F;h1&gt;
&lt;figure style=&quot;text-align:center;&quot;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;delhi-sultanate&#x2F;qutub-minar.jpg&quot;
       alt=&quot;Qutub Minar&quot;
       class=&quot;center&quot;
       style=&quot;max-height: 600px; width: auto; pointer-events: none;&quot;&gt;
  &lt;figcaption&gt;Qutub Minar&lt;&#x2F;figcaption&gt;
  
&lt;&#x2F;figure&gt;
&lt;p&gt;The first Turkish adventurers and marauders came to India following the campaigns of Mahmud of Ghazni around 1000 CE. They had entered Persia and other Islamic lands as free men during large-scale migrations of recently converted nomadic tribal groups from Central Asia. Turkic tribes were prized as slaves because of their martial prowess. Their children were enslaved, converted to Islam, and trained as soldiers. &quot;Slave&quot; in Arabic is ghulam, a word that has been borrowed into Hindustani with the meaning more or less intact. The ambitious empire of Ghor, based out of modern day Afghanistan, had many such ghulams in its service. Muhammad Ghori used them first as lieutenants, later as governors, in Punjab. From these positions of power, they eventually formed their own kingdom in India, known to posterity as the Slave&#x2F;Ghulam dynasty, or Delhi Sultanate. It should be evident by now that &lt;em&gt;ghulam&lt;&#x2F;em&gt; was a special type of servitude that was not seen as degrading. The descendants of these slaves formed a new elite within the aristocracy. Peter Jackson traces Delhi Sultanate&#x27;s history from this foundation in 1210 CE under Iltutmish (d. 1236 CE), the ghulam of Qutb ud-Din Aibak. It was the first Islamic state to be established in India.&lt;&#x2F;p&gt;
&lt;p&gt;The major dynasties that formed the Delhi Sultanate till 1400 CE are the Shamsids (Iltutmish and family), the Ghiyathids (Balaban and family), the Khaljis (Jalal al-Din Firuz and family), and the Tughluqs (Ghiyath al-Din Tughluq and family). While Iltutmish and Balaban were at one time ghulams, the majority of the rulers, and their respective descendants, were not.&lt;&#x2F;p&gt;
&lt;p&gt;Aibak&#x27;s chosen heir, Aram Shah (d. 1210-11), was murdered by Iltutmish before he ascended the throne. Balaban murdered his father-in-law, the last Shamsid sultan Nasir al-Din Mahmud Shah (d. 1266). Balaban also murdered his cousins, and Shamsi maliks, potential rivals for the throne. Of ten sultans in the 62 years after Iltutmish&#x27;s death, only Balaban died a natural death.&lt;&#x2F;p&gt;
&lt;p&gt;Alauddin Khalji&#x27;s (d. 1316) reign began in 1296, and he was a nephew of the preceding sultan, who he murdered. &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Ibn_Battuta&quot;&gt;Ibn Batuta&lt;&#x2F;a&gt; suggests that he in turn was poisoned by his chosen heir, Khidr Khan. Khidr Khan and his brother were blinded and imprisoned by Alauddin Khalji&#x27;s slave, Malik Kafur (d. 1316), who was soon enough assassinated by Qutb al-Din Mubarak Shah, another of Alauddin&#x27;s sons. Qutb al-Din Mubarak Shah then had his now-blinded brothers killed. Qutb al-Din Mubarak Shah (d. 1320) in due course met his end at the hands of his lover, the Indian slave Hasan, who ascended the throne as Nasir al-Din Khusraw Shah.&lt;&#x2F;p&gt;
&lt;p&gt;Ghiyath al-Din Tughluq Shah, the first of the Tughluqs, marched to Delhi and overthrew Khusraw Shah. He died when a newly constructed building collapsed on him at Afghanpur in 1324 CE. Contemporary chroniclers strongly suspected that his eldest son and designated heir, Muhammad bin Tughluq, had contrived his death. What is certain is that Muhammad bin Tughluq (d. 1351) killed his brother.&lt;&#x2F;p&gt;
&lt;p&gt;This book&#x27;s narrative ends with the fall of Delhi to Timur in 1398, when the last Tughluq sultan, Mahmud Shah, fled Delhi after the rout of their forces.&lt;&#x2F;p&gt;
&lt;p&gt;All our sultans, with the one Indian exception noted above, were of Turco-Mongol stock.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;3&quot;&gt;3.&lt;&#x2F;h1&gt;
&lt;p&gt;Lahore served as the capital of Muhammad Ghori&#x27;s Indian province and the centre of Islam in India when Qutb ud-Din Aibak established himself as ruler there in 1206. Aibak was the Ghurid sultan&#x27;s slave. The capital gradually shifted to Delhi due to frontier pressures - first from the expanding Khwarazm empire, then from the Mongols.&lt;&#x2F;p&gt;
&lt;p&gt;While Delhi became an accidental capital, it proved an ideal location for raids into Hindu territory. Daring campaigns were conducted against Deogiri, Warangal, and Madurai. Such raids were highly lucrative, and the Sultanate gradually expanded its ambition from plunder to permanent suzerainty. However, Delhi&#x27;s control over territories beyond their core northern region always remained weak. Governors and local chiefs routinely established independent rule. Bengal was incorporated into the Sultanate by Iltutmish, and would be an exemplar of this persistent insubordination. Gujarat was initially incorporated by Aladdin Khilji in 1310 CE, would follow a similar pattern of revolt and reconquest. By Tughluq&#x27;s death in 1351 CE, &quot;Bengal and every tract south of the Vindhyas had declared their independence, and none of these provinces was ever recovered.&quot; The Deccan remained under Delhi for less than thirty years.&lt;&#x2F;p&gt;
&lt;p&gt;Maps show a uniform shading to define the extent of Sultanate rule, though a series of dots would indicate with greater realism the extent of actual power. Each dot would be a fortified city or garrison, where the provincial Muslim governor had chosen to recognize the monarch. Even within these areas, the authority of the governor waned with distance, depending on local military operations or distance from Delhi.&lt;&#x2F;p&gt;
&lt;p&gt;Ibn Batuta, who traversed these lands between 1333 CE and 1347 CE, noted how India was different from other Muslim polities. Elsewhere in the Islamic world it made sense to talk about Dar al-Islam (abode of Islam) and Dar al-Hard (the “war-zone” or pagan territory), but not in India. Here, there was no clear physical boundary between Muslim and non-Muslim lands.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;4&quot;&gt;4.&lt;&#x2F;h1&gt;
&lt;figure style=&quot;text-align:center;&quot;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;delhi-sultanate&#x2F;execution-of-Jalal-al-Din.jpg&quot;
       alt=&quot;The Execution of Jalal-al-Din Firuzshah II by Alauddin Khalji. Via an encyclopedia from the Mongol Ilkhanate, Jami&amp;amp;#x27; al-tawarikh.&quot;
       class=&quot;center&quot;
       style=&quot;max-height: 600px; width: auto; pointer-events: none;&quot;&gt;
  &lt;figcaption&gt;The Execution of Jalal-al-Din Firuzshah II by Alauddin Khalji. Via an encyclopedia from the Mongol Ilkhanate, Jami&#x27; al-tawarikh.&lt;&#x2F;figcaption&gt;
  
&lt;&#x2F;figure&gt;
&lt;p&gt;Iltutmish&#x27;s initial encounter with Mongols were diplomatic and indirect. Genghis Khan was in the process of swallowing up the Khwarazmian empire, and chased the son of that Shah, Jalal al-Din all the way to the Indus. Genghis Khan contemplated returning to Mongolia through the Himalayan foothills and sent envoys to Iltutmish to request permission to pass through his dominion. Iltutmish sent the envoys away under guard, with a no. He was lucky that Genghis was superstitious enough to take another way that one time. The destruction of the Khwarazmian empire inadvertently ensured Muslim India was not part of the Khwarazmian sphere of influence or direct control. The Mongols ravaged the regions of Multan and Lahore, and, under Ogodei, these were subject to the Mongols and considered part of their border territory.&lt;&#x2F;p&gt;
&lt;p&gt;Mongol incursions devastated these border regions, with Punjab suffering annual attacks. The Mongols frequently penetrated deep into the Delhi Sultanate&#x27;s territory, even reaching the capital itself on multiple occasions. This threat along the Indus frontier forced successive Sultanate rulers into aggressive militarization and massive resource allocation for defense. For example, Sultan Balaban (d. 1287 CE) established a separate army specifically to combat the Mongols. Alauddin Khalji implemented drastic fiscal and administrative measures to support large armies while keeping prices low in the capital to fund his troops. Muhammad bin Tughluq had a large Khurasan force, intended for an offensive against the Mongols, with an estimated 470,000 men.&lt;&#x2F;p&gt;
&lt;p&gt;This frontier pressure also created a major flow of human capital into Delhi. Iltutmish deliberately positioned himself as a refuge for those fleeing the Mongols, attracting Persian scholars, ulemas, and soldiers of fortune. There was another source of human capital. Victorious campaigns against Hindu kingdoms provided slaves for the Sultanate&#x27;s ambitious construction projects. A historian of the court, Barani, reports that Alauddin Khalji employed 70,000 Hindu laborers on his Alai Darwaza and Jamait Khana mosque. Indian slaves and their paiks also served in Muslim military campaigns.&lt;&#x2F;p&gt;
&lt;p&gt;The resource drain of constant frontier warfare ultimately came at the expense of internal expansion. Muhammad bin Tughluq&#x27;s heavy taxation in the Doab, imposed to fund his Mongol offensive, provoked widespread revolt among cultivators, leading them to burn crops and flee to the forests. Successive rulers eventually abandoned distant campaigns, focusing instead on internal administration. This conscious reduction in long-range military capabilities left the Sultanate unprepared to face Timur in 1398, who destroyed Delhi and massacred its population.&lt;&#x2F;p&gt;
&lt;p&gt;After Timur&#x27;s devastation, the Sultanate reverted to being merely one of several competing northern powers. New or renascent Hindu principalities (Mewar, Alwar, Gwalior) and rival Muslim kingdoms (Gujarat, Bengal, Malwa) eroded its territorial control. The Delhi Sultanate itself lacked a ruler for three years following Timur&#x27;s departure.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;5&quot;&gt;5.&lt;&#x2F;h1&gt;
&lt;p&gt;The Ghurid historian Siraj al-Din Juzjani served in the court of Sultan Nasir ud din Mahmud Shah, son-in-law to Sultan Balaban. In his Tabaqat-i Nasiri, he frequently refers to Muhammad Ghori as Sultan-i-Ghazi, the holy warrior sultan, a pillar of Islam. Juzjani likens his triumphs over the Indian infidel to the victories of Muhammad Ghori&#x27;s contemporary Saladin over the Christian Franks of Syria and Palestine. It&#x27;s been suggested that the primary motivation was booty.&lt;&#x2F;p&gt;
&lt;p&gt;Qadi Nasir al-Din &#x27;Umar accompanied Timur on his invasion of 1398 to Delhi. He produced a work, now lost, Ruz-Nama-yi Futuhdat-i Hindustan. Abridged versions of it have survived. In turn, they have been incorporated in other works, including the possibly fabricated memoir &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.rct.uk&#x2F;collection&#x2F;1051262&#x2F;the-mulfuzat-timury-or-autobiographical-memoirs-of-the-moghul-emperor-timur&quot;&gt;Malfuzat-I Timuri&lt;&#x2F;a&gt;. Timur&#x27;s biographers say his motivation to invade Delhi was the merit he would gain as a ghazi by taking part in a religiously mandated holy war (jihad) against non-believers. Timur is said to have declared: &quot;By the order of God and the Prophet it is incumbent upon me to make war upon these infidels and polytheists&quot;. It&#x27;s been suggested that a crucial motivation was booty.&lt;&#x2F;p&gt;
&lt;p&gt;Babur, a Chagathay Turk, claimed direct descent from Timur through his father. His mother traced her ancestry to the Mongol Genghis Khan. Babur&#x27;s perspectives are included in his memoirs, Baburnama. For Islam&#x27;s sake, he says, he wandered pagan lands, battled Hindus and destroyed idols, and thus became a ghazi. He also reveals more concrete evidence for motivations other than holy war or protection of the faith: he was displaced from his ancestral lands - Samarkand - and he wanted territory of his own. He decided this territory would be the claims of his forbears, that is Timur, to sovereignty east of the Indus. Babur meticulously recorded the financial potential of territories, making estimates of the tax yield of Sultan Ibrahim Lodi&#x27;s north India in monetary terms.&lt;&#x2F;p&gt;
&lt;p&gt;Delhi fell to Babur in April 1526.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;6&quot;&gt;6.&lt;&#x2F;h1&gt;
&lt;p&gt;&lt;figure style=&quot;text-align:center;&quot;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;delhi-sultanate&#x2F;ranthambore-fort.jpg&quot;
       alt=&quot;&quot;
       class=&quot;center&quot;
       style=&quot;max-height: 600px; width: auto; pointer-events: none;&quot;&gt;
  &lt;figcaption&gt;&lt;&#x2F;figcaption&gt;
  
&lt;&#x2F;figure&gt;

&lt;figure style=&quot;text-align:center;&quot;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;delhi-sultanate&#x2F;chittorgarh-fort-rajasthan-1.webp&quot;
       alt=&quot;The hill fortresses kept reverting to Hindu rulers, requiring recapture by subsequent Muslim rulers, as it was with Gwalior or Ranthambor.&quot;
       class=&quot;center&quot;
       style=&quot;max-height: 600px; width: auto; pointer-events: none;&quot;&gt;
  &lt;figcaption&gt;The hill fortresses kept reverting to Hindu rulers, requiring recapture by subsequent Muslim rulers, as it was with Gwalior or Ranthambor.&lt;&#x2F;figcaption&gt;
  
&lt;&#x2F;figure&gt;
&lt;&#x2F;p&gt;
&lt;p&gt;One primary source for life under the Delhi Sultanate, and the ambitions of its rulers, is the works left behind by its court historians: Barani, &#x27;Isami, Amir Khusraw, and Shams-i Siraj. For external accounts, there&#x27;s Ibn Batuta&#x27;s Rehla, and records compiled under the Mamluks of Egypt and Mongol Persia. Ghurid historian Juzjani&#x27;s Tabaqat-i Nasiri has sections on the early Delhi Sultanate. Finally, there are administrative texts such as Hajji &#x27;Abd al-Hamid Ghaznawi&#x27;s Dastur al-Albab, a treatise, among other things, on the subject of taxation.&lt;&#x2F;p&gt;
&lt;p&gt;There are no contemporary Hindu narrative sources, except some inscriptions in stone or copper plate grants, although the references there to Mlecchas, Turushkas and Yavanas are vague.&lt;&#x2F;p&gt;
&lt;p&gt;These sources reveal a society where violence and instability pervaded even elite circles, with purges one bad night or sultan away. Wealth offered no security when political favor could shift overnight. The Delhi Sultanate was a society heavily reliant on and shaped by slavery, and political elimination was a standard tool of governance.&lt;&#x2F;p&gt;
&lt;p&gt;For military and administration, the Sultanate relied on Turkish slave guards, the ghulams. They were highly valued for their martial skills, received religious instruction, and rigorous military training. Slaves, both Turkish and Indian, were promoted to key administrative and military positions.&lt;&#x2F;p&gt;
&lt;p&gt;Hindus were extensively enslaved during military campaigns, with many thousands brought back as booty and used for labor or sold. While the wealthy and powerful enjoyed more comforts and opportunities, their lives were far from secure. Muslim chroniclers, such as Hasan-i Nizami, proudly recorded the demolition of Hindu temples and the reuse of their stone for constructing mosques, as seen in Delhi and Ajmer. Fakhr-i Mudabbir enthusiastically claimed that &quot;Infidel towns have become cities of Islam. In place of images, they worship the Most High. Idol temples have become mosques&quot;. Sultan Firuz Shah, in particular, claimed to have destroyed newly built Hindu temples and replaced them with mosques, even repopulating a township with Muslim settlers, although this policy was mostly enforced in the vicinity of Delhi. Firuz Shah&#x27;s edict, promising release from the jizya (poll-tax) to Hindus who converted to Islam, indicating a direct economic incentive and pressure to abandon native faiths. Amir Khusraw notes that the Turks could seize and buy and sell Hindus.&lt;&#x2F;p&gt;
&lt;p&gt;A recurring theme in Barani&#x27;s writings is that infidels must not be allowed to live in ease and affluence. He recounts a hypothetical conversation at Iltutmish&#x27;s court where the ulama argued that Hindus should be given only the choice between death and Islam, as they were not &quot;People of the Book&quot;. While the wazir deemed this impolitic due to the small Muslim population, the ulama insisted that the sultan should at least refrain from honoring Hindus or permitting idolatry.&lt;&#x2F;p&gt;
&lt;p&gt;From the perspective of the Sultanate&#x27;s chroniclers, Muslims constituted a common people, and Hindus were rarely seen as inherently interesting, but rather &quot;only as converts, as capitation tax-payers, or as corpses&quot;.&lt;&#x2F;p&gt;
&lt;p&gt;Indian Muslims and immigrant Muslims were generally treated differently, especially within the elite and court circles, with a clear preference for the latter, though Indian Muslims could rise in status. Ibn Battuta explicitly states that Muhammad bin Thughlaq preferred foreigners to the indigenous aristocracy and that the Indians in turn loathed the immigrant &#x27;Khurasani&#x27; nobles. Barani often stigmatized Muhammad&#x27;s Indian servitors as lowborn.&lt;&#x2F;p&gt;
&lt;p&gt;And yet, the Hindus and Jain and non-Turks did survive and remained a significant majority of the population, often in positions vital to the functioning of the state.&lt;&#x2F;p&gt;
&lt;p&gt;In rural areas, forests, and hills, remained &quot;the domain of the infidel&quot;. Even in fortified towns, such as Gwalior, Hindus formed the majority of inhabitants. Muslim victory did not always entail the displacement of Hindu rulers. Often, Hindu chiefs, the rais and the ranas, were allowed to retain their thrones in return for paying tribute.&lt;&#x2F;p&gt;
&lt;p&gt;The Turko-Persian nobility accumulated enormous debts to Hindu bankers and brokers, known as Multanis, who remained among the sultan&#x27;s wealthiest subjects. Hindu clerks were needed to staff the administration even if under Muslim supervision.&lt;&#x2F;p&gt;
&lt;p&gt;The majority of rulers within the Sultanate extended the status of &#x27;protected peoples&#x27; (dhimmis) to Hindus, to the fury of the ulema. This status, in return for acceptance of Muslim rule and payment of the jizya (poll-tax), theoretically offered protection of life and property. This was a pragmatic adaptation as in the Islamic lands outside of India, dhimmi status was applied only to monotheistic people of the Book.&lt;&#x2F;p&gt;
&lt;p&gt;There were some periods of accommodation and royal favor, based on any one Sultan&#x27;s personal disposition. Muhammad bin Thughlaq was often interested in Hindu practices, attending the Holi festival and frequenting jogis, though that made him an apostate in the eyes of our historians, &#x27;Isami and Barani.&lt;&#x2F;p&gt;
&lt;p&gt;Muslim rulers had adopted distinctly Indian practices, such as riding elephants and consulting Hindu astrologers. Donations of tax-free land to Brahmans, Jains, jogis, and temples, recorded extensively in the later Mughal era, often refer to renewals or extensions of grants made by earlier Muslim rulers, indicating continuity in Hindu religious and landholding institutions even through periods of Muslim rule.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;7&quot;&gt;7.&lt;&#x2F;h1&gt;
&lt;p&gt;The Delhi Sultanate established a historical precedent: the first and sole bastion of Muslim power in the Indian subcontinent for a hundred years. If you take seriously the argument that they prevented the Mongols from invading deeper into the country, one consequence of this pressure from the Mongols was administrative reforms and centralization of a sort not seen in India before.&lt;&#x2F;p&gt;
&lt;p&gt;The Turks and their situation - smaller ruling elites in a sea of hostile natives - accelerated the process of urbanization across much of northern India. Small market towns and large garrison cities grew in number throughout the Ganges basin. The need to maintain expensive horses and well-trained soldiers required the regular availability of cash to pay for them. The new urban centers expanded opportunities to trade. These changes fostered the development of a money economy and an expansion in craft production.&lt;&#x2F;p&gt;
&lt;p&gt;Iltutmish&#x27;s consolidation of power allowed him to launch a new coinage system based on the pure silver tanga, something that fostered economic integration within the expanded Sultanate. One major innovation was the iqta&#x27; system, a transferable revenue assignment in lieu of salary for military service. This became hereditary, allowing positions, titles, and emoluments to pass from father to son. It would influence later feudal systems and the rise of powerful regional families, and eventually the Mansabdari system of the Mughals, and in turn the Zamindari system across the country via the East India Company. Alauddin Khalji&#x27;s harsh, roughshod introduction of a highly centralized and rigorous revenue administration based on measurement and cash payments, marked a fundamental departure from earlier decentralized, agrarian systems in North India. Muhammad bin Tughluq&#x27;s administration directly colonized the northern Deccan with North Indian immigrant-settlers between the Narmada and Krishna Rivers and assimilated indigenous chieftains as iqta&#x27;dars.&lt;&#x2F;p&gt;
&lt;p&gt;The Sultanate&#x27;s internal conflicts, Mongol invasions, and policies of expansion to direct rule led to the secession of major provinces (e.g., Bengal, Deccan, Madurai) very quickly. Deccan insubordination would prove enduring. The Deccan would always remain another frontier to Delhi, including for the Mughals. The Mughal Empire would eventually unravel trying to get its Deccan holdings under central control. Native imperial authority would pass from a Deccan power, the Marathas, a confederacy no less, to another Deccan power, the East India Company, operating from Bombay and Madras. Another Deccan power, the Hyderabad State, was a significant regional power and its Nizam would at one point be the richest man in the world.&lt;&#x2F;p&gt;
&lt;p&gt;The Delhi Sultanate, it is fair to say, established a template for Muslim rule in India. Military elites would be drawn from Persia or Central Asia. The Sultan, while &lt;em&gt;the&lt;&#x2F;em&gt; defender of Islam, would accommodate his Hindu majorities. And there would be persistent attempts at taming the Deccan, and this would devolve into depending on household estates for control and revenue. That is, dependence on the Zamindars, and the title holders such as Patedars and Deshmukhs. This pattern of ambitious central authority ultimately constrained by local realities is certainly a feature of Indian governance, then and now.&lt;&#x2F;p&gt;
&lt;p&gt;After trudging through this book, there&#x27;s a claim I feel bold enough to make. The Delhi Sultanate&#x27;s cycles of conquest, revolt, and reconquest initiated a sustained and contentious dynamic between a powerful northern imperial authority and diverse Indian regional polities. This period saw the imposition of tribute and the adoption of some external administrative or cultural forms, but frequently provoked strong resistance. The Mughal Empire inherited and deepened this cycle with its tributaries and successor states and conditioned a lot of northern and deccani Indians to view Delhi as a symbolic authority of imperial power. This was leveraged by the Marathas, the British East India Company, and the modern Indian state for their own legitimization and internal consolidation.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>System Design 2</title>
        <published>2025-09-01T00:00:00+00:00</published>
        <updated>2025-09-01T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/sys-des-2/"/>
        <id>https://asun9.com/notes/sys-des-2/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/sys-des-2/">&lt;h1 id=&quot;design-a-generic-batch-processing-system&quot;&gt;Design a Generic Batch Processing System&lt;&#x2F;h1&gt;
&lt;p&gt;Designing a batch processing system involves handling large volumes of work items with a focus on reliability, fault tolerance, and efficient resource utilization. This system enables users to submit collections of work items for distributed processing with comprehensive progress tracking and failure recovery.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;requirements&quot;&gt;Requirements&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;functional-requirements&quot;&gt;Functional Requirements&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Users should be able to submit batch jobs with multiple work items.&lt;&#x2F;strong&gt; Each batch job contains a collection of items to be processed by the same task type with different parameters.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;The system should distribute work items across multiple workers for parallel processing.&lt;&#x2F;strong&gt; Large batches should be split into smaller work units for efficient distribution.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;The system should track progress at both batch and item levels.&lt;&#x2F;strong&gt; Users need visibility into overall batch completion and individual item status.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;The system should handle partial failures gracefully.&lt;&#x2F;strong&gt; When some items in a batch fail, the system should retry failed items while continuing to process successful ones.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Users should be able to monitor batch execution status and retrieve results.&lt;&#x2F;strong&gt; This includes real-time progress updates and final result aggregation.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;non-functional-requirements&quot;&gt;Non-Functional Requirements&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Scalability&lt;&#x2F;strong&gt;: Handle up to 50,000 concurrent batches with 10 million total work items processing simultaneously&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Durability&lt;&#x2F;strong&gt;: No work items should be lost due to system failures; all progress must be recoverable&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;At-least-once processing&lt;&#x2F;strong&gt;: Each work item is guaranteed to be processed at least once, with idempotency handling&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Fault tolerance&lt;&#x2F;strong&gt;: System continues operating with individual component failures&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Cost efficiency&lt;&#x2F;strong&gt;: Auto-scaling capabilities to minimize resource costs during low utilization&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;capacity-estimation&quot;&gt;Capacity Estimation&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Peak load&lt;&#x2F;strong&gt;: 50,000 batches&#x2F;hour, average 200 items per batch = 10M items&#x2F;hour&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Processing rate&lt;&#x2F;strong&gt;: ~2,800 items&#x2F;second sustained&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Storage&lt;&#x2F;strong&gt;: ~100GB metadata, 10TB temporary work data&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Worker fleet&lt;&#x2F;strong&gt;: 1,000-5,000 workers depending on item complexity&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;core-entities&quot;&gt;Core Entities&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;BatchJob&lt;&#x2F;strong&gt;: A user-submitted collection of work items sharing the same task type&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;WorkItem&lt;&#x2F;strong&gt;: An individual unit of work within a batch, containing input parameters and tracking state&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Task&lt;&#x2F;strong&gt;: A reusable processing template that defines how to execute work items&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;BatchExecution&lt;&#x2F;strong&gt;: Runtime instance tracking the overall progress and status of a batch&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;WorkerAssignment&lt;&#x2F;strong&gt;: Tracks which worker is processing which work items for failure recovery&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;system-interface&quot;&gt;System Interface&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;batch-management-api&quot;&gt;Batch Management API&lt;&#x2F;h3&gt;
&lt;pre style=&quot;background-color:#151515;color:#e8e8d3;&quot;&gt;&lt;code&gt;&lt;span&gt;POST &#x2F;batches
&lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;task_id&amp;quot;: &amp;quot;image_resize&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;batch_name&amp;quot;: &amp;quot;user_avatars_q4_2024&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;work_items&amp;quot;: [
&lt;&#x2F;span&gt;&lt;span&gt;    {&amp;quot;item_id&amp;quot;: &amp;quot;img_1&amp;quot;, &amp;quot;input_url&amp;quot;: &amp;quot;s3:&#x2F;&#x2F;...&amp;quot;, &amp;quot;params&amp;quot;: {...}},
&lt;&#x2F;span&gt;&lt;span&gt;    {&amp;quot;item_id&amp;quot;: &amp;quot;img_2&amp;quot;, &amp;quot;input_url&amp;quot;: &amp;quot;s3:&#x2F;&#x2F;...&amp;quot;, &amp;quot;params&amp;quot;: {...}}
&lt;&#x2F;span&gt;&lt;span&gt;  ],
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;batch_config&amp;quot;: {
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;failure_threshold&amp;quot;: 0.05,  &#x2F;&#x2F; Allow 5% failure rate
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;retry_limit&amp;quot;: 3,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;timeout_seconds&amp;quot;: 300
&lt;&#x2F;span&gt;&lt;span&gt;  }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;Response: {&amp;quot;batch_id&amp;quot;: &amp;quot;batch_123&amp;quot;, &amp;quot;estimated_completion&amp;quot;: &amp;quot;2024-01-15T10:30:00Z&amp;quot;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;pre style=&quot;background-color:#151515;color:#e8e8d3;&quot;&gt;&lt;code&gt;&lt;span&gt;GET &#x2F;batches&#x2F;{batch_id}&#x2F;status
&lt;&#x2F;span&gt;&lt;span&gt;Response: {
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;batch_id&amp;quot;: &amp;quot;batch_123&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;status&amp;quot;: &amp;quot;RUNNING&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;progress&amp;quot;: {
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;total_items&amp;quot;: 1000,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;completed&amp;quot;: 750,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;failed&amp;quot;: 25,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;retrying&amp;quot;: 10,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;pending&amp;quot;: 215
&lt;&#x2F;span&gt;&lt;span&gt;  },
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;estimated_completion&amp;quot;: &amp;quot;2024-01-15T10:25:00Z&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;pre style=&quot;background-color:#151515;color:#e8e8d3;&quot;&gt;&lt;code&gt;&lt;span&gt;GET &#x2F;batches&#x2F;{batch_id}&#x2F;items&#x2F;{item_id}
&lt;&#x2F;span&gt;&lt;span&gt;Response: {
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;item_id&amp;quot;: &amp;quot;img_1&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;status&amp;quot;: &amp;quot;COMPLETED&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;worker_id&amp;quot;: &amp;quot;worker_456&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;start_time&amp;quot;: &amp;quot;2024-01-15T10:00:00Z&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;end_time&amp;quot;: &amp;quot;2024-01-15T10:02:00Z&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;output_location&amp;quot;: &amp;quot;s3:&#x2F;&#x2F;results&#x2F;img_1_thumb.jpg&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;data-flow&quot;&gt;Data Flow&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Batch Submission&lt;&#x2F;strong&gt;: User submits batch job through API Gateway → Batch Management Service&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Work Item Creation&lt;&#x2F;strong&gt;: Batch Management Service creates individual WorkItem records and queues them&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Work Distribution&lt;&#x2F;strong&gt;: Workers pull work items from queue and claim ownership&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Progress Tracking&lt;&#x2F;strong&gt;: Workers update item status throughout processing lifecycle&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Completion Detection&lt;&#x2F;strong&gt;: Batch Coordinator monitors progress and determines batch completion&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Result Aggregation&lt;&#x2F;strong&gt;: Completed batch results are aggregated and made available to users&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;high-level-design&quot;&gt;High-Level Design&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;core-components&quot;&gt;Core Components&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;API Gateway&lt;&#x2F;strong&gt;: Entry point handling authentication, rate limiting, and request routing&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Batch Management Service&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Creates and validates batch jobs&lt;&#x2F;li&gt;
&lt;li&gt;Splits batches into individual work items&lt;&#x2F;li&gt;
&lt;li&gt;Manages batch lifecycle and configuration&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Work Item Database&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Choice&lt;&#x2F;strong&gt;: PostgreSQL with read replicas for metadata consistency&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Schema&lt;&#x2F;strong&gt;:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;batches&lt;&#x2F;code&gt;: batch_id, task_id, status, config, created_at, completed_at&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;work_items&lt;&#x2F;code&gt;: item_id, batch_id, status, worker_id, input_data, output_location, retry_count, last_error&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;worker_assignments&lt;&#x2F;code&gt;: assignment_id, worker_id, item_id, claimed_at, heartbeat_at&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Work Queue&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Choice&lt;&#x2F;strong&gt;: AWS SQS for reliability and auto-scaling&lt;&#x2F;li&gt;
&lt;li&gt;Separate queues for new work, retries, and dead letters&lt;&#x2F;li&gt;
&lt;li&gt;Message contains: item_id, batch_id, task_id, input_parameters&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Worker Pool&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Choice&lt;&#x2F;strong&gt;: ECS with auto-scaling based on queue depth&lt;&#x2F;li&gt;
&lt;li&gt;Workers are stateless and task-agnostic&lt;&#x2F;li&gt;
&lt;li&gt;Implement heartbeat mechanism for failure detection&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Batch Coordinator Service&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Monitors batch progress and determines completion&lt;&#x2F;li&gt;
&lt;li&gt;Handles retry logic for failed items&lt;&#x2F;li&gt;
&lt;li&gt;Manages batch-level timeouts and failure thresholds&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Data Storage&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Input&#x2F;Output&lt;&#x2F;strong&gt;: S3 for large data files with presigned URLs&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Results&lt;&#x2F;strong&gt;: Structured results in PostgreSQL, large outputs in S3&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Monitoring &amp;amp; Alerting&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;CloudWatch for infrastructure metrics&lt;&#x2F;li&gt;
&lt;li&gt;Custom dashboards for batch processing KPIs&lt;&#x2F;li&gt;
&lt;li&gt;Alerts for stuck batches, high failure rates, queue backlogs&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;workflow&quot;&gt;Workflow&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Batch Creation&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Batch Management Service validates request and creates batch record&lt;&#x2F;li&gt;
&lt;li&gt;Individual work items are created in database with PENDING status&lt;&#x2F;li&gt;
&lt;li&gt;Work items are queued for processing&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Work Processing&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Workers poll queue and claim work items (update worker_id and status to CLAIMED)&lt;&#x2F;li&gt;
&lt;li&gt;Workers send periodic heartbeats during processing&lt;&#x2F;li&gt;
&lt;li&gt;Upon completion, workers update status and output location&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Progress Monitoring&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Batch Coordinator periodically scans active batches&lt;&#x2F;li&gt;
&lt;li&gt;Calculates completion percentage and estimates completion time&lt;&#x2F;li&gt;
&lt;li&gt;Detects stuck workers via missed heartbeats and reassigns work&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Failure Handling&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Failed items are retried up to configured limit&lt;&#x2F;li&gt;
&lt;li&gt;Items exceeding retry limit are marked FAILED&lt;&#x2F;li&gt;
&lt;li&gt;Batch completion determined by failure threshold configuration&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;deep-dives&quot;&gt;Deep Dives&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;1-work-distribution-and-load-balancing&quot;&gt;1. Work Distribution and Load Balancing&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Challenge&lt;&#x2F;strong&gt;: Efficiently distribute work items to prevent worker starvation and handle varying processing times.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Solution&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Use SQS FIFO queues partitioned by batch_id to maintain order for dependent items&lt;&#x2F;li&gt;
&lt;li&gt;Implement worker prefetch limits to prevent hoarding&lt;&#x2F;li&gt;
&lt;li&gt;Dynamic batching: workers can claim multiple small items or single large items based on estimated processing time&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Work Claiming Protocol&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sql&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-sql &quot;&gt;&lt;code class=&quot;language-sql&quot; data-lang=&quot;sql&quot;&gt;&lt;span style=&quot;color:#888888;&quot;&gt;-- Atomic work claiming
&lt;&#x2F;span&gt;&lt;span&gt;UPDATE work_items
&lt;&#x2F;span&gt;&lt;span&gt;SET status = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;CLAIMED&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, worker_id = $&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;, claimed_at = NOW()
&lt;&#x2F;span&gt;&lt;span&gt;WHERE item_id IN (
&lt;&#x2F;span&gt;&lt;span&gt;  SELECT item_id FROM work_items
&lt;&#x2F;span&gt;&lt;span&gt;  WHERE status = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;PENDING&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;#39; &lt;&#x2F;span&gt;&lt;span&gt;AND batch_id = $&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;2
&lt;&#x2F;span&gt;&lt;span&gt;  LIMIT $&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;3&lt;&#x2F;span&gt;&lt;span&gt; FOR UPDATE SKIP LOCKED
&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;RETURNING item_id, input_data;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;2-failure-detection-and-recovery&quot;&gt;2. Failure Detection and Recovery&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Worker Failure Detection&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Workers send heartbeats every 30 seconds while processing&lt;&#x2F;li&gt;
&lt;li&gt;Batch Coordinator detects missed heartbeats and marks items as ABANDONED&lt;&#x2F;li&gt;
&lt;li&gt;Abandoned items are re-queued after updating retry_count&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Partial Failure Handling&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Individual item failures don&#x27;t affect other items in the batch&lt;&#x2F;li&gt;
&lt;li&gt;Failed items are retried with exponential backoff&lt;&#x2F;li&gt;
&lt;li&gt;Persistent failures are sent to dead letter queue for manual inspection&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Recovery Scenarios&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Worker crash&lt;&#x2F;strong&gt;: Heartbeat timeout triggers work reassignment&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Network partition&lt;&#x2F;strong&gt;: Worker continues processing; coordinator detects timeout and may create duplicate work (handled by idempotency)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Database failure&lt;&#x2F;strong&gt;: Work queue persists items; processing continues when database recovers&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;3-batch-completion-logic&quot;&gt;3. Batch Completion Logic&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Completion Criteria&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;All items completed successfully, OR&lt;&#x2F;li&gt;
&lt;li&gt;Failure rate exceeds configured threshold (batch marked FAILED), OR&lt;&#x2F;li&gt;
&lt;li&gt;Batch timeout exceeded&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Completion Detection&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sql&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-sql &quot;&gt;&lt;code class=&quot;language-sql&quot; data-lang=&quot;sql&quot;&gt;&lt;span style=&quot;color:#888888;&quot;&gt;-- Efficient batch status calculation
&lt;&#x2F;span&gt;&lt;span&gt;SELECT
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#7697d6;&quot;&gt;b&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#7697d6;&quot;&gt;batch_id&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;  COUNT(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span&gt;) as total_items,
&lt;&#x2F;span&gt;&lt;span&gt;  COUNT(CASE WHEN &lt;&#x2F;span&gt;&lt;span style=&quot;color:#7697d6;&quot;&gt;wi&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#7697d6;&quot;&gt;status &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;COMPLETED&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;#39; &lt;&#x2F;span&gt;&lt;span&gt;THEN &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;1 &lt;&#x2F;span&gt;&lt;span&gt;END) as completed,
&lt;&#x2F;span&gt;&lt;span&gt;  COUNT(CASE WHEN &lt;&#x2F;span&gt;&lt;span style=&quot;color:#7697d6;&quot;&gt;wi&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#7697d6;&quot;&gt;status &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;FAILED&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;#39; &lt;&#x2F;span&gt;&lt;span&gt;THEN &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;1 &lt;&#x2F;span&gt;&lt;span&gt;END) as failed
&lt;&#x2F;span&gt;&lt;span&gt;FROM batches b
&lt;&#x2F;span&gt;&lt;span&gt;JOIN work_items wi ON &lt;&#x2F;span&gt;&lt;span style=&quot;color:#7697d6;&quot;&gt;b&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#7697d6;&quot;&gt;batch_id &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#7697d6;&quot;&gt;wi&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#7697d6;&quot;&gt;batch_id
&lt;&#x2F;span&gt;&lt;span&gt;WHERE &lt;&#x2F;span&gt;&lt;span style=&quot;color:#7697d6;&quot;&gt;b&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#7697d6;&quot;&gt;status &lt;&#x2F;span&gt;&lt;span&gt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;RUNNING&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;#39;
&lt;&#x2F;span&gt;&lt;span&gt;GROUP BY &lt;&#x2F;span&gt;&lt;span style=&quot;color:#7697d6;&quot;&gt;b&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#7697d6;&quot;&gt;batch_id
&lt;&#x2F;span&gt;&lt;span&gt;HAVING COUNT(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span&gt;) = COUNT(CASE WHEN &lt;&#x2F;span&gt;&lt;span style=&quot;color:#7697d6;&quot;&gt;wi&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#7697d6;&quot;&gt;status &lt;&#x2F;span&gt;&lt;span&gt;IN (&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;COMPLETED&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;FAILED&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;) THEN &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;1 &lt;&#x2F;span&gt;&lt;span&gt;END);
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;4-scaling-and-performance&quot;&gt;4. Scaling and Performance&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Database Scaling&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Read replicas for status queries&lt;&#x2F;li&gt;
&lt;li&gt;Partition work_items table by batch_id for large batches&lt;&#x2F;li&gt;
&lt;li&gt;Connection pooling and prepared statements&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Queue Scaling&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;SQS auto-scales to handle message volume&lt;&#x2F;li&gt;
&lt;li&gt;Use multiple queues for different priority levels&lt;&#x2F;li&gt;
&lt;li&gt;Implement message batching for high-throughput scenarios&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Worker Auto-Scaling&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Scale workers based on queue depth and message age&lt;&#x2F;li&gt;
&lt;li&gt;Use spot instances for cost optimization&lt;&#x2F;li&gt;
&lt;li&gt;Implement graceful shutdown for worker termination&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Performance Optimizations&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Batch database updates for progress tracking&lt;&#x2F;li&gt;
&lt;li&gt;Use Redis for high-frequency heartbeat storage&lt;&#x2F;li&gt;
&lt;li&gt;Implement result caching for repeated status queries&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;5-monitoring-and-observability&quot;&gt;5. Monitoring and Observability&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Key Metrics&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Batch throughput (batches&#x2F;hour, items&#x2F;second)&lt;&#x2F;li&gt;
&lt;li&gt;Processing latency (time from submission to completion)&lt;&#x2F;li&gt;
&lt;li&gt;Failure rates by task type and error category&lt;&#x2F;li&gt;
&lt;li&gt;Worker utilization and queue depth&lt;&#x2F;li&gt;
&lt;li&gt;Cost per processed item&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Alerting Thresholds&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Queue depth &amp;gt; 10,000 items (scale up workers)&lt;&#x2F;li&gt;
&lt;li&gt;Batch failure rate &amp;gt; 10% (investigate task issues)&lt;&#x2F;li&gt;
&lt;li&gt;Worker heartbeat gaps &amp;gt; 5 minutes (check worker health)&lt;&#x2F;li&gt;
&lt;li&gt;Database connection pool exhaustion&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Dashboards&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Real-time batch processing overview&lt;&#x2F;li&gt;
&lt;li&gt;Historical performance trends&lt;&#x2F;li&gt;
&lt;li&gt;Cost analysis and optimization opportunities&lt;&#x2F;li&gt;
&lt;li&gt;Error analysis and retry patterns&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;This architecture provides a robust foundation for batch processing that handles the complexities of work distribution, failure recovery, and progress tracking at scale while maintaining cost efficiency and operational simplicity.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;chatgpt-with-inference-batching&quot;&gt;ChatGPT with Inference Batching&lt;&#x2F;h1&gt;
&lt;h2 id=&quot;understanding-the-problem&quot;&gt;Understanding the Problem&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;strong&gt;What are we building?&lt;&#x2F;strong&gt; A ChatGPT-like system that efficiently utilizes a pool of GPU servers for text inference. Each GPU server has a fixed latency for processing batches of 1-100 strings, making request aggregation the key optimization strategy.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;functional-requirements-1&quot;&gt;Functional Requirements&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Core Requirements&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Users should be able to submit text prompts and receive generated responses&lt;&#x2F;li&gt;
&lt;li&gt;The system should aggregate individual requests into batches for GPU processing&lt;&#x2F;li&gt;
&lt;li&gt;Responses should be correlated back to original users accurately&lt;&#x2F;li&gt;
&lt;li&gt;The system should handle variable request arrival patterns efficiently&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;&lt;strong&gt;Below the line (out of scope)&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Real-time streaming responses (token-by-token generation)&lt;&#x2F;li&gt;
&lt;li&gt;Conversation history and context management&lt;&#x2F;li&gt;
&lt;li&gt;User authentication and authorization&lt;&#x2F;li&gt;
&lt;li&gt;Advanced prompt engineering or content filtering&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;non-functional-requirements-1&quot;&gt;Non-Functional Requirements&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Core Requirements&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;High GPU Utilization&lt;&#x2F;strong&gt;: Maximize batch sizes (target: 90+ requests per batch) to optimize cost efficiency&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Acceptable User Latency&lt;&#x2F;strong&gt;: Balance batching delays with user experience (target: &amp;lt;500ms total response time)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;High Throughput&lt;&#x2F;strong&gt;: Handle thousands of concurrent requests efficiently&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Scalability&lt;&#x2F;strong&gt;: System should scale horizontally as demand increases&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Fault Tolerance&lt;&#x2F;strong&gt;: Basic resilience acceptable; memory-based components are fine per problem constraints&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;&lt;strong&gt;Below the line (out of scope)&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Strong consistency guarantees&lt;&#x2F;li&gt;
&lt;li&gt;Persistent storage requirements&lt;&#x2F;li&gt;
&lt;li&gt;Multi-region deployment&lt;&#x2F;li&gt;
&lt;li&gt;Advanced security features&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;the-set-up&quot;&gt;The Set Up&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;planning-the-approach&quot;&gt;Planning the Approach&lt;&#x2F;h3&gt;
&lt;p&gt;This system&#x27;s core challenge is &lt;strong&gt;request aggregation&lt;&#x2F;strong&gt; - efficiently batching individual user requests to maximize GPU utilization while maintaining acceptable response times. The fixed GPU latency characteristic means sending 1 request takes the same time as sending 100 requests.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;defining-the-core-entities&quot;&gt;Defining the Core Entities&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Request&lt;&#x2F;strong&gt;: An individual user prompt with associated metadata (requestId, timestamp, client connection info)&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Batch&lt;&#x2F;strong&gt;: A collection of 1-100 requests sent to GPU servers as a single inference call&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Response&lt;&#x2F;strong&gt;: Generated text corresponding to each request in a batch&lt;&#x2F;p&gt;
&lt;h3 id=&quot;system-interface-1&quot;&gt;System Interface&lt;&#x2F;h3&gt;
&lt;p&gt;Simple HTTP REST API for request-response pattern:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#151515;color:#e8e8d3;&quot;&gt;&lt;code&gt;&lt;span&gt;POST &#x2F;generate
&lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;prompt&amp;quot;: &amp;quot;What is the capital of France?&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;max_wait_ms&amp;quot;: 200  &#x2F;&#x2F; Optional: client timeout preference
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;Response:
&lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;response&amp;quot;: &amp;quot;The capital of France is Paris.&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;batch_size&amp;quot;: 87,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;processing_time_ms&amp;quot;: 245
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;high-level-design-1&quot;&gt;High-Level Design&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;core-architecture&quot;&gt;Core Architecture&lt;&#x2F;h3&gt;
&lt;pre style=&quot;background-color:#151515;color:#e8e8d3;&quot;&gt;&lt;code&gt;&lt;span&gt;[Clients] --HTTP--&amp;gt; [Load Balancer] ---&amp;gt; [Frontend Services] ---&amp;gt; [GPU Pool Manager] ---&amp;gt; [GPU Servers]
&lt;&#x2F;span&gt;&lt;span&gt;                                              |                                              ^
&lt;&#x2F;span&gt;&lt;span&gt;                                              v                                              |
&lt;&#x2F;span&gt;&lt;span&gt;                                       [Batch Accumulator]                                  |
&lt;&#x2F;span&gt;&lt;span&gt;                                       (In-Memory Queue)                                    |
&lt;&#x2F;span&gt;&lt;span&gt;                                              |                                              |
&lt;&#x2F;span&gt;&lt;span&gt;                                              +----------------------------------------------+
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;component-overview&quot;&gt;Component Overview&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Load Balancer&lt;&#x2F;strong&gt;: Distributes incoming HTTP requests across Frontend Service instances using round-robin or least-connections&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Frontend Service&lt;&#x2F;strong&gt;: Stateless HTTP servers that handle request batching and response correlation&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Batch Accumulator&lt;&#x2F;strong&gt;: In-memory data structure within each Frontend Service for collecting requests&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;GPU Pool Manager&lt;&#x2F;strong&gt;: Simple load balancer that routes batches to available GPU servers&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;GPU Servers&lt;&#x2F;strong&gt;: External inference servers with the fixed-latency API&lt;&#x2F;p&gt;
&lt;h2 id=&quot;data-flow-1&quot;&gt;Data Flow&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;request-processing-flow&quot;&gt;Request Processing Flow&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Request Arrival&lt;&#x2F;strong&gt;: Client sends HTTP POST to load balancer with text prompt&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Load Distribution&lt;&#x2F;strong&gt;: Load balancer routes request to available Frontend Service instance&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Batch Accumulation&lt;&#x2F;strong&gt;: Frontend Service adds request to in-memory batch accumulator&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Batch Triggering&lt;&#x2F;strong&gt;: Batch is sent to GPU Pool Manager when either:
&lt;ul&gt;
&lt;li&gt;100 requests accumulated (size trigger)&lt;&#x2F;li&gt;
&lt;li&gt;Timeout reached (75-100ms default)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;GPU Routing&lt;&#x2F;strong&gt;: GPU Pool Manager selects least-loaded GPU server&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Inference Processing&lt;&#x2F;strong&gt;: GPU server processes entire batch with fixed latency&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Response Disaggregation&lt;&#x2F;strong&gt;: GPU Pool Manager returns batch response to Frontend Service&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Response Correlation&lt;&#x2F;strong&gt;: Frontend Service maps individual responses back to waiting HTTP requests&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Client Response&lt;&#x2F;strong&gt;: Each client receives their specific response over original HTTP connection&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;key-data-transformations&quot;&gt;Key Data Transformations&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Individual Request → Batch Request&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Input: Single prompt string per HTTP request&lt;&#x2F;li&gt;
&lt;li&gt;Transform: Collect into list of 1-100 prompt strings&lt;&#x2F;li&gt;
&lt;li&gt;Output: Batch API call to GPU with list of strings&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Batch Response → Individual Responses&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Input: List of response strings from GPU&lt;&#x2F;li&gt;
&lt;li&gt;Transform: Map each response to original request using stored correlation&lt;&#x2F;li&gt;
&lt;li&gt;Output: Individual HTTP responses to waiting clients&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;potential-deep-dives&quot;&gt;Potential Deep Dives&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;1-how-do-we-optimize-the-batching-timeout-strategy&quot;&gt;1) How do we optimize the batching timeout strategy?&lt;&#x2F;h3&gt;
&lt;p&gt;The timeout value creates a fundamental trade-off between user latency and GPU utilization. This is the most critical optimization lever in the system.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Dynamic Timeout Adjustment&lt;&#x2F;strong&gt;:
During high traffic periods, shorter timeouts (20-30ms) work well because batches fill quickly. During low traffic, longer timeouts (100ms) are necessary to collect reasonable batch sizes. The system monitors request arrival rates and adjusts timeouts accordingly.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Traffic Pattern Analysis&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Track requests per second over rolling windows&lt;&#x2F;li&gt;
&lt;li&gt;High traffic (&amp;gt;50 req&#x2F;sec): Use 25ms timeout&lt;&#x2F;li&gt;
&lt;li&gt;Medium traffic (10-50 req&#x2F;sec): Use 50ms timeout&lt;&#x2F;li&gt;
&lt;li&gt;Low traffic (&amp;lt;10 req&#x2F;sec): Use 100ms timeout&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;User-Specified Preferences&lt;&#x2F;strong&gt;:
Allow clients to specify maximum wait time in their requests. Premium users might get priority treatment with faster timeouts, while batch processing jobs can accept longer delays.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;2-how-do-we-handle-uneven-load-distribution-across-frontend-services&quot;&gt;2) How do we handle uneven load distribution across Frontend Services?&lt;&#x2F;h3&gt;
&lt;p&gt;Each Frontend Service maintains its own batch accumulator, which can lead to suboptimal batching if traffic is unevenly distributed.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Load Balancer Strategies&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Least-connections routing ensures requests go to Frontend Services with fewer active batches&lt;&#x2F;li&gt;
&lt;li&gt;Health checks prevent routing to overloaded instances&lt;&#x2F;li&gt;
&lt;li&gt;Sticky sessions are not needed since each request is independent&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Cross-Service Batch Sharing&lt;&#x2F;strong&gt;:
Frontend Services could share accumulated requests through a lightweight coordination mechanism. When one service has a partial batch approaching timeout, it could request additional items from other services&#x27; accumulators.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Capacity Planning&lt;&#x2F;strong&gt;:
Monitor batch utilization metrics across all Frontend Services. If average batch sizes drop below targets, this indicates either uneven load distribution or insufficient traffic density requiring more aggressive timeout tuning.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-how-do-we-ensure-gpu-pool-efficiency-and-handle-failures&quot;&gt;3) How do we ensure GPU pool efficiency and handle failures?&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;GPU Load Balancing&lt;&#x2F;strong&gt;:
The GPU Pool Manager tracks pending requests per GPU server and routes new batches to the least loaded server. This prevents GPU hotspots while maintaining utilization.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Failure Handling&lt;&#x2F;strong&gt;:
When a GPU server fails or times out, the batch is immediately retried on a different server. The correlation mapping is preserved, so clients don&#x27;t experience duplicate responses. Circuit breaker patterns prevent sending traffic to consistently failing GPUs.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Health Monitoring&lt;&#x2F;strong&gt;:
Track GPU response times, error rates, and processing capacity. Servers showing degraded performance are temporarily removed from rotation. Automatic re-inclusion occurs after a recovery period with successful health checks.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;4-how-do-we-scale-the-system-horizontally&quot;&gt;4) How do we scale the system horizontally?&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Frontend Service Scaling&lt;&#x2F;strong&gt;:
Frontend Services are stateless and scale independently. Each instance maintains only its local batch accumulator and correlation mappings. Adding instances increases both batch accumulation capacity and HTTP request handling capacity.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Memory Management&lt;&#x2F;strong&gt;:
Each Frontend Service has bounded memory usage since batch accumulators have maximum sizes and correlation mappings are short-lived. Monitor memory utilization and set limits to prevent resource exhaustion.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;GPU Pool Scaling&lt;&#x2F;strong&gt;:
Adding GPU servers increases overall processing capacity. The GPU Pool Manager automatically includes new servers in routing decisions. Removal requires draining existing batches before taking servers offline.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;5-how-do-we-handle-different-request-priorities-and-patterns&quot;&gt;5) How do we handle different request priorities and patterns?&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Priority Tiers&lt;&#x2F;strong&gt;:
Implement separate batch accumulators for different priority levels. High-priority requests get smaller batch sizes and shorter timeouts, while standard requests wait for full batches. This balances responsiveness for critical users with efficiency for regular traffic.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Predictive Batching&lt;&#x2F;strong&gt;:
Analyze historical traffic patterns to predict peak periods. Pre-warm batch accumulators during expected traffic surges and adjust timeout strategies based on time-of-day patterns.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Burst Handling&lt;&#x2F;strong&gt;:
During traffic spikes, the system can temporarily reduce batch size requirements to maintain responsiveness. Monitoring request queue depths helps detect when burst mode should activate.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;6-how-do-we-monitor-and-optimize-system-performance&quot;&gt;6) How do we monitor and optimize system performance?&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Key Metrics&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Average batch utilization percentage&lt;&#x2F;li&gt;
&lt;li&gt;Request latency distribution (P50, P95, P99)&lt;&#x2F;li&gt;
&lt;li&gt;GPU server utilization and response times&lt;&#x2F;li&gt;
&lt;li&gt;Timeout frequency vs size-triggered batches&lt;&#x2F;li&gt;
&lt;li&gt;Request correlation accuracy&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Performance Optimization&lt;&#x2F;strong&gt;:
Continuously analyze the relationship between timeout values and batch sizes. Optimal timeout tuning maximizes the product of batch efficiency and user satisfaction. A&#x2F;B testing different timeout strategies helps identify optimal configurations.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Alerting Strategy&lt;&#x2F;strong&gt;:
Monitor for degraded batch utilization, increased latency, or GPU failures. Set thresholds that trigger alerts before user experience degrades significantly.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;design-chatgpt-playground&quot;&gt;Design ChatGPT Playground&lt;&#x2F;h1&gt;
&lt;h2 id=&quot;understanding-the-problem-1&quot;&gt;Understanding the Problem&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;strong&gt;🎮 What is a ChatGPT Playground?&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;A ChatGPT Playground is an interactive environment where users can experiment with Large Language Models (LLMs) by sending prompts and receiving responses. Unlike standard chat interfaces, playgrounds provide advanced configuration options like adjusting model parameters (temperature, max tokens, top-p), switching between different models, and managing multiple conversation sessions for different experiments.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;functional-requirements-2&quot;&gt;Functional Requirements&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Core Requirements&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Users should be able to send text prompts to an LLM and receive streaming responses in real-time.&lt;&#x2F;li&gt;
&lt;li&gt;Users should be able to view and persist conversation history within playground sessions.&lt;&#x2F;li&gt;
&lt;li&gt;Users should be able to configure LLM parameters (temperature, max tokens, model selection, system prompts).&lt;&#x2F;li&gt;
&lt;li&gt;Users should be able to create, name, and switch between multiple playground sessions.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;&lt;strong&gt;Below the line (out of scope)&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Sharing playground sessions with other users&lt;&#x2F;li&gt;
&lt;li&gt;Advanced prompt templating or batch processing&lt;&#x2F;li&gt;
&lt;li&gt;Custom model fine-tuning or training&lt;&#x2F;li&gt;
&lt;li&gt;Integration with external APIs or data sources&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;non-functional-requirements-2&quot;&gt;Non-Functional Requirements&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Core Requirements&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;The system should provide low latency responses with first token arriving within 500ms of prompt submission.&lt;&#x2F;li&gt;
&lt;li&gt;The system should scale to support 50,000 concurrent users with 5,000 prompts per second at peak.&lt;&#x2F;li&gt;
&lt;li&gt;The system should be highly available (99.9% uptime) with eventual consistency acceptable for conversation history.&lt;&#x2F;li&gt;
&lt;li&gt;The system should guarantee data durability - no conversation data should be lost due to system failures.&lt;&#x2F;li&gt;
&lt;li&gt;The system should handle WebSocket connections gracefully with automatic reconnection and session recovery.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;&lt;strong&gt;Below the line (out of scope)&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Strong consistency guarantees across all operations&lt;&#x2F;li&gt;
&lt;li&gt;Sub-100ms response times&lt;&#x2F;li&gt;
&lt;li&gt;Cross-region data replication&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Here&#x27;s how it might look on your whiteboard:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Playground Requirements&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-set-up-1&quot;&gt;The Set Up&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;planning-the-approach-1&quot;&gt;Planning the Approach&lt;&#x2F;h3&gt;
&lt;p&gt;For this problem, we&#x27;ll follow the delivery framework focusing on real-time streaming capabilities and session management. The core challenge is handling persistent WebSocket connections while maintaining conversation state and integrating with external LLM providers reliably.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;defining-the-core-entities-1&quot;&gt;Defining the Core Entities&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;User&lt;&#x2F;strong&gt;: Represents an individual using the playground platform, with authentication and usage tracking.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;PlaygroundSession&lt;&#x2F;strong&gt;: A named workspace containing LLM configuration and associated conversation history. Users can create multiple sessions for different experiments.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Message&lt;&#x2F;strong&gt;: Individual prompts (user) or responses (assistant) within a session, with support for streaming token metadata.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;LLMConfiguration&lt;&#x2F;strong&gt;: Parameters controlling LLM behavior (model, temperature, max_tokens, system_prompt) associated with each session.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;StreamingState&lt;&#x2F;strong&gt;: Transient state tracking active streaming responses, token buffers, and connection status.&lt;&#x2F;p&gt;
&lt;p&gt;Core Entities&lt;&#x2F;p&gt;
&lt;h3 id=&quot;the-api&quot;&gt;The API&lt;&#x2F;h3&gt;
&lt;p&gt;We&#x27;ll use REST for session management and WebSockets for real-time prompt&#x2F;response interaction:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Session Management (REST)&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#151515;color:#e8e8d3;&quot;&gt;&lt;code&gt;&lt;span&gt;POST &#x2F;sessions
&lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;name&amp;quot;: &amp;quot;My Experiment&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;config&amp;quot;: {
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;model&amp;quot;: &amp;quot;gpt-4&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;temperature&amp;quot;: 0.7,
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;quot;max_tokens&amp;quot;: 1000
&lt;&#x2F;span&gt;&lt;span&gt;  }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;GET &#x2F;sessions&#x2F;{sessionId}
&lt;&#x2F;span&gt;&lt;span&gt;Response: {
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;session_id&amp;quot;: &amp;quot;uuid&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;name&amp;quot;: &amp;quot;My Experiment&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;config&amp;quot;: {...},
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;messages&amp;quot;: [...] &#x2F;&#x2F; paginated
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;PUT &#x2F;sessions&#x2F;{sessionId}&#x2F;config
&lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;temperature&amp;quot;: 0.9,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;max_tokens&amp;quot;: 500
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Real-time Interaction (WebSocket)&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#151515;color:#e8e8d3;&quot;&gt;&lt;code&gt;&lt;span&gt;&#x2F;&#x2F; Connection
&lt;&#x2F;span&gt;&lt;span&gt;ws:&#x2F;&#x2F;api.playground.com&#x2F;sessions&#x2F;{sessionId}&#x2F;chat
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;&#x2F; Client → Server
&lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;type&amp;quot;: &amp;quot;prompt&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;content&amp;quot;: &amp;quot;Explain quantum computing&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;message_id&amp;quot;: &amp;quot;uuid&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;&#x2F; Server → Client (streaming)
&lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;type&amp;quot;: &amp;quot;token&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;content&amp;quot;: &amp;quot;Quantum&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;message_id&amp;quot;: &amp;quot;uuid&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;position&amp;quot;: 0
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;type&amp;quot;: &amp;quot;token&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;content&amp;quot;: &amp;quot; computing&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;message_id&amp;quot;: &amp;quot;uuid&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;position&amp;quot;: 1
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;type&amp;quot;: &amp;quot;complete&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;message_id&amp;quot;: &amp;quot;uuid&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;full_response_id&amp;quot;: &amp;quot;uuid&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;high-level-design-2&quot;&gt;High-Level Design&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;1-users-should-be-able-to-send-prompts-and-receive-streaming-responses&quot;&gt;1) Users should be able to send prompts and receive streaming responses&lt;&#x2F;h3&gt;
&lt;p&gt;The core challenge is maintaining persistent WebSocket connections while orchestrating calls to external LLM providers and streaming responses back to clients.&lt;&#x2F;p&gt;
&lt;h6 id=&quot;pattern-real-time-updates&quot;&gt;Pattern: Real-time Updates&lt;&#x2F;h6&gt;
&lt;p&gt;Streaming LLM responses represent a classic &lt;strong&gt;real-time updates&lt;&#x2F;strong&gt; pattern where servers must push data to clients as it becomes available. This requires persistent connections and careful handling of connection lifecycle, backpressure, and failure recovery.&lt;&#x2F;p&gt;
&lt;p&gt;Our architecture centers around a WebSocket Gateway that manages persistent connections and a Chat Service that orchestrates LLM interactions:&lt;&#x2F;p&gt;
&lt;p&gt;Basic Streaming Architecture&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;WebSocket Gateway&lt;&#x2F;strong&gt;: Manages persistent connections, handles authentication, and routes messages between clients and backend services. Maintains connection state in memory with Redis backing for connection recovery.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Chat Service&lt;&#x2F;strong&gt;: Stateless service that processes prompts, calls the LLM Provider, and streams responses back through the WebSocket Gateway. Handles message persistence and session state management.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;LLM Provider&lt;&#x2F;strong&gt;: External service (OpenAI, Anthropic, etc.) that processes prompts and returns streaming responses.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Flow for sending a prompt:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Client sends prompt via WebSocket connection to Gateway&lt;&#x2F;li&gt;
&lt;li&gt;Gateway forwards to Chat Service with connection identifier&lt;&#x2F;li&gt;
&lt;li&gt;Chat Service validates session, retrieves LLM config from database&lt;&#x2F;li&gt;
&lt;li&gt;Chat Service calls LLM Provider with streaming enabled&lt;&#x2F;li&gt;
&lt;li&gt;As tokens arrive from LLM Provider, Chat Service immediately forwards to Gateway&lt;&#x2F;li&gt;
&lt;li&gt;Gateway streams tokens to client via WebSocket&lt;&#x2F;li&gt;
&lt;li&gt;Chat Service persists complete message to database once streaming finishes&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;2-users-should-be-able-to-view-and-persist-conversation-history&quot;&gt;2) Users should be able to view and persist conversation history&lt;&#x2F;h3&gt;
&lt;p&gt;Conversation persistence requires careful coordination between real-time streaming and durable storage, with support for session recovery and message replay.&lt;&#x2F;p&gt;
&lt;p&gt;We&#x27;ll use PostgreSQL with a conversation-optimized schema:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sql&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-sql &quot;&gt;&lt;code class=&quot;language-sql&quot; data-lang=&quot;sql&quot;&gt;&lt;span&gt;CREATE TABLE &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;playground_sessions&lt;&#x2F;span&gt;&lt;span&gt; (
&lt;&#x2F;span&gt;&lt;span&gt;  session_id UUID &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;PRIMARY KEY&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;  user_id UUID NOT NULL,
&lt;&#x2F;span&gt;&lt;span&gt;  name &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;VARCHAR&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;255&lt;&#x2F;span&gt;&lt;span&gt;) NOT NULL,
&lt;&#x2F;span&gt;&lt;span&gt;  config JSONB NOT NULL,
&lt;&#x2F;span&gt;&lt;span&gt;  created_at &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;TIMESTAMP DEFAULT&lt;&#x2F;span&gt;&lt;span&gt; NOW(),
&lt;&#x2F;span&gt;&lt;span&gt;  updated_at &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;TIMESTAMP DEFAULT&lt;&#x2F;span&gt;&lt;span&gt; NOW()
&lt;&#x2F;span&gt;&lt;span&gt;);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;CREATE TABLE &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;messages&lt;&#x2F;span&gt;&lt;span&gt; (
&lt;&#x2F;span&gt;&lt;span&gt;  message_id UUID &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;PRIMARY KEY&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;  session_id UUID NOT NULL,
&lt;&#x2F;span&gt;&lt;span&gt;  role &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;VARCHAR&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;20&lt;&#x2F;span&gt;&lt;span&gt;) NOT NULL, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;-- &amp;#39;user&amp;#39; or &amp;#39;assistant&amp;#39;
&lt;&#x2F;span&gt;&lt;span&gt;  content &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;TEXT &lt;&#x2F;span&gt;&lt;span&gt;NOT NULL,
&lt;&#x2F;span&gt;&lt;span&gt;  tokens JSONB, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;-- streaming metadata, token timing
&lt;&#x2F;span&gt;&lt;span&gt;  sequence_number &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;INTEGER &lt;&#x2F;span&gt;&lt;span&gt;NOT NULL,
&lt;&#x2F;span&gt;&lt;span&gt;  created_at &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;TIMESTAMP DEFAULT&lt;&#x2F;span&gt;&lt;span&gt; NOW(),
&lt;&#x2F;span&gt;&lt;span&gt;  UNIQUE(session_id, sequence_number)
&lt;&#x2F;span&gt;&lt;span&gt;) PARTITION BY HASH(session_id);
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;-- Index for efficient conversation retrieval
&lt;&#x2F;span&gt;&lt;span&gt;CREATE INDEX &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;idx_messages_session_sequence
&lt;&#x2F;span&gt;&lt;span&gt;ON messages (session_id, sequence_number);
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Message Persistence Strategy:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Optimistic Writing&lt;&#x2F;strong&gt;: Start persisting user prompts immediately when received&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Streaming Buffer&lt;&#x2F;strong&gt;: Accumulate assistant response tokens in memory during streaming&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Atomic Completion&lt;&#x2F;strong&gt;: Persist complete assistant response as single transaction when streaming finishes&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Sequence Guarantees&lt;&#x2F;strong&gt;: Use incrementing sequence numbers per session to ensure message ordering&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;3-users-should-be-able-to-configure-llm-parameters&quot;&gt;3) Users should be able to configure LLM parameters&lt;&#x2F;h3&gt;
&lt;p&gt;LLM configuration management requires handling parameter validation, hot-swapping configurations mid-session, and maintaining compatibility across different model providers.&lt;&#x2F;p&gt;
&lt;p&gt;Session Configuration&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Configuration Service&lt;&#x2F;strong&gt;: Dedicated service managing LLM parameters with validation rules, default values, and provider-specific constraints.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Configuration validation examples:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Temperature: 0.0-1.0 for OpenAI models, 0.0-2.0 for Anthropic&lt;&#x2F;li&gt;
&lt;li&gt;Max tokens: Provider-specific limits (4096 for GPT-3.5, 100k for Claude)&lt;&#x2F;li&gt;
&lt;li&gt;Model availability: Check provider APIs for supported models&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Hot Configuration Updates:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sql&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-sql &quot;&gt;&lt;code class=&quot;language-sql&quot; data-lang=&quot;sql&quot;&gt;&lt;span style=&quot;color:#888888;&quot;&gt;-- Track configuration versions for rollback
&lt;&#x2F;span&gt;&lt;span&gt;CREATE TABLE &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;config_versions&lt;&#x2F;span&gt;&lt;span&gt; (
&lt;&#x2F;span&gt;&lt;span&gt;  version_id UUID &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;PRIMARY KEY&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;  session_id UUID NOT NULL,
&lt;&#x2F;span&gt;&lt;span&gt;  config JSONB NOT NULL,
&lt;&#x2F;span&gt;&lt;span&gt;  created_at &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;TIMESTAMP DEFAULT&lt;&#x2F;span&gt;&lt;span&gt; NOW()
&lt;&#x2F;span&gt;&lt;span&gt;);
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;When users update configurations mid-conversation, the Chat Service validates parameters against provider constraints and applies changes to subsequent prompts without affecting in-flight requests.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;4-users-should-be-able-to-create-and-switch-between-multiple-sessions&quot;&gt;4) Users should be able to create and switch between multiple sessions&lt;&#x2F;h3&gt;
&lt;p&gt;Session management requires efficient session listing, context switching, and maintaining session state across WebSocket reconnections.&lt;&#x2F;p&gt;
&lt;p&gt;Session Management Architecture&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Session Router&lt;&#x2F;strong&gt;: Routes WebSocket connections to appropriate Chat Service instances based on session ID, enabling sticky session behavior for connection management.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Session State Recovery&lt;&#x2F;strong&gt;: When clients reconnect or switch sessions:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Authenticate WebSocket connection with session ID&lt;&#x2F;li&gt;
&lt;li&gt;Retrieve last N messages from database for context&lt;&#x2F;li&gt;
&lt;li&gt;Check for any incomplete streaming responses&lt;&#x2F;li&gt;
&lt;li&gt;Resume or restart as appropriate&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;&lt;strong&gt;Efficient session switching:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;javascript&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-javascript &quot;&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span style=&quot;color:#888888;&quot;&gt;&#x2F;&#x2F; Client-side session switching
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;websocket&lt;&#x2F;span&gt;&lt;span&gt;.send({
&lt;&#x2F;span&gt;&lt;span&gt;  type: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;switch_session&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;  new_session_id: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;uuid&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;  resume_from_message: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;last_message_id&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;});
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;potential-deep-dives-1&quot;&gt;Potential Deep Dives&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;1-how-do-we-handle-websocket-connection-reliability-and-session-recovery&quot;&gt;1) How do we handle WebSocket connection reliability and session recovery?&lt;&#x2F;h3&gt;
&lt;p&gt;WebSocket connections are inherently fragile - networks drop, browsers close, mobile apps background. Our system needs robust connection management and seamless recovery.&lt;&#x2F;p&gt;
&lt;h6 id=&quot;approach-heartbeat-and-reconnection&quot;&gt;Approach: Heartbeat and Reconnection&lt;&#x2F;h6&gt;
&lt;p&gt;Implement client-server heartbeating with exponential backoff reconnection. Client sends ping every 30 seconds, server responds with pong. If either side misses 3 consecutive heartbeats, assume connection is dead.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;javascript&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-javascript &quot;&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span style=&quot;color:#888888;&quot;&gt;&#x2F;&#x2F; Client-side connection management
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;class &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;PlaygroundWebSocket &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;connect&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;sessionId&lt;&#x2F;span&gt;&lt;span&gt;) {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;this&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;ws &lt;&#x2F;span&gt;&lt;span&gt;= new &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;WebSocket&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;`&#x2F;sessions&#x2F;${&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;sessionId&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;}&#x2F;chat`&lt;&#x2F;span&gt;&lt;span&gt;);
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;this&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;startHeartbeat&lt;&#x2F;span&gt;&lt;span&gt;();
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;this&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;setupReconnection&lt;&#x2F;span&gt;&lt;span&gt;();
&lt;&#x2F;span&gt;&lt;span&gt;  }
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;startHeartbeat&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;this&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;heartbeat &lt;&#x2F;span&gt;&lt;span&gt;= setInterval(() &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;      &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;this&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;ws&lt;&#x2F;span&gt;&lt;span&gt;.readyState === &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;WebSocket&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;OPEN&lt;&#x2F;span&gt;&lt;span&gt;) {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;this&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;ws&lt;&#x2F;span&gt;&lt;span&gt;.send(JSON.stringify({ type: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;ping&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot; &lt;&#x2F;span&gt;&lt;span&gt;}));
&lt;&#x2F;span&gt;&lt;span&gt;      }
&lt;&#x2F;span&gt;&lt;span&gt;    }, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;30000&lt;&#x2F;span&gt;&lt;span&gt;);
&lt;&#x2F;span&gt;&lt;span&gt;  }
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;setupReconnection&lt;&#x2F;span&gt;&lt;span&gt;() {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;this&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;ws&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;onclose &lt;&#x2F;span&gt;&lt;span&gt;= () &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;=&amp;gt; &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;      &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;this&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;reconnectWithBackoff&lt;&#x2F;span&gt;&lt;span&gt;();
&lt;&#x2F;span&gt;&lt;span&gt;    };
&lt;&#x2F;span&gt;&lt;span&gt;  }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h6 id=&quot;challenges&quot;&gt;Challenges&lt;&#x2F;h6&gt;
&lt;p&gt;Heartbeating adds bandwidth overhead and complexity. Mobile clients may not handle backgrounding gracefully, leading to unnecessary reconnections.&lt;&#x2F;p&gt;
&lt;h6 id=&quot;approach-stateless-recovery-with-message-replay&quot;&gt;Approach: Stateless Recovery with Message Replay&lt;&#x2F;h6&gt;
&lt;p&gt;Store connection state in Redis with TTL. When clients reconnect, they provide their last received message ID, and the server replays any missed messages.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Connection State Storage:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;redis&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-redis &quot;&gt;&lt;code class=&quot;language-redis&quot; data-lang=&quot;redis&quot;&gt;&lt;span&gt;SET connection:{connectionId} {
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;session_id&amp;quot;: &amp;quot;uuid&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;user_id&amp;quot;: &amp;quot;uuid&amp;quot;,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;last_message_sequence&amp;quot;: 42,
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;quot;streaming_message_id&amp;quot;: &amp;quot;uuid&amp;quot; &#x2F;&#x2F; if streaming was interrupted
&lt;&#x2F;span&gt;&lt;span&gt;} EX 3600
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Recovery Protocol:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Client reconnects with last known message sequence&lt;&#x2F;li&gt;
&lt;li&gt;Server queries Redis for connection state&lt;&#x2F;li&gt;
&lt;li&gt;Server replays messages from database where sequence &amp;gt; last_known&lt;&#x2F;li&gt;
&lt;li&gt;If streaming was interrupted, restart from LLM provider or serve cached partial response&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h6 id=&quot;challenges-1&quot;&gt;Challenges&lt;&#x2F;h6&gt;
&lt;p&gt;Redis becomes a single point of failure. Message replay can be expensive for long-lived sessions with extensive history.&lt;&#x2F;p&gt;
&lt;h6 id=&quot;approach-connection-pooling-with-sticky-sessions&quot;&gt;Approach: Connection Pooling with Sticky Sessions&lt;&#x2F;h6&gt;
&lt;p&gt;Use consistent hashing to ensure users consistently connect to the same WebSocket Gateway instance. This enables in-memory connection state without Redis dependency.&lt;&#x2F;p&gt;
&lt;p&gt;Each Gateway instance maintains:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;javascript&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-javascript &quot;&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span style=&quot;color:#888888;&quot;&gt;&#x2F;&#x2F; In-memory connection registry
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;const &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;connections &lt;&#x2F;span&gt;&lt;span&gt;= new &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;Map&lt;&#x2F;span&gt;&lt;span&gt;(); &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;&#x2F;&#x2F; connectionId -&amp;gt; WebSocketConnection
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;const &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;sessionConnections &lt;&#x2F;span&gt;&lt;span&gt;= new &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;Map&lt;&#x2F;span&gt;&lt;span&gt;(); &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;&#x2F;&#x2F; sessionId -&amp;gt; Set&amp;lt;connectionId&amp;gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Load balancer uses consistent hashing on session ID to route WebSocket upgrade requests to the same Gateway instance.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Benefits&lt;&#x2F;strong&gt;: No external dependencies, faster connection recovery, simpler debugging.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Trade-offs&lt;&#x2F;strong&gt;: Gateway failures lose all connection state, requiring clients to reconnect and replay from database.&lt;&#x2F;p&gt;
&lt;p&gt;For our scale (50k concurrent users), consistent hashing with 10-20 Gateway instances provides good balance of reliability and simplicity.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;2-how-do-we-handle-llm-provider-failures-and-rate-limiting&quot;&gt;2) How do we handle LLM provider failures and rate limiting?&lt;&#x2F;h3&gt;
&lt;p&gt;External LLM providers have API limits, experience outages, and may return errors. Our system needs graceful degradation and retry strategies.&lt;&#x2F;p&gt;
&lt;h6 id=&quot;pattern-external-service-integration&quot;&gt;Pattern: External Service Integration&lt;&#x2F;h6&gt;
&lt;p&gt;LLM provider integration demonstrates classic &lt;strong&gt;external service integration&lt;&#x2F;strong&gt; challenges including rate limiting, circuit breaking, and graceful degradation when dependencies fail.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Circuit Breaker Pattern:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;class &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;LLMProviderClient&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;__init__&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.circuit_breaker = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;CircuitBreaker&lt;&#x2F;span&gt;&lt;span&gt;(
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;failure_threshold&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;5&lt;&#x2F;span&gt;&lt;span&gt;,  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# failures before opening
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;recovery_timeout&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;60&lt;&#x2F;span&gt;&lt;span&gt;,  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# seconds before trying again
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;expected_exception&lt;&#x2F;span&gt;&lt;span&gt;=LLMProviderError
&lt;&#x2F;span&gt;&lt;span&gt;        )
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    @&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;circuit_breaker
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;stream_completion&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;prompt&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;config&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# Call external LLM provider
&lt;&#x2F;span&gt;&lt;span&gt;        response = requests.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;post&lt;&#x2F;span&gt;&lt;span&gt;(
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;f&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;{provider_url}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;&#x2F;completions&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;json&lt;&#x2F;span&gt;&lt;span&gt;={&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;prompt&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: prompt, **config},
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;stream&lt;&#x2F;span&gt;&lt;span&gt;=True,
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;timeout&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;30
&lt;&#x2F;span&gt;&lt;span&gt;        )
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;chunk &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;in &lt;&#x2F;span&gt;&lt;span&gt;response.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;iter_content&lt;&#x2F;span&gt;&lt;span&gt;():
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;yield &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;parse_token&lt;&#x2F;span&gt;&lt;span&gt;(chunk)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Provider Rate Limiting:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Implement token bucket rate limiting per API key:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;class &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;RateLimiter&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;__init__&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;requests_per_minute&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;1000&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.bucket = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;TokenBucket&lt;&#x2F;span&gt;&lt;span&gt;(
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;capacity&lt;&#x2F;span&gt;&lt;span&gt;=requests_per_minute,
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;refill_rate&lt;&#x2F;span&gt;&lt;span&gt;=requests_per_minute &#x2F; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;60
&lt;&#x2F;span&gt;&lt;span&gt;        )
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;async def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;acquire&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;not &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.bucket.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;consume&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;raise &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;RateLimitExceeded&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;Provider rate limit exceeded&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Graceful Degradation Strategies:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Cached Responses&lt;&#x2F;strong&gt;: For identical prompts with deterministic settings (temperature=0), serve cached responses&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Fallback Providers&lt;&#x2F;strong&gt;: Route to secondary LLM provider when primary fails&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Queue with SLA&lt;&#x2F;strong&gt;: Buffer requests for up to 10 seconds during provider issues&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;User Communication&lt;&#x2F;strong&gt;: Send clear error messages explaining delays&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;3-how-do-we-scale-to-handle-50-000-concurrent-websocket-connections&quot;&gt;3) How do we scale to handle 50,000 concurrent WebSocket connections?&lt;&#x2F;h3&gt;
&lt;p&gt;WebSocket connections are stateful and memory-intensive. Scaling requires careful resource management and connection distribution.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Connection Capacity Planning:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Each WebSocket connection consumes approximately:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;8KB TCP buffers (send&#x2F;receive)&lt;&#x2F;li&gt;
&lt;li&gt;2KB application state (user ID, session ID, last message tracking)&lt;&#x2F;li&gt;
&lt;li&gt;1KB average message buffer for streaming&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Total: ~11KB per connection × 50,000 = 550MB per Gateway instance.&lt;&#x2F;p&gt;
&lt;p&gt;With modern servers having 32GB+ RAM, a single Gateway instance can handle 50k connections, but we&#x27;ll use multiple instances for fault tolerance.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Scaling Architecture:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Gateway Scaling&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;WebSocket Gateway Scaling:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Deploy 5 Gateway instances behind L4 load balancer&lt;&#x2F;li&gt;
&lt;li&gt;Each handles 10k connections (plenty of headroom)&lt;&#x2F;li&gt;
&lt;li&gt;Use consistent hashing on session ID for sticky routing&lt;&#x2F;li&gt;
&lt;li&gt;Auto-scale based on connection count metrics&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Chat Service Scaling:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Stateless horizontal scaling based on CPU&#x2F;memory usage&lt;&#x2F;li&gt;
&lt;li&gt;Queue depth monitoring for LLM provider calls&lt;&#x2F;li&gt;
&lt;li&gt;Circuit breaker integration prevents cascade failures&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Database Connection Pooling:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;With 5k prompts&#x2F;second peak, database connections become critical:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# Connection pool configuration
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;DATABASE_POOL &lt;&#x2F;span&gt;&lt;span&gt;= {
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;min_connections&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;10&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;max_connections&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;100&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;connection_timeout&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;30&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;idle_timeout&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;300
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;PostgreSQL Scaling Strategy:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Primary for writes (session creation, message persistence)&lt;&#x2F;li&gt;
&lt;li&gt;Read replicas for conversation history retrieval&lt;&#x2F;li&gt;
&lt;li&gt;Partition messages table by session_id hash for write distribution&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;4-how-do-we-ensure-data-consistency-and-handle-partial-failures&quot;&gt;4) How do we ensure data consistency and handle partial failures?&lt;&#x2F;h3&gt;
&lt;p&gt;Distributed systems create opportunities for partial failures where some operations succeed while others fail, potentially leaving the system in inconsistent state.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Message Persistence Consistency:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The critical consistency challenge occurs during streaming: what happens if we successfully start streaming to the client but fail to persist the complete response?&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Write-Ahead Logging with Compensation:&lt;&#x2F;strong&gt; Before starting LLM call, write message intent to database with PENDING status. Stream to client while buffering complete response. Then atomically update intent to COMPLETED and insert complete message in single transaction. Background cleanup job identifies stale PENDING intents and handles recovery.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Idempotency for Duplicate Prompts:&lt;&#x2F;strong&gt; Clients may retry prompts during network issues. Implement idempotency using client-generated message IDs. Check for existing messages with same ID before processing and return cached responses for duplicates.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Session State Consistency:&lt;&#x2F;strong&gt; Configuration updates during active streaming create race conditions. Use optimistic locking with version numbers on session configuration. Update operations include version checks and fail if concurrent modifications occurred.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;distribute-ml-models-in-a-data-center&quot;&gt;Distribute ML models in a Data Center&lt;&#x2F;h1&gt;
&lt;h2 id=&quot;p2p&quot;&gt;P2P&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;So it seems like one machine should download the model and distribute it to other machines.&lt;&#x2F;li&gt;
&lt;li&gt;This looks suspiciously like p2p torrenting so I am going to approach it similarly.&lt;&#x2F;li&gt;
&lt;li&gt;Machine 1 has to download the ML model fully. Then it should chunk it in let&#x27;s say 4 mb chunks. Each chunk is SHA1 hashed and this machine keeps tracks of the chunks and the hashes associated with it. Let&#x27;s call this the seed machine.&lt;&#x2F;li&gt;
&lt;li&gt;The seed machine communicates with other machines telling there&#x27;s a ML model to be downloaded. Since these machines are in the same DC, they know each other&#x27;s IPs. We will have a dedicated gRPC server and client on each machine for the purpose of downloading ML models. So the seed machine starts by distributing the manifest to each of the machines.&lt;&#x2F;li&gt;
&lt;li&gt;The other machines then start downloading the chunks. The very first sets of chunks are downloaded from the seed machine.&lt;&#x2F;li&gt;
&lt;li&gt;Each machine periodically gossips with a few random peers to learn who has what chunks. When a machine needs a specific chunk, it picks a peer that has it (from its gossip knowledge) and downloads directly via gRPC.&lt;&#x2F;li&gt;
&lt;li&gt;Eventually at some time, all the machines have all the chunks, and they can validate they indeed have that because each has a copy of the manifest file.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;The trade off between gossip versus having some central tracker:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;network overhead in gossip, while with a central tracker, one can make efficient queries.&lt;&#x2F;li&gt;
&lt;li&gt;gossip protocol is self-healing, while a central tracker is a single point of failure.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Pros: potentially fast due to parallelism. inherent fault tolerance: multiple sources for each chunk. scalable, work from 10 to 10_000 machines.&lt;&#x2F;p&gt;
&lt;p&gt;Cons: Complex coordination (gossip, central tracker), unpredictable timing.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;tree&quot;&gt;Tree&lt;&#x2F;h2&gt;
&lt;p&gt;If we know there are exactly N machines, then scaling is not important and maybe controlled behaviour is.
Each machine can pass the model to exactly one other machine in each round. So:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Machine 1 -&amp;gt; Machine 2&lt;&#x2F;li&gt;
&lt;li&gt;Machine 1 -&amp;gt; Machine 3, Machine 2 -&amp;gt; Machine 4&lt;&#x2F;li&gt;
&lt;li&gt;Machine 1 -&amp;gt; Machine 5, Machine 2 -&amp;gt; Machine 6, Machine 3 -&amp;gt; Machine 7, Machine 4 -&amp;gt; Machine 8&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;For N machines, the number of rounds we will have is log2(N). For 100, that&#x27;s at least 7 rounds.
Pros: There&#x27;s no complex discovery here, and bandwith usage is optimal - each round, for a machine, it&#x27;s committed to 100% upload or 100% download. Predictable timing and progress tracking.&lt;&#x2F;p&gt;
&lt;p&gt;Cons: half the machines are idle in each round. If one node fails, sub tree fails. Load imbalance: Early nodes (closer to root) work harder than leaf nodes.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;hybrid&quot;&gt;Hybrid&lt;&#x2F;h2&gt;
&lt;p&gt;Tree approach for first few nodes, then P2P file transfer for stragglers or failures.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;spotify-top-k&quot;&gt;Spotify Top-K&lt;&#x2F;h1&gt;
&lt;p&gt;Functional Requirements&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Real time Top K songs for all users.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Non-functional&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Real time - low latency.&lt;&#x2F;li&gt;
&lt;li&gt;Availability over consistency over all&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;data-flow-2&quot;&gt;Data flow&lt;&#x2F;h2&gt;
&lt;p&gt;Naive:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Cassadandra for write heavy system, to store analytics.
&lt;ul&gt;
&lt;li&gt;Cassandra has CDC that writes to a commit log, files on disk.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;CDC into OLAP (a dataware house, maybe clickhouse).
&lt;ul&gt;
&lt;li&gt;You must build a service that parses the commit logs and push changes to OLAP.&lt;&#x2F;li&gt;
&lt;li&gt;Could even be Kafka.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Followed by hourly map reduce workers to compute states.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;It&#x27;s naive because it&#x27;s not realtime. At least you diffeentiated between OLTP and OLAP.&lt;&#x2F;p&gt;
&lt;p&gt;Better:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;User plays song -&amp;gt; Analytics service collects info. -&amp;gt; pushes this into Kafka.
&lt;ul&gt;
&lt;li&gt;Save the song id, the user id, the timestamp.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Stream processor like flink or Spark Streams consumes it in windows.
&lt;ul&gt;
&lt;li&gt;Pull the above data from kafka.&lt;&#x2F;li&gt;
&lt;li&gt;Aggregate the counts every minute or 5 minutes.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;fb-live-comments&quot;&gt;FB Live comments&lt;&#x2F;h1&gt;
&lt;p&gt;High Level Data Flow&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;User has a post id. He uses that to post a comment.&lt;&#x2F;li&gt;
&lt;li&gt;The comment is processed by a CommentService, which
makes an entry in a db. The db records the user id,
comment id, post id, and timestamp.&lt;&#x2F;li&gt;
&lt;li&gt;This comment is then made available to all users via
an SSE connection established by the clients
&lt;ul&gt;
&lt;li&gt;The client establishes the SSE GET request. The
service keeps the connection open and continuously
sends data to the client.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;The service keeps track of a few things:
&lt;ul&gt;
&lt;li&gt;The user id&#x2F;session id and the specific TCP connection object.&lt;&#x2F;li&gt;
&lt;li&gt;The user id and the post id the user is listening to.&lt;&#x2F;li&gt;
&lt;li&gt;Comments for a post id.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;So when a comment comes in, a service should publish this comment
to everyone who is subscribing to a post. So a pub&#x2F;sub is the means
of routing comments.&lt;&#x2F;li&gt;
&lt;li&gt;We can use a Redis pub&#x2F;sub (since Redis will push, fire once and forget)
and is fast. When a comment is posted, it&#x27;s published to Redis, which
maps a post id to the user id&#x2F;connection. An SSE service manages the SSE
connections, and listens to Redis channels.
&lt;ul&gt;
&lt;li&gt;The service subscribes to various channels based on the what the user
connections it&#x27;s managing are interested in. It receives corresponding
messages, iterates though its in-memory list of active connections
and sends messages to those users.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>System Design 1</title>
        <published>2025-08-31T00:00:00+00:00</published>
        <updated>2025-08-31T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/sys-des-1/"/>
        <id>https://asun9.com/notes/sys-des-1/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/sys-des-1/">&lt;h1 id=&quot;design-stripe&quot;&gt;Design Stripe&lt;&#x2F;h1&gt;
&lt;h2 id=&quot;requirements&quot;&gt;Requirements&lt;&#x2F;h2&gt;
&lt;p&gt;Functional Requirements:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Merchant can request payment&lt;&#x2F;li&gt;
&lt;li&gt;Users should be able to make payment.&lt;&#x2F;li&gt;
&lt;li&gt;Merchant (and user) must be able to view status update - pending, completed etc&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Non-functional requirements:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;highly secure&lt;&#x2F;li&gt;
&lt;li&gt;no data loss, even on failure.&lt;&#x2F;li&gt;
&lt;li&gt;gurantee transaction and hence financial safety.&lt;&#x2F;li&gt;
&lt;li&gt;high, bursty volume (10k qps?)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;core-entities&quot;&gt;Core Entities&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Merchant&lt;&#x2F;li&gt;
&lt;li&gt;Intent
What&#x27;s being asked and delivered, how much etc.&lt;&#x2F;li&gt;
&lt;li&gt;Transaction
&lt;ul&gt;
&lt;li&gt;Record of money movement - charges, refunds, payout. disputes.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Merchant -&amp;gt; Intent -&amp;gt; Transaction Record
If transaction failed, merchat will keep trying with the Intent ID.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;api&quot;&gt;API&lt;&#x2F;h2&gt;
&lt;p&gt;Merchant creates an intent that will used for payment&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;POST&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;payment-intent -&amp;gt; intentId
&lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;amount&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; 1234, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;currency&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;dollar&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;description&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;shoes&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;POST&lt;&#x2F;span&gt;&lt;span&gt; transaction&#x2F;{intentId}
&lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;name&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;John Doe&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;card&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;1234..&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;(instead of send these over REST, we will first create a jwt token - that&#x27;s for security)&lt;&#x2F;p&gt;
&lt;p&gt;Now check status of transaction&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;GET&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;payment-intent&#x2F;{intentID}
&lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;status&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;PENDING&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;system-design&quot;&gt;System Design&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;merchant-makes-a-request-for-payment&quot;&gt;Merchant makes a request for payment&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Merchant -&amp;gt; API Gateway (load balancing, authentication, rate limiting, routes requests to the right microservice ...) -&amp;gt; paymentIntentService -&amp;gt; metadataDB (create intent record - id, merchand id, customer id, status, amount, product.)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;users-pay-for-product&quot;&gt;Users pay for product&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Collect payment details from customer.&lt;&#x2F;li&gt;
&lt;li&gt;On the merchant website, the user enters their card details.&lt;&#x2F;li&gt;
&lt;li&gt;The merchant, with intendId, initiates a transaction. Transaction service takes over - dealts with external banking system, while making entries in the DB.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;merchant-and-user-status-updates&quot;&gt;Merchant and User status updates&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Transaction service get call, with look up on the same db.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;system-design-scaling&quot;&gt;System Design Scaling&lt;&#x2F;h2&gt;
&lt;p&gt;So focus areas: security, transaction volume, durability - no loss of records.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;security&quot;&gt;Security&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;Is the person why they say they are (i.e merchant)&lt;&#x2F;li&gt;
&lt;li&gt;Are we saving and keeping encrypted the customer details?&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;For (1) -&amp;gt; Generate API keys, associated with a merchant when they sign up. Each transaction should pass this API key in headers (like so: &lt;code&gt;Authorization: Bearer {api_key}&lt;&#x2F;code&gt;). This will be the public key. They will be given a secret key that can use used to generate a unique nonce at the time of transaction, along with a signature and timestamp to validate.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;&#x2F;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt; Example request with signature
&lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;method&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;POST&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;path&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;&#x2F;payment-intents&#x2F;{paymentIntentId}&#x2F;transactions&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;body&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;: &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;    &#x2F;&#x2F; body here
&lt;&#x2F;span&gt;&lt;span&gt;  },
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;headers&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;: &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;Authorization&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;Bearer pk_live_51NzQRtGswQnXYZ8o&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, &#x2F;&#x2F; API Key
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;X-Request-Timestamp&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;2023-10-15T14:22:31Z&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, &#x2F;&#x2F; Timestamp
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;X-Request-Nonce&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;a1b2c3d4-e5f6-7890-abcd-ef1234567890&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, &#x2F;&#x2F; Nonce
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;X-Signature&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;sha256=7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;&#x2F; Hash of body
&lt;&#x2F;span&gt;&lt;span&gt;  }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;For (2) -&amp;gt; client info should never hit merchant server. Provide a javascript sdk that within an iframe, loads our server domain (stripe&#x27;s, other providers) where they can enter card details. This is then sent directly to our server. We encrypt this on client machine of course, with a public key. On our servers, with associated private key, we decrypt. HTTPS provides the transport and security layer.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;durability&quot;&gt;Durability&lt;&#x2F;h3&gt;
&lt;blockquote&gt;
&lt;p&gt;We need to track not just what the current state is, but the entire sequence of events that led to that state. When a customer disputes a charge six months later, we must be able to prove exactly what happened: when the payment was initiated, what amount was authorized, when it was captured, and whether any refunds were processed. A single missing record could mean inability to defend against chargebacks, failed compliance audits, or worse—being unable to determine the true state of customer accounts.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;So how?
Separate operation concerns from audit concerns.&lt;&#x2F;p&gt;
&lt;p&gt;Operations -&amp;gt; MetadataDB.
Audit -&amp;gt; CDC on the metadatadb, which publishes data to a Kafka queue. Differnt subscribers will consume event stream and make entries in differnt audit tables.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;For durability, Kafka provides configurable replication (typically 3x) across multiple brokers and availability zones. Events are retained for a configurable period (often 7-30 days) on disk, with older events archived to object storage for permanent retention. All events are automatically flushed to S3 for long-term auditability, ensuring we can reconstruct any payment&#x27;s complete history even years later for compliance audits or dispute resolution. This gives us both hot data for operational use and cold storage for compliance.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;transaction-volume&quot;&gt;Transaction Volume&lt;&#x2F;h3&gt;
&lt;p&gt;Event log, Kafka:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;We are expecting ~10k tps. While Kafka can support millions of messages per second at the cluster level, it&#x27;s important to note that each individual partition typically handles around 5,000-10,000 messages per second under normal production conditions. To comfortably support our 10k TPS requirement, we&#x27;d need multiple partitions—likely 3-5—to ensure both throughput and fault tolerance.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;With 10k TPS for our event stream, we can expect around 10k writes per second to our database as well. This is right on the edge of what a well-optimized PostgreSQL instance can handle this load, especially when combined with read replicas and proper indexing. To better handle the scale, we can shard our database by merchant_id.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;With regards to data growth, we can estimate that each row is ~500 bytes. This means we are storing 10,000 _ 500 bytes = 5mb of data a second, 5mb _ 100,000 (rounded seconds in a day) = 500gb of data a day, and 500gb * 365 = ~180tb of data a year. This is significant storage growth that will require careful planning for data retention and archiving strategies.
For transactions older than a certain period (e.g., 3-6 months), we can move them to cold storage like Amazon S3 or Google Cloud Storage.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;For read scaling, we can implement read replicas of our database. Most payment queries are read operations (checking payment status, generating reports), so having multiple read replicas will distribute this load.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h1 id=&quot;design-whatsapp&quot;&gt;Design Whatsapp&lt;&#x2F;h1&gt;
&lt;h2 id=&quot;requirements-1&quot;&gt;Requirements&lt;&#x2F;h2&gt;
&lt;p&gt;Functional:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;User should be able to send&#x2F;receive 1:1 message&lt;&#x2F;li&gt;
&lt;li&gt;User should be able to create groups.&lt;&#x2F;li&gt;
&lt;li&gt;User should be able to send media.&lt;&#x2F;li&gt;
&lt;li&gt;Messages should be able to receive message if they are not online.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Non-functional:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Less than 500ms latency wehn receiving a message.&lt;&#x2F;li&gt;
&lt;li&gt;Scale - support a billion users&lt;&#x2F;li&gt;
&lt;li&gt;Gurantee messages are delivered.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Out of line:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Security&lt;&#x2F;li&gt;
&lt;li&gt;Spam&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;entities&quot;&gt;Entities&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;User: Details about the number, name, last online status.&lt;&#x2F;li&gt;
&lt;li&gt;Message: content of message, from and to whom&#x2F;what&lt;&#x2F;li&gt;
&lt;li&gt;Group: Participant list, admin&lt;&#x2F;li&gt;
&lt;li&gt;Media: associated with a message&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;(hello interivew: users, chat (same as group) , messages, clients (multiple devices))&lt;&#x2F;p&gt;
&lt;h2 id=&quot;api-1&quot;&gt;API&lt;&#x2F;h2&gt;
&lt;p&gt;Sockets: sendMessage&lt;&#x2F;p&gt;
&lt;h2 id=&quot;high-level-system-design&quot;&gt;High Level System Design&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;deep-dives&quot;&gt;Deep Dives&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;design-a-local-delivery-service&quot;&gt;Design a Local Delivery Service&lt;&#x2F;h1&gt;
&lt;p&gt;Like Uber Eats. Or Rapido.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;requirements-2&quot;&gt;Requirements&lt;&#x2F;h2&gt;
&lt;p&gt;Function:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Customers can search for items available for delivery within 1 hour&lt;&#x2F;li&gt;
&lt;li&gt;Order by location&lt;&#x2F;li&gt;
&lt;li&gt;Customers can order multiple items&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Out of scope:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Driver matching&lt;&#x2F;li&gt;
&lt;li&gt;Payments&lt;&#x2F;li&gt;
&lt;li&gt;Cancellations&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Non-functional:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Availablility: search should be fast&lt;&#x2F;li&gt;
&lt;li&gt;Ordering: Two customers should not place requests on the same product id.&lt;&#x2F;li&gt;
&lt;li&gt;Volume: 10m&#x2F;day&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;entities-1&quot;&gt;Entities&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;Product.&lt;&#x2F;li&gt;
&lt;li&gt;Distribution Center.&lt;&#x2F;li&gt;
&lt;li&gt;Order.&lt;&#x2F;li&gt;
&lt;li&gt;Inventory? where a product is located, physically.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;apis&quot;&gt;APIs&lt;&#x2F;h2&gt;
&lt;p&gt;The user facing apis are really: check availability, then order product.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Check availability&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;GET&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;availability?lat={}&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;long&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;{}&amp;amp;keyword={}&amp;amp;page_size=10&amp;amp;page_num={} &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;items: &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;    name: NAME,
&lt;&#x2F;span&gt;&lt;span&gt;    quanitity: QUANTITY
&lt;&#x2F;span&gt;&lt;span&gt; }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;Order&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;POST&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;order -&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;lat:&lt;&#x2F;span&gt;&lt;span&gt; LAT, long: LONG, items: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span&gt;item1, item2...&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;]
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;high-level-system-design-1&quot;&gt;High Level System Design&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;Customers should be able to query availability of items: a db search. First search for locations in via postgis maybe, then given a list of dcs search for product in those dcs.&lt;&#x2F;li&gt;
&lt;li&gt;Customers order item. Strong consistency here to ensure two people don&#x27;t order the same item. &quot;By putting both orders and inventory in the same database, we can take advantage of the ACID properties of our Postgres database. Using a singular transaction with isolation level SERIALIZABLE we can ensure that the entire transaction is atomic. This means that if two users try to order the same item at the same time, one of them will be rejected.&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;deep-dives-1&quot;&gt;Deep Dives&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;How do we make the look ups fast? PostGIS index. Use time to to estimate traffic, or use an external service.&lt;&#x2F;li&gt;
&lt;li&gt;And what else? Scaling reads: Use cache, use read replicas to distribute load. &quot;Our orders need to be strongly consistent, so those transactions need to be sent to the Postgres leader, but our availability queries can go to our read replicas.&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h1 id=&quot;design-a-price-tracking-service&quot;&gt;Design a Price Tracking Service&lt;&#x2F;h1&gt;
&lt;p&gt;A price tracking service that monitors Amazon product prices over time and alerts users when prices drop below their specified thresholds.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;requirements-3&quot;&gt;Requirements&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Functional&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;For an amazon product, users should be able to see it&#x27;s price history.&lt;&#x2F;li&gt;
&lt;li&gt;Users should be able to subscribe to notifications when prices drop.&lt;&#x2F;li&gt;
&lt;li&gt;(below the line) Search for amazon products.&lt;&#x2F;li&gt;
&lt;li&gt;(below the line) product reviews and ratings.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Non-functional&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Availability over consistency: users should always be able to see some price, even if it&#x27;s not the latest price.&lt;&#x2F;li&gt;
&lt;li&gt;Notification latency: &amp;lt; 1 hour once price drops to notifying the user about it.&lt;&#x2F;li&gt;
&lt;li&gt;Price history query in &amp;lt; 500 ms.&lt;&#x2F;li&gt;
&lt;li&gt;Search amazon catalog of over 500 million items.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;entities-2&quot;&gt;Entities&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;User: interested in products, credit card on file, who has to be notified.&lt;&#x2F;li&gt;
&lt;li&gt;Product: with it&#x27;s price history.&lt;&#x2F;li&gt;
&lt;li&gt;Subscription: Link users and products.&lt;&#x2F;li&gt;
&lt;li&gt;Price: price history associated with products.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;apis-1&quot;&gt;APIs&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;Query for product price (search is below scope)&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;GET&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;products&#x2F;{productID}&#x2F;price?period=10d&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;granularity&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;hourly &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; priceHistory&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;[]
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;Subscribe for notification&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;POST&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;subscription
&lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;productID,
&lt;&#x2F;span&gt;&lt;span&gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;priceThreshold,
&lt;&#x2F;span&gt;&lt;span&gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;notificationType
&lt;&#x2F;span&gt;&lt;span&gt;} -&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;200
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;high-level-system-design-2&quot;&gt;High Level System Design&lt;&#x2F;h2&gt;
&lt;p&gt;This is the data flow:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;we have a crawler that crawls amazon on a schedule and updates a db with prices.&lt;&#x2F;li&gt;
&lt;li&gt;The user requests the latest price for a product, or it&#x27;s history, and we show them this information.&lt;&#x2F;li&gt;
&lt;li&gt;For a product, the user will subscribe to be notified on a price drop.&lt;&#x2F;li&gt;
&lt;li&gt;For each product, we have a queue of subscribers with different price points, and we notify them whenever the cralwer brings in a new and price and it&#x27;s below the desired threshold. We expire this once the price drops for a user.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Two tables with two different characteristics to organize the data:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;A time series db, append only, for price info.&lt;&#x2F;li&gt;
&lt;li&gt;A db with product info and metadata.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;When a user subscribes, an entry is made in the db recording the details of the product and the desired price threshold.&lt;&#x2F;p&gt;
&lt;p&gt;The simplest system is a cron that that checks the db every hour and notifies all the users.&lt;&#x2F;p&gt;
&lt;figure style=&quot;text-align:center;&quot;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;sys-design&#x2F;price-tracker-high-level.svg&quot;
       alt=&quot;Price Tracker&quot;
       class=&quot;center&quot;
       style=&quot;max-height: 600px; width: auto; pointer-events: none;&quot;&gt;
  &lt;figcaption&gt;Price Tracker&lt;&#x2F;figcaption&gt;
  
&lt;&#x2F;figure&gt;
&lt;h2 id=&quot;deep-dive&quot;&gt;Deep Dive&lt;&#x2F;h2&gt;
&lt;p&gt;The above the is the simplest system that does the work. There are issues, for example, each notification is preceded by a table scale, which is slow.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;1-how-do-we-efficiently-discover-and-track-500-million-amazon-products&quot;&gt;1. How do we efficiently discover and track 500 million amazon products?&lt;&#x2F;h3&gt;
&lt;p&gt;Amazon has rate limits - let&#x27;s say 1 crawl&#x2F;sec per IP. So crawling all the products is out of question. Solutions are:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;ol&gt;
&lt;li&gt;Prioritize a few products based on use (most things follow pareto distribution.)&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;ul&gt;
&lt;li&gt;Maintain different queues - high, medium, and low, based on product priority. Assign a priority score based on user interest, and factors such as products changing price rapidly.&lt;&#x2F;li&gt;
&lt;li&gt;Primary disadvantage is new product discovery - we can&#x27;t here before it gets popular.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;Make use of existing distribution channel for product discover - the chrome plug in with 1 million users. When they browse product catalogs, track them and these are the prices we track.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;2-how-do-we-efficiently-notify-users-of-price-changes&quot;&gt;2. How do we efficiently notify users of price changes?&lt;&#x2F;h3&gt;
&lt;p&gt;Our NFR is letting users know within an hour for price changes. Table scans will not cut it. Some ways to do this more efficiently are:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Instead of tracking changes every few hours via cron job, we can create a notification delivery event as soon as a price changes. Example, on the price db, set up a change data capture service, so it automatically publishes events, which are sent to kafka. &quot;Our notification service subscribes to these events and immediately queries the subscriptions table to find affected users.&quot;&lt;&#x2F;li&gt;
&lt;li&gt;Or the crawler writes to the kafka queue immediately, and the notification service proces the product id or drops it.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h1 id=&quot;design-a-bookseller-platform&quot;&gt;Design a Bookseller Platform&lt;&#x2F;h1&gt;
&lt;p&gt;A service where users can submit book purchase requests with details such as customer information, book info, maximum price willing to pay, and payment information. The service should check with registered book sellers to find books priced at or below the maximum price. It should place a buy request with the seller offering the minimum price within the customer&#x27;s limit. The design should include APIs for book seller registration and adapt to various seller APIs, supporting up to 10,000 queries per second.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;requirements-4&quot;&gt;Requirements&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;functional&quot;&gt;Functional&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Customers submit book purchase requests.&lt;&#x2F;li&gt;
&lt;li&gt;Book sellers can register with service.&lt;&#x2F;li&gt;
&lt;li&gt;Service makes a purchase order satisfying customer&#x27;s request with seller.&lt;&#x2F;li&gt;
&lt;li&gt;Service supports seller&#x27;s adaptable APIs.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Out of scope:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Invoice, order management.&lt;&#x2F;li&gt;
&lt;li&gt;Delivery.&lt;&#x2F;li&gt;
&lt;li&gt;Reccomendations.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;non-functional&quot;&gt;Non-functional&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;10k qps for customer service request.&lt;&#x2F;li&gt;
&lt;li&gt;availability over consistency - make a purchase reqeust over the best purchase request imediately.&lt;&#x2F;li&gt;
&lt;li&gt;System should respond to request in &amp;lt; 2 seconds.&lt;&#x2F;li&gt;
&lt;li&gt;Security: transaction for payments.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;entities-data-model&quot;&gt;Entities&#x2F;Data Model&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;Customer&lt;&#x2F;li&gt;
&lt;li&gt;Seller&lt;&#x2F;li&gt;
&lt;li&gt;Purchase Request&lt;&#x2F;li&gt;
&lt;li&gt;Order&lt;&#x2F;li&gt;
&lt;li&gt;Quotes: different sellers&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;apis-2&quot;&gt;APIs&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;make book purchase request&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;POST&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;v1&#x2F;purchase -&amp;gt; requestId
&lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;customer_id: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;xxx&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;details&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;: &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;isbn&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;...&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;title&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;...&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;    },
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;max_price:&lt;&#x2F;span&gt;&lt;span&gt; 20.00
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;currency:&lt;&#x2F;span&gt;&lt;span&gt; USD
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;Register book seller&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;POST&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;v1&#x2F;register -&amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;200
&lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;seller_id&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;xxx&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;api_config&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;: &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;base_url&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;...&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;auth_type&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;api_key&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;endpoints&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: {
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;search&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;&#x2F;search&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;purchase&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;&#x2F;purchase&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;  }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;Check status?&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;GET&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;v1&#x2F;purchase&#x2F;{requestId}&#x2F;status
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;high-level-design&quot;&gt;High Level Design&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;Customer submits a purchase request.&lt;&#x2F;li&gt;
&lt;li&gt;Our platform queries all the sellers for that books.&lt;&#x2F;li&gt;
&lt;li&gt;Orders the sellers by prices and picks the first one lesser than or at the customer&#x27;s desired price.&lt;&#x2F;li&gt;
&lt;li&gt;Make a purchase request via the seller&#x27;s API&lt;&#x2F;li&gt;
&lt;li&gt;system processes payment and confirms order.&lt;&#x2F;li&gt;
&lt;li&gt;Communicates purchase order&#x2F;request.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;There are two different API layers:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Customer facing&lt;&#x2F;li&gt;
&lt;li&gt;Seller facing&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;simplest-dataflow-is-as-follows&quot;&gt;Simplest dataflow is as follows&lt;&#x2F;h3&gt;
&lt;p&gt;When customer makes a request: User -&amp;gt; API Gateway -&amp;gt; purchaseRequestService -&amp;gt; make record in DB -&amp;gt; search seller APIs and aggregate them -&amp;gt; pick the item that matches -&amp;gt; make another db record -&amp;gt; transaction processing.&lt;&#x2F;p&gt;
&lt;p&gt;Seller registers: Seller -&amp;gt; API Gateway -&amp;gt; registerService -&amp;gt; make record in db
The seller is given a key that is used when communicating.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;deep-dives-2&quot;&gt;Deep Dives&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;1-how-to-handle-scale-10k-qps&quot;&gt;1. How to handle scale 10k qps?&lt;&#x2F;h3&gt;
&lt;p&gt;Use Dynamo DB. There&#x27;s not complex relationships, all look ups based on key, which can be request id, or seller id, or order id. single millisecond response time. There are also no strong consistency requirements - so Postgres is an overkill.&lt;&#x2F;p&gt;
&lt;p&gt;The partition key for dynamo db will be request key, sort key can be customer id&lt;&#x2F;p&gt;
&lt;p&gt;To handle scale, even larger ones, for things like bursty traffic, use SQS queue for seller (and customer) calls. You want to make seller API requests in parallel - hence the queue with a separate worker for each API (or use async within the main service).&lt;&#x2F;p&gt;
&lt;p&gt;Further, we can also cache seller api configuration, seller api responses.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;2-how-to-handle-security&quot;&gt;2. How to handle security?&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Customer info never reaches sellers.&lt;&#x2F;li&gt;
&lt;li&gt;Sellers, when they register, create RSA key pair. We have the public key. They have the private key.&lt;&#x2F;li&gt;
&lt;li&gt;When we make an order on behalf of customer, we hold the money. We transfer the money to the seller.&lt;&#x2F;li&gt;
&lt;li&gt;We create a payment token to the seller, encrypted with the public key. The seller uses their private key to decrypt and approve the transaction, confirm the purchase has been made.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;3-how-to-ensure-2-second-response-time-with-multiple-sellers&quot;&gt;3. How to ensure 2 second response time with multiple sellers?&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Use async and gather results, with aggresive timeouts. Use connection pooling.&lt;&#x2F;li&gt;
&lt;li&gt;Keep seller priority internally based on historic response times.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;4-how-to-handle-different-seller-apis&quot;&gt;4. How to handle different seller APIs?&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;We want to offer a configuration where sellers can adapt their APIs.&lt;&#x2F;li&gt;
&lt;li&gt;Maintain adapter versions for different sellers, graceful fallback between different versions.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;design-a-hierarchical-distributed-file-system-design&quot;&gt;Design a Hierarchical Distributed File System Design&lt;&#x2F;h1&gt;
&lt;p&gt;Design a hierarchical distributed file system where customers can store an arbitrary number of files and directories, nested recursively. Files should be immutable once created, while directories must be mutable to allow creating and deleting files and subdirectories. Implement APIs for file retrieval, storage, directory creation, listing, and deletion. The system should support hundreds of petabytes of storage for thousands of Databricks customers, operating within a single region and data center. Existing distributed storage systems cannot be reused, but single machine filesystems, databases, and KV stores can be utilized.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;requirements-5&quot;&gt;Requirements&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;functional-1&quot;&gt;Functional&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Core
&lt;ul&gt;
&lt;li&gt;Store arbitrary number of files and directories with recursive nesting&lt;&#x2F;li&gt;
&lt;li&gt;Files are immutable once created (write-once, read-many)&lt;&#x2F;li&gt;
&lt;li&gt;Directories are mutable (create&#x2F;delete files and subdirectories)&lt;&#x2F;li&gt;
&lt;li&gt;Support file retrieval, storage, directory creation, listing, and deletion&lt;&#x2F;li&gt;
&lt;li&gt;Hierarchical namespace with path-based access (e.g., &#x2F;customer1&#x2F;project&#x2F;data&#x2F;file.txt)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Out of scope
&lt;ul&gt;
&lt;li&gt;file versioning, history&lt;&#x2F;li&gt;
&lt;li&gt;file compression&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;non-functional-1&quot;&gt;Non-functional&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Scale to multiple petabytes of storage.&lt;&#x2F;li&gt;
&lt;li&gt;Many hundreds of customers.&lt;&#x2F;li&gt;
&lt;li&gt;High availability and fault tolerance.&lt;&#x2F;li&gt;
&lt;li&gt;Low latency for metadata operations (&amp;lt; 100 ms).&lt;&#x2F;li&gt;
&lt;li&gt;High throughput for data operations ( GS&#x2F;s per customer).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;data-model-api&quot;&gt;Data Model + API&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Customer&lt;&#x2F;li&gt;
&lt;li&gt;Files&lt;&#x2F;li&gt;
&lt;li&gt;File Metadata&lt;&#x2F;li&gt;
&lt;li&gt;Dir&lt;&#x2F;li&gt;
&lt;li&gt;DataNode&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;File Ops, Dir Ops, List Ops&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# Initiate chunked upload
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;POST&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;api&#x2F;v1&#x2F;customers&#x2F;{customer_id}&#x2F;files&#x2F;upload
&lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;path&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;&#x2F;project&#x2F;data&#x2F;large_file.txt&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;size&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; 1073741824,
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;chunk_size&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;:&lt;&#x2F;span&gt;&lt;span&gt; 67108864
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;Response: &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;upload_id&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;upload_123&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;chunk_urls&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;https:&#x2F;&#x2F;api&#x2F;upload&#x2F;chunk&#x2F;1&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;https:&#x2F;&#x2F;api&#x2F;upload&#x2F;chunk&#x2F;2&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, ...&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;total_chunks&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: 16
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# Upload individual chunks
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;PUT&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;api&#x2F;v1&#x2F;upload&#x2F;chunk&#x2F;{chunk_id}
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;Content-Type:&lt;&#x2F;span&gt;&lt;span&gt; application&#x2F;octet-stream
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;[raw&lt;&#x2F;span&gt;&lt;span&gt; binary data - 64MB chunk]
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# Complete upload
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;POST&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;api&#x2F;v1&#x2F;customers&#x2F;{customer_id}&#x2F;files&#x2F;upload&#x2F;complete
&lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;upload_id&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;upload_123&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# Read file
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;GET&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;api&#x2F;v1&#x2F;customers&#x2F;{customer_id}&#x2F;files?path=&#x2F;project&#x2F;data&#x2F;large_file.txt
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;Response: &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;file_id&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;file_456&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;size&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: 1073741824,
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;block_locations&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: [
&lt;&#x2F;span&gt;&lt;span&gt;    {&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;block_id&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;block_001&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;nodes&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;node1&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;node3&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;node7&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;},
&lt;&#x2F;span&gt;&lt;span&gt;    {&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;block_id&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;block_002&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;nodes&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;node2&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;node4&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;node8&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;  ]
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# Delete file
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;DELETE&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;api&#x2F;v1&#x2F;customers&#x2F;{customer_id}&#x2F;files?path=&#x2F;project&#x2F;data&#x2F;large_file.txt
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;high-level-system-design-3&quot;&gt;High Level System Design&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;file-upload-flow&quot;&gt;File Upload Flow:&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Client requests file upload via REST API to API Gateway&lt;&#x2F;li&gt;
&lt;li&gt;API Gateway returns upload metadata (file_id, chunk_size, upload URLs)&lt;&#x2F;li&gt;
&lt;li&gt;Client uploads file as chunked HTTP streams (64MB chunks) to API Gateway&lt;&#x2F;li&gt;
&lt;li&gt;API Gateway streams chunks directly to Data Nodes via internal gRPC&lt;&#x2F;li&gt;
&lt;li&gt;Data Nodes write chunks directly to HDD as temporary files (&#x2F;storage&#x2F;blocks&#x2F;block_001.tmp)&lt;&#x2F;li&gt;
&lt;li&gt;On successful write, Data Nodes atomically rename to final location (&#x2F;storage&#x2F;blocks&#x2F;block_001)&lt;&#x2F;li&gt;
&lt;li&gt;Metadata Service creates inode mapping file to block locations&lt;&#x2F;li&gt;
&lt;li&gt;Directory Service updates parent directory to include new file entry&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;file-read-flow&quot;&gt;File Read Flow:&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Client requests file via REST API path lookup&lt;&#x2F;li&gt;
&lt;li&gt;API Gateway queries Directory Service for path → inode mapping&lt;&#x2F;li&gt;
&lt;li&gt;Directory Service returns inode_id for requested file&lt;&#x2F;li&gt;
&lt;li&gt;API Gateway queries Metadata Service for inode → block locations&lt;&#x2F;li&gt;
&lt;li&gt;API Gateway returns block locations to client for parallel HTTP reads&lt;&#x2F;li&gt;
&lt;li&gt;Client reads blocks directly from Data Nodes via HTTP streaming&lt;&#x2F;li&gt;
&lt;li&gt;Client reassembles file from downloaded blocks&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;directory-operations&quot;&gt;Directory Operations:&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Client requests directory operation (create&#x2F;list&#x2F;delete)&lt;&#x2F;li&gt;
&lt;li&gt;API Gateway routes to Directory Service based on path hash&lt;&#x2F;li&gt;
&lt;li&gt;Directory Service manages namespace operations with distributed locking&lt;&#x2F;li&gt;
&lt;li&gt;Updates replicated across directory metadata nodes using Raft consensus&lt;&#x2F;li&gt;
&lt;li&gt;Results returned to client with directory metadata&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;So:&lt;&#x2F;p&gt;
&lt;p&gt;User -&amp;gt; API Gateway -&amp;gt; UploadService -&amp;gt; Metadata DB&lt;&#x2F;p&gt;
&lt;h1 id=&quot;design-fb-post-search&quot;&gt;Design FB Post Search&lt;&#x2F;h1&gt;
&lt;p&gt;Suitable for any search feature&#x2F;product.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;requirements-6&quot;&gt;Requirements&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;functional-2&quot;&gt;Functional&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;Users should be able to create posts.&lt;&#x2F;li&gt;
&lt;li&gt;Users should be able to search for posts by content.&lt;&#x2F;li&gt;
&lt;li&gt;Users should be able to order search results by recency, like count etc.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Out of scope:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;fuzzy matching of terms for search.&lt;&#x2F;li&gt;
&lt;li&gt;search images and media.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;non-functional-2&quot;&gt;Non-functional&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;Search results &amp;lt; 500 ms.&lt;&#x2F;li&gt;
&lt;li&gt;New posts should be searchable in &amp;lt; 1 minute.&lt;&#x2F;li&gt;
&lt;li&gt;Support high volume of requests.&lt;&#x2F;li&gt;
&lt;li&gt;System should be highly available.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;1B users, on avg, 1 post&#x2F;day = 10k posts&#x2F;second.
Likes = 100k likes&#x2F;second.&lt;&#x2F;p&gt;
&lt;p&gt;Searches = 10k searches&#x2F;second.
Volume of posts created (and hence searchable): 1B posts&#x2F;day * 365 days&#x2F;year * 10 years = 3.6T posts
Size: 3.6T * 1kb = 3.6 Pb.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;entities-data-model-1&quot;&gt;Entities&#x2F;Data Model&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;User&lt;&#x2F;li&gt;
&lt;li&gt;Post&lt;&#x2F;li&gt;
&lt;li&gt;Like&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;api-2&quot;&gt;API&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;Search: &lt;code&gt;GET &#x2F;v1&#x2F;search?query=QUERY&amp;amp;sort_order=likes&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Post: &lt;code&gt;POST &#x2F;post&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Like: &lt;code&gt;POST &#x2F;post&#x2F;{id}&#x2F;like&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;high-level-design-1&quot;&gt;High Level Design&lt;&#x2F;h2&gt;
&lt;p&gt;User -&amp;gt; Post Service, Like Service -&amp;gt; DB
User -&amp;gt; Search Service -&amp;gt; DB&lt;&#x2F;p&gt;
&lt;p&gt;For search, we will need to set up an inverted index. Scaling challenges around which words to index, (ignore common words like conjunctions? etc).&lt;&#x2F;p&gt;
&lt;p&gt;User -&amp;gt; Search Service -&amp;gt; Db (sort results)
Request time sorting is super slow. The number of results could be large - in 10s of millions. So a solution is using multiple indices. One tracks sort by time, another likes. &quot;When a new post is created, we&#x27;ll add it to both indexes for every keyword it contains. When a like event happens, we&#x27;ll update the score in our sorted set for the likes index.&quot;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;deep-dive-1&quot;&gt;Deep Dive&lt;&#x2F;h2&gt;
&lt;p&gt;Focus on satisfying scaling and handling failure modes.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Handle a large volume of requests:
Have a distributed cache. With an eviction policy. TTL of &amp;lt; 1 min. Use CDN for another solution: &quot;Most CDNs operate like a big set of geographically-spread HTTP caches. You configure an &quot;origin&quot; or target for the cache and configure DNS to route through the CDN. If the cache has the item the user is looking for, it can return it faster than almost any alternative option: most CDNs have locations very close to most users. If it doesn&#x27;t hit the cache, the CDN will proxy the request back to your servers to handle.&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Handle complicated search &quot;Cat in the hat seeing a bat&quot; versus single word:
Index bigrams and shingles. So index &quot;Cat in&quot;, &quot;the hat&quot;, &quot;hat seeing&quot;. This will increase the size of the database. A possible remediation is to only index bigrams that are likely to be searched.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Address large volume of writes:
Post creation: Fan out creation requests using a queue, partition load. We can also buffer requests so that we can handle bursts of post creation. Finally, we can scale out our index by sharding the indexes by keyword.
Like record: batch likes, so instead of writing 500 times for 500 likes, write once. The information in our db is likely stale though.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h1 id=&quot;design-google-docs&quot;&gt;Design Google Docs&lt;&#x2F;h1&gt;
&lt;h2 id=&quot;requirements-7&quot;&gt;Requirements&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;functional-3&quot;&gt;Functional&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;Users create new docs&lt;&#x2F;li&gt;
&lt;li&gt;Multiple users can edit the same doc.&lt;&#x2F;li&gt;
&lt;li&gt;Users can see the other person&#x27;s changes in real time.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Out of scope:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;markdown docs or fancy text formatting.&lt;&#x2F;li&gt;
&lt;li&gt;perimissions, only viewing&lt;&#x2F;li&gt;
&lt;li&gt;doc history, versioning&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;non-functional-3&quot;&gt;Non-functional&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;100 simulatenous users on one doc.&lt;&#x2F;li&gt;
&lt;li&gt;Documents should be eventually consistent - at some point in time, everyone should see the same doc.&lt;&#x2F;li&gt;
&lt;li&gt;Low latency edits. Let&#x27;s say &amp;lt; 100ms for an edit to appear.&lt;&#x2F;li&gt;
&lt;li&gt;Docs should be durable even over server restarts.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;entites-api&quot;&gt;Entites + API&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;User&lt;&#x2F;li&gt;
&lt;li&gt;Doc&lt;&#x2F;li&gt;
&lt;li&gt;Edit&lt;&#x2F;li&gt;
&lt;li&gt;Cursor: position of the cursor on the doc.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;api-3&quot;&gt;API&lt;&#x2F;h3&gt;
&lt;p&gt;We are going to be using websockets because there are going to lots of bidirectional communication between the docs and the users edits the docs.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Create Doc. This is REST API: `POST &#x2F;v1&#x2F;doc -&amp;gt; docId&lt;&#x2F;li&gt;
&lt;li&gt;Edit Doc:&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre style=&quot;background-color:#151515;color:#e8e8d3;&quot;&gt;&lt;code&gt;&lt;span&gt;   WS &#x2F;v1&#x2F;doc&#x2F;{docId}
&lt;&#x2F;span&gt;&lt;span&gt;   SEND {
&lt;&#x2F;span&gt;&lt;span&gt;    type: &amp;quot;insert&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;    ...
&lt;&#x2F;span&gt;&lt;span&gt;   }
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;pre style=&quot;background-color:#151515;color:#e8e8d3;&quot;&gt;&lt;code&gt;&lt;span&gt;   WS &#x2F;v1&#x2F;doc&#x2F;{docId}
&lt;&#x2F;span&gt;&lt;span&gt;   SEND {
&lt;&#x2F;span&gt;&lt;span&gt;    type: &amp;quot;delete&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;    ...
&lt;&#x2F;span&gt;&lt;span&gt;   }
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;Get update:&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre style=&quot;background-color:#151515;color:#e8e8d3;&quot;&gt;&lt;code&gt;&lt;span&gt;  WS &#x2F;v1&#x2F;doc&#x2F;{docId}
&lt;&#x2F;span&gt;&lt;span&gt;    RECV {
&lt;&#x2F;span&gt;&lt;span&gt;      type: &amp;quot;update&amp;quot;
&lt;&#x2F;span&gt;&lt;span&gt;      ...
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;high-level-design-2&quot;&gt;High Level Design&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;Create new docs: Client connects to a server via API Gateway, an entry is made in a db creating a doc.&lt;&#x2F;li&gt;
&lt;li&gt;Multiple users editing concurrently: A central server transforms the edits so that ordering is preserved. We only send edits instead of the whole document to save space and help latency. The edits are writtent to a new db that supports high volume of writes: cassandra.&lt;&#x2F;li&gt;
&lt;li&gt;When a user connects to an existing doc: load the doc, apply the latest Operational Transforms.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;deep-dives-3&quot;&gt;Deep Dives&lt;&#x2F;h2&gt;
&lt;h1 id=&quot;imagine-two-users-alice-and-bob-are-editing-the-same-sentence-hello-alice-adds-world-at-the-end-and-at-the-exact-same-time-bob-deletes-the-what-specific-data-does-alice-s-client-send-to-the-server-what-about-bob-s-and-how-does-your-server-merge-these-two-conflicting-operations-to-ensure-both-clients-end-up-with-the-same-correct-document-state&quot;&gt;Imagine two users, Alice and Bob, are editing the same sentence: &quot;Hello!&quot;. Alice adds &quot;, world&quot; at the end, and at the exact same time, Bob deletes the &quot;!&quot;. What specific data does Alice&#x27;s client send to the server? What about Bob&#x27;s? And how does your server merge these two conflicting operations to ensure both clients end up with the same, correct document state?&lt;&#x2F;h1&gt;
&lt;ol&gt;
&lt;li&gt;For saving the doc, we can&#x27;t save the entire doc each time a user makes a change. That takes up too much bandwidth and will be too slow.&lt;&#x2F;li&gt;
&lt;li&gt;So when a user makes an edits, it&#x27;s worthwhile to save only the edits.&lt;&#x2F;li&gt;
&lt;li&gt;So we need to have a data model of the how edits should be saved and transmitted.&lt;&#x2F;li&gt;
&lt;li&gt;When multiple edits are happening to the document at the same time, the server is responsible for reconciling the edits and transmitting it to the users.&lt;&#x2F;li&gt;
&lt;li&gt;For Google Docs, we are going to use Operational Transforms for manage the edits.&lt;&#x2F;li&gt;
&lt;li&gt;The data we will store when alice edits is: INSERT(6, &quot;, world&quot;). For bob: DELETE(6).&lt;&#x2F;li&gt;
&lt;li&gt;The server, when it has to route two such edits, on the server side, it updates the parameters of the operation so they are normalkized to the changes that happen before it. In this case, after insert, the delete operation becomes: DELETE(12).&lt;&#x2F;li&gt;
&lt;li&gt;So when an user makes an edit, we first apply the local edit to his application so it&#x27;s immediate, then on the server side, apply the chain transformation of edits to all users.&lt;&#x2F;li&gt;
&lt;li&gt;On the local side, when a message is recevied, we apply OT locally.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h1 id=&quot;the-server-is-now-a-critical-component-it-s-the-single-source-of-truth-that-establishes-the-final-order-of-operations-what-happens-if-that-single-server-fails-how-do-you-ensure-durability-for-the-edits-being-processed-and-how-does-the-system-recover-to-a-consistent-state-once-a-new-server-takes-over&quot;&gt;The server is now a critical component; it&#x27;s the single source of truth that establishes the final order of operations. What happens if that single server fails? How do you ensure durability for the edits being processed, and how does the system recover to a consistent state once a new server takes over?&lt;&#x2F;h1&gt;
&lt;p&gt;Yeah, the server is doing a hell of a lot of work here, and in OT, it&#x27;s a critical component. We need to have multiple servers, each handling a subset of users. It&#x27;s best if we ensure all the users who are editing a doc are connected to the same server. The server instance also has to be large enough to handle the volume of messages coming. We can assume each sever has maybe 100k connections, and for 10 million concurrent users, we will need 10*1e6&#x2F;100000 =100 servers.&lt;&#x2F;p&gt;
&lt;p&gt;When a single server fails, we need to manage:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;the connections that server was dealing with&lt;&#x2F;li&gt;
&lt;li&gt;The edits flowing through that server - ensure they are not lost, even if connection was immediately terminated for all users.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;The way we can deal with (1) is by using a coordination service like zookeeper to manage the server instances - scale it up or down, though with socket servers, this might be complicated, and we could do with just N sockets and then bring a new one up manually. The zookeeper services records all the server ids and the sockets assigned to each server id. Each user is given an id and mapped to a socket server via an hash. Once a server fails, we immediately notify to users that server connection has been lost - this can be done at the application layer to each user.&lt;&#x2F;p&gt;
&lt;p&gt;For the changes that were in teh server but not applied yet to all users, these have to be backed up, and backed up often. The way we are going to manage this is each edit will be saved, along with the document version id and time stamp. We can save this in a dynamodb.&lt;&#x2F;p&gt;
&lt;p&gt;When users come back and are connected to a new server, we compare the reconciled document id in the possibly blob store, Then apply the edits since the last change and send it to the user.&lt;&#x2F;p&gt;
&lt;p&gt;So a reconciled, materialized file is saved once in a while, let&#x27;s say a blob store, and the link to this file is present in our db.&lt;&#x2F;p&gt;
&lt;p&gt;So our db tracks:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;The edits from all users,&lt;&#x2F;li&gt;
&lt;li&gt;Document id and the document version id&lt;&#x2F;li&gt;
&lt;li&gt;The materialized file in the blob store.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;The materialized file can be created once in a while, for example when new users connect.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;design-an-online-auction-platform-like-ebay&quot;&gt;Design an Online Auction Platform Like eBay&lt;&#x2F;h1&gt;
&lt;h1 id=&quot;resources&quot;&gt;Resources&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.systemdesignhandbook.com&#x2F;&quot;&gt;System Design Handbook&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;http:&#x2F;&#x2F;hellointerview.com&#x2F;&quot;&gt;Hello Interview&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>CV</title>
        <published>2025-08-11T00:00:00+00:00</published>
        <updated>2025-08-11T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/pages/cv/"/>
        <id>https://asun9.com/pages/cv/</id>
        
        <content type="html" xml:base="https://asun9.com/pages/cv/">&lt;style&gt;
  html, body {
    margin: 0;
    padding: 0;
    height: 100%;
  }
  iframe {
    display: block;
    border: none;
    width: 100%;
    height: 100vh; &#x2F;* full viewport height *&#x2F;
  }
&lt;&#x2F;style&gt;
&lt;iframe
  src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;prof&#x2F;ASundararajanResume2025-gen.pdf#zoom=100&quot;
  style=&quot;width:100%; height:100vh; border:none;&quot;
&gt;&lt;&#x2F;iframe&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Working with coding agents</title>
        <published>2025-08-09T00:00:00+00:00</published>
        <updated>2025-08-09T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/agent/"/>
        <id>https://asun9.com/notes/agent/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/agent/">&lt;p&gt;To get immediately started with an agent, you don&#x27;t need this post. But to build a production system of some utility, where multiple people have their hands on the code base, you will need to be more thoughtful about how to use Claude Code (and its terminal-based peers). For smaller projects or solo work, simpler approaches may be perfectly adequate.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;1&quot;&gt;1.&lt;&#x2F;h1&gt;
&lt;p&gt;You will need an &lt;code&gt;agent.md&lt;&#x2F;code&gt; file or equivalent that prods our LLM collaborator to create code that&#x27;s maintainable. I have mine at &lt;code&gt;.claude&#x2F;CLAUDE.md&lt;&#x2F;code&gt;. I use the one below primarily on python projects.&lt;&#x2F;p&gt;
&lt;p&gt;Before showing the template, I should emphasize TDD here. I was not great at it, generally writing the tests after I had done everything else. That was in a time and land before coding agents. Agents need TDD. They love TDD. Do not skip it.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;markdown&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-markdown &quot;&gt;&lt;code class=&quot;language-markdown&quot; data-lang=&quot;markdown&quot;&gt;&lt;span&gt;# &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;Directives
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;## &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;1. Principles
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;- **Write Simple Code**: Prioritize clarity and readability. Avoid clever tricks. Refactor complexity.
&lt;&#x2F;span&gt;&lt;span&gt;- **Commit Incrementally**: Make small, logical changes. Every commit must compile and pass all tests.
&lt;&#x2F;span&gt;&lt;span&gt;- **Follow Existing Patterns**: Study the codebase to match existing conventions for structure and tooling.
&lt;&#x2F;span&gt;&lt;span&gt;- **Favor Composition Over Inheritance**: Use object composition for flexibility and code reuse.
&lt;&#x2F;span&gt;&lt;span&gt;- **Colocate and DRY**: Keep related logic in a single file, but extract duplicated code into reusable components (Don&amp;#39;t Repeat Yourself).
&lt;&#x2F;span&gt;&lt;span&gt;- **Use a Functional Approach**:
&lt;&#x2F;span&gt;&lt;span&gt;  - Keep functions small and single-purpose.
&lt;&#x2F;span&gt;&lt;span&gt;  - Do not mutate input data.
&lt;&#x2F;span&gt;&lt;span&gt;  - Avoid side effects; use parameters and return values for data flow.
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;## &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;2. Workflow
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;1.  **Plan**: For non-trivial tasks, create an `IMPLEMENTATION_PLAN.md`.
&lt;&#x2F;span&gt;&lt;span&gt;2.  **Implement**: Follow a Test-Driven Development (TDD) flow: write a failing test, write minimal code to pass, then refactor continuously while ensuring tests still pass.
&lt;&#x2F;span&gt;&lt;span&gt;3.  **Commit**: Use clear messages. Remove the plan file upon completion.
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;## &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;3. On Failure
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;After **3 failed attempts** on an issue, STOP. Document what failed, research alternatives, and find a simpler approach.
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;## &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;4. Python Standards
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;- **Environment**: Use Python 3.11+ with `uv` for all tasks (`uv run ...`). Add dependencies to `pyproject.toml` and run `uv sync`.
&lt;&#x2F;span&gt;&lt;span&gt;- **Public API**:
&lt;&#x2F;span&gt;&lt;span&gt;  - Strictly separate the public API from internal implementation.
&lt;&#x2F;span&gt;&lt;span&gt;  - The public API consists of simple, user-facing functions and classes. Their docstrings must explain _what_ the code does, not _how_.
&lt;&#x2F;span&gt;&lt;span&gt;  - **Within public-facing API modules, prefix all internal helpers, functions, classes, or methods with a leading underscore (`_`)**.
&lt;&#x2F;span&gt;&lt;span&gt;  - Selectively import only public objects into the package&amp;#39;s `__init__.py`.
&lt;&#x2F;span&gt;&lt;span&gt;- **Typing &amp;amp; Style**:
&lt;&#x2F;span&gt;&lt;span&gt;  - Use type annotations for all signatures and variables.
&lt;&#x2F;span&gt;&lt;span&gt;  - Format and lint with `ruff`.
&lt;&#x2F;span&gt;&lt;span&gt;    - First format with: `uv run ruff format &amp;lt;dir&amp;gt;`.
&lt;&#x2F;span&gt;&lt;span&gt;    - Then lint with: `uv run ruff check --select PL,I,B,C,F,E,W,D,ANN --fix --line-length 100 &amp;lt;dir&amp;gt;`.
&lt;&#x2F;span&gt;&lt;span&gt;    - Validate types with pyrefly: `uvx pyrefly check &amp;lt;dir&amp;gt;`.
&lt;&#x2F;span&gt;&lt;span&gt;  - Prefer `dataclasses` for data structures. Use `pydantic` only if serialization or validation is needed.
&lt;&#x2F;span&gt;&lt;span&gt;  - Use built-in collection types with subscripts: `list[T]`, `dict[K, V]`, `set[T]`, `tuple[T, ...]`
&lt;&#x2F;span&gt;&lt;span&gt;    - Import from `typing` only when necessary: `Optional`, `Union` (or use `X | None`, `X | Y`), `Protocol`, `TypeVar`, `Callable, Generic`.
&lt;&#x2F;span&gt;&lt;span&gt;    - Examples:
&lt;&#x2F;span&gt;&lt;span&gt;      - ✅ `def process(items: list[str]) -&amp;gt; dict[str, int]:`
&lt;&#x2F;span&gt;&lt;span&gt;      - ❌ `def process(items: List[str]) -&amp;gt; Dict[str, int]:`
&lt;&#x2F;span&gt;&lt;span&gt;- **Tooling &amp;amp; Docs**:
&lt;&#x2F;span&gt;&lt;span&gt;  - Use `Typer` for CLIs and `pytest` for tests.
&lt;&#x2F;span&gt;&lt;span&gt;  - Use concise, Google-style docstrings for all public APIs.
&lt;&#x2F;span&gt;&lt;span&gt;  - Add a module-level docstring to CLI&#x2F;test files showing the run command.
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;## &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;5. Quality Checklist
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;A commit is done only when:
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;- [ ] All tests pass (`uv run pytest`).
&lt;&#x2F;span&gt;&lt;span&gt;- [ ] Code is formatted and linted with `ruff`.
&lt;&#x2F;span&gt;&lt;span&gt;- [ ] It adheres to all principles (especially API separation).
&lt;&#x2F;span&gt;&lt;span&gt;- [ ] New code is tested and documented.
&lt;&#x2F;span&gt;&lt;span&gt;- [ ] `README.md` has current setup&#x2F;usage instructions (only if necessary).
&lt;&#x2F;span&gt;&lt;span&gt;- [ ] The commit message is clear.
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;## &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;6. Decision-Making
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;When choosing between valid solutions, prioritize in this order:
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;1. **Testability**: Can I easily test this?
&lt;&#x2F;span&gt;&lt;span&gt;2. **Readability**: Will someone understand this in 6 months?
&lt;&#x2F;span&gt;&lt;span&gt;3. **Consistency**: Does this match project patterns? So as to reduce cognitive overload for reviewers, and prevent pattern sprawl.
&lt;&#x2F;span&gt;&lt;span&gt;4. **Simplicity**: Is this the simplest solution that works?
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h1 id=&quot;2&quot;&gt;2.&lt;&#x2F;h1&gt;
&lt;p&gt;Each session needs a starting prompt. This is important for you as a developer as much as it is for the agent - you will use it to think through what you want. Being intentional and structuring your work helps clarify the purpose of what you&#x27;re building. As such, in the template below, treat the sections as discovery tools, not requirements.&lt;&#x2F;p&gt;
&lt;p&gt;For the agent, what&#x27;s mandatory are the problem statement, the user experience, success criteria, and scope. As coding agents get better, we will have to less specific about the implementation approaches for even non-trivial tasks. In my experience, that&#x27;s not the case today given the constraint of creating maintainable code. &lt;strong&gt;If I haven&#x27;t driven home the point yet, here it is again: to have a productive team, you must have code that&#x27;s read and understood by humans and developers alike.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# Start claude code with your session prompt
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;claude &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;# Feature Spec: [Feature Name]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;## Problem &amp;amp; Why Now
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;- **What user problem does this solve?**
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;- **Why is this needed now?**
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;## User Experience
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;- **Who uses this and how?** [User type + step-by-step workflow]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;- **Interface**: [API endpoints, UI elements, CLI commands]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;## Implementation Direction
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;- **Approach**: [High-level strategy and reasoning]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;- **Constraints**: [Technology choices, existing patterns, architecture fit]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;- **Gotchas**: [What could break? Edge cases? Dependencies?]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;## Success Criteria
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;- **Done when**: [Concrete acceptance criteria]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;- **Testing approach**: [How you&amp;#39;ll validate it works]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;## Scope
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;- **This session**: [What we&amp;#39;re building now]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;- **Not doing**: [What&amp;#39;s explicitly out of scope]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;## Open Questions
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;- [Implementation details you&amp;#39;re unsure about]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;- [Where the agent should make decisions]
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;---
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;**Agent Instructions:**
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;Challenge vague sections. Ask clarifying questions about requirements and edge cases before implementing.
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Claude Code will keep ignoring many of the directives, which means you will have to pay close attention to what it produces. There are reasons for this that are inherent in the way LLMs are designed - a combination of the data it&#x27;s seen in training, context rot, and conflicting instruction hierarchy. We just want to get going and be productive with it, so it all boils down to this in the end: (1) you will have to remind it constantly to read CLAUDE.md and acknowledge the instructions (2) add example of good and bad code.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;3&quot;&gt;3.&lt;&#x2F;h1&gt;
&lt;ol&gt;
&lt;li&gt;Claude Code is eager to do the work, and the code it produces is almost always defensive and low quality, though it, well, works. Rein it in by toggling to plan mode (shift+tab) liberally and often. Get it to produce a plan and think with you first, and summarize the conversation. Only then allow it to make changes.&lt;&#x2F;li&gt;
&lt;li&gt;Litter your code with CLAUDE.md at different levels. Remind it to follow the directives often. Ask it, for example, to pick five directives that would apply here and implement accordingly.&lt;&#x2F;li&gt;
&lt;li&gt;Claude Code seems to be good at verifying compliance. An example of how to use this to iteratively improve the code: ask Claude Code in one session&#x2F;terminal to verify if the CLAUDE.md rules are followed, and in another, do the work to fix the issues summarized by the first terminal.&lt;&#x2F;li&gt;
&lt;li&gt;You want to closely monitor the tests, even implement the skeleton yourself. Claude Code and LLMs cannot tell if the code they are generating meets a feature spec or even works. By controlling the tests, you ensure it has a feedback loop when implementing features.&lt;&#x2F;li&gt;
&lt;li&gt;Use slash commands: &lt;code&gt;&#x2F;compact&lt;&#x2F;code&gt; for using existing session for a new feature, &quot;Clear conversation history but keep a summary in context&quot;.&lt;&#x2F;li&gt;
&lt;li&gt;Use slash commands&lt;code&gt;&#x2F;clear&lt;&#x2F;code&gt; clear conversation history and free up context.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Temüjin</title>
        <published>2025-07-14T00:00:00+00:00</published>
        <updated>2025-07-14T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/frank-mlynn-mongols/"/>
        <id>https://asun9.com/frank-mlynn-mongols/</id>
        
        <content type="html" xml:base="https://asun9.com/frank-mlynn-mongols/">&lt;p&gt;Book: &lt;strong&gt;Genghis Khan: His Conquests, His Empire, His Legacy&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Frank McLynn&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;I plod through most books. Relatively speaking. History books on the other hand, I devour. Existing commitments take a backseat and we can’t have that. So I don’t read as much history as I could be. Unfortunately for all my resolve, Frank McLynn’s Genghis Khan biography was $1.99, and I had a long flight ahead of me. As it were, that was a fast 48 hours. Now I am going to tell you all about it.&lt;&#x2F;p&gt;
&lt;figure style=&quot;text-align:center;&quot;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;mongols&#x2F;MapEurasiansteppebelt.webp&quot;
       alt=&quot;The Eurasian Steppe.&quot;
       class=&quot;center&quot;
       style=&quot;max-height: 600px; width: auto; pointer-events: none;&quot;&gt;
  &lt;figcaption&gt;The Eurasian Steppe.&lt;&#x2F;figcaption&gt;
  
&lt;&#x2F;figure&gt;
&lt;p&gt;For centuries, the steppe peoples struck terror into the hearts of settled civilizations. The Han Dynasty built walls and maintained standing armies to contain nomadic raiders. Rome’s final collapse came partly through strain brought on by Attila’s Huns in the decades preceding it. In East and West, archer-warriors on horseback would suddenly appear at the edge of cities, wreak havoc, kill the old and the infirm, take women and children, enslave who they could, and disappear, leaving sedentary empires to rebuild their borders and wait for the next storm from the grasslands. Sometimes a steppe group would settle and rule their frontiers, like for example Tabgasch in northern China between 4th and 5th centuries CE, who then eventually sinicized while ruling as Northern Wei. Others created substantial empires in the steppe, such as the Gokturks and their Khaganates between 6th and 8th century CE, that were successful within the steppe. This did not happen as often as it could have because steppe confederations were fragile, dissolving immediately on the death of charismatic leaders or on defeats. All the nomadic groups encountered similar issues that eventually broke their power: succession crises, loyalty conflicts, difficulty governing diverse populations. The Mongols of early 13th century CE were the only ones to defy the pattern and establish a long standing empire beyond the steppe. There is a very good reason why: Temüjin - better known as Genghis Khan - and his talent for organization.&lt;&#x2F;p&gt;
&lt;p&gt;Most world conquerors’ empires don&#x27;t survive them. It did not for Alexander. Nor Napoleon. Or Hitler. The Mongol Empire outlasted the first Great Khan for a couple of generations, maintaining coherence far longer than Alexander&#x27;s immediate collapse. People have been making the case that despite all the killing, it led to greater prosperity for everyone in the Empire and beyond. &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;the-horde&#x2F;&quot;&gt;Pax Mongolica&lt;&#x2F;a&gt;. One can also make the case that respecting trade and deifying the flow of goods and wealth is one of the better ways of running a civilization.&lt;&#x2F;p&gt;
&lt;p&gt;Genghis&#x27;s genius was this: he broke up a clan system that was unstable due to shifting loyalties between different tribes and lineages, created a decimal military system where one could not leave one&#x27;s unit, and instituted promotions based on merit over birth. In addition, his superstate was constantly expansionary, a system that channeled all the energies that would once have gone into tribal warfare into fighting the world, one which returned untold booty and pillage. He did all this in one lifetime, in steppes that had functioned the old way for centuries. And he did this while being illiterate, making his improvements without access to classical military treatises East or West, or any administrative models from Roman, Persian-Islamic or Chinese worlds. Genghis built a military machine that could simultaneously plan and execute campaigns against Jin China, Khwarazm, and eventually Western targets.&lt;&#x2F;p&gt;
&lt;p&gt;There have been tribal confederations that became kingdoms, but that happened gradually over generations, and stayed within their cultural sphere. That&#x27;s how it was with the Germanic tribes after the collapse of Rome, forming the Frankish states. The Arab confederation under early Islam is another example, drawing on existing networks - there had been centuries of trade and contact between the Arabs and the Byzantine and Persian administrative systems. Genghis was unique in compressing what usually took 200 or so years of state building into some 20 years, starting from a more or less blank slate.&lt;&#x2F;p&gt;
&lt;figure style=&quot;text-align:center;&quot;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;mongols&#x2F;MapKhwarazmianMongol1200_CE.webp&quot;
       alt=&quot;The Khwarazmian Empire and the Mongol Federation around 1200 CE. The Mongols conquered Khwarazm between 1219 CE and 1221 CE.&quot;
       class=&quot;center&quot;
       style=&quot;max-height: 600px; width: auto; pointer-events: none;&quot;&gt;
  &lt;figcaption&gt;The Khwarazmian Empire and the Mongol Federation around 1200 CE. The Mongols conquered Khwarazm between 1219 CE and 1221 CE.&lt;&#x2F;figcaption&gt;
  
&lt;&#x2F;figure&gt;
&lt;p&gt;Some of this empire-building was driven by revenge and resentment, tribal feuds scaled up. The destruction of entire civilizations often stemmed from personal slights that would have been perpetual clan disputes in the old system. Muhammad Shah II&#x27;s Khwarazmian empire fell largely because of one governor&#x27;s massacre of Mongol merchants, infuriating Genghis. The Merkit, one of the five principal tribes of Mongolia, were chased all the way across the entire Eurasian Steppe because they had once kidnapped Borte, Genghis&#x27;s wife, as payback for an earlier slight. This pursuit and the eventual hounding of the last of the Merkit north of the Syr Darya by Subedei and Jebe got them in contact with the Cumans, who had allied with the Merkit. The Cumans thus became enemies of the Mongols, and in turn this led to the eventual conquest and vassalage of Georgia and from there various Russian principalities.&lt;&#x2F;p&gt;
&lt;p&gt;An aspect of the empire that I was unaware of and have come to appreciate was the institutionalization of knowledge. Take the early years of the Jin campaign, for example. They were a slog because the Mongols had no experience with fortified cities. But the Mongols systematically absorbed Chinese engineers and became good at siege warfare. So good in fact that, when they moved west to Central Asia, they could absorb Samarkand, Bukhara, Merv, etc., and finish the conquest of the Khwarazmian Empire in two years. This institutional memory is remarkable for two reasons. One, till recently they were nomadic warring bands who hadn’t changed their ways of operating for centuries. Two, they demonstrated they could preserve and disseminate knowledge from one end of the empire to another, like they would troops, suggesting it had to be part of some training protocol. Under Genghis, the Mongols were learning (and fighting) machines.&lt;&#x2F;p&gt;
&lt;p&gt;There&#x27;s a lot of slaving and dying that accompanies these wars, though it is hard to tell if it was much worse than what the Ottomans or Europeans or humans in other pre-modern places with enough capacity and motivation for violence did, especially toward those they saw as culturally foreign. The Turkic mamluks enslaved hundreds of thousands of Hindus, Buddhists, and Jains from the Ghaznavid campaigns of 11th century to during their rule of Delhi under the sultanate in 13th century. This happened in such large volumes that it often &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.jstor.org&#x2F;stable&#x2F;25188289&quot;&gt;caused the market for slaves to crash in prices due to oversupply&lt;&#x2F;a&gt; in Central Asia. There was a pipeline for slaves from the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.cambridge.org&#x2F;core&#x2F;journals&#x2F;international-journal-of-middle-east-studies&#x2F;article&#x2F;what-does-the-slave-trade-in-the-saqaliba-tell-us-about-early-islamic-slavery&#x2F;EDDD35D8FD593AB8D576D11550CF62C6&quot;&gt;Caucasus&lt;&#x2F;a&gt; and &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;compass.onlinelibrary.wiley.com&#x2F;doi&#x2F;abs&#x2F;10.1111&#x2F;j.1478-0542.2006.00376.x&quot;&gt;East Africa&lt;&#x2F;a&gt; into the Islamic world of Egypt, Persia, and Central Asia. With respect to the Mongols, the Persian record-keepers note numbers that McLynn says are greatly exaggerated. Given the Mongols&#x27; pragmatic tolerance toward religion, a marked improvement over their contemporaries, their methods appear less exceptional within the context of medieval warfare. Frank McLynn understands the Mongols’ “surrender or die” policy as strategic, using terror to avoid hand-to-hand combats:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;The simplest explanation for the chilling policy of ‘surrender or die’ was that the Mongols, as a far from numerous people, were always obsessed with casualties, so that the best-case scenario was a walkover surrender in which none of their troops died.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;It appears that the Mongols didn&#x27;t leave their families at home when they went campaigning during their tribal warfare phase, before unification. They brought wives, children, and all their stuff along for the ride. So every fight was a fight to the very end, accompanied by the threat of not just loss of life, but also that of slavery and bondage of their blood relatives. This high stakes attitude, total commitment approach, is what the early Mongols carried into their conquests. Every battle should be a complete victory with no half-measures. It might also inform some of Genghis’s personal qualities as exemplified by the Mongol war machine - speed, thorough preparation, use of sophisticated espionage networks, and psychological warfare. One anecdote in this largely grim recounting of the Mongols terror amused me: Genghis used his spies to circulate rumors that Muhammad Shah’s own mother, Terken Qatun, who wielded significant political power, intended to join the Mongols during their invasion of Khwarezm.&lt;&#x2F;p&gt;
&lt;figure style=&quot;text-align:center;&quot;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;mongols&#x2F;Jalal_al-Din_Indus.jpg&quot;
       alt=&quot;Muhammad Shah II&amp;amp;#x27;s son Jalal al-Din fleeing Genghis at the Indus.&quot;
       class=&quot;center&quot;
       style=&quot;max-height: 600px; width: auto; pointer-events: none;&quot;&gt;
  &lt;figcaption&gt;Muhammad Shah II&#x27;s son Jalal al-Din fleeing Genghis at the Indus.&lt;&#x2F;figcaption&gt;
  
&lt;&#x2F;figure&gt;
&lt;p&gt;McLynn draws comparisons between Mongol achievements and contemporary European developments in science, social organization, and religion, to dismiss Genghis as a moral pygmy. This misses the point entirely. Medieval Europe built on centuries of Roman infrastructure, Christian institutions, and sustained contact with the Islamic world. The Mongols had none of this - no written language, no administrative tradition, no high culture. That Genghis could transform his tribal confederacy into an organization capable of absorbing Chinese engineering and culture, Persian administration, and whatever else they encountered, then systematically disseminate that knowledge across continents does much to his credit.&lt;&#x2F;p&gt;
&lt;p&gt;The importance of Genghis to the Mongols deserves some thought. What would a man of his organizational abilities have accomplished if born in Khwarazm, Constantinople, or Jin China? I would bet on “very little”. These were societies with entrenched hierarchies. The path to advancement was fixed, with their elites already in place. And elites are defensive of their positions. A brilliant outsider might rise to middle management, perhaps minor nobility, but never to the leadership, with access to levers that could remake entire systems. Even if such a promotion were to happen, I doubt the leadership would be revolutionary: the years in the system would have beaten that out of him.&lt;&#x2F;p&gt;
&lt;p&gt;There’s a lesson in here, a parallel, to modern corporate organizations, about why startups generally crush larger incumbents, but I do not want to belabor the point.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Being Mortal</title>
        <published>2025-07-06T00:00:00+00:00</published>
        <updated>2025-07-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/appa-praptam/"/>
        <id>https://asun9.com/appa-praptam/</id>
        
        <content type="html" xml:base="https://asun9.com/appa-praptam/">&lt;p&gt;When I got the message that Appa did not have much time to live, I flew down to India immediately. I had two weeks with him during which I read obsessively. If I had not blocked YouTube and Twitter, that&#x27;s where my mind would have been. It was as if I did not want to be alone with my thoughts.&lt;&#x2F;p&gt;
&lt;p&gt;The last book I read in his presence was Atul Gawande&#x27;s &lt;em&gt;Being Mortal&lt;&#x2F;em&gt;, which I finished as my father slipped away in the hospital bed beside me. The timing was cruel and illuminating. Here was a surgeon writing about everything his doctors had failed to do: have honest conversations about prognosis, discuss quality of life, acknowledge when cure was no longer possible.&lt;&#x2F;p&gt;
&lt;p&gt;Gawande observes how abnormal contemporary death has become. In the United States, as recently as 1945, most people died at home. By the 1980s, only 17 percent did. We have medicalized dying in ways unprecedented in human history. For most of our species&#x27; existence, people died young from disease, injury, war, long before old age, and mostly surrounded by family or friends in familiar spaces. The idea of dying in a sterile hospital, attached to machines, monitored by strangers, would have been incomprehensible even a hundred years ago. This new normal has been created unthinkingly, one decision at a time, without anyone questioning whom exactly it is serving.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-machinery-of-false-hope&quot;&gt;The Machinery of False Hope&lt;&#x2F;h2&gt;
&lt;p&gt;After R-CHOP chemotherapy (a combination drug treatment) and CAR-T cell therapy, my father&#x27;s lymphoma persisted. Nothing I could find online suggested the cancer would regress with further treatment. Yet his new oncologist, let&#x27;s call him Dr. V, proposed another round of chemotherapy followed by Venetoclax. When I searched for literature on this combination for relapsed lymphoma, I found virtually nothing promising.&lt;&#x2F;p&gt;
&lt;p&gt;The moment I realized we were trapped in medicine&#x27;s false hope industrial complex came during a meeting with this new oncologist. I wrote in my journal afterward, in frustration: &quot;His interpretations of events were different from mine or appa. Either lying or foolish, unwilling to listen. Gaslighting.&quot; He seemed strangely uninvested in the outcome, curious in an academic sense about whether the treatment might work, but disconnected from my father as a person facing death. More telling, his narrative about my father&#x27;s disease progression contradicted our lived experience. He insisted the back pain that had tormented my father began with radiation; we knew it started the moment he began chemotherapy months earlier.&lt;&#x2F;p&gt;
&lt;p&gt;Dr. V, like some in Gawande&#x27;s book, focused only on &quot;the next thing to do,&quot; which was either immediate medication, another surgery, or one more round of treatment. Never: What does a good death look like? What matters most to you in your remaining time? How much suffering are you willing to endure for what probability of benefit? Is there a going back to previous mode of living if a treatment plan works?&lt;&#x2F;p&gt;
&lt;p&gt;My father&#x27;s previous oncologists had been straightforward. They suggested palliative care when cure was no longer realistic. But Appa despised that word and would go apoplectic at its mention. If I had read Gawande earlier, I might have had better language to help him understand that choosing comfort over futile treatment wasn&#x27;t surrender.&lt;&#x2F;p&gt;
&lt;p&gt;In April, I spoke to Dr. V and his team alone. I opened with a pointed question: &quot;Have you seen any patients with gastric fistula (an abnormal opening in the stomach wall) recover when surgery is not an option?&quot; They demurred. I had to push them to state what should have been obvious: how much time did my father have? A few weeks to a couple of months.&lt;&#x2F;p&gt;
&lt;p&gt;Within days of my return to California in May, I was shocked to learn they wanted to proceed with Venetoclax and more chemotherapy anyway. The treatments sent my father spiraling into worse agony. In June, a CT scan revealed the cancer had spread to his intestines and pancreas. I had my mother connect me to the trainee doctor who told me my father had only a few days to live, while mentioning nothing to my mother who was next to him. That same day - June 16 - they administered polatuzumab with rituximab, a targeted therapy costing 250,000 rupees (over $3,000) for a single 30mg dose. This was not palliative care - it was another attempt at tumor reduction for a man with days to live, with known side-effects.&lt;&#x2F;p&gt;
&lt;p&gt;Why did the doctors allow themselves to be browbeaten by a patient unwilling to accept mortality, continuing treatments they knew were futile? Their incentives made it impossible to step back. Here was a patient with good insurance, willing to try anything. Another data point for the literature, given the interest of the group in publishing.&lt;&#x2F;p&gt;
&lt;p&gt;That last night I spent with my father, his breathing gradually became labored. He had little or no consciousness left, just the mechanical rhythm of lungs and heart. When the doctors suggested a ventilator, I said no. It would have kept his body functioning a few more days in the ICU, but we wouldn&#x27;t have been there when the end finally came. That choice to let him go felt like the first honest medical decision in months.&lt;&#x2F;p&gt;
&lt;p&gt;Seeing someone die, even when you expect it, feels like a punch to the chest. The machine starts beeping. His breath stops. Yours catches. The unnecessary suffering, both his and my mother&#x27;s, that preceded it made me very angry. My father could have spent his final months traveling to Madurai, or we could have made that trip to Swamimalai in January with his granddaughter. Instead, we have this.&lt;&#x2F;p&gt;
&lt;figure style=&quot;text-align:center;&quot;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;appa&#x2F;kaveri-srp-2025.webp&quot;
       alt=&quot;The Kaveri river at Srirangapatnam.&quot;
       class=&quot;center&quot;
       style=&quot;max-height: 600px; width: auto; pointer-events: none;&quot;&gt;
  &lt;figcaption&gt;The Kaveri river at Srirangapatnam.&lt;&#x2F;figcaption&gt;
  
    &lt;small style=&quot;font-size: 0.8em; color: #777;&quot;&gt;&amp;copy; Abhishek Sundararajan. All Rights Reserved.&lt;&#x2F;small&gt;
  
&lt;&#x2F;figure&gt;
&lt;p&gt;After his death, I performed the first two days of his Shraddham in India. Shraddham is the Hindu ceremony where one offers food and prayers to deceased ancestors. This would be his final samskara, his last ritual, and he would have wanted it done correctly. But the Shraddham is also my rite of passage. For thirteen days after a parent&#x27;s death, the eldest child must perform these daily rituals. On the 12th day, he becomes a pitr, an ancestral spirit.&lt;&#x2F;p&gt;
&lt;p&gt;Offering ghee to the fire with &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Ficus_racemosa&quot;&gt;atti&lt;&#x2F;a&gt; leaves (from the same berry-laden branches found on &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;x.com&#x2F;khoomeik&#x2F;status&#x2F;1878735157517287532#m&quot;&gt;IVC seals&lt;&#x2F;a&gt; from four thousand years ago), chanting Vedic hymns, and invoking the Puranic gods, I was part of an unbroken chain, first-born sons performing these same acts across generations. Once I would have found it macabre picking up skeletal remains of my cremated father. Over the two days, any misapprehensions I might have had about things said or left unsaid to my father disappeared. It was a privilege for him to be sent this way, and it was a privilege for me to send him in this manner.&lt;&#x2F;p&gt;
&lt;p&gt;I took his ashes to Srirangapatnam, where the Kaveri River was in full monsoon spate, and watched them dissolve into waters that have carried such offerings for millennia. Back in California, I continue the daily ritual: rice, ghee, and sesame seeds offered to quench his spirit. In India, these would go to crows who carry offerings to ancestors. The Bay Area has no such crows that understand their ritually sanctioned role, so the pindam finds its way to the creek near my home, into the stomachs of ducks, geese, and fish.&lt;&#x2F;p&gt;
&lt;figure style=&quot;text-align:center;&quot;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;appa&#x2F;cali-creek.webp&quot;
       alt=&quot;A much familiar Californian stream&quot;
       class=&quot;center&quot;
       style=&quot;max-height: 600px; width: auto; pointer-events: none;&quot;&gt;
  &lt;figcaption&gt;A much familiar Californian stream&lt;&#x2F;figcaption&gt;
  
    &lt;small style=&quot;font-size: 0.8em; color: #777;&quot;&gt;&amp;copy; Abhishek Sundararajan. All Rights Reserved.&lt;&#x2F;small&gt;
  
&lt;&#x2F;figure&gt;
&lt;p&gt;He now traverses two rivers, in two countries, thirteen thousand miles apart.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-remains&quot;&gt;What Remains&lt;&#x2F;h2&gt;
&lt;p&gt;Modern medicine offered my father only procedures that prolonged his suffering without extending meaningful life. When cure is possible, medicine is miraculous. When cure is impossible, it becomes torture. For making peace with end of life, ritual tradition hints at one framework for accepting death with dignity, a way to transform loss into connection across generations. Death was once widely accepted and everyone had to prepare for it in advance - it&#x27;s a samskara after all. Gawande&#x27;s research confirms what this preparation accomplished. In the context of hospice care, he notes:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Two-thirds of the terminal cancer patients in the Coping with Cancer study reported having had no discussion with their doctors about their goals for end-of-life care, despite being, on average, just four months from death. But the third who did have discussions were far less likely to undergo cardiopulmonary resuscitation or be put on a ventilator or end up in an intensive care unit...In other words, &lt;em&gt;people who had substantive discussions with their doctor about their end-of-life preferences were far more likely to die at peace and in control of their situation and to spare their family anguish.&lt;&#x2F;em&gt;&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;The medical system fails to recognize that patients have priorities beyond merely staying alive. This stems partly from our collective inability to accept human limits and largely from hospital incentives that are at odds with patient needs.&lt;&#x2F;p&gt;
&lt;p&gt;Had his doctors read their own literature more honestly, had they practiced the difficult conversations Gawande advocates, my father might have chosen differently. He might have refused Venetoclax, skipped the final round of chemotherapy, focused on comfort rather than cure. He might have died at home instead of in a hospital, surrounded by family rather than monitors.&lt;&#x2F;p&gt;
&lt;p&gt;The rituals continue. They provide a structure for mourning, daily acts that gradually transform the relationship from a living parent to ancestral presence. The mourning period is one year, with the 27th day and 45th day observed by specific rituals, part of a series of monthly observances. Orthodox Hindu traditions, while seemingly frozen in time, are eminently negotiable. Perhaps this is how conservative religious institutions survive, by adapting. The Catholic Church no longer penalizes usury or insists on Latin mass, yet remains unmistakably Catholic. My father&#x27;s being now connects the Indian river of his boyhood and the California creek he explored as a new grandparent. For thousands of years, these rites for his ancestors were contained within Bharatavarsha, the geography named in sankalpa, statement of intent that precedes Hindu rituals. Now it is Ramanakavarshe. The ceremony endures.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Book Notes: Living An Examined Life</title>
        <published>2025-04-29T00:00:00+00:00</published>
        <updated>2025-04-29T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/hollis-examined-life/"/>
        <id>https://asun9.com/hollis-examined-life/</id>
        
        <content type="html" xml:base="https://asun9.com/hollis-examined-life/">&lt;p&gt;Book: &lt;strong&gt;Living an Examined Life: Wisdom for the Second Half of the Journey&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;James Hollis&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The Swiss psychoanalyst Jung has had a remarkable afterlife. His concept of archetypes, popularized by Joseph Campbell as the Hero’s Journey, is the foundational narrative structure for many movies, ranging from Star Wars to Thevar Magan to MCU. Jung’s ideas are central to the academic study of mythology and folklore. This is aside from his impact on the field of psychology and therapy.&lt;&#x2F;p&gt;
&lt;p&gt;James Hollis is a therapist in the Jungian tradition, with over 25 years of practice. For 26 years before that, he was a lecturer and professor. This book was recommended by Oliver Burkeman on Twitter years ago. It was only now that I got to it, during my trip to India, trying to come to grips with a family situation. Given Hollis’s extensive experience and the Burkeman recommendation, I approached this work with more openness than I might typically extend to the genre. If you are in the self-help swamp, it may not have anything new to say. The bull case I can make is that we don’t read such books because of their originality. We read in order to be reminded on occasion what matters. Some notes:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Take responsibility for your life - &quot;Our life begins twice: the day we are born and the day we accept the radical existential fact that our life, for all its delimiting factors, is essentially ours to choose.&quot;
&lt;ul&gt;
&lt;li&gt;You cannot blame circumstances. You must accept that no matter how bad things are, your choice matters.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Break free from patterns - We repeat behaviors from our past because we&#x27;re wired for security. Growth means challenging those patterns.
&lt;ul&gt;
&lt;li&gt;Hollis sees patterns, such as habits, as protective complexes that were originally formed to help us survive or adapt to our early environment, but which often outlive their usefulness. Patterns maintain their grip on us because they feel safer than confronting uncertainty, and operate largely unconsciously.&lt;&#x2F;li&gt;
&lt;li&gt;One must be aware of these patterns in the first place. Therapy helps I suppose, but the next best thing is journaling. Now that we have LLMs, use Claude or ChatGPT to find patterns from your journal entries. The lowest friction option is to create a Claude project for journaling.&lt;&#x2F;li&gt;
&lt;li&gt;It still takes enormous training to not repeat the patterns though. When in the act, one must remember that one is stuck and make a different choice. That is not easy! Hollis doesn&#x27;t suggest one eliminate patterns (though I certainly want that). He wants us to become aware of them, understand their origins, and make more conscious choices.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Face your shadow - Acknowledge the parts of yourself you&#x27;d rather not see. This gives you more energy and authenticity.&lt;&#x2F;li&gt;
&lt;li&gt;Seek meaning over happiness - &quot;Happiness is transient, but meaning abides.&quot;
&lt;ul&gt;
&lt;li&gt;Do what matters to your soul, not what provides temporary comfort. Meaning is a function of the soul, he says, and I interpret that to mean it&#x27;s different for everyone. So look toward yourself, not others.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Move beyond others&#x27; expectations - Stop living someone else&#x27;s script. Your purpose isn&#x27;t to fit in or make your parents proud, but to be yourself.
&lt;ul&gt;
&lt;li&gt;As befits a Jungian, Hollis spends some time on parenting and the constraints it imposes on your relationships.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Embrace uncertainty - Real spiritual growth happens when you get comfortable with not having all the answers.
&lt;ul&gt;
&lt;li&gt;This section was particularly insightful. Modernity means that for the first time, a large portion of the population has been forced to be accountable for their spirituality as individuals rather than deferring to external authority. Many people find this choice overwhelming and retreat to the safety of rigid belief structures.&lt;&#x2F;li&gt;
&lt;li&gt;By existing structures, Hollis meant religious institutions of one&#x27;s parents. I would add that people find safety in disenchantment too, since it&#x27;s easier than ever to be an atheist. It is much harder to maintain openness to mystery when being an atheist is part of your identity, when mainstream discourse frames religiosity as naive or misguided.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Show up authentically - &quot;All we are asked to do by history, the gods, nature, or fate is to show up as who we really are.&quot;
&lt;ul&gt;
&lt;li&gt;&quot;... the meaning of our life will be a direct function of the degree to which we became more nearly ourselves, showed up as best we could in the face of the difficulties that life presented.&quot;&lt;&#x2F;li&gt;
&lt;li&gt;Authenticity is aligning external choices with what feels true internally, even when uncomfortable. It is expressing genuine thoughts and feelings rather than what you think the other person wants to hear. It is pursuing one&#x27;s curiosity over what impresses others.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Aside from the quibbles I have noted above, I feel a larger dissonance with Hollis&#x27;s approach. The focus on individuality and personal choice feels disconnected from the reality of how humans have historically found meaning and stability. The modern emphasis on radical individualism ignores how social frameworks and shared obligations create contexts in which meaningful lives can flourish. Traditional structures automate certain choices, freeing up mental and emotional bandwidth. Yes, these traditions come with their own costs: one often ends up following predetermined paths like taking up one&#x27;s father&#x27;s profession, while women disproportionately shoulder household responsibilities. A cop out would be to say the middle ground is the best, and the middle ground is people exercising their choice and finding ways to embed oneself in community and tradition. That may not be an entirely wrong approach.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Between The Two Mysteries</title>
        <published>2025-04-27T00:00:00+00:00</published>
        <updated>2025-04-27T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/two-mysteries/"/>
        <id>https://asun9.com/two-mysteries/</id>
        
        <content type="html" xml:base="https://asun9.com/two-mysteries/">&lt;p&gt;Appa was the fittest person I knew. Certainly in his age cohort, though he could out-walk me on occasion when I would take him on the trail. He worked out everyday, looking up exercises on YouTube. Strength was a priority. So was endurance.&lt;&#x2F;p&gt;
&lt;p&gt;Every morning he would get up, brush his teeth, have his coffee, and then start with his exercises. Sixty minutes, sometimes two hours. He would track his heart rate on Fitbit and share it on the family group. Then he would have his protein milkshake, a concoction he made himself by grinding various nuts and legumes.&lt;&#x2F;p&gt;
&lt;p&gt;He expected to outlast Amma, who was having issues with her back and hand. Amma never exercised. While she could be browbeaten into helping Appa make his food and adhere to his particular diet, she never gave in to his demands to maintain a more active lifestyle.&lt;&#x2F;p&gt;
&lt;p&gt;Even when Appa was diagnosed with lymphoma and was undergoing chemotherapy, he did not relax his schedule. Not at first. Over the course of the year, as the disease progressed and survived one treatment after another, he gradually slowed down. His back was giving him trouble. The doctors said it was alright and he should deal with it. It was painful enough that he couldn&#x27;t carry his granddaughter.&lt;&#x2F;p&gt;
&lt;p&gt;It turned out that the last chemo had no impact on the cancer. It only grew, and now there was a malignant fistula in the stomach, along with gastroparesis. He had to be admitted to the hospital immediately, and an attempt would be made to remove part of the stomach if needed, and place a stent to connect the intestines to esophagus.&lt;&#x2F;p&gt;
&lt;p&gt;When I rushed back home, Appa was no longer the man I recognized even from a few weeks earlier. He had lost weight, to the tune of 1 kg a day. Tubes were sticking out of his body. One connected to intestines. For feeding. Another to the nose, to collect bile. Another in the hand, below the wrists, for medicines - paracetamol, ultracet. I was told that in the hospital he had a tube in the neck for the painkillers.&lt;&#x2F;p&gt;
&lt;p&gt;Appa always enjoyed his food. He would make large meals, and insisted on eating something different each day. Now he had to be fed by a nurse who would stuff formula in the tube six times a day. His hands were too weak to prop him up, not to mention his legs. The nurse had to clean him and help him between rooms.&lt;&#x2F;p&gt;
&lt;p&gt;While physically he was incapacitated, his mind was still the same. Appa had an enormous sense of agency. He was responsible for his life, and he would make decisions and act on them. Fast, rarely with a second opinion. After the procedure to place the stent, he was alert, asking the doctor questions about next steps, diet, and progress. The doctor told him that he would be taken care of and not to worry about it. This is not an answer that would have made him happy. It would have made me angry as well - I am his son after all. Back home, he instructed the nurse how to keep records of the aspiration of bile, and Amma about starting on solid food. He wanted to get going with Rituximab, and for that he wanted to get stronger. Right now that meant waiting, and he was not someone to wait.&lt;&#x2F;p&gt;
&lt;p&gt;Waiting.&lt;&#x2F;p&gt;
&lt;p&gt;In Hindu cosmology, one&#x27;s actions create specific consequences that one must experience. These are the Karma Phala, the fruits of karma. In Skanda and Garuda Puranas, there are various hells where punishments directly mirror one&#x27;s earthly obsessions. Take &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.wisdomlib.org&#x2F;definition&#x2F;asipatravana&quot;&gt;Asipatravana&lt;&#x2F;a&gt;, a hell meant for those who destroy the environment. Those thus punished are forced to tread through dense forests where the leaves are as sharp as knives. These descriptions are meant to be metaphorical, intended to drive home the point. You cannot accuse us Hindus of not having a sense of poetic justice. What is it if not ironic that Appa, the lover of good food and robust health, charging through the world, now has to be bed ridden and on liquid diet?&lt;&#x2F;p&gt;
&lt;p&gt;Appa has had a full life. A life that he created for himself. That&#x27;s more than could be said for anyone. He always fought for what he wanted, and he usually got it. Usually. Right now, the best I can hope for is that he takes it in his stride. He will. He&#x27;s a fighter after all, and in exercising choice here he&#x27;s still exercising his agency.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Useful Terminal Commands</title>
        <published>2025-04-19T00:00:00+00:00</published>
        <updated>2025-04-19T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/terminal/"/>
        <id>https://asun9.com/notes/terminal/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/terminal/">&lt;h2 id=&quot;find-pdf-files-in-the-current-directory-where-the-content-has-the-search-text&quot;&gt;Find pdf files in the current directory where the content has the search text.&lt;&#x2F;h2&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;rg --files-with-matches --binary --iglob &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;*.pdf&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt; llama
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;By default, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;BurntSushi&#x2F;ripgrep&quot;&gt;ripgrep&lt;&#x2F;a&gt; will not search binary files like pdf. For other kinds of files, this will do:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;rg --files-with-matches&lt;&#x2F;span&gt;&lt;span&gt; llama
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;if-you-just-want-to-find-pdfs-with-llama-in-the-filename-not-content&quot;&gt;If you just want to find PDFs with “llama” in the filename (not content)&lt;&#x2F;h2&gt;
&lt;p&gt;Via &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;sharkdp&#x2F;fd&quot;&gt;fd&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;fd -i&lt;&#x2F;span&gt;&lt;span&gt; llama&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt; --extension&lt;&#x2F;span&gt;&lt;span&gt; pdf
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;code&gt;-i&lt;&#x2F;code&gt; tells &lt;code&gt;fd&lt;&#x2F;code&gt; to ignore case.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>System Design Components and Trade Offs</title>
        <published>2025-04-10T00:00:00+00:00</published>
        <updated>2025-04-10T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/sys-design-trade-offs/"/>
        <id>https://asun9.com/notes/sys-design-trade-offs/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/sys-design-trade-offs/">&lt;h2 id=&quot;key-considerations-for-ml-system-design&quot;&gt;Key Considerations for ML System Design&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Data Volume &amp;amp; Velocity&lt;&#x2F;strong&gt;: How much data needs to be processed and at what rate&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Model Training Requirements&lt;&#x2F;strong&gt;: Frequency, computational needs, and distribution strategy&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Inference Latency&lt;&#x2F;strong&gt;: Real-time vs. batch prediction requirements&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Feature Store Needs&lt;&#x2F;strong&gt;: How features are computed, stored, and served&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Monitoring &amp;amp; Observability&lt;&#x2F;strong&gt;: How to track system health and model performance&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Component&lt;&#x2F;th&gt;&lt;th&gt;Minimal Scale (100 users)&lt;&#x2F;th&gt;&lt;th&gt;Medium Scale (10,000 users)&lt;&#x2F;th&gt;&lt;th&gt;Large Scale (1B users)&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;API Gateway&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Simple API server with basic rate limiting&lt;br&gt;• Single deployment in one region&lt;br&gt;• Direct connection to backend services&lt;br&gt;• Minimal authentication&lt;&#x2F;td&gt;&lt;td&gt;• Dedicated API gateway with caching capabilities&lt;br&gt;• Advanced authentication&#x2F;authorization (OAuth, JWT)&lt;br&gt;• Custom rate limiting and throttling&lt;br&gt;• Basic request validation and transformation&lt;br&gt;• Health checks and circuit breakers&lt;&#x2F;td&gt;&lt;td&gt;• Global API gateway mesh with edge locations&lt;br&gt;• Advanced traffic management with canary deployments&lt;br&gt;• API versioning and lifecycle management&lt;br&gt;• Sophisticated rate limiting with ML-based anomaly detection&lt;br&gt;• Automated documentation and developer portal&lt;br&gt;• GraphQL federation for complex data requirements&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Databases: Key-Value Store&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Single-instance Redis&#x2F;DynamoDB for caching and session management&lt;br&gt;• In-memory operation with basic persistence&lt;br&gt;• Simple key patterns for lookups&lt;&#x2F;td&gt;&lt;td&gt;• Redis cluster with read replicas&lt;br&gt;• Cache invalidation strategies&lt;br&gt;• Persistence for resilience&lt;br&gt;• More complex key patterns&lt;br&gt;• Basic monitoring&lt;&#x2F;td&gt;&lt;td&gt;• Globally distributed key-value store (Redis Enterprise, DynamoDB global tables)&lt;br&gt;• Multi-region replication with conflict resolution&lt;br&gt;• Hierarchical caching (local, regional, global)&lt;br&gt;• Auto-scaling based on traffic patterns&lt;br&gt;• Advanced performance optimization&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Databases: Blob Store&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Single S3 bucket or Azure Blob Storage&lt;br&gt;• Basic organization with folders&#x2F;prefixes&lt;br&gt;• Manual backup procedures&lt;br&gt;• Simple access patterns&lt;&#x2F;td&gt;&lt;td&gt;• Regional blob storage with CDN integration&lt;br&gt;• Automated lifecycle policies (archiving, deletion)&lt;br&gt;• Access patterns optimization&lt;br&gt;• Backup and disaster recovery procedures&lt;br&gt;• Basic data tiering&lt;&#x2F;td&gt;&lt;td&gt;• Multi-region blob storage with automatic replication&lt;br&gt;• Content-aware routing and caching&lt;br&gt;• Tiered storage for hot&#x2F;warm&#x2F;cold data&lt;br&gt;• Encryption and compliance controls&lt;br&gt;• Custom metadata indexing for faster searches&lt;br&gt;• Intelligent data placement based on access patterns&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Databases: OLTP&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Single instance PostgreSQL&#x2F;MySQL&lt;br&gt;• Basic indexing for common queries&lt;br&gt;• Regular backup schedule&lt;br&gt;• Simple schema design&lt;&#x2F;td&gt;&lt;td&gt;• Primary-replica setup with read replicas&lt;br&gt;• Connection pooling and query optimization&lt;br&gt;• Advanced indexing strategies&lt;br&gt;• Regular performance tuning&lt;br&gt;• Automated backups and point-in-time recovery&lt;&#x2F;td&gt;&lt;td&gt;• Horizontally sharded database clusters&lt;br&gt;• Multi-region deployment with cross-region replication&lt;br&gt;• Automated schema management&lt;br&gt;• Query routing based on data locality&lt;br&gt;• Automated performance optimization&lt;br&gt;• Zero-downtime schema changes&lt;br&gt;• Multi-tenant isolation where needed&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Databases: OLAP&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Analytics queries run directly on OLTP database during off-peak&lt;br&gt;• Basic reporting using SQL queries&lt;br&gt;• Manual data exports for analysis&lt;br&gt;• Simple aggregations&lt;&#x2F;td&gt;&lt;td&gt;• Dedicated columnar database (Redshift, BigQuery, Snowflake)&lt;br&gt;• ETL pipelines for data loading&lt;br&gt;• Pre-aggregated views for common queries&lt;br&gt;• Basic data modeling and schema design&lt;br&gt;• Scheduled reporting&lt;&#x2F;td&gt;&lt;td&gt;• Distributed data warehouse with compute&#x2F;storage separation&lt;br&gt;• Multi-region deployment for global analysis&lt;br&gt;• Materialized views and advanced indexing&lt;br&gt;• Query federation across data sources&lt;br&gt;• ML-powered query optimization&lt;br&gt;• Real-time analytics capabilities&lt;br&gt;• Self-service analytics with governance&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Pub&#x2F;Sub Systems&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Simple message queue (RabbitMQ, SQS)&lt;br&gt;• Basic producer&#x2F;consumer patterns&lt;br&gt;• Retry logic for failed operations&lt;br&gt;• Single instance deployment&lt;&#x2F;td&gt;&lt;td&gt;• Managed Kafka&#x2F;EventHub with multiple partitions&lt;br&gt;• Topic-based routing&lt;br&gt;• Consumer groups for parallel processing&lt;br&gt;• Dead-letter queues for failed messages&lt;br&gt;• Message schema management&lt;br&gt;• Regional deployment&lt;&#x2F;td&gt;&lt;td&gt;• Global event mesh with multi-region Kafka clusters&lt;br&gt;• Cross-region replication with conflict resolution&lt;br&gt;• Schema registry and evolution management&lt;br&gt;• Stream processing integration (Kafka Streams, KSQL)&lt;br&gt;• Event sourcing patterns for system state&lt;br&gt;• Real-time analytics on message streams&lt;br&gt;• Sophisticated failure handling and disaster recovery&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;ML Training Infrastructure&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Local training or single-instance VM&lt;br&gt;• Manual experiment tracking&lt;br&gt;• Basic version control for models&lt;br&gt;• Single GPU&#x2F;CPU for training&lt;br&gt;• Simple data preprocessing&lt;&#x2F;td&gt;&lt;td&gt;• Dedicated training cluster with auto-scaling&lt;br&gt;• Experiment tracking platform (MLflow, Weights &amp;amp; Biases)&lt;br&gt;• Hyperparameter optimization&lt;br&gt;• Model registry and versioning&lt;br&gt;• Pipeline scheduling&lt;br&gt;• Preemptible instances for cost savings&lt;&#x2F;td&gt;&lt;td&gt;• Distributed training platform&lt;br&gt;• Specialized hardware acceleration (TPUs&#x2F;GPUs)&lt;br&gt;• Automated neural architecture search&lt;br&gt;• Continuous training pipelines&lt;br&gt;• Multi-tenant training environment&lt;br&gt;• Hardware-aware scheduling&lt;br&gt;• Cost-optimized resource allocation&lt;br&gt;• Advanced experimentation frameworks&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Feature Store&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Feature computation within application code&lt;br&gt;• Manual feature engineering&lt;br&gt;• Static feature definitions&lt;br&gt;• Limited feature reuse&lt;&#x2F;td&gt;&lt;td&gt;• Dedicated feature store with offline&#x2F;online storage&lt;br&gt;• Feature versioning and lineage tracking&lt;br&gt;• Batch feature computation&lt;br&gt;• Feature sharing across models&lt;br&gt;• Basic feature documentation&lt;&#x2F;td&gt;&lt;td&gt;• Distributed feature platform&lt;br&gt;• Real-time feature computation&lt;br&gt;• Time-travel capabilities for point-in-time lookups&lt;br&gt;• Automated feature discovery&lt;br&gt;• Feature monitoring and drift detection&lt;br&gt;• Access control and governance&lt;br&gt;• Feature importance tracking across models&lt;br&gt;• Self-service feature creation with quality checks&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Model Serving&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Direct model inference in application&lt;br&gt;• Pre-computed predictions for common cases&lt;br&gt;• Manual model updates&lt;br&gt;• Single model version in production&lt;&#x2F;td&gt;&lt;td&gt;• Dedicated model serving with basic A&#x2F;B testing&lt;br&gt;• Model versioning and canary deployments&lt;br&gt;• Batching for higher throughput&lt;br&gt;• Basic monitoring of prediction quality&lt;br&gt;• Model rollback capabilities&lt;&#x2F;td&gt;&lt;td&gt;• Multi-region inference service with auto-scaling&lt;br&gt;• Model versioning and shadow deployments&lt;br&gt;• Sophisticated A&#x2F;B testing framework&lt;br&gt;• Hardware acceleration for inference&lt;br&gt;• Dynamic batching and adaptive scaling&lt;br&gt;• Feature importance analysis in production&lt;br&gt;• Automated model rollbacks&lt;br&gt;• Explainability for predictions&lt;br&gt;• Prediction caching where appropriate&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;ETL&#x2F;Data Processing&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Batch jobs on application server&lt;br&gt;• Scheduled scripts for data processing&lt;br&gt;• Manual monitoring of job completion&lt;br&gt;• Simple error handling&lt;&#x2F;td&gt;&lt;td&gt;• Dedicated data processing service (Apache Spark)&lt;br&gt;• Workflow orchestration (Airflow, Prefect)&lt;br&gt;• Data quality validation&lt;br&gt;• Job monitoring and alerting&lt;br&gt;• Error handling and retry logic&lt;&#x2F;td&gt;&lt;td&gt;• Distributed stream processing platform (Spark, Flink, Beam)&lt;br&gt;• Real-time and batch processing unified&lt;br&gt;• Data lineage and impact analysis&lt;br&gt;• Automated data quality assurance&lt;br&gt;• Self-service data pipelines&lt;br&gt;• Metadata management and data discovery&lt;br&gt;• Cost-optimized processing strategies&lt;br&gt;• Multi-regional data processing&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Monitoring &amp;amp; Observability&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Basic logging and metrics&lt;br&gt;• Manual alert checking&lt;br&gt;• Simple dashboards&lt;br&gt;• Periodic model evaluation&lt;&#x2F;td&gt;&lt;td&gt;• Comprehensive monitoring with alerts&lt;br&gt;• Centralized logging&lt;br&gt;• Distributed tracing&lt;br&gt;• Model performance monitoring&lt;br&gt;• SLO&#x2F;SLA tracking&lt;br&gt;• Automated performance reporting&lt;&#x2F;td&gt;&lt;td&gt;• End-to-end observability with automated anomaly detection&lt;br&gt;• ML-powered root cause analysis&lt;br&gt;• Prediction explainability tracking&lt;br&gt;• Correlation between model and business metrics&lt;br&gt;• Automated capacity planning&lt;br&gt;• Real-time visualization of system health&lt;br&gt;• Drift detection across all system components&lt;br&gt;• Self-healing systems where possible&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;h3 id=&quot;scaling-strategies-and-tradeoffs&quot;&gt;Scaling Strategies and Tradeoffs&lt;&#x2F;h3&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Strategy&lt;&#x2F;th&gt;&lt;th&gt;Description&lt;&#x2F;th&gt;&lt;th&gt;Tradeoffs&lt;&#x2F;th&gt;&lt;th&gt;Best Use Cases&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Horizontal Scaling&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Add more instances of same component&lt;br&gt;• Distribute load across instances&lt;br&gt;• Often requires stateless design&lt;&#x2F;td&gt;&lt;td&gt;• &lt;strong&gt;Pro&lt;&#x2F;strong&gt;: Near-linear scaling potential&lt;br&gt;• &lt;strong&gt;Pro&lt;&#x2F;strong&gt;: Better fault tolerance&lt;br&gt;• &lt;strong&gt;Con&lt;&#x2F;strong&gt;: Increased coordination overhead&lt;br&gt;• &lt;strong&gt;Con&lt;&#x2F;strong&gt;: More complex deployment&lt;&#x2F;td&gt;&lt;td&gt;• Stateless services&lt;br&gt;• Web&#x2F;API servers&lt;br&gt;• Model inference&lt;br&gt;• Distributed training&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Vertical Scaling&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Increase resources for individual components&lt;br&gt;• Add more CPU&#x2F;RAM&#x2F;GPU to existing machines&lt;&#x2F;td&gt;&lt;td&gt;• &lt;strong&gt;Pro&lt;&#x2F;strong&gt;: Simpler to implement&lt;br&gt;• &lt;strong&gt;Pro&lt;&#x2F;strong&gt;: No coordination overhead&lt;br&gt;• &lt;strong&gt;Con&lt;&#x2F;strong&gt;: Hardware limits&lt;br&gt;• &lt;strong&gt;Con&lt;&#x2F;strong&gt;: Higher costs at scale&lt;br&gt;• &lt;strong&gt;Con&lt;&#x2F;strong&gt;: Limited fault tolerance&lt;&#x2F;td&gt;&lt;td&gt;• Database operations&lt;br&gt;• Training workloads&lt;br&gt;• Memory-intensive operations&lt;br&gt;• Early-stage scaling&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Data Partitioning&#x2F;Sharding&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Split data across multiple databases&lt;br&gt;• Partition by user ID, geography, etc.&lt;br&gt;• Different sharding strategies (hash, range, lookup)&lt;&#x2F;td&gt;&lt;td&gt;• &lt;strong&gt;Pro&lt;&#x2F;strong&gt;: Virtually unlimited data scaling&lt;br&gt;• &lt;strong&gt;Con&lt;&#x2F;strong&gt;: Complex cross-shard queries&lt;br&gt;• &lt;strong&gt;Con&lt;&#x2F;strong&gt;: Rebalancing challenges&lt;br&gt;• &lt;strong&gt;Con&lt;&#x2F;strong&gt;: Transaction management complexity&lt;&#x2F;td&gt;&lt;td&gt;• Large-scale data storage&lt;br&gt;• High-throughput OLTP&lt;br&gt;• Feature stores&lt;br&gt;• User data isolation&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Caching Strategies&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Multi-level caching (app, DB, API)&lt;br&gt;• Cache feature vectors for inference&lt;br&gt;• Cache model predictions for common inputs&lt;&#x2F;td&gt;&lt;td&gt;• &lt;strong&gt;Pro&lt;&#x2F;strong&gt;: Dramatic performance improvement&lt;br&gt;• &lt;strong&gt;Pro&lt;&#x2F;strong&gt;: Reduced load on backends&lt;br&gt;• &lt;strong&gt;Con&lt;&#x2F;strong&gt;: Cache consistency challenges&lt;br&gt;• &lt;strong&gt;Con&lt;&#x2F;strong&gt;: Stale data risks&lt;br&gt;• &lt;strong&gt;Con&lt;&#x2F;strong&gt;: Memory consumption&lt;&#x2F;td&gt;&lt;td&gt;• Read-heavy workloads&lt;br&gt;• Repeated computations&lt;br&gt;• Frequent model inference&lt;br&gt;• Static content delivery&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Load Balancing&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Distribute requests across instances&lt;br&gt;• Geographic routing based on location&lt;br&gt;• Workload-aware routing based on capacity&lt;&#x2F;td&gt;&lt;td&gt;• &lt;strong&gt;Pro&lt;&#x2F;strong&gt;: Improved reliability and availability&lt;br&gt;• &lt;strong&gt;Pro&lt;&#x2F;strong&gt;: Better resource utilization&lt;br&gt;• &lt;strong&gt;Con&lt;&#x2F;strong&gt;: Additional infrastructure costs&lt;br&gt;• &lt;strong&gt;Con&lt;&#x2F;strong&gt;: Session management complexity&lt;&#x2F;td&gt;&lt;td&gt;• Web-facing services&lt;br&gt;• API gateways&lt;br&gt;• Global deployments&lt;br&gt;• ML inference services&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Asynchronous Processing&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Move operations to background jobs&lt;br&gt;• Event-driven architecture for decoupling&lt;br&gt;• Retry mechanisms with backoff&lt;&#x2F;td&gt;&lt;td&gt;• &lt;strong&gt;Pro&lt;&#x2F;strong&gt;: Improved user experience&lt;br&gt;• &lt;strong&gt;Pro&lt;&#x2F;strong&gt;: Better handling of traffic spikes&lt;br&gt;• &lt;strong&gt;Con&lt;&#x2F;strong&gt;: Increased system complexity&lt;br&gt;• &lt;strong&gt;Con&lt;&#x2F;strong&gt;: Eventual consistency challenges&lt;&#x2F;td&gt;&lt;td&gt;• Non-critical operations&lt;br&gt;• Data processing pipelines&lt;br&gt;• Model training jobs&lt;br&gt;• Resource-intensive tasks&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;h2 id=&quot;ml-specific-reliability-considerations&quot;&gt;ML-Specific Reliability Considerations&lt;&#x2F;h2&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Consideration&lt;&#x2F;th&gt;&lt;th&gt;Minimal Scale Implementation&lt;&#x2F;th&gt;&lt;th&gt;Medium Scale Implementation&lt;&#x2F;th&gt;&lt;th&gt;Large Scale Implementation&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Model Monitoring&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Basic accuracy tracking&lt;br&gt;• Manual review of model outputs&lt;br&gt;• Simple A&#x2F;B test measurements&lt;&#x2F;td&gt;&lt;td&gt;• Track prediction drift, data drift&lt;br&gt;• Set up retraining triggers based on performance&lt;br&gt;• Monitor feature distribution changes&lt;br&gt;• Automate performance reporting&lt;&#x2F;td&gt;&lt;td&gt;• Real-time monitoring with alerting&lt;br&gt;• Automated detection of model degradation&lt;br&gt;• Continuous evaluation in production&lt;br&gt;• Multi-dimensional performance tracking&lt;br&gt;• Business impact correlation&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Fallback Mechanisms&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Simple defaults when model fails&lt;br&gt;• Manual intervention process&lt;br&gt;• Basic error handling&lt;&#x2F;td&gt;&lt;td&gt;• Implement degraded modes for ML components&lt;br&gt;• Fall back to simpler models when complex ones fail&lt;br&gt;• Maintain rule-based systems as backup&lt;br&gt;• Circuit breakers for failing components&lt;&#x2F;td&gt;&lt;td&gt;• Sophisticated fallback hierarchy&lt;br&gt;• Automatic model switching based on health&lt;br&gt;• Geographic redundancy for models&lt;br&gt;• Graceful service degradation&lt;br&gt;• Self-healing capabilities&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Data Quality&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Basic schema validation&lt;br&gt;• Manual quality checks&lt;br&gt;• Simple alerting on failures&lt;&#x2F;td&gt;&lt;td&gt;• Automated validation at ingestion points&lt;br&gt;• Monitoring for data schema changes&lt;br&gt;• Track upstream data source reliability&lt;br&gt;• Data quality dashboards&lt;&#x2F;td&gt;&lt;td&gt;• Real-time quality validation&lt;br&gt;• Automated quarantine of suspect data&lt;br&gt;• Impact analysis of quality issues&lt;br&gt;• Data lineage tracking&lt;br&gt;• Auto-correction where appropriate&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Experiment Management&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Simple A&#x2F;B testing&lt;br&gt;• Manual analysis of results&lt;br&gt;• Direct model replacements&lt;&#x2F;td&gt;&lt;td&gt;• Controlled deployment of model changes&lt;br&gt;• Progressive rollouts for new models&lt;br&gt;• Track experiment impact on system performance&lt;br&gt;• Formalized experiment design&lt;&#x2F;td&gt;&lt;td&gt;• Sophisticated experimentation platform&lt;br&gt;• Multi-variate testing capabilities&lt;br&gt;• Automated analysis of experiment results&lt;br&gt;• Impact isolation across system components&lt;br&gt;• Experiment guardrails and safety limits&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Model Versioning&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Basic version tracking&lt;br&gt;• Manual deployment of new versions&lt;br&gt;• Simple rollback process&lt;&#x2F;td&gt;&lt;td&gt;• Formal versioning for models and features&lt;br&gt;• Streamlined rollback capabilities&lt;br&gt;• Track model and data lineage&lt;br&gt;• Dedicated model registry&lt;&#x2F;td&gt;&lt;td&gt;• Enterprise model governance&lt;br&gt;• Comprehensive audit trails&lt;br&gt;• Automated compliance verification&lt;br&gt;• Model promotions across environments&lt;br&gt;• Shadow deployments before promotion&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;h1 id=&quot;postgresql-and-elasticsearch-in-large-scale-applications&quot;&gt;PostgreSQL and Elasticsearch in Large-Scale Applications&lt;&#x2F;h1&gt;
&lt;h2 id=&quot;postgresql-for-transactions&quot;&gt;PostgreSQL for Transactions&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Strengths&lt;&#x2F;strong&gt;: ACID transactions, data integrity, complex joins, precise queries&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Use case&lt;&#x2F;strong&gt;: Source of truth, business data, transactional workflows&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Table scans&lt;&#x2F;strong&gt;: Operations where database reads every row (expensive)
&lt;ul&gt;
&lt;li&gt;Sequential Scan: Reads every row in the table&lt;&#x2F;li&gt;
&lt;li&gt;Index Scan: Uses indexes to locate rows&lt;&#x2F;li&gt;
&lt;li&gt;Bitmap Heap Scan: Creates memory bitmap of matching blocks&lt;&#x2F;li&gt;
&lt;li&gt;Index Only Scan: Retrieves data directly from index&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;PostgreSQL Scale Numbers&lt;&#x2F;strong&gt;:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Database size&lt;&#x2F;strong&gt;: Practical limit ~100TB for a single instance, multi-PB with sharding&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Table size&lt;&#x2F;strong&gt;: Individual tables can reach 32TB&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Row count&lt;&#x2F;strong&gt;: Billions of rows possible with proper indexing&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Transactions&lt;&#x2F;strong&gt;: 10,000-20,000 TPS on well-tuned systems&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Query performance&lt;&#x2F;strong&gt;: Sub-millisecond for indexed point queries, seconds for complex analytics&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;elasticsearch-for-search&quot;&gt;Elasticsearch for Search&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Document-based search engine&lt;&#x2F;strong&gt; storing data as JSON documents&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Inverted index&lt;&#x2F;strong&gt; maps terms to documents (opposite of traditional indexes)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Near real-time&lt;&#x2F;strong&gt;: Documents become searchable after refresh (default: 1 second)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;elasticsearch-scaling-architecture&quot;&gt;Elasticsearch Scaling Architecture&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Sharding&lt;&#x2F;strong&gt;: Data distributed across multiple shards
&lt;ul&gt;
&lt;li&gt;Each shard is a self-contained Lucene index&lt;&#x2F;li&gt;
&lt;li&gt;Enables horizontal scaling&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Replication&lt;&#x2F;strong&gt;: Primary shards have replica shards
&lt;ul&gt;
&lt;li&gt;Provides redundancy and fault tolerance&lt;&#x2F;li&gt;
&lt;li&gt;Increases search throughput with parallel execution&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Distributed search&lt;&#x2F;strong&gt;: Queries broadcast to relevant shards, results merged&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;effective-elasticsearch-writing-strategies&quot;&gt;Effective Elasticsearch Writing Strategies&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Bulk indexing&lt;&#x2F;strong&gt;: Use _bulk API (1,000-5,000 docs per request)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Refresh control&lt;&#x2F;strong&gt;: Adjust intervals based on workload needs&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Synchronization&lt;&#x2F;strong&gt; from PostgreSQL:
&lt;ul&gt;
&lt;li&gt;Change Data Capture (CDC) frequency: Real-time to every few minutes depending on requirements&lt;&#x2F;li&gt;
&lt;li&gt;Real-time CDC: Logical decoding with tools like Debezium (milliseconds latency)&lt;&#x2F;li&gt;
&lt;li&gt;Batch CDC: Every 5-15 minutes for lower overhead&lt;&#x2F;li&gt;
&lt;li&gt;Overnight sync: For full rebuilds or reconciliation&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;performance-considerations&quot;&gt;Performance Considerations&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Separate client&#x2F;coordinating nodes from data nodes&lt;&#x2F;li&gt;
&lt;li&gt;Configure appropriate heap sizes&lt;&#x2F;li&gt;
&lt;li&gt;Implement backpressure handling&lt;&#x2F;li&gt;
&lt;li&gt;Monitor indexing queues and thread pools&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;This architecture combines PostgreSQL&#x27;s transactional strength with Elasticsearch&#x27;s search capabilities, creating a robust foundation for large-scale applications like Yelp or Uber.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;kubeflow-vs-airflow-vs-dataflow-comparison&quot;&gt;Kubeflow vs Airflow vs Dataflow Comparison&lt;&#x2F;h1&gt;
&lt;h2 id=&quot;performance-architecture-comparison&quot;&gt;Performance &amp;amp; Architecture Comparison&lt;&#x2F;h2&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Feature&lt;&#x2F;th&gt;&lt;th&gt;Kubeflow&lt;&#x2F;th&gt;&lt;th&gt;Apache Airflow&lt;&#x2F;th&gt;&lt;th&gt;Apache&#x2F;Google Dataflow&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Primary Focus&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;ML-specific workflow orchestration on Kubernetes&lt;&#x2F;td&gt;&lt;td&gt;General-purpose workflow orchestration&lt;&#x2F;td&gt;&lt;td&gt;Unified stream and batch data processing&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Execution Environment&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Kubernetes pods&lt;&#x2F;td&gt;&lt;td&gt;Server-based or Kubernetes pods via operator&lt;&#x2F;td&gt;&lt;td&gt;Managed service (Google Cloud) or self-hosted&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Task Definition&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Docker containers&lt;&#x2F;td&gt;&lt;td&gt;Python code&lt;&#x2F;td&gt;&lt;td&gt;Apache Beam SDK (Java, Python, Go)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Horizontal Scalability&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;High (leverages Kubernetes)&lt;&#x2F;td&gt;&lt;td&gt;Medium (depends on executor)&lt;&#x2F;td&gt;&lt;td&gt;Very High (auto-scaling)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Parallel Processing&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Container-based parallelism (dynamic, independent scaling of components)&lt;&#x2F;td&gt;&lt;td&gt;Task-based parallelism (fixed concurrency limits, uniform resource allocation)&lt;&#x2F;td&gt;&lt;td&gt;Stream and batch parallelism with dynamic auto-scaling&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Minimum Latency&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Sub-minute (Kubernetes-dependent)&lt;&#x2F;td&gt;&lt;td&gt;~1 minute intervals&lt;&#x2F;td&gt;&lt;td&gt;Sub-second for streaming&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Resource Utilization&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;High (needs significant CPU&#x2F;memory)&lt;&#x2F;td&gt;&lt;td&gt;Moderate&lt;&#x2F;td&gt;&lt;td&gt;Optimized (elastic scaling)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Setup Complexity&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Complex (requires Kubernetes expertise)&lt;&#x2F;td&gt;&lt;td&gt;Moderate&lt;&#x2F;td&gt;&lt;td&gt;Low (as a managed service)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Operational Overhead&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;High&lt;&#x2F;td&gt;&lt;td&gt;Medium&lt;&#x2F;td&gt;&lt;td&gt;Low (managed service)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Community Size&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Medium-growing&lt;&#x2F;td&gt;&lt;td&gt;Large and active&lt;&#x2F;td&gt;&lt;td&gt;Medium&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Best For&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;ML workflows, distributed training&lt;&#x2F;td&gt;&lt;td&gt;Complex DAG orchestration, scheduling&lt;&#x2F;td&gt;&lt;td&gt;Heavy data processing pipelines&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;h2 id=&quot;feature-comparison-for-data-processing&quot;&gt;Feature Comparison for Data Processing&lt;&#x2F;h2&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Feature&lt;&#x2F;th&gt;&lt;th&gt;Kubeflow&lt;&#x2F;th&gt;&lt;th&gt;Apache Airflow&lt;&#x2F;th&gt;&lt;th&gt;Apache&#x2F;Google Dataflow&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Data Processing Capability&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Through containers&#x2F;operators&lt;&#x2F;td&gt;&lt;td&gt;Limited (orchestration only)&lt;&#x2F;td&gt;&lt;td&gt;Native and powerful&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;ML Libraries Integration&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Native (TF, PyTorch, scikit-learn, etc.)&lt;&#x2F;td&gt;&lt;td&gt;Through operators&lt;&#x2F;td&gt;&lt;td&gt;Through Beam SDK&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;DAG Complexity Support&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Limited compared to Airflow&lt;&#x2F;td&gt;&lt;td&gt;Very high&lt;&#x2F;td&gt;&lt;td&gt;Medium&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Error Handling&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Basic, manual implementation needed&lt;&#x2F;td&gt;&lt;td&gt;Advanced (retries, callbacks, etc.)&lt;&#x2F;td&gt;&lt;td&gt;Advanced (dead-letter queuing)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Monitoring&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Kubernetes-based + Tensorboard&lt;&#x2F;td&gt;&lt;td&gt;Native metrics &amp;amp; logging&lt;&#x2F;td&gt;&lt;td&gt;Advanced monitoring in GCP&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Hyperparameter Tuning&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Built-in (Katib)&lt;&#x2F;td&gt;&lt;td&gt;Must implement manually&lt;&#x2F;td&gt;&lt;td&gt;Must implement manually&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Experiment Tracking&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Built-in&lt;&#x2F;td&gt;&lt;td&gt;Must implement manually&lt;&#x2F;td&gt;&lt;td&gt;Must implement manually&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Templating&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Limited&lt;&#x2F;td&gt;&lt;td&gt;Extensive (Jinja2)&lt;&#x2F;td&gt;&lt;td&gt;Through Beam SDK&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;UI for Visualization&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Comprehensive dashboard&lt;&#x2F;td&gt;&lt;td&gt;Comprehensive dashboard&lt;&#x2F;td&gt;&lt;td&gt;GCP Console&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Independant Job Scaling&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Yes - each component runs in separate pod&lt;&#x2F;td&gt;&lt;td&gt;Limited by executor&lt;&#x2F;td&gt;&lt;td&gt;Yes - autoscaling based on workload&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;h2 id=&quot;when-to-choose-each-tool-for-data-processing&quot;&gt;When to Choose Each Tool for Data Processing&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;choose-kubeflow-when&quot;&gt;Choose Kubeflow When:&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;You need to run highly parallel, resource-intensive data processing jobs&lt;&#x2F;li&gt;
&lt;li&gt;Your team already uses Kubernetes for other workloads&lt;&#x2F;li&gt;
&lt;li&gt;You want built-in ML-specific capabilities alongside data processing&lt;&#x2F;li&gt;
&lt;li&gt;You need to scale each component of your pipeline independently&lt;&#x2F;li&gt;
&lt;li&gt;Your data processing requires specialized hardware like GPUs&#x2F;TPUs&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;choose-airflow-when&quot;&gt;Choose Airflow When:&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;You need complex workflow orchestration with sophisticated dependencies&lt;&#x2F;li&gt;
&lt;li&gt;Your data processing logic is primarily in Python&lt;&#x2F;li&gt;
&lt;li&gt;You want maximum flexibility in workflow definition&lt;&#x2F;li&gt;
&lt;li&gt;You need excellent error handling and recovery mechanisms&lt;&#x2F;li&gt;
&lt;li&gt;You have complex scheduling requirements&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;choose-dataflow-when&quot;&gt;Choose Dataflow When:&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;You need the best performance for data processing at scale&lt;&#x2F;li&gt;
&lt;li&gt;Your workloads have variable demand requiring elastic scaling&lt;&#x2F;li&gt;
&lt;li&gt;You want minimal operational overhead (managed service)&lt;&#x2F;li&gt;
&lt;li&gt;You need both streaming and batch processing in the same pipeline&lt;&#x2F;li&gt;
&lt;li&gt;You want optimized cost management based on actual resource usage&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;integration-options&quot;&gt;Integration Options&lt;&#x2F;h2&gt;
&lt;p&gt;For optimal data processing architecture, many organizations use:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Airflow to orchestrate the overall workflow&lt;&#x2F;li&gt;
&lt;li&gt;Kubeflow for ML-specific components with custom resource requirements&lt;&#x2F;li&gt;
&lt;li&gt;Dataflow for heavy data processing tasks&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;This combination leverages the strengths of each tool while minimizing their weaknesses.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;kubeflow-airflow-and-dataflow-parallelism-models&quot;&gt;Kubeflow, Airflow, and Dataflow: Parallelism Models&lt;&#x2F;h1&gt;
&lt;p&gt;The three platforms implement fundamentally different approaches to parallelism, which significantly impacts their suitability for different data processing workloads:&lt;&#x2F;p&gt;
&lt;h3 id=&quot;kubeflow-container-based-parallelism&quot;&gt;Kubeflow: Container-Based Parallelism&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Each component runs in independent Kubernetes pods&lt;&#x2F;li&gt;
&lt;li&gt;Dynamic scaling based on workload and resource needs&lt;&#x2F;li&gt;
&lt;li&gt;Components can scale horizontally independent of each other&lt;&#x2F;li&gt;
&lt;li&gt;No central resource allocation - leverages Kubernetes scheduler&lt;&#x2F;li&gt;
&lt;li&gt;Ideal for heterogeneous workloads with varying resource requirements&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;apache-airflow-task-based-parallelism&quot;&gt;Apache Airflow: Task-Based Parallelism&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Centralized concurrency control through executor configuration&lt;&#x2F;li&gt;
&lt;li&gt;Fixed number of tasks executed simultaneously (configured globally)&lt;&#x2F;li&gt;
&lt;li&gt;Uniform resource allocation across parallel tasks&lt;&#x2F;li&gt;
&lt;li&gt;Limited by worker pool capacity&lt;&#x2F;li&gt;
&lt;li&gt;More suitable for orchestration than heavy data processing&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;apache-google-dataflow-stream-batch-parallelism&quot;&gt;Apache&#x2F;Google Dataflow: Stream&#x2F;Batch Parallelism&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Purpose-built for data processing at scale&lt;&#x2F;li&gt;
&lt;li&gt;Auto-scaling based on data volume and processing requirements&lt;&#x2F;li&gt;
&lt;li&gt;Fine-grained parallelism within a processing job&lt;&#x2F;li&gt;
&lt;li&gt;Dynamic resource allocation based on workload characteristics&lt;&#x2F;li&gt;
&lt;li&gt;Specialized for high-throughput data transformations&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;key-considerations-for-data-processing-workloads&quot;&gt;Key Considerations for Data Processing Workloads&lt;&#x2F;h2&gt;
&lt;p&gt;When evaluating these tools for data processing, consider:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Component Independence&lt;&#x2F;strong&gt;: Kubeflow provides the strongest isolation between components, with each running in separate containers that can scale independently.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Resource Efficiency&lt;&#x2F;strong&gt;: Dataflow offers the most efficient resource utilization with elastic scaling, while Kubeflow requires more resources but provides greater flexibility, and Airflow is the least resource-efficient for data processing.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Orchestration vs. Processing&lt;&#x2F;strong&gt;: Airflow excels at orchestration but requires integration with processing engines, while Kubeflow and Dataflow combine orchestration with processing capabilities.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Scaling Granularity&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Kubeflow: Component-level scaling (each step can scale independently)&lt;&#x2F;li&gt;
&lt;li&gt;Airflow: Worker-level scaling (all tasks share the same worker pool)&lt;&#x2F;li&gt;
&lt;li&gt;Dataflow: Data-driven auto-scaling (scales based on processing demands)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Operational Complexity&lt;&#x2F;strong&gt;: Dataflow offers the lowest operational overhead as a managed service, while Kubeflow has the highest due to Kubernetes complexity.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;optimal-usage-patterns&quot;&gt;Optimal Usage Patterns&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;For ML-heavy data processing&lt;&#x2F;strong&gt;: Kubeflow provides the best end-to-end solution with built-in ML capabilities and independent component scaling.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;For complex workflow orchestration with moderate data processing&lt;&#x2F;strong&gt;: Apache Airflow with KubernetesPodOperator can strike a balance between orchestration flexibility and processing power.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;For high-volume data processing pipelines&lt;&#x2F;strong&gt;: Apache&#x2F;Google Dataflow delivers the best performance and resource efficiency for pure data transformation workloads.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Hybrid approach&lt;&#x2F;strong&gt;: Many organizations use Airflow to orchestrate the overall workflow, triggering Kubeflow for ML workloads and Dataflow for heavy data processing.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;For horizontally scalable data processing components where each step has different resource requirements and scaling characteristics, Kubeflow offers the most natural fit with its container-based parallelism model.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>UI Navigation: Agent S vs Agent S2</title>
        <published>2025-04-06T00:00:00+00:00</published>
        <updated>2025-04-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/ui-agents/"/>
        <id>https://asun9.com/notes/ui-agents/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/ui-agents/">&lt;p&gt;Notes from two papers on building UI Navigation Agents:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2410.08164&quot;&gt;Agent S: An Open Agentic Framework that Uses Computers Like a Human&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2504.00906&quot;&gt;Agent S2: A Compositional Generalist-Specialist Framework for Computer Use Agents&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h1 id=&quot;agent-s-an-open-agentic-framework-that-uses-computers-like-a-human&quot;&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2410.08164&quot;&gt;Agent S: An Open Agentic Framework that Uses Computers Like a Human&lt;&#x2F;a&gt;&lt;&#x2F;h1&gt;
&lt;p&gt;The framework integrates three main strategies in a closed loop: experience-augmented hierarchical planning, continual update of narrative and episodic memory, and an Agent-Computer Interface for precise perception and action on GUIs.&lt;&#x2F;p&gt;
&lt;p&gt;The key components include:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Manager: Plans high-level tasks by breaking them down into manageable subtasks. It uses both external web-based knowledge and internal task-specific experience from narrative memory.&lt;&#x2F;li&gt;
&lt;li&gt;Workers: Execute individual subtasks by drawing from episodic memory for detailed, step-by-step experiences. Each subtask has its own dedicated worker.&lt;&#x2F;li&gt;
&lt;li&gt;Self-Evaluator: Evaluates performance and generates summaries of experiences that are stored back into memory for future use.&lt;&#x2F;li&gt;
&lt;li&gt;Memory Systems:
&lt;ul&gt;
&lt;li&gt;Narrative Memory: Stores high-level, abstractive task experiences&lt;&#x2F;li&gt;
&lt;li&gt;Episodic Memory: Contains detailed, step-by-step subtask experiences&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Rather than a single loop, it&#x27;s a hierarchical system where:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;The Manager plans the overall task&lt;&#x2F;li&gt;
&lt;li&gt;Multiple Workers execute specific subtasks&lt;&#x2F;li&gt;
&lt;li&gt;The Self-Evaluator reviews performance&lt;&#x2F;li&gt;
&lt;li&gt;Memory is continually updated to improve future performance&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;agent-s-data-flow&quot;&gt;Agent S Data Flow&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Input Processing&lt;&#x2F;strong&gt;: Given a goal and UI screen, the system processes:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;A screenshot of the current UI state&lt;&#x2F;li&gt;
&lt;li&gt;An accessibility tree (containing hierarchical information about UI elements)&lt;&#x2F;li&gt;
&lt;li&gt;These are combined with unique element IDs for precise targeting&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Manager Planning&lt;&#x2F;strong&gt;: The Manager:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Formulates an observation-aware query based on the user task and environment&lt;&#x2F;li&gt;
&lt;li&gt;Retrieves external knowledge (web search) and internal experience (narrative memory)&lt;&#x2F;li&gt;
&lt;li&gt;Fuses these knowledge sources&lt;&#x2F;li&gt;
&lt;li&gt;Creates a sequence of subtasks with contextual information for each&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Worker Execution&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Each subtask is handled by a dedicated Worker&lt;&#x2F;li&gt;
&lt;li&gt;The Worker retrieves relevant subtask experience from episodic memory&lt;&#x2F;li&gt;
&lt;li&gt;It uses a Trajectory Reflector to provide guidance during execution&lt;&#x2F;li&gt;
&lt;li&gt;It generates specific grounded actions (click, type, etc.) to interact with UI elements&lt;&#x2F;li&gt;
&lt;li&gt;Actions are executed via the Agent-Computer Interface (ACI)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Workers execute the task sequentially&lt;&#x2F;strong&gt;, one after the other.
&lt;ul&gt;
&lt;li&gt;Each Worker is specialized for its specific subtask, retrieving the most relevant experiences from memory. This design allows for more focused execution of each step in the overall plan.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Evaluation and Feedback&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;The Self-Evaluator generates experience summaries after subtask completion&lt;&#x2F;li&gt;
&lt;li&gt;These summaries are stored as &quot;textual rewards&quot; in memory&lt;&#x2F;li&gt;
&lt;li&gt;The Manager can adjust plans based on subtask success&#x2F;failure&lt;&#x2F;li&gt;
&lt;li&gt;If a Worker signals FAIL, the Manager can replan with the new environment state&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Memory Systems&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Narrative Memory stores high-level task experiences&lt;&#x2F;li&gt;
&lt;li&gt;Episodic Memory stores detailed subtask experiences&lt;&#x2F;li&gt;
&lt;li&gt;Both are continuously updated through operation&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;why-multiple-workers-instead-of-a-single-worker&quot;&gt;Why multiple workers instead of a single worker?&lt;&#x2F;h2&gt;
&lt;p&gt;Based on the paper, the separation into multiple worker modules appears to be primarily a design choice to maintain modularity and organization rather than a technical necessity. In practice, you could implement this with a single worker that handles each subtask sequentially.&lt;&#x2F;p&gt;
&lt;p&gt;The potential advantages of their multiple worker approach include:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Specialization&lt;&#x2F;strong&gt;: Each worker can focus on retrieving the most relevant experiences for its particular subtask&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Cleaner architecture&lt;&#x2F;strong&gt;: Separating workers logically aligns with the hierarchical task structure&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Isolation&lt;&#x2F;strong&gt;: Failures or issues in one subtask don&#x27;t necessarily contaminate the execution of others&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Memory management&lt;&#x2F;strong&gt;: Each worker has its own retrieval context specific to its subtask&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;But you&#x27;re right that fundamentally they could have designed it with a single worker executing different subtasks sequentially.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;examples-of-subtasks&quot;&gt;Examples of subtasks&lt;&#x2F;h2&gt;
&lt;p&gt;The paper includes several examples of subtasks across different applications:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Example 1: Thunderbird task&lt;&#x2F;strong&gt; (Figure 5)&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Subtask: &quot;Open Account Settings&quot;&lt;&#x2F;li&gt;
&lt;li&gt;Subtask: &quot;Remove the Account&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Example 2: Git repository cloning task&lt;&#x2F;strong&gt; (Figure 8)&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Subtask: &quot;Open Terminal&quot;&lt;&#x2F;li&gt;
&lt;li&gt;Subtask: &quot;Navigate to Home Directory&quot;&lt;&#x2F;li&gt;
&lt;li&gt;Subtask: &quot;Clone the Repository&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Example 3: LibreOffice Impress task&lt;&#x2F;strong&gt; (Figure 9)&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Subtask: &quot;Click on the Tools menu&quot;&lt;&#x2F;li&gt;
&lt;li&gt;Subtask: &quot;Click on the Options... item&quot;&lt;&#x2F;li&gt;
&lt;li&gt;Subtask: &quot;Click on Load&#x2F;Save category&quot;&lt;&#x2F;li&gt;
&lt;li&gt;Subtask: &quot;Double-click on Load&#x2F;Save category&quot;&lt;&#x2F;li&gt;
&lt;li&gt;Subtask: &quot;Click on the General suboption&quot;&lt;&#x2F;li&gt;
&lt;li&gt;Subtask: &quot;Change the time to 3 minutes&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Example 4: VSCode task&lt;&#x2F;strong&gt; (Figure 10)&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Subtask: &quot;Initiate Find and Replace&quot;&lt;&#x2F;li&gt;
&lt;li&gt;Subtask: &quot;Enter the Words&quot;&lt;&#x2F;li&gt;
&lt;li&gt;Subtask: &quot;Replace All Instances&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Each of these subtasks involves specific actions (like clicking on elements or typing text) that are executed by the corresponding worker, which retrieves relevant experiences from episodic memory to guide its execution strategy.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;data-stored-in-memories&quot;&gt;Data Stored in Memories&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;narrative-memory&quot;&gt;Narrative Memory&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Content&lt;&#x2F;strong&gt;: High-level, abstractive task experiences without specific actions&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Structure&lt;&#x2F;strong&gt;: Indexed by observation-aware queries (Q)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Examples&lt;&#x2F;strong&gt;: Success&#x2F;failure summaries of previous similar tasks&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Format&lt;&#x2F;strong&gt;: Textual summaries that omit specific ground actions and focus on strategies&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Purpose&lt;&#x2F;strong&gt;: Provides contextual understanding for effective task planning&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;episodic-memory&quot;&gt;Episodic Memory&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Content&lt;&#x2F;strong&gt;: Detailed, step-by-step subtask experiences with specific grounding actions&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Structure&lt;&#x2F;strong&gt;: Indexed by task query, subtask, and contextual information (⟨Q, si, Csi⟩)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Examples&lt;&#x2F;strong&gt;: Complete plans with specific UI element interactions for subtasks&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Format&lt;&#x2F;strong&gt;: Only includes summaries from successful subtasks (marked as DONE)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Purpose&lt;&#x2F;strong&gt;: Guides low-level execution with precise action sequences&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;memory-usage-in-prompting&quot;&gt;Memory Usage in Prompting&lt;&#x2F;h2&gt;
&lt;p&gt;The paper describes how these memories are incorporated into prompts for the model:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Manager Prompting&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;When a new task arrives, an observation-aware query Q is formulated based on the task and initial observation&lt;&#x2F;li&gt;
&lt;li&gt;This query retrieves relevant web knowledge (Kweb) and narrative memory experiences (Enu)&lt;&#x2F;li&gt;
&lt;li&gt;These are fused together into a single guideline Kfused = LLM(Mn(Q), Kweb)&lt;&#x2F;li&gt;
&lt;li&gt;This fused knowledge is used to prompt the model to generate subtasks&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Worker Prompting&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;For each subtask, a query combining task, subtask, and context retrieves relevant episodic experience&lt;&#x2F;li&gt;
&lt;li&gt;Retrieved experience Esi = Retrieve(Me, ⟨Tu, si, Csi⟩)&lt;&#x2F;li&gt;
&lt;li&gt;This experience is combined with current observations and trajectory reflection&lt;&#x2F;li&gt;
&lt;li&gt;The model is prompted with this combined information to generate a structured response&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Experience Context Fusion&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;The paper describes a formal process: Kfused = LLM(Mn(Q), Kweb)&lt;&#x2F;li&gt;
&lt;li&gt;This suggests they&#x27;re prompting the model to synthesize narrative memory information with external web knowledge&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Continual Memory Update&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;After task completion, the Self-Evaluator generates summaries&lt;&#x2F;li&gt;
&lt;li&gt;These summaries are stored back in memory for future retrieval&lt;&#x2F;li&gt;
&lt;li&gt;For episodic memory: Me ← Save(Me, ⟨Tu, si, Csi⟩, rsi)&lt;&#x2F;li&gt;
&lt;li&gt;For narrative memory: Mn ← Save(Mn, Q, Enu)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;The process creates a feedback loop where experience drives planning and execution, and outcomes are summarized and stored to improve future performance. This experience-augmented approach allows the agent to draw on both external resources and its own past successes and failures when tackling new tasks.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;agent-s2-a-compositional-generalist-specialist-framework-for-computer-use-agents&quot;&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2504.00906&quot;&gt;Agent S2: A Compositional Generalist-Specialist Framework for Computer Use Agents&lt;&#x2F;a&gt;&lt;&#x2F;h1&gt;
&lt;h2 id=&quot;key-innovations&quot;&gt;Key Innovations&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;1-mixture-of-grounding-mog&quot;&gt;1. Mixture of Grounding (MoG)&lt;&#x2F;h3&gt;
&lt;p&gt;Agent S2 addresses the grounding bottleneck through a novel Mixture of Grounding mechanism that routes actions to specialized grounding experts:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Visual Grounding Expert&lt;&#x2F;strong&gt;: Takes language descriptions and generates precise pixel-level coordinates&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Textual Grounding Expert&lt;&#x2F;strong&gt;: Uses OCR for fine-grained text selection and manipulation&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Structural Grounding Expert&lt;&#x2F;strong&gt;: Handles spreadsheet and tabular content interactions programmatically&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;This approach allows the Worker to focus on reasoning while distributing the cognitive load of grounding to appropriate specialists.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;2-proactive-hierarchical-planning&quot;&gt;2. Proactive Hierarchical Planning&lt;&#x2F;h3&gt;
&lt;p&gt;Unlike Agent S&#x27;s more reactive planning approach, Agent S2 introduces Proactive Hierarchical Planning that:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Dynamically adjusts and refines action plans at multiple temporal scales based on new observations&lt;&#x2F;li&gt;
&lt;li&gt;Updates remaining subgoals after each subtask completion&lt;&#x2F;li&gt;
&lt;li&gt;Adapts to evolving observations and recontextualizes the user query&lt;&#x2F;li&gt;
&lt;li&gt;Maintains context from previous subgoals to reduce susceptibility to noise&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;3-compositional-generalist-specialist-framework&quot;&gt;3. Compositional Generalist-Specialist Framework&lt;&#x2F;h3&gt;
&lt;p&gt;Agent S2 moves from the primarily hierarchical design of Agent S to a compositional framework that:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Delegates cognitive responsibilities across various generalist and specialist models&lt;&#x2F;li&gt;
&lt;li&gt;Separates high-level reasoning, low-level execution, and fine-grained grounding&lt;&#x2F;li&gt;
&lt;li&gt;Avoids the limitations of monolithic approaches that rely solely on a single model&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;4-performance-improvements&quot;&gt;4. Performance Improvements&lt;&#x2F;h3&gt;
&lt;p&gt;The paper demonstrates significant performance improvements:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;18.9% and 32.7% relative improvements on OSWorld 15-step and 50-step evaluations&lt;&#x2F;li&gt;
&lt;li&gt;52.8% improvement on WindowsAgentArena&lt;&#x2F;li&gt;
&lt;li&gt;16.5% improvement on AndroidWorld&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;5-test-time-adaptability&quot;&gt;5. Test-Time Adaptability&lt;&#x2F;h3&gt;
&lt;p&gt;Agent S2 shows better scaling with more compute and time steps through:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Adaptive Navigation: Exploring multiple approaches to find UI elements&lt;&#x2F;li&gt;
&lt;li&gt;Adaptive Interaction: Interacting with the same element in different ways&lt;&#x2F;li&gt;
&lt;li&gt;Backward Correction: Correcting small errors from previously completed subgoals&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Overall, Agent S2 represents a significant advancement over Agent S by addressing the core limitations of grounding precision, planning adaptability, and model specialization while demonstrating superior performance across multiple benchmarks.&lt;&#x2F;p&gt;
&lt;p&gt;Thanks for asking for clarification! I was using somewhat vague terms there, so let me explain more precisely how the decision-making works in Agent S2:&lt;&#x2F;p&gt;
&lt;h2 id=&quot;decision-control-in-agent-s2-s-adaptive-approach&quot;&gt;Decision Control in Agent S2&#x27;s Adaptive Approach&lt;&#x2F;h2&gt;
&lt;p&gt;The &quot;adaptive&quot; flexibility in Agent S2 comes from the framework&#x27;s architecture and is controlled by specific components:&lt;&#x2F;p&gt;
&lt;h3 id=&quot;1-the-worker-as-a-gating-mechanism&quot;&gt;1. The Worker as a Gating Mechanism&lt;&#x2F;h3&gt;
&lt;p&gt;The Worker module acts as a decision maker that:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Analyzes the current state of the UI&lt;&#x2F;li&gt;
&lt;li&gt;Decides which grounding expert is most appropriate for the current action&lt;&#x2F;li&gt;
&lt;li&gt;Routes each action to the selected expert (Visual, Textual, or Structural)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;For example, when faced with selecting text in a document, the Worker might first try:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#151515;color:#e8e8d3;&quot;&gt;&lt;code&gt;&lt;span&gt;agent.click(&amp;quot;The last paragraph...&amp;quot;)  &#x2F;&#x2F; Using Visual Grounding Expert
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If it observes this isn&#x27;t precisely selecting the text, it can switch to:&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#151515;color:#e8e8d3;&quot;&gt;&lt;code&gt;&lt;span&gt;agent.highlight_text_span(&amp;quot;Each student...&amp;quot;, &amp;quot;The essay writing...&amp;quot;)  &#x2F;&#x2F; Using Textual Grounding Expert
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;2-the-manager-s-proactive-planning&quot;&gt;2. The Manager&#x27;s Proactive Planning&lt;&#x2F;h3&gt;
&lt;p&gt;After each subtask completion, the Manager:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Examines the latest environmental state&lt;&#x2F;li&gt;
&lt;li&gt;Takes the prior subgoals, latest observation, and original instruction as input&lt;&#x2F;li&gt;
&lt;li&gt;Generates a new set of remaining subgoals if needed&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;For instance, if the intended cell operations didn&#x27;t work as expected in a spreadsheet task, the Manager doesn&#x27;t blindly follow the original plan but generates a modified approach based on the actual state.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-specific-examples-of-adaptive-behavior&quot;&gt;3. Specific Examples of Adaptive Behavior&lt;&#x2F;h3&gt;
&lt;p&gt;In the paper, they identified several specific adaptive behaviors that emerge from this architecture:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Adaptive Navigation&lt;&#x2F;strong&gt;: When the agent tries multiple approaches to find a UI element (e.g., first trying to click directly, then searching through menus)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Adaptive Interaction&lt;&#x2F;strong&gt;: When the agent tries different ways to interact with the same element (e.g., first trying to drag the fill handle, then using direct cell value setting)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Backward Correction&lt;&#x2F;strong&gt;: When the agent notices and fixes errors from previous steps while completing the current subtask&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;These adaptations aren&#x27;t pre-programmed responses but emerge from the framework&#x27;s ability to continuously observe results, reassess the environment, and adjust its approach accordingly.&lt;&#x2F;p&gt;
&lt;p&gt;The key insight is that Agent S2 doesn&#x27;t have a single rigid execution path. Instead, it has a built-in mechanism to continuously evaluate results and switch strategies based on what it observes, making it more robust to the complex and unpredictable nature of GUI interactions.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;execution-comparison-agent-s-vs-agent-s2-with-decision-control&quot;&gt;Execution Comparison: Agent S vs Agent S2 with Decision Control&lt;&#x2F;h2&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Step&lt;&#x2F;th&gt;&lt;th&gt;Agent S&lt;&#x2F;th&gt;&lt;th&gt;Agent S2&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Initial Planning&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Manager&lt;&#x2F;strong&gt;: Retrieves web knowledge and narrative memory to create a fixed plan of subtasks&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Manager&lt;&#x2F;strong&gt;: Retrieves knowledge and creates an initial plan of subtasks&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Input Processing&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Combined Worker&lt;&#x2F;strong&gt;: Processes both accessibility tree + screenshot for element identification&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Worker&lt;&#x2F;strong&gt;: Processes screenshot and decides which grounding expert to use for each action&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Subtask 1: Add Column Header&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Worker for Subtask 1&lt;&#x2F;strong&gt;: Retrieves specific episodic memory, executes all aspects of the subtask including element grounding&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Worker&lt;&#x2F;strong&gt;: Decides to use Structural Grounding Expert&lt;br&gt;&lt;strong&gt;Structural Grounding Expert&lt;&#x2F;strong&gt;: Executes &lt;code&gt;agent.set_cell_values({&quot;D1&quot;: &quot;Profit&quot;}, &quot;soffice&quot;, &quot;Sheet1&quot;)&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Plan Revision&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;None&lt;&#x2F;strong&gt;: Fixed plan continues regardless of outcome&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Manager&lt;&#x2F;strong&gt;: Reassesses environment after subtask completion and potentially updates remaining subtasks based on new observations&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Subtask 2: Enter Formula&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Worker for Subtask 2&lt;&#x2F;strong&gt;: New worker instance handles all aspects including reasoning and grounding&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Worker&lt;&#x2F;strong&gt;: Decides to use Structural Grounding Expert&lt;br&gt;&lt;strong&gt;Structural Grounding Expert&lt;&#x2F;strong&gt;: Executes &lt;code&gt;agent.set_cell_values({&quot;D2&quot;: &quot;=B2-C2&quot;}, &quot;soffice&quot;, &quot;Sheet1&quot;)&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Error Handling (during execution)&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Worker&lt;&#x2F;strong&gt;: If action fails, might retry with slightly adjusted approach based on trajectory reflection&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Worker&lt;&#x2F;strong&gt;: Observes failure, switches to alternative grounding expert&lt;br&gt;&lt;strong&gt;New Expert&lt;&#x2F;strong&gt;: Executes action with different approach&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Subtask 3: Copy Formula&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Worker for Subtask 3&lt;&#x2F;strong&gt;: Attempts to drag the fill handle, handling both planning and execution&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Worker&lt;&#x2F;strong&gt;: First decides to use Visual Grounding Expert&lt;br&gt;&lt;strong&gt;Visual Grounding Expert&lt;&#x2F;strong&gt;: Attempts drag operation&lt;br&gt;&lt;strong&gt;Worker&lt;&#x2F;strong&gt;: If unsuccessful, decides to switch to Structural Grounding Expert&lt;br&gt;&lt;strong&gt;Structural Grounding Expert&lt;&#x2F;strong&gt;: Sets all cell formulas at once&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Recovery Strategy (if subtask fails)&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Manager&lt;&#x2F;strong&gt;: If worker signals FAIL, creates an entirely new plan based on current state&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Manager&lt;&#x2F;strong&gt;: Dynamically updates plan after each subtask&lt;br&gt;&lt;strong&gt;Worker&lt;&#x2F;strong&gt;: Can attempt alternative approaches within a subtask&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Memory Update&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Self-Evaluator&lt;&#x2F;strong&gt;: Generates summaries of successful trajectories&lt;br&gt;&lt;strong&gt;System&lt;&#x2F;strong&gt;: Stores in memory for future retrieval&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Self-Evaluator&lt;&#x2F;strong&gt;: Evaluates experiences&lt;br&gt;&lt;strong&gt;System&lt;&#x2F;strong&gt;: Updates both narrative and episodic memory continuously&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;This table highlights how Agent S2 distributes decision-making:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;The &lt;strong&gt;Manager&lt;&#x2F;strong&gt; makes high-level planning decisions and revises plans after each subtask&lt;&#x2F;li&gt;
&lt;li&gt;The &lt;strong&gt;Worker&lt;&#x2F;strong&gt; decides which grounding expert to use for each action and can switch experts if needed&lt;&#x2F;li&gt;
&lt;li&gt;The specialized &lt;strong&gt;Grounding Experts&lt;&#x2F;strong&gt; handle the execution details appropriate to their domain&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;The flexibility comes from this separation of concerns, allowing each component to make decisions in its area of expertise rather than having a single component handle all aspects of a subtask.&lt;&#x2F;p&gt;
&lt;p&gt;You&#x27;re right to ask for clarification. Let me explain the adaptive behavior in Agent S2 more precisely:&lt;&#x2F;p&gt;
&lt;h2 id=&quot;how-adaptiveness-works-in-agent-s2&quot;&gt;How Adaptiveness Works in Agent S2&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Sequential Execution&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Yes, workers still execute sequentially in Agent S2, just as in Agent S&lt;&#x2F;li&gt;
&lt;li&gt;Each subtask is completed by a worker before moving to the next subtask&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Sources of Adaptiveness&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Within-Subtask Adaptation&lt;&#x2F;strong&gt; (Worker level):&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Each worker can dynamically switch between different grounding experts during execution&lt;&#x2F;li&gt;
&lt;li&gt;If one approach fails (e.g., visual grounding), the worker can try another approach (e.g., textual grounding)&lt;&#x2F;li&gt;
&lt;li&gt;This happens within a single subtask without requiring a complete plan change&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Between-Subtask Adaptation&lt;&#x2F;strong&gt; (Manager level):&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;After each subtask completes successfully, the Manager re-evaluates and potentially updates the remaining plan&lt;&#x2F;li&gt;
&lt;li&gt;This is a proactive process that happens even if no failures occurred&lt;&#x2F;li&gt;
&lt;li&gt;The Manager takes the prior subtasks, latest observation, and original instruction to potentially revise future subtasks&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Key Difference from Agent S&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;In Agent S, plan changes typically only happen after failures (reactive planning)&lt;&#x2F;li&gt;
&lt;li&gt;In Agent S2, plans are reassessed after every subtask regardless of success (proactive planning)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;The adaptiveness doesn&#x27;t just come from failure recovery, but from continuous reassessment at multiple levels:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Within a subtask (by the Worker choosing among grounding experts)&lt;&#x2F;li&gt;
&lt;li&gt;Between subtasks (by the Manager updating the remaining plan based on new observations)&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;This multi-level adaptation allows Agent S2 to be more responsive to the dynamic nature of UI interactions, even when things are generally working as expected but might benefit from strategy adjustments.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;evaluation-methodology-in-agent-s2&quot;&gt;Evaluation Methodology in Agent S2&lt;&#x2F;h2&gt;
&lt;p&gt;The authors evaluated their framework using online interactive benchmarks rather than static offline datasets. This approach allowed for a more realistic assessment of agent performance in dynamic environments.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;primary-benchmarks-used&quot;&gt;Primary Benchmarks Used&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;OSWorld&lt;&#x2F;strong&gt; The main benchmark used was OSWorld, which consists of 369 real-world computer use tasks across different categories including OS operations, Office applications (LibreOffice Calc, Impress, Writer), Daily applications (Chrome, VLC Player, Thunderbird), Professional tools (VS Code and GIMP), and Workflow tasks that involve multiple applications.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;WindowsAgentArena&lt;&#x2F;strong&gt; The authors also tested on WindowsAgentArena, which includes 154 tasks executed on the Windows operating system, demonstrating cross-OS generalization.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;AndroidWorld&lt;&#x2F;strong&gt; To showcase versatility beyond desktop environments, they tested on AndroidWorld with 116 smartphone tasks across 20 real-world Android applications.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;evaluation-approach&quot;&gt;Evaluation Approach&lt;&#x2F;h3&gt;
&lt;p&gt;The evaluation was conducted in &lt;strong&gt;interactive online environments&lt;&#x2F;strong&gt;, not offline datasets:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Live Execution&lt;&#x2F;strong&gt;: The agent actively interacted with real applications in real-time, sending keyboard and mouse commands and observing the results. This allowed for true testing of the agent&#x27;s ability to interact with and adapt to dynamic environments.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Metrics&lt;&#x2F;strong&gt;: The primary metric was task success rate, with two evaluation settings:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;15-step evaluation&lt;&#x2F;strong&gt;: Limited to 15 steps maximum&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;50-step evaluation&lt;&#x2F;strong&gt;: Extended to 50 steps maximum to test scalability&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Ablation Studies&lt;&#x2F;strong&gt;: The authors conducted extensive ablation studies on a subset of 65 examples from OSWorld, stratified by categories, to evaluate the contribution of individual components.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Comparative Analysis&lt;&#x2F;strong&gt;: They compared Agent S2 against several baselines including Claude Computer Use, UI-TARS, previous Agent S, and others, establishing state-of-the-art results across all benchmarks.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;This methodology of using interactive environments rather than static datasets is particularly important for evaluating computer-use agents, as it tests their ability to:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Adapt to changing UI states&lt;&#x2F;li&gt;
&lt;li&gt;Recover from errors&lt;&#x2F;li&gt;
&lt;li&gt;Handle unexpected pop-ups or system behaviors&lt;&#x2F;li&gt;
&lt;li&gt;Operate in realistic, non-deterministic conditions&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The results showed significant improvements over baselines, with relative improvements of 18.9% and 32.7% on OSWorld 15-step and 50-step evaluations respectively, demonstrating the effectiveness of the compositional approach and proactive planning.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>API Design</title>
        <published>2025-04-03T00:00:00+00:00</published>
        <updated>2025-04-03T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/api-types/"/>
        <id>https://asun9.com/notes/api-types/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/api-types/">&lt;h1 id=&quot;rest-api-design-technical-interview-cheatsheet&quot;&gt;REST API Design: Technical Interview Cheatsheet&lt;&#x2F;h1&gt;
&lt;h2 id=&quot;http-methods-trade-offs-table&quot;&gt;HTTP Methods: Trade-offs Table&lt;&#x2F;h2&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Method&lt;&#x2F;th&gt;&lt;th&gt;Purpose&lt;&#x2F;th&gt;&lt;th&gt;Pros&lt;&#x2F;th&gt;&lt;th&gt;Cons&lt;&#x2F;th&gt;&lt;th&gt;When to Use&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;GET&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Retrieve data&lt;&#x2F;td&gt;&lt;td&gt;• Cacheable&lt;br&gt;• Idempotent&lt;br&gt;• Bookmarkable&lt;br&gt;• Simple&lt;&#x2F;td&gt;&lt;td&gt;• URL length limits&lt;br&gt;• Visible parameters&lt;br&gt;• Limited data complexity&lt;&#x2F;td&gt;&lt;td&gt;• Resource retrieval&lt;br&gt;• Simple filtering&lt;br&gt;• Public&#x2F;non-sensitive operations&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;POST&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Create resources&lt;&#x2F;td&gt;&lt;td&gt;• Request body for data&lt;br&gt;• No length limits&lt;br&gt;• Better security&lt;&#x2F;td&gt;&lt;td&gt;• Not cacheable&lt;br&gt;• Not idempotent&lt;br&gt;• Cannot bookmark&lt;&#x2F;td&gt;&lt;td&gt;• Resource creation&lt;br&gt;• Complex operations&lt;br&gt;• Sensitive data submission&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;PUT&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Update resources&lt;&#x2F;td&gt;&lt;td&gt;• Idempotent&lt;br&gt;• Full resource replacement&lt;br&gt;• Client-defined URI&lt;&#x2F;td&gt;&lt;td&gt;• Requires full resource&lt;br&gt;• Less bandwidth efficient&lt;br&gt;• Race condition risks&lt;&#x2F;td&gt;&lt;td&gt;• Complete updates&lt;br&gt;• Resource creation with known URI&lt;br&gt;• Idempotent operations&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;PATCH&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Partial updates&lt;&#x2F;td&gt;&lt;td&gt;• Bandwidth efficient&lt;br&gt;• Partial updates&lt;br&gt;• Less conflict risk&lt;&#x2F;td&gt;&lt;td&gt;• More complex&lt;br&gt;• Not always idempotent&lt;br&gt;• Less standardized&lt;&#x2F;td&gt;&lt;td&gt;• Partial updates&lt;br&gt;• Large resources&lt;br&gt;• Mobile applications&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;DELETE&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Remove resources&lt;&#x2F;td&gt;&lt;td&gt;• Clear intent&lt;br&gt;• Idempotent&lt;br&gt;• Simple&lt;&#x2F;td&gt;&lt;td&gt;• Caching challenges&lt;br&gt;• Security risks&lt;&#x2F;td&gt;&lt;td&gt;• Resource removal&lt;br&gt;• Cleanup operations&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;h2 id=&quot;filtering-patterns-comparison&quot;&gt;Filtering Patterns: Comparison&lt;&#x2F;h2&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Pattern&lt;&#x2F;th&gt;&lt;th&gt;Example&lt;&#x2F;th&gt;&lt;th&gt;Pros&lt;&#x2F;th&gt;&lt;th&gt;Cons&lt;&#x2F;th&gt;&lt;th&gt;Complexity&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Query Parameters&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;&#x2F;products?category=x&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;Simple, widely supported&lt;&#x2F;td&gt;&lt;td&gt;Limited nesting, URL length&lt;&#x2F;td&gt;&lt;td&gt;Low&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Path Parameters&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;&#x2F;products&#x2F;category&#x2F;x&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;Clean URLs, semantic&lt;&#x2F;td&gt;&lt;td&gt;Limited flexibility, endpoint proliferation&lt;&#x2F;td&gt;&lt;td&gt;Low&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Matrix Parameters&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;&#x2F;products;category=x&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;Hierarchical, segment-specific&lt;&#x2F;td&gt;&lt;td&gt;Less supported&lt;&#x2F;td&gt;&lt;td&gt;Medium&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Query Language&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;&#x2F;products?filter=cat:x&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;Powerful expressions&lt;&#x2F;td&gt;&lt;td&gt;Requires custom parser&lt;&#x2F;td&gt;&lt;td&gt;High&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;POST Filtering&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;POST body with filter JSON&lt;&#x2F;td&gt;&lt;td&gt;Complex filters, no length limit&lt;&#x2F;td&gt;&lt;td&gt;Not RESTful, not cacheable&lt;&#x2F;td&gt;&lt;td&gt;High&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;OData&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;&#x2F;?$filter=Category eq &#x27;x&#x27;&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;Standardized, powerful&lt;&#x2F;td&gt;&lt;td&gt;Complex implementation&lt;&#x2F;td&gt;&lt;td&gt;High&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;h2 id=&quot;pagination-techniques&quot;&gt;Pagination Techniques&lt;&#x2F;h2&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Technique&lt;&#x2F;th&gt;&lt;th&gt;Implementation&lt;&#x2F;th&gt;&lt;th&gt;Pros&lt;&#x2F;th&gt;&lt;th&gt;Cons&lt;&#x2F;th&gt;&lt;th&gt;Best For&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Offset-based&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;?offset=20&amp;amp;limit=10&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;Simple, stateless&lt;&#x2F;td&gt;&lt;td&gt;Performance degrades, inconsistent with changes&lt;&#x2F;td&gt;&lt;td&gt;Small datasets&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Cursor-based&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;?cursor=eyJpZCI6MTI1fQ&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;Consistent with changes, performant&lt;&#x2F;td&gt;&lt;td&gt;Opaque, no random access&lt;&#x2F;td&gt;&lt;td&gt;Large datasets&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Page-based&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;?page=2&amp;amp;per_page=10&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;Simple, familiar&lt;&#x2F;td&gt;&lt;td&gt;Same issues as offset&lt;&#x2F;td&gt;&lt;td&gt;Small, stable datasets&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Time-based&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;?since=2023-04-01&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;Natural for time-series, efficient&lt;&#x2F;td&gt;&lt;td&gt;Limited to chronological data&lt;&#x2F;td&gt;&lt;td&gt;Event&#x2F;activity streams&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Key-based&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;?after_id=1000&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;Simple implementation&lt;&#x2F;td&gt;&lt;td&gt;Requires stable sorting&lt;&#x2F;td&gt;&lt;td&gt;Medium datasets&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;h2 id=&quot;api-security-framework&quot;&gt;API Security Framework&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;jwt-json-web-token&quot;&gt;JWT (JSON Web Token)&lt;&#x2F;h3&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Component&lt;&#x2F;th&gt;&lt;th&gt;Description&lt;&#x2F;th&gt;&lt;th&gt;Security Considerations&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Header&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Token type &amp;amp; algorithm&lt;&#x2F;td&gt;&lt;td&gt;Verify algorithm (prevent algorithm switching attacks)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Payload&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Claims about entity&lt;&#x2F;td&gt;&lt;td&gt;No sensitive data, include expiration (exp) claim&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Signature&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Verifies integrity&lt;&#x2F;td&gt;&lt;td&gt;Use strong keys, prefer asymmetric crypto for scale&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;h3 id=&quot;jwt-implementation-flow&quot;&gt;JWT Implementation Flow&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;Client authenticates → receives token&lt;&#x2F;li&gt;
&lt;li&gt;Client includes token in Authorization header&lt;&#x2F;li&gt;
&lt;li&gt;Server validates signature and claims&lt;&#x2F;li&gt;
&lt;li&gt;Server authorizes based on claims&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;security-best-practices-table&quot;&gt;Security Best Practices Table&lt;&#x2F;h3&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Category&lt;&#x2F;th&gt;&lt;th&gt;Practices&lt;&#x2F;th&gt;&lt;th&gt;Trade-offs&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Authentication&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• OAuth 2.0 + OIDC&lt;br&gt;• Short-lived tokens&lt;br&gt;• Refresh token rotation&lt;&#x2F;td&gt;&lt;td&gt;Implementation complexity vs. security&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Authorization&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• RBAC&#x2F;ABAC&lt;br&gt;• Least privilege&lt;br&gt;• Fine-grained permissions&lt;&#x2F;td&gt;&lt;td&gt;Usability vs. security, maintenance overhead&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Transport&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• HTTPS only&lt;br&gt;• HSTS headers&lt;br&gt;• Certificate pinning&lt;&#x2F;td&gt;&lt;td&gt;Performance impact, deployment complexity&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Rate Limiting&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Per-client limits&lt;br&gt;• Geographic limits&lt;br&gt;• Graduated response&lt;&#x2F;td&gt;&lt;td&gt;User experience vs. protection&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Data Validation&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Input sanitization&lt;br&gt;• Schema validation&lt;br&gt;• Parameterized queries&lt;&#x2F;td&gt;&lt;td&gt;Development time vs. security hardening&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;h3 id=&quot;jwt-token-handling-staff-principal-level-considerations&quot;&gt;JWT Token Handling - Staff&#x2F;Principal Level Considerations&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Stateless vs. Stateful&lt;&#x2F;strong&gt;: Pure JWT (stateless) vs. token registry with revocation&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Storage&lt;&#x2F;strong&gt;: HttpOnly cookies vs. localStorage (XSS&#x2F;CSRF tradeoffs)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Architecture&lt;&#x2F;strong&gt;: Centralized vs. distributed token validation&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Scaling&lt;&#x2F;strong&gt;: Token validation performance in high-throughput systems&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Crypto Agility&lt;&#x2F;strong&gt;: Strategy for algorithm&#x2F;key rotation without downtime&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;system-design-considerations&quot;&gt;System Design Considerations&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;API versioning strategy&lt;&#x2F;li&gt;
&lt;li&gt;Consistency models across distributed services&lt;&#x2F;li&gt;
&lt;li&gt;Cache invalidation strategies&lt;&#x2F;li&gt;
&lt;li&gt;Monitoring and observability&lt;&#x2F;li&gt;
&lt;li&gt;API contract testing&lt;&#x2F;li&gt;
&lt;li&gt;Documentation automation&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;overview&quot;&gt;Overview&lt;&#x2F;h1&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;&#x2F;th&gt;&lt;th&gt;&lt;strong&gt;REST&lt;&#x2F;strong&gt;&lt;&#x2F;th&gt;&lt;th&gt;&lt;strong&gt;GraphQL&lt;&#x2F;strong&gt;&lt;&#x2F;th&gt;&lt;th&gt;&lt;strong&gt;gRPC&lt;&#x2F;strong&gt;&lt;&#x2F;th&gt;&lt;th&gt;&lt;strong&gt;JSON-RPC &#x2F; XML-RPC&lt;&#x2F;strong&gt;&lt;&#x2F;th&gt;&lt;th&gt;&lt;strong&gt;WebSockets&lt;&#x2F;strong&gt;&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Implementation&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Resource-based with unique URIs&lt;br&gt;• Standard HTTP methods (GET, POST, PUT, DELETE)&lt;br&gt;• Stateless&lt;br&gt;• HTTP status codes&lt;br&gt;• JSON&#x2F;XML responses&lt;&#x2F;td&gt;&lt;td&gt;• Single endpoint for all queries&lt;br&gt;• Strongly-typed schema&lt;br&gt;• Client specifies exact data needs&lt;br&gt;• Returns only requested data&lt;br&gt;• Typically over HTTP POST&lt;&#x2F;td&gt;&lt;td&gt;• Protocol Buffers (protobuf) IDL&lt;br&gt;• Strongly typed service definitions&lt;br&gt;• Generated client&#x2F;server code&lt;br&gt;• HTTP&#x2F;2 with binary serialization&lt;br&gt;• Support for streaming&lt;&#x2F;td&gt;&lt;td&gt;• Method name and parameters in request&lt;br&gt;• Result or error in response&lt;br&gt;• JSON or XML encoding&lt;br&gt;• Typically over HTTP POST&lt;&#x2F;td&gt;&lt;td&gt;• Persistent TCP connection&lt;br&gt;• Full-duplex communication&lt;br&gt;• HTTP handshake upgrades to WebSocket&lt;br&gt;• Real-time data streaming&lt;br&gt;• Custom message formats&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Pros&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Simple and widely understood&lt;br&gt;• Excellent caching&lt;br&gt;• Scalable due to statelessness&lt;br&gt;• Works well with web infrastructure&lt;br&gt;• Mature tooling ecosystem&lt;&#x2F;td&gt;&lt;td&gt;• Precise data retrieval&lt;br&gt;• Strong typing and introspection&lt;br&gt;• Evolution without versioning&lt;br&gt;• Single request for complex data&lt;br&gt;• Powerful developer tools&lt;&#x2F;td&gt;&lt;td&gt;• High performance binary serialization&lt;br&gt;• Strong typing and contract&lt;br&gt;• Excellent for microservices&lt;br&gt;• Built-in streaming support&lt;br&gt;• Multi-language code generation&lt;&#x2F;td&gt;&lt;td&gt;• Simple implementation&lt;br&gt;• Language-agnostic&lt;br&gt;• Lightweight&lt;br&gt;• Good for simple interfaces&lt;br&gt;• Compatible with existing infrastructure&lt;&#x2F;td&gt;&lt;td&gt;• Real-time bidirectional communication&lt;br&gt;• Low latency after connection&lt;br&gt;• Good for event-driven architecture&lt;br&gt;• Efficient for frequent small messages&lt;br&gt;• Ideal for live monitoring&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Cons&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Over&#x2F;under-fetching data&lt;br&gt;• Multiple requests for complex operations&lt;br&gt;• Tight coupling between endpoints and clients&lt;br&gt;• Version management challenges&lt;&#x2F;td&gt;&lt;td&gt;• Complex server implementation&lt;br&gt;• Difficult caching&lt;br&gt;• Potential for expensive queries&lt;br&gt;• Learning curve&lt;br&gt;• Security concerns with arbitrary queries&lt;&#x2F;td&gt;&lt;td&gt;• Limited browser support&lt;br&gt;• Less human-readable than JSON&lt;br&gt;• Steeper learning curve&lt;br&gt;• Requires code generation&lt;br&gt;• Less flexible for rapid changes&lt;&#x2F;td&gt;&lt;td&gt;• Limited for complex operations&lt;br&gt;• No standardized interface definition&lt;br&gt;• No built-in streaming&lt;br&gt;• Less structured&lt;br&gt;• Fewer tooling options&lt;&#x2F;td&gt;&lt;td&gt;• Complex implementation&lt;br&gt;• Connection state management&lt;br&gt;• Potential scalability concerns&lt;br&gt;• Complex error handling&lt;br&gt;• Extra infrastructure needs&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;ML-Specific Considerations&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;• Familiar to most ML engineers&lt;br&gt;• Simple for basic model inference&lt;br&gt;• Good for model management endpoints&lt;&#x2F;td&gt;&lt;td&gt;• Excellent for model metadata queries&lt;br&gt;• Flexible for ML experiment tracking&lt;br&gt;• Good for dashboards showing various metrics&lt;&#x2F;td&gt;&lt;td&gt;• Ideal for high-volume ML data transfer&lt;br&gt;• Great for model streaming inference&lt;br&gt;• Efficient for microservice architecture&lt;br&gt;• Good for production ML systems&lt;&#x2F;td&gt;&lt;td&gt;• Simple for basic ML inference&lt;br&gt;• Easy integration with legacy systems&lt;br&gt;• Low overhead for simple operations&lt;&#x2F;td&gt;&lt;td&gt;• Perfect for real-time ML predictions&lt;br&gt;• Good for streaming model training metrics&lt;br&gt;• Useful for collaborative ML tools&lt;br&gt;• Enables interactive ML applications&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;h4 id=&quot;what-s-the-difference-between-an-api-and-a-end-point&quot;&gt;What&#x27;s the difference between an API and a end point?&lt;&#x2F;h4&gt;
&lt;p&gt;APIs and endpoints are two different entities. An API is the method by which two software applications communicate, and an endpoint is a component of the API. Endpoints define the exact location of the available resources. In contrast, API uses these endpoint URLs to make its resources available to its users.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;functional-and-non-functional-requirements&quot;&gt;Functional and Non-Functional requirements&lt;&#x2F;h4&gt;
&lt;ul&gt;
&lt;li&gt;Functional requirements define the desired end function of a system and its required parameters. For example, in a video streaming service, the ability to post comments on a video is a functional requirement because it has a defined end goal and parameters.&lt;&#x2F;li&gt;
&lt;li&gt;Non-functional requirements define the performance and quality of the services the API provides. Continuing from the video streaming example above, the ability of an API to quickly respond to the user (low latency) or a number of users posting comments simultaneously (scalability) are forms of non-functional requirements. Other non-functional requirements include availability, reliability, consistency, and so on.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h4 id=&quot;sli-and-slo&quot;&gt;SLI and SLO&lt;&#x2F;h4&gt;
&lt;ul&gt;
&lt;li&gt;A service level indicator (SLI) is a carefully defined quantitative measure of an aspect of the level of service that has been provided. These are request latency, error rate, system throughput, availability, durability.&lt;&#x2F;li&gt;
&lt;li&gt;A service level objective (SLO) is a target range of value for a service we measure through an SLI. A good SLO should specify how it will be measured and what valid conditions it has. Examples:
&lt;ul&gt;
&lt;li&gt;Response time of 95% of API calls &amp;lt; 500 ms&lt;&#x2F;li&gt;
&lt;li&gt;The availability of the API is ≈ 98%&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h4 id=&quot;data-formats&quot;&gt;Data formats&lt;&#x2F;h4&gt;
&lt;p&gt;The best data format for a design problem is a tradeoff between the factors mentioned above and the features provided by a specific format. In general, a format is considered to be a good choice if it supports the following features:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Human-readable: Easy to read and debug by developers&lt;&#x2F;li&gt;
&lt;li&gt;Low latency: Fast to transmit over the wire&lt;&#x2F;li&gt;
&lt;li&gt;Standardized: Follows a well-defined pattern in the industry&lt;&#x2F;li&gt;
&lt;li&gt;Machine friendly: Needs less time to be processed by machines&lt;&#x2F;li&gt;
&lt;li&gt;Interoperable: Easy to serialize and deserialize data into different formats&lt;&#x2F;li&gt;
&lt;li&gt;Flexible: Easy to introduce and manage changes over time&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h4 id=&quot;rest&quot;&gt;REST&lt;&#x2F;h4&gt;
&lt;p&gt;REST is a web architecture style that proposes some constraints that should be used to design web or mobile applications. However, HTTP is the protocol, or, in simple words, a method that enables us to achieve the constraints proposed by REST. Although HTTP was designed earlier than REST, fortunately, it has all the features that can be utilized to make the World Wide Web conform to the REST constraints. Therefore, HTTP is widely adopted in this regard.&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Constraints&lt;&#x2F;th&gt;&lt;th&gt;Features&lt;&#x2F;th&gt;&lt;th&gt;Drawbacks&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Client-server&lt;&#x2F;td&gt;&lt;td&gt;• Improves evolvability of clients and server&lt;br&gt;• Increases scalability&lt;&#x2F;td&gt;&lt;td&gt;• An enormous number of user requests can overload the server&lt;br&gt;• Network disconnectivity may cause an interruption in services&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Cache&lt;&#x2F;td&gt;&lt;td&gt;• Reduces latency by storing data on the client side&lt;&#x2F;td&gt;&lt;td&gt;• Reduces consistency if the stale data in cache varies considerably from the data in the recent response from the server&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Stateless&lt;&#x2F;td&gt;&lt;td&gt;• Improves reliability&lt;br&gt;• Increases scalability of the term of incoming requests&lt;br&gt;• Improves visibility of requests for analysis&lt;&#x2F;td&gt;&lt;td&gt;• Reduces the network performance by sending repetitive data in a series of requests&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Uniform interface&lt;&#x2F;td&gt;&lt;td&gt;• Improves independent development of components&lt;br&gt;• Smoothens the interactions of entities&lt;br&gt;• Improves evolvability of the components&lt;&#x2F;td&gt;&lt;td&gt;• Degrades the efficiency and flexibility because the information has to be sent in a standardized form rather than required by the application&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Layered system&lt;&#x2F;td&gt;&lt;td&gt;• Improves evolvability and reusability of different components&lt;br&gt;• Enhances decoupling of the components&lt;&#x2F;td&gt;&lt;td&gt;• Reduces the performance by increasing the processing overhead of different layers&lt;br&gt;• High security is needed at each layer to keep communication secure&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Code-on-demand&lt;&#x2F;td&gt;&lt;td&gt;• Improves extensibility&lt;br&gt;• Increases performance&lt;&#x2F;td&gt;&lt;td&gt;• Reduces the trackability of the requests by the monitoring systems&lt;br&gt;• May sometimes compromise the security of the client&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;h1 id=&quot;foundational-api-designs&quot;&gt;Foundational API Designs&lt;&#x2F;h1&gt;
&lt;h2 id=&quot;design-a-search-service&quot;&gt;Design a Search Service&lt;&#x2F;h2&gt;
&lt;p&gt;Functional requirements: Searching, sorting, paging.
Non-functional requirements: avalilability, scalability, security, low latency.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;design-a-file-service&quot;&gt;Design a File Service&lt;&#x2F;h2&gt;
&lt;p&gt;Functional requirements: Upload, Download, Delete, List.
Non-functional requirements: avalilability, scalability, security, low latency.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;components-and-services-details&quot;&gt;Components and Services Details&lt;&#x2F;h3&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Component or Service&lt;&#x2F;th&gt;&lt;th&gt;Details&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;File servers&lt;&#x2F;td&gt;&lt;td&gt;• Accept and process file API requests forwarded by the API gateway&lt;br&gt;• Split requests into metadata (user and file information) and file content&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Processing server&lt;&#x2F;td&gt;&lt;td&gt;• Performs encoding&#x2F;decoding of data into different encoding schemes&lt;br&gt;• Encrypt&#x2F;decrypt data at-rest to prevent unauthorized access&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;User to file mapping system (UFMS)&lt;&#x2F;td&gt;&lt;td&gt;• Maps users to files and where those files can be found in storage&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Blob storage&lt;&#x2F;td&gt;&lt;td&gt;• Stores binary data objects (file content)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Temporary storage&lt;&#x2F;td&gt;&lt;td&gt;• Stores files and objects temporarily before processing&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;User server&lt;&#x2F;td&gt;&lt;td&gt;• Handles user related requests forwarded by the API gateway&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;SQL database&lt;&#x2F;td&gt;&lt;td&gt;• Stores information related to files and users (metadata)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;CDN servers&lt;&#x2F;td&gt;&lt;td&gt;• Geographically distributed network for serving data to the user from a nearby location instead of serving it from the blob storage&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;API gateway&lt;&#x2F;td&gt;&lt;td&gt;• Forwards client requests to the appropriate application server&lt;br&gt;• Authenticates and authorizes client requests&lt;br&gt;• Rate-limits client requests to keep the server from overburdening&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Client&lt;&#x2F;td&gt;&lt;td&gt;• The consumer of the API service&lt;br&gt;• Can perform lossless compression before sending a file&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;h2 id=&quot;design-a-comment-service&quot;&gt;Design a Comment Service&lt;&#x2F;h2&gt;
&lt;h2 id=&quot;design-a-pub-sub-service&quot;&gt;Design a Pub-sub Service&lt;&#x2F;h2&gt;
&lt;h1 id=&quot;others&quot;&gt;Others&lt;&#x2F;h1&gt;
&lt;h2 id=&quot;youtube-apis&quot;&gt;YouTube APIs&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Functional requirements&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Search for videos.&lt;&#x2F;li&gt;
&lt;li&gt;Stream for videos.&lt;&#x2F;li&gt;
&lt;li&gt;Video preview.&lt;&#x2F;li&gt;
&lt;li&gt;Rate a video.&lt;&#x2F;li&gt;
&lt;li&gt;Upload video.&lt;&#x2F;li&gt;
&lt;li&gt;Comment on a video.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Non-functional&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Scalability: The system should be scalable to handle ever-increasing numbers of users.&lt;&#x2F;li&gt;
&lt;li&gt;Available: Uninterrupted service.&lt;&#x2F;li&gt;
&lt;li&gt;Security&lt;&#x2F;li&gt;
&lt;li&gt;Low latency&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The difference services are going to be: streaming service, upload service, search service, comment service, like&#x2F;dislike service.&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Operation&lt;&#x2F;th&gt;&lt;th&gt;Endpoints&lt;&#x2F;th&gt;&lt;th&gt;Data Entities&lt;&#x2F;th&gt;&lt;th&gt;Response&lt;br&gt;(Status Code, Body)&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Manifest file&lt;&#x2F;td&gt;&lt;td&gt;GET &#x2F;v1.0&#x2F;videos&#x2F;{videoId}&lt;&#x2F;td&gt;&lt;td&gt;videoId&lt;&#x2F;td&gt;&lt;td&gt;200 OK, Yes&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Video segments&lt;&#x2F;td&gt;&lt;td&gt;GET &#x2F;v1.0&#x2F;playback?{videoSegmentId}&lt;&#x2F;td&gt;&lt;td&gt;videoSegmentId&lt;&#x2F;td&gt;&lt;td&gt;200 OK, Yes&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Audio segments&lt;&#x2F;td&gt;&lt;td&gt;GET &#x2F;v1.0&#x2F;playback?{audioSegmentId}&lt;&#x2F;td&gt;&lt;td&gt;audioSegmentId&lt;&#x2F;td&gt;&lt;td&gt;200 OK, Yes&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Playback configuration&lt;&#x2F;td&gt;&lt;td&gt;POST &#x2F;v1.0&#x2F;playback&#x2F;videoId&lt;&#x2F;td&gt;&lt;td&gt;videoId, {other required fields}&lt;&#x2F;td&gt;&lt;td&gt;200 OK, Yes&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Preview&lt;&#x2F;td&gt;&lt;td&gt;GET &#x2F;v1.0&#x2F;videos&#x2F;preview&#x2F;{videoId}&lt;&#x2F;td&gt;&lt;td&gt;videoId&lt;&#x2F;td&gt;&lt;td&gt;200 OK, Yes&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;GET&lt;&#x2F;strong&gt;: Used to retrieve data from the server without modifying it&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;POST&lt;&#x2F;strong&gt;: Used to create new resources on the server&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;All endpoints return a 200 OK status code when successful&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;All successful responses include a body payload&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;The API version is v1.0&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Identifiers include: videoId, videoSegmentId, and audioSegmentId&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;achieving-non-functional-requirements&quot;&gt;Achieving Non-Functional Requirements&lt;&#x2F;h3&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Non-Functional Requirements&lt;&#x2F;th&gt;&lt;th&gt;Approaches&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Scalability&lt;&#x2F;td&gt;&lt;td&gt;• Transmitting data through CDNs and GGC&lt;br&gt;• Asynchronous back-end communication&lt;br&gt;• Sharding databases for efficient data management&lt;br&gt;• Versioning API to support new features&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Availability&lt;&#x2F;td&gt;&lt;td&gt;• Regionally located edge servers at the ISP level&lt;br&gt;• Using circuit breakers for fault tolerance&lt;br&gt;• Replication to avoid SPOF&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Flexibility&#x2F;adaptability&lt;&#x2F;td&gt;&lt;td&gt;• Transcoding to different formats supported by different devices&lt;br&gt;• ABR and buffering based on device capabilities&lt;br&gt;• User playback history synchronization across devices&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Security&lt;&#x2F;td&gt;&lt;td&gt;• Using TLS&#x2F;1.3 for improved security&lt;br&gt;• Authenticated and authorized access to private data&lt;br&gt;• Implements OAuth&#x2F;2 with PKCE code flow for third-party access&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Low latency&lt;&#x2F;td&gt;&lt;td&gt;• Dividing video in segments&#x2F;chunks for quick delivery&lt;br&gt;• Prefetching segments using buffering at the client&#x27;s end&lt;br&gt;• Using caching techniques at the streaming server along with CDNs&lt;br&gt;• Applying compression and encoding techniques&lt;br&gt;• Uses ABR for adapting to dynamic network conditions&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;h2 id=&quot;twitter&quot;&gt;Twitter&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Functional requirements: post a tweet, see timeline, search, comment on another tweet, favourite a tweet&lt;&#x2F;li&gt;
&lt;li&gt;Non-functional: availablity, reliability, scalability, security, low latency.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Different backend services one needs: tweet service for creating and storing tweets, timeline service to generate the home page via user timline, mention timeline and user timeline.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;components-and-services-details-1&quot;&gt;Components and Services Details&lt;&#x2F;h3&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Component or Service&lt;&#x2F;th&gt;&lt;th&gt;Details&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Tweet service&lt;&#x2F;td&gt;&lt;td&gt;• Stores Tweet (up to 280 characters) in a database&lt;br&gt;• Coordinates with timeline service in creating up-to-date timelines&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Timeline service&lt;&#x2F;td&gt;&lt;td&gt;• Extracts information on active users&#x27; followers from the database to get their Tweets and ranks them&lt;br&gt;• Combines Tweets, trends, accounts, and ads into a single response to generate a complete timeline&lt;br&gt;• Performs pagination to reduce the burden on the client and backend&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Feed cache&lt;&#x2F;td&gt;&lt;td&gt;• Acts as distributed cache like Redis for storing the timeline of active users&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Trends&lt;&#x2F;td&gt;&lt;td&gt;• Generates trends on the basis of user location&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Pub-sub&lt;&#x2F;td&gt;&lt;td&gt;• Notifies end-users of any activity happening in their circle—for example, a new Tweet from a celebrity they are following&lt;br&gt;• Decouples Tweet service from timeline service, enabling asynchronous communication between them&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;People discovery&lt;&#x2F;td&gt;&lt;td&gt;• Recommends people based on the user&#x27;s interest&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Ads&lt;&#x2F;td&gt;&lt;td&gt;• Recommends text, images, or video-based promotional ads&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;API gateway&lt;&#x2F;td&gt;&lt;td&gt;• Routes traffic to different services or servers for the same service for load-balancing purposes&lt;br&gt;• Implements many other functionalities like rate-limiting, basic authentication, TLS connection termination, etc.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;h3 id=&quot;workflow&quot;&gt;Workflow&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;When a user posts a tweet, it goes to tweet service via the API gateway. The contents are stored in a database. Media file is stored in a blob store first and an id is returned, which then is stored in the db.&lt;&#x2F;li&gt;
&lt;li&gt;The tweet service pushes a copy of the tweet into a pub sub service. The pub sub service notifies the timeline service that a new tweet has arrived.&lt;&#x2F;li&gt;
&lt;li&gt;The timeline services acts differently for active and inactive users.&lt;&#x2F;li&gt;
&lt;li&gt;For active users, the timeline service generates the timeline beforehand in order to respond to the users in near real-time. The timeline service gets the followers of a user from the database, extracts their Tweets, and scores them based on their content relevancy to the user. The timeline service also interacts with the trend, people discovery, and ads services. These services return different types of suggestions based on user information. The timeline service aggregates the responses of these services and stores them in the feed cache.&lt;&#x2F;li&gt;
&lt;li&gt;When an active user requests a timeline, the API gateway forwards the request to the timeline service. The timeline service gets a timeline from the feed cache and returns it to the client via an API gateway. However, the timeline service has to interact with the other services (trend, people discovery, and so forth) and generate a timeline on a runtime for an inactive user.&lt;&#x2F;li&gt;
&lt;li&gt;The timeline service handles timeline updates via a push&#x2F;pull model.
&lt;ul&gt;
&lt;li&gt;For active followers, use the push model. In the push model, notifications are sent to the client from the server whenever a new Tweet is posted.&lt;&#x2F;li&gt;
&lt;li&gt;For inactive followers, use the pull model. This sends a request to the server after a specific interval and gets an updated timeline from the server.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Chai</title>
        <published>2025-03-22T00:00:00+00:00</published>
        <updated>2025-03-22T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/tea/"/>
        <id>https://asun9.com/tea/</id>
        
        <content type="html" xml:base="https://asun9.com/tea/">&lt;p&gt;A few days ago I discovered an unopened packet of &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.hul.co.in&#x2F;brands&#x2F;foods&#x2F;brooke-bond-red-label&#x2F;&quot;&gt;Red Label&lt;&#x2F;a&gt; on the shelf. Amma had bought it when she was here a couple of years ago. Growing up tea always meant milk tea. It&#x27;s not just milk and tea, it&#x27;s also sugar. Without sugar, the concoction is, let&#x27;s say, an acquired taste. A sweetener, though, transforms it into something more - rainy afternoons, cricket, bicycles and the neighborhood. A distant past.&lt;&#x2F;p&gt;
&lt;p&gt;I suddenly had the urge to make tea. So with the help of the internet and an inkling of how Amma would have gone about it, I fumbled around the kitchen. For a novice effort, it didn&#x27;t taste as bad as I thought it would. The next day I made chai&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-chaiTea-1&quot;&gt;&lt;a href=&quot;#fn-chaiTea&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; once again. Still pretty good. By this time I had already claimed to family and friends that I make some fine tea. I should have qualified the claim with &quot;in my house.&quot; After all, I did not really measure the portions when preparing; it was all vibes and whatever the vessels in the kitchen allowed.&lt;&#x2F;p&gt;
&lt;p&gt;This morning I urgently took measurements, and here I am recording the ratio of water to milk and the number of teaspoons I used so I can make perfectly reasonable chai anywhere on the planet.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;8 oz of water. Heat it until it simmers.&lt;&#x2F;li&gt;
&lt;li&gt;Add three crushed cardamoms and one crushed clove. Add a bit of ginger, half an inch, although I think one could get away with an inch.&lt;&#x2F;li&gt;
&lt;li&gt;After a minute, add two and a half medium spoons of tea.
&lt;ul&gt;
&lt;li&gt;Red Label tea is grown and processed in Assam. Noting for the future, in case I have to make substitutes.&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-chinaTea-1&quot;&gt;&lt;a href=&quot;#fn-chinaTea&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Wait for the mixture to come to a boil.&lt;&#x2F;li&gt;
&lt;li&gt;Add 12 oz of milk. Again, wait for it to simmer. The chai has got to be steaming hot.&lt;&#x2F;li&gt;
&lt;li&gt;Be generous with stevia or monk fruit. I use three small spoons, and that&#x27;s still not as sweet as the tea one would get at a &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Darshini_(restaurant)&quot;&gt;darshini&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;At the end of the process, there should be between 16 oz and 18 oz of chai. That&#x27;s more than what two people should need, but also just about enough if a couple were to really enjoy their tea.&lt;&#x2F;p&gt;
&lt;br&#x2F;&gt;
&lt;p style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;FOOTNOTES&lt;&#x2F;b&gt; &lt;&#x2F;p&gt;
&lt;footer class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-chaiTea&quot;&gt;
&lt;p&gt;I am using chai and tea interchangeably. In India, what goes by chai up north went by tea down south. Still does to a large extent. &lt;a href=&quot;#fr-chaiTea-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-chinaTea&quot;&gt;
&lt;p&gt;Tea in India was first cultivated by the British East India Company in order to get a grip on the outflow of bullion from the Europe to China. Growing tea was a state secret, and gaining access and know-how involved espionage. Amitav Gosh goes into this history in some detail in &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;opium-amitav-ghosh&#x2F;&quot;&gt;Smoke and Ashes&lt;&#x2F;a&gt; and Sea of Poppies. &lt;a href=&quot;#fr-chinaTea-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;footer&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>KV Caches in LLM inference</title>
        <published>2025-03-10T00:00:00+00:00</published>
        <updated>2025-03-10T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/kv-caches-in-llm-inference/"/>
        <id>https://asun9.com/notes/kv-caches-in-llm-inference/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/kv-caches-in-llm-inference/">&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;notes&#x2F;kv-caches-in-llm-inference&#x2F;#what-is-a-kv-cache&quot;&gt;What is a KV Cache?&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;notes&#x2F;kv-caches-in-llm-inference&#x2F;#the-problem&quot;&gt;The Problem&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;notes&#x2F;kv-caches-in-llm-inference&#x2F;#what-the-paper-proposes&quot;&gt;What the Paper Proposes&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;notes&#x2F;kv-caches-in-llm-inference&#x2F;#results&quot;&gt;Results&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;notes&#x2F;kv-caches-in-llm-inference&#x2F;#attention-mechanism-explained&quot;&gt;Attention Mechanism Explained&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;notes&#x2F;kv-caches-in-llm-inference&#x2F;#why-kv-cache-matters&quot;&gt;Why KV Cache Matters&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;notes&#x2F;kv-caches-in-llm-inference&#x2F;#what-are-attention-heads&quot;&gt;What Are Attention Heads?&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;notes&#x2F;kv-caches-in-llm-inference&#x2F;#how-multi-headed-attention-works&quot;&gt;How Multi-Headed Attention
Works&lt;&#x2F;a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;notes&#x2F;kv-caches-in-llm-inference&#x2F;#relationship-to-kv-cache-and-the-papers-innovation&quot;&gt;Relationship to KV Cache and the Paper&#x27;s Innovation&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;notes&#x2F;kv-caches-in-llm-inference&#x2F;#kv-cache&quot;&gt;KV Cache&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;notes&#x2F;kv-caches-in-llm-inference&#x2F;#attention-heads&quot;&gt;Attention Heads&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;notes&#x2F;kv-caches-in-llm-inference&#x2F;#the-core-innovation-in-the-new-paper&quot;&gt;The Core Innovation in the New
Paper&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;notes&#x2F;kv-caches-in-llm-inference&#x2F;#model-weights-vs-activation-values&quot;&gt;Model Weights vs. Activation
Values&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;notes&#x2F;kv-caches-in-llm-inference&#x2F;#during-training&quot;&gt;During Training&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;notes&#x2F;kv-caches-in-llm-inference&#x2F;#during-inference&quot;&gt;During Inference&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;notes&#x2F;kv-caches-in-llm-inference&#x2F;#key-insight&quot;&gt;Key Insight&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;I have started using Claude to help to read and understand papers. It&#x27;s been educational so far. Claude could be hallucinating but what it says seems reasonable, and I hope grounding it in a pdf makes it less prone to making things up.&lt;&#x2F;p&gt;
&lt;p&gt;Recently I used this paper as an excuse to learn about KV caches and attention mechanisms: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2502.14882&quot;&gt;From 16-Bit to 1-Bit: Visual KV Cache Quantization for Memory-Efficient Multimodal Large Language Models&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;This is a transcript of my conversation.&lt;&#x2F;p&gt;
&lt;p style=&quot;text-align:center;&quot;&gt;&lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;attention-diagram.svg&quot; alt=&quot;Attention Mechanism&quot; class=&quot;center&quot;&gt;&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Explain this paper to me. Start with explaining what a KV cache is in the context of LLMs, and what this paper is proposing.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;This paper focuses on optimizing memory usage in Multimodal Large Language Models (MLLMs) through a novel approach to Key-Value (KV) cache quantization.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-is-a-kv-cache&quot;&gt;What is a KV Cache?&lt;&#x2F;h2&gt;
&lt;p&gt;In the context of Large Language Models, the KV cache is a memory optimization technique that stores previously computed key and value pairs from the attention mechanism during text generation.&lt;&#x2F;p&gt;
&lt;p&gt;When an LLM generates text, it processes tokens sequentially. For each new token, it needs to calculate attention over all previous tokens. Without a KV cache, the model would need to recompute these values for all previous tokens every time it generates a new token, which is computationally expensive.&lt;&#x2F;p&gt;
&lt;p&gt;The KV cache stores these intermediate representations (keys and values) in memory, so they can be reused when generating subsequent tokens. This trades memory usage for computational efficiency - it speeds up inference but requires more memory as the generated text gets longer.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-problem&quot;&gt;The Problem&lt;&#x2F;h2&gt;
&lt;p&gt;The paper identifies that in MLLMs, the visual components of inputs (like images) significantly increase the number of tokens that need to be processed. This creates much larger KV caches, leading to:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Increased memory consumption&lt;&#x2F;li&gt;
&lt;li&gt;Reduced throughput&lt;&#x2F;li&gt;
&lt;li&gt;Limited ability to run on devices with constrained GPU memory&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Prior approaches focused on dropping &quot;unimportant&quot; tokens to reduce KV cache size, but the authors demonstrate this approach can significantly degrade performance, especially when handling multiple objects or generating longer descriptions.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-the-paper-proposes&quot;&gt;What the Paper Proposes&lt;&#x2F;h2&gt;
&lt;p&gt;Instead of dropping tokens, the researchers propose &lt;strong&gt;quantizing the visual KV cache&lt;&#x2F;strong&gt; - reducing the precision of the stored values from the standard 16-bit floating-point format down to as low as 1-bit representation. This approach:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Preserves all visual tokens (no information loss)&lt;&#x2F;li&gt;
&lt;li&gt;Significantly reduces memory requirements&lt;&#x2F;li&gt;
&lt;li&gt;Maintains model performance&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;The key technical innovations are:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Group-specific quantization&lt;&#x2F;strong&gt;: Instead of quantizing the entire cache with the same parameters, they quantize specific groups (like attention heads) separately, preserving more fine-grained information.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Quantile-based quantization&lt;&#x2F;strong&gt;: Rather than using global min&#x2F;max values for scaling, they use quantiles to avoid extreme outliers from distorting the quantization range.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;results&quot;&gt;Results&lt;&#x2F;h2&gt;
&lt;p&gt;The researchers show they can quantize the KV cache down to 1-bit (16x compression) with minimal impact on performance across several image captioning metrics (BLEU, METEOR, ROUGE-L, CIDEr, SPICE) for the InternVL model family.&lt;&#x2F;p&gt;
&lt;p&gt;The approach is &quot;plug-and-play,&quot; meaning it can be integrated into various MLLMs without architectural modifications, making it widely applicable for improving memory efficiency in multimodal models.​​​​​​​​​​​​​​​​&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;What does calculate attention mean in your explanation?&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Great question! Let me explain what &quot;calculate attention&quot; means in the context of Large Language Models.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;attention-mechanism-explained&quot;&gt;Attention Mechanism Explained&lt;&#x2F;h2&gt;
&lt;p&gt;&quot;Calculate attention&quot; refers to a core operation in transformer-based models like LLMs and MLLMs. The attention mechanism determines how much focus or &quot;attention&quot; a model should place on different parts of the input when producing each part of the output.&lt;&#x2F;p&gt;
&lt;p&gt;Here&#x27;s how it works in more detail:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Representation Transformation&lt;&#x2F;strong&gt;: For each token (word or image patch), the model creates three vector representations:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Query (Q)&lt;&#x2F;strong&gt;: What the current token is &quot;looking for&quot;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Key (K)&lt;&#x2F;strong&gt;: What information each token &quot;offers&quot;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Value (V)&lt;&#x2F;strong&gt;: The actual content each token contains&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Attention Score Calculation&lt;&#x2F;strong&gt;: For each token position, the model computes how much it should &quot;attend to&quot; every other position by calculating compatibility scores between its query and all other tokens&#x27; keys.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;This is typically done through dot products: &lt;code&gt;Score = Q·K^T&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;These scores are then scaled and normalized using softmax to get attention weights between 0 and 1&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Weighted Aggregation&lt;&#x2F;strong&gt;: The model uses these attention weights to create a weighted sum of the value vectors.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;If token A has a high attention weight with token B, then token B&#x27;s value contributes strongly to token A&#x27;s output representation&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;This process allows the model to selectively focus on relevant parts of the input. For example, when generating a word that describes an object in an image, the model can &quot;attend&quot; heavily to the relevant visual tokens representing that object.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;why-kv-cache-matters&quot;&gt;Why KV Cache Matters&lt;&#x2F;h2&gt;
&lt;p&gt;The &quot;KV&quot; in KV cache refers specifically to the Key and Value matrices that are used in this attention calculation. When generating text, the model would normally need to recompute these K and V matrices for all previous tokens every time it generates a new token.&lt;&#x2F;p&gt;
&lt;p&gt;By saving these K and V matrices in a cache, the model can skip recomputing them for previously processed tokens, and only needs to:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Compute K and V for the newly generated token&lt;&#x2F;li&gt;
&lt;li&gt;Compute Q for the new token&lt;&#x2F;li&gt;
&lt;li&gt;Calculate attention scores between this new Q and all the cached K values&lt;&#x2F;li&gt;
&lt;li&gt;Produce a weighted sum using the cached V values&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;This significantly reduces the computational cost during text generation, especially for long sequences.​​​​​​​​​​​​​​​​&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;What are attention heads? What’s a head here? For example, I have seen multi-headed attention. What are these things and what’s the relationship to what you have explained above?&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Great question about attention heads! Let me clarify this important concept.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-are-attention-heads&quot;&gt;What Are Attention Heads?&lt;&#x2F;h2&gt;
&lt;p&gt;An &quot;attention head&quot; refers to a parallel instance of the attention mechanism I described earlier. In modern transformer architectures, instead of having just one attention mechanism, models typically employ multiple attention heads operating in parallel. This is what&#x27;s known as &quot;multi-headed attention.&quot;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;how-multi-headed-attention-works&quot;&gt;How Multi-Headed Attention Works&lt;&#x2F;h2&gt;
&lt;p&gt;Here&#x27;s how it breaks down:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Parallel Processing&lt;&#x2F;strong&gt;: Each head performs its own separate attention calculation simultaneously&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Each head has its own set of learned parameters (weight matrices) for projecting inputs into Query, Key, and Value spaces&lt;&#x2F;li&gt;
&lt;li&gt;This means each head can specialize in capturing different types of relationships&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Different Perspectives&lt;&#x2F;strong&gt;: Each head can focus on different aspects of the input&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;One head might attend to syntactic relationships&lt;&#x2F;li&gt;
&lt;li&gt;Another might focus on semantic similarities&lt;&#x2F;li&gt;
&lt;li&gt;Others might capture long-range dependencies or focus on specific visual features in multimodal models&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Dimension Splitting&lt;&#x2F;strong&gt;: To keep computational costs manageable, the full embedding dimension (often 768, 1024, or larger) is split among heads&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;For example, if a model has an embedding dimension of 768 and 12 attention heads, each head might operate on 64-dimensional vectors&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Output Concatenation&lt;&#x2F;strong&gt;: After each head performs its attention calculation, their outputs are concatenated and linearly transformed to produce the final output&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;relationship-to-kv-cache-and-the-papers-innovation&quot;&gt;Relationship to KV Cache and the Papers Innovation&lt;&#x2F;h2&gt;
&lt;p&gt;In the context of this paper and KV caching:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Per-Head Caching&lt;&#x2F;strong&gt;: The KV cache stores the Key and Value matrices for each attention head separately&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Why Group-Specific Quantization Matters&lt;&#x2F;strong&gt;: The paper observed that different attention heads show different statistical distributions in their Key and Value matrices (as shown in their Figure 4)&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Some heads might have values concentrated in different ranges&lt;&#x2F;li&gt;
&lt;li&gt;Some might have different outlier patterns&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The Innovation&lt;&#x2F;strong&gt;: Instead of applying the same quantization parameters to the entire KV cache, the paper proposes quantizing each attention head&#x27;s cache separately&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;This preserves the unique information captured by each head&lt;&#x2F;li&gt;
&lt;li&gt;It allows for more effective extreme quantization (down to 1-bit)&lt;&#x2F;li&gt;
&lt;li&gt;This approach maintains the specialized focus that different heads have learned&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;This head-specific approach is crucial because it recognizes that in MLLMs, different attention heads might specialize in different aspects of visual understanding. Some heads might focus on object shapes, others on colors, others on spatial relationships, etc. By quantizing each head with parameters tailored to its specific value distribution, the model preserves more of the specialized information that each head has learned to extract.​​​​​​​​​​​​​​​​&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;In Multi-headed attention, does each attention head operate on all the previous tokens or only part of the tokens? I have attached the attention is all you need paper to ground your answers in.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;In multi-headed attention, each attention head operates on &lt;strong&gt;all&lt;&#x2F;strong&gt; of the previous tokens, but in a different way than other heads.&lt;&#x2F;p&gt;
&lt;p&gt;Looking at the &quot;Attention Is All You Need&quot; paper you shared, this is clearly explained in section 3.2.2 on Multi-Head Attention:&lt;&#x2F;p&gt;
&lt;p&gt;Each attention head takes the &lt;strong&gt;complete set&lt;&#x2F;strong&gt; of input tokens, but projects them into different subspaces using different learned weight matrices. Specifically, the paper states:&lt;&#x2F;p&gt;
&lt;p&gt;&quot;Instead of performing a single attention function with dmodel-dimensional keys, values and queries, we found it beneficial to linearly project the queries, keys and values h times with different, learned linear projections to dk, dk and dv dimensions, respectively. On each of these projected versions of queries, keys and values we then perform the attention function in parallel, yielding dv-dimensional output values.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;So rather than dividing the input tokens among different heads (which would mean each head sees only a subset of tokens), multi-headed attention:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Takes the complete input sequence for all heads&lt;&#x2F;li&gt;
&lt;li&gt;Projects this same input into different representation subspaces for each head (using different learned weight matrices)&lt;&#x2F;li&gt;
&lt;li&gt;Computes attention separately in each of these different subspaces&lt;&#x2F;li&gt;
&lt;li&gt;Concatenates the results and projects them back to the original dimension&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;This approach allows each head to focus on different aspects of the relationships between tokens. For example, one head might learn to focus on syntactic relationships, while another might focus on semantic relationships, all while having access to the complete sequence of tokens.&lt;&#x2F;p&gt;
&lt;p&gt;The paper explicitly states the benefit of this approach: &quot;Multi-head attention allows the model to jointly attend to information from different representation subspaces at different positions. With a single attention head, averaging inhibits this.&quot;&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;How do attention heads learn to specialize in semantic relationships or syntactic relations like you describe above? Again, ground your answers in the artifacts attached to this chat.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;The &quot;Attention Is All You Need&quot; paper doesn&#x27;t explicitly describe the mechanism by which attention heads specialize in different types of relationships. This is more of an empirical observation researchers have made when analyzing trained transformer models.&lt;&#x2F;p&gt;
&lt;p&gt;However, we can understand how this specialization happens by examining the architecture and training process detailed in the paper:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Different initialization&lt;&#x2F;strong&gt;: As shown in section 3.2.2, each head has its own set of projection matrices (W^Q_i, W^K_i, W^V_i). These matrices are randomly initialized before training, giving each head a different starting point.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Parameter learning through backpropagation&lt;&#x2F;strong&gt;: During training, these parameters are updated to minimize the loss function. Since each head starts with different parameters and experiences the gradients through a different projection of the same inputs, they naturally evolve to capture different patterns.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Dimensionality reduction&lt;&#x2F;strong&gt;: The paper states that for each head &quot;we use dk = dv = dmodel&#x2F;h = 64.&quot; This reduced dimension forces each head to focus on a subset of possible relationships in the data rather than capturing everything.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;The authors indirectly acknowledge this specialization in Section 5 (page 7) where they mention:&lt;&#x2F;p&gt;
&lt;p&gt;&quot;As side benefit, self-attention could yield more interpretable models. We inspect attention distributions from our models and present and discuss examples in the appendix. Not only do individual attention heads clearly learn to perform different tasks, many appear to exhibit behavior related to the syntactic and semantic structure of the sentences.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;This indicates that the authors observed this specialization phenomenon in their experiments, even though they don&#x27;t detail the specific mechanisms that cause it.&lt;&#x2F;p&gt;
&lt;p&gt;What happens is that during training, if one head becomes slightly better at capturing a particular pattern (like syntactic relationships), the optimization process will reinforce this specialization because it contributes to reducing the overall loss. Other heads are then free to specialize in different aspects of the data.&lt;&#x2F;p&gt;
&lt;p&gt;The paper also notes in Section 4 that self-attention has advantages in modeling long-range dependencies because &quot;a self-attention layer connects all positions with a constant number of sequentially executed operations.&quot; This global connectivity allows different heads to specialize in different ranges and types of dependencies that exist in the training data.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;To summarize:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;KV Cache in LLM inference is used to speed up the processing by caching the K (each token identifier) and V (the information each token has generated) for all the previous tokens. Since KV will change for the previous tokens for each new token being generated, longer the conversation, more the memory required.
&lt;ul&gt;
&lt;li&gt;This technique trades computation for memory, in service of inference speed.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;KV &amp;amp; Q are computed as part of the attention process, which is what makes a transformer a transformer. There are multiple attention heads, initialized with different values and that end up specializing in different parts of the language. These heads are run on all the &amp;gt; previous tokens for each new token being generated. They are run in parallel and concatenated at the end.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Is my understanding accurate?&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Your understanding is quite accurate! Let me clarify a few nuances to ensure your mental model is complete:&lt;&#x2F;p&gt;
&lt;h3 id=&quot;kv-cache&quot;&gt;KV Cache&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;You&#x27;ve captured the essence correctly - KV cache stores previously computed key and value matrices to avoid redundant calculations.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;One small correction: The K doesn&#x27;t represent &quot;each token identifier&quot; but rather the &quot;key&quot; vectors derived from the tokens. Each token&#x27;s embedding is transformed through learned weight matrices into query (Q), key (K), and value (V) vectors.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;An important clarification: The K and V matrices for previous tokens don&#x27;t change when a new token is generated. That&#x27;s precisely why caching works - once computed, these matrices remain constant. What changes is that we add new K and V vectors for each new token.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;The memory usage grows linearly with sequence length because we must store these fixed K and V matrices for all previous tokens, which is why extremely long conversations become memory-intensive.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;attention-heads&quot;&gt;Attention Heads&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;You&#x27;re correct that multiple attention heads are what make transformers powerful. Each head can specialize in different linguistic patterns during training.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Perfect understanding that all heads process all tokens - they don&#x27;t divide the tokens among themselves.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;The specialization happens naturally through training, as each head (with different initialization) learns to extract different patterns that together minimize the loss function.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;The parallel processing of attention heads is indeed a key advantage of transformers over sequential models like RNNs.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;the-core-innovation-in-the-new-paper&quot;&gt;The Core Innovation in the New Paper&lt;&#x2F;h3&gt;
&lt;p&gt;The paper you initially shared (&quot;From 16-Bit to 1-Bit&quot;) builds on this understanding by recognizing that we can compress the KV cache through quantization (reducing numerical precision) without significantly affecting model performance. By quantizing the visual KV cache from 16-bit to as low as 1-bit representation, they achieve dramatic memory savings while preserving model quality.&lt;&#x2F;p&gt;
&lt;p&gt;Their key insight was that different attention heads show different statistical distributions, so applying separate quantization parameters to each head (rather than global quantization) preserves the specialized information each head has learned to extract.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Is V, the value&#x2F;content of each token derived from the embeddings of the sentence or text the token is part of?&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Yes, the value (V) representation for each token is indeed derived from the embeddings of that token, which is part of the overall input sequence (sentence or text).&lt;&#x2F;p&gt;
&lt;p&gt;Let me walk through how this works in more detail:&lt;&#x2F;p&gt;
&lt;p&gt;When a sequence of tokens enters a transformer model, each token first gets converted into an embedding vector. This embedding typically combines:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;A learned token embedding that represents the semantic meaning of the token&lt;&#x2F;li&gt;
&lt;li&gt;A positional encoding that indicates where in the sequence the token appears&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Once we have these embeddings, each transformer layer processes them further. Within each layer&#x27;s attention mechanism, these embeddings are transformed into three different representations through learned linear projections:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Query (Q)&lt;&#x2F;strong&gt;: What the current token is &quot;looking for&quot; or &quot;asking about&quot;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Key (K)&lt;&#x2F;strong&gt;: What aspects of the token might be relevant to other tokens&#x27; queries&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Value (V)&lt;&#x2F;strong&gt;: The actual information content that gets extracted from the token&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;These transformations happen via matrix multiplication with the learned weight matrices:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Q = Embedding × W^Q&lt;&#x2F;li&gt;
&lt;li&gt;K = Embedding × W^K&lt;&#x2F;li&gt;
&lt;li&gt;V = Embedding × W^V&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The value vectors contain the actual information that gets weighted and aggregated during the attention computation. When one token &quot;attends to&quot; another token strongly, it&#x27;s essentially extracting more information from that token&#x27;s value vector.&lt;&#x2F;p&gt;
&lt;p&gt;So to directly answer your question - yes, the value representation is derived directly from each token&#x27;s embedding. The V matrix contains transformed versions of the original token embeddings, where the transformation is learned during training to encode useful information that other tokens might want to access.&lt;&#x2F;p&gt;
&lt;p&gt;In multi-headed attention, each head has its own separate W^V matrix, allowing different heads to extract different kinds of information from the same token embeddings. This is part of why different heads can specialize in different linguistic patterns or relationships.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;During inference, are the weights computed again? Or these are the weights computed during the training process? I am trying to understand the relationship between the K, V, Q during training versus inference. During training, one doesn&#x27;t need a KV cache because the KV changes for a token during each step right?&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Great question! Let me clarify how weights and computations work during both training and inference:&lt;&#x2F;p&gt;
&lt;h3 id=&quot;model-weights-vs-activation-values&quot;&gt;Model Weights vs. Activation Values&lt;&#x2F;h3&gt;
&lt;p&gt;First, we need to distinguish between two different concepts:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Model Weights&lt;&#x2F;strong&gt;: These are the learned parameters (W^Q, W^K, W^V) that transform token embeddings into query, key, and value vectors. These weights are learned during training and remain fixed during inference.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Activation Values&lt;&#x2F;strong&gt;: These are the actual Q, K, V vectors produced when we apply those weights to specific input tokens. These change depending on the input.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;during-training&quot;&gt;During Training&lt;&#x2F;h3&gt;
&lt;p&gt;During training, the model processes batches of complete sequences (like sentences or paragraphs):&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;The model weights (W^Q, W^K, W^V) are initially random and get updated through backpropagation.&lt;&#x2F;li&gt;
&lt;li&gt;For each training example, the model computes Q, K, V vectors for all tokens in the sequence.&lt;&#x2F;li&gt;
&lt;li&gt;The model performs attention calculations, computes the loss, and updates the weights.&lt;&#x2F;li&gt;
&lt;li&gt;You&#x27;re right that we don&#x27;t need a KV cache during training because:
&lt;ul&gt;
&lt;li&gt;We process complete sequences all at once&lt;&#x2F;li&gt;
&lt;li&gt;We need to recompute activations after weights change with each update&lt;&#x2F;li&gt;
&lt;li&gt;The training is typically done with batches of multiple examples in parallel&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;during-inference&quot;&gt;During Inference&lt;&#x2F;h3&gt;
&lt;p&gt;During inference (when generating text), the model weights are fixed - we&#x27;re using the final trained weights:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;When processing the initial prompt (prefix), the model computes K and V vectors for all tokens, just like in training.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;The critical difference comes during generation: as we generate each new token, we would normally need to recompute attention over all previous tokens.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Instead, we store (cache) the K and V vectors for all previous tokens. These don&#x27;t change because:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;The model weights are now fixed&lt;&#x2F;li&gt;
&lt;li&gt;The input tokens don&#x27;t change&lt;&#x2F;li&gt;
&lt;li&gt;The transformations applied to them won&#x27;t change&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;For each new token, we only need to:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Compute K and V for just the new token (using the same fixed weights)&lt;&#x2F;li&gt;
&lt;li&gt;Add these to our cached K and V matrices&lt;&#x2F;li&gt;
&lt;li&gt;Compute Q for the new token&lt;&#x2F;li&gt;
&lt;li&gt;Calculate attention using the new Q against all cached K vectors&lt;&#x2F;li&gt;
&lt;li&gt;Extract information using the corresponding V vectors&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;This dramatically reduces computation since we avoid recomputing K and V for all previous tokens with each new token generation.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;key-insight&quot;&gt;Key Insight&lt;&#x2F;h3&gt;
&lt;p&gt;The KV cache works during inference but not training because:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;During training: Weights are constantly changing, so K and V values would need to be recomputed anyway&lt;&#x2F;li&gt;
&lt;li&gt;During inference: Weights are fixed, so previously computed K and V values remain valid and can be reused&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;This distinction is at the heart of why the KV cache is an inference optimization technique rather than a training technique.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Skunk Works</title>
        <published>2025-03-04T00:00:00+00:00</published>
        <updated>2025-03-04T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/skunk-works/"/>
        <id>https://asun9.com/skunk-works/</id>
        
        <content type="html" xml:base="https://asun9.com/skunk-works/">&lt;blockquote&gt;
&lt;p&gt;You don’t need Harvard to teach you that it’s more important to listen than to talk. You can get straight A’s from all your Harvard profs, but you’ll never make the grade unless you are decisive: even a timely wrong decision is better than no decision. The final thing you’ll need to know is don’t half-heartedly wound problems—kill them dead. That’s all there is to it. Now you can run this goddam place.&lt;&#x2F;p&gt;
&lt;p&gt;— &lt;cite&gt; Kelly Johnson to Ben Rich, on everything he needed to know about running a company. &lt;&#x2F;cite&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Early last year, a project I had been working on for a while got canned. Around the same time, I read Ben Rich&#x27;s memoir of his years at Lockheed&#x27;s famed Skunk Works division, and I&#x27;ve been turning it over in my mind since then. The history of aerospace development in the United States has many fascinating chapters, but few are as consistently impressive as the half-century run of the Skunk Works under Kelly Johnson and later Ben Rich.&lt;&#x2F;p&gt;
&lt;p&gt;It is striking how similar the organization I was with then and Skunk Works were. Ambitious R&amp;amp;D? Check. Heavily gated by disclosure? Check. Severely understaffed? Check. World class generalists? Check. Isolated from the parent company? Check. It did not end well for us because there were few other crucial ingredients missing from the list, including stable leadership. What makes Skunk Works&#x27; story worth examining isn&#x27;t just the technological marvels they produced but rather the organizational and managerial approach that allowed them to consistently ship aircraft on budget, ahead of time, while their competitors struggled with cost overruns, delays, and mediocre results. In any business that involves creating complex products under challenging constraints, there&#x27;s much to learn from their experience.&lt;&#x2F;p&gt;
&lt;p style=&quot;text-align:center;&quot;&gt;&lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;SR-71.webp&quot; alt=&quot;SR-71 Blackbird&quot; class=&quot;center&quot;&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-model&quot;&gt;The Model&lt;&#x2F;h2&gt;
&lt;p&gt;The Skunk Works began as an applied research division of Lockheed during World War II when the company was tasked with building America&#x27;s first jet fighter. The official name of the working group was Advanced Development Projects. The pseudonym that stuck came from a popular comic strip of the era, after engineer Irv Culver answered a phone call with &quot;Skonk Works.&quot;&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-skonk-1&quot;&gt;&lt;a href=&quot;#fn-skonk&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Alongside a jet fighter, what emerged during those years was a different, clearly effective way of developing advanced technology, when compared to other defense firms. That fighter, The XP-80 Shooting Star, America&#x27;s first operational jet fighter, was designed and built by a small team in just 143 days. This approach would go on to produce the most innovative aircraft in history: the U-2 spy plane, SR-71 Blackbird (still remains the fastest manned, air-breathing jet aircraft ever built, after being introduced in 1964!), and the F-117 stealth fighter.&lt;&#x2F;p&gt;
&lt;p&gt;Several key factors allowed this small division to consistently outperform much larger organizations.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;1-minimal-bureaucracy&quot;&gt;1. Minimal Bureaucracy&lt;&#x2F;h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Kelly&#x27;s motto was &#x27;Be quick, be quiet, be on time.&#x27;&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Kelly Johnson ran the Skunk Works with a &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;connections.digital&#x2F;kelly-johnsons-14-rules-of-management&#x2F;&quot;&gt;set of 14 rules&lt;&#x2F;a&gt;. These rules established an environment of minimal bureaucracy, tight security, and autonomy from corporate oversight.&lt;&#x2F;p&gt;
&lt;p&gt;The traditional defense contracting process involves layers of management approval, extensive documentation, and constant oversight, all of which slow down development and increase costs. Kelly Johnson deliberately stripped away these layers.&lt;&#x2F;p&gt;
&lt;p&gt;When Ben Rich took over after 25 years of Kelly&#x27;s reign, he faced far more regulatory constraints than Johnson had (EPA, OSHA, EEOC, affirmative action requirements), yet he still fought to maintain the essential independence that made their work possible. As government oversight increased, Rich found himself with &quot;nearly forty auditors living with me inside our plant, watching every move we made.&quot; One auditor memorably told him, &quot;Mr. Rich, let&#x27;s get something straight: I don&#x27;t give a damn if you turn out scrap. It&#x27;s far more important that you turn out the forms we require.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;Once an organization becomes large enough, process trumps product&lt;&#x2F;em&gt;. The Skunk Works&#x27; success was built on constantly resisting this pressure. Bureaucracy should be questioned relentlessly.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;2-small-teams-of-exceptional-people&quot;&gt;2. Small Teams of Exceptional People&lt;&#x2F;h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;We had a very strong and innovative design organization of about a dozen truly brilliant engineers, working at their drawing boards in a big barnlike room on the second floor of our headquarters building, who simply could not be conned or browbeaten into doing anything they knew would not work.&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;The Skunk Works operated with remarkably small teams. For their stealth fighter project, they began with just fifty veteran engineers and designers and a hundred or so expert machinists and shop workers. They deliberately hired generalists rather than narrow specialists, people who could approach problems from unconventional angles.&lt;&#x2F;p&gt;
&lt;p&gt;Rich notes that for the F-117 stealth fighter, the one that graces the cover of the book, they delivered the first operational squadron in five years, while McDonnell Douglas took ten years to produce their first squadron of F-18s - and theirs was a conventional design while the Skunk Works was creating revolutionary technology.&lt;&#x2F;p&gt;
&lt;p&gt;In the Skunk Works, I see confirmation of what I&#x27;ve repeatedly encountered: the right team of 10 people can outperform a middling team of 100, especially when shipping is the goal. While this insight permeates Silicon Valley thinking, it merits continued emphasis. WhatsApp, with 32 engineers, managed a platform used by 450 million users. OpenAI, with 500 employees, shipped ChatGPT, ChatGPT Plugins, and GPT-4 within just 6 months.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-collocation-and-direct-communication&quot;&gt;3. Collocation and Direct Communication&lt;&#x2F;h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Kelly&#x27;s rule was never put an engineer more than fifty feet from the assembly area.&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Physical proximity between designers and builders was a fundamental Skunk Works principle. This wasn&#x27;t just about convenience. It changed how problems were solved.&lt;&#x2F;p&gt;
&lt;p&gt;Rich describes how &quot;our designers spent at least a third of their day right on the shop floor; at the same time, there were usually two or three shop workers up in the design room conferring on a particular problem.&quot; This created an environment where &quot;my weights man talked to my structures man, and my structures man talked to my designer, and my designer conferred with my flight test guy, and they all sat two feet apart, conferring and kibitzing every step of the way.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;Unlike the streamlined approach of small teams and small orgs, large organizations frequently fracture into isolated silos, leading to multiple engineering teams unknowingly tackling identical problems across different departments. When these parallel efforts eventually collide, energy shifts from problem-solving to internal competition for recognition, ownership, and deployment rights - a wasteful misallocation of talent and resources.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;4-deeply-technical-leadership&quot;&gt;4. Deeply Technical Leadership&lt;&#x2F;h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;I had never known anyone so expert at every aspect of airplane design and building. He was a great structures man, a great designer, a great aerodynamicist, a great weights man. He was so sharp and instinctive that he often took my breath away.&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;This is Rich&#x27;s description of Kelly Johnson. Johnson wasn&#x27;t a remote manager - he was the chief engineer who could outperform nearly anyone on his team.&lt;&#x2F;p&gt;
&lt;p&gt;Rich followed this model, having served as the propulsion and thermodynamics expert for the Blackbird before becoming the division&#x27;s leader. They led from knowledge, not just position.&lt;&#x2F;p&gt;
&lt;p&gt;Companies employ both technically informed leaders and purely business-oriented managers. Success can come from either approach, but technical competence often results in quicker, more confident decisions and inspires a particular type of respect from team members.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;5-direct-customer-relationships&quot;&gt;5. Direct Customer Relationships&lt;&#x2F;h3&gt;
&lt;p&gt;A unique aspect of the Skunk Works was their direct relationship with their customers, primarily the CIA and Air Force, without the parent organization in the loop. Kelly Johnson personally briefed generals and agency directors, keeping a direct line between technical decisions and customer needs.&lt;&#x2F;p&gt;
&lt;p&gt;This direct connection allowed them to maintain focus on what mattered most to the end user. When Johnson presented design concepts to the Air Force, he had already internalized their needs and could respond directly to concerns without going through layers of bureaucratic translation.&lt;&#x2F;p&gt;
&lt;p&gt;You need to work backwards from the product and you need to be aware of what your customers need, even if they cannot articulate it. Now that I think about it, who were &lt;em&gt;we&lt;&#x2F;em&gt; building for?&lt;&#x2F;p&gt;
&lt;h3 id=&quot;6-good-enough-over-great&quot;&gt;6. Good-enough Over Great&lt;&#x2F;h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Perfection was seldom a Skunk Works goal. If we were off in our calculations by a pound or a degree, it didn&#x27;t particularly concern us.&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;The Skunk Works embraced a philosophy that 80% efficiency would get the job done, and straining for that extra 20% would cost as much as 50% more in overtime and delays while having little real impact on the aircraft&#x27;s performance.&lt;&#x2F;p&gt;
&lt;p&gt;This wasn&#x27;t about cutting corners on safety or quality, but rather about making intelligent trade-offs. They evaluated risks carefully and focused resources on the areas that mattered.&lt;&#x2F;p&gt;
&lt;p&gt;It is always worth asking if a release should be delayed over &quot;just one more feature.&quot; One should always be shipping.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;entropy-claims-all&quot;&gt;Entropy Claims All&lt;&#x2F;h2&gt;
&lt;p&gt;The average tenure of an S&amp;amp;P 500 company is 18 years. Organizational performance typically fades after two leadership transitions. Microsoft appears unique with three such leaders, culminating with Satya Nadella, while Google also operates under its third CEO. Intel&#x27;s heydays were also under its third CEO, Andy Grove.&lt;&#x2F;p&gt;
&lt;p&gt;While a 50-year run is extraordinary, Skunk Works eventually had to give way to entropy. It seems like this was a result of both longer term industry trends and changes in leadership. Some factors that contributed to this change:&lt;&#x2F;p&gt;
&lt;h3 id=&quot;1-increased-regulatory-burden&quot;&gt;1. Increased Regulatory Burden&lt;&#x2F;h3&gt;
&lt;p&gt;The regulatory environment changed dramatically between Kelly Johnson&#x27;s early days and Rich&#x27;s later tenure. Rich specifically mentions EPA, OSHA, EEOC, and affirmative action requirements that added complexity to their operations. These served important social purposes but they did make the lean Skunk Works approach harder to maintain.&lt;&#x2F;p&gt;
&lt;p&gt;The moment you give in to some oversight of your product strategy to outsiders, you have given away a lot.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;2-industry-consolidation-and-budget-constraints&quot;&gt;2. Industry Consolidation and Budget Constraints&lt;&#x2F;h3&gt;
&lt;p&gt;As Rich notes toward the end of his memoir, the aerospace industry underwent significant consolidation, and the number of new aircraft developed declined drastically. In the 1950s, 49 new aircraft were introduced. By the 1980s, only 7 new designs emerged. This reflected both budget constraints and the increasing complexity of modern aircraft.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-the-rise-of-distributed-manufacturing&quot;&gt;3. The Rise of Distributed Manufacturing&lt;&#x2F;h3&gt;
&lt;p&gt;The B-2 bomber project that Rich describes represents the antithesis of the Skunk Works approach. Instead of a small team building an entire aircraft, the B-2 was manufactured in pieces by multiple companies: &quot;Boeing makes the wings, Northrop makes the cockpit, and LTV makes the bomb bays and back end of the B-2 airplane, in addition to four thousand subcontractors working on bits and pieces of everything else.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;This distributed approach was driven by political and economic considerations rather than technical efficiency. When billions of dollars are at stake, the pressure to spread contracts across multiple congressional districts becomes enormous.&lt;&#x2F;p&gt;
&lt;p&gt;The shrinking industrial base and outsourcing meant a loss of highly skilled workforce, including skilled toolmakers and welders, machinists, designers, die makers.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;4-increasing-technical-complexity&quot;&gt;4. Increasing Technical Complexity&lt;&#x2F;h3&gt;
&lt;p&gt;Modern aircraft incorporate vastly more complex systems than their predecessors. The F-35, which began development shortly after Rich&#x27;s retirement, represents this trend. It contains millions of lines of code and integrates systems from numerous suppliers. This complexity makes the generalist approach of the original Skunk Works harder to sustain.&lt;&#x2F;p&gt;
&lt;p&gt;Starting in 1996, Lockheed worked on the F-35 for 20 years before it was introduced.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;5-the-rise-of-tech-industry&quot;&gt;5. The Rise Of Tech Industry&lt;&#x2F;h3&gt;
&lt;p&gt;By the late 1980s, high-tech industries contributed around 5% of U.S. GDP. Defense spending peaked during the Reagan administration&#x27;s military buildup, reaching about 6% of GDP, before dropping to roughly 3% during the Clinton presidency after the Cold War&#x27;s end. Even during the Afghanistan and Iraq war years, defense spending accounted for 4% of the GDP. Meanwhile, the tech industry continued its ascent through the 2000s, and by 2019, it contributed around 10% of U.S. GDP.&lt;&#x2F;p&gt;
&lt;p&gt;By the time this book was published, 1996, the rise of Silicon Valley should have been evident. While Ben Rich doesn&#x27;t comment on it, this parallel development surely affected Skunk Works&#x27; competitive environment. Silicon Valley began attracting some of the most technically gifted and ambitious minds in the last decades of the twentieth century. As the tech sector created more value, it could afford increasingly generous compensation packages, with stock options and RSUs offering wealth-creation possibilities that defense contractors struggled to match.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;coda&quot;&gt;Coda&lt;&#x2F;h2&gt;
&lt;p&gt;Skunk Works demonstrates the power of a clear, compelling mission. Everyone involved understood they were working on something vital, something that pushed the boundaries of what was possible. That sense of purpose fueled their commitment and creativity.&lt;&#x2F;p&gt;
&lt;p&gt;Rich&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-titan-1&quot;&gt;&lt;a href=&quot;#fn-titan&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; notes near the end of his memoir: &quot;We became the most successful advanced projects company in the world by hiring talented people, paying them top dollar, and motivating them into believing that they could produce a Mach 3 airplane like the Blackbird a generation or two ahead of anybody else.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;Perhaps that&#x27;s the most important lesson: give talented people a clear mission, the resources they need, and then get out of their way.&lt;&#x2F;p&gt;
&lt;br&#x2F;&gt;
&lt;p style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;FOOTNOTES&lt;&#x2F;b&gt; &lt;&#x2F;p&gt;
&lt;footer class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-skonk&quot;&gt;
&lt;p&gt;Kelly immediately fired him on the spot, presumably for not maintaining the appropriate seriousness for the task at hand. Irv Culver, however, was back at work the next day, and all was forgotten. &lt;a href=&quot;#fr-skonk-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-titan&quot;&gt;
&lt;p&gt;Rich&#x27;s style is to intersperse his narrative with anecdotes. This one greatly amused me. For their Mach 3+ spy plane, the A-12, Skunk Works decided on titanium as the build material. It could withstand high temperatures and would not fry the pilot. Through a series of shell companies, the CIA (Lockheed&#x27;s client) and Skunk Works sourced titanium from a country that produced it at the necessary volume. The country that thus contributed to the most high-tech reconnaissance plane in the world? The Soviet Union. &lt;a href=&quot;#fr-titan-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;footer&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>SpaceX</title>
        <published>2025-02-22T00:00:00+00:00</published>
        <updated>2025-02-22T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/musk-spacex-eric-berger/"/>
        <id>https://asun9.com/musk-spacex-eric-berger/</id>
        
        <content type="html" xml:base="https://asun9.com/musk-spacex-eric-berger/">&lt;p&gt;Book: &lt;strong&gt;Reentry: SpaceX, Elon Musk, and the Reusable Rockets that Launched a Second Space Age&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Eric Berger&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Only the paranoid survive.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Andy Grove&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;blockquote&gt;
&lt;br&#x2F;&gt;
&lt;blockquote&gt;
&lt;p&gt;An institution is the lengthened shadow of one man;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Emerson&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;blockquote&gt;
&lt;br&#x2F;&gt;
&lt;blockquote&gt;
&lt;p&gt;A maniacal sense of urgency is our operating principle.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Elon Musk&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;blockquote&gt;
&lt;br&#x2F;&gt;
&lt;p&gt;In 2002, private launch services independent of government contracts or largesse did not exist. Blue Origin had been incorporated in 2000. Boeing and Lockheed depended almost exclusively on government support and infrastructure. SpaceX was just one among many aspiring private space companies. Its peers included established players like Arianespace, a French firm which had practically invented commercial launch services, and American companies like Orbital Sciences Corporation. Innovative startups like John Carmack&#x27;s Armadillo Aerospace and Sea Launch promised to revolutionize space access.&lt;&#x2F;p&gt;
&lt;p&gt;Yet within two decades, most of these companies had either failed, stagnated, or been left behind. By late 2024, Blue Origin still hadn&#x27;t launched a successful orbital mission. Boeing&#x27;s SLS rocket that was meant to replace NASA&#x27;s Space Shuttle program was canceled after being delayed significantly, with NASA spending approximately $3 billion a year developing the rocket and its ground systems over the program&#x27;s lifetime. Boeing&#x27;s Starliner program had resulted in losses of nearly $1 billion on a fixed-price contract meant to provide NASA with crew transportation to the International Space Station. Even when Starliner finally launched astronauts Wilmore and Williams to the ISS in June 2024, Boeing proved unable to return them safely to Earth, forcing NASA to contract SpaceX&#x27;s Dragon capsule for their return journey.&lt;&#x2F;p&gt;
&lt;p&gt;In 2024 alone SpaceX completed 134 launches with its Falcon family of rockets. That was half of all orbital launches worldwide that year. NASA launched the Space Shuttle 135 times over a 30 year period. SpaceX reached its 400th Falcon 9 launch in November 2024. By that time, SpaceX had launched over 6,370 active Starlink satellites, representing nearly two-thirds of all operational satellites in orbit. This dominance by one company would have been unthinkable in 2002.&lt;&#x2F;p&gt;
&lt;p&gt;A large portion of the reasons for the difference in outcomes between SpaceX and its competitors can be attributed to how SpaceX operates. SpaceX is very top-down and mission-driven, a vehicle for Musk&#x27;s stated desire to make humanity inter-planetary, however incredulous that may sound. They do not function at all like a traditional aerospace firm.&lt;&#x2F;p&gt;
&lt;p&gt;The decisions SpaceX has made over the years can only be explained in the light of this mission, a belief in a something that is beyond just making profit. While Boeing and Lockheed  only moved when incentivized by government contracts, SpaceX aimed for Mars. This higher purpose attracted talented engineers willing to work punishing hours because they believed in the mission. When Musk pushed for reusable rockets or proposed loading super-chilled propellants with astronauts aboard - ideas that initially met fierce resistance - it was always in service of this larger goal.&lt;&#x2F;p&gt;
&lt;div class=&quot;yv&quot;&gt;
    &lt;iframe src=&quot;https:&#x2F;&#x2F;www.youtube-nocookie.com&#x2F;embed&#x2F;ANv5UfZsvZQ&quot; title=&quot;Look at the young &amp;#x27;uns&quot; class=&quot;yvi&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;&#x2F;iframe&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;The company created a unique culture of high-stakes responsibility and rapid iteration. Young engineers in their twenties were given tremendous responsibility, like managing the Merlin engine development program or overseeing crucial launch operations. When failures occurred - and they did, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Jlj2BW8AtUQ&quot;&gt;spectacularly at times&lt;&#x2F;a&gt; - the focus was on learning and improving rather than assigning blame. This created an environment where innovation flourished despite, or perhaps because of, the intense pressure. While competitors like Blue Origin operated more like &quot;the world&#x27;s largest single-donor nonprofit&quot; with comfortable 40-hour work weeks, SpaceX maintained a startup mentality even as it grew. Musk&#x27;s insistence on vertical integration and in-house manufacturing allowed SpaceX to iterate quickly and control costs.&lt;&#x2F;p&gt;
&lt;p&gt;While SpaceX was iterating rapidly and taking calculated risks to advance technology, Boeing followed a conservative, process-heavy approach that paradoxically led to more problems. When facing technical challenges, Boeing&#x27;s response was typically to add more layers of review and documentation rather than solving the core issues. Their engineers seemed more focused on satisfying bureaucratic requirements than achieving practical results&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-nasaPref-1&quot;&gt;&lt;a href=&quot;#fn-nasaPref&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;. When SpaceX needed to improve its rocket&#x27;s performance, it developed super-chilled propellants and challenged conventional loading procedures, even risking (and losing) a customer&#x27;s satellite in the process&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-zuckResponse-1&quot;&gt;&lt;a href=&quot;#fn-zuckResponse&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;. Established companies would never risk the loss of cargo on new tech. Meanwhile, United Launch Alliance, the Boeing-Lockheed joint venture, continued to rely on Russian-made engines for its Atlas rockets, seeing no urgent need to develop domestic alternatives despite the strategic risks.&lt;&#x2F;p&gt;
&lt;p&gt;It should be obvious by now that the reason why SpaceX operates the way it does is because of Elon Musk. His mission is SpaceX&#x27;s. His timelines are SpaceX&#x27;s. The same qualities that make Musk nearly impossible to work with - his obsessiveness, unreasonable standards, and demands for lightning-fast execution - have pushed aerospace engineering further in two decades than the industry managed in the previous twenty years.&lt;&#x2F;p&gt;
&lt;p&gt;Musk&#x27;s management style is legendary for its intensity. I have heard from engineers from the Tesla Autopilot team who quit six months in. That team once organized their work around minimizing interactions with him, knowing that any shortfall would trigger explosive reactions. In SpaceX, when the VP of Structures, Chris Thompson, was driving with a colleague named Carlson, Musk called to berate Thompson and ordered him to fire Carlson on the spot. When Thompson refused, saying he wasn&#x27;t Carlson&#x27;s supervisor, Musk threatened to fire them both. This volatility and immediate escalation to threats is typical. In this case, Thompson and Carlson went on with their work, and Musk did not mention the matter again.&lt;&#x2F;p&gt;
&lt;p&gt;Yet this same intensity drives unprecedented achievement. SpaceX employees refer to Musk&#x27;s timelines as &quot;green lights to Malibu&quot; - schedules that assume every traffic light will be green on the way to Malibu, making them literally impossible to meet. While these deadlines are never achieved, they push teams to move at speeds that make traditional aerospace companies look glacial by comparison. As one executive noted, &quot;Like everything else we&#x27;ve ever done, it was way slower than Elon wanted, and way faster than anyone had ever done it before.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;The toll on employees is severe. Even at the senior level, executives accept that they are &quot;already dead&quot; when taking the job, knowing they&#x27;ll eventually burn out or be fired. Working weeks of 80-100 hours are common. Employees sacrifice marriages, family time, and personal lives in service of SpaceX&#x27;s mission. Many quit or break under the pressure, yet the company continues to attract top talent drawn by the opportunity to push the boundaries of what&#x27;s possible in spaceflight.&lt;&#x2F;p&gt;
&lt;p&gt;This creates a paradox: clearly Musk&#x27;s leadership style is simultaneously SpaceX&#x27;s greatest strength and its most significant vulnerability. His refusal to accept conventional limitations, coupled with his willingness to take personal responsibility for major decisions, enables SpaceX to move at speeds that competitors can&#x27;t match. They fail faster, learn faster, improve faster. When traditional aerospace companies defer decisions to committees and endless reviews, Musk makes quick calls and accepts the consequences, allowing SpaceX to iterate and improve rapidly. During one launch preparation, as teams worked to fix an issue, Musk walked around asking everyone the same question: &quot;What can we do to go faster?&quot; This relentless push for speed and improvement has driven SpaceX to achieve what competitors deemed impossible.&lt;&#x2F;p&gt;
&lt;p&gt;And because Musk is abrasive, he couldn&#x27;t have done what he has without having people like Gwynne Shotwell&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-notNormal-1&quot;&gt;&lt;a href=&quot;#fn-notNormal&quot;&gt;3&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; around to smooth things with NASA and other customers, and insulating as much as possible the employees from Musk.&lt;&#x2F;p&gt;
&lt;p&gt;Musk, after backing Trump, now holds the reins to not just NASA&#x27;s budget, but the government of the USA, and is likely one of the most polarizing figures in the world. That puts SpaceX in a tough spot when the government changes. And it will change. That&#x27;s a pity. If he had quit before buying Twitter, his legacy as one of the greats would have remained intact. Now that legacy risks being eclipsed by his reputation for spreading misinformation on Twitter. He&#x27;s attempting to apply his war-mode approach to the complex challenge of reforming government infrastructure. But a democratic government isn&#x27;t a startup. It&#x27;s a 200-year-old institution designed for stability, not speed. Reforms require broad consensus, not executive mandates. The skills that made SpaceX possible - ruthless prioritization, tolerance for creative destruction, and willingness to break norms - can become liabilities when applied to public infrastructure and services.&lt;&#x2F;p&gt;
&lt;br&#x2F;&gt;
&lt;p style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;FOOTNOTES&lt;&#x2F;b&gt; &lt;&#x2F;p&gt;
&lt;footer class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-nasaPref&quot;&gt;
&lt;p&gt;NASA preferred Boeing’s approach. They came close to awarding only Boeing the contract for the commercial crew program, even though Boeing cost 60 percent more than SpaceX when both bids were technically acceptable. They had a written justification and a public announcement in the works. It was hastily rewritten at the last minute to include SpaceX because they were afraid Elon Musk would sue them. &lt;a href=&quot;#fr-nasaPref-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-zuckResponse&quot;&gt;
&lt;p&gt;This is the 2016 AMOS-6 incident. SpaceX was testing a new approach to rocket fueling - using super-chilled propellants to improve performance - during a routine pre-launch test with a customer&#x27;s satellite aboard. The rocket exploded, destroying the $200 million Israeli-built satellite meant to provide internet services to Africa. Traditional launch providers would never risk a customer&#x27;s payload to test new technology. They would conduct such tests separately, at great expense and time. But Musk&#x27;s focus on advancing rocket technology for Mars missions drove him to take calculated risks that others wouldn&#x27;t dare. Facebook was going to use that satellite. After the explosion, Zukerberg wrote “As I’m here in Africa, I’m deeply disappointed to hear that SpaceX’s launch failure destroyed our satellite that would have provided connectivity to so many entrepreneurs and everyone else across the continent&quot;. Shotwell&#x27;s response was &quot;What an asshole.&quot; &lt;a href=&quot;#fr-zuckResponse-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-notNormal&quot;&gt;
&lt;p&gt;Shotwell is longest tenured employee at SpaceX, after Musk himself. Given the wake of burn out at Musk&#x27;s companies, she is clearly anything but normal. &lt;a href=&quot;#fr-notNormal-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;footer&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>The Snake and the Mongoose</title>
        <published>2025-01-25T00:00:00+00:00</published>
        <updated>2025-01-25T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/snake-mongoose-mcgovern/"/>
        <id>https://asun9.com/snake-mongoose-mcgovern/</id>
        
        <content type="html" xml:base="https://asun9.com/snake-mongoose-mcgovern/">&lt;p&gt;Book: &lt;strong&gt;The Snake and the Mongoose: The Emergence of Identity in Early Indian Religion&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Nathan McGovern&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Na jaṭāhi na gottena, na jaccā hoti brāhmaṇo, &lt;br&#x2F;&gt;
Not because of matted hair, family or birth is one a true brahmin,&lt;&#x2F;p&gt;
&lt;p&gt;yamhi saccañ-ca Dhammo ca, so sucī so va brāhmaṇo. [393] &lt;br&#x2F;&gt;
in whom there is truth and Dhamma, that one is pure, that one is surely a brahmin.&lt;&#x2F;p&gt;
&lt;p&gt;— &lt;cite&gt;The Dhammapada&lt;&#x2F;cite&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;The primary sources in reconstructing identity in early Indian religions are the Vedas, Ashoka’s edicts (a little over 4,000 words), the Pali canon, the three early Jain Agamas, Panini’s Ashtadhyayi, and Patanjali’s commentary, Mahabhasya, the Dharmasastras, and the Arthasastra. Then there’s the lost Megastenes’ Indica, parts of which have been reproduced in later Greek and Latin works.&lt;&#x2F;p&gt;
&lt;p&gt;The earliest date in Indian history one can be sure of is 326 BC, the year of Alexander’s invasion. All the other events are a guesstimate, anchored around that year. The earliest Vedas are probably 3,500 years old. The first Dharmasastra, Apastamba, is dated to between 450 BCE and 350 BCE. Buddha’s date ranges from around 500 BCE to 400 BCE. Since the Ashokan edicts mention rulers whose dates are more certain, such as &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.britannica.com&#x2F;biography&#x2F;Ptolemy-II-Philadelphus&quot;&gt;Ptolemy II Philadelphus&lt;&#x2F;a&gt; and &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.hellenicaworld.com&#x2F;Greece&#x2F;Person&#x2F;en&#x2F;MagasOfCyrene.html&quot;&gt;Magas of Cyrene&lt;&#x2F;a&gt;, Ashoka is dated to the early 3rd century BCE.&lt;&#x2F;p&gt;
&lt;p&gt;Buddhism had been positioned as rising in opposition to an existing Hindu and Brahmin orthodoxy during colonial re-discovery of Buddhist heritage in India. Over time, it became clear that there are many Buddhisms in Asia. Almost none of the theologies of these varied Buddhisms were ever articulated against Brahmin or Vedic religion. In Thailand, for example, Brahmin priests and Ganeshas nestle comfortably with official endorsement of Buddha’s precepts. &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;bronkhorst-buddhism&#x2F;&quot;&gt;Johannes Bronkhorst&lt;&#x2F;a&gt;, in his trilogy on the origins of Buddhism, made the case that Buddhism was not a rebellion against late-Vedic religion. It arose in the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Greater_Magadha&quot;&gt;Greater Magadha region&lt;&#x2F;a&gt; where there were Jainas, Ajivikas, and others. Both Buddhism and what he called Brahmanism contested for political power, and the Brahmins prevailed in the long run.&lt;&#x2F;p&gt;
&lt;p&gt;Nathan McGovern takes this thesis further in this book and says even the category of Brahmin was not exclusively a Vedic phenomenon by this time. The earliest Buddhist and Jain texts appropriate the Brahmin identity for Mahavira and the Buddha. The word Brahmin is of Vedic origin, appearing frequently in the Rig Veda, but it was never conceived as determined by birth. The four varnas don’t appear that frequently together in the Vedas. The Purusha Sukta, where they appear together for the first time, doesn’t even use the word varna. In the earliest Buddhist and Jain texts, and some Upanishads, a Brahmin is always determined by behavior and by a devotion to a life of contemplation in the forests. Nathan McGovern ties the notion of this shared understanding of the category of the Brahmin to a common commitment to Brahmacharya.&lt;&#x2F;p&gt;
&lt;p&gt;His contention is that Buddhism was positioned as a rebellion against Brahmins by the Europeans in the 19th century because they took as a model the Protestant reformations in Europe in the preceding centuries. This supposed opposition of the Buddhist to the Brahmin has been read into Indian texts of antiquity since then. This animus has been located in Sanskrit grammarian Panini in his Asthadyayi and the commentary on Asthadyayi by Patanjali, Mahabhasya. In academic scholarship, it is a convention that the sramana and brahmana are oppositional categories, just as a snake and the mongoose are. The origin of the Indian religions in academia lies in this Patanjali-derived image. Nathan McGovern right at the onset shows how erroneous this assumption has been.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;But at no point in this work does he compare the relationship between the śramaṇa and the Brahman to that between the snake and the mongoose, nor does he ever mention the compound “snake and mongoose” (ahi-nakula) in conjunction with the compound “śramaṇa and Brahman” (śramaṇa-brāhmaṇa).&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Apparently, the two commentaries on Pāṇini’s rule 2.4.9 were conflated at some point by a modern scholar (although it is not entirely clear when or how this happened), and the conflation was then propagated in scholarship from there.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Everywhere the compound sramana-brahamna is found, as in the Ashokan edicts, they should be read as not as distinct oppositional groups, but instead having a relationship such as that of religion and clergy.&lt;&#x2F;p&gt;
&lt;p&gt;McGovern disputes the Bronkhorst position that Buddha articulated his innovations without any Vedic influence in Greater Magadha. &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Michael_Witzel&quot;&gt;Witzel&lt;&#x2F;a&gt;, for example, locates the geography of the earlier Vedas in Punjab, moving eastwards, and the latest ones in the Indo-Gangetic plains. McGovern’s thesis is that there were many groups of teachers and disciplines in the Indo-Gangetic plains that had much in common with each other, such as notions of karma, rebirth, and moksha&#x2F;nirvana. One of these shared beliefs is that in Brahmacharya. All of them lay claim to the category of the Brahmin. Some time around or after the time of the Buddha, in Apastamba Dharmasutra, a case is first made against Brahmacharya being the highest ideal. While identifying Brahmins as those who could partake in asceticism, Apastamba privileges those with households, i.e. wife and children. &lt;strong&gt;Hence, rather than a Vedic versus non-Vedic fault line, or the Sramana against the Brahmana, the primary disagreement in the second half of the 1st millennium BCE is between householder Brahmins and the ascetic Brahmins. The Buddhists, Jain, Vedic forest-dwelling Brahmins, the householder Brahmins, and others all participated in the development of Brahmanical thought in India, and these traditions brought each other into existence.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The householder Brahmins - as articulated in the Dharmasastras - were successful in appropriating the category of Brahmin to themselves and in arguing for a birth-based varna. These “neo-Brahmins” did this, according to McGovern, by producing texts which positioned a Brahmin-hood that has always been an essential characteristic derived from birth. The ashrama system was designed to accommodate celibate impulses. While Buddha was seen to debate householder Brahmins in the Pali canon, in the Dharmasastras non-Vedic streams of thought are not even acknowledged. Gradually, the Buddhists lost the battle for the Brahmin status due to their failure in providing an alternative praxis that could be used to articulate their vision.&lt;&#x2F;p&gt;
&lt;p&gt;McGovern&#x27;s arguments for his position are persuasive. His primary materials include works in Greek, Prakrit, Pali, and Sanskrit. He paints a picture of a landscape where the dominant tendency is towards syncretism. I buy that. Indian religions, if anything, are inclusivist, finding ways to accommodate diverse streams of thought. What else after all can explain the presence of the Buddha in Vishnu Puranas by the 10th century? Or a Sai Baba in 20th-century mainstream Hinduism? Or a Lakshmi in Jainism and Buddhism across the ages? Or the assimilation of Vishnu into Buddhism?&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>The Bhagavad Gita: A Biography</title>
        <published>2025-01-21T00:00:00+00:00</published>
        <updated>2025-01-21T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/gita-bio-davis/"/>
        <id>https://asun9.com/gita-bio-davis/</id>
        
        <content type="html" xml:base="https://asun9.com/gita-bio-davis/">&lt;p&gt;Book: &lt;strong&gt;The Bhagavad Gita: A Biography&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Richard H. Davis&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The Mahabharata is the preeminent epic of India, and one grows up with the stories of the Pandavas and Kauravas, and the adventures of Arjuna and Bhima. While dating the Mahabharata is close to impossible, the oldest layers are thought to capture memories of the Vedic people from the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Vedic_period&quot;&gt;Kuru-Panchala period&lt;&#x2F;a&gt;. The Gita appears first in this epic just before the cousins engage in an all-out war of extermination. Over the course of 18 chapters, Krishna synthesizes diverse religious paths, reveals himself to be an avatar of God, shakes Arjuna from his psychological stupor, and - my favorite bit - ends by saying now that Krishna has said what has to be said, Arjuna is free to do as he pleases.&lt;&#x2F;p&gt;
&lt;p&gt;Richard Davis’s book traces the publication and reception history of the Gita as a stand-alone text outside of the Mahabharata. The medieval period is represented by the commentaries of Shankara, Ramanuja, and the Marathi translation by Jnanadeva. Since there is a wealth of material about the Gita translations in European languages from the late eighteenth century, it&#x27;s no surprise that this is where the book comes into its own, at least with respect to how the Gita was received. A volume dedicated to both reception and contested interpretations from the medieval era is still warranted, though. I know Edwin Bryant has been working on it for a while, and it really can&#x27;t come sooner.&lt;&#x2F;p&gt;
&lt;p&gt;Indian texts have a long history of being accompanied by detailed commentaries, century upon century of exegesis. My occasional forays into the Gita without such guides have left me feeling lost. Richard Davis&#x27;s book just brings home the point that if you want to make this text a part of your life, at a minimum, you need commentarial assistance. That’s my takeaway, not his. Davis’ recommendations for starting with the Gita include a free verse translation by Stephen Mitchell and S. Radhakrishnan’s translation and commentary.&lt;&#x2F;p&gt;
&lt;p&gt;Ambedkar has denounced the Gita’s values in favor of Buddha’s dhamma, Gandhi has used it for spiritual succor and religious endorsement of satyagraha, E. Sreedharan has distributed it among his staff as a management gospel. Aldous Huxley considered it as the most systemic statement of a &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Perennial_philosophy&quot;&gt;perennial philosophy&lt;&#x2F;a&gt;. People in the end see what they want to see in it, and I prefer the charitable - and hence traditional - reading of this work, as an eminently practical and useful book.&lt;&#x2F;p&gt;
&lt;p&gt;Pairs well with &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;fruits-desiring&#x2F;&quot;&gt;Fruits of Our Desiring&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>State of Reading 2024</title>
        <published>2024-12-30T00:00:00+00:00</published>
        <updated>2024-12-30T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/reading-highlights-2024/"/>
        <id>https://asun9.com/reading-highlights-2024/</id>
        
        <content type="html" xml:base="https://asun9.com/reading-highlights-2024/">&lt;p&gt;I finished &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.goodreads.com&#x2F;user&#x2F;year_in_books&#x2F;2024&#x2F;3523286&quot;&gt;33 books&lt;&#x2F;a&gt; this year, 4 of them rereads. I notice that I ended 4 out of the last 5 years with &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.amazon.com&#x2F;Reflections-Silver-River-Ken-McLeod&#x2F;dp&#x2F;0989515311&quot;&gt;Reflections on Silver River&lt;&#x2F;a&gt;. It was not intentional. Something about the end of the year and the beginning of a new one calls me to that book. Is it the promise of being a better person or the reminder of what is important (hint: the practice, always the practice)? Beats me. My other re-reads were Narada Bhakti Sutra and Awake at the Wheel. All are religion or religion-adjacent books. I almost never re-read any other kind. I know I remember much less of these books anyway, and I want to internalize what they are saying. It has not happened yet. Something about them is slippery, and I can never recall the main points when I need to.&lt;&#x2F;p&gt;
&lt;p&gt;Seven biographies. More than usual, though none I would regret spending time with. The one I enjoyed the most was &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;enzo-ferrai-yates&#x2F;&quot;&gt;Brock Yates’s Ferrari&lt;&#x2F;a&gt;. It’s a crash course on the history of racing and the Italian middle class experience of the 20th century. Enzo Ferrari won by just out-surviving his competition, an essential trick that all successful start-ups must master. Just don’t die. I also liked &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;bob-gottlieb-memoir&#x2F;&quot;&gt;Robert Gottlieb’s book&lt;&#x2F;a&gt;. Gottlieb represented the who’s who of the twentieth-century popular literature, from Rushdie to John le Carré, so there’s a lot of juicy gossip about the book publishing world. My takeaway is that if you enjoy what you are doing - and there’s a lot of luck involved in stumbling into a career you are meant for - nothing ever seems like hard work. Gottlieb and Ferrari worked right till they died. There’s no such thing as a retirement when you are having fun, and before you know it, you have had a career. I also learnt from Gottlieb that it’s important to be a problem solver or be seen as one. That opened doors for him, including to the New York City Ballet and becoming a fixer for Irene Selznick’s family.&lt;&#x2F;p&gt;
&lt;p&gt;I finally read &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;The_Sun_Also_Rises&quot;&gt;The Sun Also Rises&lt;&#x2F;a&gt;. The last Hemingway I read was around 17 years ago, For Whom the Bell Tolls, back in college. This is the sort of book I would have enjoyed back then, or even early into my career. A bunch of drunks in love with the original manic pixie girl. At this point in time, it just seems sad to me, although I am sure it would have ruined my life if I had discovered it earlier. The only other fiction I read worth mentioning would be Elmore Leonard. I have to admit that he’s a master. Rum Punch was a damn good caper.&lt;&#x2F;p&gt;
&lt;p&gt;As far as insights per page is concerned, the most rewarding book this year has been &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;opium-amitav-ghosh&#x2F;&quot;&gt;Smoke and Ashes&lt;&#x2F;a&gt;. Want to know about why the Marwaris moved to Calcutta? The diverging fates of Calcutta and Bombay? The palaces and forts that the Marathas left behind in central India and how they were funded? The Opium Wars? The persistence of elites in America and the opioid crisis? Ghosh loops through all that and more. I try to capture some of it &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;opium-amitav-ghosh&#x2F;&quot;&gt;here in my notes on the book&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;I read a few technical books at the beginning of the year. I want to read a lot more, and the only reason I don’t is because technical ebooks are damn expensive, and the cutting-edge stuff is on arXiv or blogs.&lt;&#x2F;p&gt;
&lt;p&gt;Is there any book I wish I hadn’t read? No, because I abandon books I don’t wish to read. I did not complete a few, although it looks like I will revisit the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.amazon.com&#x2F;Be-Like-Fox-Machiavelli-World&#x2F;dp&#x2F;0393609723&quot;&gt;Machiavelli&lt;&#x2F;a&gt; book again. It was not bad, it just wasn’t the right time.&lt;&#x2F;p&gt;
&lt;p&gt;There are many books I wish I had read this year. I want to read a lot more history. I want to read a lot more technical books. I want to work through Aurobindo and Vedanta Desika. There are Chip Hyuen&#x27;s books. Matthew Crawford. Nilakanta Sastri. &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;history.ucla.edu&#x2F;person&#x2F;sanjay-subrahmanyam&#x2F;&quot;&gt;Sanjay Subramanyam&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;I cannot tell if reading makes me happy. It is just that I cannot imagine another state of being. I am unable to recall now a moment in my early childhood when I did not read. Today with Kindle and iBooks, it’s even easier to be always in the middle of a book, never in between them.&lt;&#x2F;p&gt;
&lt;p&gt;I have regretted wasting time on video games. It causes me enormous grief to think about all the time I spend on Twitter and Reddit. I do not have the same amount of heartburn when I take stock of my reading habit, even when I read trash. Once I hoped all this reading would be of use someday. I would be lying if I said I don’t anymore, but I have also come to accept that I would continue to read even if it had no utility at all.&lt;&#x2F;p&gt;
&lt;p&gt;It just is. Like breathing.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>A Strange Year</title>
        <published>2024-12-26T00:00:00+00:00</published>
        <updated>2024-12-26T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes-on-cancer/"/>
        <id>https://asun9.com/notes-on-cancer/</id>
        
        <content type="html" xml:base="https://asun9.com/notes-on-cancer/">&lt;p&gt;When you are diagnosed with Stage 4 Non-Hodgkin’s lymphoma, the standard operating procedure is R-CHOP. It&#x27;s a regimen where the body is subjected to three chemotherapy drugs, a targeted therapy drug, and a steroid. The treatment lasts 18 weeks, in three-week cycles. The steroid is given orally, and the other drugs via IV. Between sessions, the body is given time to heal while R-CHOP kills cancer cells. This is not pleasant for the patient. The treatment is accompanied by hair loss, numbness in hands and feet, nausea, and fatigue. My dad, during this process, worked out every day and never complained. It was just another problem to be solved, and he went about researching treatments and designing an exercise schedule. By the end of it, one couldn&#x27;t tell he had cancer. He is quite simply the strongest-willed person I know. R-CHOP has a very high chance of success. For someone with large B-cell lymphoma, the chance of complete remission is 80%. My dad was not in that 80%.&lt;&#x2F;p&gt;
&lt;p&gt;In the past decade, a new wave of treatments has emerged to treat blood cancers, including lymphomas and some forms of leukemia. This is the CAR T-Cell therapy. The patient&#x27;s T cells are changed in the laboratory so that they will attack cancer cells.  Large numbers of the CAR T cells are grown in the laboratory and given to the patient by infusion. In the patient&#x27;s body, the CAR T cells will continue to multiply and, with guidance from their engineered receptor, recognize and kill any cancer cells that harbor the target antigen on their surfaces.&lt;&#x2F;p&gt;
&lt;p&gt;CAR T cells cause severe side effects, not unlike other cancer treatments. While they lead to remission in around 50% of the patients, they have been shown to eradicate advanced lymphomas. In India, only three hospitals offered this treatment in 2024: Amrita in Kochi, Tata Memorial in Mumbai, and Adayar Cancer Institute in Chennai. Only IIT Bombay had the equipment to modify patient T cells. My father got admitted to Adayar Cancer Institute, which happens to be one of the best places in the country for any form of cancer treatment. Only around 300 or so patients in the country received CAR T cell therapy. My father was one of them.&lt;&#x2F;p&gt;
&lt;p&gt;The cancer survived the T cells. Initial biopsy revealed that the cancer was gone from inside the stomach, but was still present outside. It had reduced, but was still active. We want cancerous activity to be less than 3%. 0% would have been perfect. It was at 7.5%. After R-CHOP, the metabolic activity was at 11%. Before the start of CAR T-Cell therapy, the metabolic activity was at 33%. Between the end of R-CHOP and the start of CAR T-cell, the metabolic activity in the region had more than doubled. A PET scan taken a month after the end of CAR T-Cell therapy showed that the metabolic activity was now at 15%. The cancer was still growing aggressively.&lt;&#x2F;p&gt;
&lt;p&gt;The doctor recommended radiation and palliative care. In other words, there was nothing else to do, except to manage the pain and wait for the inevitable.&lt;&#x2F;p&gt;
&lt;p&gt;It&#x27;s not appa&#x27;s nature to just accept an answer like that. After a few more consultations with other doctors, he decided to go with yet another treatment, R-ICE. The R stands for the same drug that&#x27;s in R-CHOP, rituximab. It&#x27;s generally followed by a stem cell transplant. This involves collecting the patient&#x27;s own stem cells, administering high-dose chemotherapy to eliminate as much lymphoma as possible, and then reinfusing the stem cells to restore the bone marrow. Similar to R-CHOP, there&#x27;s a treatment cycle. Each cycle lasts 21 days and between 3 to 6 sessions. The chance of &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;ascopubs.org&#x2F;doi&#x2F;10.1200&#x2F;jco.2009.27.15_suppl.8509#:~:text=The%20overall%20response%20rate%20was,in%20mobilization%20adjusted%20response%20rate.&quot;&gt;complete remission seems to be 38%&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;It’s been 10 months now, with the first chemotherapy drugs entering his body in February 2024. My poor, long-suffering mother has been at his side throughout. Her social life has been severely curtailed, along with sleep. There’s no end in sight yet. During this time, my father&#x27;s sister got diagnosed with breast cancer. Also stage 4. My mother&#x27;s sister went through additional procedures caused by her own cancer treatment the year before, something that left her confined to her house. My project, something that I have been working on for a large part of my career, shut down. My wife went through her own career upheaval.&lt;&#x2F;p&gt;
&lt;p&gt;I don&#x27;t particularly feel beaten. Could this attitude be an inheritance from my father? When I visit the cancer ward in the hospital, I see children going through chemo, and I see the old and destitute. Thanks to our insurance, much of our treatment is taken care of, something that can&#x27;t be said for many people I encounter. I still have a job, and the wife has a legal presence in the country. We have our creative outlets, and a circle of friends who help lighten our load. Despite it all, my overwhelming sense is that things can always be worse.&lt;&#x2F;p&gt;
&lt;p&gt;What this year has brought into sharp focus is the fragility of life, of the things that we take for granted. The elders won’t be here forever. Every conversation is potentially the last conversation. Make time for them. Show that you care. The best way to do that is by being present and giving them your attention. Before one knows it, all that is left is regrets for things said and unsaid. The only balm is the knowledge that you did your best at the end and made the other person feel wanted.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Book Notes: Arnold Schwarzenegger&#x27;s Be Useful</title>
        <published>2024-12-24T00:00:00+00:00</published>
        <updated>2024-12-24T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/be-useful-arnie/"/>
        <id>https://asun9.com/notes/be-useful-arnie/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/be-useful-arnie/">&lt;p&gt;Book: &lt;strong&gt;Be Useful&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Arnold Schwarzenegger&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;&#x2F;h2&gt;
&lt;p&gt;Schwarzenegger, along with Rajini and Kamal, was part of the movie star triumvirate that defined my childhood. Terminator 2 and True Lies would play often on Star Movies. Hollywood movies, for a short while, were essentially Arnie movies. Given all that, I couldn’t help but read this book in his voice. Have a vision, as clear as it can get, of what you want, and work your ass off to make it happen. You know, the usual self-help schtick. I prefer hearing these things from an old man though. With a career like Arnie’s, it can be anything but boring.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;notes&quot;&gt;Notes&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;vision-and-purpose&quot;&gt;Vision and purpose&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Vision is the most important thing. Vision is purpose and meaning. To have a clear vision is to have a picture of what you want your life to look like and a plan for how to get there. The people who feel most lost have neither of those. They don’t have the picture or the plan. They look in the mirror and they wonder, “How the hell did I get here?” but they don’t know.
&lt;ul&gt;
&lt;li&gt;It’s obviously not that easy, but it is that simple, and it can begin by looking back in time and thinking very broadly about the things you used to love. Your obsessions are a clue to your earliest vision for yourself, if only you had paid attention to them in the beginning.&lt;&#x2F;li&gt;
&lt;li&gt;First, create little goals for yourself. Don’t worry about the big, broad stuff for now. Focus on making improvements and banking achievements one day at a time. They can be exercise goals, nutrition goals. They can be about networking or reading or getting your house organized.&lt;&#x2F;li&gt;
&lt;li&gt;When I fell in love with bodybuilding, I didn’t have vague hopes of becoming a champion. I had a very specific vision of it, borrowed from the pictures inside muscle magazines of guys like Reg Park celebrating their victories. I could see myself on the top step of the podium holding the winner’s trophy. I could see the other competitors on the lower steps looking up at me enviously, but also in awe. I could see their tight smiles, I could even see the colors of their posing briefs. I could see the judges standing and applauding. I could see the crowd going wild and chanting my name. “Arnold! Arnold! Arnold!” This wasn’t a fantasy. This was a memory that just hadn’t happened yet. That’s what it felt like to me.&lt;&#x2F;li&gt;
&lt;li&gt;As an actor, before I ever got my first starring role, I could see my name above the title on movie posters and theater marquees, just like I’d seen Clint Eastwood, John Wayne, Sean Connery, and Charles Bronson with their names above the titles of their movies, which I loved.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;What I am saying is that if you want your vision to stick, if you want to increase the chances of success looking exactly like you hoped it would when you first figured out what you wanted your life to look like, then you need to get crystal clear on that vision and tattoo it to the inside of your eyelids. You need to SEE IT.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Elite athletes understand this. They are masters of visualizing their goals. In fact, visualization has been the difference between the good and the greatest performers at the highest level of nearly every major international sport. The Olympic swimmer Michael Phelps was famous, all the way back as a teenager, for visualizing his split times down to the tenth of a second during training and nailing them lap after lap.&lt;&#x2F;li&gt;
&lt;li&gt;You need to be able to see what you want to achieve before you do it, not as you do it. That’s the difference.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Knowing what is and isn’t success brings crystal clarity to your vision. And with that clarity, I have found, comes a sense of calm, because almost every question becomes easier to answer.&lt;&#x2F;li&gt;
&lt;li&gt;If you can’t fully see your vision—if you can’t picture what success is and what it isn’t—it becomes very hard to assess opportunities and challenges like this. It becomes next to impossible to know for certain if they’ll get you what you want or something close, and if “close” is good enough for you.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;work-your-ass-off&quot;&gt;Work your ass off&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;The one thing all these brilliant people have in common is that in the face of doubt and skepticism, they kept going.&lt;&#x2F;li&gt;
&lt;li&gt;This is what can happen when you think big with your goals. When you go all in. When you ignore the naysayers. When you stick to your guns. Good things can happen for you and all the people you care about at a level that others never thought possible.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Nothing good has ever come from having a plan B. Nothing important or life-changing, anyway. Plan B is dangerous to every big dream. It is a plan for failure. If plan A is the road less traveled, if it’s you carving your own path toward the vision you’ve created for your life, then plan B is the path of least resistance.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Watching someone with a crazy goal give it everything they’ve got and then succeed is so powerful. It’s like magic, because it unlocks potential we didn’t even know we had. It shows us what is possible if we put our mind to something and then back that up with effort.&lt;&#x2F;li&gt;
&lt;li&gt;If there is one unavoidable truth in this world, it’s that there is no substitute for putting in the work. There is no shortcut or growth hack or magic pill that can get you around the hard work of doing your job well, of winning something you care about, or of making your dreams come true.
&lt;ul&gt;
&lt;li&gt;Work works. That’s the bottom line. No matter what you do. No matter who you are. My entire life has been shaped by that single idea.&lt;&#x2F;li&gt;
&lt;li&gt;When I got to America, I took my workouts up a level and invented the double split, where I trained two and a half hours in the morning and two and a half hours in the evening, just so I could get two full workouts in each day. I needed two sets of workout partners to pull this off—Franco in the morning, Ed Corney or Dave Draper in the evening—because no one wanted to train that hard. They weren’t crazy like me.&lt;&#x2F;li&gt;
&lt;li&gt;During my campaign in 2003, I devoured briefing books on every issue that was important in the state of California. Each one was filled with detailed memos written by top experts about obscure topics I never imagined I would need to think about, let alone care about or potentially make decisions about. Things like microstamping on gun ammunition and nurse-to-patient staffing ratios in county hospitals. After my morning workouts down the hill in Venice, I opened the doors of my home to anyone who was willing to teach me about governing, about policy, about the things that mattered to Californians.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;The purpose of all this hard work—all the reps, all the pain, all the follow-through, all the long hours—was the same in every phase of my career.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;The purpose is to be prepared. It’s to be ready to perform when the spotlight turns on, when opportunity knocks, when the cameras roll, when a crisis arrives. There is value and meaning in doing hard work for its own sake, don’t get me wrong, but the real reason is so that when the moment arrives for your dream to come true and for your vision to become real . . . you don’t flinch and you don’t falter.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;From my earliest bodybuilding days, putting in the work has always meant repetitions. Not just doing reps, but tracking them. At the local weight-lifting club in Graz, I’d write my entire workout on the chalkboard, down to the number of sets and number of reps, and I wouldn’t let myself leave until I’d marked them all off.&lt;&#x2F;li&gt;
&lt;li&gt;Coltrane practiced constantly. Another saxophonist from his era said Coltrane practiced “25 hours a day.” He would regularly play through the entire 256-page Thesaurus of Scales and Melodic Patterns, which is the musical equivalent of watching someone like Bruce Lee do “wax on, wax off” and “paint the fence” for eighteen hours. There are stories of Coltrane practicing a single note for ten hours straight to get the tone and the volume exactly perfect.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Pain isn’t just an indicator of sacrifice, though, it’s also a measure of growth potential. In the gym, if an exercise doesn’t start to hurt, then I know I haven’t done enough to unleash the growth potential of the muscle I’m targeting. Reps build strength, but pain builds size.&lt;&#x2F;li&gt;
&lt;li&gt;Get out of your comfort zone. Embrace the suck. Lean into the pain. Do something every day that scares you. These are just different ways of trying to tell you that if you want to grow, or you want to be great, it’s not going to be easy. It’s going to hurt a little bit. Or a lot.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Follow up and follow through, fully&lt;&#x2F;strong&gt;. Do just those two things, which I know you can do if your vision means enough to you, and it will set you apart from the pack.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;there-are-no-excuses&quot;&gt;There are no excuses&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;The questions you need to ask yourself are: How much of that time am I wasting? How much of it do I spend thinking about how I’m going to get started . . . instead of starting? How much of it do I flush down the toilet of social media? How much of it do I spend watching television, playing video games, drinking, and partying?&lt;&#x2F;li&gt;
&lt;li&gt;Do you know how many times people tell me they don’t have time to work out, and then I ask them to take out their phones and show me their screen time stats and it says they spent three and a half hours on social media? It’s not hours in the day you lack, it’s a vision for your life that makes time irrelevant.&lt;&#x2F;li&gt;
&lt;li&gt;Do you have any idea how powerful an hour a day is? If you want to write a novel, sit down and write for an hour every day, and aim for just one page. At the end of the year, you will have a 365-page manuscript. That’s a book! If you want to get in shape, burn five hundred more calories each day than you consume. In one week, that’s a pound you will have lost.&lt;&#x2F;li&gt;
&lt;li&gt;Turn your TV off. Throw your machines out the window. Save your excuses for someone who cares. Get to work.&lt;&#x2F;li&gt;
&lt;li&gt;The beauty of weight lifting is that failure is baked into the practice. The whole goal in weight lifting is to work your muscles to failure, which we sometimes forget. When you can’t squeeze out that last rep or lock out those elbows before dropping the weight, it’s not uncommon to feel a flash of frustration, but then you have to remember that your failure on that particular lift doesn’t mean you’ve lost somehow. It actually means that your workout was a good one, that your muscles were fully fatigued. It means you did the work.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;reach-out&quot;&gt;Reach out&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;My friends like to call me Forrest Gump because I’ve met every American president since Lyndon Johnson. Unlike Forrest, I didn’t find myself in the same room as these great historical figures by accident; I met them because I was famous. But I got to know them and develop relationships with them because I was curious. I asked them questions about themselves and their experiences. I asked for advice. And then I listened.
&lt;ul&gt;
&lt;li&gt;Important, interesting, powerful people are drawn to those who ask good questions and listen well. When you’re curious and you’re humble enough to admit that you don’t know everything, people like that want to talk to you.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Use it or lose it. These words apply to so many areas of life, they should be considered a law of the universe. In the gym, if you don’t use a muscle, it shrivels up and dies. Something called atrophy. In Hollywood, if you don’t use your fame to do big projects or make a big impact, your star will fade and your chance to do either will fade along with it.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Amp It Up</title>
        <published>2024-11-30T00:00:00+00:00</published>
        <updated>2024-11-30T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/amp-it-up/"/>
        <id>https://asun9.com/amp-it-up/</id>
        
        <content type="html" xml:base="https://asun9.com/amp-it-up/">&lt;p&gt;Book: &lt;strong&gt;Amp It Up&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Frank Slootman&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Data Domain had a product, but no revenue. Frank Slootman, who came in as CEO in 2003, eventually led to its acquisition by EMC for $2.4 billion. He then joined ServiceNow in 2011, a company bootstrapped with $7 million dollars 8 years prior, operating out of San Diego. Slootman led it’s through its hyper growth phase, where it became the only second company in history to exceed $1 billion in software-as-a-service revenues. Slootman also took it public with a $210 million IPO. He then joined Snowflake in 2019, another hyper-growth company that did well under his leadership, and under his watch, went on to become the largest software IPO of all time.&lt;&#x2F;p&gt;
&lt;p&gt;So it should be clear by now that Slootman gets something right. He’s an operator for hire and it looks like he knows something that others don’t. He is most definitely not Bill Gates, or Steve Jobs, or any of the other celebrated founder entrepreneurs. He never founded any of the companies he ran. And yet, he knew how to get them to succeed greatly. The only parallel I can think of is Andy Grove, another world class operator who did not start the company most associated with him. Amp It Up is Slootman’s book about what he did in his career that he thinks worked and what he thinks others should do. At 180 pages, one cannot accuse it of being longer than it needs to be. And it is useful, even if it is familiar. Every good management book, after all, is downstream of Andy Grove’s &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;only-paranoid-survive&#x2F;&quot;&gt;Only The Paranoid Survive&lt;&#x2F;a&gt; and &lt;a href=&quot;&#x2F;@2022-08-01-high-output-management.md&quot;&gt;High Output Management&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Like Grove, Slootman’s intensity jumps off every page. There are no wasted words and everything is to the point. Leadership matters. Raising the bar is energizing. A sense of urgency is energizing. You want to kill management by objectives because it causes employees to silo and impossible to pull off projects. Get alignment by ensuring incentivizing sales and product growth. Do fewer things, but make sure those things are the right things. Prioritize hard. &lt;strong&gt;Constantly ask: what is it that you are not going to do? What are the consequences of not doing something? Be constantly prioritizing and reprioritizing.&lt;&#x2F;strong&gt; Good leadership requires a never‐ending process of boiling things down to their essentials. Spell out what you mean! If priorities are not clearly understood at the top, how distorted will they be down the line?&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Go fast. Compress timelines.&lt;&#x2F;strong&gt; Again, urgency is energizing. High performers crave a culture of energy. Use every encounter, meeting, and opportunity to increase the pace of whatever is going on. &lt;strong&gt;Apply pressure. Be impatient.&lt;&#x2F;strong&gt; Culture is not a list of values. Culture is something that is enforced by rewards and punishment. You get the culture you incentivize and enforce. Fire the violators. Your competitors can gain access to capital, hire away your talent, and steal your ideas, but they almost certainly can&#x27;t replicate your culture. &lt;strong&gt;If you want to drive a more consistent set of behaviors, norms, and values, you have to focus on consistent and clearly defined consequences, day in and day out.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;When you join a new company, you want to gain trust. You get that by saying what you are going to do and doing it.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Hyperbolic projections will destroy any form of credibility and trust. So when you set expectations, make sure you have the resources and ability to adhere to them. Not just in terms of deliverables but also in how you treat people. For instance, if you say you have a zero‐tolerance policy on an issue, don&#x27;t make exceptions. If you say you have somebody&#x27;s back, then do. Words have consequences. People trust a straight shooter.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Invest in sales. You must sell your product, and keep your customers. In a static, low growth company, increasing sales productivity is viewed as a positive development. But in high‐growth scenarios it&#x27;s a negative metric because it means you aren&#x27;t hiring fast enough. Set your people up for success by providing them with a plan and if necessary, mentors, and watch them thrive.&lt;&#x2F;p&gt;
&lt;p&gt;You need to invest in larger strategy, but always couple it with execution. This means that the person strategizing is also the person executing. No consultants. Ask yourself and your team, what should you be doing urgently but not doing for some reason? Ask often so you don’t get too engrossed in day-to-day activities. With new products, aim for early adopters who are willing to take the risk. Another strategic call: attacking markets that have weak, unpopular incumbents is infinitely easier than chasing strong, popular occupants. Customers do not easily part with products that do the job for them. They have enough on their plate already. You need massive, not marginal differentiation, or they will simply filter you out as noise.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Running a company is somewhat like playing a hand in poker. You may or may not be dealt good cards, but what matters even more is understanding the potential of the cards you were dealt. They will dictate your strategic options—whether you should call, raise, or fold at every round of the hand.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Andy Grove said everyone was a CEO of their career. &lt;strong&gt;You should think of yourself as a product and aggressively manage your own growth&lt;&#x2F;strong&gt;. Frank Slootman, unsurprisingly, echos the same sentiment.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Build your record of accomplishments thoughtfully. Having a bunch of roles on your resume without clear success at each one can become a strike against you.&lt;&#x2F;strong&gt; You start to look like a passenger, not a driver. If you are light on experience for a role you want, redirect the conversation to aptitudes. Why would you be great in this position? Smart managers will usually pick someone with less experience but more aptitude.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Nothing puts rocket fuel in your career tank more than what other people say about you. Bosses, peers, and subordinates will all have strong opinions about what you&#x27;re like to work with. Smart managers know that for anyone well beyond entry level, exhaustive referencing builds a clearer portrait of a candidate than any number of interviews. Think of everyone around you—bosses, peers, and subordinates—as a potential future reference. What will they say about you?&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Slootman views business as war. You either survive or die. Kill or be killed. Either you already have a turf, and you have to defend it against all comers, or else you have to invade somebody else&#x27;s turf and take it. We are playing defense and offense at the same time.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;only-paranoid-survive&#x2F;&quot;&gt;The paranoid&lt;&#x2F;a&gt; do more than survive, they are richly rewarded.&lt;&#x2F;p&gt;
&lt;p&gt;Slootman&#x27;s assertion that leadership matters should be obvious to anyone who has tracked Intel&#x27;s fortunes since Andy Grove. In 2024, the company is battling for survival and could very well be &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.reuters.com&#x2F;technology&#x2F;qualcomm-has-explored-acquiring-pieces-intel-chip-design-business-sources-say-2024-09-06&#x2F;&quot;&gt;acquired by Qualcomm&lt;&#x2F;a&gt;. Culture degrades over time, even if it degrades slowly. The same will happen to ServiceNow and Snowflake without Slootman at helm. So how does one go about ensuring similar success? Reading books such as this is not enough. It is internalizing and embodying the attitudes of people like Slootman and Grove, which seems to be rare. One must make these ideas their own.&lt;&#x2F;p&gt;
&lt;p&gt;Being lucky and going in hard on opportunities that come your way is rarer still, and Slootman had the instincts to bet right when it presented itself.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;We all need to be careful what “elevator” we get into early in our careers. Some go up, some go down, some don&#x27;t move. It&#x27;s largely beyond our control, so choose wisely. We have seen staggering examples of this phenomenon in Silicon Valley. Anybody who spent the last 20 years at Google, Amazon, or Apple would have done spectacularly well, regardless of their individual merit. And anyone who stayed with companies like IBM and HP would have stagnated during that period.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Smoke and Ashes</title>
        <published>2024-10-08T00:00:00+00:00</published>
        <updated>2024-10-08T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/opium-amitav-ghosh/"/>
        <id>https://asun9.com/opium-amitav-ghosh/</id>
        
        <content type="html" xml:base="https://asun9.com/opium-amitav-ghosh/">&lt;p&gt;Book: &lt;strong&gt;Smoke and Ashes: Opium&#x27;s Hidden Histories&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Amitav Ghosh&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Here are some things I have always wondered about (although never long enough to actually go find an answer):&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;How did the East India Company (EIC) make its money? Cotton and indigo, really?&lt;&#x2F;li&gt;
&lt;li&gt;Why are Bihar and UP the way they are compared to rest of India?&lt;&#x2F;li&gt;
&lt;li&gt;Bombay, Calcutta and Madras are all colonial cities. Calcutta has been on a constant downhill the past 75 years, while the other two are thriving. Why?&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;I suppose one learns about these things in school. While I loved history, clearly I didn&#x27;t pay attention or maybe opium was never mentioned. Yes, opium. Turns out cultivation of poppy and its processing had a large role in funding the wars in the Indian subcontinent and China in the 19th century.&lt;&#x2F;p&gt;
&lt;p&gt;The East India Company&#x27;s first major settlement in the Indian subcontinent was at Madras, which grew around Fort St George, in 1639. In 1668, they obtained the islands of Bombay from the Portuguese as dowry soon after the marriage of King Charles II to Catherine of Braganza. The next was at Calcutta, where Fort William was established in 1696. The Company gradually made inroads into the country, ostensibly in service of trade. The Company defeated the Nawab of Bengal at the Battle of Plassey in 1757 and replaced that Nawab with another one. Then in 1773 it abolished local rule and directly became involved in governance, with Calcutta as its capital. At this point in time, the Company administered an area encompassing modern day Bangladesh, West Bengal, Orissa, Bihar, parts of Uttar Pradesh and Jharkhand. The Company was the de facto ruler of large parts of the lower Gangetic plain. Over the next century it would defeat the Marathas, the Sikh Empire, the Mysore kingdom and find itself governing most of the subcontinent, either directly or via its native allies.&lt;&#x2F;p&gt;
&lt;p&gt;The motivation for this aggressive expansion was, unsurprisingly, the fortunes to be made on trade in the Old World. The company&#x27;s revenues, and consequently the British Empire&#x27;s, took the shape of a pareto distribution. The lion&#x27;s share of the proceeds were due to two plants: tea and poppy.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-two-plants&quot;&gt;The Two Plants&lt;&#x2F;h2&gt;
&lt;p&gt;Through much of the eighteenth and nineteenth centuries, the tax on tea accounted for nearly a tenth of Britain&#x27;s revenues. It earned the British government as much as all land, property and income taxes put together: it could pay for the salaries of all government servants; for all public works and buildings; for all expenses related to law, justice, education, art and science; and for Her Majesty&#x27;s colonial, consular and foreign establishments—combined.&lt;&#x2F;p&gt;
&lt;p&gt;Britain got its tea from China via the Company. It took a while before they could pilfer tea seeds from China and grow tea themselves in India - China guarded its secrets and would not allow the foreign traders access to the mainland. The trade between China and the West took place within the confines of the Canton System, based in the southern Chinese city of Guangzhou. Since there was no demand for European goods in China, this tea had to be paid for in silver. There was a glut of silver in Europe thanks to the strip mining of that particular resource in the New World. In turn, there was huge outflow of bullion from Europe to China. By mid 18th century these supplies dwindled and the Company became desperate for another source to sustain its trade with China.&lt;&#x2F;p&gt;
&lt;p&gt;One solution was to  grow tea in India, but as we discussed, China didn&#x27;t make it easy to access tea seeds. Another was to increase exports from India to China. There was demand for two Indian products in China: cotton and opium.  The opium trade was small, but brisk. In time it would dwarf everything else.&lt;&#x2F;p&gt;
&lt;p&gt;Opium was long used as an analgesic in the places it was cultivated. It was different from other psychoactive substances like cannabis, psycolibin mushrooms or khat leaves in that it had to be processed significantly before it be ingested. Even as recently as the eighteenth and nineteenth centuries it would take almost an entire year for poppy sap to be converted into usable opium. This meant that it was never used society wide and remained for a long time an habit of the elites, were they to acquire a taste for it.&lt;&#x2F;p&gt;
&lt;p&gt;In the Indian subcontinent the cultivation of poppies probably began towards the end of the first millennium of the common era, introduced by the Arabs and the Persians. The oral consumption of opium in various forms was popular among Mongol rulers and in their courts, and the practice was then passed on to their successors, the Ottoman, Safavid, and Mughal empires. The Mughals were great enthusiasts of opium and passed the habit to their Rajput allies. These were indulgences of kings and emperors and almost never within the reach of ordinary people. Cannabis and betel nuts were by far the most common psychoactive substances in India and remained so, sometimes serving ritual functions.&lt;&#x2F;p&gt;
&lt;p&gt;All of this is to say, before the Company control of the Gangetic plain, there was no widespread acceptance or availability of opium in Indian society. By late nineteenth century however, India was exporting around 100,000 chests of opium and its use within the subcontinent had become common. Amitav Ghosh&#x27;s goal here, or at least one of them, is to describe the circumstances that led to this moment.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;bihar&quot;&gt;Bihar&lt;&#x2F;h2&gt;
&lt;p&gt;The template for using opium as a means of monopoly and control was established by the Dutch VOC in South East Asia in the seventeen century. They would offer opium to local rulers in exchange for exclusive access to their products while insisting, at the same time, that they be the sole supplier of the drug to their kingdoms. It alone had the right to ship opium from eastern India to its territories, where it was auctioned off by its officials to opium ‘farmers&#x27; or retailers, who then arranged for its sale to consumers.  The Dutch never attempted to cultivate poppy in their own colonial territories because of commercial as well as political considerations: they realized early on that if opium poppies were to be grown widely in the East Indies, not only would the price of the drug decline steeply, but the local rulers and chieftains would no longer depend on the Dutch for its supply.&lt;&#x2F;p&gt;
&lt;p&gt;The Dutch in East Indies were, in other words, a narco-state, whose survival was heavily dependent on drug revenues. This was the role taken up by EIC and later the British Crown in India, with some tweaks.&lt;&#x2F;p&gt;
&lt;p&gt;EIC grew its poppies in areas of modern day eastern Uttar Pradesh and Bihar, an area historically known as Purvanchal. Purvanchal had surplus labour that led to a thriving market in military labour, with soldiering and war-making being major industries employing as much as a quarter of the population. They supplied the armies of the EIC as well, and it was with Purbiyas that the EIC took control of the Gangetic Plains.&lt;&#x2F;p&gt;
&lt;p&gt;Under the Company rule, the farmers of this region were forced to cultivate poppy, which was then processed in two factories at an industrial scale: Patna and Ghazipur. Cultivating this land required the labour of more than a million peasant households. The Company had an Opium Department to oversee the quality and cultivation&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-orwell-1&quot;&gt;&lt;a href=&quot;#fn-orwell&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;By the late nineteen century there were over thirty times more Indian than British employees on the Department&#x27;s payrolls. The salaries of all the Indians together amounted to less than half that of the seventy-five white staff. One reason the British were paid more was to discourage corruption, not a bad idea and something that would turn out to work well in the future in Lee Kuan Yew&#x27;s Singapore. However the wages of Indians were so low that it inevitably invited fraud and corruption. Amitav Ghosh emphasizes that the present day poverty and illiteracy in Bihar and Jharkhand is really an historical anomaly, and the current circumstances as can be traced back to the moment the Company seized these areas and forced the cultivation of poppy at significant losses on the harvest to the farmers.&lt;&#x2F;p&gt;
&lt;p&gt;These were the regions that were the epicenters of the war in 1857. After 1857, the British Crown directly assumed control of EIC&#x27;s Indian territories, and the colonial regime rebalanced the ethnic composition of its army, drastically reducing its intake of soldiers from the Gangetic heartland: before, Purbiyas had constituted almost half the army; within a few decades their numbers were reduced to less than 11 per cent. Most of the sepoys after 1857 came from Punjab and the Maratha territories, which is also reflected in the composition of the Indian army to this day.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-triangular-trade&quot;&gt;The Triangular Trade&lt;&#x2F;h2&gt;
&lt;p&gt;So we have opium processed in India, exchanged for Chinese tea with bills on British banks. The Qing state in China banned the production and importation of opium by 1800. The opium trade that did happen after was because the Europeans flouted the Qing law, and smuggled opium into China. The volume of the sale was such that by 1820s, the balance of trade was reversed in Britain&#x27;s favour, and it was the Chinese who now had to pay with silver.&lt;&#x2F;p&gt;
&lt;p&gt;Opium trade facilitated the growth of Hong Kong, Singapore, Bombay and Calcutta. By 1765, when the East India Company was already in control of most of the Gangetic plain, its holdings on the west coast consisted of little more than the port of Bombay. Bombay was subsidized by the revenues from Madras and Calcutta. In the next 150 years Bombay would become the commercial capital of India and Amitav Ghosh puts that down to two factors: Maratha pushback against EIC and opium trade. Poppy was cultivated and opium processed in Maratha territories and EIC tried to ban the trade in opium by Indians on the western coast. They never succeeded and the Indian states found ways around the embargo exported the opium to China and East Indies. between 1800 and 1803 over 63,500 kilograms of opium had been exported to China by private traders, through the Company&#x27;s own port, Bombay. Since they couldn&#x27;t stop the trade, they decided to legalize it. Bombay was on the verge of being abandoned by the British in the late eighteenth century because it produced very little revenue for the East India Company. Malwa opium solved Bombay&#x27;s revenue problem: the transit tax charged by the British was a cash cow and led to native mercantile groups flocking to Bombay.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;‘By the end of the nineteenth century,&#x27; writes Richards, ‘some ninety states engaged in opium production. These ranged in size from the largest in territory and population such as Indore, Mewar, Bhopal, Jaipur, Marwar, Gwalior, Alwar, and Bikaner, to smaller states that dwindled to the size of Sitamau in Malwa with its few thousand inhabitants and one principal town.&#x27;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;In Bombay and Western India, business men of every community were involved in the trade: the Parsis, the Hindu Vanias and Bhatias, the Muslim Bohras, Khojas and Memons, Baghdadi Jews, Marwaris, Jains. This was in contrast to Calcutta, where the British retained a monopoly.&lt;&#x2F;p&gt;
&lt;p&gt;In just ten years, from 1831 to 1840, China received as much opium from India as it had in the whole of the century before. By 1837 opium accounted for 57 per cent of all of China&#x27;s imports. After the two Opium Wars, the British Empire&#x27;s opium exports kept growing until they peaked at 105,507 chests in 1880.  In the 1790s the British Empire&#x27;s annual earnings from opium were about 200,000 pounds sterling. This would rise to more than 10 million pounds sterling in the 1880s.&lt;&#x2F;p&gt;
&lt;p&gt;Opium was the third largest source of revenue for the British Empire after taxes on salt and taxes on land. It also needed the least bureaucratic apparatus, and hence was an easy money to finance wars. In 1837 a Qing official estimated that the equivalent of 20 million pounds sterling was pouring out of China annually.&lt;&#x2F;p&gt;
&lt;p&gt;With opium addiction seriously destabilizing the country, and the loss of bullion, the Qing state decided to crackdown further on opium. In 1839, it seized opium stockpiles in warehouses in Guangzhou  and the thirteen factories and destroyed them. This was the impetus for the first Opium war in 1840, which ended in the Qing state&#x27;s defeat and gave the British merchants access to Chinese ports and the Western states the ability to trade in any goods they liked. The Second Opium war resulted in another defeat in 1860, and China was forced to legalize opium.&lt;&#x2F;p&gt;
&lt;p&gt;Once opium became legal, China quickly became the single largest producer of opium in the world by early twentieth century, accounting for seven-eighths of global supply. Legalization only accelerated the spread of opioids through the country.&lt;&#x2F;p&gt;
&lt;p&gt;By this time, the early 20th century, these were enough critical voices in power in the West that in 1907 Britain signed an agreement with China, undertaking to phase out all opium exports from India, over a ten-year period, provided that China&#x27;s suppression of its domestic drug industry met similar annual targets. China exceeded expectations and in some provinces like Sichuan, officials succeeded in almost eliminating opium in just four years.&lt;&#x2F;p&gt;
&lt;p&gt;It is not a coincidence that colonization became increasingly untenable once easy money from the narco trade ended. Ghazipur is still one of the world&#x27;s largest producers of legal opium, manufactured for medicinal use.&lt;&#x2F;p&gt;
&lt;p&gt;Amitav Ghosh&#x27;s book scope is wider than what is in mentioned in this review - he talks about the stateless merchant communities like Parsis, Jews and Armenians, the plants and garden aesthetics from China that spread to Britain, the opioid crisis in America, the palaces of “Incredible India”. It is worth reading in full. The book emerged from his research for the Ibis trilogy (or was it the other way around?) and given how extensive and absorbing it turned out to be, it doesn&#x27;t seem like I will be disappointed with The Sea of Poppies when I get to it.&lt;&#x2F;p&gt;
&lt;br&#x2F;&gt;
&lt;p style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;FOOTNOTES&lt;&#x2F;b&gt; &lt;&#x2F;p&gt;
&lt;footer class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-orwell&quot;&gt;
&lt;p&gt;Richard Blair was an agent of Opium Department and his son Eric Blair was born in Bihar. Eric Blair was an essayist, journalist and novelist who wrote under the pen name of George Orwell. &lt;a href=&quot;#fr-orwell-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;footer&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Avid Reader: A Life</title>
        <published>2024-09-17T00:00:00+00:00</published>
        <updated>2024-09-17T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/bob-gottlieb-memoir/"/>
        <id>https://asun9.com/bob-gottlieb-memoir/</id>
        
        <content type="html" xml:base="https://asun9.com/bob-gottlieb-memoir/">&lt;p&gt;Book: &lt;strong&gt;Avid Reader: A Life&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Robert Gottlieb&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Robert Caro has published six books thus far, including his semi-memoir Working. His first was about Robert Moses and the reshaping of New York city. The next four were about Lyndon Johnson. These five books took him over five decades, averaging one book a decade. More than being just profiles of individuals, they are a study of power and how men who wield it operate whether they are elected to office or not. Caro is now eighty-eight years old, and one hopes that he survives long enough to finish his last book on LBJ.&lt;&#x2F;p&gt;
&lt;p&gt;Robert Gottlieb was his editor on at least five books and he would have edited the last of the LBJ series as well. Gottlieb died in 2023 at ninety-two, and that book is still due. When it is out, I have no doubt who it will be dedicated to. While Caro is why I know of Gottlieb, the title is why I picked up this biography. I thought it would be about his reading life, but it is not. Well, it &lt;em&gt;is&lt;&#x2F;em&gt; in a way, because as an editor his job was to read closely. But there is little here about how all this reading informed his interior life except a stray comment here and there.&lt;&#x2F;p&gt;
&lt;p&gt;Instead, my primary takeaway from the book is that it is easier to be a workaholic when one loves what one does. To read and to be paid for it! That’s the life. Gottlieb’s grandparents, from both sides, made their way from Eastern Europe, no doubt escaping anti-semitism though he doesn’t comment on it. His father worked his way out of poverty and put himself through school. Gottlieb’s parents provided him with a stable middle class upbringing in New York. He was an introverted kid who spent all his time at the library or with books at home. Then he found himself in Columbia University, surrounded by people who loved the same books as him and shared his snobberies. This was a stroke of good luck. If one’s closest circle consists of poets and writers, what else does one become? After a brief stay at Cambridge, he was back in New York, with an infant and a wife in tow, searching for a job. After many months living off his friends, he finds one at Simon and Schuster, and his career is determined. He will spend the next sixty odd years as an editor and publisher.&lt;&#x2F;p&gt;
&lt;p&gt;Amongst the star publishers (Sonny Mehta for example), Gottlieb probably has edited or published more literary best sellers, Pulitzer prize, and Noble prize winners than any other. How did he get there? His biography doesn’t indicate any preternatural talent other than a voracious need to devour books and a capacity for work. He worked on weekends, and through nights. He did not take vacations. He turned manuscripts around overnight which made agents happy, and authors even happier. “Why put off reading a manuscript or doing an editorial job? You’re going to have to do it sooner or later, and it doesn’t take more time to do it right away than after putting it off for whatever neurotic reason.”&lt;&#x2F;p&gt;
&lt;p&gt;He went all in on each publication. One book he discovered and championed early in his career catapulted him to stardom. This was Joseph Heller’s Catch-22. That led to more authors and agents seeking him - Doris Lessing, Toni Morrison, VS Naipaul, Salman Rushdie, John le Carré, Anthony Burgess, Robert Caro, Lauren Bacall, Janet Malcolm, Michael Crichton, you name it. Each successful launch opened new doors. His ability to make his clients friends helped, no doubt. Many of them, in his telling, became family. His network at Knopf led to a brief stay at The New Yorker which in turn made his fortune. His interest in dance and record of publishing books on the subject also opened doors to the New York City Ballet (NYCB), on whose board he served for many years. An association with NYCB meant a big deal for Gottlieb, because he could finally work with one of his idols, George Balanchine, one of the most influential choreographers of twentieth century. What he says about Balanchine applies just as well to himself: “When there was something practical to be discussed or decided, he was not only quick, sharp, and decisive, he was obviously in his element. Several times when I nervously called him at home about some crisis, he was far from irritated. He welcomed problems, I concluded, so that he could have the satisfaction of dealing with them.” &lt;strong&gt;One is rewarded for showing agency and solving problems. Most problems, at their core, are people and coordination problems.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;While it did not seem as such when he was child, Gottlieb was at his happiest collaborating as part of a relatively small group of congenial, like-minded people. It is a great fortune to stumble on an occupation that fits one’s aptitude, to be a work horse, and to have a long and healthy life.&lt;&#x2F;p&gt;
&lt;p&gt;One of the unexpected pleasures of reading a book like this is not just learning new anecdotes about famous writers, but encountering the occasional bitchiness that comes through the writing when trying to set the record straight. Here is his response to Michael Korda&#x27;s biography from 1999, Another Life:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Michael in his memoir reported Peter’s resentment of me, as though we were rivals. If we were, I didn’t know it, because I just didn’t think that way. In fact, I enthusiastically handed over to him his most successful writer, the unique memoirist-raconteur Alexander King, whose first book—Mine Enemy Grows Older (his Enemy was Himself)—ratcheted up to number one on all bestseller lists, spurred on by Alex’s many appearances on the Jack Paar show.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;On Kat Hepburn:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;But the exchange we had that I remember most vividly was on the phone one morning when a blizzard had piled up snow so high that New York was shut down. Kate’s secretary and cook came in every morning, but she was alone in the house at night, and on this morning they were not going to make it in. She was old, and I decided to call her, to see if she needed anything. The phone rang and rang, and I was beginning to worry when she finally answered. “Sorry it took me so long,” she said, catching her breath. “I was up on the roof shoveling the snow off. Very important to do. If you don’t know how, I can come over and do it for you.” What a dame! Or, at least, what a performance. I was fortunate to have been long gone from Knopf when it published her fuller memoir, Me, a thorough mess of a book. Yet at least the title was accurate: From first to last she was about Me.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;His relationship with David Cornwell aka John le Carré:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;At some point, David had his agent insert into our latest contract that I would take him out to at least one first-rate restaurant when he was in New York; he was tired of our sandwich lunches in my office and the tacky ethnic places I preferred for dinner. I was less amused by this than he was.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;And when John le Carré parts ways with Knopf:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Our extremely successful relationship had extended itself with The Russia House when I was at The New Yorker, but I could tell that he was restless, and when he dedicated it to me I sensed it was a gesture meant to smooth the way for him to move on — David rarely did things without a complicated reason; overthinking was his habit of mind.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Elmore Leonard&#x27;s Fire In The Hole</title>
        <published>2024-09-06T00:00:00+00:00</published>
        <updated>2024-09-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/el-fire-in-hole/"/>
        <id>https://asun9.com/notes/el-fire-in-hole/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/el-fire-in-hole/">&lt;p&gt;Book: &lt;strong&gt;Fire In The Hole&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Elmore Leonard&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Goddamn, EL has become my favorite story teller. In this collection, and in every other book I have read, the backdrop is almost always crime. Murder and death lurk about. But there&#x27;s also more: a love that foregrounds it, along with strong, and sometimes voluble, men and women. Not to mention cool. They are always cool. Also chicken-brained criminals. Definitely that. Despite the tropes, it is hard to predict where the plot is going to take you.&lt;&#x2F;p&gt;
&lt;p&gt;This brings me to “Hanging Out at the Buena Vista”, one of the smaller stories in the collection. Two old people are living it out at a luxury retirement home, just chatting, and maybe even planning to elope. There are no villains here, and no crime, though death makes it presence felt. What it is though is touching, a tender tale that caught me by surprise.&lt;&#x2F;p&gt;
&lt;p&gt;There is not one bad story here. When was the last time that happened? I am currently sampling, rather slowly, Jeyamohan’s Aram, and it is showing similar promise.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Surprised By Joy</title>
        <published>2024-08-18T00:00:00+00:00</published>
        <updated>2024-08-18T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/joy/"/>
        <id>https://asun9.com/joy/</id>
        
        <content type="html" xml:base="https://asun9.com/joy/">&lt;p&gt;You are trying to put your baby to sleep. Usually that involves turning off the lights and getting your daughter into a drunken stupor with milk. She would roll over after she has had her fill and fall head first into the bed. In a few seconds, she’s asleep. Tonight it doesn’t go that way. She has had her milk but sleep is not on her mind. You see her placing herself on the pillow. Then she starts singing in her baby voice. This means meaningless words, and cooing. But there’s a tune in there somewhere, an order, and so it’s a song. After a while, she shuffles a bit and lands on your pillow. She pushes your head and elbow away so she has space. Then she starts patting your head and says, on a loop, “jo, jo, sshh&quot;. The first couple of times, the “sshh” is accompanied by a gesture, with her finger on her lips. That stops eventually. After a few more “jo”s, still sitting, she rests her head on you, with the cheek on your forehead, just above your right eye. It’s soft and cold. Then you feel her drool over your eyes. You wait a while. This is not comfortable, but you stay put. Finally you work up the courage to move her and realize she has fallen asleep. Placing her to your side, you cover her little palm with yours. And wait.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;This is how the day went. You make pancakes for the first time, with the little one gobbling them as if she had been starved the night before. Then you go to see an &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;sempervirens.org&#x2F;news&#x2F;old-growth-what-it-means-and-why-it-matters&#x2F;&quot;&gt;old-growth redwood grove&lt;&#x2F;a&gt; in the Santa Cruz Mountains. You reflect on the thousand summers some of these trees have seen. Between you and your daughter, you have seen thirty-seven. You say a silent prayer to the old gods that she may see a hundred more.&lt;&#x2F;p&gt;
&lt;p&gt;You make your way to Santa Cruz Costco. The two of you try out the food samples. Cheese, popsicles, and raspberry bread. Not a bad streak here. Then you loiter around Santa Cruz downtown, looking for a place to eat. You head back home for the little one to nap and you, you get a break. The siesta lasts ninety minutes. You then walk around the neighborhood while she snacks on more pancakes. The Palo Alto Children&#x27;s Zoo would be entertaining. It&#x27;s been on your mind for a while, and so that&#x27;s next. You are told the place is full, but lucky for you, there&#x27;s a park nearby and a children&#x27;s library. The next couple of hours will be spent there and then it is back home again for the last time. Dinner. Bath. Milk. Sleep.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;How does it feel? A hundred miles, give or take, a zig-zag across &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Santa_Clara_Valley&quot;&gt;the valley&lt;&#x2F;a&gt; and through the mountains. With sore legs and a hint of a bad back. When you wipe the saliva from between your eyes and the forehead. Ready to sleep. At that moment, how does it feel?&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Old Person Project</title>
        <published>2024-08-03T00:00:00+00:00</published>
        <updated>2024-08-03T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/mcphee-tabula-rasa-1/"/>
        <id>https://asun9.com/mcphee-tabula-rasa-1/</id>
        
        <content type="html" xml:base="https://asun9.com/mcphee-tabula-rasa-1/">&lt;p&gt;Book: &lt;strong&gt;Tabula Rasa: Volume 1&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;John McPhee&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;This collection is the first of a series on McPhee’s ideas for articles that never ended being published or many times, even written. He’s eighty-eight now, and has been writing for close to seventy years, so there’s plenty to keep him busy for the rest of his life. Which is perfect because that’s exactly what McPhee wants, an old person project. A never ending work to keep oneself busy in the twilight years. “Reading them and cataloguing them was something to do, and do, and do. It beat dying” as he says of another old person project, Thornton Wilder’s attempt at documenting seventeenth century Spanish playwright Lope De Vega’s works. Hence, the Vol. 1 of the title.&lt;&#x2F;p&gt;
&lt;p&gt;McPhee can make interesting even the most common place thing - an interaction, a building, a road - with sheer skill. It&#x27;s made interesting not just because he is passioante about some subject, but the craft he deploys while at it. I have read plenty of one kind, but not the other. Makes me want to read more McPhee. Makes me want to write, even.&lt;&#x2F;p&gt;
&lt;p&gt;McPhee came on my radar because of his science writing. I have long been under the impression that no one does it better, even though I can&#x27;t recall ever having read him. Now that I have actually read him and having enjoyed the process, I should do away with the excuses and tackle his longer works.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Rivers that come together to form a common delta, like the Sacramento and the San Joaquin, are extremely rare in the world—the Tigris and the Euphrates, the Ganges and the Brahmaputra, the Kennebec and the Androscoggin at Merrymeeting Bay in Maine. Rivers that come together to form a common delta in a far-inland setting are unique. In the Great Central Valley of California, the Sacramento–San Joaquin River Delta is fifty miles from the ocean.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;This involves—for me, anyway—breaking the fundamental rule of journalism that you never show a manuscript to the subject. I have always adhered to that rule with the consistent exception of pieces about science. It has not been my purpose to write for a scientific audience, but my purpose would be defeated if my work were not acceptable to scientists.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;In writing about science, one is always aware that the reader may know a good deal more about the science than the writer does, or a good deal less, and that both categories of reader are always going to be there, in some ratio or other. So, as I’m suggesting, you look for ways to put things that would inform the unknowledgeable while not irritating the knowledgeable.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;He was Lewis Thomas and he was telling me that he liked something that I had written about science. I did not need a higher prize. He also told me about an experience he had in the nineteen-thirties when he was an undergraduate at Princeton. He had gone to the campus medical center to report that he was dying. That, at least, was his diagnosis and he had come to the McCosh Infirmary to confirm it. My father, the physician who examined him, listened to his lungs and heart, and shaped a diagnosis of his own. He said, “Thomas, you are hung over. Go back to your room and sleep it off.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Missouri Summer</title>
        <published>2024-07-30T00:00:00+00:00</published>
        <updated>2024-07-30T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/missouri-summer/"/>
        <id>https://asun9.com/missouri-summer/</id>
        
        <content type="html" xml:base="https://asun9.com/missouri-summer/">&lt;p&gt;I once visited a friend, K, in Kansas City. I knew no one in that part of the country and did not think I would ever visit it again. I wanted to use K’s brief presence there as an excuse to see the Midwest. I can’t recall now who made the plan - I suspect it was him - but we decided to spend some time at the Ozark Caverns and drive down to St Louis. It would take us six hours to get to St Louis this way.&lt;&#x2F;p&gt;
&lt;p&gt;On the way to Ozark, in one of the country roads, I saw something moving on the road at a distance. A raccoon? A cat? No, too slow. As we got closer we realized it was a turtle. I was not sure what to do and so I stopped. Do I drive around it or wait for it to cross? By this time the turtle had crossed the yellow line mark and was entering the other lane.&lt;&#x2F;p&gt;
&lt;p&gt;As I prepared to drive, K decided it was risky to let the turtle make its journey on the road alone. He got off the car and walked towards the turtle. There he stood guard. Another car was approaching from the other side, honking. It eventually screeched to a halt. The driver was visibly upset and swore. I can’t remember the contents now. I can only recall being surprised that he could place our identity accurately, out there, in the middle of nowhere. K didn’t pay attention. He escorted the turtle to the other side and he got back into the car.&lt;&#x2F;p&gt;
&lt;figure style=&quot;text-align:center;&quot;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;ozark-turtle.jpg&quot; class=&quot;center&quot; style=&quot;max-height: 400px; width: auto;&quot;&gt;
&lt;&#x2F;figure&gt;
&lt;p&gt;As we continued on our journey, every few miles there would be another turtle on the road. None alive. It was also not the last time I visited Kansas City. I married a girl from there.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Ferrari: The Man And The Machine</title>
        <published>2024-07-26T00:00:00+00:00</published>
        <updated>2024-07-26T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/enzo-ferrai-yates/"/>
        <id>https://asun9.com/enzo-ferrai-yates/</id>
        
        <content type="html" xml:base="https://asun9.com/enzo-ferrai-yates/">&lt;p&gt;Book: &lt;strong&gt;Enzo Ferrari: The Man and the Machine&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Brock Yates&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;As a boy, Enzo Ferrari dreamed of three careers: sportswriting, opera singing, and race driving. He did dabble in sportswriting and race driving. In the end, he didn’t make his mark in any of them. Instead, he ended up with a monomaniacal focus on racing in the Grand Prix, and that’s where he entered into the pantheon of larger-than-life figures who mark a zeitgeist.&lt;&#x2F;p&gt;
&lt;p&gt;He was not born in poverty, but he was decidedly of a lower middle-class stock. Given that he was not of nobility, his desire to serve in the artillery division in WWI was denied, and he ended up shoeing mules in the Italian army. He got injured, and as he lay recovering in a chilly, darkened room on the second floor of a building, he could hear the steady clatter of workmen’s hammers as the lids of coffins were pounded into place. This time, in 1918, when he was around 19, is when, for some mysterious reason, he decided to get into cars for a career. He tried joining Fiat. It was the end of the war, and there were many thousands of veterans looking for a job, many more skilled and higher in the social pecking order. Enzo Ferrari did not get the job, and in his own telling, sat down on a park bench and cried. He then moved into racing for a career.&lt;&#x2F;p&gt;
&lt;p&gt;The next twenty years were a heady time in Italy. The Fascists were on the rise, and so was motor racing. Motor racing, one learns, was the most popular sport in Italy and large parts of Europe. It was one sport where the rich could mingle with the poor, and death visited all. In Italy, motorsports crossed all social boundaries, rivaling football and cycling in popularity. Mussolini, Il Duce, had some passing interest in the sport. Alfa Romeo was the Italian racehorse then, and the government offered financial inducements to keep Alfa Romeo powerful in international Grand Prix competition in the name of Italian prestige.&lt;&#x2F;p&gt;
&lt;p&gt;Ferrari started by racing Alfa Romeos himself. At some point, he realized he would never be a master and so set up a stable of Alfa Romeos that he could enter into races by hiring more talented drivers. There were some wins, many losses, and lots of haggling with Alfa Romeo, who fielded their own racing team. Fiat dropped out of the racing business. New ones entered it - the Maseratis, Bugatti, Mercedes, and Auto Union of the Germans being the most notable. The Germans had the backing of the state and they had the best technology on the market. They beat the Alfas handily before WW2 put an end to all racing. It was around this time that Enzo Ferrari decided to build his own cars. After some war profiting, he finally managed to field some of his &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Ferrari_125_S&quot;&gt;beautiful machines&lt;&#x2F;a&gt; in 1947. The engine was from Ferrari engineers, the body was from elsewhere. From then on, it was constant improvement and keeping up with advances others came up with.&lt;&#x2F;p&gt;
&lt;p&gt;Ferrari was in his 50s then, with decided ideas about what would win races - it all came down to the engine at the front of the car. No noteworthy innovation came from Scuderia Ferrari. It almost always came from the Germans, the British, and the Americans, tried and tested on the track a few times, before Ferrari, kicking and screaming, could be convinced to try it. So it was that rear engines, space-age bodywork, coil-spring suspensions, independent suspensions, magnesium wheels, and disc brakes all came from elsewhere, many from the British. Only one significant alteration in engineering philosophy had come from Ferrari in all the years of business: the switch to a large-displacement, naturally aspirated engine.&lt;&#x2F;p&gt;
&lt;p&gt;So while Ferrari was trying to win races, barely keeping up with the competition, he still had to make money. Starting money from races and sponsorship was not enough. The passenger car effort - selling cars to the newly rich, dissolute nobles, playboys - was only a means to keep the money flowing into racing. His focus, always, was on racing. He had also become by this time very stuck to his hometown of Modena. All business negotiations had to happen there, with everyone stopping by his bare office and big desk to seek a deal. He rarely made public appearances, and did not visit the races his cars entered, all of which added to his mystique. The American press, always up for the creation of new celebrities, made him into a demigod. His passenger cars were selling at enormous margins, and he looked at his buyers, mainly the Americans, with contempt.&lt;&#x2F;p&gt;
&lt;p&gt;This did not stop him from being almost bankrupt, however. There was a brief dalliance with Ford about buying the passenger car business. That fell through because Ferrari wanted to run Scuderia Ferrari and race cars. Ford did not want the competition. Ferrari could not race if Ford entered the races. So the deal fell through. On paper, the deal was for 17 million or so dollars. Not much. Nationalism was rampant in all of European racing. The cars still carried the colors of their native states: Italians red, British green, French blue, Germans silver, Belgians yellow, and so on. Numerous companies, including Dunlop, the English tire company, Michelin from France, and Continental from Germany, were reluctant to do business with any team that was not composed of fellow countrymen.&lt;&#x2F;p&gt;
&lt;p&gt;So the idea of an American corporation buying Ferrari made enough noise in the Italian press that Fiat entered into an agreement to purchase Ferrari and, what’s more, on his terms. He would continue racing. Ferrari made sure to note that this was revenge for rejecting him almost 50 years earlier.&lt;&#x2F;p&gt;
&lt;p&gt;It&#x27;s always great to read a biography where the author is not intimidated by the subject, nor hopelessly star-struck. Yates demolishes the aura around Enzo Ferrari right from the get-go, showing in no uncertain terms that Ferrari was neither an engineer nor a race car driver of note. What he was was a man of enormous ego, capable of holding a grudge for any perceived slight, and focused on one thing and one thing only: success on the race track. Not any race track, but the Grand Prix. This focus meant that he stuck around long enough for his competitors to drop out - the Fiats, Alfa Romeos, the Auto Unions, the Mercedeses, Maseratis. Just showing up every day clearly has its benefits, especially if one has had a long life like Ferrari. He did not care about the many, many dead drivers, not family (and especially not his wife), not his mistresses, not even the road cars that clearly subsidized his racing. He did not care about politics or religion, and rode over both the fascist tide and the socialist wave that followed World War II. All that mattered was the prize, and his reputation for winning. His special skill, aside from the focus, seems to have been his ability to &quot;agitate men&quot; to create and drive his machines. He possessed an unerring sense of whom to bully and whom to accommodate. He was a workaholic, in his workshops all seven days a week, including holidays - he worked on both Easter Sunday and Christmas.&lt;&#x2F;p&gt;
&lt;p&gt;Brock Yates is very opinionated. Couple that with the fact that he can write, makes this a very entertaining book, even if all the races at some point begin to resemble each other, a medley of deaths, crashes, and newer competitors rising from the ashes. Consider this assessment of the early 20th-century Italian middle class:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;The family unit was sacred to the Italian male of Ferrari’s generation, within, of course, the rather wide latitudes defined exclusively by the man himself—who remained free to philander, spend freely and ignore the tenets of the Church, while in turn demanding goose-stepping obedience from his children and saintly fidelity from his wife. He adored his children, and treated his wife as a basically asexual helpmate modeled on the most perfect female of all time—his mother. Mothers were worshipped, wives tolerated and other women treated as objects of either scorn or lust, or both.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;And this:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Mussolini never enjoyed the goose-stepping enthusiasm accorded Hitler by the Germans. He faced a solid anti-Fascist coalition of old royalists, socialists, academics and a strong Communist Party centered in the industrial north. To his credit, and directly opposed to the inhuman actions of Hitler and Stalin, Mussolini did not incite pogroms against his opposition and precious few of his opponents were killed or incarcerated.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;On the status-starved Americans, who wanted Ferraris despite it being of inferior build quality:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;By now the image of Enzo Ferrari had been inflated to mystical dimensions. His adoring customers accepted him as an imperious but lovable artisan laboring with monklike devotion over his beloved machines. Little did the provincials know that he had been prepared to unceremoniously dump the road-car business not once but three times within the past few years and was now engaged in a serious attempt to establish strong financial relations with Fiat.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;On why Ferrari did not show any emotion at the races:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;His view of racing remained constant: the event itself was essentially meaningless. For him the stimulation came in the planning and preparation, in the creation of the machines, in the organization of the human beings who would man the team and in the endless wrangling with the press, promoters and sponsors. For Enzo Ferrari the race was over when the engines were fired and the cars leapt away from the starting grid. From then on it was in the hands of his drivers and there was nothing for him to do but to ease back in his chair.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Great book.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Michael Lopp on Management</title>
        <published>2024-06-26T00:00:00+00:00</published>
        <updated>2024-06-26T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/rands-leadership/"/>
        <id>https://asun9.com/rands-leadership/</id>
        
        <content type="html" xml:base="https://asun9.com/rands-leadership/">&lt;p&gt;Book: &lt;strong&gt;The Art of Leadership: Small Things, Done Well&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Michael Lopp&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;randsinrepose.com&quot;&gt;Michael Lopp&lt;&#x2F;a&gt;&#x27;s book is about leadership, but it&#x27;s really about management. There&#x27;s nothing groundbreaking here, but considering it is from a practitioner in the field for the last two decades, its utility can&#x27;t be questioned. The book is organized as a collection of strategies - techniques? - that the author suggests one pick and try for sometime, ideally three months. If you like it, do it forever and allow compounding to work its magic. The crux boils down to this: be kind, be reliable, and have a lot of 1:1s. That&#x27;s not hard. Right? Right.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;notes&quot;&gt;Notes&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Those years of building out the team taught me that &lt;strong&gt;management is fundamentally about uncovering information — roadblocks your team is facing, interpersonal friction, etc.— and then slicing through the BS to find the right way forward&lt;&#x2F;strong&gt;. Doing it well means getting good at both of those. On the information front, it means asking the right questions and designing an intentional culture that fosters truth telling. In terms of finding a path forward, it means learning about the universe of possible solutions and then choosing the best one for the particular situation.&lt;&#x2F;li&gt;
&lt;li&gt;I’ve preached 1: 1s, weekly recurring meetings with direct reports, for decades. I believe a 1: 1 represents the simplest and most reliable way to build trust between you and your coworkers, by providing a weekly high-bandwidth conversation on current events affecting the team.&lt;&#x2F;li&gt;
&lt;li&gt;Leadership, like any complex skill, can’t be hacked; it must be thoughtfully and patiently built. Leadership is built on a set of practices, but the judgment of choosing when to use or deploy a certain habit is the art of leadership. One of the primary reasons there are not noteworthy university degrees in leadership is because leadership is a set of skills you must learn from the job.&lt;&#x2F;li&gt;
&lt;li&gt;More importantly, there are actually no marginal minutes. It is my personal and professional responsibility as a leader to bring as much enthusiasm, curiosity, and forward momentum as possible to every single minute of my day. When I find myself in a situation where the value is not obvious, I seek it because it’s always there. &lt;strong&gt;Assume they have something to teach you.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;When it comes to complex political scenarios, you need to keep track of who knows what. Again, nothing nefarious. No ill intent. Just an honest attempt to shape the narrative productively.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;operational-excellence&quot;&gt;Operational Excellence&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;You sign up for things and get them done. Every single time.&lt;&#x2F;li&gt;
&lt;li&gt;Leaders set the bar for what is and is not acceptable on their teams. They define this bar both overtly with the words they say, and more subtly with their actions.&lt;&#x2F;li&gt;
&lt;li&gt;Thinking I am being responsible and helpful, I sign up for things. I do this repeatedly and sign up for too many things. Over time, I realize I’m overloaded, so I back out on some commitments. Where’s the flaw? Because I could not initially correctly assess how much work I could do, I’m signaling to my team that it’s okay to back out of commitments.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;act-last&quot;&gt;Act Last&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;You’ll be sitting in a meeting where folks are going around the table and giving their opinion about some important topic—and for a great many situations, when it’s your turn to offer your opinion, the savvy move is to pass.&lt;&#x2F;li&gt;
&lt;li&gt;In a meeting where an individual or team is presenting a complex idea or project, my job as the leader is soup tasting. It’s sampling critical parts of the idea to get a sense of how this soup has been or will be made. Who are the critical people? What are the critical parts? Which decisions matter? I don’t know. I do believe that a prerequisite for leadership is that you have experience.&lt;&#x2F;li&gt;
&lt;li&gt;Let others share their thoughts. You never know when a great idea will appear. Understand that because you’re the leader, your team is going to be less likely to contradict your idea—which is another good reason to act last.&lt;&#x2F;li&gt;
&lt;li&gt;Demonstrate respect to the team by asking great questions. Be curious. Your experience has taught you lessons, and your questions often share those lessons better than your lectures. Plus, you never know what kind of soup you’ll get to taste.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;performance&quot;&gt;Performance&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;It’s always performance season.&lt;&#x2F;li&gt;
&lt;li&gt;How often should you review and revise your answers to these questions (about what you need from your career)? Four times a year? Five? Your call, but it needs to be more frequently than the company’s official performance season because professional growth occurs every single day. Most days that growth is not obvious; it’s the daily set of work on your plate that is predictable and understood. No surprises.&lt;&#x2F;li&gt;
&lt;li&gt;If you’re going to say yes to the opportunity, it needs to be an informed yes. What is it about this opportunity that will allow you to grow?&lt;&#x2F;li&gt;
&lt;li&gt;Give yourself months and months to discuss a gap in performance (of a reportee). Analyze it from different angles and make it about learning rather than a step on the road to performance management.&lt;&#x2F;li&gt;
&lt;li&gt;The reality is that you’re always managing performance. Your very existence as a leader sets a performance bar. How you act, what you say, how you treat others, how you work, all of your attributes influence how your team performs because you demonstrate what you value as a leader.&lt;&#x2F;li&gt;
&lt;li&gt;The vast majority of the situations surrounding performance, though, are coachable. The work is complex, uncomfortable, time-consuming, and often hard to measure, but it is during these hard conversations that you become a better communicator, you learn the value of different perspectives, you build empathy, you become a better coach, and you become a better leader.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;delegation&quot;&gt;Delegation&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;You do not start management equipped for the gig. Your first role in management is a career restart. Yes, you’ve acquired dealing-with-humans skills from being a part of a team, but the New Manager Death Spiral demonstrates how the very instincts that got you the new role are going to steer you in the wrong direction.&lt;&#x2F;li&gt;
&lt;li&gt;Delegate more than is comfortable. The complete delegation of work to someone else on the team is a vote of confidence in their ability, which is one essential way that trust forms within a team. Letting go of doing the work is tricky, but the manager’s job isn’t doing quality work, it’s building a healthy team that does quality work at scale.&lt;&#x2F;li&gt;
&lt;li&gt;As a manager, I had to deal with the discomfort of not actually doing the practical and obvious work, but at least I could glance at the engineer’s monitor and get a glimpse of work happening. As a manager of managers, I had to take the word of other managers regarding how the work was proceeding. This distance is the primary challenge for the manager of managers.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Just as the role of manager is preparation for being a manager of managers, the role of director is preparation for being an executive.&lt;&#x2F;strong&gt;
&lt;ul&gt;
&lt;li&gt;Politics, the good and the bad, is now part of your daily diet. Communication downward and upward has always been important, but now you must communicate sideways—and now it’s time to give away your Legos.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;A common complaint I hear about managers is the classic, “What do they do all day?” You know what a good manager is doing? They’re giving away just about everything that lands on their plate to members of their team because their job isn’t building the product, their job is building a team that is capable of building the product.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;recruiting&quot;&gt;Recruiting&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Let’s start with the rule. For every open job on your team, you need to spend one hour a day per req on recruiting-related activities. Cap that investment at 50% of your time.&lt;&#x2F;li&gt;
&lt;li&gt;There are two use cases for The Must List. First, whenever a new gig opens up on my team, I fire up the List and see if there is anyone on it who might fit the bill. Then I send them a friendly note. Hi. How are you? Got a gig and I must work with you again. Coffee? More often than not, if we haven’t spoken recently, this human and I will get coffee regardless of their interest in the role because these are dear friends.&lt;&#x2F;li&gt;
&lt;li&gt;Every month or so, whether or not I have a relevant open gig on my team, I review the list and see whom I have not spoken with in the last 90 days. Time for an email? Okay: Hi. How are you? Coffee? Again, they’re rarely interested in switching gigs, but if they happen to be looking, I will move mountains to work with them again.&lt;&#x2F;li&gt;
&lt;li&gt;Your focus during Understanding is to again consider the candidate’s mindset. While they are getting peppered with questions about their skills and qualifications, they are also wondering, “Who is this engineering team?” “What do they value?” and “Where are they headed?”&lt;&#x2F;li&gt;
&lt;li&gt;Your responsibility is to make sure the candidates understand your mission, culture, and values.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;gossip-and-lies&quot;&gt;Gossip and Lies&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;I’m solidly on the record as believing 1: 1s are the most important meeting of the week. A very close second is the staff meeting. I find that 1: 1s beat staff meetings in two important categories: trust building and quality of signal. There are ongoing, compounding benefits to a regular well-run staff meeting, though: team building, efficient information dissemination, and healthy debate are three I can think of off the top of my head.&lt;&#x2F;li&gt;
&lt;li&gt;In a well-run staff meeting, 95% percent of the activity is healthy conversation and debate. Key word: healthy. It’s a clear signal that a staff meeting is working when the majority of attendees jump into conversations and drive those conversations in unexpected directions. It’s a clear sign that no one is curating those conversations when those unexpected directions are not revealing insight or value. It’s time for a Meeting Runner.&lt;&#x2F;li&gt;
&lt;li&gt;Humans have complicated relationships with meetings. If they’re in the meeting and it’s not meeting their expectations, they’re mad. If they’re not invited to a meeting where they believe they should be present, they’re mad. Combine this slippery situation with the fact that meeting efficiency devolves as a function of the number of humans greater than seven that are present, and you’ve got a maddening set of complicated constraints. The simple but perhaps controversial practice I recommend is that every single meeting have a Meeting Historian, and the work of that Historian be broadcast to the whole company.&lt;&#x2F;li&gt;
&lt;li&gt;Politics are a natural development in a large group of humans working together. Corrosive politics give me rage. Taking credit for others’ ideas, hoarding information, not allowing the best idea to win—the list goes on and on, and when I discover this type of politics where I work there is rage.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;The fact is, in the absence of information, your team will make up the worst possible version of the truth, usually reflecting their worst fears. This deceptively simple rule is the reason for many of the rumors circulating within your team and at your company.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;say-the-hard-thing&quot;&gt;Say the hard thing&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;On my short list of critical leadership skills, the ability to “say the hard thing” is right after “delegate until it hurts.” The majority of people-related disasters I’ve created have originated with my choice to not say the hard thing.&lt;&#x2F;li&gt;
&lt;li&gt;Your job, the work you should value the most, is helping your team grow. Compliments and recognition are one way to highlight exceptional work, but saying the hard thing always gets their attention.&lt;&#x2F;li&gt;
&lt;li&gt;A good place to start practicing feedback is with new employees. Once we’re past the “getting to know you” phase of a working relationship, a month or two in, I start giving feedback. I keep it lightweight at first (“ In this meeting, you said this thing. Is this what you meant to say?”), and at the end of each 1: 1 I ask the same question, “Do you have any feedback for me?”&lt;&#x2F;li&gt;
&lt;li&gt;Listen for what? One simple insight. One realization. Here’s one example: “Why are they choosing to give me this feedback right now?” The trick is to engage your rational brain, the part of your brain that likes to solve problems, as opposed to the part that wants to scream, because the part of your brain that wants to scream is exceptional at demonstrating tremendously poor judgment.&lt;&#x2F;li&gt;
&lt;li&gt;Again, your goal in life is to make feedback in all directions no big deal. You and your team never start in this state; you work up to it. You start with small spoken observations that slowly turn into more useful feedback. You watch each other to see if you’re listening to the feedback, and eventually acting on it.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;These principles frame my advice for your growing company: Provide a clear explanation of the rules. Be prepared for the rules to evolve in unexpected ways. Play, learn, and repeat.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;At a start-up, “fail fast” isn’t good advice; it’s a way of life, and it’s the defining characteristic. It is up to you to make failure a competitive advantage.&lt;&#x2F;li&gt;
&lt;li&gt;Once they’re broken, and with ruthless and calming efficiency, you must set to the task of learning. What truly broke here? What is the best set of fixes? Who is accountable for leading those fixes? It won’t completely address the fear, but a culture of learning and acting on those learnings will signal to everyone that you take failure seriously and are eager to learn completely.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;the-first-three-months&quot;&gt;The first three months&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;The first three months at a new job is a delicate time because you are in the “first impression zone” where, whether you like it or not, the judgment factor is impossibly high.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;And just like when joining a compelling new start-up, we begin with the following affirmation: “I need to look like I know what I’m doing even though I’ve never done it before.”&lt;&#x2F;strong&gt;
&lt;ul&gt;
&lt;li&gt;Part of leadership is learning to demonstrate enough charisma and enthusiasm to convince the team that against impossible odds, we will succeed.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Your team’s first impression of your leadership style should not be, “My new executive is not going to ask my opinion. They like going rogue.” I would much prefer, “My new executive moves rather quickly and with intense and defensible purpose.”&lt;&#x2F;li&gt;
&lt;li&gt;The first 90 days is a dangerous time. First impressions are hard to change. Your first few months set the tone. Simple acts as a leader will resonate loudly throughout the team and the organization.&lt;&#x2F;li&gt;
&lt;li&gt;My default operating model is sharing a vision for where we’re going. This means describing our ambitious future and all the strategic steps we’ll need to take to get there. I’ll want your opinion because I know ideas get better with eyeballs, but sometimes, rarely, we’re just going to go. See, I’ve been here before and by acting without asking, I’m giving us a strategic advantage, I’m saving us time and money, and I’m being a leader.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;misc&quot;&gt;Misc&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Other than spending time with my family, my absolute favorite time of the week is Saturday morning. I sleep in a little bit, walk upstairs, start the coffee process, and wander over to the computer. There’s a Dropbox folder titled “Latest Rands Articles,” and right at this moment there are 65 articles in progress there. After a brief stumble through the internet, a precious time begins. I have precisely the right music on, in the center of my screen is a wall of words, and in that moment I’m decidedly not busy, I’m not working—I am building a thing, and I need this time every single day.&lt;&#x2F;li&gt;
&lt;li&gt;1:1 every week - This meeting is for discussing topics of substance, not updates. I’ve created a private Slack channel for the two of us to capture future topics for our 1: 1s as well as to provide a handy historic record of what we’ve discussed.&lt;&#x2F;li&gt;
&lt;li&gt;Leadership comes from everywhere. My wife likes to remind me that I hated meetings for the first 10 years of my professional career. She’s right. I’ve wasted a lot of time in meetings that were poorly run by bad managers. As an engineer, I remain skeptical of managers even as a manager. While I believe managers are an essential part of a scaling organization, I don’t believe they have a monopoly on leadership, and I work hard to build other constructs and opportunities in my teams for nonmanagers to effectively lead.&lt;&#x2F;li&gt;
&lt;li&gt;I heavily bias toward action. Long meetings where we are endlessly debating potential directions are often valuable, but I believe starting is the best way to begin learning and make progress. This is not always the correct strategy. This strategy annoys those who like to debate.&lt;&#x2F;li&gt;
&lt;li&gt;I believe in the compounding awesomeness of continually fixing small things. I believe quality assurance is everyone’s responsibility and there are bugs to be fixed everywhere… all the time.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Clear communications, demonstrated expertise, clear and actionable feedback, and even-keeled temperament. All the time.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;First, an unfailingly kind leadership protocol seems like a solid approach for a volunteer organization. You don’t hire your team, and they likely come from diverse backgrounds with different motivations, so your ability to explain and guide is key. Your ability to convey credibility and become the expert as quickly as possible is paramount because volunteers leave… randomly. In the face of disaster, you must remain a calm and focused leader—this leadership trait is essential. Disaster is a strong word, but in a world where volunteers are doing work they are choosing to do rather than work they must do, unexpected situations are the norm.&lt;&#x2F;li&gt;
&lt;li&gt;How do you interview for leadership skills? I hear this question a lot, and 9 times out of 10 the thoughtful but predictable response is, “Ask them about the last person they let go.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>On Fred Rogers</title>
        <published>2024-05-19T00:00:00+00:00</published>
        <updated>2024-05-19T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/fred-rogers/"/>
        <id>https://asun9.com/fred-rogers/</id>
        
        <content type="html" xml:base="https://asun9.com/fred-rogers/">&lt;p&gt;Book: &lt;strong&gt;The Good Neighbor: The Life and Work of Fred Rogers&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Maxwell King&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Find something that you like and spend a life time developing expertise in it. This seems like a recipe for not just a happy life, but outsize returns. Fred Rogers knew early on, in college, that he liked children, and he liked music. He discovered television around this time and was hooked. For the rest of his life, this was his play area. This, and his Presbyterian faith, which he fused into his life’s work.&lt;&#x2F;li&gt;
&lt;li&gt;Fred Rogers, along with a few others like Dr V or Gandhi, are examples of people of faith just having a deeper, kinder, and a more positively impactful life. All of them practiced their religion, in the truest sense of the word. They grappled with integrating it in their daily work and social life. It informed their choices in the world. For Fred, it was treating everyone, from the little ones to the adults, with compassion and empathetic outreach.&lt;&#x2F;li&gt;
&lt;li&gt;Fred was bullied in school. That seems to have left its mark on him, about how children should be treated. Folks with outsize success in America seem to have had emotionally tough childhoods. See &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;fred-rogers&#x2F;@2024-02-08-larry-miller.md&quot;&gt;Larry Miller&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Once you have decided your field, have the highest standards. Fred was famous was not going home till he got wanted from each show, from all his performers. He was obsessed with quality, and he didn’t give a damn about the what the studio executives care about, which was advertisement. He stayed away from selling to children through his life, trading profits for excellence. His show integrated themes of kindness and self-acceptance and actively listening to the children, and the mid century American children responded back.&lt;&#x2F;li&gt;
&lt;li&gt;Despite being the person he was, both his children had rebellious adolescent years, including encounters with the police and drugs. Neither of them finished college. Mysterious are the ways of the world. Fred Rogers set an example for other children to emulate, including his own, but they took their time to get to it.&lt;&#x2F;li&gt;
&lt;li&gt;Speaking of being a role model, that seems to be one of the things you must be very mindful of. Children notice everything. Fred Rogers’ own faith and life was informed by his parents, for whom the term “pillars of the community” applied without qualification. Similar roles were played by Dr. Orr at Pittsburg Theological Seminary,  and &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Margaret_McFarland&quot;&gt;Dr. Margaret MacFarland&lt;&#x2F;a&gt;. &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;fred-rogers&#x2F;@2021-01-25-infinite-vision&quot;&gt;Dr V&lt;&#x2F;a&gt;, was heavily influenced by Gandhi. Dr V’s siblings, who followed him into Aravind, in turn aspired to the standards set by him. &lt;strong&gt;What and how you do matters, so you must be an exemplar. Be what you want to see more of in the world&lt;&#x2F;strong&gt;.
&lt;ul&gt;
&lt;li&gt;Jim Rogers, Fred’s father, once wrote a large check to a waitress at a restaurant after she told him she was putting all her tips toward her college tuition, and he set aside a large contribution from his own stocks and bonds to create what he called the “sinking fund” to meet the unanticipated needs of the Latrobe Presbyterian Church.&lt;&#x2F;li&gt;
&lt;li&gt;More than once, Rogers saw Dr. Orr leave for lunch on a winter’s day and come back without his overcoat, having given it to someone he encountered living on the street. Orr told Rogers not to worry: He had other coats back home. With everyone at the seminary, students and faculty alike, Orr was willing to give freely of his time, his books, his money, or anything that was needed. Rogers found Orr, with his emphasis on kindness and caring and his deep belief in forgiveness, to be an example of how to live.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;It’s good to have friends, and friends in high places. Fred Rogers could take some of the risks because he came from wealth, and his father had wealthy friends. This opened some doors. Once you work, and do it honestly and thoroughly, your reputation will speak for itself, and more doors open.&lt;&#x2F;li&gt;
&lt;li&gt;In the end, how do you measure impact? Despite Fred Rogers’ efforts, television and movies are entirely motivated by profit and commercials today. By the time he finished his television career in 2001, around half the marriages in America ended in divorce. Just a few years later, the US passed another watershed: Over 40 percent of babies were being born out of wedlock; and for women in their twenties—a harbinger of future trends—the percentage of babies born outside of marriage was 60 percent. This was not the values he stood for, but here America is.
&lt;ul&gt;
&lt;li&gt;Despite the trend of the day - about which you can do little - you must still live out your values. Most people will not care and the world will unfold the way it will, but some people’s lives could change by your example and words.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;On parenting, and children:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;“Nothing can replace the influence of unconditional love in the life of a child. . . . Children love to belong, they long to belong.”&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Fred McFeely always made sure his grandson knew, directly and sincerely, how much he enjoyed his company. “Freddy, you make my day very special,” McFeely frequently told the shy little boy, reminding him of his importance to the adults in his life.&lt;&#x2F;li&gt;
&lt;li&gt;Dr. Margaret MacFarland said that attitudes aren’t taught, they’re caught. If the teacher has an attitude of enthusiasm for the subject, the student catches that whether the student is in second grade or is in graduate school. She said that if you show them what you love, they’ll get it and they’ll want to get it.”&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Some notes on TMK and the Academy</title>
        <published>2024-03-29T00:00:00+00:00</published>
        <updated>2024-03-29T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/tmk-raga/"/>
        <id>https://asun9.com/tmk-raga/</id>
        
        <content type="html" xml:base="https://asun9.com/tmk-raga/">&lt;p&gt;There&#x27;s a lot of drama around TM Krishna (TMK hereon) this past week. I have refrained from consuming more than I need to know about what’s happening, so I may be missing some or even a lot of context. That’s okay because I am going to use the narratives around this incident as an opportunity to finally organize some of my thoughts around Carnatic music, EV Ramasamy, and the role of artiste in the public.&lt;&#x2F;p&gt;
&lt;p&gt;TMK has been conferred the Sangita Kalanidhi for 2024. Sangita Kalanidhi, given annually by the Madras Music Academy, is the preeminent award for Carnatic music. Tiruchur Brothers, Vishaka Hari, Dushyant Sridhar, Ranjani Gayatri, Chitravina Ravikiran (and maybe a few others) have declined to participate in the 2024 music season stating that they don’t want to share the stage with TMK. The response to this has been predictable. All the premier news papers and digital publications have accused the above of being closest &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;theprint.in&#x2F;opinion&#x2F;pov&#x2F;Brahmin-meltdown-over-madras-music-academy-award-to-tm-krishna-shows-fear-of-change&#x2F;2010094&#x2F;&quot;&gt;casteists&lt;&#x2F;a&gt;, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;scroll.in&#x2F;article&#x2F;1065557&#x2F;what-explains-the-outrage-in-the-Carnatic-world-about-vocalist-tm-krishnas-prestigious-award&quot;&gt;elitist&lt;&#x2F;a&gt; and &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;indianexpress.com&#x2F;article&#x2F;opinion&#x2F;columns&#x2F;underlying-the-t-m-krishna-controversy-the-politics-of-hindutva-9232623&#x2F;&quot;&gt;so on&lt;&#x2F;a&gt;. Why this particular line of accusation? Because TMK has a long history of making sweeping, abrasive statements to the effect that the Carnatic musicians and sabha culture are orthodox, hypocritical, and ill-willed towards others. This intersects with the larger popular discourse, especially in Tamil Nadu, that of the Brahmin as an irredeemable, scheming outsider. Unless one constantly apologies and renounces that identity, one is always suspect. &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;N._Ram&quot;&gt;N Ram&lt;&#x2F;a&gt;, the brother of N Murali, the chief of Madras Music Academy, has this to say of Ranjani Gayatri&#x27;s concerns: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;twitter.com&#x2F;nramind&#x2F;status&#x2F;1771008433598455998&quot;&gt;&quot;...bigoted, casteist objections by a small coterie of set-up Carnatic musicians&quot;&lt;&#x2F;a&gt;. N Murali, by the way, is a director of The Hindu Group.&lt;&#x2F;p&gt;
&lt;p&gt;TMK has the support of political powers that be. Kanimozhi, Lok Sabha MP, deputy general secretary of the DMK and the president of &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.thehindu.com&#x2F;news&#x2F;cities&#x2F;chennai&#x2F;nation-facing-undeclared-emergency-over-the-past-10-years-says-n-murali&#x2F;article67522141.ece&quot;&gt;The Hindu and National Press Employees&#x27; Union&lt;&#x2F;a&gt; came out with a statement. Her brother, the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.devdiscourse.com&#x2F;article&#x2F;politics&#x2F;2866951-tn-cm-throws-weight-behind-noted-vocalist-tm-krishna&quot;&gt;CM of Tamil Nadu Stalin&lt;&#x2F;a&gt;, came out with another statement in TMK&#x27;s favour and of course, insinuated that a certain community has a grudge. The state of discourse in Tamil Nadu is such that even &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.outlookindia.com&#x2F;art-entertainment&#x2F;chinmayi-sripada-defends-tm-krishna-over-sangita-kalanidhi-row-they-are-mixing-up-their-problems-and-dislike&quot;&gt;bit players&lt;&#x2F;a&gt;, who really should know better given their encounter with the Dravida Kazhagam political machine, toe the line. DMK, for those who can recall, very openly celebrated the total lack of representation of Brahmins - a minority - from the state assembly for the first time in the state&#x27;s history, in 2021. Even their ideological counter parts in the center do not celebrate the absence of muslims from the parliament. Since politicians be politicking all the time, the BJP and AIADMK has gotten into the fray as well by commenting on the story.&lt;&#x2F;p&gt;
&lt;p&gt;I am going to attempt to answer some of the arguments I have encountered and make a case for why this dissent is really a principled stand. I am very much in sympathy with TMK’s project of bringing Carnatic music and high culture to everyone whatever their status. It cannot survive if it&#x27;s limited to a few social classes. Carnatic music has to be made relevant in a world filled with dopamine-inducing distractions. However, he is not alone in doing it within the Carnatic music community, and his ways of doing it are unfair to his fellow artists. Moreover, TM Krishna LARPs as someone who speaks truth to power. He falls woefully short when calling out the pervasive Dravidian bigotry, or for that matter, even seeing it in the first place.&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-dravEng-1&quot;&gt;&lt;a href=&quot;#fn-dravEng&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;does-anyone-wish-to-deny-tmk-the-sangita-kalanidhi&quot;&gt;Does anyone wish to deny TMK the Sangita Kalanidhi?&lt;&#x2F;h2&gt;
&lt;p&gt;The first objection is the easiest to get out of the way. No one feels TMK is untalented and undeserving of the Sangita Kalanidhi, if the award were really a signifier of excellence in the field. In their public notices, none of dissenters comment on the validity of conferring it on TMK. Their problem is that the awardee presides over a multi-week event, an event which is the highlight of the music calendar, and they do not wish to share the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=2bOprfexcb8&quot;&gt;stage&lt;&#x2F;a&gt; with &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=NAW4vNJtxBg&quot;&gt;him&lt;&#x2F;a&gt;. TMK denigrates whatever they stand for and it would be awkward for them to interact with him.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;are-these-values-they-stand-for-casteist&quot;&gt;Are these values they stand for casteist?&lt;&#x2F;h2&gt;
&lt;p&gt;Most liberal commentators have concluded that since TMK is vocally anti-caste, RaGa and Dushyant Sridhar&#x27;s dissent can be explained only by inherent casteism.&lt;&#x2F;p&gt;
&lt;p&gt;Well, are they? You should take their words and actions for it. RaGa, Chitravina Ravikiran, Tirchur Brothers all have students across caste lines. &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=K6BOzVJHb0A&quot;&gt;Dushyant Sridhar&lt;&#x2F;a&gt; teaches Harikatha to anyone who comes to him, irrespective of caste. &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=0bZAHqg89rw&quot;&gt;N Ravikiran&lt;&#x2F;a&gt; has been in the social sphere for a long time, taking Carnatic music to various corners of Tamil Nadu, especially in spaces with no upper caste presence at all.&lt;&#x2F;p&gt;
&lt;p&gt;This particular charge has been laid on Carnatic music because some of its most famous practitioners are Brahmins. TMK&#x27;s conclusion is that Carnatic musicians practice caste discrimination so that they can ensure their dominance and control over the art form. That the field has been studded with non-Brahmin greats doesn&#x27;t matter (my personal favourites are &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=twYWM-G7N9A&quot;&gt;U Srinivas&lt;&#x2F;a&gt; and &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=dRqcv5uvBA8&quot;&gt;KJ Yesudas&lt;&#x2F;a&gt;). TMK&#x27;s other contention is that Brahmins have appropriated a non-Brahmin art form. To me that sounds as ridiculous as saying black basketball players have appropriated - taken something away from, illegitimately - white basketball players by dominating the scene. I like this basketball comparison because there&#x27;s a clear majority in the field who are minorities in public life. To reduce the complexity of reasons for why things turned out the way they did to &quot;bad Brahmins&quot; shows, if you happen to be TMK&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-tmkRead-1&quot;&gt;&lt;a href=&quot;#fn-tmkRead&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;, a lack of complete engagement with truth. Not ignorance, but dishonesty.&lt;&#x2F;p&gt;
&lt;p&gt;There are &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;theprint.in&#x2F;opinion&#x2F;Carnatic-musicians-indulged-tm-krishna-for-too-long-boycott-is-just-a-start&#x2F;2017909&#x2F;&quot;&gt;plausible&lt;&#x2F;a&gt; reasons that are capable of explaining the present moment, does not involve deception, and does not scapegoat any group. Public concert performances are a 20th-century phenomenon. Given the independence movement and dawn of representative democracy, patronage from kings and zamindars dropped. Modern occupations became attractive for a stable source of income. During this period non-Brahmin performers declined considerably. This transition happened alongside the systematic campaign of vilification against Brahmins and the Hindu religion, including art forms involving the two, by EV Ramasamy and Dravida Kazhagam. Around the same time, popular cinema and music took off, and these were monetarily more rewarding. Given the dominant trend of the day - the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.commentary.org&#x2F;articles&#x2F;terry-teachout&#x2F;the-decline-of-the-audience&#x2F;&quot;&gt;devaluing of classical music&lt;&#x2F;a&gt; across the world - it is a suprise Carnatic music survived at all. That it did is because some Brahmins felt a cultural affinity towards it, and others could survive as full time musicians without having to depend on the music to make a living. There is no doubt that Music Academy had a significant role to play in its survival. Whatever the criticism about institutionalization of the arts, whether that of Bharatanatyam or Shastriya Sangeet, organization meant channeling of government funds, and the democratization of tools and spaces to appreciate it.&lt;&#x2F;p&gt;
&lt;p&gt;While this 20th century journey has made Carnatic music almost exclusively Hindu, it wasn&#x27;t entirely that in the preceding 100 years. Vedanayagam Shastri was a contemporary of Tyagraja and spent time in the Tanjaore Court. He composed a lot of songs, almost all religious in nature, a reflection of his &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?app=desktop&amp;amp;v=kVBdzctCigE&quot;&gt;Protestant&lt;&#x2F;a&gt;, Pietist faith. Abraham Pandithar traced the changing Carnatic music of his time and located its origins in the earliest Sangam poems. While Carnatic music can handle all expressions of faith&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-uarun-1&quot;&gt;&lt;a href=&quot;#fn-uarun&quot;&gt;3&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;, it&#x27;s Hindu variants cannot be divorced from &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;bhakti-decon&#x2F;&quot;&gt;Bhakti&lt;&#x2F;a&gt; (contra TMK).&lt;&#x2F;p&gt;
&lt;p&gt;So that&#x27;s where we are now: an art form was standardized. This happened as the world outside became non-Brahmin dominated culturally and politically. As it were, Brahmin identity and Carnatic music fused in India. At the same time, thanks to increasing indifference among non-Brahmins in general (as patrons of &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.jstor.org&#x2F;stable&#x2F;25501587&quot;&gt;temple music, Periya Melam&lt;&#x2F;a&gt;), non-Brahmins within the Carnatic music (nadasvaram vidwans, thavil vidwans etc) tradition came to depend economically and artistically on Brahmin patrons, a complete inverse of the relationship between the two at the start of the 20th century. As a result, music production, documentation and cultural history acquired a distinct Brahmin bias.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;why-announce-the-withdrawal-in-public&quot;&gt;Why announce the withdrawal in public?&lt;&#x2F;h2&gt;
&lt;p&gt;Why not wait for a response from the organizers? Artistes, public performers, are role models. What they say or do matters. If you rise up in life you have a moral duty to be an exemplar. You must set an example. By taking a public stance, they are only doing one of their duties as custodians of a tradition.&lt;&#x2F;p&gt;
&lt;p&gt;Related to this theme, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.newindianexpress.com&#x2F;cities&#x2F;bengaluru&#x2F;2024&#x2F;Mar&#x2F;23&#x2F;mss-doesnt-need-superficial-custodians-of-her-legacy-says-her-great-grandson&quot;&gt;MS Subbulakshmi&#x27;s great grandson&lt;&#x2F;a&gt; says &quot;..She[MSS] does not need spokespersons or superficial custodians of her legacy to use her name and score personal brownie points.&quot; I disagree. MSS was&#x2F;is a public figure of great import, and once you are a public figure you are going to be used to prop one position or the other. So when TMK uses her to make a point about Sabha culture, she will be used to make the opposite point. MSS&#x27;s progeny have as much say in the matter as anybody, but not more. Sticking with analogies, can the custodian of Nehru&#x27;s legacy be only Rahul Gandhi? Can only Gopalkrishna Gandhi talk about Gandhi or Rajaji? Carnatic music and its greats, like modern India, is a shared inheritance.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-has-ev-ramasamy-got-to-do-with-anything&quot;&gt;What has EV Ramasamy got to do with anything?&lt;&#x2F;h2&gt;
&lt;p&gt;I would argue it’s got everything to do with it! EV Ramasamy was a prickly rabble rouser who is central to the Dravidian project. The Dravidian movement invests in his figure everything that is good and modern - equality, self-respect, rejection of the gods, liberation of women. He could have been all that in his better moments, but for the last 50 years of his life he was a raging anti-Brahmin, and incidentally, an anti-semite. He compared the Brahmins to the Jews and wished to do to them what Hitler was doing in Germany. E.V. Ramasamy wrote this in his magazine Kudiyarasu on &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;thewire.in&#x2F;history&#x2F;periyar-ev-ramasamy-dravida-nadu-brahmins-dmk&quot;&gt;March 20, 1938&lt;&#x2F;a&gt;&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-2-1&quot;&gt;&lt;a href=&quot;#fn-2&quot;&gt;4&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;“The Jews are only interested in themselves, and nobody else. They somehow contrive to have the rulers in their pocket, participate in governance and conspire to torture and suck the lives out of other citizens in order that they live (in comfort). Are they not comparable to the Brahmins who too have no responsibility but have the rulers in their pocket, have entered the ruling dispensation and been lording over (all of us)?”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;This is also the position of the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;realitycheck.wordpress.com&#x2F;2022&#x2F;11&#x2F;25&#x2F;anti-brahmin-tropes-repeated-at-tk-seenivasan-event&#x2F;&quot;&gt;Dravidian movement in general&lt;&#x2F;a&gt;. CN Annadurai echoed those same talking points in 1950s, after the full extent of the horrors inflicted by the Nazis became clear&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-3-1&quot;&gt;&lt;a href=&quot;#fn-3&quot;&gt;5&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;. EV Ramasamy, through his career, has called for his fellow Tamils to kill Brahmins around them many times. Here’s &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=yE7JyBzFzT4&quot;&gt;one&lt;&#x2F;a&gt; instance, in Karaikudi in 1971, after the Dravida Kazhagam win over K. Kamaraj.&lt;&#x2F;p&gt;
&lt;div class=&quot;yv&quot;&gt;
    &lt;iframe src=&quot;https:&#x2F;&#x2F;www.youtube-nocookie.com&#x2F;embed&#x2F;kk1gmztXrXs&quot; title=&quot;Youtube&quot; class=&quot;yvi&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;&#x2F;iframe&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;His &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.deccanherald.com&#x2F;india&#x2F;dmk-spokesperson-supports-periyar-s-call-for-killing-brahmins-subramanian-swamy-moves-ec-1116752.html&quot;&gt;modern day supporters&lt;&#x2F;a&gt; know what they are talking about, and it&#x27;s not &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;realitycheck.wordpress.com&#x2F;2022&#x2F;12&#x2F;22&#x2F;corruption-is-downstream-of-social-justice-is-downstream-of-dravidian&#x2F;&quot;&gt;social justice&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Jawaharlal Nehru sent a letter to Kamaraj, the then CM of Madras State, calling EVR a &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;archive.org&#x2F;details&#x2F;HindSwaraj-Nehru-SW2-39&#x2F;page&#x2F;n433&#x2F;mode&#x2F;2up&quot;&gt;madman&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;nehru-kamaraj-letter-1.webp&quot; alt=&quot;Nehru on EVR 1&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;And again on Nov 5, 1957&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-dismithough-1&quot;&gt;&lt;a href=&quot;#fn-dismithough&quot;&gt;6&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;nehru-kamaraj-letter-on-evr-2.webp&quot; alt=&quot;Nehru on EVR 2&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;An year before this, EVR was arrested for burning pictures of Lord Rama on the Marina Beach&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-evrBS-1&quot;&gt;&lt;a href=&quot;#fn-evrBS&quot;&gt;7&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;. In the 1960s, he asked Tamils to start using caste names because it was getting harder to identify Brahmins, presumably to harass and intimidate.&lt;&#x2F;p&gt;
&lt;p&gt;EVR and Justice Party resolved that parts of South India should be a separate country and the ideology underlying this country, Dravida Nadu, was pure racism. North Indians are a alien race and Brahmins are intruders and possibly Jews. Later, when India attained independence EVR boycotted the day.&lt;&#x2F;p&gt;
&lt;p&gt;This anti-democratic&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-pakOnPeriyar-1&quot;&gt;&lt;a href=&quot;#fn-pakOnPeriyar&quot;&gt;8&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;realitycheck.wordpress.com&#x2F;2022&#x2F;09&#x2F;27&#x2F;recurring-theme-of-prostitutes-in-dravidian-ideological-source-material&#x2F;&quot;&gt;vulgar&lt;&#x2F;a&gt;, prejudiced man is who TMK &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=b5vJNf3l63s&quot;&gt;celebrates&lt;&#x2F;a&gt; as having taught Tamils to think. Let&#x27;s briefly note the condescension on display here. TMK seems to agree with EVR that two thousand years of Tamil literature and heritage are worthless. EVR called Silappadikaram, the great Tamil epic written by Ilango Adigal, an Aryan propaganda tool. He considered Thirukkural as “feces placed in a golden plate”. He thought the Tamils an unintelligible people for valuing Kamba Ramayanam and Silappadikaram. Even the other Tamil Nationalists have &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;youtu.be&#x2F;t4tSHN74Drg?t=3320&quot;&gt;wisened up&lt;&#x2F;a&gt; to the DK project (to be clear, I do not approve of ethno-nationalists of any kind).&lt;&#x2F;p&gt;
&lt;p&gt;The Justice Party and Dravidian Movement has always been about Non-Brahmin elites masquerading as subaltern. They took the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Mylapore_clique&quot;&gt;brief period&lt;&#x2F;a&gt; under the British colonialism where Brahmins ended up staffing most of the bureaucracy as a testament of a permanent Brahmin hegemony and projected it into the past. The &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;realitycheck.wordpress.com&#x2F;2023&#x2F;02&#x2F;04&#x2F;tn-finance-minister-palanivel-thiagarajan-reaches-out-to-the-spring-of-hate-for-support&#x2F;&quot;&gt;viciousness&lt;&#x2F;a&gt; of their &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;realitycheck.wordpress.com&#x2F;2023&#x2F;02&#x2F;02&#x2F;dravidian-tamil-accounts-spew-anti-brahmin-hate-on-nirmala-sitharaman-on-twitter-over-budget-2023&#x2F;&quot;&gt;discourse&lt;&#x2F;a&gt;, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;vedham.blogspot.com&#x2F;2022&#x2F;01&#x2F;hateful-cartoons-of-brahmanas-in-tamizh.html&quot;&gt;even now&lt;&#x2F;a&gt;, after the elimination of the Brahmins from TN politics, state bureaucracy, and education, yet daily &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.newindianexpress.com&#x2F;states&#x2F;tamil-nadu&#x2F;2021&#x2F;sep&#x2F;15&#x2F;300-caste-killings-in-tn-13-convictions-in-five-years-rti-data-2358885.html&quot;&gt;inter-caste violence&lt;&#x2F;a&gt;, ought to make any liberal to dig deep into their claims about &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;realitycheck.wordpress.com&#x2F;2021&#x2F;07&#x2F;15&#x2F;calls-to-violent-conflict-the-nazi-like-dravidian-hate-ideology-you-need-to-know-about&#x2F;&quot;&gt;social justice&lt;&#x2F;a&gt; and the false dichotomy of a monolithic non-Brahmin front versus the Brahmins.&lt;&#x2F;p&gt;
&lt;p&gt;RaGa are brave in taking their stance when they know it will bring upon them the ire of the entire political establishment. TM Krishna, quite rightly, is critical about BJP and Hindutva for its authoritarian tendencies and a politics that thrives on divisions. Dravida Kazhagam and the EVR are exactly the same, illiberal, authoritarian, and divisive, except their bogeyman happens to be Brahmins. His willful blindness in not just accommodating, but also pushing Dravida Kazhagam talking points, is hypocritical. Is it because unlike Hindutva folks, the Dravidians strut about as inclusive and progressive? Does North Korea calling itself a democratic people&#x27;s republic make it one?&lt;&#x2F;p&gt;
&lt;h2 id=&quot;okay-ignore-the-political-stuff-the-award-has-nothing-to-do-with-it-it-s-all-about-the-music&quot;&gt;Okay, ignore the political stuff, the award has nothing to do with it. It&#x27;s all about the music.&lt;&#x2F;h2&gt;
&lt;p&gt;Maybe so, but the citation does say &quot;...he has used music as a tool for social reform&quot; and &quot;..his championing of social causes&quot;. He refused to participate in the music season for 10 years, and now he is back, a little over one year after Stalin inaugurated the 2022 festival. &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;youtu.be&#x2F;Ef2svKcnIIo?t=1137&quot;&gt;TMK himself has said he believes everything is politics&lt;&#x2F;a&gt;. We will be charitable, and take N Murali at his word. &lt;strong&gt;Without a doubt TMK is richly deserving of this and many such awards.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The real question is how does one separate the art from the artist? TMK is capable of bringing the most aloof of his audiences, if they are even slightly sensitive to the arts, to a state of ecstasy. Despite all the peacocking and sanctimony, that&#x27;s valuable, surely? The highest value Steve Jobs had was beauty. He thought the best one can do for one&#x27;s fellow human being was to create something beautiful. He imbued everything he did with this attitude, always at exacting standards. His legacy is evident. He was also an ass to everyone around him and those who worked for him. Oscar Wilde is a revered figure now, an embodiment of wit. His &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;tertulia.com&#x2F;book&#x2F;the-importance-of-being-earnest-and-other-plays-oscar-wilde&#x2F;9780199535972&quot;&gt;Importance of Being Earnest&lt;&#x2F;a&gt; is a popular school play. He also slept with male prostitutes and teenage boys. Vairamuthu is an acclaimed poet, must admired by his peers. He is also a serial molester. Erza Pound was a Nazi&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-litFas-1&quot;&gt;&lt;a href=&quot;#fn-litFas&quot;&gt;9&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; sympathizer. The list of problematic artists is never ending - &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;forward.com&#x2F;culture&#x2F;523287&#x2F;every-antisemitic-thing-kanye-has-said-so-far&#x2F;&quot;&gt;Kanye West&lt;&#x2F;a&gt;, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.theguardian.com&#x2F;books&#x2F;2023&#x2F;mar&#x2F;18&#x2F;gauguins-child-wife-in-search-of-the-muse-that-inspired-a-masterpiece&quot;&gt;Paul Gaugin&lt;&#x2F;a&gt;, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.usatoday.com&#x2F;story&#x2F;life&#x2F;music&#x2F;2019&#x2F;01&#x2F;06&#x2F;drake-seen-kissing-fondling-17-year-old-girl-2010-concert-video&#x2F;2495634002&#x2F;&quot;&gt;Drake&lt;&#x2F;a&gt; to name just a few.&lt;&#x2F;p&gt;
&lt;p&gt;The answer to the question, I suppose, is up to the consumer of the image thus being constructed. The boundary of acceptable behaviour changes over time and culture&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-hypo-1&quot;&gt;&lt;a href=&quot;#fn-hypo&quot;&gt;10&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;. I cannot in good conscience be a patron of TM Krishna, but I can understand if others are.&lt;&#x2F;p&gt;
&lt;p&gt;The current DMK dispensation comes down heavily on anyone who &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.newindianexpress.com&#x2F;cities&#x2F;chennai&#x2F;2021&#x2F;oct&#x2F;17&#x2F;septuagenarian-youtuber-held-for-derogatory-remarks-on-periyar-2372373.html&quot;&gt;dares&lt;&#x2F;a&gt; to &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.deccanherald.com&#x2F;india&#x2F;youtuber-arrested-over-is-tamil-nadu-turning-into-kashmir-comment-1059268.html&quot;&gt;question&lt;&#x2F;a&gt; them or their heroes, sometimes under &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;thewire.in&#x2F;media&#x2F;tamil-nadu-badri-seshadri-cji-manipur-comments-arrest&quot;&gt;unrelated&lt;&#x2F;a&gt; charges. While I disagree with some of their words&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-gen-1&quot;&gt;&lt;a href=&quot;#fn-gen&quot;&gt;11&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;, right now I am firmly behind Ranjani Gayatri and hope they come out of this unscathed. Ranjani Gayatri have said what they hope to do with their art is unite people. Here&#x27;s to them succeeding beyond their wildest dreams.&lt;&#x2F;p&gt;
&lt;br&#x2F;&gt;
&lt;p style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;FOOTNOTES&lt;&#x2F;b&gt; &lt;&#x2F;p&gt;
&lt;footer class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-dravEng&quot;&gt;
&lt;p&gt;When there is a rare disagreement with the Dravidians, he doesn&#x27;t engage with the point at all! See this &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;twitter.com&#x2F;tmkrishna&#x2F;status&#x2F;1629197953020854272&quot;&gt;exchange&lt;&#x2F;a&gt; on twitter for instance. He talks about an &quot;opposing sociological position&quot; while glibly skipping over the normalized bigotry of labeling an entire caste &quot;parasitic&quot;. If the groups spoken about were different, say another jati, or religion, or the Palestinians, we know what his position would have been. &lt;a href=&quot;#fr-dravEng-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-tmkRead&quot;&gt;
&lt;p&gt;I mean he must be well-read right? To be a writer, you must first be a reader. Maybe he only reads to confirm things he has already made up his mind on, in which case he&#x27;s a very poor public intellectual indeed. Happens to the best of us. &lt;a href=&quot;#fr-tmkRead-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-uarun&quot;&gt;
&lt;p&gt;The brigading of &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;thewire.in&#x2F;communalism&#x2F;communal-campaign-threats-carnatic-music-artists-ramanathan-rsss&quot;&gt;OS Arun&lt;&#x2F;a&gt; is an especially shameful event for anyone who loves this music. &lt;a href=&quot;#fr-uarun-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-2&quot;&gt;
&lt;p&gt;Translated by PA Krishnan, from Naan Sonnal Unakku Yen Kopam Vara Vendum, vol. 4, p. 532, compiled by Pasu. Gowthaman. &lt;a href=&quot;#fr-2-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-3&quot;&gt;
&lt;p&gt;There are universities in Tamil Nadu named after these people. &lt;a href=&quot;#fr-3-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-dismithough&quot;&gt;
&lt;p&gt;EVR was tried by a &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;indiankanoon.org&#x2F;doc&#x2F;122642&#x2F;&quot;&gt;sessions judge and convicted&lt;&#x2F;a&gt;, but the state took no action. &lt;a href=&quot;#fr-dismithough-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-evrBS&quot;&gt;
&lt;p&gt;Best thing to happen to Tirupati is it ended up with the Telugus. Otherwise there would have been another garish statue of EVR in front of it, like in Srirangam. &lt;a href=&quot;#fr-evrBS-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-pakOnPeriyar&quot;&gt;
&lt;p&gt;Here&#x27;s &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;pakrishnan.com&#x2F;2018&#x2F;02&#x2F;19&#x2F;periyars-blinkers-made-him-see-only-the-brahmin-hegemon-none-else&#x2F;&quot;&gt;PA Krishnan&lt;&#x2F;a&gt; on EVR: &quot;When the Hindi agitation was in full swing in 1965 – the agitation that catapulted the Dravida Munnetra Kazhagam (DMK) to power – Periyar was fully supporting the government. He suggested that there should a general gag order and nobody should be allowed to speak about the agitation. To rub it in, he wanted the government to ban all newspapers. After the gruesome murders of Dalits in 1968, he recommended that all political parties, including the Communist parties, be banned except the Congress and the DMK!&quot; &lt;a href=&quot;#fr-pakOnPeriyar-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-litFas&quot;&gt;
&lt;p&gt;There is a long list of &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;lithub.com&#x2F;literary-fascists-of-the-1930s-great-and-small&#x2F;&quot;&gt;literary fascists&lt;&#x2F;a&gt;. &lt;a href=&quot;#fr-litFas-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-hypo&quot;&gt;
&lt;p&gt;I know it&#x27;s tempting to argue that what TMK is doing cannot be compared to sleeping with teenage boys. If you will excuse some whataboutery, by the same token, private prejudices in the Sabha in Madras cannot be equated to physical violence on lower castes in Gobichettipalayam. Except that it &lt;em&gt;is&lt;&#x2F;em&gt; - all the time - in the current discourse. See [here]. Nevertheless, the point being made is about deviance from &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Original_position&quot;&gt;social norms&lt;&#x2F;a&gt;, not the scale. &lt;a href=&quot;#fr-hypo-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-gen&quot;&gt;
&lt;p&gt;Genocide? EVR and DK are rude, uncivil bigots and define themselves via their anti-brahmanism, but they haven&#x27;t mass murdered any Brahmins. Larger scale violence is meted out daily to dalits by the middle castes. &lt;a href=&quot;#fr-gen-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;footer&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Web Notes: March 2024</title>
        <published>2024-03-25T00:00:00+00:00</published>
        <updated>2024-03-25T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/clips-march-24/"/>
        <id>https://asun9.com/clips-march-24/</id>
        
        <content type="html" xml:base="https://asun9.com/clips-march-24/">&lt;h3 id=&quot;review-the-price-of-time&quot;&gt;Review: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.lrb.co.uk&#x2F;the-paper&#x2F;v45&#x2F;n22&#x2F;jamie-martin&#x2F;kettle-of-vultures&quot;&gt;The Price of Time&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;I wanted to understand the changes that led to acceptance of interest in the West and in searching, came across this review of Edward Chancellor&#x27;s The Price of Time.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;The danger posed by interest necessitated controls, the most enduring of which was in Deuteronomy 23, which forbade the Israelite from charging interest to his ‘brother’, but permitted it with the ‘stranger’. This traditional distinction between relations of exchange with members of one’s own group, based on principles of reciprocity, and those with outsiders, where no such principle applied, was weakened wherever interest-bearing debt was widely used.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;While the church forbade interest, in practice people found a way around it by exploiting instruments such as exhange rates. This sanction on interest also led to animus against Jews, who could licitly demand interest from the Gentiles.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;The efforts of the medieval church to outlaw interest were mostly ineffective, as merchants and bankers simply redescribed the many fees they charged to borrowers in less offensive terms, often suggesting that the sum added to the amount borrowed was a ‘donation’ from borrower to lender. The Reformation transformed the theology of money, allowing ideas about interest to catch up to existing practices. Calvin attacked both pillars of medieval anti-usury reasoning: ancient Jewish law shouldn’t be binding on Christians, so long as lending at interest didn’t violate norms of charity, and Aristotle’s concept of the ‘barrenness’ of money was illogical.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;article-rob-henderson-on-reading&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.robkhenderson.com&#x2F;p&#x2F;how-i-read&quot;&gt;Rob Henderson on reading&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;I am always curious about other peoples reading strategies and this one was good, coming from a very productive auto-didact. Also useful links to the thoughts of other votaries of reading on the matter.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;You will not learn anything of lasting importance from TV, movies, podcasts…they’re junk food. Successful people converge on 3 ways to learn: lots of reading time, some exercises and projects, and conversations with people who are slightly ahead of them.”
&lt;strong&gt;Dwarkesh Patel&lt;&#x2F;strong&gt;: Okay. Let me ask a meta question. What do you think podcasts are for? What is happening?
&lt;strong&gt;Tyler Cowen&lt;&#x2F;strong&gt;: To anaesthetize people? To feel they&#x27;re learning something? To put them to sleep. So they can exercise and not feel like idiots. Occasionally to learn something. To keep themselves entertained while doing busy work of some kind.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;In our busy and distracted society, deep reading is increasingly rare. Deep reading changes people. When you interact with people, you can tell who reads seriously and who doesn’t. This isn’t just a matter of mental ability or intelligence. There is a difference between raw cognitive horsepower and time spent immersed in complex and intricate ideas. You can tell the difference between a smart person who reads and a smart person who doesn’t by how they express ideas, the references they make, and the chains of logic they follow. The former often demonstrates a subtle understanding that weaves together insights from various domains.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;obit-war-criminal-kissinger-is-dead&quot;&gt;Obit: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.rollingstone.com&#x2F;politics&#x2F;politics-news&#x2F;henry-kissinger-war-criminal-dead-1234804748&#x2F;&quot;&gt;War criminal Kissinger is dead&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Refreshing for it no holds barred honesty and dispensing away with the convention that one must not speak ill of the dead.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;In 1971, the Pakistani government waged a campaign of genocide to suppress the independence movement in what would become Bangladesh. Pakistan’s Yahya Khan, an architect of the genocide, was valuable to Nixon’s ambitions of restoring diplomatic relations with China. So the U.S. let Khan’s forces rape and murder at least 300,000 people and perhaps three &lt;em&gt;million&lt;&#x2F;em&gt;. “We can’t allow a friend of ours and China’s to get screwed in a conflict with a friend of India’s,” Nixon quoted Kissinger shrugging.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Nixon was not subtle about who he meant by the Eastern Establishment. When the media seized upon the U.S. massacre at My Lai, Nixon remarked, “It’s those dirty rotten Jews from New York who are behind it.” Nixon’s White House counsel, John Erlichman, recalled Nixon talking about “Jewish traitors” in front of Kissinger, including “Jews at Harvard.” Kissinger would assure the boss he was one of the good ones. “Well, Mr. President,” Erlichman quoted him responding, “there are Jews and &lt;em&gt;Jews&lt;&#x2F;em&gt;.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;It was this sort of unacceptable policy that prompted Kissinger to remark, during an intelligence meeting about two months before Allende’s election, “I don’t see why we need to stand idly by and watch a country go communist due to the irresponsibility of its own people.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;After Kissinger and the  CIA decided to overthrow Allende after the elections which he had won:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;He would be among the first of 3,200 Chileans to die violently under the 17-year regime of Augusto Pinochet and his &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Caravan_of_Death&quot;&gt;&lt;em&gt;Caravana de la Muerte&lt;&#x2F;em&gt;&lt;&#x2F;a&gt;, to say nothing of the tens of thousands tortured and imprisoned. “In the Eisenhower period, we would be heroes,” Kissinger &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;nsarchive2.gwu.edu&#x2F;NSAEBB&#x2F;NSAEBB123&#x2F;Box%2022,%20File%203,%20Telcon,%209-16-73%2011,50%20Mr.%20Kissinger-The%20Pres%202.pdf&quot;&gt;told Nixon&lt;&#x2F;a&gt; in a telephone conversation days after the coup, and &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;nsarchive2.gwu.edu&#x2F;NSAEBB&#x2F;NSAEBB123&#x2F;chile.htm&quot;&gt;the same week he denied at his Senate confirmation hearings&lt;&#x2F;a&gt; that the U.S. played any role in it.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;obit-goodbye-mom-and-thank-you&quot;&gt;Obit: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;christophermschroeder.substack.com&#x2F;p&#x2F;goodbye-mom-and-thank-you&quot;&gt;Goodbye, Mom. And thank you.&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;A loving tribute to a mother. All mothers, really. A reminder that the best thing you can do for your children is set high standard, be role models, and most of all, be there for them. Parenting matters.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;She was an incredible friend. My parents had a set of friends consistent for nearly half a century, and they formed and supported each other as the family they too became.
She treated everyone she met, regardless of who or what they were in title, exactly the same. The outpouring of stories this week of ways she touched people - in things large and small - have been astounding but not surprising to me.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;article-the-silences-of-eric-hobsbawm&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;salmagundi.skidmore.edu&#x2F;articles&#x2F;184-the-silences-of-eric-hobsbawm&quot;&gt;The Silences of Eric Hobsbawm&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Eric Hobsbawm was a historian and a Marxist. He was a very successful historian, and his books have been on my reading list for a while, since my time in India. All of his books are still in print. He also did not talk about a lot of things, which makes one wonder, how is he popular in the current zeitgeist, where identity and identity politics matter so much.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;America is an astonishing absence. Jefferson, Washington and Lincoln are curiously marginal. Kennedy and Reagan are referred to only four times each in  &lt;em&gt;Age of Extremes&lt;&#x2F;em&gt; (less often, for example, than Bukharin). The United States rarely receives the same amount of attention as Germany or the Soviet Union. “He neither narrates nor explains the century’s central story: American supremacy in politics, markets, and mass culture,” wrote Stephen Kotkin in &lt;em&gt;The New Yorker&lt;&#x2F;em&gt;. It may have been the American Century for some, but not for Hobsbawm.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;However, the notable areas of silence – about Jewishness and the crimes of Communism especially – are, ultimately, devastating. Can you trust a history of modern Europe which is seriously misleading about the French and Russian Revolutions, which barely touches on the Gulag, the Holocaust and the Cultural Revolution, which has so little to say about women and peasants, religion and nationalism, America and Africa?&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;article-the-academic-study-of-religion&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.firstthings.com&#x2F;article&#x2F;2000&#x2F;05&#x2F;the-very-idea-of-religion&quot;&gt;The academic study of religion&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Paul J Griffith&#x27;s essay from 2000 about the limits of religion as an academic category.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;“Religion” picks out a genus of which there are many species, and we all know what at least some of the species are: Judaism, Buddhism, Christianity, Islam, and so on. It is, in this formal respect, a term just like “currency,” a genus whose species include dollars, deutschmarks, pounds, and yen. But while there is fairly widespread agreement about what makes it reasonable to say that dollars and deutschmarks are species of the same genus (and about what genus they’re a species of), there is much less about what makes it reasonable to say that Islam and Buddhism are species of the same genus (and about what genus they’re a species of).&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;The historian of religion Jonathan Z. Smith puts the matter very clearly in an essay published in 1998: “‘Religion,’” he writes, “is not a native term; it is a term created by scholars for their intellectual purposes and therefore is theirs to define. It is a second“order generic concept that plays the same role in establishing a disciplinary horizon that a concept such as ‘language’ plays in linguistics or ‘culture’ plays in anthropology. There can be no disciplined study of religion without such a horizon.” Smith might have added, though he does not, that such a horizon is, as a matter of fact, entirely lacking.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;The book largely succeeds in both these purposes. The analysis of the work of the nineteenth“and twentieth“century founding fathers of  &lt;em&gt;Religionswissenschaft&lt;&#x2F;em&gt; (Max Mueller, P. D. Chantepie de la Saussaye, Gerardus Van der Leeuw, Joachim Wach, Mircea Eliade), though brief, is convincing in its claim that the understandings of religion developed by all of them were informed by theological premises and goals. Fitzgerald does not mean by this that each of them was thinking explicitly about religion as Parson Thwackum did; neither does he mean that they were all Christians (or Jews). He means, rather (and rightly), that they assumed, sometimes implicitly and sometimes explicitly, “that a transcendental ontology provided the universal reference point . . . for all those forms of life that could be categorized as religious.” Such an assumption, as Fitzgerald rightly says, is crypto“Christian, and thus at least implicitly theological. He doesn’t say, though I wish he had, that it is vastly less interesting and less theoretically productive than openly and fully Christian assumptions.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;article-the-rise-and-fall-of-adam-osborne&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;every.to&#x2F;the-crazy-ones&#x2F;the-rise-and-fall-of-steve-jobs-s-greatest-rival&quot;&gt;The rise and fall of Adam Osborne&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Adam Osborne was an early rival of Apple&#x27;s Steve Jobs. He was briefly a superstar before he crashed and burned in Silicon Valley. I was delighted to learn he was the son of Arthur Osborne, famous chronicler of Ramana Maharshi of Tiruvannamalai. Adam spent the first ten years of his life in India before spending the rest of his life fighting his upbringing.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Hey. It’s Steve Jobs,” the voice on the other end of the phone told the astonished young temp. “Is Adam there?” The young man stammered that Osborne was still out of town. Unsure what to do, he asked Jobs if he wanted to leave a message. Yeah,” Jobs replied. “Tell Adam he’s an arsehole.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;After losing it all, he makes his way back to Tamil Nadu to spend his last years.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;How could anyone, even an English boy, grow up in Tiruvannamalai, in the ashram of Sri Ramana Maharishi, and not acquire a pride in his roots?” Osborne wrote in an article for Indian computing magazine &lt;em&gt;Dataquest&lt;&#x2F;em&gt; at the time. In it, he acknowledged that he realized now what he had always been. Something he’d never known he was allowed to be: not English, not American, but Tamil.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;paper-hidden-technical-debt-in-machine-learning-systems&quot;&gt;Paper: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;proceedings.neurips.cc&#x2F;paper_files&#x2F;paper&#x2F;2015&#x2F;file&#x2F;86df7dcfd896fcaf2674f757a2463eba-Paper.pdf&quot;&gt;Hidden Technical Debt in Machine Learning Systems&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Or, ML engineering is absolutely critical, underserved, and I should go all in on it.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Machine learning offers a fantastically powerful toolkit for building useful com- plex prediction systems quickly. This paper argues it is dangerous to think of these quick wins as coming for free. Using the software engineering framework of technical debt, we find it is common to incur massive ongoing maintenance costs in real-world ML systems. We explore several ML-specific risk factors to account for in system design. These include boundary erosion, entanglement, hidden feedback loops, undeclared consumers, data dependencies, configuration issues, changes in the external world, and a variety of system-level anti-patterns.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Block web crawlers from ai firms</title>
        <published>2024-03-25T00:00:00+00:00</published>
        <updated>2024-03-25T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/ai-crawl-bots/"/>
        <id>https://asun9.com/notes/ai-crawl-bots/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/ai-crawl-bots/">&lt;p&gt;To block - in honesty, hint - crawlers from scraping your website for ai training data, update robots.txt.&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#151515;color:#e8e8d3;&quot;&gt;&lt;code&gt;&lt;span&gt;User-agent: CCBot
&lt;&#x2F;span&gt;&lt;span&gt;Disallow: &#x2F;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;User-agent: ChatGPT-User
&lt;&#x2F;span&gt;&lt;span&gt;Disallow: &#x2F;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;User-agent: GPTBot
&lt;&#x2F;span&gt;&lt;span&gt;Disallow: &#x2F;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;User-agent: Google-Extended
&lt;&#x2F;span&gt;&lt;span&gt;Disallow: &#x2F;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;User-agent: anthropic-ai
&lt;&#x2F;span&gt;&lt;span&gt;Disallow: &#x2F;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;User-agent: Omgilibot
&lt;&#x2F;span&gt;&lt;span&gt;Disallow: &#x2F;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;User-agent: Omgili
&lt;&#x2F;span&gt;&lt;span&gt;Disallow: &#x2F;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;User-agent: FacebookBot
&lt;&#x2F;span&gt;&lt;span&gt;Disallow: &#x2F;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;User-agent: Diffbot
&lt;&#x2F;span&gt;&lt;span&gt;Disallow: &#x2F;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;User-agent: Bytespider
&lt;&#x2F;span&gt;&lt;span&gt;Disallow: &#x2F;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;User-agent: ImagesiftBot 
&lt;&#x2F;span&gt;&lt;span&gt;Disallow: &#x2F;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;User-agent: cohere-ai
&lt;&#x2F;span&gt;&lt;span&gt;Disallow: &#x2F;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Got this very useful list from &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;neil-clarke.com&#x2F;block-the-bots-that-feed-ai-models-by-scraping-your-website&#x2F;&quot;&gt;Neil Clarke&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>To Meat Or Not</title>
        <published>2024-03-22T00:00:00+00:00</published>
        <updated>2024-03-22T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/being-vegetarian/"/>
        <id>https://asun9.com/notes/being-vegetarian/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/being-vegetarian/">&lt;p&gt;Sometime ago the question of my child eating meat came up with a few friends. I chose to stay silent then, as I usually do. Like &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;sive.rs&#x2F;slow&quot;&gt;Derek Sivers&lt;&#x2F;a&gt;, I am a slow thinker. I often do not know how to justify my stance till I write it down. Or for that matter even know what my position is unless I have chewed on it for a few days, in this case, months. This is an attempt at thinking through my attitudes towards vegetarianism.&lt;&#x2F;p&gt;
&lt;p&gt;If you would like a tl;dr version of what I am going to say, it is this: my position on this subject can be explained by three things - mater, ethical obligations, and ownership of cultural heirlooms.&lt;&#x2F;p&gt;
&lt;p&gt;I was born in a family that’s vegetarian. We never ate meat, and in school I don’t ever recall anyone bringing meat. As a child it never occurred me to question this state of affairs. During my early teens, as I rebelled against my family values, vegetarianism, God, and rituals were first to fall. I tasted meat for the first time in college. I didn’t like it. I tasted it a few times after that. One time, it was at Iftar at the end of Ramadan in Fraser Town, Bangalore. This was on Mosque Road, famous for its kababs. I only remember the rubbery feeling in my mouth now but I believe I could have eventually acquired the taste for it, as it has so been with alcohol. That’s not where I ended up though. An important reason was while the rejection of God and rituals did not bother my mother too much, eating the meat of animals most certainly would have. I did not want to cause her much pain. I was always very close to her, and I did not have it in me to push all her buttons. Was that a cop out? After all these years it’s hard for me to tell.&lt;&#x2F;p&gt;
&lt;p&gt;What did eventually happen was I started to think hard about ethical considerations. What moral obligations do I have towards other humans? Why should I not extend it to other species? I do not want to unnecessarily hurt others or visit undue violence upon them. Do animals feel pain? &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;sentientmedia.org&#x2F;do-lobsters-feel-pain&#x2F;&quot;&gt;Many&lt;&#x2F;a&gt; undoubtedly do. That conveniently ruled out meat. What about insects such as mosquitoes? As you can see, this soon becomes a slippery slope. A reasonable line seemed to me that my survival doesn&#x27;t depend on consuming meat, most of which today comes from &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.ciwf.org.uk&#x2F;factory-farming&#x2F;animal-cruelty&#x2F;&quot;&gt;factories&lt;&#x2F;a&gt; with animals in miserable conditions. This I decided was a foundational virtue and I had to stick with it. A commitment to something, anything, was worth pursuing, an anchor for the self in a meaningless world. So I told myself. I did not make any attempt to aggressively police my friends and evangelize this position. Everyone should workout for themselves the sort of life they want to lead. Also, why be more disagreeable than necessary?&lt;&#x2F;p&gt;
&lt;p&gt;Over the past few years, another reason for vegetarianism slowly emerged. It seemed to me that my family’s particular way of being was constantly under attack, in media, literature, pop culture, academia. The word Brahmanism has been made a shibboleth, a marker of the worst qualities a Hindu could possess, as something that liberal modernity must oppose. So being one or partaking in the old religion means one is a fascist, oppressor, a supporter of patriarchy and such. I found this highly objectionable, considering the examples I have before me - my parents, my mother in particular, and the women in my family in general. They are all devout Hindus, and engaged in rituals. They are also modern in their own way. My mother was a scientist  with ISRO. My aunt, a banker. Another aunt a lecturer of English literature. All very capably fused their modernity with ancient obligations. I have never heard them utter anything distasteful about other jatis or religions. They are engaged only in carrying out what they perceive as their religious obligations, many of which are tied to their subcaste. Why should this bother anyone at all? My mother provided for the education of all our maid’s children. I do not know what the maid’s caste is, and neither does my mother. My mother’s closest friend is a Muslim. I cannot reconcile her attitude and religious outlook with the aspersions cast on Tamil Brahmins in current zeitgeist - that they are close-minded, power hungry, hypocritical etc. Some no doubt are, but that accusation is also true for a large portion of mankind. As a matter of fact, central to modernity is the rejection of the idea that folks are responsible for the alleged crimes of their forebears.&lt;&#x2F;p&gt;
&lt;p&gt;I now felt obliged to defend the faith of my ancestors. It bothered me that I had been rejecting a way of life without deeply engaging with it, a way that I know many people have found meaning in. This chain of unbroken association with a particular cultural episteme, I did not want to end with me. Every generation negotiates their particular culture with modernity, or these days, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Postmodernity&quot;&gt;postmodernity&lt;&#x2F;a&gt;. My parents’ did, knowingly or not. I have to as well, without resorting to the default, which is abandoning it. Part of this process is a renewed commitment to vegetarianism, but also some way of accommodating the traditional rituals whilst in the busyness of the New World, far away from the homeland.&lt;&#x2F;p&gt;
&lt;p&gt;I think of vegetarianism, and associated cultural practices as heirlooms. My friend has a heirloom as well, her grandmother’s saree. She could have sold it, ignored it or given it away. She chose to keep it, but not wear it. It has been beautifully framed and occupies the pride of place in her hallway. Similarly, I have no intention of abandoning my heritage. I may modify it to suit my current circumstances, but I am going to keep it and pass it on to my children. The way to frame cultural values is by living them. At least a thousand years it has stood, and I feel a moral duty to practice it.&lt;&#x2F;p&gt;
&lt;p&gt;Children will eventually do as they like. I know I did. Parents can have a large impact on children&#x27;s outcomes however. Some of it is genetic. A large fraction is cultural osmosis. Belief in hard work, karma, duties towards the eminent dead, responsibilities for one&#x27;s actions, accepting differences and still having productive relationships, these are all values that can be taught. I must create an environment where the default behavior is living these values. Our ambitions and attitudes change with our social circle, whether it be friends, work places, or families. Old married couples become very much like each other in their actions and attitudes. Warren Buffet and Charlie Munger got to a point where one would grunt and the other would understand exactly what was being said. Children of musicians become musicians at a rate higher than those not from that background. The same can be observed of &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;marginalrevolution.com&#x2F;marginalrevolution&#x2F;2014&#x2F;02&#x2F;are-genetics-becoming-more-important-for-nba-success.html&quot;&gt;athletes&lt;&#x2F;a&gt;, actors, dancers, and &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;adamaltmejd.se&#x2F;assets&#x2F;papers&#x2F;Altmejd_Inheritance.pdf&quot;&gt;knowledge professionals&lt;&#x2F;a&gt;. We are the approximation of the people we surround ourselves with. What I can do is focus on creating a network for my kids composed of people with similar values to mine. Surround them with books. This is hard work, but one hopes for the best.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>529 Accounts</title>
        <published>2024-03-18T00:00:00+00:00</published>
        <updated>2024-03-18T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/529-faq/"/>
        <id>https://asun9.com/529-faq/</id>
        
        <content type="html" xml:base="https://asun9.com/529-faq/">&lt;h2 id=&quot;what-are-529-accounts&quot;&gt;What are 529 accounts?&lt;&#x2F;h2&gt;
&lt;p&gt;Savings account you can create for your children (or yourself) to be used for the purpose of education. Think of it as another index fund (if you choose to use the money you put in to track the S&amp;amp;P 500). The main advantage is money you contribute can grow tax-deferred. Every state offers at least one 529 plan. Many states in the USA even offer some sort of tax deductions for these accounts.&lt;&#x2F;p&gt;
&lt;p&gt;Examples:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Ohio offers $4000 per beneficiary each year.&lt;&#x2F;li&gt;
&lt;li&gt;South Carolina offers the full contribution as a deduction.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;California does not offer any type of 529 tax deduction, but &lt;strong&gt;the gains are tax-deferred, and qualified withdrawals are tax-free&lt;&#x2F;strong&gt;. You can also withdraw up to $10,000 without a tax penalty to pay for qualified expenses for grades K-12.&lt;&#x2F;p&gt;
&lt;p&gt;You can contribute a maximum of $18,000 each year. If you give more than $18,000 in cash or assets (for example, stocks, land, a new car) in a year to any one person, you&#x27;re supposed to file a gift tax return.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-s-the-penalty-if-i-use-if-for-non-education-purposes&quot;&gt;What&#x27;s the penalty if I use if for non-education purposes?&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;The earnings portion will be subject to ordinary income taxes and a 10% penalty.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;what-s-superfunding&quot;&gt;What&#x27;s superfunding?&lt;&#x2F;h2&gt;
&lt;p&gt;You can choose to front-load large contributions to a 529 plan without having to pay gift taxes. This is a maximum of $90,000 (in 2024) as a lump sum you can invest. It is treated as if it were spread over a five-year period.. For married couples filing taxes jointly, the maximum contribution is $180,000.&lt;&#x2F;p&gt;
&lt;p&gt;The advantage of superfunding is that the money can compound. As recorded on the wealthfront page:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;To pay for your child to attend UCLA, you could either save $720 over 18 years, for a total of $155,520. Or you could deposit $103,439 today — and let it grow over the next 18 years.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;investor.vanguard.com&#x2F;investor-resources-education&#x2F;news&#x2F;lump-sum-investing-versus-cost-averaging-which-is-better&quot;&gt;Research&lt;&#x2F;a&gt; from Vanguard suggests that if you’re deciding between investing a lump sum today or dollar cost averaging it into the market (where you invest a portion of the total sum on a regular schedule), lump-sum investing tends to yield a higher ending balance on average&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-are-the-tax-implications-of-superfunding-in-usa&quot;&gt;What are the tax implications of superfunding in USA?&lt;&#x2F;h2&gt;
&lt;p&gt;If superfunding, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.irs.gov&#x2F;pub&#x2F;irs-pdf&#x2F;f709.pdf&quot;&gt;report&lt;&#x2F;a&gt; to IRS and indicate it&#x27;s being spread over five years. This must be done for each of the five years.&lt;&#x2F;p&gt;
&lt;p&gt;Aside from the superfunding, gifting more than $18,000 to an individual in a calendar year means you must file a gift tax return, but it doesn’t necessarily mean you’ll pay gift taxes. In addition to the annual gift tax exclusion, there’s also a lifetime gift tax exemption. Anytime you give more than the annual gift tax limit in a single year, the excess contribution will count against your lifetime gift tax exemption.&lt;&#x2F;p&gt;
&lt;p&gt;The &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.irs.gov&#x2F;businesses&#x2F;small-businesses-self-employed&#x2F;whats-new-estate-and-gift-tax&quot;&gt;lifetime gift tax exemption&lt;&#x2F;a&gt; is $13.61 million in 2022 ($27.22 million for a married couple giving jointly). It’s been raised from $12.92 million for 2023.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;now-show-me-the-math&quot;&gt;Now show me the math&lt;&#x2F;h2&gt;
&lt;p&gt;Using the calculator &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.investor.gov&#x2F;financial-tools-calculators&#x2F;calculators&#x2F;compound-interest-calculator&quot;&gt;here&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Base case: starting with an initial investment of of $18,000, we are going to allow it to compound over the next 18 years. The interest rate is 5% compounding monthly. Every month, we will contribute $1500. This means for every year for the next 18 years, we will be infusing the fund with $18,000. At the end of 18 years, our compounded results will be $567,993.18. So that&#x27;s a total contribution of $324,000 over the next 18 years, for a return of approximately $243,000.&lt;&#x2F;p&gt;
&lt;p&gt;Regarding the interest rates chosen, I am using the S&amp;amp;P 500 returns as a frame of reference. For the 10 years ending December 31st 2023, S&amp;amp;P 500 had an annual compounded rate of return of 12.02%, including reinvestment of dividends. 5% is a conservative estimate, considering that &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;tradethatswing.com&#x2F;average-historical-stock-market-returns-for-sp-500-5-year-up-to-150-year-averages&#x2F;&quot;&gt;adjusted for inflation&lt;&#x2F;a&gt;, the 100-year average stock market return (including dividends) is 7.4%.&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style=&quot;text-align: left&quot;&gt;Initial Investment&lt;&#x2F;th&gt;&lt;th style=&quot;text-align: left&quot;&gt;Monthly Contribution&lt;&#x2F;th&gt;&lt;th style=&quot;text-align: left&quot;&gt;Length of time&lt;&#x2F;th&gt;&lt;th style=&quot;text-align: left&quot;&gt;Interest Rate&lt;&#x2F;th&gt;&lt;th style=&quot;text-align: left&quot;&gt;Compounded Results&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: left&quot;&gt;$18,000&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;$200&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;18&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;5%&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;$114,030.56&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: left&quot;&gt;$18,000&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;$1000&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;18&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;5%&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;$393,392.17&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: left&quot;&gt;$18,000&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;$1500&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;18&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;5%&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;$567,993.18&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: left&quot;&gt;$18,000&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;$1000&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;18&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;10%&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;$708,647.70&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: left&quot;&gt;$85,000&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;$0&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;18&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;5%&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;$208,675.72&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: left&quot;&gt;$85,000&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;$0&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;18&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;10%&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;$510,398.94&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: left&quot;&gt;$120,000&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;$0&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;18&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;5%&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: left&quot;&gt;$294,601.01&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;h2 id=&quot;which-provider-should-i-choose&quot;&gt;Which provider should I choose?&lt;&#x2F;h2&gt;
&lt;p&gt;As mentioned above, each state has at least one plan. As of this moment, Ohio comes highly recommended for two reasons:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Freedom to choose what to invest in.&lt;&#x2F;li&gt;
&lt;li&gt;Communication and transparency regarding the investments.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Wealthfront offers its 529 plan as well, with fees ranging from 0.42% to 0.46%.
The &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;investor.vanguard.com&#x2F;accounts-plans&#x2F;529-plans&#x2F;fees-costs&quot;&gt;Vanguard 529&lt;&#x2F;a&gt; has an expense ratio of 0.14% in comparison.&lt;&#x2F;p&gt;
&lt;p&gt;For 529 plans by states, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.savingforcollege.com&#x2F;529-plan-details&quot;&gt;visit this page&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;does-a-529-plan-impact-financial-aid-eligibility&quot;&gt;Does a 529 plan impact financial aid eligibility?&lt;&#x2F;h2&gt;
&lt;p&gt;Maybe. Parent owned 529 plan seem to reduce aid by up to 5.64%. See &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.savingforcollege.com&#x2F;article&#x2F;yes-your-529-plan-will-affect-financial-aid&quot;&gt;here for details&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;can-i-move-529-account-providers&quot;&gt;Can I move 529 account providers?&lt;&#x2F;h2&gt;
&lt;p&gt;Yeah.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;resources&quot;&gt;Resources&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;kindnessfp.com&#x2F;superfund-a-529-plan-what-you-should-know&#x2F;&quot;&gt;Superfunding a 529&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.irs.gov&#x2F;pub&#x2F;irs-news&#x2F;fs-09-12.pdf&quot;&gt;IRS 529 fact sheet&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Comments on 529 as a &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.financialsamurai.com&#x2F;a-529-plan-is-not-enough-to-pay-for-college&#x2F;&quot;&gt;great generational wealth transfer tool&lt;&#x2F;a&gt;, and how expensive colleges in USA is. One can&#x27;t go wrong in being aggresive with 529.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Miniconda + Virtual Envs</title>
        <published>2024-03-16T00:00:00+00:00</published>
        <updated>2024-03-16T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/conda/"/>
        <id>https://asun9.com/notes/conda/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/conda/">&lt;h2 id=&quot;creating-virtual-environment&quot;&gt;Creating virtual environment&lt;&#x2F;h2&gt;
&lt;p&gt;To create a virtual enviroment with conda:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;conda create -n venv pip&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;This will create a virtual env called &lt;code&gt;venv&lt;&#x2F;code&gt; and install &lt;code&gt;pip&lt;&#x2F;code&gt; in that env. It is reccommended that you install packages while creating the virtual env. So if you want to install torch and matplotlib, this is how your command will look like.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;conda create -n venv pip torch matplotlib&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;To install particular versions of packages:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;conda create -n venv scipy=0.17.3 astroid babel&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;To activate the virtual environment:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;conda activate venv&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;To deactivate the virtual env:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;conda deactivate&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The default python used for creating the virtual env is python 3.12 or whatever is the latest. To choose a specific python version:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;conda create -n venv399 python=3.9.9&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;You might want to specify the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;anaconda.org&#x2F;conda-forge&#x2F;python&quot;&gt;channel&lt;&#x2F;a&gt; in which this version is available for installation. So:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;conda create -n venv399 python=3.9.9 -c conda-forge&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;To make an exact copy of a virutal env&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;conda create --name venv-clone --clone venv&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;To list envs:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;conda info --envs&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;To see the packages installed in an active env:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;conda list&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;To connect jupyter notebook to conda env:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Go into the virtual env: &lt;code&gt;conda activate venv&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;conda install ipykernel&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;ipython kernel install --user --name=&amp;lt;any_name_for_kernel&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;jupyter notebook&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;install-miniconda&quot;&gt;Install miniconda&lt;&#x2F;h2&gt;
&lt;p&gt;From &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;docs.anaconda.com&#x2F;free&#x2F;miniconda&#x2F;&quot;&gt;here&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;mkdir -p ~&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;miniconda3
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span&gt; https:&#x2F;&#x2F;repo.anaconda.com&#x2F;miniconda&#x2F;Miniconda3-latest-MacOSX-arm64.sh&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt; -o ~&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;miniconda3&#x2F;miniconda.sh
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;bash ~&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;miniconda3&#x2F;miniconda.sh&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt; -b -u -p ~&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;miniconda3
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;rm -rf ~&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;miniconda3&#x2F;miniconda.sh
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Then run the following commands:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;~&#x2F;miniconda3&#x2F;bin&#x2F;conda&lt;&#x2F;span&gt;&lt;span&gt; init bash
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;~&#x2F;miniconda3&#x2F;bin&#x2F;conda&lt;&#x2F;span&gt;&lt;span&gt; init zsh
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Machine Learning Jargon</title>
        <published>2024-03-04T00:00:00+00:00</published>
        <updated>2024-03-04T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/ml-jargon/"/>
        <id>https://asun9.com/notes/ml-jargon/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/ml-jargon/">&lt;h1 id=&quot;conv2d&quot;&gt;Conv2D&lt;&#x2F;h1&gt;
&lt;p&gt;Convolution is a process in which two signals are intertwined. In image processing, it is used to blur or sharpen images, or enhance edges etc. The first layer in a CNN (a neural network = multiple layers of perceptrons) is always a convolution operation. A convolution converts all the pixels in its receptive field into a single value. For example, if you would apply a convolution to an image, you will be decreasing the image size as well as bringing all the information in the field together into a single pixel. The final output of the convolutional layer is a vector.&lt;&#x2F;p&gt;
&lt;p&gt;A filter or a kernel in a conv2D layer “slides” over the 2D input data, performing an elementwise multiplication. As a result, it will be summing up the results into a single output pixel. The kernel will perform the same operation for every location it slides over, transforming a 2D matrix of features into a different 2D matrix of features.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;weights-and-biases&quot;&gt;Weights and Biases&lt;&#x2F;h1&gt;
&lt;p&gt;Parameters of a model that need to be estimated by your learning algorithm. The weights are the w in the equation w*x+b, and the biases are the b in that equation.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;one-hot-encoding&quot;&gt;One Hot Encoding&lt;&#x2F;h1&gt;
&lt;p&gt;Using a vector of 0s, with a 1 in each location that is represented in the data, to encode a list of integers.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;activations&quot;&gt;Activations&lt;&#x2F;h1&gt;
&lt;p&gt;&lt;strong&gt;The output of an activation function&lt;&#x2F;strong&gt;. An activation function in a neural network defines how the weighted sum of the input is transformed into an output from a node or nodes in a layer of the network. Examples: ReLU, tanh, sigmoid for non linear functions. wx+b for linear.&lt;&#x2F;p&gt;
&lt;p&gt;All hidden layers typically use the same activation function. The output layer will typically use a different activation function from the hidden layers and is dependent upon the type of prediction required by the model.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;embedding&quot;&gt;Embedding&lt;&#x2F;h1&gt;
&lt;p&gt;Embeddings are representations of values or objects like text, images, and audio that are designed to be consumed by machine learning models and semantic search algorithms. Embeddings are vectors created by machine learning models for the purpose of capturing meaningful data about each object.&lt;&#x2F;p&gt;
&lt;p&gt;Via google&#x27;s ML &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;developers.google.com&#x2F;machine-learning&#x2F;crash-course&#x2F;embeddings&#x2F;video-lecture&quot;&gt;crash course&lt;&#x2F;a&gt;:
No separate training process needed -- the embedding layer is just a hidden layer with one unit per dimension
Supervised information (e.g. users watched the same two movies) tailors the learned embeddings for the desired task
Intuitively the hidden units discover how to organize the items in the d-dimensional space in a way to best optimize the final objective.&lt;&#x2F;p&gt;
&lt;p&gt;For NLP, embedding layer would take a word as an input, and produce an output vector of specified embedding_size. In a sense, it is very similar to Linear layer, but instead of taking one-hot encoded vector, it will be able to take a word number as an input. (&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;learn.microsoft.com&#x2F;en-us&#x2F;training&#x2F;modules&#x2F;intro-natural-language-processing-pytorch&#x2F;4-embeddings&quot;&gt;source&lt;&#x2F;a&gt;)&lt;&#x2F;p&gt;
&lt;p&gt;Great resource on &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;simonwillison.net&#x2F;2023&#x2F;Oct&#x2F;23&#x2F;embeddings&#x2F;&quot;&gt;embeddings&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Embeddings are based around one trick: take a piece of content—in this case a blog entry—and turn that piece of content into an array of floating point numbers. The key thing about that array is that it will always be the same length, no matter how long the content is.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;vickiboykis.com&#x2F;what_are_embeddings&#x2F;&quot;&gt;What are embeddings?&lt;&#x2F;a&gt; by Vicki Boykis&lt;&#x2F;p&gt;
&lt;p&gt;Famous embeddings: Word2Vec, CLIP (used subsequently in Flamingo LLM and others).&lt;&#x2F;p&gt;
&lt;p&gt;For a successful reccomendation system, these are the pipelines around embeddings:&lt;&#x2F;p&gt;
&lt;p&gt;• Generating embeddings
• Storing embeddings
• Embedding feature engineering and iteration
• Artifact retrieval
• updating embeddings
• versioning embeddings and data drift
• Inference and latency&lt;&#x2F;p&gt;
&lt;h1 id=&quot;token&quot;&gt;Token&lt;&#x2F;h1&gt;
&lt;p&gt;Given a character sequence and a defined document unit, tokenization is the task of chopping it up into pieces, called tokens, perhaps at the same time throwing away certain characters, such as punctuation.&lt;&#x2F;p&gt;
&lt;p&gt;A token is one element of a list created by the tokenization process. It could be a word, part of a word (a subword), or a single character.&lt;&#x2F;p&gt;
&lt;p&gt;A token is an instance of a sequence of characters in some particular document that are grouped together as a useful semantic unit for processing.&lt;&#x2F;p&gt;
&lt;p&gt;More &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;nlp.stanford.edu&#x2F;IR-book&#x2F;html&#x2F;htmledition&#x2F;tokenization-1.html&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;encoder&quot;&gt;Encoder&lt;&#x2F;h1&gt;
&lt;p&gt;The learned model not including the task-specific final layer(s). This term means much the same thing as “body” when applied to vision CNNs, but “encoder” tends to be more used for NLP and generative models.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;baseline&quot;&gt;Baseline&lt;&#x2F;h1&gt;
&lt;p&gt;A simple model that you are confident should perform reasonably well. It should be simple to implement and easy to test, so that you can then test each of your improved ideas and make sure they are always better than your baseline. Without starting with a sensible baseline, it is difficult to know whether your super-fancy models are any good.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;backbone&quot;&gt;Backbone&lt;&#x2F;h1&gt;
&lt;p&gt;The feature extractor layers of a neural network. Doesn&#x27;t seem to be a well defined term, and different papers use it differently.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;transfer-learning&quot;&gt;Transfer Learning&lt;&#x2F;h1&gt;
&lt;p&gt;Using a pretrained model for a task different from what it was originally trained for.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;fine-tuning&quot;&gt;Fine-tuning&lt;&#x2F;h1&gt;
&lt;p&gt;A transfer learning technique that updates the parameters of a pretrained model by training for additional epochs using a different task from that used for pretraining.&lt;&#x2F;p&gt;
&lt;p&gt;A convolutional neural network consists of many linear layers with a nonlinear activation function between each pair, followed by one or more final linear layers with an activation function such as softmax at the very end. The final linear layer uses a matrix with enough columns such that the output size is the same as the number of classes in our model (assuming that we are doing classification).&lt;&#x2F;p&gt;
&lt;p&gt;This final linear layer is unlikely to be of any use for us when we are fine-tuning in a transfer learning setting, because it is specifically designed to classify the categories in the original pretraining dataset. So when we do transfer learning, we remove it, throw it away, and replace it with a new linear layer with the correct number of outputs for our desired task.&lt;&#x2F;p&gt;
&lt;p&gt;For the new linear layer(s), we initialize with random weights. &lt;strong&gt;These are the only weights we must tune. All the previous layers must be frozen and not updated since they have been carefully tuned already.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;h1 id=&quot;maxpooling&quot;&gt;Maxpooling&lt;&#x2F;h1&gt;
&lt;p&gt;Max pooling is a downsampling technique commonly used in convolutional neural networks (CNNs) to reduce the spatial dimensions of an input volume. It is a form of non-linear down-sampling that serves to make the representation smaller and more manageable, and to reduce the number of parameters and computation in the network. Max pooling operates independently on each depth slice of the input and resizes it spatially.&lt;&#x2F;p&gt;
&lt;p&gt;Max pooling is performed on the convolutional layers of a CNN. It involves sliding a window (often called a filter or kernel) across the input data, similar to the convolution step, but instead of performing a matrix multiplication, &lt;strong&gt;max pooling takes the maximum value within the window.&lt;&#x2F;strong&gt; This maximum value becomes a single pixel in the new, pooled output.&lt;&#x2F;p&gt;
&lt;p&gt;Other pooling methods, such as average pooling and L2-norm pooling. Average pooling takes the average of all values in the pooling window, which can result in smoother pooled outputs. L2-norm pooling takes the square root of the sum of squares of the values in the window.&lt;&#x2F;p&gt;
&lt;p&gt;Reasons:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Feature Invariance: Max pooling helps the model to become invariant to the location and orientation of features. This means that the network can recognize an object in an image no matter where it is located.&lt;&#x2F;li&gt;
&lt;li&gt;Dimensionality Reduction: By downsampling the input, max pooling significantly reduces the number of parameters and computations in the network, thus speeding up the learning process and reducing the risk of overfitting.&lt;&#x2F;li&gt;
&lt;li&gt;Noise Suppression: Max pooling helps to suppress noise in the input data. By taking the maximum value within the window, it emphasizes the presence of strong features and diminishes the weaker ones.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Possible cons:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;It can sometimes be too aggressive, discarding potentially useful information that could be important for the classification task.&lt;&#x2F;li&gt;
&lt;li&gt;Max pooling is a fixed operation and does not learn from the data, unlike convolutional layers that have learnable parameters.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;relu-rectified-linear-activation-function&quot;&gt;ReLU, Rectified linear activation function&lt;&#x2F;h1&gt;
&lt;p&gt;A piecewise linear function that will output the input directly if it is positive, otherwise, it will output zero.&lt;&#x2F;p&gt;
&lt;p&gt;The rectified linear activation function overcomes the vanishing gradient problem, allowing models to learn faster and perform better.
The rectified linear activation is the default activation when developing multilayer Perceptron and convolutional neural networks.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;input &amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;	&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;input
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;else&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;	&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Or:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span&gt;g = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;max&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;, g)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The function is linear for values greater than zero, meaning it has a lot of the desirable properties of a linear activation function when training a neural network using backpropagation. Yet, it is a nonlinear function as negative values are always output as zero.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Because rectified linear units are nearly linear, they preserve many of the properties that make linear models easy to optimize with gradient-based methods. They also preserve many of the properties that make linear models generalize well.
— Page 175, Deep Learning, 2016.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h1 id=&quot;softmax&quot;&gt;Softmax&lt;&#x2F;h1&gt;
&lt;p&gt;In classification models, we use the softmax activation function in the final layer to ensure that the activations are all between 0 and 1, and that they sum to 1. softmax is the multi-category equivalent of sigmoid—we have to use it anytime we have more than two categories and the probabilities of the categories must add to 1, and we often use it even when there are just two categories, just to make things a bit more consistent.&lt;&#x2F;p&gt;
&lt;p&gt;There could be other functions that have the properties that all activations are between 0 and 1. However, no other function has the same relationship to the sigmoid function, which we have seen is smooth and symmetric.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# Softmax is also in torch.nn.functional
&lt;&#x2F;span&gt;&lt;span&gt;data = torch.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;randn&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;5&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;print&lt;&#x2F;span&gt;&lt;span&gt;(data)
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;print&lt;&#x2F;span&gt;&lt;span&gt;(F.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;softmax&lt;&#x2F;span&gt;&lt;span&gt;(data, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;dim&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;))
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;print&lt;&#x2F;span&gt;&lt;span&gt;(F.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;softmax&lt;&#x2F;span&gt;&lt;span&gt;(data, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;dim&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;).&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;sum&lt;&#x2F;span&gt;&lt;span&gt;())  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# Sums to 1 because it is a distribution!
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;print&lt;&#x2F;span&gt;&lt;span&gt;(F.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;log_softmax&lt;&#x2F;span&gt;&lt;span&gt;(data, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;dim&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;))  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# theres also log_softmax
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The output is:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;tensor&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span&gt; 1.3800, -1.3505,  0.3455,  0.5046,  1.8213&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;tensor&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span&gt;0.2948, 0.0192, 0.1048, 0.1228, 0.4584&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;tensor&lt;&#x2F;span&gt;&lt;span&gt;(1.)
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;tensor&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span&gt;-1.2214, -3.9519, -2.2560, -2.0969, -0.7801&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;]&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h1 id=&quot;cross-entropy-loss&quot;&gt;Cross Entropy Loss&lt;&#x2F;h1&gt;
&lt;p&gt;Use this for classification. Results in faster and more reliable training. Sofmax, then log liklihood of softmax = cross entropy loss.
“The gradient of cross_entropy(a,b) is softmax(a)-b. Since softmax(a) is the final activation of the model, that means that the gradient is proportional to the difference between the prediction and the target. This is the same as mean squared error in regression (assuming there’s no final activation function such as that added by y_range), since the gradient of (a-b)*&lt;em&gt;2 is 2&lt;&#x2F;em&gt;(a-b). Because the gradient is linear, we won’t see sudden jumps or exponential increases in gradients, which should lead to smoother training of models.”&lt;&#x2F;p&gt;
&lt;h1 id=&quot;bottleneck-layers&quot;&gt;Bottleneck layers&lt;&#x2F;h1&gt;
&lt;p&gt;The bottleneck in a neural network is just a layer with fewer neurons than the layer below or above it. Having such a layer encourages the network to compress feature representations (of salient features for the target variable) to best fit in the available space. Improvements to compression occur due to the goal of reducing the cost function, as for all weight updates.&lt;&#x2F;p&gt;
&lt;p&gt;A bottleneck architecture as the type found in the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;http:&#x2F;&#x2F;arxiv.org&#x2F;pdf&#x2F;1512.03385.pdf&quot;&gt;ResNet&lt;&#x2F;a&gt; paper where [two 3x3 conv layers] are replaced by [one 1x1 conv, one 3x3 conv, and another 1x1 conv layer].&lt;&#x2F;p&gt;
&lt;h1 id=&quot;transformer&quot;&gt;Transformer&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;http:&#x2F;&#x2F;jalammar.github.io&#x2F;illustrated-transformer&#x2F;&lt;&#x2F;li&gt;
&lt;li&gt;https:&#x2F;&#x2F;e2eml.school&#x2F;transformers.html&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;attention&quot;&gt;Attention&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;https:&#x2F;&#x2F;jalammar.github.io&#x2F;visualizing-neural-machine-translation-mechanics-of-seq2seq-models-with-attention&#x2F;&lt;&#x2F;li&gt;
&lt;li&gt;Or &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;machinelearningmastery.com&#x2F;the-attention-mechanism-from-scratch&#x2F;&quot;&gt;this&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Via &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;e2eml.school&#x2F;transformers.html#markov_chain&quot;&gt;this&lt;&#x2F;a&gt;:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;After masking the unhelpful features, the next word predictions become much stronger. When the word battery occurs earlier in the sentence, the word after ran is predicted to be down with a weight of 1 and please with a weight of 0. What was a weight difference of 25 percent has become a difference of infinity percent. There is no doubt what word comes next. The same strong prediction occurs for please when program occurs early on.
This process of selective masking is the attention called out in the title of the original paper on transformers.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h1 id=&quot;latent-space&quot;&gt;Latent Space&lt;&#x2F;h1&gt;
&lt;p&gt;A lower-dimensional, abstract representation of data that captures the underlying structure and variations in the original high-dimensional data space.
Generative model learns to map data points from the latent space back to the original space, effectively generating new data instances that resemble those in the training dataset.&lt;&#x2F;p&gt;
&lt;p&gt;The regular distribution of points in the latent space is the crucial property underlying the generative task. Suppose we are interested in generating, say, images of human faces. If we randomly generate an image, the probability of getting a face is practically null. In most cases, we would obtain noise. Instead, the generator learns how to transform any sample from the latent space into a face, mapping a known (so-called, prior) distribution into the actual distribution we are interested in.&lt;&#x2F;p&gt;
&lt;p&gt;Related to the concept of embeddings (see above).&lt;&#x2F;p&gt;
&lt;h1 id=&quot;variational-autoencoders&quot;&gt;Variational Autoencoders&lt;&#x2F;h1&gt;
&lt;p&gt;Fundamental to current generation of diffusion models to produce generative images, text, audio etc. Autoencoders are neural networks designed for &lt;strong&gt;unsupervised learning&lt;&#x2F;strong&gt; that aim to reconstruct their input data at the output. The networks are called the encoder and the decoder. The encoder network is trained to compress data into a simplified, or latent, format that captures key features. The decoder model is trained to reconstruct content from latent data.&lt;&#x2F;p&gt;
&lt;p&gt;An example of an autoencoder architecture using torch (using the MNIST data as input, which explains the input size):&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;torch.nn &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;as &lt;&#x2F;span&gt;&lt;span&gt;nn
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;class &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;AutoEncoder&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;nn.Module&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;__init__&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;super&lt;&#x2F;span&gt;&lt;span&gt;().&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;__init__&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;        
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# Set the number of hidden units
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.num_hidden = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;8
&lt;&#x2F;span&gt;&lt;span&gt;        
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# Define the encoder part of the autoencoder
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.encoder = nn.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;Sequential&lt;&#x2F;span&gt;&lt;span&gt;(
&lt;&#x2F;span&gt;&lt;span&gt;            nn.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;Linear&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;784&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;256&lt;&#x2F;span&gt;&lt;span&gt;),  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# input size: 784, output size: 256
&lt;&#x2F;span&gt;&lt;span&gt;            nn.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;ReLU&lt;&#x2F;span&gt;&lt;span&gt;(),  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# apply the ReLU activation function
&lt;&#x2F;span&gt;&lt;span&gt;            nn.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;Linear&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;256&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.num_hidden),  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# input size: 256, output size: num_hidden
&lt;&#x2F;span&gt;&lt;span&gt;            nn.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;ReLU&lt;&#x2F;span&gt;&lt;span&gt;(),  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# apply the ReLU activation function
&lt;&#x2F;span&gt;&lt;span&gt;        )
&lt;&#x2F;span&gt;&lt;span&gt;        
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# Define the decoder part of the autoencoder
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.decoder = nn.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;Sequential&lt;&#x2F;span&gt;&lt;span&gt;(
&lt;&#x2F;span&gt;&lt;span&gt;            nn.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;Linear&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.num_hidden, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;256&lt;&#x2F;span&gt;&lt;span&gt;),  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# input size: num_hidden, output size: 256
&lt;&#x2F;span&gt;&lt;span&gt;            nn.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;ReLU&lt;&#x2F;span&gt;&lt;span&gt;(),  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# apply the ReLU activation function
&lt;&#x2F;span&gt;&lt;span&gt;            nn.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;Linear&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;256&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;784&lt;&#x2F;span&gt;&lt;span&gt;),  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# input size: 256, output size: 784
&lt;&#x2F;span&gt;&lt;span&gt;            nn.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;Sigmoid&lt;&#x2F;span&gt;&lt;span&gt;(),  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# apply the sigmoid activation function to compress the output to a range of (0, 1)
&lt;&#x2F;span&gt;&lt;span&gt;        )
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;forward&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;x&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# Pass the input through the encoder
&lt;&#x2F;span&gt;&lt;span&gt;        encoded = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;encoder&lt;&#x2F;span&gt;&lt;span&gt;(x)
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# Pass the encoded representation through the decoder
&lt;&#x2F;span&gt;&lt;span&gt;        decoded = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;decoder&lt;&#x2F;span&gt;&lt;span&gt;(encoded)
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# Return both the encoded representation and the reconstructed output
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;encoded, decoded
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;1312.6114&quot;&gt;Variational Autoencoders&lt;&#x2F;a&gt; (VAEs hereon) extend the idea of traditional autoencoders by incorporating probabilistic modeling. Instead of learning a deterministic mapping from input to latent space, &lt;strong&gt;VAEs learn the parameters of a probability distribution in the latent space&lt;&#x2F;strong&gt;. By decoding the slightly modified compressed information, the VAE model outputs similar, but ultimately original, content.&lt;&#x2F;p&gt;
&lt;p&gt;VAEs are quick at generating outputs like images, but they can lack detail compared to some other models.&lt;&#x2F;p&gt;
&lt;p&gt;VAEs code available &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;medium.com&#x2F;@sofeikov&#x2F;implementing-variational-autoencoders-from-scratch-533782d8eb95&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;exploding-or-disappearing-activations&quot;&gt;Exploding or Disappearing Activations&lt;&#x2F;h1&gt;
&lt;p&gt;wrt RNNs or deep networks.
Because matrix multiplication is just multiplying numbers and adding them up, exactly the same thing happens with repeated matrix multiplications. And that&#x27;s all a deep neural network is —each extra layer is another matrix multiplication. This means that it is very easy for a deep neural network to end up with extremely large or extremely small numbers.
This inaccuracy means that often the gradients calculated for updating the weights end up as zero or infinity for deep networks. This is commonly referred to as the vanishing gradients or exploding gradients problem. It means that in SGD, the weights are either not updated at all or jump to infinity. Either way, they won&#x27;t improve with training.&lt;&#x2F;p&gt;
&lt;p&gt;For RNNs, there are two types of layers that are frequently used to avoid exploding activations: gated recurrent units (GRUs) and long short-term memory (LSTM) layers.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;dropout&quot;&gt;Dropout&lt;&#x2F;h1&gt;
&lt;p&gt;Dropout is a regularization technique that was introduced by Geoffrey Hinton et al. in Improving neural networks by preventing co-adaptation of feature detectors. The basic idea is to randomly change some activations to zero at training time. This makes sure all neurons actively work toward the output.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;unet&quot;&gt;UNet&lt;&#x2F;h1&gt;
&lt;p&gt;The architecture used in most diffusers.&lt;&#x2F;p&gt;
&lt;p&gt;Some of the highlights of the architecture are:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;this model predicts images of the same size as the input&lt;&#x2F;li&gt;
&lt;li&gt;the model makes the input image go through several blocks of ResNet layers which halves the image size by 2&lt;&#x2F;li&gt;
&lt;li&gt;then through the same number of blocks that upsample it again.&lt;&#x2F;li&gt;
&lt;li&gt;skip connections link features on the downsample path to corresponding layers in the upsample path.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h1 id=&quot;diffusers&quot;&gt;Diffusers&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;Details &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;huggingface.co&#x2F;docs&#x2F;diffusers&#x2F;stable_diffusion&quot;&gt;here&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;huggingface.co&#x2F;blog&#x2F;annotated-diffusion&quot;&gt;The annotated diffusion model&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;huggingface.co&#x2F;blog&#x2F;stable_diffusion&quot;&gt;Stable diffusion with diffusers library&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;A diffusion model is a neural network learns to gradually denoise data starting from pure noise.&lt;&#x2F;p&gt;
&lt;p&gt;The set-up consists of 2 processes:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;a fixed (or predefined) forward diffusion process &lt;code&gt;q&lt;&#x2F;code&gt;, that gradually adds Gaussian noise to an image, until you end up with pure noise&lt;&#x2F;li&gt;
&lt;li&gt;a learned reverse denoising diffusion process &lt;code&gt;pθ&lt;&#x2F;code&gt;, where a neural network is trained to gradually denoise an image starting from pure noise, until you end up with an actual image.
Both the forward and reverse process indexed by &lt;code&gt;t&lt;&#x2F;code&gt; happen for some number of finite time steps &lt;code&gt;T&lt;&#x2F;code&gt; (1000 in the case of the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2006.11239&quot;&gt;DDPM&lt;&#x2F;a&gt; paper)&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Generating new images from a diffusion model happens by reversing the diffusion process: we start from &lt;code&gt;T&lt;&#x2F;code&gt;, where we sample pure noise from a Gaussian distribution, and then use our neural network to gradually denoise it (using the conditional probability it has learned), until we end up at time step &lt;code&gt;t=0&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;For now, it seems that the main (perhaps only) disadvantage of diffusion models is that they require multiple forward passes to generate an image (which is not the case for generative models like GANs). However, there&#x27;s research going on that enables high-fidelity generation in as few as 10 denoising steps.&lt;&#x2F;p&gt;
&lt;p&gt;Training diffusion models = learning to denoise&lt;&#x2F;p&gt;
&lt;h1 id=&quot;latent-diffusion&quot;&gt;Latent Diffusion&lt;&#x2F;h1&gt;
&lt;p&gt;Introduced in this &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2112.10752&quot;&gt;paper&lt;&#x2F;a&gt;, the basis of Stable Diffusion. Introduces conditioning on text as input during the training process.
Latent diffusion can reduce the memory and compute complexity by applying the diffusion process over a lower dimensional latent space, instead of using the actual pixel space. This is the &lt;strong&gt;key difference between standard diffusion and latent diffusion models: in latent diffusion the model is trained to generate latent (compressed) representations of the images.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;There are three main components in latent diffusion.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;An autoencoder (VAE).
&lt;ol&gt;
&lt;li&gt;The VAE model has two parts, an encoder and a decoder. &lt;strong&gt;The encoder is used to convert the image into a low dimensional latent representation, which will serve as the input to the U-Net model&lt;&#x2F;strong&gt;. The decoder, conversely, transforms the latent representation back into an image.&lt;&#x2F;li&gt;
&lt;li&gt;During latent diffusion training, the encoder is used to get the latent representations (latents) of the images for the forward diffusion process, which applies more and more noise at each step. During inference, the denoised latents generated by the reverse diffusion process are converted back into images using the VAE decoder. As we will see during inference we only need the VAE decoder.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;A U-Net.
&lt;ol&gt;
&lt;li&gt;The U-Net has an encoder part and a decoder part both comprised of ResNet blocks. The encoder compresses an image representation into a lower resolution image representation and the decoder decodes the lower resolution image representation back to the original higher resolution image representation that is supposedly less noisy. More specifically, the U-Net output predicts the noise residual which can be used to compute the predicted denoised image representation.&lt;&#x2F;li&gt;
&lt;li&gt;To prevent the U-Net from losing important information while downsampling, short-cut connections are usually added between the downsampling ResNets of the encoder to the upsampling ResNets of the decoder. &lt;strong&gt;Additionally, the stable diffusion U-Net is able to condition its output on text-embeddings via cross-attention layers. The cross-attention layers are added to both the encoder and decoder part of the U-Net usually between ResNet blocks.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;A text-encoder, e.g. CLIP&#x27;s Text Encoder.
&lt;ol&gt;
&lt;li&gt;The text-encoder is responsible for transforming the input prompt, e.g. &quot;An astronaut riding a horse&quot; into an embedding space that can be understood by the U-Net. It is usually a simple transformer-based encoder that maps a sequence of input tokens to a sequence of latent text-embeddings.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Since latent diffusion operates on a low dimensional space, it greatly reduces the memory and compute requirements compared to pixel-space diffusion models. For example, the autoencoder used in Stable Diffusion has a reduction factor of 8. This means that an image of shape (3, 512, 512) becomes (3, 64, 64) in latent space, which requires 8 × 8 = 64 times less memory.&lt;&#x2F;p&gt;
&lt;p&gt;One can replace the UNet layer with Transformers instead: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2212.09748&quot;&gt;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2212.09748&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Division of labor&lt;&#x2F;strong&gt;
• Diffusion model -&amp;gt; Generate low resolution sketch
• AutoEncoder -&amp;gt; Fill out high resolution details&lt;&#x2F;p&gt;
&lt;p&gt;Detailed explaination of the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;lilianweng.github.io&#x2F;posts&#x2F;2021-07-11-diffusion-models&#x2F;&quot;&gt;math&lt;&#x2F;a&gt;.
Annotated code for &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;nn.labml.ai&#x2F;diffusion&#x2F;stable_diffusion&#x2F;model&#x2F;unet.html&quot;&gt;U-Net&lt;&#x2F;a&gt;
Jay Alammar has an &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;jalammar.github.io&#x2F;illustrated-stable-diffusion&#x2F;&quot;&gt;illustrated stable diffusion page&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;generative-pre-trained-transformers&quot;&gt;Generative Pre-Trained Transformers&lt;&#x2F;h1&gt;
&lt;p&gt;A type of neural network architecture based on the Transformer.
The tl;dr:&lt;&#x2F;p&gt;
&lt;p&gt;Generative: A GPT generates text.
Pre-trained: A GPT is trained on lots of text from books, the internet, etc ...
Transformer: A GPT is a decoder-only transformer neural network.&lt;&#x2F;p&gt;
&lt;p&gt;A GPT model pre-trained on enough data with enough parameters was capable of performing any arbitrary task by itself, no fine-tuning needed. Just prompt the model, perform autoregressive language modeling, and like voila, the model magically gives us an appropriate response. This is referred to as in-context learning, because the model is using just the context of the prompt to perform the task.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;resources&quot;&gt;Resources&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;http:&#x2F;&#x2F;karpathy.github.io&#x2F;2019&#x2F;04&#x2F;25&#x2F;recipe&#x2F;&quot;&gt;A recipe for training neural networks&lt;&#x2F;a&gt;. Get dumb baselines first, and start by setting up end-to-end evaluation skeletons
&lt;ul&gt;
&lt;li&gt;Overfit one batch.&lt;&#x2F;li&gt;
&lt;li&gt;Verify decreasing training loss.&lt;&#x2F;li&gt;
&lt;li&gt;For ConvNets a well-tuned SGD will almost always slightly outperform Adam, but the optimal learning rate region is much more narrow and problem-specific (Note: If you are using RNNs and related sequence models it is more common to use Adam. At the initial stage of your project, again, don’t be a hero and follow whatever the most related papers do.)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;http:&#x2F;&#x2F;karpathy.github.io&#x2F;2015&#x2F;05&#x2F;21&#x2F;rnn-effectiveness&#x2F;&quot;&gt;Unreasonable effectiveness of RNNs&lt;&#x2F;a&gt;
&lt;ul&gt;
&lt;li&gt;We are estimating an hidden state, and this hidden state depends on hidden states computed on earlier training samples (so everything that has come before).&lt;&#x2F;li&gt;
&lt;li&gt;Each layer in a RNN has as input the output activations of the previous layer, and the embeddings computed for the new char or word.&lt;&#x2F;li&gt;
&lt;li&gt;For example, for a three word sequence of inputs, in order to predict the fourth word, this is how a RNN would &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;fastai&#x2F;fastbook&#x2F;blob&#x2F;master&#x2F;12_nlp_dive.ipynb&quot;&gt;look&lt;&#x2F;a&gt;:
&lt;ul&gt;
&lt;li&gt;&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;class &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;LMModel1&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;Module&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;      &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;__init__&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;vocab_sz&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;n_hidden&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;          &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.i_h = nn.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;Embedding&lt;&#x2F;span&gt;&lt;span&gt;(vocab_sz, n_hidden)  
&lt;&#x2F;span&gt;&lt;span&gt;          &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.h_h = nn.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;Linear&lt;&#x2F;span&gt;&lt;span&gt;(n_hidden, n_hidden)     
&lt;&#x2F;span&gt;&lt;span&gt;          &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.h_o = nn.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;Linear&lt;&#x2F;span&gt;&lt;span&gt;(n_hidden,vocab_sz)
&lt;&#x2F;span&gt;&lt;span&gt;          
&lt;&#x2F;span&gt;&lt;span&gt;      &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;forward&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;x&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;          h = F.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;relu&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;h_h&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;i_h&lt;&#x2F;span&gt;&lt;span&gt;(x[:,&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;])))
&lt;&#x2F;span&gt;&lt;span&gt;          h = h + &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;i_h&lt;&#x2F;span&gt;&lt;span&gt;(x[:,&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;])
&lt;&#x2F;span&gt;&lt;span&gt;          h = F.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;relu&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;h_h&lt;&#x2F;span&gt;&lt;span&gt;(h))
&lt;&#x2F;span&gt;&lt;span&gt;          h = h + &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;i_h&lt;&#x2F;span&gt;&lt;span&gt;(x[:,&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;])
&lt;&#x2F;span&gt;&lt;span&gt;          h = F.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;relu&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;h_h&lt;&#x2F;span&gt;&lt;span&gt;(h))
&lt;&#x2F;span&gt;&lt;span&gt;          &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;h_o&lt;&#x2F;span&gt;&lt;span&gt;(h)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;explained.ai&#x2F;rnn&#x2F;index.html&quot;&gt;Explaining RNNs without neural networks&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;e2eml.school&#x2F;transformers.html#markov_chain&quot;&gt;Transformers from scratch&lt;&#x2F;a&gt;
&lt;ul&gt;
&lt;li&gt;More &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;peterbloem.nl&#x2F;blog&#x2F;transformers&quot;&gt;transformers from scratch&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;gist.github.com&#x2F;veekaybee&#x2F;be375ab33085102f9027853128dc5f0e&quot;&gt;The anti-hype llm reading list&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;gist.github.com&#x2F;rain-1&#x2F;eebd5e5eb2784feecf450324e3341c8d&quot;&gt;Another LLM reading list&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;jaykmody.com&#x2F;blog&#x2F;gpt-from-scratch&#x2F;&quot;&gt;GPT in 60 lines of numpy&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Bloomberg on Bloomberg</title>
        <published>2024-03-02T00:00:00+00:00</published>
        <updated>2024-03-02T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/bloomberg-on-bloomberg/"/>
        <id>https://asun9.com/bloomberg-on-bloomberg/</id>
        
        <content type="html" xml:base="https://asun9.com/bloomberg-on-bloomberg/">&lt;p&gt;Michael Bloomberg was the mayor of New York when I first heard of him. My sister, a doctor in Staten Island, didn&#x27;t like it when I asked about him on the ferry to Manhattan. He was, I understood, a very divisive figure. I didn&#x27;t dig very deep then. The second time I heard of him was in 2020, the time of the presidential elections. In a year where billionaires were very unpopular, he was taken to the cleaners both by mass media and the social corners of the internet. However, I thought it was to his credit that he spent his own money on the campaign and refused donations.&lt;&#x2F;p&gt;
&lt;p&gt;His biography has provided me with a more fuller picture of the man. I should note that the version I picked up was published in 2019, most certainly reissued keeping his campaign in mind. There&#x27;s a lot of policy discussion here and a few paragraphs about his effectiveness as a mayor. As all politicians are wont to do, the controversies of his term in office are passed over unremarked. This latter half of the book I couldn&#x27;t bring myself to care much. It&#x27;s 2024 now, and he is not contesting ever again. The first half is where I found useful lessons - in living, in building a career. Bloomberg after all lived a full life, coming from a working class Jewish background, making his way to Yale and Harvard, a storied career in Wall Street with the Salomon Brothers, and a second career as a entrepreneur. There is even a third, if you count his public office. His laurels as an entrepreneur rests on his Bloomberg Terminals, providing real time analytics to almost every trading firm on the planet, and the Bloomberg media empire.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;so-what-s-the-path&quot;&gt;So what&#x27;s the path?&lt;&#x2F;h2&gt;
&lt;p&gt;Bloomberg attributes his success to sheer hard work, working fourteen-hour days most of his life. He displays an awareness of his overwhelming ego, and is very unapologetic about it. After getting laid off Salomon Brothers, he started his own company because he couldn&#x27;t imagine working for anyone else, and Goldman Sachs did not immediately approach him with a job. It&#x27;s not all just bullheadedness. He&#x27;s strategic about the choices he makes. For example, you usually can&#x27;t make great, multi-generational fortunes on Wall Street. You get it by building.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;The Street promised vast riches—although few of the great fortunes have been made there. From John D. Rockefeller to Sam Walton to Bill Gates, great financial success comes from starting businesses with concrete products in the real world, building jobs, creating value, and helping people.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;When you are selling something, you must deliver value. Ask what your unique proposition is.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Why do some companies like Bloomberg, charging about $2,000 per month for electronically delivered information, keep growing when others can’t keep customers even when charging only pennies—or nothing at all? Simple: supply and demand. If you’re not providing something unique, you have no ability to impose charges. Most of what’s available electronically on one website is available on many others simultaneously. Most broadcast TV programs are just copies of earlier or other successful shows. No uniqueness: too much supply. Hence the success of original shows on on-demand services.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;If you are going to do anything at all, first write down your plans. Only when the pen hits the paper do you really know for certain if you thinking about this the right way.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;“Think logically and dispassionately about what you’d like to do. Work out all steps of the process—the entire what, when, where, why, and how. Then, sit down after you are absolutely positive you know it cold, and write it out. There’s an old saying, “If you can’t write it, you don’t know it.” Try it. The first paragraph invariably stops you short. “Now why did we want this particular thing?” you’ll find yourself asking. “Where did we think the resources would come from?” “And what makes us think others—the suppliers, the customers, the potential rivals—are going to cooperate?” On and on, you’ll find yourself asking the most basic questions you hadn’t focused on before taking pen to paper.
As you discover you don’t know it all, force yourself to address the things you forgot, ignored, underestimated, or glossed over. Write them out for a doubting stranger who doesn’t come with unquestioned confidence in the project’s utility—and who, unlike your spouse, parent, sibling, or child, doesn’t have a vested interest in keeping you happy. Make sure your written description follows, from beginning to end, in a logical, complete, doable path.
Then tear up the paper.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Yes, once you have done your due diligence, &lt;strong&gt;commit to the task and get to work&lt;&#x2F;strong&gt;. Real life will throw curve balls and all your plans will come to a nought. &lt;strong&gt;So you don&#x27;t want to waste time and effort worrying about an infinite number of down-the-road possibilities, most of which will never materialize.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Bloomberg&#x27;s influences seemed to be his parents and working class background, and what he learnt from the legendary Salomon Brothers CEOs, Billy Salomon and John Gutfreund. From his family, as a child, he learned to work hard, and to strive relentlessly for the goals he set. He had a great regard for Billy Salomon.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;“He was decisive and consistent as a leader. If he ever harbored doubts after making a decision, I never saw it. And although he was easily approachable and willing to listen to everyone’s views, when he said we were going left, we went left, and when he said right, right it was.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;“He set the rules and even he conformed to them. Was it a rule to conduct one’s personal affairs so as not to embarrass the firm? His own private life was exemplary. When he thought another’s wasn’t, we had an instantaneous partners’ meeting to remove the offender—no matter how important that person was to the immediate bottom line. Did he decree each of us should be accessible to all? Anyone could come up to his desk, anytime. He was on a first-name basis with as many people at the bottom of the corporate ladder as at the top.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;He liked John Gutfreund and considered him a good enough leader. What made him  ineffective was &quot;he listened to too many people.&quot;&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;“John consulted all interested parties before making a decision. No matter how noble the motive, that resulting apparent indecisiveness eventually destroyed his constituency and led to his downfall.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;This style of working clearly carried over into his endeavors. He could motivate the people around him.  The folks he started the company with are still there with him, over 30 years later. He co-wrote this autobiography with the editor-in-chief of Bloomberg News, who he poached from the Wall Street Journal. He too is an old Bloomberg hand.&lt;&#x2F;p&gt;
&lt;p&gt;Bloomberg acknowledges that one&#x27;s success is the result of everyone around them, from the sacrifices of the spouses, to their working partners and employees, to the parents. He doesn&#x27;t say as much, but he also had great luck to be where he was. He stuck with Salomon Brothers for fifteen years and started his firm only once he was fired. His payday from Salomon Brothers at that time, at 39 years old, was ten million dollars, half of which he invested in his new company. He only thought of the particular niche in which his company would first operate - real time analytics delivered via a custom terminal - because he his bosses asked him to digitize the records at Salomon Brothers. To his credit, he took the opportunities that came his way and ran with it.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;He never confused his product with the delivery mechanism.&lt;&#x2F;strong&gt; The analysis was the product, not the custom computers.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;“Executives at Eastman Kodak, for instance, thought they were in the camera and film business, instead of the photography business. The digital photography revolution passed them by, and after more than a century as one of the most innovative companies in the world, they filed for bankruptcy in 2012.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h2 id=&quot;self-belief-helps&quot;&gt;Self-belief helps&lt;&#x2F;h2&gt;
&lt;p&gt;His enormous ego - or to be charitable, let&#x27;s call it self-regard and sense of fair play - clearly helped his business. It allowed him to dare to replace the Federal Reserve Bank of New York as the authoritative, impartial source for US Treasuries (the Fed had delayed for years on its promise to automate the delivery of US government securities price list). When Dow Jones &amp;amp; Co, the Wall Street Journal&#x27;s owner, tried to enforce its monopoly on this information, he outcompeted them as a five year old start up. Before Bloomberg, the only real-time news organization in the United States for textual financial news was Dow Jones. There was only one news organization in Europe for following those markets in prose — Reuters. Both tried to put terminal on the desks of financial professionals and lost. He even got Matt Winkler of the Journal to build and run his Bloomberg News in the late 1980s. He forced his way into the Japanese business media scene, refusing to accept second fiddle status to local media. When he was advised not to send women while opening an office there, he sent two women to run the place (who were accepted and able to hire men to work under them).&lt;&#x2F;p&gt;
&lt;p&gt;Clearly this is a very driven man.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Happiness for me has always been the thrill of the unknown, trying something that everyone says can’t be done, feeling that gnawing pit in my stomach that says “Danger ahead.” Would it be nice not to have uncertainty, to sit back and “veg out”? When the phone rings constantly, when people keep demanding attention, when I desperately need time to myself, it seems an attractive notion just to “chuck it all.” But then nobody calls, nobody stops by, and soon I’m nibbling my nails and getting irritable, and I realize that’s not what I want. It sounds good. In reality though, I want action, I want challenge.&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Whatever his politics, these are words to live by.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;I’ve always loved my work and put in a lot of time, which has helped make me successful. I truly pity people who don’t like their jobs. They struggle at work, so unhappily, for ultimately so much less success, and thus develop even more reason to hate their occupations. There’s too much delightful stuff to do in this short lifetime not to love getting up on a weekday morning.&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Start with a small piece; fulfill one goal at a time, on time. Do it with all things in life. Sit down and learn to read one-syllable words. If you try to read Chaucer in elementary school, you’ll never accomplish anything. You can’t jump to the end game right away, in computers, politics, love, or any other aspect of life.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Larry H Miller&#x27;s American Dream</title>
        <published>2024-02-08T00:00:00+00:00</published>
        <updated>2024-02-08T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/larry-miller/"/>
        <id>https://asun9.com/larry-miller/</id>
        
        <content type="html" xml:base="https://asun9.com/larry-miller/">&lt;p&gt;Book: &lt;strong&gt;Driven: An Autobiography&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Larry H Miller&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Larry Miller is the sort of guy who is the very embodiment of Americana: little formal education, ability to work himself to death chasing the dollar, never takes no for an answer, and almost always succeeds. Even more, he&#x27;s a devoted member of that very American religion, the Latter-Day Saints. By the time of his death, he owned several theatre chains, was one of the largest car dealers in the United States, and was the owner of the Utah Jazz. His capacity for work, I am not sure it can be taught, especially examining the lives of other high agency folks - Sam Zemurray or Les Schwab, neither of whom had much of a formal education. There is a preternatural inner drive that some people seem to have. I wonder if their childhoods have anything to do with it. All three had tough early years. Larry Miller&#x27;s mother was abusive, and threw him out of the house without any explanation in high school. He did not know his birth father well into adulthood. He liked to spend more time outside than inside his house. His capacity for work is clearly a differentiator in his outsize success, that and the accumulation of small advantages such as riding the Japanese manufacturing wave or ensuring the incentives of your employees align with what you want out of your business.&lt;&#x2F;p&gt;
&lt;p&gt;One thing that can be taught is to care about your work the way these guys do - know everything about it, from the meanest task to highest. Larry started from the bottom, getting hold of car parts. So did Sam Zemurray, picking cast off bananas from the dock a kid. This pattern keeps repeating in these hagiographies: to care about something more than the next person means eventually seeing things others don&#x27;t. Larry’s network opened up because customers saw him as the person with answers and wanted to hire him. His reputation spread. Another compounding factor that eventually lead to banks opening up their purse strings from him when they wouldn’t have for anyone else. It helped that Miller was very resourceful - everything was a problem to be solved, and there were no unsolvable problems.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;“How did we do it? I get asked that often. Here is one of the main messages in this whole book: It is not fancy. It is as fundamental as blocking and tackling. I just did it. I just went to work every day and did everything that needed to be done.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Larry&#x27;s way of working was to micromanage everything, and old habit of his that helped him get off poverty and overcome his lack of education. One of his business maxims was &quot;You can’t do it if you’re not there.&quot; This became untenable as he grew big, and this was one thing he was unable to solve to his satisfaction: how to make the unavoidable bureaucracy that comes with growing a company work for him.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;“I missed the relationships and interactions and getting to know people. The relationships were important to me; they were very fulfilling and allowed people to get to know me and gain trust in me. That’s how I did business — through relationships. As we grew bigger, I lost some of that and missed it. “I micromanaged for years, and that was a great reason for my success. Eventually, I had to rely on others, and I didn’t like it because I knew no one would care about it like I do.&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;The book was ghost written. Larry died before it was finished. The last chapter is a conversation of the author with Larry’s wife Gail. She says something to this effect: “I am sad he is gone, but it’s not like he was there when he was alive.” Larry was not part of his children’s upbringing, except as a provider of food and shelter. He made sure that he would go to the church on Sundays, skipping important Jazz games, because he wanted to be seen by the world doing so. A role model, and good PR for the church. It worked, it got spoken about. I thought it was interesting that he didn’t apply the same lens to his parenting considering the best thing you could for children is modeling behavior you would like to see in them as adults. Larry Miller died a billionaire, not without regrets, but on the whole it was not a bad life. He had a positive impact on his community. He kept his marriage - already remarkable given this is the USA - and his children eventually came back to his fold. He died surrounded by family and friends, none bearing ill will. That&#x27;s one measure of a good life.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Revolt of the Public</title>
        <published>2024-02-01T00:00:00+00:00</published>
        <updated>2024-02-01T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/revolt-of-public/"/>
        <id>https://asun9.com/revolt-of-public/</id>
        
        <content type="html" xml:base="https://asun9.com/revolt-of-public/">&lt;p&gt;Book: &lt;strong&gt;Revolt of the Public&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Martin Gurri&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;No book predicted the present moment like this one did, when it was published in 2014. How did we get here, where there is general distate for liberal democracy widely across the world, and even more contempt for the elites and experts who our parents and those before them trusted?&lt;&#x2F;p&gt;
&lt;p&gt;This is Martin Gurri&#x27;s thesis: “An affluent, well-educated, hyper-connected public is in revolt against the system that has bestowed all of this bounty upon it. The great motive power of the revolt isn’t economic resentment but outrage over distance and failure. Everyday life is increasingly digital and networked. From dating to hailing a cab, most social and commercial transactions occur at the speed of light. This mode of life incessantly collides with the lumbering hierarchies we have inherited from the industrial age. Modern government, above all, is institutionally unable to grasp that it has lost its monopoly over political reality.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;The answer, in short, is the Internet. When information is scarce, as it was for most of human history, the structures that control the flow of information retain and exercise their power. This includes not just governments and governmental organizations, but also news institutions in the 20th century. Thus, the New York Times was a news paper of record, and only the internet could reveal how often they are wrong, and consistently at that. Same goes for Washington Post. By offering many alternating narratives chaining the same facts, they bleed legitimacy from these storied institutions. Similar afflictions ail democratic institutions. Politicians overstretch and overpromise what they can never fulfill. As long as the people are kept entertained and information flow curtailed, no one had to think about ever replacing it. That world no longer exists. So it is that Hillary Clinton’s email server, a story that could have been buried in another era, took most of the news space. No matter how hard the Times, Post, or Twitter tried to bury the story of Hunter Biden’s laptop, it refused to die and lives on, yet another representation of the elite’s control of the information they don’t like.&lt;&#x2F;p&gt;
&lt;p&gt;Growth in information has historically been slow and additive. It’s exponential now. This is new territory for human beings. This has made uncertainty a part of life. Once monopoly on information is lost, so is trust.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Every presidential statement, every CIA assessment, every investigative report by a great newspaper, suddenly acquired an arbitrary aspect, and seemed grounded in moral predilection rather than intellectual rigor. When proof for and against approaches infinity, a cloud of suspicion about cherry-picking data will hang over every authoritative judgment.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h2 id=&quot;authority-and-the-public&quot;&gt;Authority and the Public&lt;&#x2F;h2&gt;
&lt;p&gt;Gurri presents his thesis via one singular frame: that of authority versus the public. Authority is a source. We believe a report, obey a command, or accept a judgment because of the standing of the originator. These have always been institutions because institutions transcend generations. Individuals confer prestige to such institutions, but also vice versa. Thus Walter Cronkite made CBS news, but he is gone now and CBS is here in other forms. Authority is government office-holders, regulators, the bureaucracy, the military, the police, corporations, financial institutions, universities, mass media, politicians, the scientific research industry, think tanks and &quot;nongovernmental organizations,&quot; endowed foundations and other nonprofit organizations, the visual and performing arts business. Each of these institutions speaks as an authority in some domain.&lt;&#x2F;p&gt;
&lt;p&gt;Public is everything that’s not authority. It’s not just a fixed body of individuals, but different vital communities, organized on the internet over affairs of interest. The public, defined against authority, took shape in the early days of 21st century in the figure of the blogger. They speak when there should be silence, and utter what should never be said. They trample on the sanctities, in the judgment of the great hierarchical institutions which for a century and half have controlled, from the top down, authoritatively, the content of every public conversation. Thus we have Hossein Derakhshan, an American-Iranian blogger who was imprisoned in Iran from 2008 to 2014 because he became a nuisance to powers that be. We also have Steve McIntyre, who persistently made FOIA requests for datasets used in papers from Climate Research Institute, East Anglia. Emails exchanged show how tribal even the practitioners of the scientific method could get. Here’s Mann, head of CRU, when another peer-reviewed paper that did not toe the official line, was published in the magazine &lt;em&gt;Climate Research&lt;&#x2F;em&gt;:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;So what do we do about this? I think we have to stop considering Climate Research as a legitimate peer-reviewed journal. Perhaps we should encourage our colleagues in the climate research community to no longer submit to, or cite papers in, this journal.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Disgusted by the “crap science” in Climate Research, Tom Wigley, a senior figure at the National Center for Atmospheric Research, proposed going “direct to the publishers and point out the fact that their journal is being perceived as a medium for disseminating disinformation under the guise of refereed work.” This was revealed in 2009. We see similar attitude now, with COVID, its origins, vaccines and so on.&lt;&#x2F;p&gt;
&lt;p&gt;Gurri is far too humble to entirely credit the above framing when talking about the Green Revolution, or the Orange one in Ukraine, or the ones in Egypt, Tunisia and elsewhere. He understands that even the simplest human events constitute complex systems ruled by nonlinearities. As with all models of the world, his is just very useful.&lt;&#x2F;p&gt;
&lt;p&gt;It is important to note that the public is not the majority of people, it’s an amorphous something that aims for speak for them. Thus in Egypt, when 13 million people voted for Morsi in 2013, the people were spoken for. But there were protests and he had to step down. The public is not the crowd, it mediates the transformation of the crowd into a symbolic force. It can seize on a event, like demonstrations in Istanbul against the demolition of a park, then mobilize its organs of opinion on behalf of the demonstrators, in the process adding sentiment and meaning that may not have been present in the actual event. Used in this manner, the crowd becomes an instrument to communicate public opinion. The “Occupy” groups in the US, with tiny numbers on the street compared to Egypt’s protesters, still claimed to represent the “99 percent” against the predations of the elite.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;nihilism-all-the-way-down&quot;&gt;Nihilism all the way down&lt;&#x2F;h2&gt;
&lt;p&gt;So here we are: we know democratic governments are failing, when politicians speak, we do not believe them, when experts in a domain speak as authority, we most definitely do not trust them. This is a nihilist’s world. While our news papers of record and the governments are obsessed with social media and fake news, what they are really conveying to us is their lack of narrative control and disappearing legitimacy.&lt;&#x2F;p&gt;
&lt;p&gt;So what is to be done? Gurri has an addendum. But it’s a wish more than a concrete plan of action. He says, “When it comes to economic questions, politicians should be rewarded for the modesty of their claims rather than the heroic ambition of their rhetoric. Sitting presidents should be applauded for discarding the pose of papal infallibility, and speaking about uncertainty, risk, and trade-offs. The more people we elect to office who grasp the concept of trial and error, which means nothing more than learning from mistakes, the happier we should be.”&lt;&#x2F;p&gt;
&lt;p&gt;Do you imagine there ever will such a world? I don’t. The best thing a book can do for you is give you different ways of thinking about the world. By that standard, I have not read anything that explains the present moment as well as this one.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Time Complexity Cheatsheet</title>
        <published>2024-01-19T00:00:00+00:00</published>
        <updated>2024-01-19T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/complexity-algs/"/>
        <id>https://asun9.com/notes/complexity-algs/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/complexity-algs/">&lt;h2 id=&quot;graphs&quot;&gt;Graphs&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Djikstra&#x27;s algorithm
&lt;ul&gt;
&lt;li&gt;Time complexity: O(E+VlogV) when a Fibonacci heap is used, or O(E + ElogV) with binary heap. We use a heap&#x2F;priority queue to add and pop items with smallest weight, that&#x27;s logV.&lt;&#x2F;li&gt;
&lt;li&gt;Space compexity, O(V) to store the vertices.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Bellman Ford algorithm
&lt;ul&gt;
&lt;li&gt;Time Complexity: O(V.E). In the worst-case scenario, when all the vertices are connected with each other, we need to check every path from every vertex.&lt;&#x2F;li&gt;
&lt;li&gt;Space complexity: O(V). We use two arrays of length V. One to store the shortest distance from the source vertex using at most k-1 edges. The other is to store the shortest distance from the source vertex using at most k edges.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Never Split The Difference</title>
        <published>2023-12-26T00:00:00+00:00</published>
        <updated>2023-12-26T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/never-split-difference/"/>
        <id>https://asun9.com/never-split-difference/</id>
        
        <content type="html" xml:base="https://asun9.com/never-split-difference/">&lt;p&gt;Book: &lt;strong&gt;Never Split The Difference&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Chris Voss&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;This is really a book about listening and getting along with others despite disagreeing with them masquerading as a book about high powered negotiation. The core messaging reminded me of an anecdote attributed to Abe Lincoln, who when chastised by a lady for not calling Southerners irreconcilable enemies during the civil war, responded “Why, madam, do I not destroy my enemies when I make them my friends?” The first few chapters are devoted to strategies around effective listener. When you radiate warmth and acceptance, conversations flow. And during a negotiation, you want to keep the other party talking. So smile and display enthusiasm. Mirror what the other party is saying. Verbal combat is not going to persuade anyone, while showing empathy can make the other person amenable to your stance.&lt;&#x2F;p&gt;
&lt;p&gt;Do not force the other party to admit they are wrong. This is sometimes the side effect of the negotiation strategy that&#x27;s come out of Harvard, articulated in the book &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.amazon.com&#x2F;Getting-Yes-Negotiating-Agreement-Without&#x2F;dp&#x2F;0143118757&quot;&gt;&quot;Getting to yes&quot;&lt;&#x2F;a&gt;. More often than not, this angers the other side. One way to circumvent this is by getting the objections out of the way right at the beginning. Specifically, Chris Voss suggests that one say &quot;I want you to feel like you are being treated fairly at all times. So please stop me at any time if you feel I&#x27;m being unfair, and we&#x27;ll address it.&quot; Voss also disagrees with another aspect of &quot;Getting to yes&quot; - that of a win&#x2F;win negotiation. You do not ever have to settle for anything less than what&#x27;s most favourable to you. There&#x27;s no half-way point. Everything is negotiable. The world is more pliant than one would think.&lt;&#x2F;p&gt;
&lt;p&gt;You want to give your counterpart the illusion of control. When talking about specific demands, start with “what,” “how,” and sometimes “why.” “Who,” “when,” and “where” will often just get your counterpart to share a fact without thinking. When you are attacked in a negotiation, bite your tongue. Pause and avoid angry emotional reactions. Instead, ask your counterpart a calibrated question, one that starts with “what” and “how”. E.g: “How do you propose I do that?”.  Your job in a negotiation is not just to get to an agreement, but getting one that can be implemented. Never say “no” to a demand. A “How” question is a gentle and graceful way to say no and guide your counterpart to develop a better solution — your solution. A gentle How&#x2F;No invites collaboration and leaves your counterpart with a feeling of having been treated with respect.&lt;&#x2F;p&gt;
&lt;p&gt;Before you head into the weeds of bargaining, you&#x27;ll need a plan of extreme anchor, calibrated questions, and well-defined offers. Voss uses what he calls Ackerman plan. Raise stakes in specific percents: 65, 85, 95, 100 percent. Decreasing raises and ending on non-round numbers will get your counterpart to believe that he&#x27;s squeezing you for all you&#x27;re worth when you&#x27;re really getting to the number you want.&lt;&#x2F;p&gt;
&lt;p&gt;When you are getting into a negotiation, you must prepare. Know what’s at stake, who is on the other side, and who is really behind the person talking to you. Learn as much as you can. Work to understand the other side’s “religion.” Digging into worldviews inherently implies moving beyond the negotiating table and into the life, emotional and otherwise, of your counterpart. The more you know, the better you can play. This is probably the most non-counterintuitive of the strategies detailed in the book.&lt;&#x2F;p&gt;
&lt;p&gt;As with most books of this style, each tactic is reinforced with countless anecdotes. I do not have any hard reservations, and I am somewhat thrilled by the amorality of it. This would make a perfect double billing with Doris Kearns Goodwin’s &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.amazon.com&#x2F;Team-Rivals-Political-Abraham-Lincoln&#x2F;dp&#x2F;0743270754&quot;&gt;Team of Rivals&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>The Little One</title>
        <published>2023-12-21T00:00:00+00:00</published>
        <updated>2023-12-21T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/the-little-lady/"/>
        <id>https://asun9.com/the-little-lady/</id>
        
        <content type="html" xml:base="https://asun9.com/the-little-lady/">&lt;p&gt;There is this creature in the house. A guest that is here to stay. Mute so far, but oh god, so cute. She makes known her displeasures, of which there are many. Everything of interest is chewed on till she gets bored. Refuses to be contained in the barrier we have set up for her. No. She wants to be out, in the room, in the house. Surveying. Adventuring. Being where she shouldn&#x27;t be. Attracted to bright things. And dark. To corners. To drawers. To sockets. She wakes at 1 am and lets us know very loudly that she doesn&#x27;t like to be alone in her room. Allowing her to cry it out is a battle she makes sure we regret fighting. If she is pleased, she purrs - when she sees us in the morning, when she is placed on her back gently after a hug, after she’s had her meal.&lt;&#x2F;p&gt;
&lt;p&gt;We now find it hard to imagine the lives we had before the little one entered ours. She has taken over, dictating the terms of our existence. We complain about our middle of the night excursions. But this existence of ours, it seems it finally has meaning now, which is to be a humbled servant of our daughter. It’s easy to love and worship the little ones, being secure in front of them while performing monkey tricks.&lt;&#x2F;p&gt;
&lt;p&gt;I am beginning to understand why the &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;bhakti-decon&#x2F;&quot;&gt;Bhakti saints&lt;&#x2F;a&gt; worshipped the lord as a little child. When the object of devotion is a baby, one&#x27;s self gets out of the way far more quickly. Here is &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Periyalvar&quot;&gt;Periya Azhwar&lt;&#x2F;a&gt; singing about Krishna in the 9th century:&lt;&#x2F;p&gt;
&lt;div class=&quot;yv&quot;&gt;
    &lt;iframe src=&quot;https:&#x2F;&#x2F;www.youtube-nocookie.com&#x2F;embed&#x2F;HsC_yvzYLVo&quot; title=&quot;Youtube&quot; class=&quot;yvi&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;&#x2F;iframe&gt;
&lt;&#x2F;div&gt;
&lt;br&#x2F;&gt;
&lt;p&gt;There&#x27;s a very handy &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.projectmadurai.org&#x2F;pm_etexts&#x2F;utf8&#x2F;pmuni0621_eng.html&quot;&gt;translation&lt;&#x2F;a&gt; on Project Madurai, thanks to Dr. Kausalya Hart.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;ol start=&quot;23&quot;&gt;
&lt;li&gt;Come and see the lotus feet of the innocent child &lt;br &#x2F;&gt;
who was given to Yashoda by Devaki, his mother &lt;br &#x2F;&gt;
whose hair is decorated with beautiful garlands &lt;br &#x2F;&gt;
and is as sweet as the nectar that came out of the milky ocean. &lt;br &#x2F;&gt;
Come and see how he holds and puts his lotus foot &lt;br &#x2F;&gt;
in his coral-red mouth and tastes it. &lt;br &#x2F;&gt;
Come and see.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;blockquote&gt;
&lt;br&#x2F;&gt;
&lt;blockquote&gt;
&lt;ol start=&quot;24&quot;&gt;
&lt;li&gt;Come and see the ten perfect toes &lt;br &#x2F;&gt;
of the sapphire-colored child &lt;br &#x2F;&gt;
that look like an ornament studded &lt;br &#x2F;&gt;
with pearls, jewels, diamonds and pure gold. &lt;br &#x2F;&gt;
O girls with shining foreheads, &lt;br &#x2F;&gt;
come and see his perfect toes. Come and see his toes.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;blockquote&gt;
&lt;br&#x2F;&gt;
&lt;blockquote&gt;
&lt;ol start=&quot;64&quot;&gt;
&lt;li&gt;You, the highest one, the creator of the world &lt;br &#x2F;&gt;
swallowed it into your beautiful stomach &lt;br &#x2F;&gt;
rest gently on a banyan leave that floats on the ocean &lt;br &#x2F;&gt;
whenever the world ends and begins again. &lt;br &#x2F;&gt;
You have a body dark as kohl, &lt;br &#x2F;&gt;
your eyes are long and beautiful like lotus flowers &lt;br &#x2F;&gt;
and your ears are decorated with precious shining emeralds. &lt;br &#x2F;&gt;
O dear one, crawl gently. &lt;br &#x2F;&gt;
Do not shake Lakshmi, the goddess of wealth who stays on your chest. &lt;br &#x2F;&gt;
You should think of her safety. &lt;br &#x2F;&gt;
Shake your head and crawl for me once. &lt;br &#x2F;&gt;
You are a bull and you fight for the cowherds. Crawl, crawl.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Web Notes: December 2023</title>
        <published>2023-12-18T00:00:00+00:00</published>
        <updated>2023-12-18T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/clips-december-23/"/>
        <id>https://asun9.com/clips-december-23/</id>
        
        <content type="html" xml:base="https://asun9.com/clips-december-23/">&lt;h3 id=&quot;article-gandhi-and-liberal-modernity&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.theindiaforum.in&#x2F;essay&#x2F;gandhi-and-liberal-modernity-vexed-question-caste&quot;&gt;Gandhi and Liberal Modernity&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Great essay on Gandhi, which positions his stance on caste as not mere sentimentality or conservatism, but deeply thought response to liberal capitalism.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;We then considered whether allowing for the very notion of economy as an independent sector of human life that filled Gandhi with anxiety would offer an alternative and more ‘progressive’ way of addressing these social hierarchies of caste, as is on offer in the standard accounts of primitive accumulation owing to Marx? With the aid of a counterfactual, we concluded that Gandhi’s instincts were that quite apart from his normative recoil from these developments of capitalist modernity, these accounts were not theoretical accounts but local observations of an extended moment in one continent of the globe, inapplicable to large agrarian economies of the colonies of the south. Whatever we thought of his own normative stances, they anyway would not and could not, according to Gandhi, address the hierarchies of caste that defined Indian society.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;article-what-is-chatgpt-doing&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;writings.stephenwolfram.com&#x2F;2023&#x2F;02&#x2F;what-is-chatgpt-doing-and-why-does-it-work&#x2F;&quot;&gt;What is ChatGPT doing?&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;A good introduction to ChatGPT and how it does what it does. How can a next word predictor be so good at making sense?&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;From its training ChatGPT has effectively “pieced together” a certain (rather impressive) quantity of what amounts to semantic grammar. But its very success gives us a reason to think that it’s going to be feasible to construct something more complete in computational language form. And, unlike what we’ve so far figured out about the innards of ChatGPT, we can expect to design the computational language so that it’s readily understandable to humans.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;article-robert-gottlieb-s-obituary&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.newyorker.com&#x2F;magazine&#x2F;2023&#x2F;06&#x2F;26&#x2F;remembering-robert-gottlieb-editor-extraordinaire&quot;&gt;Robert Gottlieb&#x27;s Obituary&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Gottlieb, who died on Wednesday, at the age of ninety-two, may have been the most important book editor of his time. Caro was just one of hundreds of authors he ministered to. Gottlieb had passions––among them literature, ballet, music, and the movies––and those passions were reflected in his long list of authors, which included John Cheever, Joseph Heller, John le Carré, Doris Lessing, Jessica Mitford, Toni Morrison, V. S. Naipaul, and Salman Rushdie; Mikhail Baryshnikov, Natalia Makarova, and Lincoln Kirstein; Bob Dylan, John Lennon, and Paul Simon; Lauren Bacall, Sidney Poitier, Elia Kazan, Katharine Hepburn, and Irene Selznick.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;article-idols-and-what-they-mean-in-hinduism&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;renovatio.zaytuna.edu&#x2F;article&#x2F;images-of-the-unimaginable-god&quot;&gt;Idols and what they mean in Hinduism&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;blockquote&gt;
&lt;p&gt;the multiple Hindu worlds are shaped by an ongoing conversation over the coherence of the claim that the divine has form (rūpa); while many of these religious strands have highly visual cultures, many others are staunchly aniconic. Thus, Hindu worlds combine vividly sensuous iconographic representations of the deity with cautionary reminders not to conflate the signifier with the signified. Some Hindus may “see” traces of the divine in rivers (such as the Ganges), lakes, mountains, roadside trees, sacred groves, and sites of pilgrimage while being cautioned by others that these traces are penultimate pointers to, and do not exhaustively embody, the cognitively ungraspable reality.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;podcast-andy-matuschak-on-dwarakesh-patel-s-podcast&quot;&gt;Podcast: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.dwarkeshpatel.com&#x2F;p&#x2F;andy-matuschak#details&quot;&gt;Andy Matuschak on Dwarakesh Patel&#x27;s podcast&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Maybe this is a good time to talk about what memorization is or what it&#x27;s for. We could use that word to refer to the practice of learning more trivia. For instance, a thing that I and some people I know have done is, we’ve gone through a book called &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;http:&#x2F;&#x2F;book.bionumbers.org&#x2F;&quot;&gt;Cell Biology by the Numbers&lt;&#x2F;a&gt;, which says all of these things like, how big exactly is a nucleotide? Like how much volume does it take up? It&#x27;s kind of helpful occasionally to know that it&#x27;s about a nanoliter. And that can help you model things. So you can just commit all of those things to memory, right? That&#x27;s one kind of memorization. And we could talk about how LLMs affect that. But I just want to make the case that so much of what you do and experience day to day is memory bound, or is memory influenced in important ways. For instance, your ability to understand a difficult argument, even in the course of a text, is memory bound. Some of that&#x27;s working memory. But your ability to understand an argument that has many steps in it, more steps than you can keep in your working memory, depends on your ability to think of some of those steps in terms of some stuff that you already know, so that you can kind of reduce it or abstract it.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;article-understanding-bjp-s-rise&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;claremontreviewofbooks.com&#x2F;indias-uprising&#x2F;&quot;&gt;Understanding BJP&#x27;s rise&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;The author does a very good job charting the rise of the party currently in power in India, and is far more interested in the truth than what you would read in Washington Post or New York Times.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Because Hindu radicalism in the 20th century was the province of nostalgic Brahmins, many analysts have assumed the BJP was a party of upper-caste elites. We now know better. Of the 303 BJP members in the Parliament’s lower house now, 63% belong either to scheduled castes and tribes, or to the group of Other Backward Castes that includes Modi’s. As the political scientist Nalin Mehta has argued in his indispensable recent work, &lt;em&gt;The New BJP: Modi and the Making of the World’s Largest Political Party&lt;&#x2F;em&gt; (2022), this caste revolution is an undiscussed key to the BJP’s rise. The party can wage its campaign to unravel the special constitutional rights of Muslims only because it has the backing of voters who want the social revolution it is waging on behalf of Hindus of lower caste.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;The problem of respecting the decisions of majorities while defending the rights of minorities is an anthropological one, not a moral one. We like to pretend that, when it comes to balancing majority and minority interests, there is a knowable “right thing to do.” Often there isn’t. We also like to pretend that protecting minorities always means protecting them against abuse and persecution by majorities. Sometimes it does. But just as often it means claiming prerogatives for minorities against the innocent preferences of democratic majorities. &lt;strong&gt;When progressive change is about protecting minorities from majorities, it can become not just undemocratic but anti-democratic.&lt;&#x2F;strong&gt; It may be &lt;em&gt;for&lt;&#x2F;em&gt; the people, but it will not be &lt;em&gt;of&lt;&#x2F;em&gt; the people or &lt;em&gt;by&lt;&#x2F;em&gt; the people. Eventually it draws the people directly into the political fight, to unpredictable effect.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;article-morgan-housel-s-reading-strategy&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;collabfund.com&#x2F;blog&#x2F;how-to-read-lots-of-inputs-and-a-strong-filter&#x2F;&quot;&gt;Morgan Housel&#x27;s Reading Strategy&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Every smart person I know is a voracious reader who also says “every smart person I know is a voracious reader.” There are so few exceptions to this rule it’s astounding. College tuition at $25,000 a year comes out to roughly $100 per lecture. Good books – sometimes written by the same professor – can be purchased for fifteen bucks and can offer multiple times as much life-changing insight.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;The conflict between these two – most books don’t need to be read to the end, but some books can change your life – means you need two things to get a lot out of reading: &lt;strong&gt;Lots of inputs and a strong filter&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;It should be ruthless, taking no prisoners and offering no mercy. Similar to dating, a book you’re not into after 10 minutes of attention has little chance of a happy ending. Slam it shut and move on. You’re not a failure if you quit a book after three pages anymore than if you reject the proposition of a 10-hour date with someone you just met who annoys you. Lots of fish in the sea.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;article-venkatesh-rao-on-the-resourceful-life&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.ribbonfarm.com&#x2F;2023&#x2F;07&#x2F;06&#x2F;the-resourceful-life&#x2F;&quot;&gt;Venkatesh Rao on The Resourceful Life&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;blockquote&gt;
&lt;p&gt;What interests me a lot more is people who are relentlessly resourceful in the larger game of ordinary life, outside of hero’s journeys. People for whom resourcefulness is not just a way of life but the very definition of it, with anything short of an &lt;em&gt;of-course-it’s-worth-it&lt;&#x2F;em&gt; attitude being some degree of deadness. &lt;strong&gt;As the world gets ever-more complex, it’s the resourceful who increasingly inherit the future. Anyone who wonders too long whether life is worth living is increasingly likely to conclude that it is not due to the sheer difficulty of thinking about the question honestly. Only those who don’t bother to ask the question will ever choose life at all.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;blog-the-dangers-of-high-status-low-wage-jobs&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;economistwritingeveryday.com&#x2F;2022&#x2F;02&#x2F;07&#x2F;the-dangers-of-high-status-low-wage-jobs&#x2F;&quot;&gt;The dangers of high status, low wage jobs&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Really, an essay on journalism as a career.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Makowsky’s law of career planning: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;economistwritingeveryday.com&#x2F;2021&#x2F;07&#x2F;12&#x2F;its-a-trap&#x2F;&quot;&gt;never bet your entire future&lt;&#x2F;a&gt; on doing something &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;economistwritingeveryday.com&#x2F;2021&#x2F;03&#x2F;01&#x2F;dolly-parton-and-the-danger-of-doing-what-you-love&#x2F;&quot;&gt;other people will happily do for free.&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;review-biography-of-ian-fleming&quot;&gt;Review: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;literaryreview.co.uk&#x2F;becoming-james-bond&quot;&gt;Biography of Ian Fleming&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;So well written.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Anthony Powell, two and a half years older than Ian Fleming, remembered him as ‘one of the few persons I have met to announce that he was going to make a lot of money out of writing novels, and actually contrive to do so’. Fleming and his older brother, Peter, turn up in &lt;em&gt;Faces in My Time&lt;&#x2F;em&gt; (1980), the third volume of Powell’s memoirs, in connection with the short-lived 1930s magazine &lt;em&gt;Night and Day&lt;&#x2F;em&gt;, with Peter filing editorial notes and Ian raising money for the magazine in the City. Coming across a bound volume half a century later, Powell was immediately struck by what he called the ‘Fleming impact’. One of the signature marks of Nicholas Shakespeare’s new biography is its terrific sense of clannishness. Rarely has there been a collective unit whose members looked out for, supported, interfered with and privately disparaged each other with such unrelenting tenacity.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;review-skewering-a-new-aurangazeb-biography&quot;&gt;Review: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;pragyata.com&#x2F;on-audrey-truschkes-aurangzeb-the-life-and-legacy-of-indias-most-controversial-king&#x2F;&quot;&gt;Skewering a new Aurangazeb biography&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Yes, that infamous one by a very online academic.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Bridging the chasm between the historical Aurangzeb and this reimagined (and largely imaginary) Aurangzeb is a daunting task, but Truschke makes her case with the chirpy enthusiasm of an Aurangzeb fangirl writing a puff piece in People magazine on her idol. The received historiography on Aurangzeb is riddled with outlandish hoaxes that have gone unchallenged for decades. Truschke’s book is a worthy addition to this genre since it refreshes our memories of these hoaxes while enthusiastically manufacturing new ones.&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;In short, the M.A. describes the destruction of the Mathura temple as a wonderful and difficult accomplishment, and says that the Hindu rajahs were humiliated, the idols of the Hindu gods were buried under the steps of a mosque for Muslims to step on, and a grand mosque was built at great expense over the ruins of the great Mathura temple. Truschke gives you a mistranslation of a small fragment of this passage, and assures you that the passage suggests temple destructions under Aurangzeb were “rare” and “unusual.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;article-you-can-t-fact-check-propaganda&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;hedgehogreview.com&#x2F;web-features&#x2F;thr&#x2F;posts&#x2F;you-cant-fact-check-propaganda&quot;&gt;You can&#x27;t fact check propaganda&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;I learnt a few things here, such as the best propaganda, in the words of it&#x27;s expert practitioners and theoreticians, includes more truth than falsehood.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;On the contrary, at least since World War II, the most effective propagandists have insisted that propaganda should tell the truth. In his &lt;em&gt;Propaganda: The Formation of Men’s Attitudes&lt;&#x2F;em&gt;, French sociologist Jacques Ellul observed that propagandists on either side of World War II were as truthful as they could be. The manual for the American and British expeditionary forces warned that “when the listener catches you in a lie, your power diminishes.… For this reason, never tell a lie which can be discovered.” Joseph Goebbels, Ellul found, “never stopped battling for propaganda to be as accurate as possible.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Facts are just what you see—look! But facts are rarely just that. Rather, they come in the form of statements, which are not bare observations but descriptions of some state of affairs. In other words, there are no “pure” facts available, as Karl Popper pointed out. All descriptions entail selections, implicit theorizing, and are attended by subjective factors such as interests, expectations, and wishes.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>System Design Building Blocks</title>
        <published>2023-12-08T00:00:00+00:00</published>
        <updated>2025-08-31T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/sys-design/"/>
        <id>https://asun9.com/notes/sys-design/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/sys-design/">&lt;h2 id=&quot;non-functional-requirements&quot;&gt;Non-functional Requirements&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;CAP&lt;&#x2F;strong&gt;: When a network partition occurs, do you choose availability or consistency?
&lt;ul&gt;
&lt;li&gt;Consistency prioritizing systems: Ticket booking (prevent double booking), e-commerce inventory (avoid overselling), financial systems, ride matching, online auctions.&lt;&#x2F;li&gt;
&lt;li&gt;Availability prioritizing systems: content platforms (netflix, yelp, instagram), whatsapp (messages eventually consistent), google docs (eventually consistent), distributed cache.&lt;&#x2F;li&gt;
&lt;li&gt;Different features within the same system may have different consistency needs.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Scalability&lt;&#x2F;strong&gt;
&lt;ul&gt;
&lt;li&gt;Evaluate the read vs. write ratio. Is it a read-heavy system (like Instagram feeds, YouTube streaming) or a write-heavy system (like Uber&#x27;s location tracking, ad click aggregation, write-optimized databases like Cassandra)?&lt;&#x2F;li&gt;
&lt;li&gt;Consider unique scaling requirements, such as bursty traffic (e.g., holiday sales, breaking news events).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Latency&lt;&#x2F;strong&gt;: How quickly does the system need to respond to user requests, especially for computationally intensive operations?
&lt;ul&gt;
&lt;li&gt;Instagram: Feed load times &amp;lt; 500ms, instant photo&#x2F;video rendering. Distributed Job Scheduler: Execute jobs within 2s of scheduled time. Robinhood: Low latency for price updates and order placement (under 200ms).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Fault Tolerance&lt;&#x2F;strong&gt;: How well does the system need to handle failures (e.g., redundancy, failover, recovery mechanisms)?
&lt;ul&gt;
&lt;li&gt;Payment System: Guarantee durability and auditability, no transaction data lost. Web Crawler: Resume crawling without losing progress.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Environment Constraints&lt;&#x2F;strong&gt;: Are there limitations like mobile devices with limited battery&#x2F;memory&#x2F;bandwidth (e.g., streaming video on 3G)?&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Security&lt;&#x2F;strong&gt;: How secure does the system need to be? Consider data protection, access control, and compliance.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Compliance&lt;&#x2F;strong&gt;: Are there legal or regulatory requirements (e.g., industry standards, data protection laws)?&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;scaling-reads&quot;&gt;Scaling Reads&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;1-ensure-the-db-is-organized-correctly&quot;&gt;1. Ensure the db is organized correctly.&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Normalization and denormalization. Indexes.
&lt;ul&gt;
&lt;li&gt;Gotta fix the index so you avoid table scans as much as possible.
&lt;ul&gt;
&lt;li&gt;B Tree is the most common index. There are others: hash index, inverted index etc.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;You can get a lot out your databases by just vertically scaling: ssds over spinning disks, more RAM, faster CPUs (to handle concurrent queries).&lt;&#x2F;li&gt;
&lt;li&gt;Normalization is the process of structuring data to reduce redundancy by splitting information across multiple tables to avoid storing duplicate data. While this saves storage space, it makes queries more complex because you need joins to bring related data back together.&lt;&#x2F;li&gt;
&lt;li&gt;For read-heavy systems, denormalization (the opposite of normalization - you store redundant data) trades storage for speed. Instead of joining three tables to get user profile data, store the data redundantly in a single table.&lt;&#x2F;li&gt;
&lt;li&gt;You can materialize views by precomputing expensive aggregations.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;2-scale-horizontally&quot;&gt;2. Scale horizontally.&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;Read replicas will help with distribute load.&lt;&#x2F;li&gt;
&lt;li&gt;Sharding helps in two ways: smaller datasets mean faster individual queries, and you can distribute read load across multiple databases.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;3-add-external-caching-layers&quot;&gt;3. Add external caching layers.&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;Application level caches like redis or memcached (in memory, both). &quot;When your application needs data, it checks the cache first. On a hit, you get sub-millisecond response times. On a miss, you query the database and populate the cache for future requests.&quot;&lt;&#x2F;li&gt;
&lt;li&gt;CDN and edge caching. Deliver both static and dynamic content faster, better, by distributing it geographically. CDNs only make sense for data accessed by multiple users. Don&#x27;t cache user-specific data like personal preferences, private messages, or account settings.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;scaling-writes&quot;&gt;Scaling Writes&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;vertical-scaling-and-write-optimization&quot;&gt;Vertical Scaling and Write Optimization&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Writes are bottlenecked by disk I&#x2F;O, CPU, or network bandwidth. Fix these first.&lt;&#x2F;li&gt;
&lt;li&gt;Pick the right database optimized for writes.
&lt;ul&gt;
&lt;li&gt;Example, Cassandra, which achieves this via append-only commit log architecture. No data updates in place (and hence no disk seeks), instead writes everything sequentially to disk. Gives 10,000+ writes per second, compared to maybe 1,000 writes per second for a traditional relational database doing the same work.&lt;&#x2F;li&gt;
&lt;li&gt;that makes it bad for reading though, so that&#x27;s the trade off.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;sharding-partitioning&quot;&gt;Sharding, Partitioning&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Horizontal sharding: split the writes to N servers, each which can handle M writes&#x2F;sec instead of just one server with M writes&#x2F;sec. Use consistent hashing to determine which key lands in which server.&lt;&#x2F;li&gt;
&lt;li&gt;How does one determine a parition key? A good key is one which distributes the data evenly across the cluster.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;handling-bursts&quot;&gt;Handling Bursts&lt;&#x2F;h3&gt;
&lt;p&gt;Real world traffic is not steady. You will have to deal with peak volume. Two ways to deal with it: queues, load shedding.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Use queues to handle bursty traffic. Queues allow the application layer to act as if the data is already recorded. Database processes writes at a steady rate while the queue handles bursts.
&lt;ul&gt;
&lt;li&gt;This only works if the application layers writes to the queue slower than the records can be written to the database.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Load shedding is rejecting traffic altogether. Decide which writes are important for the business and which are not.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;batching-and-hierarchical-aggregation&quot;&gt;Batching and Hierarchical Aggregation&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Individual write operations have overhead like network round trips, transaction setup, index updates. Amortize the overhead by batching writes.
&lt;ul&gt;
&lt;li&gt;Can be done at application year, somewhere intermediate, or in database layer.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;For high volume data, like stream processing, individual events don&#x27;t matter. You can aggregate data in stages because that&#x27;s what is insighful for this sort of workflows. Example, comments or likes in a live streamed video.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;cdc&quot;&gt;CDC&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Change Data Capture (CDC) is a mechanism that monitors a database&#x27;s write-ahead log (WAL) or oplog, capturing every committed change as an event.&lt;&#x2F;li&gt;
&lt;li&gt;Once a change is captured, CDC publishes it as an event to an immutable event stream. The event stream acts as a central hub from which different specialized services or consumers can independently read and process the changes.&lt;&#x2F;li&gt;
&lt;li&gt;Kafka (or similar event streams like Kinesis) is a frequently used and highly robust intermediate step. When CDC captures changes, it publishes these changes to an immutable event stream like Kafka, creating an append-only log of every state transition.&lt;&#x2F;li&gt;
&lt;li&gt;Note, while it&#x27;s frequently used, it&#x27;s not necessary. The core concept is that CDC produces an event stream.
&lt;ul&gt;
&lt;li&gt;For instance, DynamoDB Streams is a built-in CDC mechanism that captures changes to DynamoDB tables. While one can use Kafka, they also directly support triggering AWS Lambda functions in response to changes. In this scenario, the Lambda function acts as a direct consumer of the stream, and while Lambda functions often interact with queues, the DynamoDB Stream itself serves as the event pipeline without another explicit message queue layer between the CDC stream and the immediate consumer (the Lambda).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;redis&quot;&gt;Redis&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Redis can run in several infrastructure configurations: as a single node, with a high availability (HA) replica, or as a cluster. When operating as a cluster, Redis is a distributed system that scales horizontally by spreading data across multiple machines.&lt;&#x2F;li&gt;
&lt;li&gt;In a Redis cluster, data is partitioned using hash slots. Instead of you manually keeping track of which partition each piece of data belongs to, clients directly connect to the specific node that contains the data they are requesting.&lt;&#x2F;li&gt;
&lt;li&gt;Choosing how to structure your keys is how you scale Redis.&lt;&#x2F;li&gt;
&lt;li&gt;Redis is very fast because it is an in-memory, single-threaded data structure store written in C.
&lt;ul&gt;
&lt;li&gt;sub-millisecond latency for reads, O(100k) operations per second.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;It supports a wide range of data structures like strings, hashes, lists, sets, sorted sets, Bloom filters, and geospatial indexes, which are easy to reason about in a distributed system.&lt;&#x2F;li&gt;
&lt;li&gt;Distributed Locks: Useful for short-term resource locking in high-concurrency scenarios, such as ticket booking or ride-sharing matching, using atomic operations with TTLs.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Redis prioritizes speed over strong durability guarantees&lt;&#x2F;strong&gt;, meaning some data loss is possible during failures unless explicitly configured with persistence options like AOF (Append-Only File) or RDB snapshots, or using alternatives like AWS&#x27; MemoryDB.
&lt;ul&gt;
&lt;li&gt;Uneven load distribution can lead to &quot;hot key&quot; issues, where a single key overwhelms a node.&lt;&#x2F;li&gt;
&lt;li&gt;While instances can handle terabytes, it&#x27;s fundamentally memory-bound. If your dataset greatly exceeds available RAM and fine-grained sharding isn&#x27;t feasible, other databases might be more suitable&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;redis-cluster&quot;&gt;Redis Cluster&lt;&#x2F;h3&gt;
&lt;h3 id=&quot;how-sharding-works-in-redis-cluster&quot;&gt;How Sharding Works in Redis Cluster&lt;&#x2F;h3&gt;
&lt;p&gt;In Redis Cluster, the data space is divided into &lt;strong&gt;16,384 hash slots&lt;&#x2F;strong&gt;. Each of these slots is owned by a single Redis node. When you use Redis Pub&#x2F;Sub, the channel name is hashed to determine which of the 16,384 slots it belongs to.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Shard&lt;&#x2F;strong&gt;: A shard is a group of nodes that manages a subset of the hash slots. For example, in a 3-node cluster, Node A might be responsible for slots 0-5460, Node B for 5461-10922, and Node C for 10923-16383.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Channel&lt;&#x2F;strong&gt;: Each Pub&#x2F;Sub channel (e.g., &lt;code&gt;post:123&lt;&#x2F;code&gt;, &lt;code&gt;post:456&lt;&#x2F;code&gt;) is assigned to one of these hash slots. Since a single node (or shard) owns thousands of slots, it will manage &lt;strong&gt;thousands of channels&lt;&#x2F;strong&gt;, each representing a different post or data stream.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;practical-example&quot;&gt;Practical Example&lt;&#x2F;h3&gt;
&lt;p&gt;Let&#x27;s say you have a Redis Cluster with three nodes (Node A, Node B, and Node C).&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;When a new comment is posted to &lt;code&gt;post:123&lt;&#x2F;code&gt;, the Redis client hashes the channel name &lt;code&gt;post:123&lt;&#x2F;code&gt; and determines it belongs to &lt;strong&gt;slot 1000&lt;&#x2F;strong&gt;. Node A owns this slot.&lt;&#x2F;li&gt;
&lt;li&gt;When a new comment is posted to &lt;code&gt;post:456&lt;&#x2F;code&gt;, the Redis client hashes the channel name &lt;code&gt;post:456&lt;&#x2F;code&gt; and determines it belongs to &lt;strong&gt;slot 6000&lt;&#x2F;strong&gt;. Node B owns this slot.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Any SSE service instance that wants to listen for updates on &lt;code&gt;post:123&lt;&#x2F;code&gt; must connect to &lt;strong&gt;Node A&lt;&#x2F;strong&gt; to subscribe. Similarly, any service instance listening for &lt;code&gt;post:456&lt;&#x2F;code&gt; must connect to &lt;strong&gt;Node B&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Therefore, a single Redis node within a shard is responsible for all the channels (and thus, all the posts) that hash to its assigned range of slots.&lt;&#x2F;p&gt;
&lt;p&gt;While a cluster can have many nodes, a typical production setup for high availability and fault tolerance starts with a minimum of six nodes—three master nodes and three replica (slave) nodes, with one replica for each master. This configuration ensures that if a master node fails, a replica can be promoted to take its place.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;real-time-processing&quot;&gt;Real Time Processing&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;1-server-side-processing-and-dataflow&quot;&gt;1. Server Side Processing and Dataflow&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Event Streams (Kafka&#x2F;Kinesis): Use Apache Kafka or AWS Kinesis as a scalable, durable event streaming platform to absorb bursts of data and ensure messages are processed in order using partitions.&lt;&#x2F;li&gt;
&lt;li&gt;Stream Processors (Flink&#x2F;Spark Streaming): Tools like Apache Flink or Spark Streaming process events from the stream in real-time. They can maintain in-memory aggregations and flush results to a database, enabling low-latency analytics.&lt;&#x2F;li&gt;
&lt;li&gt;Precomputation and Denormalization: For very low-latency queries (e.g., 10s of milliseconds), data is often precomputed and stored.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;2-client-side-update-mechanisms&quot;&gt;2. Client Side Update Mechanisms&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Server-Sent Events (SSE): Best for unidirectional pushes from server to client. It uses a single, persistent HTTP connection for streaming data. SSE is simple to implement, has automatic reconnection, and is efficient for one-way updates like live stock prices or comments.&lt;&#x2F;li&gt;
&lt;li&gt;WebSockets: Ideal for bi-directional, high-frequency communication by upgrading an HTTP connection to a full-duplex channel.&lt;&#x2F;li&gt;
&lt;li&gt;WebRTC: Enables direct peer-to-peer communication for applications like video&#x2F;audio calls, but is the most complex.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;3-server-to-client-update-propagation&quot;&gt;3. Server-to-Client Update Propagation&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Pub&#x2F;Sub: A flexible pattern for broadcasting updates. A server publishes an event to a topic, and all subscribed client-facing servers receive it, then forward to their connected clients.&lt;&#x2F;li&gt;
&lt;li&gt;Consistent Hashing: Used for stateful connections where a client&#x27;s requests are always routed to the same server (e.g., in Google Docs, all editors for a document connect to the same server). It ensures optimal resource use and allows dynamic scaling.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;kafka&quot;&gt;Kafka&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;A Kafka cluster is made up of multiple brokers. These are just individual servers (they can be physical or virtual). Each broker is responsible for storing data and serving clients. The more brokers you have, the more data you can store and the more clients you can serve.&lt;&#x2F;li&gt;
&lt;li&gt;Each broker has a number of partitions. Each partition is an ordered, immutable sequence of messages that is continually appended to.&lt;&#x2F;li&gt;
&lt;li&gt;A topic is just a logical grouping of partitions. Topics are the way you publish and subscribe to data in Kafka. When you publish a message, you publish it to a topic, and when you consume a message, you consume it from a topic. Topics are always multi-producer; that is, a topic can have zero, one, or many producers that write data to it.&lt;&#x2F;li&gt;
&lt;li&gt;Topics are just a way to organize your data, while partitions are a way to scale your data.&lt;&#x2F;li&gt;
&lt;li&gt;Producers are the ones who write data to topics, and consumers are the ones who read data from topics. While Kafka exposes a simple API for both producers and consumers, the creation and processing of messages is on you, the developer. Kafka doesn&#x27;t care what the data is, it just stores and serves it.&lt;&#x2F;li&gt;
&lt;li&gt;When a message is published to a Kafka topic, Kafka first determines the appropriate partition for the message. This partition selection is critical because it influences the distribution of data across the cluster.
&lt;ul&gt;
&lt;li&gt;Once the partition is determined, Kafka then identifies which broker holds that particular partition. The mapping of partitions to specific brokers is managed by the Kafka cluster metadata, which is maintained by the Kafka controller (a role within the broker cluster).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Each partition in Kafka functions essentially as an append-only log file. Messages are sequentially added to the end of this log, which is why Kafka is commonly described as a distributed commit log.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Once written, messages in a partition cannot be altered or deleted.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Consumers in Kafka work on a pull-based model, continuously polling for messages from their assigned partition. The consumer is responsible for telling Kafka that a message has been processed, and it does so by committing its offset.
&lt;ul&gt;
&lt;li&gt;A consumer can process many messages and accumulate a batch of work before committing its offset. It does not need to commit the offset of the current message to be able to pull and process the next message in the stream.&lt;&#x2F;li&gt;
&lt;li&gt;The consumer knows what the next message in the stream is by keeping track of its offset. &lt;strong&gt;An offset is a unique, sequential identifier assigned to each message.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Use Kafka as a message queue
&lt;ul&gt;
&lt;li&gt;If you have processing that can be done asynchronously. Example, transcoding YouTube videos after an upload.&lt;&#x2F;li&gt;
&lt;li&gt;If you need to ensure that messages are processed in order.&lt;&#x2F;li&gt;
&lt;li&gt;You want to decouple producer and consumer so they can scale independently.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;User Kafka as a stream
&lt;ul&gt;
&lt;li&gt;If you require continuous and immediate processing of incoming data, treating it as a real-time flow. Example, Ad click aggregation.&lt;&#x2F;li&gt;
&lt;li&gt;If messages need to be processed by multiple consumers simultaneously. Example, FB Live comments.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Some numbers:
&lt;ul&gt;
&lt;li&gt;Keep messages under 1 MB for optimal performance.&lt;&#x2F;li&gt;
&lt;li&gt;On good hardware, a single broker can store around 1TB of data and handle as many as 1M messages per second.&lt;&#x2F;li&gt;
&lt;li&gt;Simplest way to scale: (1) add more brokers (scale horizontally) (2) decide how to partition your data across the brokers.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;To handle hot partitions:
&lt;ul&gt;
&lt;li&gt;Use a compound key: instead of using just the one ID, use a combination of that ID and another attribute, such as geographical region or user ID segments, to form a compound key.&lt;&#x2F;li&gt;
&lt;li&gt;Backpressure: slow down the producer. The producer can check the lag on the partition and slow down if it&#x27;s too high.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;isolation-levels-and-locking-mechanisms&quot;&gt;Isolation Levels and Locking Mechanisms&lt;&#x2F;h2&gt;
&lt;p&gt;In PostgreSQL, isolation levels define the degree to which transactions are separated from the effects of other concurrent transactions in a database system. There are three internal isloation levels: read commited (the default), repeatable read, and serializable.&lt;&#x2F;p&gt;
&lt;p&gt;With serializable isolation level, transactions behave as if they were executed one after another in sequence, preventing all types of concurrency anomalies. The trade off is if two transactions conflict, one will be rolled back and require the application to implement retry logic.&lt;&#x2F;p&gt;
&lt;p&gt;Isolation level sets the broad concurrency policy for a transactions in a db. Row-level locking is used within transactions to explicitly lock specific rows. Row-level locking ensures a consistent view of the data for the duration of the changes to specific rows.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;PostgreSQL Row-Level Locking&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;When a row is locked in PostgreSQL (e.g., using &lt;code&gt;SELECT... FOR UPDATE&lt;&#x2F;code&gt;), other transactions attempting to modify that row &lt;strong&gt;will wait&lt;&#x2F;strong&gt; until the current transaction commits or rolls back.&lt;&#x2F;li&gt;
&lt;li&gt;If multiple processes wait for the same row, they will typically &lt;strong&gt;queue&lt;&#x2F;strong&gt; and acquire the lock in sequence. The db will manage this queue.&lt;&#x2F;li&gt;
&lt;li&gt;This mechanism ensures strong consistency but can be a &lt;strong&gt;performance bottleneck&lt;&#x2F;strong&gt; under heavy contention. It should be held for a &lt;strong&gt;short duration&lt;&#x2F;strong&gt; on &lt;strong&gt;precisely identified rows&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Redis-Based Distributed Locks&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Redis locks operate on a &lt;strong&gt;dedicated Redis instance&lt;&#x2F;strong&gt;, separate from the primary application database.&lt;&#x2F;li&gt;
&lt;li&gt;They store the &lt;strong&gt;state of the lock itself&lt;&#x2F;strong&gt; (e.g., if a resource is held), not the primary data.&lt;&#x2F;li&gt;
&lt;li&gt;Redis uses &lt;strong&gt;atomic operations&lt;&#x2F;strong&gt; (like &lt;code&gt;INCR&lt;&#x2F;code&gt; or &lt;code&gt;SETNX&lt;&#x2F;code&gt;) to manage these locks and often includes an &lt;strong&gt;expiration time (TTL)&lt;&#x2F;strong&gt; to prevent indefinite locks due to crashes.&lt;&#x2F;li&gt;
&lt;li&gt;They are used for &lt;strong&gt;locking resources across different systems or processes&lt;&#x2F;strong&gt; or for longer-term locks, distinct from transactional database locks.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;When to Use Optimistic Locking&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Use when you &lt;strong&gt;assume conflicts are rare&lt;&#x2F;strong&gt; .&lt;&#x2F;li&gt;
&lt;li&gt;Operations are &lt;strong&gt;read-only or can be retried&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;It &lt;strong&gt;avoids explicit locks&lt;&#x2F;strong&gt; upfront, using a &quot;compare and swap&quot; or &lt;strong&gt;versioning mechanism&lt;&#x2F;strong&gt; to detect changes before committing.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Example&lt;&#x2F;strong&gt;: Updating an auction&#x27;s maximum bid where simultaneous bids are infrequent.&lt;&#x2F;li&gt;
&lt;li&gt;Optimistic concurrency is primarily about updating existing data safely.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;When to Use Row-Level Locking&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Use when &lt;strong&gt;strong consistency is essential&lt;&#x2F;strong&gt; for specific records.&lt;&#x2F;li&gt;
&lt;li&gt;You can &lt;strong&gt;precisely identify and lock only the necessary rows&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;The lock can be held for a &lt;strong&gt;short duration&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Ensures &lt;strong&gt;atomic operations&lt;&#x2F;strong&gt; within a transaction on specific data.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Examples&lt;&#x2F;strong&gt;: Updating a user&#x27;s bank account, processing an auction bid by locking &lt;em&gt;only the auction row&lt;&#x2F;em&gt;, or preventing double-booking of resources.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Optimistic vs. Row-Level Locking Relationship&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;These are generally &lt;strong&gt;alternative strategies&lt;&#x2F;strong&gt; for handling concurrency, not typically used together for the same operation.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Databases Supporting Row-Level Locking&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;PostgreSQL&lt;&#x2F;strong&gt; explicitly supports row-level locking (e.g., &lt;code&gt;SELECT... FOR UPDATE&lt;&#x2F;code&gt;).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Cassandra&lt;&#x2F;strong&gt; is noted for having &quot;row-level transactions to work with&quot; in certain contexts. Most &lt;strong&gt;relational databases&lt;&#x2F;strong&gt; generally allow for it.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h1 id=&quot;two-phase-commit&quot;&gt;Two Phase Commit&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;This is a protocol that ensures atomocity across multiple participants in a distributed transaction.&lt;&#x2F;li&gt;
&lt;li&gt;It works by having a coordinator orchestrate the process in two distinct phases: the Prepare Phase (Phase 1) and the Commit Phase (Phase 2).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;redis-1&quot;&gt;Redis&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;A Redis Cluster is like a library system with multiple branches.&lt;&#x2F;li&gt;
&lt;li&gt;Node is like one library branch - it&#x27;s a single Redis instance&#x2F;server.&lt;&#x2F;li&gt;
&lt;li&gt;Hash Slots are like catalog sections. Redis divides all possible data into 16,384 numbered sections (0 through 16,383). Each node is responsible for managing some of these sections.&lt;&#x2F;li&gt;
&lt;li&gt;How data gets distributed:
&lt;ul&gt;
&lt;li&gt;When you store data for user 12345, Redis doesn&#x27;t directly assign the user to a node. Instead:
-Redis takes the key name &quot;user:12345:profile&quot;
-Runs it through a math formula to get a number between 0 and 16,383
-That number is the hash slot
&lt;ul&gt;
&lt;li&gt;Whichever node owns that hash slot stores the data&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;system-failure-modes&quot;&gt;System Failure Modes&lt;&#x2F;h1&gt;
&lt;h2 id=&quot;data-loss-durability&quot;&gt;Data Loss &amp;amp; Durability&lt;&#x2F;h2&gt;
&lt;p&gt;No data lost, ever.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Failure:&lt;&#x2F;strong&gt; Data vanishes due to crashes or incomplete operations.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;&#x2F;strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Durable Queues:&lt;&#x2F;strong&gt; Use &lt;strong&gt;Kafka&#x2F;SQS&lt;&#x2F;strong&gt; to buffer and guarantee delivery of critical data.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Replication:&lt;&#x2F;strong&gt; Keep &lt;strong&gt;multiple copies&lt;&#x2F;strong&gt; of data across nodes&#x2F;zones (e.g., database replicas, Kafka replication).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;WAL&#x2F;Snapshots:&lt;&#x2F;strong&gt; Ensure &lt;strong&gt;Write-Ahead Logs&lt;&#x2F;strong&gt; and periodic &lt;strong&gt;snapshots&lt;&#x2F;strong&gt; persist changes for recovery.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Event Sourcing&#x2F;CDC:&lt;&#x2F;strong&gt; Capture every state change as an &lt;strong&gt;immutable event&lt;&#x2F;strong&gt; for audit and replay.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;performance-bottlenecks&quot;&gt;Performance Bottlenecks&lt;&#x2F;h2&gt;
&lt;p&gt;System slow or overwhelmed.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Failure:&lt;&#x2F;strong&gt; System is slow, overwhelmed by load, or specific data items are &quot;hot&quot;.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;&#x2F;strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Scale Up (Vertical):&lt;&#x2F;strong&gt; Use &lt;strong&gt;more powerful hardware&lt;&#x2F;strong&gt; (CPU, RAM, SSDs).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Scale Out (Horizontal):&lt;&#x2F;strong&gt; Add &lt;strong&gt;more servers&lt;&#x2F;strong&gt; to distribute load.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Indexing:&lt;&#x2F;strong&gt; Create &lt;strong&gt;smart indexes&lt;&#x2F;strong&gt; (B-tree, inverted, geospatial) to speed up queries.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Caching Layers:&lt;&#x2F;strong&gt; Add &lt;strong&gt;Redis&#x2F;Memcached, CDN&#x2F;Edge caches&lt;&#x2F;strong&gt; to store frequent data closer to users.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Read Replicas:&lt;&#x2F;strong&gt; Distribute &lt;strong&gt;read load&lt;&#x2F;strong&gt; across database copies.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Sharding&#x2F;Partitioning:&lt;&#x2F;strong&gt; Divide data&#x2F;workload across &lt;strong&gt;multiple machines&#x2F;databases&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Hot Key Strategies:&lt;&#x2F;strong&gt; For popular items, use &lt;strong&gt;cache key fanout&lt;&#x2F;strong&gt; (multiple cache entries) for reads or &lt;strong&gt;key sharding&lt;&#x2F;strong&gt; (split item into sub-keys) for writes.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Stale-While-Revalidate:&lt;&#x2F;strong&gt; Serve old data while &lt;strong&gt;refreshing cache in background&lt;&#x2F;strong&gt; to prevent thundering herds.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Batching&#x2F;Queues:&lt;&#x2F;strong&gt; Aggregate many small writes into &lt;strong&gt;fewer, larger operations&lt;&#x2F;strong&gt; or use queues to smooth out write bursts.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;consistency-issues&quot;&gt;Consistency Issues&lt;&#x2F;h2&gt;
&lt;p&gt;Data out of sync or wrong.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Failure:&lt;&#x2F;strong&gt; Data appears different across parts of the system or updates conflict.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;&#x2F;strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;CAP Theorem Choice:&lt;&#x2F;strong&gt; Prioritize &lt;strong&gt;Consistency&lt;&#x2F;strong&gt; (e.g., financial systems) or &lt;strong&gt;Availability&lt;&#x2F;strong&gt; (e.g., social feeds) during network partitions.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;ACID Transactions:&lt;&#x2F;strong&gt; Use &lt;strong&gt;database transactions&lt;&#x2F;strong&gt; with appropriate isolation levels (e.g., Serializable) for critical operations.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Optimistic Concurrency:&lt;&#x2F;strong&gt; Assume no conflict, then &lt;strong&gt;check and retry&lt;&#x2F;strong&gt; if conflict occurs.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Distributed Locks:&lt;&#x2F;strong&gt; Use &lt;strong&gt;Redis&#x2F;ZooKeeper locks&lt;&#x2F;strong&gt; to ensure only one process modifies a resource at a time.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Cache Invalidation:&lt;&#x2F;strong&gt; Implement &lt;strong&gt;Time-To-Live (TTL), write-through, or versioned keys&lt;&#x2F;strong&gt; to manage cache freshness.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Reconciliation:&lt;&#x2F;strong&gt; For external systems, use &lt;strong&gt;background jobs&lt;&#x2F;strong&gt; to correct eventual inconsistencies.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;service-component-failures&quot;&gt;Service &amp;amp; Component Failures&lt;&#x2F;h2&gt;
&lt;p&gt;Parts of the system die&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Failure:&lt;&#x2F;strong&gt; Individual servers, services, or jobs crash or become unresponsive.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;&#x2F;strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Redundancy:&lt;&#x2F;strong&gt; Design for &lt;strong&gt;no single point of failure&lt;&#x2F;strong&gt; through replication and distributed architecture.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Failover&#x2F;Recovery:&lt;&#x2F;strong&gt; Automatically &lt;strong&gt;promote replicas&lt;&#x2F;strong&gt; or &lt;strong&gt;restart failed services&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Health Checks:&lt;&#x2F;strong&gt; Monitor components and &lt;strong&gt;re-route traffic&lt;&#x2F;strong&gt; from unhealthy ones.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Job Retries&#x2F;DLQs:&lt;&#x2F;strong&gt; Use queues with &lt;strong&gt;visibility timeouts&lt;&#x2F;strong&gt; and &lt;strong&gt;Dead Letter Queues&lt;&#x2F;strong&gt; to retry failed jobs safely.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Pipelining:&lt;&#x2F;strong&gt; Break complex jobs into &lt;strong&gt;smaller, fault-tolerant stages&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;network-communication-issues&quot;&gt;Network &amp;amp; Communication Issues&lt;&#x2F;h2&gt;
&lt;p&gt;Things breaking in transit&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Failure:&lt;&#x2F;strong&gt; Messages lost, high latency from network, or difficult real-time updates.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;&#x2F;strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Durable Queues:&lt;&#x2F;strong&gt; As mentioned, use &lt;strong&gt;Kafka&#x2F;SQS&lt;&#x2F;strong&gt; for reliable message delivery.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Real-time Protocols:&lt;&#x2F;strong&gt; Choose &lt;strong&gt;WebSockets&lt;&#x2F;strong&gt; (bi-directional), &lt;strong&gt;Server-Sent Events (SSE)&lt;&#x2F;strong&gt; (server-to-client push), or &lt;strong&gt;Long Polling&lt;&#x2F;strong&gt; for efficient updates.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Consistent Hashing:&lt;&#x2F;strong&gt; Route clients&#x2F;data to specific servers for &lt;strong&gt;stateful connections&lt;&#x2F;strong&gt; (e.g., Google Docs, WhatsApp).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Pub&#x2F;Sub:&lt;&#x2F;strong&gt; Decouple services and enable &lt;strong&gt;broadcasts&lt;&#x2F;strong&gt; to many subscribers.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Data Locality:&lt;&#x2F;strong&gt; Place data and services &lt;strong&gt;geographically closer to users&lt;&#x2F;strong&gt; (CDNs, regional deployments).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Connection Pooling:&lt;&#x2F;strong&gt; Reuse network connections to &lt;strong&gt;reduce overhead&lt;&#x2F;strong&gt; and latency.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;security-vulnerabilities&quot;&gt;Security Vulnerabilities&lt;&#x2F;h2&gt;
&lt;p&gt;System compromised&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Failure:&lt;&#x2F;strong&gt; Unauthorized access, data breaches, or abuse.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;&#x2F;strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;API Gateway Security:&lt;&#x2F;strong&gt; Implement &lt;strong&gt;authentication, authorization, rate limiting&lt;&#x2F;strong&gt; at the entry point.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Request Signing:&lt;&#x2F;strong&gt; Use &lt;strong&gt;cryptographic signatures&lt;&#x2F;strong&gt; (HMAC) to verify request authenticity and prevent replay attacks.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Data Protection:&lt;&#x2F;strong&gt; Employ &lt;strong&gt;encryption (in transit and at rest)&lt;&#x2F;strong&gt;, tokenization for sensitive data (e.g., credit cards).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Rate Limiting&#x2F;Throttling:&lt;&#x2F;strong&gt; Control request volume to prevent &lt;strong&gt;abuse and scraping&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;resources&quot;&gt;Resources&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.systemdesignhandbook.com&#x2F;&quot;&gt;System Design Handbook&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;http:&#x2F;&#x2F;hellointerview.com&#x2F;&quot;&gt;Hello Interview&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>The Killer</title>
        <published>2023-12-06T00:00:00+00:00</published>
        <updated>2023-12-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/fincher-the-killer/"/>
        <id>https://asun9.com/fincher-the-killer/</id>
        
        <content type="html" xml:base="https://asun9.com/fincher-the-killer/">&lt;p style=&quot;text-align:center;&quot;&gt;&lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;The_Killer_2023_poster.jpg&quot; alt=&quot;The Killer&quot; class=&quot;center&quot;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The first time I saw The Killer, I was not particularly impressed. It’s the story of a hitman on the run after a botched job. This is a theme that has been explored widely but I first fell in love with it with Jean Pierre Meivelle’s &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Le_Samoura%C3%AF&quot;&gt;Le Samourai&lt;&#x2F;a&gt; (1967), back when I saw it at 19 or 20. I have believed thus far that no else has done it better, not John Woo, not Luc Bresson, not even Jim Jarmusch in &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Ghost_Dog:_The_Way_of_the_Samurai&quot;&gt;Ghost Dog&lt;&#x2F;a&gt;. Only the Korean action drama, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;A_Bittersweet_Life&quot;&gt;A Bittersweet Life&lt;&#x2F;a&gt;, comes close.&lt;&#x2F;p&gt;
&lt;p&gt;The Killer has since that first viewing drawn me back again and again. I have never seen a movie twice in such quick succession before. Layers that escaped me became apparent, such as the fact that our hitman could be an unreliable narrator. David Fincher is some ways an old school filmmaker. There are no jump cuts, the camera is still, the action when it happens is centered. There are no obvious musical prompts shoving the audience ahead of the narration. He is patient, letting the scenes build. The effect is that we are completely with our protagonist all the way through, in the moment: watching a few gym bros and their menacing pitbull in Tampa Bay, buying a garbage can and nail gun in New Orleans, staking out a restaurant outside of New York. In here is an immediacy that I have rarely felt in other movies. The hitman, played by Michael Fassbender, has a code. He anticipates, but doesn’t improvise. He doesn’t believe in justice or karma. He has trained himself, he lets us know, to not give a damn about his targets. He repeats these statements, as if they were a mantra, and we see him just as persistently violate them. I see in it parallels to Fincher&#x27;s own style of filmmaking, with his exacting pre-production and numerous takes, all that careful planning at the mercy of magic that an actor dispenses on the day of the shoot. If one could extend the analogy, there are parallels to very many things in life. You can prepare all you want, but there are few things really under one’s control.&lt;&#x2F;p&gt;
&lt;p&gt;Fassbender, who was a very a convincing android in &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Prometheus_(2012_film)&quot;&gt;Prometheus&lt;&#x2F;a&gt;, is mesmerizing. With him we are nervous, with him we are sore, with him we squirm. We lose sight of him just once, when Tilda Swinton, in a brief role as another contractor for hire, steals the scene. David Fincher, I must accept, is a master. Even with a narrator, he is content to show rather than tell. He resists the urge to offer a sermon and to moralize, a dispiriting affectation &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;The_White_Lotus&quot;&gt;all&lt;&#x2F;a&gt; too &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;The_Menu_(2022_film)&quot;&gt;common&lt;&#x2F;a&gt; in the recent “eat the rich” movies and tv shows. Though stylistically and thematically different, Scorsese is similar is this respect. While maintaining a moral distance from his protagonists, he unapologetically shows criminals having a good time while the fun lasts. Consider his Wolf of Wall Street or Goodfellas.&lt;&#x2F;p&gt;
&lt;p&gt;This is that rare movie I will certainly revisit again. Here we spend the first 20 minutes with our anonymous hitman in an abandoned WeWork high-rise, sleeping on a sheetrock, and still be pretty darn entertained. That deserves a first place on any list of hitman movies worth recalling.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Autumn of the patriarch</title>
        <published>2023-12-01T00:00:00+00:00</published>
        <updated>2023-12-01T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/autumn-of-patriarch/"/>
        <id>https://asun9.com/notes/autumn-of-patriarch/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/autumn-of-patriarch/">&lt;p&gt;Note: This is an attempt at fiction. I am trying to construct a narrative as slowly suffocating as Vivek Shanbag&#x27;s via Srinath Perur. I will fail, but here goes.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;There is a man. A man with a wife and a child, his son. He has some admirable qualities. He takes a decision and acts on it. Whether selling land and property and moving cities or buying a new place, once a commitment has been made, he sees it executed as soon as possible. He has a sense of duty towards his brother and child. He does things for them that others would consider out of the way. For example, getting his niece married, trying to resolve issues as that marriage threatened to dissolve (he once drove 400 miles to check in on her, forcing everyone to go along), helping his nephew clear out his dorm room after he graduated. The patriarch&#x27;s most expensive assets are always in his wife’s name.&lt;&#x2F;p&gt;
&lt;p&gt;The son, as a child, would be upset at the affections the brother&#x27;s children got, especially when the brother did not reciprocate. He never shared his thoughts on the matter with his father. The father has a temper, very capable of holding a grudge. His son, through his childhood, was very afraid of him. The father worked in a factory with Mondays off. The other six days were working days, with long hours. The son always wished Mondays didn&#x27;t exist. On the other days he would dread the time his father would come home from work. If the son didn&#x27;t do well in school, he would get a whipping. If he bought a comic book instead of a paperback, he would get a tongue lashing. If the boy didn’t smile for photos, yet another tongue lashing. Worse, the boy had to see him lay it out on his mother while he couldn&#x27;t do anything about it. The boy’s mother did not - and does not - have the freedom to disagree with the father. The patriarch browbeats her into silence, a silence that he perceives as conceding to his opinion. Sometimes the father was seemingly good. There was an impromptu trip to see the Empire Strikes Back when it was re-released. The shopping for crackers during Deepavali season. But these were rare and few. &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Strange_Case_of_Dr_Jekyll_and_Mr_Hyde&quot;&gt;Mr Hyde&lt;&#x2F;a&gt; was never far behind.&lt;&#x2F;p&gt;
&lt;p&gt;When the boy was in high school the father left town for better opportunities. The boy was relived to not have him around. The boy soon left town too, for his studies. He would never go back and live with his father again. The memories of his father&#x27;s temper would haunt him. The patriarch would get very upset and angry in a public place like a reception because he was made to wait for food. The boy would be overcome with extreme shame, sitting next to him, with all eyes on them.  The public berating his mother would get for something as silly as not paying attention to him when he was saying something. Only well into his own adulthood did the boy understand how unusual his childhood was. Other parents were not like this. Other fathers were friends and confidants. As he reflected back, he realized that he never had an intimate conversation with his father. He never felt psychologically safe with him. When he left town, he wouldn&#x27;t talk to his dad for months unless his mother insisted on it. Even when he became confident of his body and strength, and his ability to support himself, he still didn&#x27;t confront his dad. His mother refused to leave him and he didn&#x27;t want his father to hurt her when he wasn&#x27;t around.&lt;&#x2F;p&gt;
&lt;p&gt;Some time ago, the boy started watching his father more intently and discovered a few things that made him mistrust the patriarch even more than before. He is always complaining about being insulted by people around him. He is antagonistic to people he is supposed to be close to. He cannot give a compliment without it being laced with sarcasm and bile. When questioned, he would take offense - “I can’t even talk normally without being policed”. He is barely on speaking terms with anybody who knows him the longest, and he doesn’t have anyone that one would generally consider friends. His work colleagues (now ex-colleagues) are his friends, but he does not know the names of their children, their likes and dislikes, or birthdays. In his own mind, he is always right. It is always the other person&#x27;s fault. His internal narrative is “I have done so much for people, yet nobody appreciates me”. The boy sees versions of this in himself and his interactions with others.&lt;&#x2F;p&gt;
&lt;p&gt;So now here we are. The boy has a child of his own. He has an example before him. Despite the few virtues, the patriarch&#x27;s temper and insecurity have overwhelmed his life and destroyed his relationships. He is not even aware of it. A strange, wounded animal. What is a good life, the son asks himself. To love and to be loved. To be friends with your children and to earn their trust. To be cheerful and good-tempered. To never hold grudges. To be present in a relationship, to be aware of its fragility. To never complain. To never be bitter. To be nothing like his father.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Playful Parenting</title>
        <published>2023-11-25T00:00:00+00:00</published>
        <updated>2023-11-25T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/playful-parenting/"/>
        <id>https://asun9.com/playful-parenting/</id>
        
        <content type="html" xml:base="https://asun9.com/playful-parenting/">&lt;p&gt;Book: &lt;strong&gt;Playful Parenting&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Lawrence Cohen&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;One of Maria Montessori&#x27;s organizing principles was this: “In the life of the child, play is perhaps something of little importance which he undertakes for the lack of something better to do.” Lawrence Cohen, a child therapist, turns this dictum around its head. The central theme of his practice is that playing is how children learn to form connections with others and cope with emotional distress. He makes his case with plenty of analogies and use cases from his career. To enter into the world of a child on her own terms is a very difficult task for most adults, far removed from their own childhood. I can name just a few in my own life who had quite the impact on me, most significant among them being my mother. Mom still has the preternatural ability to make any child her friend. Cohen&#x27;s arguments worked for me because I had adult references for both what one should do and what one shouldn&#x27;t. I wouldn&#x27;t have thought of my mother as a playmate, but now I recognize that&#x27;s what she was. Children best learn empathy and kindness not by moral lessons or lectures but via games designed to teach them. So playing can be fun, but also meaningful and complex. The most important thing we have to offer to our children is our ability to make them feel loved, respected, wanted, and welcome. With infants, this takes the form of cuddling, mirroring, talking and singing. With older kids, it&#x27;s making many interactions a game, from hide and seek to driving a car to story telling.&lt;&#x2F;p&gt;
&lt;p&gt;There is a particular emphasis on reconnection in the book. Reconnection takes persistence since children receive conflicting messages from the world. You want to hear hurting children out, not try to cheer them or cajole them out of feeling bad. Follow the child&#x27;s lead. Often this means saying &quot;yes&quot; when you want to say &quot;no&quot;. Remember to jump into their world, and to make it easier, have a dedicated play time daily. Having a regular and scheduled time allows children to look forward to it and plan for it.&lt;&#x2F;p&gt;
&lt;p&gt;Cohen&#x27;s messaging about connection and play is focused on children, but it is clear that it applies just as well to adult relationships. This is him talking about children:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;I think we each want the other one to take the initiative to apologize and ask for forgiveness. But if we wait for them, it might never happen. I think it&#x27;s up to us, the adults, the parents, to take the initiative. Make eye contact. Cuddle. Always make up after a fight. Offer forgiveness without being asked. Apologize when you&#x27;ve been wrong. When things are rough between you, spend more time together instead of less. As a way to resolve a conflict, offer a hug instead of the usual punishment. Tell everyone in the family something you appreciate about him or her.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Peter Kaufman, the CEO of Glenair and the author of Poor Charlie&#x27;s Alamanack, emphasized in one of his &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;http:&#x2F;&#x2F;latticeworkinvesting.com&#x2F;2018&#x2F;04&#x2F;06&#x2F;peter-kaufman-on-the-multidisciplinary-approach-to-thinking&#x2F;&quot;&gt;talks&lt;&#x2F;a&gt; how it&#x27;s easy to fail in life while succeeding in a business. His central theme?&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;So you’ve got one lifetime. How do you want to spend your one lifetime? Do you want to spend your one lifetime like most people do, fighting with everybody around them? No. I just told you how to avoid that. And in exchange have what? A celebratory life. Instead of an antagonistic fighting life. &lt;strong&gt;All you have to do is go positive, go first, be patient enough.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Life of Sri Ramanuja</title>
        <published>2023-11-11T00:00:00+00:00</published>
        <updated>2023-11-11T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/sri-ramanuja-budhananda/"/>
        <id>https://asun9.com/sri-ramanuja-budhananda/</id>
        
        <content type="html" xml:base="https://asun9.com/sri-ramanuja-budhananda/">&lt;p&gt;Book: &lt;strong&gt;Life of Sri Ramanuja&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Swami Ramakrishnananda, translated by Swami Budhananda&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;This was a throwback to the books I read as a child, the stories one is told before the disenchantment sets in. Written with such loving devotion, this is a world where the gods talk to the bhaktas and make their presence apparent. The sole purpose of the bhaktas is to be of service to the Supreme, sing the hagiographies of other bhaktas, and spread the word. Jati and other identities may matter in the social context, but irrelevant when making acts of devotion. Modeling one&#x27;s behavior on the illustrious bhaktas becomes important, and this quote from the Vanaprasta of the Mahabharata appears more than once:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;‘महाजनो येन गतः स पन्था—The way the great ones trod, that is the path.’&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;The story of Ramanuja and the Alvars thus told, is filtered through a thousand years of the &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;bhakti-decon&#x2F;&quot;&gt;Bhakti storm&lt;&#x2F;a&gt; traversing across this country, seen from the perspective of a Bengali monk of the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;vedanta.org&#x2F;the-ramakrishna-order&#x2F;&quot;&gt;Ramakrishna order&lt;&#x2F;a&gt;. As such, the references include not just the Mahabharata, Ramayana and the Puranas, but also the words of Christ. The muslim princess who was eventually deified in Srirangam, Tulukka Nachiyar, is also devoted a chapter. This emphasis on syncretism - and yet paying considerable attention to Sri Vaishnava orthodoxy - surely reflects one of the central concerns of Bengal renaissance at the time this book was written, in late 19th century. I enjoyed being immersed in it. I know a few elders with easy access to the devotion described here. I have always been jealous of them, wishing I could possess something of it. It is an inheritance I am afraid I have squandered forever.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Pronto</title>
        <published>2023-10-06T00:00:00+00:00</published>
        <updated>2023-10-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/elmore-pronto/"/>
        <id>https://asun9.com/elmore-pronto/</id>
        
        <content type="html" xml:base="https://asun9.com/elmore-pronto/">&lt;p&gt;Book: &lt;strong&gt;Pronto&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Elmore Leonard&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;I did not want to read more Elmore Leonard, but I came across a deal and the first few lines made this one a no-brainer. Damn you, Leonard. No matter how implausible the story, it is peopled by real characters and he’s capable of making the most reticent of them seem quite chatty. This one is no exception. In fact, Harry Arno, one of the players, is more than disagreeable and reminded me of someone very close. Arno here is a bookie, and he’s been skimming from his boss, and the boss before that going back forty years. When he is about to retire, he gets set up and they are out to get him. Will he survive? There’s a detour to Italy, memories of Ezra Pound during World War II, and a stetson wearing marshal tailing him. Not bad ingredients that make for a not bad novel. Interestingly enough, the two books I have read of “The Dickens of Detroit” are primarily set in Florida. Two others that I want to read, Get Shorty and Rum Punch, are also set - for most part - in Los Angeles and Florida.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Book Notes: The Joys of Compounding</title>
        <published>2023-09-09T00:00:00+00:00</published>
        <updated>2023-09-09T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/joys-of-compounding/"/>
        <id>https://asun9.com/joys-of-compounding/</id>
        
        <content type="html" xml:base="https://asun9.com/joys-of-compounding/">&lt;p&gt;Book: &lt;strong&gt;The Joys of Compounding&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Gautham Baid&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;summary&quot;&gt;Summary&lt;&#x2F;h3&gt;
&lt;p&gt;Firmly embedded in the landscape of Munger literature, in the tradition of Peter Bevelin and Guy Spier. Hard pressed to find things here that are also not there, except references to Gita and the Indian stock market. Nevertheless, a good reference book for some very fundamental mental models - compounding, delayed gratification, checklists, incentives, opportunity costs, role of luck and randomness.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;notes&quot;&gt;Notes&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;On seeking wisdom
&lt;ul&gt;
&lt;li&gt;It involves a lot of hard work, patience, discipline, and focus. Read. A lot. This is how Warren Buffett, one of the most successful people in the business world, describes his typical day: “I just sit in my office and read all day.”&lt;&#x2F;li&gt;
&lt;li&gt;Self-improvement is the ultimate form of investing in oneself. It requires devoting time, money, attention, and hard effort now for a payoff later, sometimes in the far distant future. A lot of people are unwilling to make this trade-off because they crave instant gratification and desire instant results.&lt;&#x2F;li&gt;
&lt;li&gt;After hearing Buffett talk, Combs started keeping track of what he read and how many pages he was reading. Eventually finding and reading productive material became second nature, a habit. As he began his investing career, he would read even more, hitting 600, 750, even 1,000 pages a day. Combs discovered that Buffett’s formula worked, giving him more knowledge that helped him with what became his primary job—seeking the truth about potential investments.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Continuous learning
&lt;ul&gt;
&lt;li&gt;In Michael Eisner and Aaron Cohen’s book Working Together: Why Great Partnerships Succeed, Buffett talked about his and Munger’s fierce dedication to lifelong learning: I don’t think any other twosome in business was better at continuous learning than we were…. And if we hadn’t been continuous learners, the record wouldn’t have been as good. And we were so extreme about it that we both spent the better part of our days reading, so we could learn more, which is not a common pattern in business…. We don’t read other people’s opinions. We want to get the facts, and then think.&lt;&#x2F;li&gt;
&lt;li&gt;In the long term, the daily investment in learning something new and improving yourself goes a long way. So, the best investment of time is to invest in personal development.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Compounding is one of the most powerful forces in the world. In fact, it is the only power law in the universe that exists with a variable in its exponent. The power law of compounding not only is applicable to investing but also, and more important, can be applied to continued learning. The fastest way to simplify things is to spot the symmetries, or invariances—that is, the fundamental properties that do not change from one object under study to another.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The only way to gain an edge is through long and hard work.&lt;&#x2F;strong&gt; Do what you love to do, so you just naturally do it or think about it all the time, even if you are relaxing…. Over time, you can accumulate a huge advantage if it comes naturally to you like this [emphasis added]. —Li Lu&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Focus
&lt;ul&gt;
&lt;li&gt;When Bill Gates met Warren Buffett for the first time, their host at dinner, Gates’s mother, asked everyone around the table what they believed was the single most important factor in their success in life. Gates and Buffett gave the same one-word answer: “focus.” Both men agree that relentlessly focusing on one specific passion leads to achievement. And that means pushing aside other ideas and interests until a goal is reached.
&lt;ul&gt;
&lt;li&gt;Buffett biographer Alice Schroeder writes about Buffett’s intense focus: “He ruled out paying attention to almost anything but business—art, literature, science, travel, architecture—so that he could focus on his passion.”&lt;&#x2F;li&gt;
&lt;li&gt;Many of the highly successful people in the world attribute their success to a singular focus—a deep commitment to the pursuit of one main goal. Focus directs your energy toward your goals. The more focused you are, the more energy you put toward what you’re working on.&lt;&#x2F;li&gt;
&lt;li&gt;Buffett’s secret to success is his intense focus—instead of doing more, he does less. He once told his personal airplane pilot, Mike Flint, that Flint needed to do three things to reach his goals. The first was to write down his top twenty-five goals. The second was to circle the top five most important ones. Finally, he should separate the top five goals into a separate list—and put goals six through twenty-five on a “not-to-do” list. Buffett concludes by stating: “Everything you didn’t circle just became your ‘avoid at all cost list.’ No matter what, these things get no attention from you until you’ve succeeded with your top 5.”&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Energy as competitive advantage
&lt;ul&gt;
&lt;li&gt;The truth is, so few people really jump on their jobs, you really will stand out more than you think,” Buffett explains. “You will get noticed if you really go for it.”As the well-known saying goes, “Choose a job you love, and you will never have to work a day in your life.” You know that you are doing things right in your life when you go to bed at night and cannot wait to wake up and live the next day.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;It is our duty to act as moral exemplars and to inspire others to do the same. When I was an officer in the military, we had a rule called Conduct Unbecoming an Officer. It was not specific, but it said there were certain ways to behave as an example for others…. If you rise high in a corporation or elsewhere in life, you have a duty to be an exemplar—you have a duty to take less than you deserve, to set an example [emphasis added]. —Charlie Munger&lt;&#x2F;li&gt;
&lt;li&gt;Relationships
&lt;ul&gt;
&lt;li&gt;Spend time building new relationships. Too many stop building relationships after school, or after marriage, and then you find yourself in a rut and your only relationships represent who you used to be &amp;amp; not where you want to go. —Ian Cassel&lt;&#x2F;li&gt;
&lt;li&gt;Making connections by e-mail or phone is nothing like meeting in person. You need to really make a genuine effort to create strong bonds with people who are on the same path as you. If you do this with utmost sincerity, your network of compounded relationships will open many unexpected, joyful doors for you in the future. Just take that first small step.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Out of Sight</title>
        <published>2023-09-03T00:00:00+00:00</published>
        <updated>2023-09-03T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/elmore-out-of-sight/"/>
        <id>https://asun9.com/elmore-out-of-sight/</id>
        
        <content type="html" xml:base="https://asun9.com/elmore-out-of-sight/">&lt;p&gt;Book: &lt;strong&gt;Out Of Sight: A Novel&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Elmore Leonard&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;I knew of Elmore Leonard’s reputation as one of the modern masters of crime, but I just never got around to reading him. Thanks to a prime deal, I finally got to read &#x27;Out of Sight&#x27;, one of his bestsellers from the 90s. Many years ago I saw the trailer of the movie remake on TV, and as I read the opening lines, the memory of George Clooney’s irrepressible charisma came flooding back. From then on, in my mind’s eye, Jack Foley’s dialogues were only in Clooney’s distinctive drawl. While the book ostensibly is about Jack Foley, a convict on the run, and a U.S. marshal, Karen Sisco who’s chasing him, I will remember it more for the rapport and friendship between Foley and Buddy, and the banter between Karen and her father. Leonard is regarded as a master of dialogue, and he’s in top form here. The chemistry leaps across the paper. Minor characters make their entrance and with just a few lines appear fully rounded thanks to Leonard&#x27;s style.  The violence, when it arrives, is swift but not unbelievable. One can see the traces of Leonard’s fiction in Tarantino movies, chatty characters driving the plot, tension building slowly till it explodes in ultra-violence. Love it.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Comparative Advantages</title>
        <published>2023-08-29T00:00:00+00:00</published>
        <updated>2023-08-29T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/comparative-advantage/"/>
        <id>https://asun9.com/notes/comparative-advantage/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/comparative-advantage/">&lt;p&gt;From wikipedia:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;David Ricardo developed the classical theory of comparative advantage in 1817 to explain why countries engage in international trade even when one country&#x27;s workers are more efficient at producing every single good than workers in other countries. He demonstrated that if two countries capable of producing two commodities engage in the free market (albeit with the assumption that the capital and labour do not move internationally), then each country will increase its overall consumption by exporting the good for which it has a comparative advantage while importing the other good, provided that there exist differences in labor productivity between both countries. Widely regarded as one of the most powerful yet counter-intuitive insights in economics, Ricardo&#x27;s theory implies that comparative advantage rather than absolute advantage is responsible for much of international trade.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;What can you do that others can do as well, but it takes less effort for you to do it relative to others? A economics term that can be applied to self-improvement as well. Focus on your strengths, and do it everyday. This is a useful mental model to evaluate career choices, and deciding on which skills to build.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>State of books, and an early polemic</title>
        <published>2023-08-27T00:00:00+00:00</published>
        <updated>2023-08-27T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/books-celsus/"/>
        <id>https://asun9.com/notes/books-celsus/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/books-celsus/">&lt;p&gt;Two TILs:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Only 28 books sold more than 500,000 copies last year—and eight of them were by the same romance writer. Via &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.honest-broker.com&#x2F;p&#x2F;the-state-of-the-culture-2023&quot;&gt;Ted Gioia&lt;&#x2F;a&gt;
&lt;ul&gt;
&lt;li&gt;Also related &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;freddiedeboer.substack.com&#x2F;p&#x2F;everything-gawker-existed-to-satirize&quot;&gt;stat&lt;&#x2F;a&gt;: &quot;..advances for books &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.authorsguild.org&#x2F;industry-advocacy&#x2F;authors-guild-survey-shows-drastic-42-percent-decline-in-authors-earnings-in-last-decade&#x2F;&quot;&gt;have dropped 40%&lt;&#x2F;a&gt; in ten years, and in 2020, 98% of books &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.nytimes.com&#x2F;2021&#x2F;04&#x2F;18&#x2F;books&#x2F;book-sales-publishing-pandemic-coronavirus.html&quot;&gt;sold less than 5,000 copies&lt;&#x2F;a&gt;. The median advance is barely more than $6,000 now, and you are unlikely to earn out even that amount.&quot;&lt;&#x2F;li&gt;
&lt;li&gt;What this means is you cannot make a living as a writer any more. Writing books then is a status game, you do it in order to gain cred while you make your living another way. T.S. Eliot is model, not Hemingway (journalism doen&#x27;t pay either, unless you are a superstar). People are willing to write for free, and that&#x27;s what one is competing against.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;The_True_Word&quot;&gt;The True Word&lt;&#x2F;a&gt;, a lost 2nd century greek treatise refuting early Christianity. Two interesting points stand out:
&lt;ul&gt;
&lt;li&gt;The accusation that early christian theology was pilfered from eastern philosophy, which begs the question, what philosophy is Celsus (the author) talking about?&lt;&#x2F;li&gt;
&lt;li&gt;Celsus&#x27; principle antagonism towards the faith was that the recalcitrant believers refused to follow the acceptable social norms - venerating the emperor and offering sacrifices - thus destroying the social balance.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Notes from an India trip</title>
        <published>2023-08-26T00:00:00+00:00</published>
        <updated>2023-08-26T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/notes-india-trip-1/"/>
        <id>https://asun9.com/notes/notes-india-trip-1/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/notes-india-trip-1/">&lt;p&gt;India has changed rapidly since the last time I was there in 2018. Bangalore certainly has.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Lots of projects dominating the city skyline. Tall towers, many of which are residential.&lt;&#x2F;li&gt;
&lt;li&gt;Many gated apartments, all using MyGate application. This app provides allows residents to determine who can come in, and at what time. One can provide permanent passes to maids, temporary passes to friends and visitors, track issues in the complex, post ads.&lt;&#x2F;li&gt;
&lt;li&gt;No beggars. Don&#x27;t recall seeing any this time. Not in Bangalore.&lt;&#x2F;li&gt;
&lt;li&gt;Metro - people actually stood in line before entering. And the metro was clean. And very crowded. Build more public transport and people will use it!&lt;&#x2F;li&gt;
&lt;li&gt;Cashless payments everywhere. I was taken aback when everyone from Ola drivers to road side vendors preffered this to cash - I did not think they would want &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;The_Man&quot;&gt;the man&lt;&#x2F;a&gt; to keep track of their transactions.&lt;&#x2F;li&gt;
&lt;li&gt;Bookstores. Blossoms had expanded into three or four new buildings on church street. The bookstores I grew up with in Hyderabad and Chennai are dead. Could this be chalked down to the brand value that Blossoms has and the intersection of the book culture of Bangalore? Gangarams, on the same street, was empty.&lt;&#x2F;li&gt;
&lt;li&gt;The old gives way to the new. Rex, the theatre, was gone. Replaced by a shopping mall. Lots of new coffee places. Third Wave. Chai point. New brew pubs.&lt;&#x2F;li&gt;
&lt;li&gt;Lots of in-ear wireless head phones, of varying colors. In the United States, one only see&#x27;s Apple&#x27;s airpods.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Two days in Kumbakonam</title>
        <published>2023-08-10T00:00:00+00:00</published>
        <updated>2023-08-10T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/two-days-konam/"/>
        <id>https://asun9.com/two-days-konam/</id>
        
        <content type="html" xml:base="https://asun9.com/two-days-konam/">&lt;p&gt;Kumbakonam was hot. As hot as the bay area this past summer. Thanks to the humidity, the heat felt a lot less oppressive. The temples were weather beaten. The paint on the gopurams were faded. That hardy constant of the Indian landscape, arasamaram, ficus religiosa, grew in cervices on the temple walls and towers. There was not much of a crowd in the morning, but that could be because it was middle of the working week. The mornings were reserved for Swamimalai and the Sivan kovils. Adi Kumbeshwar has the largest gopuram in town. The Thiruvalasuzhi Pillaiyar kovil was in a particularly bad shape, with dense undergrowth everywhere between the amman, pillaiyar and sivan sannidhis, and graffiti on the temple walls.&lt;&#x2F;p&gt;
&lt;div style=&quot;display: inline-block;&quot;&gt;
  &lt;div style=&quot;display: flex; gap: 5px; justify-content: center; flex-wrap: wrap;&quot;&gt;
    
      &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;kumbakonam_2023&#x2F;thiruvalasuzhi-1.jpg&quot; width=&quot;250&quot; style=&quot;pointer-events: none;&quot;&gt;
    
      &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;kumbakonam_2023&#x2F;thiruvalasuzhi-2.jpg&quot; width=&quot;250&quot; style=&quot;pointer-events: none;&quot;&gt;
    
      &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;kumbakonam_2023&#x2F;thiruvalasuzhi-3.jpg&quot; width=&quot;250&quot; style=&quot;pointer-events: none;&quot;&gt;
    
  &lt;&#x2F;div&gt;
  
  &lt;div style=&quot;text-align:center; font-size: 0.8em; color: #777; margin-top: 5px; width: 100%;&quot;&gt;
    &amp;copy; Abhishek Sundararajan. All Rights Reserved.
  &lt;&#x2F;div&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;Later that morning, we managed to squeeze in a trip to Airavateswara temple at Darasuram. The nearby agraharams now had Saurashara weavers, who said they had been there for eight generations. Their house was dominated by one handloom that they made their living by. I was told it takes five days to make one silk saree. The husbands were responsible for soliciting tourists, while the wives and relatives worked on the loom. The weaver we visited said the family occupation was going to end with him. Both his children were leading a better life in Chennai and Bangalore, as software engineers. They conversed between themselves in Saurastri, which amazed me. This was a language they did not know to read or write, and there&#x27;s little pop culture produced, and yet it had survived in the heart of Tamil Nadu for this long.&lt;&#x2F;p&gt;
&lt;p&gt;From Darasuram, we went to Sarangapani temple, the largest of Perumal kovils in Kumbakonam. As a child I was fascinated by the temple elephant. It was not as big as I remembered it, but I was told it&#x27;s the same.&lt;&#x2F;p&gt;
&lt;div style=&quot;display: inline-block;&quot;&gt;
  &lt;div style=&quot;display: flex; gap: 5px; justify-content: center; flex-wrap: wrap;&quot;&gt;
    
      &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;kumbakonam_2023&#x2F;sarangapani_yaanai.jpg&quot; width=&quot;350&quot; style=&quot;pointer-events: none;&quot;&gt;
    
  &lt;&#x2F;div&gt;
  
  &lt;div style=&quot;text-align:center; font-size: 0.8em; color: #777; margin-top: 5px; width: 100%;&quot;&gt;
    &amp;copy; Abhishek Sundararajan. All Rights Reserved.
  &lt;&#x2F;div&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;The evenings were reserved for the Vaishnava temples - Ramaswami, Sarangapani, Chakrapani. Chakrapani was crowded. With the thronging people and prabandham in the air, one couldn&#x27;t help but believe in the old gods.&lt;&#x2F;p&gt;
&lt;div style=&quot;display: inline-block;&quot;&gt;
  &lt;div style=&quot;display: flex; gap: 5px; justify-content: center; flex-wrap: wrap;&quot;&gt;
    
      &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;kumbakonam_2023&#x2F;ramaswami_pillar.jpg&quot; width=&quot;350&quot; style=&quot;pointer-events: none;&quot;&gt;
    
  &lt;&#x2F;div&gt;
  
  &lt;div style=&quot;text-align:center; font-size: 0.8em; color: #777; margin-top: 5px; width: 100%;&quot;&gt;
    &amp;copy; Abhishek Sundararajan. All Rights Reserved.
  &lt;&#x2F;div&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;The next day we went to Thiruvaiaru to see the Sivan and Kaveri. The ghats - padithurai in tamil - closest to the temple were dirty, with people were offering prayers and doing last rites. The one near Thyagaraja Samadhi was cleaner. There were a couple of women bathing, and one man brushing his teeth, but no trash. They soon left. Amma touched the water there with her hands. I didn&#x27;t want to dirty mine. I did step into the cool waters though. A few locals were lying inside the samadhi and looking into their phones. No sense of sacred here. Amma became a little child at the banks of Kaveri. She had never seen the river in spate. As a child growing up in Madurai, she would visit her grand parents and the river only in summer, when it was dry. Ponniyin Selvan, and related mythologies had made the river a potent symbol in her mind, central to her conception of Tamil history. So she was as excited as one could be when she finally saw it up close.&lt;&#x2F;p&gt;
&lt;div style=&quot;display: inline-block;&quot;&gt;
  &lt;div style=&quot;display: flex; gap: 5px; justify-content: center; flex-wrap: wrap;&quot;&gt;
    
      &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;kumbakonam_2023&#x2F;amma_thiruvaiaru.jpg&quot; width=&quot;350&quot; style=&quot;pointer-events: none;&quot;&gt;
    
  &lt;&#x2F;div&gt;
  
  &lt;div style=&quot;text-align:center; font-size: 0.8em; color: #777; margin-top: 5px; width: 100%;&quot;&gt;
    &amp;copy; Abhishek Sundararajan. All Rights Reserved.
  &lt;&#x2F;div&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;It took us a little over an hour to go from there to Oppiliappan kovil, right before it closed for the noon, around 12 10 PM. This temple was crowded. They had recently done the Kumbabhishekam and whole temple was glowing, thanks to the fresh coat of paint. We could barely make it to the darshan. The murthy was beautiful, standing. This is one of the older temples in Kumbakonam, apparently older than the Varadarajan Perumal kovil in Kanchipuram (which is one of the three most illustrious Vaishnava temples). I later learnt from a mother of a friend that it is regarded as auspicious to visit a temple in the 38 days after the Kumbabhishekam, and that probably explains the crowds.&lt;&#x2F;p&gt;
&lt;div style=&quot;display: inline-block;&quot;&gt;
  &lt;div style=&quot;display: flex; gap: 5px; justify-content: center; flex-wrap: wrap;&quot;&gt;
    
      &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;kumbakonam_2023&#x2F;oppiliappan_temple.jpg&quot; width=&quot;350&quot; style=&quot;pointer-events: none;&quot;&gt;
    
  &lt;&#x2F;div&gt;
  
  &lt;div style=&quot;text-align:center; font-size: 0.8em; color: #777; margin-top: 5px; width: 100%;&quot;&gt;
    &amp;copy; Abhishek Sundararajan. All Rights Reserved.
  &lt;&#x2F;div&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;While we were in Kumbakonam, we stayed at &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;indecohotels.com&#x2F;swamimalai-honeymoon-indeco-resort-swamimalai&#x2F;&quot;&gt;Indeco Hotels Swamimalai&lt;&#x2F;a&gt;. There are a series of bunglows here, crafted out of three abandoned villages. The bunglows are in traditional tamil style, and the staff extremely friendly. The food is pricy, but not bad at all. If one would want to experience a village life in the style of the landlords in Thanjavur, one could do no better than Indeco.&lt;&#x2F;p&gt;
&lt;div style=&quot;display: inline-block;&quot;&gt;
  &lt;div style=&quot;display: flex; gap: 5px; justify-content: center; flex-wrap: wrap;&quot;&gt;
    
      &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;kumbakonam_2023&#x2F;indeco_bungla.jpg&quot; width=&quot;350&quot; style=&quot;pointer-events: none;&quot;&gt;
    
      &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;kumbakonam_2023&#x2F;indeco_scene.jpg&quot; width=&quot;350&quot; style=&quot;pointer-events: none;&quot;&gt;
    
  &lt;&#x2F;div&gt;
  
  &lt;div style=&quot;text-align:center; font-size: 0.8em; color: #777; margin-top: 5px; width: 100%;&quot;&gt;
    &amp;copy; Abhishek Sundararajan. All Rights Reserved.
  &lt;&#x2F;div&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;Here, for the first and likely the last time in my life, I was woken up by a crowing peacock.&lt;&#x2F;p&gt;
&lt;div style=&quot;display: inline-block;&quot;&gt;
  &lt;div style=&quot;display: flex; gap: 5px; justify-content: center; flex-wrap: wrap;&quot;&gt;
    
      &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;kumbakonam_2023&#x2F;indeco_peacock.jpg&quot; width=&quot;350&quot; style=&quot;pointer-events: none;&quot;&gt;
    
  &lt;&#x2F;div&gt;
  
  &lt;div style=&quot;text-align:center; font-size: 0.8em; color: #777; margin-top: 5px; width: 100%;&quot;&gt;
    &amp;copy; Abhishek Sundararajan. All Rights Reserved.
  &lt;&#x2F;div&gt;
&lt;&#x2F;div&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>JK on meditation</title>
        <published>2023-08-05T00:00:00+00:00</published>
        <updated>2023-08-05T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/jk-meditation/"/>
        <id>https://asun9.com/notes/jk-meditation/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/jk-meditation/">&lt;blockquote&gt;
&lt;p&gt;So a religious life is a life of meditation, in which the activities of the self are not. And one can live such a life in this world every day. &lt;strong&gt;That is, one can live a life as a human being in which there is constant alertness, watchfulness, awareness, an attentive mind that is watching the movement of the self. And the watching is watching from silence, not from a conclusion.&lt;&#x2F;strong&gt; Because the mind has observed the activities of the self and sees the falseness of it and therefore the mind has become extraordinarily sensitive, and silent. And from that silence it acts. &lt;em&gt;In daily life&lt;&#x2F;em&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Have you noticed also how little space we have inwardly, psychologically? Our minds are crowded with imagination, with all the things that we have learned, with various forms of conditioning, influences, propaganda. We are full of all the things that man has thought about, invented, our own desires, pursuits and ambitions, fears, and so on, and therefore there is very little space. Meditation, if you go into it very deeply, is the negation of all this, so that, in that state of attention, there is vast space without boundary. Then the mind is silent.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Enlightenment is not a fixed place. There is no fixed place. All one has to do is understand the chaos, the disorder in which we live. In the understanding of that we have order and there comes clarity, there comes certainty. And that certainty is not the invention of thought. That certainty is intelligence. And when you have all this, when the mind sees all this very clearly, then the door opens. &lt;strong&gt;What lies beyond is not nameable. It cannot be described, and anyone who describes it has never seen it. It cannot be put into words because the word is not the thing, the description is not the described.&lt;&#x2F;strong&gt; All that one can do is to be totally attentive in relationship, to see that attention is not possible when there is image, to understand the whole nature of pleasure and fear, and to see that pleasure is not love, and desire is not love.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Bengaluru after ages</title>
        <published>2023-08-01T00:00:00+00:00</published>
        <updated>2023-08-01T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/blore-pub-trans/"/>
        <id>https://asun9.com/notes/blore-pub-trans/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/blore-pub-trans/">&lt;p&gt;I had to make a trip to Bannerghatta to drop off my documents for the visa. It took me half a day to get there and come back home. In the process, I took all the forms of transportation Bengaluru had to offer - ridesharing taxi, auto rickshaw, the metro train, and bus. Started at 8 15 or so from Vidyaranyapura in an Ola cab, and reached Gopalan Mall in Bannerghatta at 9 37 am. Cost me 812 ruppees. The drop off itself was smooth. I was out by 10 15 am. Used an auto to get to the Jayanagar metro station around 10 20 am. The metro took me to Sandal Soap Factory station. The 401 RC bus took me to where I started, and I reached home at 11 57 am. 1.5 hours via public transport versus 1.2 hours via taxi. I would say that&#x27;s a public transport win. Also at 140 rupees, cheaper. This is my first time on a bus in Bengaluru in over 10 years. The bus was as old as ever, with some updates to how one is ticketed. There seems to be an app now. The bus had a few QR codes plastered for validating a pass or ticket. I found it interesting to see many people having wireless ear pods, many the non-Apple kind. There&#x27;s constant construction everywhere. I saw many, many tall apartment complexes - Prestige, Sattva, Brigade etc. Lone behemoths in a sea of small buildings. I had forgotten how green this place is. Lots of Copperpods and Gulmohars. Banyans. Parks. Still standing after all these years, unlike the Hyderabad I grew up in. The pollution is a constant. After a few hours on the road, my nose developed an irritation that lasted the whole day.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>The Star Principle</title>
        <published>2023-07-26T00:00:00+00:00</published>
        <updated>2023-07-26T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/star-principle/"/>
        <id>https://asun9.com/star-principle/</id>
        
        <content type="html" xml:base="https://asun9.com/star-principle/">&lt;p&gt;Book: &lt;strong&gt;The Star Principle&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Richard Koch&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;If you want to get rich, you could work hard, use natural abilities and such, but you can do quite well by being at the right place at the right time. You can be strategic about finding the right place. Richard Koch&#x27;s strategy is evaluating opportunities in terms of Boston Consultancy Group&#x27;s growth&#x2F;share matrix. This is a 2x2 matrix with the 4 quadrants occupied by four kinds of businesses. The leaders in high growth market are called stars. The other quadrants are question marks, dogs and cash cows. A star business is one that (a) is a market leader in its niche (b) and the market is growing by at least ten percent a year, on average, over many years.&lt;&#x2F;p&gt;
&lt;p&gt;Find a business like that and allow compounding to work its magic. It&#x27;s important that the growth is uninterrupted. Growing at 20% every year for 20 years will give you more returns than growing at 30% for 10 years. High growth sustained for a long time is the key.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;A business with sales of $10 million that grows at 3 per cent a year - roughly the rate the economy grows - will increase by 34 per cent over a decade, to just over $13 million. What will a business that grows at 30 per cent a year - ten times 3 per cent - grow by in the same time? You might assume is it ten times 34 per cent, which is 340 per cent, and add a bit for the effect of compounding, to take the growth to perhaps 500 per cent. If this were true the sales after ten years would have grown to $50 million. But the correct answer is nearly $138 million.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Find a business like that to invest, start such a business, or become an early employee at such companies.&lt;&#x2F;p&gt;
&lt;p&gt;Amazon and Google were stars. So was Apple. Betfair, which the author invested in, grew at over 30 percent &lt;em&gt;each month&lt;&#x2F;em&gt; in the early aughts. Coca Cola and McDonald were stars as well, with 99 percent of their value entirely due to growth - again, emphasizing the value of compound returns.&lt;&#x2F;p&gt;
&lt;p&gt;Koch says he has bet his entire career on stars. It is a religious belief that seemingly informs all his decisions.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Stars are where the universe creates good fortune. Stars are the source of wealth. Stars are the place to invest. Stars are the place to work. Know only one thing, so that you can’t ever forget it. Know the power of stars. Believe it. Act on it. Once you know this one thing, all the rest of your professional life is tactics - how to find your star before anybody else, how to ensure it stays a star, how to work in a star as one of the early star-mongers, how to get the most out of your star. But the tactics depend upon believing in the star idea. Believe in it, because it is true, because it is the single most vital truth in the business world, and because it can set you free.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;One thing is for sure, if you want out-sized returns, you must have the ability to fool yourself just enough to be dangerous. One sees this with LBJ, Steve Jobs, and Koch.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>The Polyglossic Tanjavur Maratha Kingdom</title>
        <published>2023-07-20T00:00:00+00:00</published>
        <updated>2023-07-20T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/18th-century-tanjavur/"/>
        <id>https://asun9.com/notes/18th-century-tanjavur/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/18th-century-tanjavur/">&lt;p&gt;In popular imagination Tamil Nadu is the land of Tamils, a more or less homogenous population even though they might be distributed into different jatis, with a sprinkling of minorities. The truth is that by the 18th century, what is today Tamil Nadu, and specifically south Tamil Nadu was a highly polyglossic society with people of different languages and ethnicies living with each other. D Dennis Hudson, speaking on the Tanjavur Maratha Kindom from the 17th and 18th centuries, says&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;... a complex linguistic, dynastic, and religious culture had emerged among the predominantly Tamil-speaking peoples of the region. The Marathi-speaking family that now ruled Tanjore and worshiped Siva had descended from warriors of the Bhonsle dynasty of Maharashtra; they had conquered the fortified capital in 1674. But Telugu-speaking Nayakas from the Andhra region, who worshiped Krishna or Vishnu, had preceded them as part of the earlier Vijayanagara realm centered in Karnataka; their Telugu-speaking presence was now permanent. The Vijayanagara realm had replaced the even earlier Cholas, and they carried on their predecessor’s patronage of Sanskrit as an elite literary and religious language. When the Mughal rulers and the French and British of the East India Companies joined the ancient struggle over Tanjore, Persian, French, and English were added to the Portuguese, German, Danish, and Dutch already there.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Bay Area Urban Trees</title>
        <published>2023-07-17T00:00:00+00:00</published>
        <updated>2023-07-17T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/street-trees-bay-area/"/>
        <id>https://asun9.com/street-trees-bay-area/</id>
        
        <content type="html" xml:base="https://asun9.com/street-trees-bay-area/">&lt;p&gt;Till I started taking my daughter out on walks I never paid attention to the trees on my street or those along the creek. Now I do, rather obsessively. I want to name them to her. I want to tell her where they are originally from, if they shed leaves in winter, if autumn changes the color of their leaves, how to identify them. So my walks are now spent looking at trees and making a record of those I can&#x27;t identify. These streets that I have walked hundreds of times, what was I doing before I started obsessing with the trees? I can&#x27;t recall now. Houses maybe. Usually lost in my head. That&#x27;s another thing to convey to her - there&#x27;s an infinite amount of detail in the world. One just has to know how to look.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;deodar-cedar&quot;&gt;Deodar Cedar&lt;&#x2F;h2&gt;
&lt;p&gt;There are a few on my street and around the block. Huge, so I suspect at least over 50 years old. I don&#x27;t recall ever seeing these in India, although one learns about them in school. Quite the contrast with Coast Redwoods that are nearby. Also prettier to my eyes, with those drooping branches and upright acorns.&lt;&#x2F;p&gt;
&lt;div style=&quot;display: flex; gap: 5px;&quot;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;trees&#x2F;cedar_deodar_1.jpg&quot; width=&quot;250&quot; &#x2F;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;trees&#x2F;cedar_deodar_2.jpg&quot; width=&quot;250&quot; &#x2F;&gt;
&lt;&#x2F;div&gt;
&lt;h2 id=&quot;london-plane-tree&quot;&gt;London Plane Tree&lt;&#x2F;h2&gt;
&lt;p&gt;There are streets and streets of these. Shed their leaves in fall. Great summer colors though. No matter how hot it gets - and there is a heat wave going on now - these streets are always cool. I don&#x27;t doubt it&#x27;s the trees.&lt;&#x2F;p&gt;
&lt;div style=&quot;display: flex; gap: 5px;&quot;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;trees&#x2F;london_plane.jpg&quot; width=&quot;250&quot; &#x2F;&gt;
&lt;&#x2F;div&gt;
&lt;h2 id=&quot;ash-tree&quot;&gt;Ash Tree&lt;&#x2F;h2&gt;
&lt;p&gt;I thought these were Neem first, but the leaves don&#x27;t smell like Neem, so my second guess is Ash trees. Both have opposite branching and compound leaves. I just don&#x27;t know which Ash. These are present in many places along the creek, and along many streets.&lt;&#x2F;p&gt;
&lt;div style=&quot;display: flex; gap: 5px;&quot;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;trees&#x2F;ash_tree_1.jpg&quot; width=&quot;250&quot; &#x2F;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;trees&#x2F;ash_tree_2.jpg&quot; width=&quot;250&quot; &#x2F;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;trees&#x2F;ash_tree_3.jpg&quot; width=&quot;250&quot; &#x2F;&gt;
&lt;&#x2F;div&gt;
&lt;h2 id=&quot;valley-oak&quot;&gt;Valley Oak&lt;&#x2F;h2&gt;
&lt;p&gt;Love the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.glendaleca.gov&#x2F;government&#x2F;departments&#x2F;public-works&#x2F;indigenous-tree-program&#x2F;valley-oak#:~:text=Valley%20oaks%20have%20an%20easily,leaf%20is%20a%20paler%20green.&quot;&gt;leaves&lt;&#x2F;a&gt; on these trees. While they are a prominent presence along the creek, the only other place I have seen them is on Wolfe Road right opposite the Apple Park gate, close to the entrace to 280.&lt;&#x2F;p&gt;
&lt;div style=&quot;display: flex; gap: 5px;&quot;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;trees&#x2F;valley_oak.jpg&quot; width=&quot;250&quot; &#x2F;&gt;
&lt;&#x2F;div&gt;
&lt;h2 id=&quot;sweetgum&quot;&gt;Sweetgum&lt;&#x2F;h2&gt;
&lt;p&gt;Another urban favourite, along with the London Plane tree. Easily identifiable leaves - 5 fingered, star shaped, lush green. Striking colors in autumn.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;coast-redwood&quot;&gt;Coast Redwood&lt;&#x2F;h2&gt;
&lt;p&gt;Unavoidable, if you are in the Bay Area. Reddish brown trunk, usually towering over the other trees in the area.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;cottonwood&quot;&gt;Cottonwood&lt;&#x2F;h2&gt;
&lt;p&gt;Heart shaped leaves with serrated edges. Seen these only along creeks here. Down there, these are bigger than even the oaks.&lt;&#x2F;p&gt;
&lt;div style=&quot;display: flex; gap: 5px;&quot;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;trees&#x2F;cottonwood.jpg&quot; width=&quot;250&quot; &#x2F;&gt;
&lt;&#x2F;div&gt;
&lt;h2 id=&quot;gingko&quot;&gt;Gingko&lt;&#x2F;h2&gt;
&lt;p&gt;These are everywhere once you notice them. Distinctive foilage, that shed seemingly at the same time in fall. You don&#x27;t want to park your car underneath these trees at that time.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;peruvian-pepper-tree&quot;&gt;Peruvian Pepper Tree&lt;&#x2F;h2&gt;
&lt;p&gt;Saw a few of these around the creek. The branches droop, while the leaves look like those of the Neem tree. Some had fruits.&lt;&#x2F;p&gt;
&lt;div style=&quot;display: flex; gap: 5px;&quot;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;trees&#x2F;peruvian_pepper.jpg&quot; width=&quot;250&quot; &#x2F;&gt;
&lt;&#x2F;div&gt;
&lt;h2 id=&quot;coast-live-oak&quot;&gt;Coast Live Oak&lt;&#x2F;h2&gt;
&lt;p&gt;So many of these along the creek. Most are young, with smallish trunks and no larger than 9 or 10 feet, so can&#x27;t be more than a decade or two old.&lt;&#x2F;p&gt;
&lt;div style=&quot;display: flex; gap: 5px;&quot;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;trees&#x2F;coast_oak.jpg&quot; width=&quot;250&quot; &#x2F;&gt;
&lt;&#x2F;div&gt;
&lt;h2 id=&quot;african-fern-pine&quot;&gt;African Fern Pine&lt;&#x2F;h2&gt;
&lt;p&gt;Another favourite of mine. Looks pretty good on any street, with that thick foilage. There are at least three close to where I live.&lt;&#x2F;p&gt;
&lt;div style=&quot;display: flex; gap: 5px;&quot;&gt;
  &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;trees&#x2F;african_fern_pine_1.jpg&quot; width=&quot;250&quot; &#x2F;&gt;
&lt;&#x2F;div&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>No Country For Old Men</title>
        <published>2023-07-07T00:00:00+00:00</published>
        <updated>2023-07-07T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/no-country-mccarthy/"/>
        <id>https://asun9.com/no-country-mccarthy/</id>
        
        <content type="html" xml:base="https://asun9.com/no-country-mccarthy/">&lt;p&gt;Book: &lt;strong&gt;No Country For Old Men&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Cormac McCarthy&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;It’s been a while since I made an impulse purchase. When I finally did at the local bookstore, it was this one. I was rifling through the book and came across a conversation between Sheriff Bell and his deputy. I knew then I had to read the entire thing. Now that it’s been done, what do I think of it? That the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=38A__WT3-o0&quot;&gt;movie&lt;&#x2F;a&gt; is just about perfect. Cormac McCarthy’s writing is so sparse that entire exchanges here have made it as dialogues with little modification.  Each time a new character was introduced all I could think of was the actor cast in movie for that role. A rare instance where the book doesn’t improve on the movie. The book doesn’t stand too shabbily either, but it does not add any new context or perspective. McCarthy&#x27;s characters are taciturn when interacting with each other. Sheriff Bell is chatty when he&#x27;s talking to us, but not otherwise. I imagine this could have been made into a screenplay without much effort. There are some larger themes here, about good and evil, fate, loyalty, actions and reactions. This last feels like the concept of karma. Every action produces consequences, except in McCarthy&#x27;s universe it closes more doors than it opens. If one is unlucky, the consequence sometimes takes the form of an unemotional, remorseless hitman, Anton Chigurh. Chigurh is a very fascinating character, and I was hoping for more backstory, but there is nothing of value here that&#x27;s not in the movie. Chigurh, Bell, Moss, Wells are all veterans. They have seen death, and consequently their world views shaped by it in different ways. Did Wells and Chigurh know each other from Vietnam? What does the outfit in Houston do? What&#x27;s the relationship between that outfit and the drug runners from across the southern border? So many unanswered questions. Unlike other crime books, there are loose ends and I suspect that&#x27;s part of the reason for my fascination with this world. The cartel landscape has been explored since the book came out in other movies and fiction - Breaking Bad, Sicario, Don Winslow&#x27;s works. None with McCarthy&#x27;s sense of doom and concerns with evil however.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Coonan Cross Oath</title>
        <published>2023-07-06T00:00:00+00:00</published>
        <updated>2023-07-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/coonan-cross/"/>
        <id>https://asun9.com/notes/coonan-cross/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/coonan-cross/">&lt;p&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.jstor.org&#x2F;stable&#x2F;44148123?seq=1&quot;&gt;The oath of the &#x27;Coonan Cross&#x27; (Leaning Cross), Mattancherry, Cochin, January 16, 1653 A.D&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&quot;The Coonan Cross Oath (Malayalam: കൂനൻ കുരിശ് സത്യം, romanized: Kūnan Kuriśŭ Satyaṁ), also known as the Great Oath of Bent Cross, the Leaning Cross Oath or the Oath of the Slanting Cross, taken on 3 January 1653 in Mattancherry, was a public avowal by members of the Saint Thomas Christians of the Malabar region in India, that they would not submit to the Jesuits and Latin Catholic hierarchy, nor accept Portuguese dominance (Padroado) in ecclesiastical and secular life.&quot;&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>What&#x27;s Our Problem?</title>
        <published>2023-07-05T00:00:00+00:00</published>
        <updated>2023-07-05T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/tim-urban-liberalism/"/>
        <id>https://asun9.com/notes/tim-urban-liberalism/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/tim-urban-liberalism/">&lt;p&gt;Book: &lt;strong&gt;What&#x27;s our problem?&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Tim Urban&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;A great introduction to classical liberalism, masquerading as a self-help book. He&#x27;s preaching to the choir here, so nothing new to learn. Has some useful talking points about social justice fundamentalism though, one that can map very well to India. While it pairs well with Fukuyama&#x27;s book on liberalism, this is far more America-centric. I don&#x27;t buy his suggestions for fixing this madness. It will - might - work for those who read this book and are persuaded by the arguments presented, but that&#x27;s not enough. One needs institutional power, something liberal ideas once had.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>The Happy Sleeper</title>
        <published>2023-06-21T00:00:00+00:00</published>
        <updated>2023-06-21T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/happy-sleeper/"/>
        <id>https://asun9.com/happy-sleeper/</id>
        
        <content type="html" xml:base="https://asun9.com/happy-sleeper/">&lt;p&gt;Book: &lt;strong&gt;The Happy Sleeper&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Heather Turgeon, Julie Wright&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;&#x2F;h2&gt;
&lt;p&gt;The good: to the point and after some experimenting, the technique appears to be working so far. The bad: I wish they had citations for each of the claims they make about trauma, protest crying and such. While there are footnotes and links to studies or peer reviewed research, these are not easily accessible and sparser than I thought it should be. Still this is a 4-star book because it’s arrival was really opportune, right around the time the terror was ready for sleep-training and for all its faults, the authors stick to a process and don’t hedge.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-routine&quot;&gt;The Routine&lt;&#x2F;h2&gt;
&lt;p&gt;Here&#x27;s a routine that worked for us. First, get a lovey. It is a transitional toy that comforts the baby. While the baby can play with it, its role is to act as cue to the baby that it’s time to sleep. This could be a tiny blanket or some stuffed toy. Another thing you would need is a speaker to play some white noise. Babies around the 5 month age are highly amenable to routines and this is the perfect time to train them. The goal is to help the baby to soothe herself and not depend on you, the parent, for it. While there are no long term consequences for the baby, there are immediate benefits for the working parents&#x27; mental health. The training process takes a few days, less than a week. The trick is to be consistent and use it for all naps, without exception. 5 months is perfect for training because the baby can roll around and move, and hence put herself in a position she likes. It&#x27;s best to train after 4 months also because that&#x27;s when the baby&#x27;s circadian rhythm has settled and she&#x27;s ready for longer night time sleep.&lt;&#x2F;p&gt;
&lt;p&gt;When the baby is ready for a nap, we do the following:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Darken the room with black out curtains.&lt;&#x2F;li&gt;
&lt;li&gt;Play white noise. If you have a HomePod, say &quot;Hey Siri, play white noise.&quot;&lt;&#x2F;li&gt;
&lt;li&gt;Put the baby in the crib and say some comforting words. For us, in the night it is “Good night kannu kutti. Naanga inga dhan irukom”. During the day, it’s “Thoongu kanna. Inga dhaan irukom.” Remember, babies are highly amenable to routines, so it&#x27;s better for us to stick to the same script each time.&lt;&#x2F;li&gt;
&lt;li&gt;Give her the lovey. Then move out of sight or leave the room.&lt;&#x2F;li&gt;
&lt;li&gt;The baby plays for a bit and will sleep at the end of it, in 10 min or so. If the baby doesn’t sleep in 10 min, giving a pacifier will put her to sleep in a few seconds. We give the pacifier and pat her gently for a bit till she’s asleep.&lt;&#x2F;li&gt;
&lt;li&gt;If baby hasn’t slept after her lovey play and is instead crying, wait for exactly a minute and give the pacifier. She should be crying loudly. Moaning or purring or making protest noises is not crying.&lt;&#x2F;li&gt;
&lt;li&gt;We initially played Moon Child album by Bombay Jayashree at the end of play, but now the baby sleeps with just the white noise. Still useful to play the same music each time and that music should be used only for sleep. That’s a powerful cue.&lt;&#x2F;li&gt;
&lt;li&gt;The crib, lovey, darkened rooms and white noise should be used only for sleeping. Once she gets up, open the blinds, turn off the white noise, and mover her from the crib. The lovey stays with the crib.&lt;&#x2F;li&gt;
&lt;li&gt;We have noticed that tiring the baby during wake hours with &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;safetosleep.nichd.nih.gov&#x2F;reduce-risk&#x2F;tummy-time&quot;&gt;tummy time&lt;&#x2F;a&gt; would result in deeper naps and longer night time sleeping.&lt;&#x2F;li&gt;
&lt;li&gt;Having a night diaper during the initial training also helps. Now she sleeps through most of the night without the night diaper.
&lt;ul&gt;
&lt;li&gt;I don&#x27;t recall anything in the book about wet diapers waking up the child, but it was a constant issue for us. This was quite the game changer.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;If the baby gets up before the expected time, unless she’s wet her diapers, give her space to fall asleep by herself. If she cries, pat her gently and she should fall asleep. Else give the lovey and follow the routine. If the baby is inconsolable, she has probably wet her diapers or is hungry.&lt;&#x2F;li&gt;
&lt;li&gt;In preparing for night time sleeping, following the same routine in the lead up to the crib helps a lot. We bathe her, read a book, and quieten the entire house. We gradually turn of the lights in the room we feed her. This is almost always around the same time each day, starting around 5 30 PM. She&#x27;s in the crib between 7 and 7 30 PM.&lt;&#x2F;li&gt;
&lt;li&gt;For day time naps, an assertion from the book that turned out to be true for our baby: she&#x27;s sleepiest every 90 minutes from her last wake time. She&#x27;s usually asleep in a few minutes when provided the right cues.&lt;&#x2F;li&gt;
&lt;li&gt;Unless unavoidable, ensure that the baby goes to sleep only in the crib under the designed circumstances. Try not to get her to sleep by carrying and juggling her or at the feeding bottle.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Book Notes: From Zero to Kyocera</title>
        <published>2023-06-20T00:00:00+00:00</published>
        <updated>2023-06-20T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/inamori-kyocera/"/>
        <id>https://asun9.com/inamori-kyocera/</id>
        
        <content type="html" xml:base="https://asun9.com/inamori-kyocera/">&lt;p&gt;Book: &lt;strong&gt;From Zero to Kyocera&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Kazuo Inamori&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;&#x2F;h2&gt;
&lt;p&gt;Old man looking back on a well lived life. A genre I really like, especially the East Asian kind. Hits all the check boxes: be kind, think of your people, and have an insane work ethic. Do the right thing and the money will follow. I can take a swig of this, yeah. No hideous self-pity like those from the Anglo-sphere, no horrible bosses or discussions of bad marriages and personal failings. Just a life of spiritual commitment. John Wooden would love it. Kazuo Inamori founded Kyocera when he was 27, rode the semiconductor wave thanks to an early relationship with Fairchild Semiconductors and now has a mythic status in Japan for turning around Japan Airlines after it went bankrupt, founding the telecommunication giant DDI, setting up the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Kyoto_Prize&quot;&gt;Kyoto Prize&lt;&#x2F;a&gt;, and being a trained Zen monk. I want to listen to him.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;notes&quot;&gt;Notes&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;It&#x27;s important for both companies and individuals to project their abilities into the future. Goals should always be set at a level that exceeds current capabilities. From the outset, establish a goal that seems impossibly high and decide to achieve it at some point in the future. Then, figure out ways to improve your capabilities to the point where that high goal can be met.&lt;&#x2F;li&gt;
&lt;li&gt;Fierce willpower and passion are needed to turn dreams into reality. One must have a deep desire for self-fulfillment that gushes out from the inner recesses of the soul. To do something truly creative, one must overcome all difficulties with an iron will that wells up from deep within the body and will not rest until the task is successfully accomplished.&lt;&#x2F;li&gt;
&lt;li&gt;When attempting something truly creative, the most important thing is to believe in yourself, which means having confidence. Without a solid, internal standard for making decisions, a standard you can believe in and put into action, you will lose your way as you grope through creativity&#x27;s uncharted territory.&lt;&#x2F;li&gt;
&lt;li&gt;I say this because I&#x27;m confident that I have striven to achieve a perfect life on a daily basis. Only after dedicating each and every day to perfection can we set our own course with confidence.
&lt;ul&gt;
&lt;li&gt;To reach perfection, we must resist the temptation to cut corners, refuse to make excuses, and always maintain an attitude of staunch rigor. This is not an easy-going attitude that calls for concentration only in the moment when it&#x27;s necessary. Rather, it requires a habitually serious engagement with all things, and an involvement with daily work that is filled with tense awareness. If this heightened mentality becomes habitual, it can generate correct decisions even in creative fields that have never before been experienced.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;The Result of Life or Work = Attitude × Effort × Ability
&lt;ul&gt;
&lt;li&gt;People who are cynical and envious and refuse to live decently are negative by nature and are assigned a negative value on the attitude scale. To the extent that they are talented and enthusiastic, such people are doomed to suffer tragic ends in their lives or work. People&#x27;s lives can be utterly transformed depending on whether or not they have an excellent philosophy.&lt;&#x2F;li&gt;
&lt;li&gt;The industrial titans Konosuke Matsushita (who founded Panasonic Corporation.) and Soichiro Honda (founder of Honda Motor Co., Ltd.) did not have advanced educations. Both entered apprenticeships right out of school, so they had neither advanced academic experience nor specialized knowledge. However, both had supreme enthusiasm burning in their hearts and worked with unrivaled intensity. They also had the noble desire to make a positive contribution to the lives of their employees and to many people in society at large.&lt;&#x2F;li&gt;
&lt;li&gt;Effort can also be defined as enthusiasm.
&lt;ul&gt;
&lt;li&gt;Throughout my life, I have striven to maximize the element of effort in my formula. From the time at my first job, when I was researching new ceramics at Shofu Industrial, through the founding of Kyocera with my colleagues, and all the way up to the present day, &lt;strong&gt;I have put many times more effort into my work than most people do just to reach a point I considered to be average. I put all of my body and soul into it, to the point where people around me repeatedly predicted that I would someday collapse from exhaustion.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;I got my start in the working world as an engineer and have been involved in R&amp;amp;D for many years. If I were to characterize my own approach to research, I would liken it to a tribe of hunters in pursuit of prey. Bearing a single spear, I track my quarry in tireless pursuit, neither sleeping nor resting until I have brought it down. &lt;strong&gt;The strong desire to be the person I want to be, the sense of responsibility to make sure I complete what I set out to do no matter what, and the determined refusal to whine or complain all compel me to complete the task.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;The Kyoto Prize Philosophy encapsulates my personal view of life: that we have no higher calling than to serve the greater good of humankind and society. I wanted to repay the debt of gratitude I owed to people who had nurtured me, to human society, and to the world.&lt;&#x2F;li&gt;
&lt;li&gt;This &quot;grit&quot; to which I refer can also be called &quot;fighting spirit.&quot; Managers must have the fierce spirit never to lose in the face of battle.
&lt;ul&gt;
&lt;li&gt;A person without these qualities should not be a manager; doing so will make him miserable and will lead to misfortune for employees and everyone involved with the company. A person who wants to live a fun and easy-going life should not become the manager of a company.&lt;&#x2F;li&gt;
&lt;li&gt;It is extremely hard to constantly think about work from morning to night. But that&#x27;s what is required of a manager. Without it, the company will not thrive in the face of increasingly severe business conditions year upon year. On the other hand, if one does possess this kind of fervent desire and keeps working harder than anyone, success will certainly be achieved no matter how the business environment changes.&lt;&#x2F;li&gt;
&lt;li&gt;The more a manager burns with fighting spirit and desires to improve his company by any means, the more important it is for him to learn the philosophy of doing what is right as a human being. In this way, he can admonish himself when he begins to lose his way (as he is likely to do), and keep working with intense desire and a strong will. Not only will he be bound for success, but that success will certainly continue over an extended period of time.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Old men looking back, East Asian edition</title>
        <published>2023-06-19T00:00:00+00:00</published>
        <updated>2023-06-19T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/old-men-1/"/>
        <id>https://asun9.com/notes/old-men-1/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/old-men-1/">&lt;p&gt;Here are some books by old east asian men looking back on a well lived life.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Gichin Funakoshi, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;a.co&#x2F;d&#x2F;b7vBxKo&quot;&gt;Karate-Do: My Way of Life&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Lee Kuan Yew, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;a.co&#x2F;d&#x2F;8gnDq9E&quot;&gt;The Singapore Story&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Kazuo Inamori, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;a.co&#x2F;d&#x2F;3rZu49u&quot;&gt;From Zero To Kyocera&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Empires of the Sea</title>
        <published>2023-05-27T00:00:00+00:00</published>
        <updated>2023-05-27T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/ottoman-of-the-seas/"/>
        <id>https://asun9.com/ottoman-of-the-seas/</id>
        
        <content type="html" xml:base="https://asun9.com/ottoman-of-the-seas/">&lt;p&gt;Book: &lt;strong&gt;Empires of the Sea: The Siege of Malta, the Battle of Lepanto, and the Contest for the Center of the World&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Roger Crowley&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The Ottomans were the lords of the Mediterranean for close to half a century, from 1520 to 1570. The beginning of their suzerainty over the sea under Suleiman the Magnificent was due to a happy coincidence - the Barbarossa brothers offered their service to him, and expanded Ottoman territory by handing off Algiers which they had won by fighting the Spanish and their Berber allies. Now they needed to defend themselves against the Spaniards and the Great Turk would help them do it. The Ottomans knew they couldn&#x27;t keep their empire if they didn&#x27;t control the seas. Constantinople was situated on seaway connecting the Black Sea, the Aegean Sea, and the Mediterranean. The islands of the Mediterranean closest to the empire were controlled by the Genoese, Venetians, Greeks and the crusading Knights of St John. Their location meant they faced crusaders, corsairs, and constant war without commanding the sea. Thus they were compelled both by circumstances and ambition to take control of the Mediterranean, and they succeeded for a while.&lt;&#x2F;p&gt;
&lt;p&gt;Suleiman had another reason to expand into Europe. He resented the Habsburg monarch Charles V, elected the Holy Roman Emperor. The Ottomans considered themselves inheritors of the Byzantine Empire, and through them the Roman Empire. Byzantine emperor John VI Kantakouzenos gave his daughter Theodora in marriage to Orhan, the second bey of the Ottomans, in 1346 in exchange for Ottoman troops coming to aid his side in the Byzantine civil war. Their son Halil was betrothed to Irene, daughter of John VI’s son, Matthew. Because of such marriages and other trysts, Ottoman princes were born of Byzantine as well as Armenian, Serbian, and other Christian mothers. Suleiman always referred to Charles V as the King of Spain, while he himself was the Caesar. Charles V and the Pope of course begged to differ. Charles V also took very seriously his role as The Catholic Monarch. Thus the stage was set, and Charles V lost almost every battle in the contest for the Mediterranean. The Spaniards could afford to battle thanks to gold from the New World. They couldn&#x27;t win because of constant infighting with other European powers - mainly the Venetians, France of Francis I or ascendant Protestant powers. Thus it was that the in first half of the 16th century the Ottomans gradually added to their possessions Tunis, Rhodes and a host of islands under Venetian and Genoese control. The Kings of St John were kicked out of Rhodes and had to settle on Malta. The Ottomans did not win every time - there&#x27;s the Great Siege of Malta to prove the point. But they had a reputation for winning, and winning for close to a century.&lt;&#x2F;p&gt;
&lt;p&gt;The greatest of Ottoman captains - Dragut Reis, Hayreddin Barbarossa, Uluch Ali were all galley slaves at some point.  Considering the upward trajectory of these slaves under Ottomans - usually Christians who converted to Islam - it seems like the Ottomans were more meritocratic in contrast to the Habsburgs, or indeed any of the Christian European kingdoms. Both the Europeans and the Ottomans were brutal to their opponents. Each was the infidel to the other, and hence there was great virtue in visiting depredations on them. Thus the Knights of St John set sail almost every year to conduct their personal maritime crusade, sweeping the seas for Islamic plunder and slaves in the name of religion. The Spaniards and the Portuguese were busy enslaving in the New World and West Africa. Europe was on the receiving end of the slavery by the Islamic empires - though the numbers slaved to the Turks and Mamluks far exceeded the black slaves taken in the sixteenth century. The Turks come off as particularly savage. One envoy of France to Constantinople, a priest named Maurand, was escorted by Hayreddin Barbarossa. During that trip, Barbarossa’s imperial fleet raided Lipari, a volcanic island off the coast of Sicily. After pillaging and ransoming the Lipariots, Maurand notes that a few of the most aged were found sheltering in a church. The corsairs seized them, stripped off their clothes, and cut them open while still alive, “out of spite.”&lt;&#x2F;p&gt;
&lt;p&gt;By 1570, Christian Europe&#x27;s sense of military inferiority was deeply ingrained, till a series of events transpired that lead to eventual reversal of fortunes.  Each new Ottoman emperor had to sanctify his reign by expanding his territory on ascending his throne. Thus for Suleiman it was beating the fortresses of Belgrade into submission. For Selim, his predecessor, it was Mamaluk Egypt. For Selim II, the son of Suleiman, it was Cyprus. Cyprus was a Venetian possession. Over the course of summer, the Ottomans gradually took control of the island, one fortress at a time. After taking over the citadel of Famagutsa, they flayed its much loved governor, Marcantonio Bragadin, reneging on their promise to let the defenders depart in peace. Around this time there was a new crusading Pope, Pius V. He wanted nothing short of destruction of Turkish power and taking back the Levant from the infidels. Towards that end he assembled yet another Holy League under Philip II, the new Holy Roman Emperor, the Genoese, the Venetians and the Knights of St John. The Venetians had lost Cyprus and were spoiling for a fight. The Knights of Saint John were virtually the sworn enemies of Venice. The Genoese and Venetians don&#x27;t get along either. As they make their way East they start bickering among themselves and the League almost comes apart. This is when the news comes to them about what the Turks have done to Baragdin. Now united in their hatred they start towards Leptano where an Ottoman fleet is awaiting them. The galleys of the League are newer, larger and packed with artillery. The Ottomans are tired from their conquest of Cyprus, but supremely confident in their ability to defeat a disunited enemy. When they meet, exceeding all expectations, it&#x27;s the  League that wins in what will turn out to be the largest sea battle in history till that point.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;In four hours 40,000 men were dead, nearly 100 ships destroyed, 137 Muslim ships captured by the Holy League. Of the dead, 25,000 were Ottoman; only 3,500 were taken alive. Another 12,000 Christian slaves were liberated.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;This apparently has an electrifying effect on the European rivals of the Ottomans, giving them more confidence than should have been warranted. The Ottomans were dismissive of the loss, and in a year had built a larger fleet than they had before. So rapid was this reconstruction that Sokollu could taunt the Venetian ambassador about their relative losses at Cyprus and Lepanto: “In wrestling Cyprus from you we have cut off an arm. In defeating our fleet you have shaved our beard. An arm once cut off will not grow again, but a shorn beard grows back all the better for the razor.”&lt;&#x2F;p&gt;
&lt;p&gt;The author states that this victory was important not just because it showed that the Ottomans were not invincible, but thenceforth their boundaries in the sea would be frozen. The Ottomans would no longer expand in the Mediterranean. At Lepanto, the empire suffered its first military catastrophe since the Mongol warlord Tamerlane shattered the army at Ankara in 1402. To make war, one needs money and there were other factors at play that would determine the ambition of the Ottoman. One was the steady stream of gold from the New World. The Spanish real became the most appreciated currency in the Ottoman empire; it was impossible to strike money of matching value. The silver coins paid to the soldiers grew increasingly thin; they were “as light as the leaves of the almond tree and as worthless as drops of dew,” according to a contemporary Ottoman historian.&lt;&#x2F;p&gt;
&lt;p&gt;While the author doesn&#x27;t mention it, the Ottomans were busy battling a new European superpower in the Indian Ocean, the Portuguese. The brutality of the Portuguese and the surprise of everyone who encountered it in Indies is well documented. I never understood Da Gama&#x27;s implacable hatred of the muslims - his burning of the Hajj pilgrim ship comes to mind. After learning about the ravaging of the Mediterranean and the reconquista in Spain and Portugal, the context that informs their actions is apparent now. They were no more brutal than the Spaniards in the New World, or Barbarossa and Dragut in the Mediterranean.&lt;&#x2F;p&gt;
&lt;p&gt;This was quite the rollicking read.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>The Horde</title>
        <published>2023-05-14T00:00:00+00:00</published>
        <updated>2023-05-14T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/the-horde/"/>
        <id>https://asun9.com/the-horde/</id>
        
        <content type="html" xml:base="https://asun9.com/the-horde/">&lt;p&gt;Book: &lt;strong&gt;The Horde: How the Mongols Changed the World&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Marie Favereau&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Soon after Chinggis Khan died, the Mongol Empire was divided between his four sons, following a long-standing Mongol practice. This division eventually turned permanent, with each becoming their own imperial formation. There was the empire of the Ogedei Khan, the de facto Great Khan, encompassing most of East Asia. Tolui Khan inherited the Mongol heartland. Chagtai Khan inherited Central Asia, which included Northern Iran. Jochi Khan, once Chinggis&#x27;s favorite, died before his father. His children inherited the Eurasian Steppe. This included parts of what is modern day Russia, the area around lower Volga. Jochi&#x27;s inheritance is the subject of this book. By virtue of being the most distant from the Great Khan, with an open border available for expansion, they became one of the most powerful and influential movers of the Mongol Empire, even while these successors would never go back to Mongolia. They called themselves Orda, The Horde.&lt;&#x2F;p&gt;
&lt;p&gt;Modeled after Pax Romania and Pax Britannia, the author&#x27;s central thesis is that there was Pax Mongolica, a period of stability in dominions Mongols conquered between 1200 and 1300. This led to an explosion of trade networks that led to an significant increase in exchange of goods. The empires of the Mongols facilitated the flourishing of art, the development of skilled crafts, and the progress of research in various areas such as botany, medicine, astronomy, measurement systems, and historiography. The author characterizes this shift as being as monumental as the Columbian exchange, and calls it the Mongol exchange. The Mongols prioritized trade, and merchants were often rewarded with lofty distinctions, legal privileges, and tax exemptions. A lot of the book is the focus on the unique Mongol policies that meant there was no clash between empire building and globalization. They did not work their subjects to death like the later Atlantic overlords did as long as they could tax them to mutual benefit. They even converted religions if it means furthering their interest. In the 1260s the Jochid elite converted en masse to Islam in order to win powerful friends and trading partners in Muslim-ruled lands. This extraordinary focus on trade was tied to the Mongol belief system.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;The Mongols saw commodities as receptacles or mediums of something immaterial, and circulation of this immaterial something was essential to the cosmic balance of the world. Specifically, the qubi, the redistribution system, supported not only the living but also the dead, whose spirits needed to be continuously appeased in order to protect the living from negative interference by the “ill dead.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Another thesis is that there wouldn&#x27;t be a modern Russia if not for the Horde&#x27;s deliberate economic policies that fostered Russian growth. This contests the idea of the &quot;Tartar Yoke&quot;, that the Russian nation celebrated by nationalists is one created in opposition to despotic Mongol rule. Russia in the 12th century was splintered between various groups that were in conflict with each other - Novogord, Tver, Muscovy and so on. The Jochids conquered them all and made them vassals, thus unifying them for the first time. Jochid policies eventually favored the duchy of Moscow, making it the most powerful of the Russian principalities and initiating a shift from the Kievan regime, the consequences of which are still apparent today. On the Steppe, all the various Turkic and Chinese tribes defeated by the Mongols became Mongol. Thus it was with Kereit and then the Merkit warriors whose families were assimilated, and their leading women were married into Temüjin’s family. This was also true of the Eurasian steppe, with the Qipchaqs elite becoming the Jorchid elite. But the Rus - the Mongols allowed them to form their own identity as long as they paid tribute to the Horde. While in China and Central Asia, the Mongols were much more interventionist, in Russia, they allowed the landowners to keep their domains intact.&lt;&#x2F;p&gt;
&lt;p&gt;One of the commodities of the Mongol exchange with some consequence in the world is that of slaves from the Steppe. The Mamluks of Egypt now had a direct line to their principal source of military manpower, as their warrior slaves arrived mainly from the Qipchaq steppe. I found it interesting that the author doesn&#x27;t comment on the morality of this trade, considering how much condemnation most discussions of Atlantic one entails. The Black Death in the fourteen century hastened the dismantling of the Mongol empires(s). The pandemic shattered trade and circulation, the lifeblood of the Chinggisid regimes, weakening them forever. The covid pandemic did not lead to the destruction of the current world systems. Yet. So is what we have more robust than the global empire of the Mongols? It&#x27;s certainly a thought that Pax Americana and the death of capitalism is not really nigh.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Into The Silence</title>
        <published>2023-04-30T00:00:00+00:00</published>
        <updated>2023-04-30T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/everest-mallory-raj/"/>
        <id>https://asun9.com/everest-mallory-raj/</id>
        
        <content type="html" xml:base="https://asun9.com/everest-mallory-raj/">&lt;p&gt;Book: &lt;strong&gt;Into the Silence: The Great War, Mallory, and the Conquest of Everest&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Wade Davis&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;A very absorbing and ambitious piece of work that combines such disparate narratives such as the opening of Tibet in early 20th century, the Great Trigonometrical Survey of India, and the impact of World War I on British psyche. The more I learnt about George Mallory the less I cared for him. The only way to explain the fanboyism around him is the convergence of the media&#x27;s need for heroes, the allure of Everest as their siren and the time it took to discover his body. Luckily in this tale there are far more interesting characters than Mallory, many who I hadn&#x27;t heard of before. There are Moreshead and Bailey, who made an unauthorized expedition to Tibet in 1913 and determined that the Brahmaputra and Tsangpo are indeed the same rivers. Then there is the Canadian Oliver Wheeler, also part of the Survey of India, who documented the six hundred square miles of the immediate vicinity of Everest, on a one-inch scale, a significant technical breakthrough in 1921. There is Howard Somerville, who chose to give up a medical practice in London to serve the Indian poor in Neyoor, while also at the same time being a film music composer, painter and mountaineer. All had served in the Great War. All were lucky to survive both the War and Everest.&lt;&#x2F;p&gt;
&lt;p&gt;There are also the pandits who serve the Raj, spies of the Great Game immortalized by Kipling in Kim, often unrewarded for their exertions. Kinthup, a Lepcha from Sikkim, who first determined that Brahmaputra is connected to Tsangpo in the 19th century, ended up being enslaved in Tibet before escaping. By the time he got back from his assignment, either his British masters were dead or did not care. Nain Singh, the first surveyor to fix the location of the Tibetan capital, traveled on foot from Sikkim to Lhasa and then all over central Tibet, walking 1,580 miles, or 3,160,000 paces, each counted. Pundit Hari Ram, who in 1871 completed a secret traverse from Shigatse to Nyelam, might have been the first British agent to have glimpsed Everest from the Tingri Plain in Tibet.&lt;&#x2F;p&gt;
&lt;p&gt;Wade Davis is very generous in his interpretations of people and events, whether it&#x27;s Tibetans, Indians or the Everest expedition party. His harshest words are reserved for Douglas Haig, who commanded the British Army on the &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;notes&#x2F;ww1-elites&#x2F;&quot;&gt;Western Front&lt;&#x2F;a&gt; of the war and never set foot on the field. Davis doesn&#x27;t offer an apologia of the empire, nor does he dismiss these people as mere cultural supremacists as is the current fashion. His style is a little bit odd, having us visit the Somme or other sites of the War each time he introduces a new character. It can get weary, but the people he documents are so interesting I can forgive him for that. The reference books listed in the appendix are a treasure, as also his notes on how he came across each.&lt;&#x2F;p&gt;
&lt;p&gt;Recommended.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Invasions on the British Isles</title>
        <published>2023-04-27T00:00:00+00:00</published>
        <updated>2023-04-27T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/british-isles-pop/"/>
        <id>https://asun9.com/notes/british-isles-pop/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/british-isles-pop/">&lt;p&gt;I have been rabbit-holing into Bristish histroy these last few days, thanks to the excellent Rest Is History podcast. Lots of TILs here, one of the biggest for me being how integrated Britain was into mainstream Europe even in the first mllenium CE.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;The British Isles were first populated by Ice Age hunter gatherers from the European continent. This is around 12,000 or so years ago.&lt;&#x2F;li&gt;
&lt;li&gt;These Ice Age folks were then replaced by farmers from the Near East, who brought with them agriculture. These are the people who erected the Stone Henge.&lt;&#x2F;li&gt;
&lt;li&gt;These early farmers were then replaced by people who migrated from the European steppe around 4,500 years ago. They brought with them the Indo-European languages, which eventually became the Celtic languages. There was 90% turn over in the population, and these became the Celtic peoples. There is no genetic relation between those inhabiting the islands today and the Stone Henge folks.&lt;&#x2F;li&gt;
&lt;li&gt;Then there are famous Roman invasions, starting with Julius Caesar in 54 BCE. Britain eventually becomes the Roman province of Britannia, followed by Christianization.&lt;&#x2F;li&gt;
&lt;li&gt;Around 400 CE Rome retreats, and there are a series of German invasions. The population becomes pagan again. Later the kings convert, and there&#x27;s Christianization from the top. These are the Anglo Saxons.&lt;&#x2F;li&gt;
&lt;li&gt;There are Viking invasions, starting in 8th century. By the late 9th century, the Vikings had overrun most of the Anglo-Saxon kingdoms that constituted England at the time.&lt;&#x2F;li&gt;
&lt;li&gt;Two big events in the 11th century: Cnut the Great becomes the king, uniting England with Norway and Denmark. Britain is part of a thalassocracy, the North Sea Empire&lt;&#x2F;li&gt;
&lt;li&gt;1066 CE. The Norman invasions. William the Conquerer. Normans are Vikings settled in Normandy. This is the only one I had some familiarity with before my wikipedia surfing.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>World War I and British Elites</title>
        <published>2023-04-10T00:00:00+00:00</published>
        <updated>2023-04-10T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/ww1-elites/"/>
        <id>https://asun9.com/notes/ww1-elites/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/ww1-elites/">&lt;p&gt;Some very interesting stats from Wade Davis&#x27; book on Mallory and Everest. The British elites then had skin in the game, which is very unusual in any modern democracy. One son of a former Prime Minister, Raymond Asquith, was shot dead at the Somme in 1916.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Nearly 1 million dead in Britain alone, some 2.5 million wounded, 40,000 amputees, 60,000 without sight, 2.4 million on disability a decade after the end, including 65,000 men who never recovered from the mental ravages of shell shock.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;In 1914, the chances of any British boy aged thirteen through twenty-four surviving the war were one in three. Schools, on average, lost five years’ worth of students. The student body of Eton numbered 1,100; in the war, 1,157 Old Etonians would perish. Wellington, a school of only 500, would sacrifice 699. Uppingham would lose 447, Winchester 500, Harrow 600, Marlborough 733, and Charterhouse 686. The Public Schools Club in London lost over 800 members, forcing it to close for lack of numbers. Of the thousands of public school boys who entered the war, one in five would perish. The lucky ones served on staff positions behind the line. Of those young officers who fought in the trenches, half would die.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;It seems like that after 4 years of war, the Brits hadn&#x27;t gained much of an advantage at all. Their eventual victory was precipitated only by the economic collapse of Germany - mostly.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;In the fall of 1918 the German home front had collapsed, the nation on the brink of starvation and revolution. But German armies still controlled the field, and there was not a single Allied soldier anywhere near the approaches to the Rhine.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;On March 21 the Germans launched the Spring Offensive, which began with the most intense bombardment of the war. In five hours more than three million high-explosive and gas shells fell upon the British Fifth Army. Attacking out of the fog, German storm troopers retook in days what the British had struggled six months to capture at the Somme. Within twenty-four hours 21,000 British soldiers were taken prisoner; in nine days the number captured rose to 90,000. Thirteen hundred British gun emplacements were overrun.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Book Notes: Only The Paranoid Survive</title>
        <published>2023-04-07T00:00:00+00:00</published>
        <updated>2023-04-07T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/only-paranoid-survive/"/>
        <id>https://asun9.com/only-paranoid-survive/</id>
        
        <content type="html" xml:base="https://asun9.com/only-paranoid-survive/">&lt;h3 id=&quot;summary&quot;&gt;Summary&lt;&#x2F;h3&gt;
&lt;p&gt;Andy Grove really doesn&#x27;t grok bullshit. Unlike other business books, this one is short and to the point. His central thesis is that business and industries undergo strategic inflection points, changes that transform the landscape and destroy the old gods unless they adapt. The preferred phrase now to refer to such changes is &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Disruptive_innovation&quot;&gt;disruption&lt;&#x2F;a&gt;. Grove then proceeds to examine the computer industry from within that framework, and one outside, that of Walmart. Disruption, 10x changes, strategic inflection points and such are common wisdom now. While one cannot read this book with the eyes of a beginner, it has aged well&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-1-1&quot;&gt;&lt;a href=&quot;#fn-1&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;. This is especially true when he applies similar lens to individual career, a theme he has visited in his other books. This attitude, that one is responsible for one&#x27;s career and one must constantly prepare for the next job, like an athlete does for his race, is really the central philosophy of leetcoders and blinders.  The title is particularly relevant this year. In an age of mass layoffs in the tech industry, it is as good a personal motto as any.&lt;&#x2F;p&gt;
&lt;p&gt;It&#x27;s ironic that Intel after Grove missed the strategic inflection points that have hollowed it out considerably: pure play foundries like TSMC and mobile devices. Organizational paranoia, it seems, needs a strong man at the top to sustain.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;notes&quot;&gt;Notes&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;A strategic inflection point is a time in the life of a business when its fundamentals are about to change. That change can mean an opportunity to rise to new heights. But it may just as likely signal the beginning of the end.
&lt;ul&gt;
&lt;li&gt;An inflection point occurs where the old strategic picture dissolves and gives way to the new, allowing the business to ascend to new heights. However, if you don’t navigate your way through an inflection point, you go through a peak and after the peak the business declines.&lt;&#x2F;li&gt;
&lt;li&gt;A strategic inflection point is like venturing into what I call the valley of death, the perilous transition between the old and the new ways of doing business. **You march in, knowing full well that some of your colleagues will not make it across to the other side. Yet the senior manager’s task is to force that march to a vaguely perceived goal in spite of the casualties, and the middle managers’ responsibility is to support that decision. There is no other choice.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;If you run a business, you must recognize that no amount of formal planning can anticipate such changes. Does that mean you shouldn’t plan? Not at all. You need to plan the way a fire department plans: It cannot anticipate where the next fire will be, so it has to shape an energetic and efficient team that is capable of responding to the unanticipated as well as to any ordinary event. Understanding the nature of strategic inflection points and what to do about them will help you safeguard your company’s well-being. It is your responsibility to guide your company out of harm’s way and to place it in a position where it can prosper in the new order. Nobody else can do this but you.&lt;&#x2F;li&gt;
&lt;li&gt;The sad news is, nobody owes you a career. &lt;strong&gt;Your career is literally your business. You own it as a sole proprietor. You have one employee: yourself. You are in competition with millions of similar businesses: millions of other employees all over the world. You need to accept ownership of your career, your skills and the timing of your moves. It is your responsibility to protect this personal business of yours from harm and to position it to benefit from the changes in the environment. Nobody else can do that for you.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;To prepare for a 10x change, consume information this way: &quot;Reading the daily newspapers through a “10X” lens constantly exposes potential strategic inflection points. Does the wave of bank mergers that is sweeping the United States today have anything to do with a “10X” change? Does the acquisition of ABC by Disney or Time Warner’s proposed merger with Turner Broadcasting System have anything to do with one? Does the self-imposed breakup of AT&amp;amp;T?&quot;&lt;&#x2F;li&gt;
&lt;li&gt;On when CEOs leave and are replaced by new ones:
&lt;ul&gt;
&lt;li&gt;I suspect that the people coming in are probably no better managers or leaders than the people they are replacing. They have only one advantage, but it may be crucial: unlike the person who has devoted his entire life to the company and therefore has a history of deep involvement in the sequence of events that led to the present mess, ==the new managers come unencumbered by such emotional involvement and therefore are capable of applying an impersonal logic to the situation. They can see things much more objectively than their predecessors did.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;The most important tool in identifying a particular development as a strategic inflection point is a broad and intensive debate.&lt;&#x2F;strong&gt; This debate should involve technical discussions (for example, is RISC inherently “10X” faster?), marketing discussions (is it a fashion fling or is it a business?) and considerations of strategic repercussions (how will it affect our microprocessor business if we make a dramatic move; how will it affect it if we don’t?).&lt;&#x2F;li&gt;
&lt;li&gt;An organization that has a culture that can deal with these two phases—debate (chaos reigns) and a determined march (chaos reined in)—is a powerful, adaptive organization. Such an organization has two attributes: 1. It tolerates and even encourages debate. These debates are vigorous, devoted to exploring issues, indifferent to rank and include individuals of varied backgrounds. 2. It is capable of making and accepting clear decisions, with the entire organization then supporting the decision.&lt;&#x2F;li&gt;
&lt;li&gt;A sense of loss accompanies a manager whose company is going through a strategic inflection point:
&lt;ul&gt;
&lt;li&gt;However, unlike the accepted model of the sequence of emotions associated with grief (i.e., denial, anger, bargaining, depression and, ultimately, acceptance), in the case of a strategic inflection point, the sequence goes more as follows: denial, escape or diversion and, finally, acceptance and pertinent action.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Only the paranoid survive:
&lt;ul&gt;
&lt;li&gt;The most important role of managers is to create an environment in which people are passionately dedicated to winning in the marketplace. Fear plays a major role in creating and maintaining such passion. Fear of competition, fear of bankruptcy, fear of being wrong and fear of losing can all be powerful motivators.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;The existence of career inflection points is best analyzed by conducting a vigorous debate with sympathetic associates. You need to cultivate the habit of constantly questioning your work situation. By examining the tacit assumptions underlying your daily work, you will hone your ability to recognize and analyze change. In other words, get into the habit of conducting an internal debate about your work environment with yourself.
&lt;ul&gt;
&lt;li&gt;As in managing businesses, it is rare that people make career calls early. Most of the time, as you look back, you will wish you had made the change earlier. In reality, a change made under the benign bubble of an existing job, when things are still going well, will be far less wrenching than the same change made once your career has started its decline.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;br&gt;
&lt;p style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;FOOTNOTES&lt;&#x2F;b&gt; &lt;&#x2F;p&gt;
&lt;footer class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-1&quot;&gt;
&lt;p&gt;Although I should note that one major company is still quite vertically integrated, just differently than in the 80s and the 90s. Horizontal integration hasn&#x27;t eaten it&#x27;s lunch at all, and in fact has led to pretty subpar competitive products. This company continues to do pretty well for itself. &lt;a href=&quot;#fr-1-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;footer&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Cache Invalidation</title>
        <published>2023-03-27T00:00:00+00:00</published>
        <updated>2023-03-27T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/cache-invalidation/"/>
        <id>https://asun9.com/notes/cache-invalidation/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/cache-invalidation/">&lt;p&gt;A cache is a software or hardware component that keeps a copy of data in order to serve future requests faster. Storage is longer term data, cache is shorter lived data. Cache is also memory limited.&lt;&#x2F;p&gt;
&lt;p&gt;When data is modified, updating both storage and cache simultaneously can be challenging. Cached data may become stale, leading to incorrect results and potential performance issues. To solve this problem, cache invalidation techniques are used to remove or refresh stale data in the cache.&lt;&#x2F;p&gt;
&lt;p&gt;Some strategies for cache invalidation:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Invalidate data in cache when data is being modified in stograge.&lt;&#x2F;li&gt;
&lt;li&gt;Invalidate data in cache at the time of reading by an application. Check if storage data is newer, and if so, write it into the cache.&lt;&#x2F;li&gt;
&lt;li&gt;Time-to-live policy: data in cache will expire after some time and is marked as invalid.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Charlie Munger&#x27;s Iron Prescriptions</title>
        <published>2023-03-18T00:00:00+00:00</published>
        <updated>2023-03-18T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/munger-iron-presciption/"/>
        <id>https://asun9.com/notes/munger-iron-presciption/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/munger-iron-presciption/">&lt;h2 id=&quot;agency-and-responsibility&quot;&gt;Agency and Responsibility&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&quot;Whenever you think that some situation or some person is ruining your life, it’s actually you who are ruining your life. It’s such a simple idea. Feeling like a victim is a perfectly disastrous way to go through life. If you just take the attitude that however bad it is in anyway, it’s always your fault and you just fix it as best you can – the so-called ‘iron prescription’ – I think that really works.&quot;&lt;&#x2F;li&gt;
&lt;li&gt;&quot;You should never, when facing some unbelievable tragedy, let one tragedy increase to two or three through your failure of will&quot;&lt;&#x2F;li&gt;
&lt;li&gt;“Generally speaking, envy, resentment, revenge, and self-pity are disastrous modes of thought; self-pity gets pretty close to paranoia, and paranoia is one of the very hardest things to reverse; You do not want to drift into self-pity.”&lt;&#x2F;li&gt;
&lt;li&gt;&quot;I suggest that every time you find you’re drifting into self-pity—I don’t care what the cause, your child could be dying of cancer, self-pity is not going to improve the situation—just give yourself one of those cards. It’s a ridiculous way to behave and when you avoid it you get a great advantage over everybody else, almost everybody else, because self-pity is a standard condition and yet you can train yourself out of it.&quot;&lt;&#x2F;li&gt;
&lt;li&gt;&quot;`What one frame of mind is likely to cause the most damage to an individual&#x27;s happiness, his contribution to others, and the like-what one frame of mind will be the worst?&#x27; &lt;strong&gt;The answer, of course, would be some sort of paranoid self-pity. I can&#x27;t imagine a more destructive frame of mind.&lt;&#x2F;strong&gt;&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;ideology&quot;&gt;Ideology&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&quot;I have what I call an “iron prescription” that helps me keep sane when I naturally drift toward preferring one ideology over another. And that is I say, “I’m not entitled to have an opinion on this subject unless I can state the arguments against my position better than the people do who are supporting it.” I think only when I reach that stage am I qualified to speak.&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;This is similar to Pūrva paksha, one tradition of debates by Indian logicians. &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;substack.com&#x2F;inbox&#x2F;post&#x2F;109084196&quot;&gt;Gurwinder&lt;&#x2F;a&gt; defines it as thus: &quot;To truly understand an opposing view, try to argue in favor of it as best you can. This will prevent your tribal brain from reflexively dismissing it as an “enemy ideology”, and force you to genuinely consider its merits.&quot;&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Web Notes: March 2023</title>
        <published>2023-03-11T00:00:00+00:00</published>
        <updated>2023-03-11T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/clips-march-23/"/>
        <id>https://asun9.com/clips-march-23/</id>
        
        <content type="html" xml:base="https://asun9.com/clips-march-23/">&lt;h3 id=&quot;blog-russia-ukraine-and-the-donbass-war&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;nemets.substack.com&#x2F;p&#x2F;roots-of-the-donbass-war&quot;&gt;Russia, Ukraine and the Donbass War&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;All you want to know about the history of Russia, Ukraine and why they are fighting. It&#x27;s always more complicated than one would think.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&quot;Moscow, merely a small town at the beginning of the 14th century, was an unlikely place to evolve into a great power. Nearby Vladimir and Tver were the obvious candidates to rise to preeminence among the northeastern Rus’ states. It was precisely because Moscow was so small and unimportant that it rose to power. Loyally serving the Mongols of the Golden Horde in the 14th century, Moscow was rewarded with wealth and power.&quot;&lt;&#x2F;li&gt;
&lt;li&gt;&quot;Elite cooption in Russia and outright lack of elites in Austria as well as widespread illiteracy and absence of explicit national political structures prevented the development of Ukrainian national consciousness in spite of a dialect continuum that cross the Austrian-Russian border. In 1842 only 15% of children in Galicia attended school, and as late as 1865 only 4.5% recruits from Galicia could read. The situation across the border was likely worse. The Russian government saw an opportunity in that lack of education to acculturate Ukrainians from their folksy culture into a more sophisticated Russian culture through the foundation of a number of universities in Ukraine. Under of the guidance of Sergey Uvarov, the universities studied Ukrainian history to determine a path forward in the assimilation of Ukrainians. The result was the concept of a Little Russian identity. It emphasized the shared heritage of the Great Russians with the Little Russians that went back to the medieval Rus’ realm, as well as their shared Orthodox faith and their shared struggles against the Poles, Turks, and Tatars. The Little Russian identity was to be a regional identity inclusive of a broader Russian identity.&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;interview-jed-perl-and-the-purpose-of-art&quot;&gt;Interview: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;salmagundi.skidmore.edu&#x2F;articles&#x2F;436-authority-freedom?utm_source=substack&amp;amp;utm_medium=email&quot;&gt;Jed Perl and the purpose of art&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&quot;And not some political point or reading, like everyone insists on doing today. Initially it is a Marxist view that art has to serve society or some utilitarian purpose.&quot;&lt;&#x2F;li&gt;
&lt;li&gt;&quot;... every work of art is the result of a debate or dynamic interaction between the authority of a tradition and the individual creator’s effort to find his or her own sense of that tradition and respond to it and renew it. All art is about the search for freedom within authority – even in premodern periods, when what I would call freedom was expressed through the mastery of a craft – and I think we in the audience respond to that dynamic. It’s an infinitely rich and variable dynamic.&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;blog-collect-as-many-lottery-tickets-as-possible&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;adayeo.substack.com&#x2F;p&#x2F;collect-as-many-lottery-tickets-as&quot;&gt;Collect as many lottery tickets as possible&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Why and how to increase the surface area of your luck: &quot;Do things with low downside and large upside.&quot;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;blog-tribalism-whether-left-or-right&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;gurwinder.substack.com&#x2F;p&#x2F;why-smart-people-hold-stupid-beliefs&quot;&gt;Tribalism, whether left or right&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&quot;...high IQ people and low IQ people &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;journals.sagepub.com&#x2F;doi&#x2F;abs&#x2F;10.1177&#x2F;1948550616660592&quot;&gt;display&lt;&#x2F;a&gt; similar levels of prejudice, except toward different groups, and educated people actually &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;academic.oup.com&#x2F;poq&#x2F;article-abstract&#x2F;81&#x2F;4&#x2F;930&#x2F;4652248?redirectedFrom=fulltext&amp;amp;login=false&quot;&gt;display&lt;&#x2F;a&gt;greater prejudice against those with different views&quot;&lt;&#x2F;li&gt;
&lt;li&gt;&quot;The popular woke myth that sex is a spectrum is &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.nature.com&#x2F;articles&#x2F;518288a&quot;&gt;often justified&lt;&#x2F;a&gt; on the basis that there’s no single thing that distinguishes all men from all women. Such an abstract explanation is seductive to an intellectual, but beneath the allure it’s just an instance of the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.lesswrong.com&#x2F;posts&#x2F;cu7YY7WdgJBs3DpmJ&#x2F;the-univariate-fallacy-1#:~:text=The%20denial%20of%20this%20possibility,%22%20as%20potential%20alternative%20names.&quot;&gt;univariate fallacy&lt;&#x2F;a&gt;) (it’s true that no single thing distinguishes all men from all women, but no single thing distinguishes all cats from all monkeys either; does this make cats monkeys?)&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;article-paul-erdos-in-madras&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.thehindu.com&#x2F;society&#x2F;paul-erds-a-legendary-mathematician-in-madras&#x2F;article28295095.ece&#x2F;amp&#x2F;&quot;&gt;Paul Erdos in Madras&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Where he composes this ditty:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;This is the city of Madras &lt;br &#x2F;&gt;
The home of the curry and the dal&lt;br &#x2F;&gt;
Where Iyers speak only to Iyengars&lt;br &#x2F;&gt;
And Iyengars speak only to God.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;blog-acceptance-is-a-superpower&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;autotranslucence.com&#x2F;2019&#x2F;01&#x2F;13&#x2F;acceptance-as-a-superpower&#x2F;&quot;&gt;Acceptance is a superpower&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;A friend asked me what my favourite tools were for addressing conflict, and I realised that by far my most powerful strategies had to do with the same kind of acceptance of discomfort I had been developing in the ocean baths at 6:30am. Mediating conflict requires first seeing it. And being able to fully feel your emotions requires not running away from them.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Over the last few years I’ve been developing the following personal growth heuristic – Do what scares me. And not in the cutesy ‘go pet a spider’ way, but finding growth areas by systematically inventorying my fears, and then devising and enabling situations in which I can run headlong into them.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;But this heuristic turned into a powerful compass direction when turned towards my emotional reactions. First while journalling, then while doing a somatic meditation practice, then in arguments with people I trusted, then finally in all high-stakes situations. I would tune into the experience of fear and investigate the feelings hidden behind it &lt;em&gt;even more&lt;&#x2F;em&gt;, much to the chagrin of the part of me that was doing the deflecting.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;blog-how-few-books-sell&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;malwarwickonbooks.com&#x2F;how-much-is-a-pulitzer-prize-worth&#x2F;&quot;&gt;How few books sell&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;How well does the Pulitzer prize translate to bestsellers list? Not very well.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;The 2014 general nonfiction winner, &lt;em&gt;Tom’s River&lt;&#x2F;em&gt; by Dan Fagin, went from 10 copies [before the prize announcement] to 162 copies sold (6,266 copies sold to date) on BookScan [which measures a significant proportion of industry sales].&lt;&#x2F;li&gt;
&lt;li&gt;&lt;em&gt;3 Sections&lt;&#x2F;em&gt; by Vijay Seshadri, the 2014 poetry winner, went from 11 copies to 81 copies (353 copies sold to date)&lt;&#x2F;li&gt;
&lt;li&gt;A few titles somehow become big outliers as measured by the sales numbers. As _PW_revealed in its article, “sales for the [2014] Pulitzer Prize fiction winner, &lt;em&gt;The Goldfinch&lt;&#x2F;em&gt; by Donna Tartt, spiked in the week following the announcement of the prize.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;interview-ruth-harris-on-vivekanada&quot;&gt;Interview: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.ks1729.com&#x2F;swami-vivekananda&#x2F;2023&#x2F;1&#x2F;14&#x2F;a-moveable-feast&quot;&gt;Ruth Harris on Vivekanada&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;The author comments thus: &quot;What I particularly liked about Professor Harris’ biography was her underlying sense of generosity towards the man—unlike other more recent efforts which devolve into a gotcha scholasticism with little insight to Vivekananda’s life-journey itself. In one sense, she sees him as no different than most of us, as somebody trying to figure things out things as he goes along; but she also sees in him somebody who was not like us—as one, who despite living in the world of telegraphs and steamers, he belongs to a great lineage of Hindu monks who sought to address the times they lived in, and the ones that are to come, using the vocabulary of their present and past to assert that the world is a manifestation of God, which nevertheless is in great need for human intervention, generosities, and willfulness. He argued that this way—of thought, action, and compassion—was the way of the Upanishads and Dharma itself.&quot;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Also Dharmapala detests Hinduism, though he keeps it always under wraps. He talks about going to Benares and he&#x27;s disgusted by the ritualism and what he saw as its sensualism.  Vivekananda never had that view of different forms of religious experience.  They are true frenemies. I must say, Vivekananda never says a bad word about Dharmapala  (except to suggest that Dharmapala is not a great speaker)and later on he doesn’t mention him because he is not very concerned with him. Whereas Dharmapala continues to care about Vivekananda [laughs].&lt;&#x2F;li&gt;
&lt;li&gt;But Vivekananda is unique! Vivekananda is unique is because he globalizes Hinduism. And whether that&#x27;s good or bad is open, and remains open, to debate. At the time, of course, the Orthodox hated what he was doing—the whole idea that one would engage in the world in the way he suggested  was a  terrible transgression, especially for a sannyasin.  He seems at intervals to be almost worldly in the way he institutionalizes, and yet his vision was often radical, and its articulation unprecedented.&lt;&#x2F;li&gt;
&lt;li&gt;Ramakrishna seems strange above all because of his insistence on being a baby. But the way he became a baby spoke a kind of cosmic truth.  He emphasized babyhood precisely because it was a universal human state, before religion, culture, and hierarchy imposed their transformations. And created diversity.  And this understanding or intuition—whatever you want to call it—was extraordinary.  And yet it’s integral to many “Hindu traditions, “ both in its openness to other paths and in the way it sought to envelop and encompass those traditions.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;article-pedagogy-and-the-designed-childhood&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;escapingflatland.substack.com&#x2F;p&#x2F;childhoods&quot;&gt;Pedagogy and the designed childhood&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Given your children access to observe you while you work—is, in my experience, rewarding but draining. While writing his ten-volume &lt;em&gt;History of British India,&lt;&#x2F;em&gt; John Stuart Mill’s father allowed John Stuart, who was three years old, to interrupt him every time he encountered a Greek word he had not seen before (he was reading the classics). His father considered raising his children to be of equal importance as his intellectual work&lt;&#x2F;li&gt;
&lt;li&gt;Books can, in other words, be a good stand-in for a social milieu, up to a point, but eventually, you need direct access to exceptional people. And having access to them from a young age greatly increases the likelihood that you will be shaped by them.&lt;&#x2F;li&gt;
&lt;li&gt;Let me sum up what I’ve said so far. A lot of care went into curating the environment around the children—fascinating guests were invited, libraries were built, machines were brought home and disassembled—but the children were left with a lot of time to freely explore the interests that arose within these milieus.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Unlike children today, they had little access to entertainment, and so were often bored, unless they figured out a way to keep their minds occupied; the intellectual obsessions that grew into their life’s work often grew out of this boredom.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;blog-ramanujam-and-dreams&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;kristinposehn.substack.com&#x2F;p&#x2F;ramanujan-dreams&quot;&gt;Ramanujam and Dreams&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&quot;In their remarks, English mathematicians were careful to stress that Ramanujan was rational and rigorous—characteristics that were worthy, in their eyes, of conventional respect, while Ramanujan’s devout practice as a Hindu was glossed over, as if this were merely a set of odd behavioral codes he happened to scrupulously observe. His first biographer received complaints about having included in the biography various remarks from Ramanujan’s childhood friends which detailed his great passion for occult and religious subjects, because any association with such matters apparently contaminated his mathly reputation. And these distortions persist to this day: His most popular biographer avoids the topic of his dreams, merely including a few as incidental, offhand notes. Personally, I think if you’re a 25, or sub-5, or even an 80 on the mathalete scale, it would be prudent to cultivate a healthy, open-minded curiosity about someone operating at a 100. What did Ramanujan know about mathematics that we don’t?&quot;&lt;&#x2F;li&gt;
&lt;li&gt;&quot;Ramanujan and his family were ardent devotees of Narasimha—the lion-faced incarnation, or avatara, of god, and consort of the goddess Namagiri—and for them, seeing drops of blood in a dream was considered a sign of Narasimha’s grace. It is also worth noting that roughly around this time, while in the midst of explaining a mathematical relation to a friend, Ramanujan paused for a moment, then turned to his listener and out of nowhere said, “An equation has no meaning for me unless it expresses a thought of GOD.” Might these details suggest that within Ramanujan’s interior network of dream-meaning—stimulated by the presence of a monk—a mysterious hand wrote thoughts of god on a screen of god’s grace? It is remarkable that this dream unfolds in a seamless flow of blood, grace, attention, writing, and math, and perhaps for Ramanujan they were inseparable. You do not achieve a dream like that by accident.&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;blog-mainstream-media-and-madness&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;betonit.substack.com&#x2F;p&#x2F;mainstream-media-is-worse-than-silence&quot;&gt;Mainstream media and madness&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;The media has always promoted mass hysteria - Iran, Kuwait, War on Terror etc.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&quot;The problem isn’t limited to race, gender, and sexual orientation, where Richard agrees that the media is crazy. The problem isn’t specific factual errors, either. The central problem is that the mainstream media’s standard operating standard is to use selective presentation to spread absurd views about practically everything that matters.&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;blog-freedom-house-chicanery&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;richardhanania.substack.com&#x2F;p&#x2F;freedom-house-woke-imperialists&quot;&gt;Freedom House Chicanery&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Not only does Freedom House portray the behavior of conservative governments in an unflattering light, but it looks past what are much clearer violations of individual liberty and democratic norms when they are committed in the service of left-wing social or political goals. &lt;&#x2F;li&gt;
&lt;li&gt;Sweden, for example, is one of only &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;freedomhouse.org&#x2F;countries&#x2F;freedom-world&#x2F;scores?sort=desc&amp;amp;order=Total%20Score%20and%20Status&quot;&gt;three countries&lt;&#x2F;a&gt; to receive a perfect score of 100. This is despite having &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.state.gov&#x2F;reports&#x2F;2018-country-reports-on-human-rights-practices&#x2F;sweden&#x2F;&quot;&gt;hate speech laws&lt;&#x2F;a&gt;, which have in the past been used to &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.irishtimes.com&#x2F;news&#x2F;pastor-cleared-over-anti-gay-sermon-1.414439&quot;&gt;arrest Christian preachers for their interpretation of the Bible&lt;&#x2F;a&gt;. Norway, another “perfect democracy,” in 2020 expanded its hate speech laws &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.csmonitor.com&#x2F;World&#x2F;Points-of-Progress&#x2F;2020&#x2F;1127&#x2F;Points-of-Progress-Norway-updates-hate-speech-laws-and-more&quot;&gt;to cover gender identity&lt;&#x2F;a&gt;, with punishments of up to three years in prison for violators.&lt;&#x2F;li&gt;
&lt;li&gt;Another clear double standard is related to whether countries are allies or enemies of the United States. For example, Iran has actual elections that determine who gets in power and have legitimate consequences for economic and foreign policy, even though many candidates are disqualified from running. Oman, in contrast, is &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;freedomhouse.org&#x2F;country&#x2F;oman&#x2F;freedom-world&#x2F;2020&quot;&gt;an absolute monarchy&lt;&#x2F;a&gt; with a “Consultative Council,” which “has no legislative powers and can only recommend changes to new laws.” Yet Oman has a score of 23, while Iran has a 17. Jordan, another American ally and arguably&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;constitutionnet.org&#x2F;news&#x2F;jordans-2016-constitutional-amendments-return-absolute-monarchy&quot;&gt;another absolute monarchy&lt;&#x2F;a&gt;, gets a 34.&lt;&#x2F;li&gt;
&lt;li&gt;It’s a strange algorithm that deducts points for criticizing journalists, but not for putting them in jail. It’s the algorithm you’d expect, however, from an organization run by former American government officials.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;article-the-american-press-and-russiagate&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.cjr.org&#x2F;special_report&#x2F;trumped-up-press-versus-president-part-1.php&quot;&gt;The American Press and Russiagate&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&quot;But outside of the &lt;em&gt;Times&lt;&#x2F;em&gt;’ own bubble, the damage to the credibility of the &lt;em&gt;Times&lt;&#x2F;em&gt; and its peers persists, three years on, and is likely to take on new energy as the nation faces yet another election season animated by antagonism toward the press. At its root was an undeclared war between an entrenched media, and a new kind of disruptive presidency, with its own hyperbolic version of the truth. (The &lt;em&gt;Washington Post&lt;&#x2F;em&gt; has tracked thousands of Trump’s false or misleading statements.) At times, Trump seemed almost to be toying with the press, offering spontaneous answers to questions about Russia that seemed to point to darker narratives. When those storylines were authoritatively undercut, the follow-ups were downplayed or ignored.&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;article-caste-and-kinship-in-telugu-migrants&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.tandfonline.com&#x2F;doi&#x2F;full&#x2F;10.1080&#x2F;1369183X.2017.1314598&quot;&gt;Caste and Kinship in Telugu Migrants&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&quot;Coastal Andhra region&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.tandfonline.com&#x2F;doi&#x2F;full&#x2F;10.1080&#x2F;1369183X.2017.1314598#&quot;&gt;Footnote6&lt;&#x2F;a&gt; where Narendra hails from, had already seen a steady flow of migrants from among the dominant agrarian castes&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.tandfonline.com&#x2F;doi&#x2F;full&#x2F;10.1080&#x2F;1369183X.2017.1314598#&quot;&gt;Footnote7&lt;&#x2F;a&gt; – Kammas, Vellamas, Reddys and Rajus – to the U.S.A. as doctors and engineers.&quot;&lt;&#x2F;li&gt;
&lt;li&gt;Caste capital refers to the (largely invisible) symbolic, cultural or social capital that an actor may possess by virtue of upper or dominant caste affiliation, capital that accords advantages not enjoyed by people from other castes. In the case of transnational Kammas, caste capital allows for the strategic pairing of the global with the local (Kearney &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.tandfonline.com&#x2F;doi&#x2F;full&#x2F;10.1080&#x2F;1369183X.2017.1314598#&quot;&gt;Citation1995&lt;&#x2F;a&gt;) that facilitates the accumulation of symbolic capital (the NRI status and the respect that comes along with it) and social capital (strong caste-based social networks that yield tangible or intangible benefits in the migration process). The American dream nurtured in rural or semi-rural environments of Coastal Andhra is an attribute of what I call a malleable caste capital, in so far as it responds to changing times to become better suited to respond to these changes. Kamma families inherit social and symbolic capital (Bourdieu &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.tandfonline.com&#x2F;doi&#x2F;full&#x2F;10.1080&#x2F;1369183X.2017.1314598#&quot;&gt;Citation1986&lt;&#x2F;a&gt;) by virtue of their dominant caste status and strategic investment of agricultural surplus in higher education (Upadhya &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.tandfonline.com&#x2F;doi&#x2F;full&#x2F;10.1080&#x2F;1369183X.2017.1314598#&quot;&gt;Citation1997&lt;&#x2F;a&gt;), a process that has allowed them to respond to the global demand for skilled workforce from the 1960s onward.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;interview-tagore-gandhi-and-nationalism&quot;&gt;Interview: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.sahapedia.org&#x2F;tagore-nationalism-conversation-prof-ashis-nandy&quot;&gt;Tagore, Gandhi and Nationalism&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;An excellent interview with Ashis Nandy on Tagore and Gandhi, their motivations and influences.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&quot;Tagore believed that India was a country of communities. It was not a country of a nation. So trying to build a nation in India was like an attempt to build a navy in Switzerland, that is what he wrote. Because nation and nationalism presumes that you homogenise the population.&quot;&lt;&#x2F;li&gt;
&lt;li&gt;&quot;It will be a pity if we underestimate the nature of Gandhi’s quest. I think he was serious in his quest for a spiritual position as well as a political position which will be mutually potentiating and uphold the concept of ethics in politics which you would not find in contemporary cultures or politics. Certainly not within the enlightened vision of a good society. Because enlightened vision has no strong theory of non-violence. It has a theory of containment of violence but not non-violence.&quot;&lt;&#x2F;li&gt;
&lt;li&gt;&quot;But the fact remains that Gandhi also was not entirely a product of India. He was a product of India and Africa. His most formative years, he spent in South Africa. Satyagraha emerged in a racist country. Many people believe that satyagraha could have only emerged under a liberal dispensation, only under British rule. That is not true. It was tried out in a country which was openly racist and was a police state in every sense. In that sense, Gandhi also had his exposure to different kinds of cultural plurality. And if you read accounts of Gandhi in South Africa, you have no reason to feel ashamed as an Indian because there is no touch of racism in him. Indeed, Nelson Mandela has said that you sent us a barrister, we sent back a saint to you. And it is also true that the three greatest Gandhians at this moment, none is an Indian. None is an Indian, no one is a Hindu either or a Jain. Aung San Suu Kyi, Nelson Mandela and the Dalai Lama. And I think it also talks of a different kind of cross cultural sensitivity.&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;article-a-bahujan-s-take-on-caste-in-usa&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;americankahani.com&#x2F;perspectives&#x2F;ive-never-been-discriminated-in-india-or-america-a-bahujans-professionals-take-on-seattles-historic-caste-resolution&#x2F;&quot;&gt;A Bahujan&#x27;s take on caste in USA&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;I and many other Hindu Dalits and Bahujans (“lower caste” Indians) are integral members of our broader South Asian Hindu communities here in the U.S. We all work together, we socialize together, we pray together, and we volunteer together. 
&lt;ul&gt;
&lt;li&gt;I have not been treated at all differently, let alone mistreated, because of my caste, nor have other Hindus who I now have learned are Dalit and Bahujan.&lt;&#x2F;li&gt;
&lt;li&gt;The City of Seattle wants to ignore voices like mine. &lt;&#x2F;li&gt;
&lt;li&gt;Part of the reason is that my story does not fit neatly into the stereotypes Americans at large are inundated with. That story wants to tell a story of division and widespread oppression; a story which deliberately misportrays and demonizes Hinduism’s teachings and traditions and then claims that my religion is not a safe space for Dalits. &lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;blog-review-of-r-balakrishnan-s-journey-of-a-civilization&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;pakrishnan.com&#x2F;2023&#x2F;03&#x2F;09&#x2F;my-review-of-mr-balakrishnans-book-journey-of-a-civilization&#x2F;&quot;&gt;Review of R Balakrishnan&#x27;s Journey of A Civilization&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;R Balakrishnan is an author and former bureaucrat devoted to establishing the antiquity of Tamils as a civilization at odds with rest of India. He has a book making some claims around the same, one that has been making rounds on the internet, heavily promoted by the powers that be in Tamil Nadu (The minister PTR gifted the book to Raghuram Rajan). This is a review  of the book critically examining the claims.&lt;&#x2F;p&gt;
&lt;p&gt;&quot;Iravatham Mahadevan, to whom this book is dedicated, says it cannot be earlier than 2nd Century CE.  The first time its name is mentioned is in Irayanar Akapporul which is dated sometime after 8th century CE. It is the same story with the other works of Sangam.  In all probability, the corpus which is available to us was written between First Century BCE and 4th Century CE. It was compiled several centuries later. What is more, the urban societiy it portrays is strongly influenced by Vedic, Jain and Buddhist religions.  It speaks about Vedas and Veda- chanting Brahmins. Tolkappiyam speaks about them. Maduraikkanchi and Pattinappalai do too. Almost every god of the Hindu pantheon appears in these poems. Thus, one has to be very brave to make a claim that he has found a point where the Indus civilization ends and Sangam texts commence without the intruders from the Gangetic plains butting in and spoiling the show. The author is one such brave person.&quot;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;blog-become-and-educated-layman&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;srconstantin.github.io&#x2F;2021&#x2F;06&#x2F;09&#x2F;Educated-Layman.html&quot;&gt;Become and educated layman&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&quot;Your strength, as an “educated layman”, is the ability to drill down and learn everything about the one question within the field that you care about, which will often be different from what most experts in the field care about. Your lack of embeddedness in the community can actually be helpful, because by aggregating everything in the one slice of data you care about, you can generate ideas that aren’t correlated with the field’s biases.&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;review-the-habit-of-interestedness-on-eva-brann-s-pursuits-of-happiness&quot;&gt;Review: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;lareviewofbooks.org&#x2F;article&#x2F;the-habit-of-interestedness-on-eva-branns-pursuits-of-happiness&#x2F;&quot;&gt;The Habit of Interestedness: On Eva Brann’s “Pursuits of Happiness”&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Happiness is neither beatitude nor euphoria nor gratification, but it is, rather, interest — in sublimity, for example; and unlike “pleasantness,” ==Brann’s happiness emerges from a habit of showing interest, of feeling our feelings.==&lt;&#x2F;li&gt;
&lt;li&gt;Along with Strauss and Klein, Brann seems to find atheism unacceptable. Also like them, she identifies as a conservative. I interpret this not as a political position, but as a statement of her commitment to conserve old truths — from the American founders, the Greek poets — and of her belief in philosophy over ideology.&lt;&#x2F;li&gt;
&lt;li&gt;&quot;Interested’ is one of the best words I know,” she says; when you find something that draws your attention, her injunction is to “[b]arge on.” Daydreaming is a species of thinking, and therefore okay. But avoid boredom! Being bored makes you boring. “Boredom is the antithesis of interest,” she asserts. Also, being “interested” makes you more “interesting.”&lt;&#x2F;li&gt;
&lt;li&gt;I like to think that becoming interested follows upon the display of the object’s attractive power, as the peacock “displays” its fan. &lt;strong&gt;Our choice is to follow through, to get serious, for it’s one thing to light up with the fire of fascination and another to bank that fire so that it becomes a steady heat, an ardor.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;blog-doing-anything&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;tynan.com&#x2F;anything&#x2F;&quot;&gt;Doing Anything&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;I’m always surprised at how early people give up on things or how little confidence they have that they can figure out how to make something work.&lt;&#x2F;li&gt;
&lt;li&gt;I admit that at first I did not believe it was possible for me to date the kind of girls I wanted to date, but as soon as I caught a glimpse of what was possible, I believed that I could do it and I rose through the pickup world and eventually married an amazing woman.&lt;&#x2F;li&gt;
&lt;li&gt;A friend suggested that I write a book, and because I believed that it was possible to write one quickly, I stayed up for two days straight and wrote it.&lt;&#x2F;li&gt;
&lt;li&gt;The primary reason I achieved most of the things I achieved was that I believed they were possible and was content to keep walking on the path towards them and deal with whatever came my way.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>200% Indian</title>
        <published>2023-03-08T00:00:00+00:00</published>
        <updated>2023-03-08T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/actor-sivaji/"/>
        <id>https://asun9.com/notes/actor-sivaji/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/actor-sivaji/">&lt;p&gt;An interview with the legendary actor &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Sivaji_Ganesan&quot;&gt;Sivaji Ganeshan&lt;&#x2F;a&gt;, where his assertion that he is &quot;200% Indian&quot; sits comfortably with his admiration for EV Ramasamy and Annadurai. It is interesting to contrast his cosmopolitanism with that of his political peers. Generally, there is no cynicism in him, and he exudes the joy of a well lived life.&lt;&#x2F;p&gt;
&lt;div class=&quot;yv&quot;&gt;
    &lt;iframe src=&quot;https:&#x2F;&#x2F;www.youtube-nocookie.com&#x2F;embed&#x2F;-g63DoH7Wqc&quot; title=&quot;Youtube&quot; class=&quot;yvi&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;&#x2F;iframe&gt;
&lt;&#x2F;div&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Parallels</title>
        <published>2023-02-28T00:00:00+00:00</published>
        <updated>2023-02-28T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/parallels-jati/"/>
        <id>https://asun9.com/parallels-jati/</id>
        
        <content type="html" xml:base="https://asun9.com/parallels-jati/">&lt;p&gt;In an &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=7GFAjqIke7s&quot;&gt;interview&lt;&#x2F;a&gt; with Ben Shapiro, Sam Harris says slavery is explicitly endorsed in the Old Testament and the New Testament doesn&#x27;t repudiate it. Jesus apparently said slaves should serve their Christian masters. Shaprio makes the point that it was Abolitionists inspired by the Bible who made the against slavery in America and England. Sam Harris says they did it despite the Bible, with &quot;aggressive&quot; reinterpretations.&lt;&#x2F;p&gt;
&lt;p&gt;A similar pattern is apparent in Hinduism. There&#x27;s varna in orthodox Hindu soteriology, but a whole bunch of people use the same Hindu worldview to make case against jati: Aurobindo, Subramaniya Bharati, Dayananda Saraswati, the Naths. I am not sure if these interpretations can be regarded just as &quot;aggressive&quot; though, since another tenet of Hindu soteriology is the dissolving of identity, a condition called moksha. There is in the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.holy-bhagavad-gita.org&#x2F;chapter&#x2F;5&#x2F;verse&#x2F;18&quot;&gt;Gita&lt;&#x2F;a&gt;, these lines:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;vidyā-vinaya-sampanne brāhmaṇe gavi hastini
śhuni chaiva śhva-pāke cha paṇḍitāḥ sama-darśhinaḥ&lt;&#x2F;p&gt;
&lt;p&gt;The truly learned, with the eyes of divine knowledge, see with equal vision a Brahmin, a cow, an elephant, a dog, and a dog-eater. \&lt;&#x2F;p&gt;
&lt;p&gt;-- Chapter 5, Verse 18&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Just like the modern abolisonists, 19th century Hindu reformers - Raja Ramohan Roy, Vivekananda - made social service central to the practice of Hinduism. This is what &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;loveofallwisdom.com&#x2F;blog&#x2F;2010&#x2F;08&#x2F;the-catholic-pauls-against-nondualism&#x2F;#more-1317&quot;&gt;Amod Lele&lt;&#x2F;a&gt; has to say:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;The “Ramakrishna” Mission was actually founded by Vivekānanda – Ramakrishna had little or no part in its creation – and so it adheres to Vivekānanda’s philosophy rather than Ramakrishna’s. Narasingha Sil notes how a fellow monk had already charged Vivekānanda with falsely introducing social service into Ramakrishna’s teachings; in reply Vivekānanda said, “Hands off! Who cares for your Ramakrishna? Who cares for your Bhakti and Mukti? Who cares what your Scriptures say?… I am not a slave of Ramakrishna, but of him only who serves and helps others, without caring for his own Bhakti or Mukti.” It seems that promoting social service was more important to V than representing Ramakrishna’s thought accurately, and one might expect the organization he founded to carry on this tradition.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Should Art Always Serve The Present Moment?</title>
        <published>2023-02-22T00:00:00+00:00</published>
        <updated>2023-02-22T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/art-relevance/"/>
        <id>https://asun9.com/art-relevance/</id>
        
        <content type="html" xml:base="https://asun9.com/art-relevance/">&lt;p&gt;Jed Perl is an American art critic whose writing I have read in NYRB and The New Republic. He has an &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;salmagundi.skidmore.edu&#x2F;articles&#x2F;436-authority-freedom&quot;&gt;interview&lt;&#x2F;a&gt; in Salmangundi that I find very little to disagree with. Criticism of art - movies, music, writing - today is reduced to a very stark utilitarianism. Does it address the perceived problems of the present? Does it improve one&#x27;s liberal understanding of the world? Jed Perl offers a note of dissent. His latest book is a challenge to the notion that works of art need to be “validated (or invalidated) by the extent to which they line up with (or fail to line up with) our current social and political concerns.”&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;I would argue that there has come to be an assumption that the artist who isn’t offering a response to our social, economic, and political circumstances is somehow failing to act as an artist, or at least acting irresponsibly. For evidence I don’t think we need to look beyond the culture pages of the New York Times and The New Yorker, where the political, social, and even sexual orientations of creative people are time and again foregrounded, while the particulars of their work – a prose style, a way of handling paint, the sounds a conductor coaxes from an orchestra – are seen as afterthoughts when they’re discussed at all.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;The fascination – I would almost say the obsession – that developed among liberals in the last quarter of the twentieth century with associating the triumphs and failures of various creative spirits with their political, social, and sexual views and orientations reflects, so I believe, a refusal to see art in its own terms. The idea that certain literary styles or artistic structures might be inherently fascist or leftist – and this has certainly been suggested – does serious damage to our understanding of the arts. (Some eighty years ago George Orwell argued that Yeats’s fascist views could be discovered “even in the smallest detail of his work,” a view later brilliantly debunked by Conor Cruise O&#x27;Brien.)&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;After a couple of decades of hearing and reading politically correct nonsense I’m finding that the startlingly and frankly dangerous pc excesses of some of our most admired critics – Holland Cotter’s appalling review of Titian’s mythological paintings in the Times or Alex Ross’s explorations of the whiteness of classical music in The New Yorker – are just too absurdly formulaic to get under my skin. With Authority and Freedom I’m less interested in demonstrating what’s wrong with their thinking than in exploring what’s (hopefully) right about mine.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;A work of art can begin with a powerfully personal feeling or impression, but feelings and impressions aren’t works of art, at least not until they’ve been put under the pressure of an artistic language. An artist will only be able to use that language freely – use it to cry or scream – when they’ve mastered its subtleties and complexities.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;...every work of art is the result of a debate or dynamic interaction between the authority of a tradition and the individual creator’s effort to find his or her own sense of that tradition and respond to it and renew it. All art is about the search for freedom within authority – even in premodern periods, when what I would call freedom was expressed through the mastery of a craft – and I think we in the audience respond to that dynamic.&lt;&#x2F;strong&gt; It’s an infinitely rich and variable dynamic.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;These views seem similar to that of Barry Lopez, the acclaimed essayist. In his posthumously published book, &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;barry-lopez-burning-world&#x2F;&quot;&gt;Embrace Fearlessly The Burning World&lt;&#x2F;a&gt;, I have this passage highlighted:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Perhaps it’s necessary to emphasize that works of art are not generally intended to function as political or social statements. Many artists, however, are reacting to social and political realities when they’re creating, so their work often informs us though it sets out no agenda. During the time I spent interviewing artists at the Penland community, I found deeply affecting the degree to which artistic excellence, not political or social comment, was the primary focus. How a particular work might later be interpreted seemed not to be much on anyone’s mind.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Jed Perl&#x27;s point is that art has its own significance, something that he took as self-evident when growing up in mid-century America. He laments the loss of this perspective, with art and its criticism now forced to satisfy social requirements. That some piece of art doesn&#x27;t engage with the social, political, and ecological crises of the present moment can make it seem parochial. &quot;But if so, it’s the narrowness that makes it possible for artists to dig deep – very deep.&quot;&lt;&#x2F;p&gt;
&lt;br&#x2F;&gt; 
&lt;p&gt;&lt;strong&gt;Update: 03-11-2023.&lt;&#x2F;strong&gt; This &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;frontline.thehindu.com&#x2F;columns&#x2F;counter-culture-kochi-muziris-biennale-a-throbbing-rigidity&#x2F;article66563791.ece&quot;&gt;review&lt;&#x2F;a&gt; of Kochi-Muziris Biennale by Pratyush Parasuraman, shows a similar reticence about the heavy-handedness of art that wants to mean something.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;I do not make an argument for the utility of art because one cannot reduce everything’s value and importance to its utility. In the same breath, I do not want to make an argument for the utility of biennales. Where I chafed against a lot of the descriptions—and this was more acute in Durbar Hall, where local, greener artists were being exhibited, who loved to express their art in the first person, autobiographically—was this overriding sense of purpose. That their art needed to mean something. And in order for it to mean something, it needed to be “about” something, it had to linger on “themes”, it had to speak to the moment, it had to “juxtapose” this with that.
The most powerful art I saw refused these simple grunts...&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to talk about databases</title>
        <published>2023-02-22T00:00:00+00:00</published>
        <updated>2023-02-22T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/db-what-know/"/>
        <id>https://asun9.com/notes/db-what-know/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/db-what-know/">&lt;h2 id=&quot;general&quot;&gt;General&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;Caching
&lt;ul&gt;
&lt;li&gt;Another way to optimize increasing read load, using an in-memory cache like Redis or memcached.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Paging&lt;&#x2F;li&gt;
&lt;li&gt;Read Replicas
&lt;ul&gt;
&lt;li&gt;For read-heavy applications, add read replicas to the primary database to handle reads. Drawback is replication lag.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Load&lt;&#x2F;li&gt;
&lt;li&gt;Sharding
&lt;ul&gt;
&lt;li&gt;Used to partition data across multiple database servers based on the values in one or more columns of a table.&lt;&#x2F;li&gt;
&lt;li&gt;Each server handles a small subset of the rows that were previously managed by the single primary database, leading to improved query performance as each shard handles a smaller subset of data.&lt;&#x2F;li&gt;
&lt;li&gt;While sharding improves query performance, it can also make it harder to perform cross-shard queries or join data from multiple shards. This limitation can restrict the types of queries that can be performed.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Transactional Gurantees&lt;&#x2F;li&gt;
&lt;li&gt;Denormalization&lt;&#x2F;li&gt;
&lt;li&gt;Latency: P99, P95&lt;&#x2F;li&gt;
&lt;li&gt;Data structures that power databases
&lt;ol&gt;
&lt;li&gt;Skip Lists&lt;&#x2F;li&gt;
&lt;li&gt;Hash Index (Redis)&lt;&#x2F;li&gt;
&lt;li&gt;LSMTree + MemTable (NoSQL DBs like Cassandra, RocksDB)&lt;&#x2F;li&gt;
&lt;li&gt;BTree (Postgres, MySQL)&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;PostgresSQL numbers and scale&lt;&#x2F;li&gt;
&lt;li&gt;Presto numbers and scale&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;redis&quot;&gt;Redis&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;✅ In-memory database. Faster than random disk I&#x2F;O.&lt;&#x2F;li&gt;
&lt;li&gt;✅ High read and write throughput, low latency.&lt;&#x2F;li&gt;
&lt;li&gt;❗️ Dataset cannot be larger than memory.&lt;&#x2F;li&gt;
&lt;li&gt;Redis is primarily single-threaded,
&lt;ol&gt;
&lt;li&gt;which makes it fast because of simpler code paths, no messing with locks and synchronization&lt;&#x2F;li&gt;
&lt;li&gt;But doesn&#x27;t leverage all the cores of a modern CPU.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Uses
&lt;ol&gt;
&lt;li&gt;Caching objects for web requests (similar to memcached, multiple redis servers in a cluster for scale).&lt;&#x2F;li&gt;
&lt;li&gt;As a session store.&lt;&#x2F;li&gt;
&lt;li&gt;MessageQueue&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Embrace Fearlessly The Burning World</title>
        <published>2023-02-19T00:00:00+00:00</published>
        <updated>2023-02-19T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/barry-lopez-burning-world/"/>
        <id>https://asun9.com/barry-lopez-burning-world/</id>
        
        <content type="html" xml:base="https://asun9.com/barry-lopez-burning-world/">&lt;p&gt;Book: &lt;strong&gt;Embrace Fearlessly The Burning World&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Barry Lopez&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;This is a collection of Barry Lopez&#x27;s essays over the past 30 years, the oldest of which appears to be from 1989. There is some repetition since these pieces appeared in many different magazines, and Lopez died before he could edit them with his apparently customary thoroughness. I found one of his themes - his childhood molestation - pretty painful to get through, and certainly didn&#x27;t want to keep encountering it again and again. I had been hearing about Lopez for a while, and in his nature pieces, I should say he delivers. Lopez, like Mary Oliver, is completely present to experiences of the world around him. He pays attention and in recording what he does, forces us to do the same. His concerns range from pre-war LA to Alaska to Dreamtime landscapes of Australia, and the depredations caused by humans to the natural world. Lopez, after a life time of field work, doesn&#x27;t seem to have any hope left that we can invent our way out of environmental degradation and  &quot;biological and economic problems associated with advancing climate breakdown.&quot; He has his reasons, but I find it hard to share his pessimism. As a new father, you can&#x27;t help being optimistic about the world (after all, deciding to have children now is the most world affirming thing you could be doing). More than any other time in the past, we understand the urgency of the present moment. I think this is especially true for the young people - Greta Thunberg, the museum vandals, the rise to power of the green parties. &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;ourworldindata.org&#x2F;world-lost-one-third-forests&quot;&gt;Deforestation&lt;&#x2F;a&gt; has been in decline since the 1980s. And so I still retain hope.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>A short list of people claiming to be enlightened</title>
        <published>2023-02-17T00:00:00+00:00</published>
        <updated>2023-02-17T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/freaks-meditators/"/>
        <id>https://asun9.com/notes/freaks-meditators/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/freaks-meditators/">&lt;p&gt;And don&#x27;t seem obviously insane or charlatan. Listing only those who can articulate their experience outside of traditional religious language. And alive.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;qualiacomputing.com&#x2F;2021&#x2F;11&#x2F;23&#x2F;the-supreme-state-unconsciousness-classical-enlightenment-from-the-point-of-view-of-valence-structuralism&#x2F;comment-page-1&#x2F;&quot;&gt;Roger Thisdell&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Tn9WlWH3rPE&quot;&gt;Delson Armstrong&lt;&#x2F;a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;edgeofmindpodcast.com&#x2F;delson-armstrong-on-the-marvels-of-the-mind-high-altitude-states-of-meditative-absorption-jhana-part-i&#x2F;&quot;&gt;Extraordinary claims&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;sashachapin.substack.com&#x2F;p&#x2F;enlightenment&quot;&gt;Sasha Chapin&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.integrateddaniel.info&#x2F;talking-about-it&quot;&gt;Daniel Ingram&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;archive.org&#x2F;details&#x2F;nue7yhqw7bvawcofh4cgtm1dtha25xmd3w2jk77y&quot;&gt;Vinay Gupta&lt;&#x2F;a&gt;
&lt;ul&gt;
&lt;li&gt;Why become enlightened? &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;http:&#x2F;&#x2F;files.howtolivewiki.com&#x2F;why_become_enlightened.mp3&quot;&gt;Part 1&lt;&#x2F;a&gt; and &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;http:&#x2F;&#x2F;files.howtolivewiki.com&#x2F;why_become_enlightened_2.mp3&quot;&gt;Part 2&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.siftingtothetruth.com&#x2F;&quot;&gt;Akilesh Ayyar&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=4t8KvdMtT4A&quot;&gt;Frank Yang&lt;&#x2F;a&gt;
&lt;ul&gt;
&lt;li&gt;Okay, this guy seems more than a little bit out-there.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Nursing</title>
        <published>2023-02-11T00:00:00+00:00</published>
        <updated>2023-02-11T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/nursing-and-stress/"/>
        <id>https://asun9.com/notes/nursing-and-stress/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/nursing-and-stress/">&lt;p&gt;Having a child and nursing them is so exhaustive for women. During the first few months, the baby wakes every hour or so with wet diaper or hunger pangs and need to be cleaned and fed. The baby&#x27;s screams are no longer cute when it happens at 2 am in morning and then 2 hours after that. In South India, these first few months, you have help from the woman&#x27;s family, her mother, her sister. But is it enough? I can&#x27;t recall the women in my family complaining. Evolution is doing its best. Nursing is accompanied by &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.ncbi.nlm.nih.gov&#x2F;books&#x2F;NBK539790&#x2F;&quot;&gt;oxytocin release&lt;&#x2F;a&gt;, which promotes a state of calm. The secretion occurs when the mother expects a feed or starts seeing, hearing, smelling, or even thinking about the baby. I think we should assign some blame to modernity for the stress. Lack of social safety net means instead of sleeping when the baby sleeps, the mother is running errands. Sleep deprivation is correlated to &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.ncbi.nlm.nih.gov&#x2F;pmc&#x2F;articles&#x2F;PMC5561681&#x2F;&quot;&gt;postpartum depression&lt;&#x2F;a&gt;. How do people in America, these single family households, manage at all without help is a wonder. When I see these posts on instagram of mothers with their infants, smiling and playing, all I think is, what are they hiding?&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Bye, Old Friend</title>
        <published>2023-02-05T00:00:00+00:00</published>
        <updated>2023-02-05T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/bye-sleep/"/>
        <id>https://asun9.com/notes/bye-sleep/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/bye-sleep/">&lt;p&gt;I have always been a deep sleeper. This one time in college, I went to sleep in my room while my roommate went out for a smoke. When he came back he found the door locked and his knocks unanswered. The entire hostel block had to gather and break the door open to find me sleeping inside. They assumed I had killed myself.&lt;&#x2F;p&gt;
&lt;p&gt;Another time, when I was in 10th or 11th grade in school, my mom told me watch the house while she went out on a quick errand downstairs. I snuggled into the bed with a book and no intention of sleeping. Of course I locked the door to the apartment. She, like my friend above, came home to find herself locked out without spare keys. She had to take the neighbors help and open the window next to my bed to get me to wake up and let her in.&lt;&#x2F;p&gt;
&lt;p&gt;I never did not sleep well. Just two weeks ago, in the hospital, as my wife was being induced, I passed out on the couch. When I came to, I was told I had been unresponsive to her calls when she wanted a restroom break and she had to take the help of the nurse.  There were many restroom breaks - she was on the IV. The first few days I slept through my daughter&#x27;s cries, and the only way I could be of help to my wife in the night was by not sleeping at all.&lt;&#x2F;p&gt;
&lt;p&gt;Back home, this past week I found myself checking on the baby whenever I heard the slightest noise. I was mistrustful of the snoo and had become sensitive of the daughter&#x27;s call for attention: she was hungry or had wet her diapers. My wife had crashed, after 10 days of minimal sleep. As of today, I have had less sleep in a week than I ever did in my life. Mostly it is because I don&#x27;t want to let my wife down, but also because I need to make the baby comfortable. I need to get up and check that she is doing fine. Whoever coined the phrase &quot;sleeping like a baby&quot; clearly never had a baby. A sleeping baby is not quiet for long. There is cooing, grunting, hiccups, false cries, reflexes that jolt the baby awake.&lt;&#x2F;p&gt;
&lt;p&gt;It looks like this is how the story is going to be for the next few months. I miss sleep already.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Crying Infants</title>
        <published>2023-01-30T00:00:00+00:00</published>
        <updated>2023-01-30T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/baby-crying/"/>
        <id>https://asun9.com/notes/baby-crying/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/baby-crying/">&lt;p&gt;When a week-old baby cries, there is a reason and it is always one of these three:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;The baby has wet her diapers.&lt;&#x2F;li&gt;
&lt;li&gt;She is hungry.&lt;&#x2F;li&gt;
&lt;li&gt;She&#x27;s uncomfortable. Is she too hot or too cold or being held too tightly or too loosely?&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Working my way through this checklist for each bawl and resolving the issues hasn&#x27;t failed me. Yet.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Bendōwa</title>
        <published>2023-01-26T00:00:00+00:00</published>
        <updated>2023-01-26T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/dogen-uchiyama/"/>
        <id>https://asun9.com/dogen-uchiyama/</id>
        
        <content type="html" xml:base="https://asun9.com/dogen-uchiyama/">&lt;p&gt;Book: &lt;strong&gt;Wholehearted Way: A Translation of Eihei Dōgen&#x27;s Bendōwa&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Dōgen, Commentary by Kosho Uchiyama Roshi&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Bendōwa is one of the two early texts Dōgen wrote after his return from China in 1227. This very short treatise emphatically rejects everything other than zazen as central message and practice of Buddhism. After the introduction, there are a series of questions followed by answers. Sometimes Dōgen can be insulting, and I found these put-downs outright hilarious.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;“Reading literature while ignoring the way of practice is like a person reading a prescription but forgetting to take the medicine; what is the benefit? Continuously uttering sounds like frogs in a spring rice paddy croaking day and night is also ultimately worthless.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Or consider this:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;“Although it is said that one should not relate dreams to fools and it is useless to give oars to mountain folks, I will give you further instruction.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Was this a common pedagogical style in Japan back then? It’s always interesting to see references to India and its geography - “In the Western Heaven…people are inherently straight forward”. The River Ganges is mentioned without further elaboration, which means both Dōgen and other monks and laypeople in 13th century Japan were at least a little familiar with the river, and its significance in India.&lt;&#x2F;p&gt;
&lt;p&gt;Most of the book is a commentary on Bendōwa by the 20th century Sōtō Zen priest, Kosho Uchiyama. This commentary on an established religious text is similar to the other tradition I am most familiar with, that of 20th century Advaita teachers commenting on Shankaracharya or Ramanuja or Bhakti Sutras. There is a mixture of apologetics, elaboration and the necessity of faith in Buddha-dharma to address some of the ills of modernity. Zen as explained by Uchiyama is also very similar to Shankara&#x27;s Advaitic non-duality, which itself arose in oppositon to Buddhism. It&#x27;s fascinating to me that &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;loveofallwisdom.com&#x2F;blog&#x2F;2020&#x2F;08&#x2F;perennial-nondualism&#x2F;#more-4938&quot;&gt;East Asian Buddhists&lt;&#x2F;a&gt; and Vedantists agree on the nondual worldview.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;“All beings exist through life experience of the self. The self lives out itself in the life experience of all beings. The life experience of the self and the myriad beings that we experience are one. This is the reality of life. The life experience of the self and the life experience of all beings can never separate into subject and object. That which experiences and that which is experienced cannot be divided into two.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Uchiyama repeatedly emphasizes that the practice is the point. Enlightenment is just zazen, and not a state that you encounter suddenly after sitting for some time or by listening to Zen koans. You must construct your life around sitting. There is a reality beyond the conceptual mind, before dividing into good or bad, delusion or enlightenment. Zazen is no good if you want to become an improved person - kinder, more productive  and such. You cannot see this reality by reading about it. It takes years of practice. He recommends sitting for at least 10 years. This message has been persuasive to many people in the West. Uchiyama’s books are one of the most recommend books on Zen practice. If you are into Zen or Buddhism, I suppose this will deepen your practice in the same way that Yoga Sutras will for yoga practitioners. In other words, svādhyāya.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Classical Liberalism</title>
        <published>2023-01-16T00:00:00+00:00</published>
        <updated>2023-01-16T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/fukuyama-liberalism-discontent/"/>
        <id>https://asun9.com/fukuyama-liberalism-discontent/</id>
        
        <content type="html" xml:base="https://asun9.com/fukuyama-liberalism-discontent/">&lt;p&gt;Book: &lt;strong&gt;Liberalism and Its Discontents&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Francis Fukuyama&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Liberalism is a big tent. The social contract is that you have a rule of law, a respect for private property, and a respect for human autonomy and choice. Within these constraints you can find governing systems as varied as the neoliberal USA, the welfare states of Europe, and conglomerate-run East Asian countries. These constraints meant that liberalism eventually became the ideological basis of market economy - you can’t have a market economy if the government can change and you lose access to land or goods. Francis Fukuyama charts the global prosperity and standard of living we have now to the liberal world order, and its inherent tolerance for diversity. Liberalism historically had two enemies - communism and nationalism. The world wars were an out-growth of nationalism, and the cold war, communism. That it survived both is to Fukuyama an indication of the strength of liberal ideas.&lt;&#x2F;p&gt;
&lt;p&gt;Liberalism’s current threats are again from the left and the right. The frame of reference here is mostly the USA and Europe (in India, all parties are to the left of USA-center, even if Fukuyama thinks otherwise). Fukuyama’s argument is that both the left and right take issues with liberalism&#x27;s excesses, misidentify these with liberalism’s core ideas, and in rejecting it are in the process of throwing the baby along with the bath water. An example of this excess is neoliberalism - a divorcing of state oversight and devaluing of the welfare state - that has led to enormous inequality and financial crises. Yes, there has been an increase in aggregate prosperity, but you cannot explain to a voter in the United States that he has lost his job, but someone in Asia has been pulled out of poverty thanks to outsourcing.&lt;&#x2F;p&gt;
&lt;p&gt;The now fashionable criticism of liberalism from the progressive left in USA is that since these ideas emerged from Europe after &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;European_wars_of_religion&quot;&gt;150 years of war&lt;&#x2F;a&gt;, it is alien and inapplicable to other countries and groups. Fukuyama rejects that criticism, giving the examples of Taiwan, South Korea and Japan that propelled to first world status using the same operating principles in the second half of the twentieth century.  China became prosperous only when starting relaxing its economy and permitted peasants to keep the earnings from their family plots under the household responsibility system instead of working on collective farms. Similarly, he considers identity politics, critical theory, globalization and addresses their premises. In doing this, he’s fair in how he’s characterizing these postmodern arguments and their dominance in academia. I found myself willingly led by him as he argues against these extremes of epistemic relativism. In the end, his defense seems to be that yes, liberalism doesn’t result in equality of outcomes, but everything else is worse. This echoes what &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;winstonchurchill.org&#x2F;resources&#x2F;quotes&#x2F;the-worst-form-of-government&#x2F;&quot;&gt;Churchill said about democracy&lt;&#x2F;a&gt;. And I agree.&lt;&#x2F;p&gt;
&lt;p&gt;The one liberal ideal I endorse wholeheartedly is its tolerance of diversity - not just race and gender, but also political viewpoints and religious traditions. This tolerance is critical for human prosperity and managing violence. In choosing between which diversity among many it&#x27;s willing to endorse, the loudest voices on the progressive left are being hypocritical, both in India and elsewhere. Yes, tolerance and liberal ideas emerged in and were adopted by countries that were not liberal themselves. United States gave women representation only in 1920, and enfranchisement to African Americans only in the 1960s. Liberal Britain was also a rapacious colonizer. &quot;But saying that racism and patriarchy were intrinsic to liberalism is to essentialize historically contingent phenomena. The fact that self-proclaimed liberals endorsed illiberal ideas and policies in the past does not mean that the doctrine was incapable of acknowledging and correcting these mistakes..&quot;. The world has grown richer since colonialism was dismantled.&lt;&#x2F;p&gt;
&lt;p&gt;Fukuyama notes that between liberal universalism and national identity there is a powerful point of tension, but he thinks there needn&#x27;t be a contradiction. If forced to choose, it&#x27;s clear which side of the fence he falls on - that of the universalism. On the other hand, I am quite sympathetic to ideas around strengthening national identities. What the last 50 years has shown is that concerns about human rights are a sham, and countries are willing to do what they want to further either corporate interests or those of the elites. National identities offer a buffer around such predation, no matter what the globalized elite seem to think.&lt;&#x2F;p&gt;
&lt;p&gt;While Fukuyama does as he promises with the title, describing liberalism and its discontents, he doesn’t deliver on the solutions to its excesses. His alternatives are more or less commonsensical, but lacking in realpolitik. That is a very tame end to the book, and it left me wanting more. Fukuyama&#x27;s focus is on the West, aside from some hand-wavy statements on India. I would like to read more about India and its interpretation of the liberal tradition. &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;polisci.columbia.edu&#x2F;content&#x2F;sudipta-kaviraj&quot;&gt;Sudipta Kaviraj&lt;&#x2F;a&gt;, Udai Singh Mehta, and &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.amazon.com&#x2F;Raise-Fallen-People-Nineteenth-Century-International&#x2F;dp&#x2F;0231206445&quot;&gt;Rahul Sagar&lt;&#x2F;a&gt; seem to point a way.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Manoj Das&#x27; Tales</title>
        <published>2023-01-13T00:00:00+00:00</published>
        <updated>2023-01-13T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/tales-manoj-das/"/>
        <id>https://asun9.com/tales-manoj-das/</id>
        
        <content type="html" xml:base="https://asun9.com/tales-manoj-das/">&lt;p&gt;Book: &lt;strong&gt;Tales Told By Mystics&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Manoj Das&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Manoj Das is a much decorated Odiya author and a devotee of Aurobindo. This book is a compilation of folk tales circulating in the Indian subcontinent in the twentieth century. They are essentially of religious nature. Versions of these stories are part of my childhood. Themes include search for God, who is within, the futility of visiting religious places if it&#x27;s not accompanied by inner transformation, rogue sadhus changed by wearing the ochre robe or by the faith of the devout. The dissolving of identity is emphasized and also the power of faith. The latter is unsurprising, this is the land of Bhakti after all. The dissolving of identity is a close to universal precept among many Indian religions, even if the consequences of that idea has had curiously minimal impact on the lived experience of most people. Relatedly, there is no mention of jati at all, which reminded me yet again of the sort of literature I was exposed to as a child.&lt;&#x2F;p&gt;
&lt;p&gt;The stories are simple and memorable enough, given the themes, and I found myself entertaining children of friends with these. If nothing else, this is valuable for that alone. I am tempted to say it&#x27;s also valuable because it captures ideas from a more innocent time, when Indian religion still seemed to hold promise of liberation. Now accessing the same attitude as an adult requires some considerable soul work and rationalizing.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>GBS and Induction of Labor</title>
        <published>2023-01-12T00:00:00+00:00</published>
        <updated>2023-01-12T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/gbs/"/>
        <id>https://asun9.com/notes/gbs/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/gbs/">&lt;h2 id=&quot;gbs&quot;&gt;GBS&lt;&#x2F;h2&gt;
&lt;p&gt;Group B streptococci (GBS) is a bacteria found in some pregnant people. Between 35 to 37 weeks of pregnancy, a screening is done to find out if they are a carrier of the bacteria. A carrier means the person has GBS in their bodily fluids, but there are no signs of infection.&lt;&#x2F;p&gt;
&lt;p&gt;Some information one should know in order to make an informed decision regarding GBS:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;25% of the pregnant people are carriers of GBS.&lt;&#x2F;li&gt;
&lt;li&gt;Approximately 1 in 200 babies born to these people acquire a GBS infection.&lt;&#x2F;li&gt;
&lt;li&gt;GBS can cause pneumonia, sepsis and meningitis in the new born - all serious diseases.&lt;&#x2F;li&gt;
&lt;li&gt;If the laboring person is given antibiotics, the risk of the new born being infected with GBS is 1 in 2000 to 4000.
&lt;ul&gt;
&lt;li&gt;Several doses of the antibiotics are given during the waiting period. A common practice is to give a maximum of four doses and &lt;strong&gt;plan for induction if the person does not go into labour within 24 hours&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;The baby receives these antibiotics via the placenta.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;If the GBS carrier is given insufficient antibiotics before giving birth, the baby is observed for symptoms and tested. Tests are done on a culture from the baby&#x27;s blood, urine or spinal fluid.
&lt;ul&gt;
&lt;li&gt;The baby can be given the same antibiotics and observed for 2 or 3 days till the tests are complete.&lt;&#x2F;li&gt;
&lt;li&gt;If GBS is present in the culture, antibiotics via IV are continued for many more days and new born monitored for signs of infection.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Antibiotics must be administered to the pregnant person when their membranes rupture or when they go into labour. Membranes could rupture during a dilation check, for example. Or it could be natural, what&#x27;s called a &quot;water break&quot;.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;induction&quot;&gt;Induction&lt;&#x2F;h2&gt;
&lt;p&gt;By induction, we mean labor that is artificially started or sped up. This can be done for both medical and non-medical reasons.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Inductions are most successful when cervix has ripened or softened considerably.&lt;&#x2F;li&gt;
&lt;li&gt;If induction is done for medical reasons and fails, cesarean is the only option.
&lt;ul&gt;
&lt;li&gt;Medical reasons include being positive for GBS, high blood pressure, prolong ed pregnancy (over 40 weeks). Or the pregnant person could have prolonged prelabor but the cervix is firm. Many more.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;There are multiple ways to induce or augment labour.
&lt;ul&gt;
&lt;li&gt;Artificial rupture of membranes.&lt;&#x2F;li&gt;
&lt;li&gt;Prostaglandin gels or tablets. Used before the cervix has naturally softened or thinned.&lt;&#x2F;li&gt;
&lt;li&gt;Pitocin via IV in a continuous drip. Works only if the cervix has softened.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Each Moment Is The Universe</title>
        <published>2023-01-09T00:00:00+00:00</published>
        <updated>2023-01-09T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/dainin-moment-universe/"/>
        <id>https://asun9.com/dainin-moment-universe/</id>
        
        <content type="html" xml:base="https://asun9.com/dainin-moment-universe/">&lt;p&gt;Book: &lt;strong&gt;Each Moment Is The Universe: Zen and the Way of Being Time&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Dainin Katagiri, edited by Andrea Martin&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Dogen is the founder of the Soto Zen school of Japanese Buddhism. A writer, philosopher and poet, his reconfiguration of Chan practice is what largely informs Zen, and every Zen teacher has had to grapple with his works. Dainin Katagiri was a Roshi, a master, from that school, and this book is a compilation of talks he had given over a twenty year period on an essential element of Dogen&#x27;s metaphysics, Being-Time.&lt;&#x2F;p&gt;
&lt;p&gt;Being concerns itself with existence. What does it mean to be something? Time in the sense we are most familiar with is the measure of physical processes, or more simply, what the clock says. Katagiri&#x27;s Time is not just the normal, familiar time, but a combination of it with space. There is no before or previous moment or next moment, there is the present moment extending into the universe. Time and Being are not separate, but not equivalent either, and the subjective universe is produced by the interaction of the two. &quot;When the moment begins, all sentient beings temporarily appear as particular beings in the stream of time and seem to have their own separate existences. When the moment ceases, all sentient beings disappear, but they do not go away; they are interconnected smoothly and quietly in timelessness.&quot; I don&#x27;t know how to accept this other than assuming once you inhabit an altered state of consciousness that comes with certain meditation practices, your perception of time changes. Like all major proponents of non-dual awareness assert, what we perceive as the world is generated by the mind. To be rid of the delusion of the real is not the point of Zen, but to be aware of it.&lt;&#x2F;p&gt;
&lt;p&gt;A lot of what Dainin says can be mapped to non-Buddhist Indian thought, especially Karma Yoga. Take this for example:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;All you have to do is follow the technique. Just continue to act! Day after day, moment after moment, just take care of practice, leaving no trace of technique and no trace of practitioner. This is a very fundamental attitude toward human life. If you do it, finally you will be great: a great skier, a great artist, a great musician, a great poet, a great philosopher, a great businessman, or a great religious person.&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Compared to Theravada Buddhism, I like it that Zen says that enlightenment is not a big deal, and one must not aspire to it. It will not change you. Your neuroses will remain. So why bother? The practice is the point.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Sitting in zazen, practicing with all sentient beings, you become Buddha. At the same time, your activity becomes enlightenment. Carry this practice as long as possible, moment by moment and day by day, and this is called nirvana.&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;...practice is to manifest the object of your activity - zazen, cooking, sports, or whatever you are doing - as a being that exists in eternal time. If you do something wholeheartedly, all sentient beings come into your life.&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;I can buy that. This characterization of Zen seems more like Mihaly Csikszentmihalyi&#x27;s flow, an easy to attain state, while also not being a rejection of the material world. Enlightenment then is an attitude, seeing life from a universal perspective, that of Being-Time.&lt;&#x2F;p&gt;
&lt;p&gt;While the book is eminently quotable, I wonder what good all these are if you violate some very basic ethical principles. Three of the four major Zen figures who came to the United States from Japan had &lt;a href=&quot;https:&#x2F;&#x2F;www.theatlantic.com&#x2F;national&#x2F;archive&#x2F;2014&#x2F;12&#x2F;the-zen-predator-of-the-upper-east-side&#x2F;383831&#x2F;&quot;&gt;major public sex scandals&lt;&#x2F;a&gt;. Clearly, power corrupts, even those certified enlightened. I suppose one should learn to separate the message from the messenger and yet I can&#x27;t but help be bothered by it. Something else I find myself thinking about is the structure of the text itself. Like some other Zen books, this one is also derived from talks recorded over a long time. They are transcribed by devoted students into a collection bearing the speaker&#x27;s name. There is no background provided on the talk each chapter is derived from. The chapters are organized along the theme of the book, arranged in the structure of the Four Noble Truths. I wonder, am I reading Katagiri or am I reading Katagiri as mediated and understood by the curator? And does it matter?&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Venkata Kavi on Ramayana</title>
        <published>2023-01-08T00:00:00+00:00</published>
        <updated>2023-01-08T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/sree-jaya-rama/"/>
        <id>https://asun9.com/notes/sree-jaya-rama/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/sree-jaya-rama/">&lt;p&gt;At a family function earlier in the day, someone sang this composition by &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Oothukkadu_Venkata_Kavi&quot;&gt;OVS&lt;&#x2F;a&gt; on the Ramayana. I do not have much of an ear for Carnatic music, but this one immediately grabbed my attention. It&#x27;s in Tamil, and there&#x27;s mention of Kaveri. I shouldn&#x27;t have been suprised by the mention of Kaveri in a retelling of Ramayana from the 18th century. Kamban&#x27;s Ramavataram, composed 600 years earlier, had as it&#x27;s setting Ayodhya, but peopled by folks in and around Chola lands. Ramar&#x27;s coronation there had the Chola and Pandyas as visiting royals. Ramayana has always been moulded and shaped by the desires, devotion and political landscape of its retellers.&lt;&#x2F;p&gt;
&lt;div class=&quot;yv&quot;&gt;
    &lt;iframe src=&quot;https:&#x2F;&#x2F;www.youtube-nocookie.com&#x2F;embed&#x2F;32Yb_s6XGcw&quot; title=&quot;Youtube&quot; class=&quot;yvi&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;&#x2F;iframe&gt;
&lt;&#x2F;div&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Book Notes: Several Short Sentences About Writing</title>
        <published>2023-01-03T00:00:00+00:00</published>
        <updated>2023-01-03T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/verlyn-k-on-writing/"/>
        <id>https://asun9.com/verlyn-k-on-writing/</id>
        
        <content type="html" xml:base="https://asun9.com/verlyn-k-on-writing/">&lt;p&gt;Book: &lt;strong&gt;Several Short Sentences About Writing&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Verlyn Klinkenborg&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;After putting it off for months, I finally got to this one during the winter break when I was in-between books. I am averse to pointed advice from strangers, and I will not be taking the opinions from a book written this strange way. So I thought. But the suggestions made sense, the prose persuasive, and I found myself taking notes. I began to wonder if I was liking it because it was appealing to my existing prejudices. I stopped then and looked up the author, Verlyn Klinkenborg, to see what his more mainstream work was like. That&#x27;s when I discovered his review of Kim Stanley Robinson&#x27;s &lt;a href=&quot;https:&#x2F;&#x2F;www.theatlantic.com&#x2F;books&#x2F;archive&#x2F;2022&#x2F;07&#x2F;the-high-sierra-kim-stanley-robinson-book-review&#x2F;670587&#x2F;&quot;&gt;The High Sierras&lt;&#x2F;a&gt; and a few of his pieces from the New York Times. I found it more than reassuring. I am now a fan. This is someone who knows what he is talking about.&lt;&#x2F;p&gt;
&lt;p&gt;Good writing is intentional. Every word is where it is because the author has deliberately placed it there. This is one of the two high-utility takeaways — among many — from the book. The other one is instead of just obsessing over meaning of a text, you need to pay attention to the structure and literal significance of the prose. This has already started informing how I read. It is more rewarding than one would think.&lt;&#x2F;p&gt;
&lt;p&gt;This is a rare book worth reading and re-reading.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;highlights&quot;&gt;Highlights&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Your job as a writer is making sentences. Most of your time will be spent making sentences in your head. In your head. Did no one ever tell you this? That is the writer’s life. Never imagine you’ve left the level of the sentence behind.&lt;&#x2F;li&gt;
&lt;li&gt;A writer’s real work is the endless winnowing of sentences, The relentless exploration of possibilities, The effort, over and over again, to see in what you started out to say The possibility of saying something you didn’t know you could.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;You can only become a better writer by becoming a better reader. You have far more experience as a reader than you do as a writer.&lt;&#x2F;strong&gt; You’ve read millions of words arranged by other writers. How many sentences have you made so far?&lt;&#x2F;li&gt;
&lt;li&gt;Prose isn’t validated by a terminal meaning. If you love to read—as surely you must—you love being wherever you find yourself in the book you’re reading, Happy to be in the presence of every sentence as it passes by, Not biding your time until the meaning comes along.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Every work of literature is the result of thousands and thousands of decisions. Intricate, minute decisions—this word or that, here or where, now or later, again and again. It’s the living tissue of a writer’s choices, Not the fossil record of an ancient, inspired race. Interrogate those choices. Imagine the reason behind each sentence. Why is it shaped just this way and not some other way? Why that choice of words? Why that phrasing? Why that rhythm?&lt;&#x2F;strong&gt;
&lt;ul&gt;
&lt;li&gt;One of the hardest things about learning to read well is learning to believe that every sentence has been consciously, purposely shaped by the writer. This is only credible in the presence of excellent writing.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;The urge to write is so strong. Aspiring writers want so badly to be pouring something out of themselves. You need a place where you can practice noticing and making sentences— Observations of genuine clarity, Sentences of vigor, invention, and self-perception. That place would be your mind.&lt;&#x2F;li&gt;
&lt;li&gt;When the work is really complete, the writer knows how each sentence got that way, What choices were made. You become not only a living concordance of your work, able to say where almost any word appears. You also carry within you the memory of all the decisions you made while shaping your prose, Decisions invisible to the reader except in the residue of your prose.&lt;&#x2F;li&gt;
&lt;li&gt;Do you remember, in school, going around the room, Each student in turn reading a paragraph out loud? Remember how well some students read and others, how badly? It was a difference in comprehension, Not of the sentence’s meaning, But of its texture, pace, structure, actuality.&lt;&#x2F;li&gt;
&lt;li&gt;The idea of writer’s block, in its ordinary sense, exists largely because of the notion that writing should flow. But if you accept that writing is hard work, And that’s what it feels like while you’re writing, Then everything is just as it should be. Your labor isn’t a sign of defeat. It’s a sign of engagement. The difference is all in your mind.
&lt;ul&gt;
&lt;li&gt;And like “flow,” “natural” is one of the words behind writer’s block. So let’s suppose there’s no such thing as writer’s block. There’s loss of confidence. And forgetting to think. And failing to prepare. And not reading enough. And giving up on patience. And hastening to write. And fearing your audience. And never really trying to understand how sentences work. Above all, there’s never learning to trust yourself, or your capacity to learn or think or perceive.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Concentration, attention, excitement, will be part of your working state. Daily. Flow, inspiration—the spontaneous emission of sentences—will not.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Write consciously, deliberately. Learn how to get out of trouble. Learn how to free yourself when you’re stuck. Learn how to know what you’re doing when you’re making sentences.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Try this: No outline. Research, reading, noticing, interviewing, traveling, paying attention, note taking—all the work you do to understand the subject, whatever it is, whatever kind of piece you’re writing. Reread your notes, and take notes on them. And again. Take notes on your thoughts. Most of all, take notes on what interests you. Be certain you’ve marked out what interests you. Don’t make an outline from your notes. Don’t turn your notes into a road map for the sentences to come.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;How do you begin to write? Look for a sentence that interests you. A sentence that might begin the piece. Don’t look too hard. Just try out some sentences. Lots of them. See how they sound. Do any of them sound first? Discard them readily, easily, with no sense of loss, then try out some more.&lt;&#x2F;strong&gt; This is important. Get used to discarding sentences.&lt;&#x2F;li&gt;
&lt;li&gt;Don’t give in to the memory of your school writing, The claustrophobic feeling that there’s only one right order of arguing, proving, demonstrating, The assumption that logic persuades the reader Instead of the clarity of what you’re saying.
&lt;ul&gt;
&lt;li&gt;Your job isn’t to arrange chunks of evidence, Chunks of the world in the order you gather them. &lt;strong&gt;Your job is to atomize everything you touch, To dissect your evidence into its details and particulars&lt;&#x2F;strong&gt; and Resist the inherent jargon of your subject, Breaking apart every clod of words you come across. Your job is to undo the adhesiveness of the evidence you’ve gathered, Its tendency to clump into indissoluble units.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;All the authority a writer ever possesses is the authority the reader grants him. Yet the reader grants it in response to her sense of the writer’s authority. Authority arises only from clarity of language and clarity of perception. Authority is how the reader’s trust is engaged.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Every Moment Is An Emergency</title>
        <published>2023-01-02T00:00:00+00:00</published>
        <updated>2023-01-02T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/dainin-emergency/"/>
        <id>https://asun9.com/dainin-emergency/</id>
        
        <content type="html" xml:base="https://asun9.com/dainin-emergency/">&lt;p&gt;A few years ago I tried listening to Dainin Katagiri&#x27;s lectures on Apple Podcasts. Dainin Katagiri was the founding abbot of the Minnesota Zen Meditation Center. He died of cancer in 1990, and the talks in the podcast were recorded in the late 80s. I found his accent hard to understand. Outside of that lone memory, I don&#x27;t remember anything at all about the contents of his talk. My poor recall can be explained by the fact that I am a bad listener; I don&#x27;t blame Dainin or his accent. I am a slightly better reader, however. I encountered Dainin again after all these years this past weekend in the Cupertino Library. I read the first few pages of the book &quot;Each Moment Is The Universe&quot; and I knew that it was going to come home with me. Dainin is trying to emphasize the urgency of Zen, and this he does with striking metaphors.  I am far from done with the book, but the lines below struck a cord and so I must share them here.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;So before the earthquake happens, before your mind starts to work and you want run away, accept every moment as an opportunity presented to you to practice facing reality as it really is. When a moment arises, you don&#x27;t know the reason why it exists, but you have to accept it and face it, whatever happens.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Life is an emergency case! Where is the emergency? Is it a particular situation, one day of your life? No, &lt;strong&gt;every moment of every day is an emergency. You have to do your best to face every moment, because this moment will never come again. The moment that you are living right now is a very important opportunity to make your life vividly alive. If you want to live with spiritual security in the midst of constant change, you have to burn the flame of your life force in everything you do.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Like other Zen books, this one is also derived from talks recorded over a long time, twenty years in this case. They are transcribed by devoted students into a collection bearing the speaker&#x27;s name. There is no background provided on the talk each chapter is derived from. The chapters are organized along the theme of the book, arranged in the structure of the Four Noble Truths. I wonder, am I reading Katagiri or am I reading Katagiri as mediated and understood by the curator? And does it matter?&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Compiling and deploying a Zola site</title>
        <published>2022-12-29T00:00:00+00:00</published>
        <updated>2022-12-29T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/zola-deploy-script/"/>
        <id>https://asun9.com/notes/zola-deploy-script/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/zola-deploy-script/">&lt;p&gt;Quick script to build and deploy a Zola site to Netlify.&lt;&#x2F;p&gt;
&lt;p&gt;First, create this Makefle:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;make&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-make &quot;&gt;&lt;code class=&quot;language-make&quot; data-lang=&quot;make&quot;&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;DEPLOY_PATH &lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;= https:&#x2F;&#x2F;api.netlify.com&#x2F;api&#x2F;v1&#x2F;sites&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;$(NETLIFY_SITE_NAME)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;.netlify.com&#x2F;deploys
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;OUTPUT_DIR &lt;&#x2F;span&gt;&lt;span&gt;:= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;_release
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;ZIP_FILE &lt;&#x2F;span&gt;&lt;span&gt;:= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;$(OUTPUT_DIR)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;.zip
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;print&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;	 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;@echo $(NETLIFY_AUTH_TOKEN)
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;clean&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;	&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;rm -rf $(OUTPUT_DIR)
&lt;&#x2F;span&gt;&lt;span&gt;	&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;[ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;-a $(ZIP_FILE) &lt;&#x2F;span&gt;&lt;span&gt;]; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;then &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;rm $(ZIP_FILE)&lt;&#x2F;span&gt;&lt;span&gt;; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;build&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;	&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;zola&lt;&#x2F;span&gt;&lt;span&gt; build&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt; --output-dir $(OUTPUT_DIR)
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;zip&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;	&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;zip -r $(ZIP_FILE) $(OUTPUT_DIR)&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;deploy&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;	&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;curl -H &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;Content-Type: application&#x2F;zip&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt; -H &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;Authorization: Bearer &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;$(NETLIFY_AUTH_TOKEN)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt; --data-binary &lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;@&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;$(ZIP_FILE)&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;$(DEPLOY_PATH)
&lt;&#x2F;span&gt;&lt;span&gt;	
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;all&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;clean build zip deploy
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Export your personal access token using the environment variable &lt;code&gt;NETLIFY_AUTH_TOKEN&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Similary export your site name using the environment variable &lt;code&gt;NETLIFY_SITE_NAME&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;To deploy, just do this: &lt;code&gt;make all&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>State of Reading 2022</title>
        <published>2022-12-29T00:00:00+00:00</published>
        <updated>2022-12-29T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/reading-highlights-2022/"/>
        <id>https://asun9.com/reading-highlights-2022/</id>
        
        <content type="html" xml:base="https://asun9.com/reading-highlights-2022/">&lt;p&gt;I finished &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.goodreads.com&#x2F;user&#x2F;year_in_books&#x2F;2022&#x2F;3523286&quot;&gt;37 books&lt;&#x2F;a&gt; so far this year. I might finish one other before the year ends. There are many more in various stages of progress, but incomplete. These 37 span 9537 pages, so that&#x27;s roughly 237 pages a book on average. When I started this year, I wanted to read a lot less that I did before. I failed by at least 15. Most of my reading happened just these past six months - I only read 8 books or so prior to June&#x2F;July.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Four of the books are technical. One of them as part of the book club at work.  I regard these as high leverage activities. At least two of them informed how I go about building systems in my day job.&lt;&#x2F;li&gt;
&lt;li&gt;Completed a few others are also thanks to another management-oriented book club at work. I still get hits on the website for the &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;high-output-management&#x2F;&quot;&gt;book notes&lt;&#x2F;a&gt; on High Output Management.&lt;&#x2F;li&gt;
&lt;li&gt;I read five works of fiction, of which three were comics. The only virtues of the comics were that I didn&#x27;t waste too much time on them. In hindsight, I should not have even started with Graham Greene. I am not sure what traces it&#x27;s going to leave on my mind. The lone fiction I am glad to have read is &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;kuvempu-kanooru&#x2F;&quot;&gt;Kuvempu&#x27;s&lt;&#x2F;a&gt;. I need to read a lot more Kannada works in the future.&lt;&#x2F;li&gt;
&lt;li&gt;Two biographies, one of which was about &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;lives-of-sri-aurobindo&#x2F;&quot;&gt;Aurobindo&lt;&#x2F;a&gt;. Reading this before Kuvempu&#x27;s book helped me synthesize some of the ideas I had about the development of Hinduism, especially the influence on Bengal Renaissance across the subcontinent. Related, finally finished Tagore&#x27;s Sadhana earlier this year. That one is not going to become an emotional touchstone.&lt;&#x2F;li&gt;
&lt;li&gt;The toughest books I read were &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;pop-gen-india-reich&#x2F;&quot;&gt;David Reich&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;graeber-debt&#x2F;&quot;&gt;Debt&lt;&#x2F;a&gt;. These had ideas that fall under the &quot;big if true&quot; category, while also being inaccessible. They have definitely have changed my perspectives on the world. Worthwhile. I could only &lt;em&gt;really&lt;&#x2F;em&gt; understand their theses when writing about them.&lt;&#x2F;li&gt;
&lt;li&gt;Quite a few Dharma books. Biggest discoveries have been R. Ganesh and DVG.&lt;&#x2F;li&gt;
&lt;li&gt;A couple of birthing books. I don&#x27;t think I would have found value in them if I wasn&#x27;t closely tracking the wife&#x27;s pregnancy using their appendices. Better than the internet, and there are citations whose trail I can follow.&lt;&#x2F;li&gt;
&lt;li&gt;Read Annie Ernaux before she won the Noble. I think a New Yorker profile led me to her book. Short. I enjoyed the intense cross examination of her memories. I would like to write like her.&lt;&#x2F;li&gt;
&lt;li&gt;As usual, some self help and productivity books. At the least, I got posts out of it. Dan Charnas&#x27; framework is interesting and I think quite pragmatic. That book deserves a second reading.&lt;&#x2F;li&gt;
&lt;li&gt;Just two academic Indology&#x2F;Indian Studies books. I liked both of them and wrote about &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;allama-prabhu&#x2F;&quot;&gt;each&lt;&#x2F;a&gt; &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;rural-society-india-gough&#x2F;&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;some-desiderata-for-the-next-year&quot;&gt;Some desiderata for the next year&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;No self help or productivity books. I think I know enough to get around for the rest of my life now. A waste of time.
&lt;ul&gt;
&lt;li&gt;Tiny Habits is an exception. Already working my way through it.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;No comics. Again, a waste of time. Even if they are quick reads. I am at a stage now where I want books to leave a trace in my life. Comics don&#x27;t serve that purpose any more.&lt;&#x2F;li&gt;
&lt;li&gt;I have a few books about writing in the pipeline. I am enjoying them. Since I want to write a lot more and want to get better at it, I am likely to finish these next. Then there is question of how to convert what I am reading into actionable insights.&lt;&#x2F;li&gt;
&lt;li&gt;Dharma books are nonnegotiable. Have a few in the backlog. Krishna Sastri. R.L. Kashyap. It&#x27;s also time to re-read Aurobindo.&lt;&#x2F;li&gt;
&lt;li&gt;Want to finish and write about some hard &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;commoncog.com&#x2F;the-3-kinds-of-non-fiction-book&#x2F;&quot;&gt;tree&lt;&#x2F;a&gt; books: Beginning of Infinity, Niscaldas and Hinduism. Re-read Julius Lipner&#x27;s Face of Truth. Eliot Deustch&#x27;s book on Advaita Vedanta.&lt;&#x2F;li&gt;
&lt;li&gt;I only want to read Indian fiction works. I have Jeyamohan on my shelf. There is also Kuvempu and Bhyrappa.&lt;&#x2F;li&gt;
&lt;li&gt;Parenting books. I suspect this is going to dominate the year. Includes Hitopadesha and Manoj Das.&lt;&#x2F;li&gt;
&lt;li&gt;I am re-reading Reflections on Silver River now, and I have a feeling I will tackle Dogen next. I don&#x27;t think I can ever be rid of the meditation itch.&lt;&#x2F;li&gt;
&lt;li&gt;I should really be reading a lot more technical books this year: Re-visit the ML Engineering book, read Human in the Loop Machine Learning, the second system design book. Finish grokking functional programming.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Considering how little I remember of most books I have read, I don&#x27;t want to read more than 25 books next year. Lesser, if I can get away with it. Reading has become a crutch to avoid thinking. It is easy to eliminate a great many books from consideration just by reading reviews and reading the Kindle samples. My reading life has taught me that the books that are most rewarding are those at the intersection of interesting or insightful ideas and at the same time at least a little robust and critical about the epistemological foundations of the claims they are making. I might have a few like that.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Grant Takes Command</title>
        <published>2022-12-28T00:00:00+00:00</published>
        <updated>2022-12-28T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/grant-takes-command/"/>
        <id>https://asun9.com/notes/grant-takes-command/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/grant-takes-command/">&lt;p&gt;I love me some civil war histories, and it had been a while since I last read one. I remember liking Catton&#x27;s previous book in the series and picked this one up on a prime deal. Catton, through his Grant series, is responsible for the now universally positive reception Grant gets as a war commander. Grant is hard to dislike. The Grant that is etched into my memory is that of him at Shiloh, sitting in the rain in the night and whittling a twig after a hard day&#x27;s fight. When Sherman, who thinks the battle is lost, approaches him, Grant tells him that the rebels would get a whipping the next day. That supreme confidence in himself. All Sherman could do was assent.&lt;&#x2F;p&gt;
&lt;p&gt;Catton writes beautifully, and I could picture myself in the woods and the fields with the Union soldiers. The Confederacy was not just outmanned, but eventually outgeneraled. Among the qualities Grant had that led to fortune favoring him was his initiative and energy - he was always pushing and going forward and forcing the enemy to react. That and his will to win the war at all costs. It&#x27;s surprising how much of a pushover the generals before him were in comparison.&lt;&#x2F;p&gt;
&lt;p&gt;The other dominant image I leave with is that of office politics. Who gets credits for maneuvers, how the press reports events, what gets you promoted. How does one reduce the damage caused by an incompetent general? You cannot fire him because he has political connections. The blindingly obvious answer is you promote him away from the field of action. Catton&#x27;s phrasing when describing such scenarios can be downright funny. Take this for example, &quot;One reason why Grant did not want to leave Petersburg was the fact that if he went away the ranking officer in Virginia would be General Butler, and the thought of letting this man direct all of the operations against Robert E. Lee was enough to make a soldier shudder.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;Some highlights from the book below.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Grant’s reply was equally blunt. “No, I am not,” he said, “but in war anything is better than indecision. We must decide. If I am wrong we shall soon find it out and can do the other thing. But not to decide wastes both time and money and may ruin everything.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Howard was mildly surprised when he saw Grant; he had expected someone rough and burly and he found a slight, pale little man, “not larger than McClellan,” with a quiet way of talking and an engaging smile.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;I believe you are as brave, patriotic and just as the great prototype, Washington; as unselfish, kind-hearted and honest as a man should be, but the chief characteristic is the simple faith in success you have always manifested, which I can liken to nothing else than the faith a Christian has in a Savior.
--&lt;cite&gt; Sherman to Grant &lt;&#x2F;cite&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;When he spoke of Grant’s unshakable self-confidence Sherman put his finger on one of Grant’s most important characteristics as a soldier. Just at this time Grant got a new man on his staff, a former newspaperman named Adam Badeau, who had been wounded in the foot at Port Hudson, still went about on crutches, and came in as a sort of military secretary under some idea that he would eventually write a military history; and one of the first things Badeau learned was that Grant firmly believed in his own ability to meet all of his obligations.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;General Schofield was one who knew better, and he told Hamlin Garland after the war: “Grant was very far from being a modest man, as the word modest is generally understood. His just self-esteem was as far above modesty as it was above flattery … He knew his own merits as well as anybody, and he knew his own imperfections. When his attention was called to a mistake he had committed he would see and admit it with a smile, which expressed the exact opposite of that feeling which most men are apt to show under like circumstances … His absolute confidence in his own judgment upon any subject which he had mastered added to his accurate estimate of his own ability.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;This same clerk told Hamlin Garland after the war that he never knew Grant to hesitate about anything, and never saw him flurried or excited: “He was a man who always knew just exactly what he wanted to do.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Commenting frameworks</title>
        <published>2022-12-27T00:00:00+00:00</published>
        <updated>2022-12-27T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/comment-systems-ssg/"/>
        <id>https://asun9.com/notes/comment-systems-ssg/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/comment-systems-ssg/">&lt;p&gt;Some commenting frameworks for static site generators. Not considering disqus and facebook comments because they serve ugly ads, and I don&#x27;t want users stalked across the internet. Reducing the options to only those that also support self-hosting, and those that I have encountered before, this is what I have:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;commento.io&#x2F;&quot;&gt;Commento&lt;&#x2F;a&gt; - $99&#x2F;year for the hosted version.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;cactus.chat&#x2F;&quot;&gt;Cactus&lt;&#x2F;a&gt; - Federated, self-hosting options.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;staticman.net&#x2F;&quot;&gt;Staticman&lt;&#x2F;a&gt; - Using github to host and moderate comments.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Migrating to Zola</title>
        <published>2022-12-26T00:00:00+00:00</published>
        <updated>2022-12-26T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/migrating-to-zola/"/>
        <id>https://asun9.com/migrating-to-zola/</id>
        
        <content type="html" xml:base="https://asun9.com/migrating-to-zola/">&lt;p&gt;Moved this blog to &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;getzola&#x2F;zola&quot;&gt;Zola&lt;&#x2F;a&gt; on a whim. Mostly. I had this migration in mind for a while, ever since I stumbled into the world of static site generators and created the Jekyll-based site earlier this year. I soon discovered that I didn&#x27;t like Ruby, and Jekyll was not all that attractive any more. I wanted some things to be automated - creating pages for tags and categories, automatic refresh when I make changes locally, search and so on. Moving to a new Jekyll theme that supported these things seemed like work. Hugo seemed complicated. Pelican seemed boring. Zola uses Rust and I saw some good comments about it on HN. So there. Still work, but I was completely absorbed in the effort for a good two days.&lt;&#x2F;p&gt;
&lt;p&gt;One of the advantages of Jekyll is that it has been around for a long time. There is a big community around it. When I run into an issue I can be close to certain that some else has encountered the same problem in the past and very likely has a solution. Also, a bigger community and being older means it is likely to last longer (anti-fragile and all that). Zola is only a few years old. I hope I don&#x27;t have to switch SSGs for a while and just focus on writing instead.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-i-like-about-zola&quot;&gt;What I like about Zola&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;Fast build times. It takes less than a second to build and serve, given the number of posts I have (which is probably around 50 - not much). Jekyll would take 30 seconds to serve the same website.&lt;&#x2F;li&gt;
&lt;li&gt;Opinionated. I like the abstraction provided by pages, sections. Things I don&#x27;t have to think about. An extremely simple directory structure that I can understand.&lt;&#x2F;li&gt;
&lt;li&gt;Better &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.getzola.org&#x2F;documentation&#x2F;content&#x2F;table-of-contents&#x2F;&quot;&gt;table of contents&lt;&#x2F;a&gt; support.&lt;&#x2F;li&gt;
&lt;li&gt;Support for a search index out of the box.&lt;&#x2F;li&gt;
&lt;li&gt;Minor, but I don&#x27;t have to customize the quote block; it&#x27;s pretty out of the box.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.getzola.org&#x2F;documentation&#x2F;content&#x2F;linking&#x2F;#internal-links&quot;&gt;Build errors&lt;&#x2F;a&gt; if there are broken internal links.&lt;&#x2F;li&gt;
&lt;li&gt;Support for aliases.&lt;&#x2F;li&gt;
&lt;li&gt;When migrating, Zola by default parses dates from the markdown file name and I didn&#x27;t have to add it to the metadata.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;what-i-don-t-like-about-zola&quot;&gt;What I don&#x27;t like about Zola&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;zola.discourse.group&#x2F;t&#x2F;place-references-in-foot-of-text&#x2F;1503&quot;&gt;Footnotes are horrible&lt;&#x2F;a&gt;. There&#x27;s no &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;getzola&#x2F;zola&#x2F;issues&#x2F;1285&quot;&gt;back reference&lt;&#x2F;a&gt;. This seems to be an issue with Rust parser for Markdown used by Zola, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;raphlinus&#x2F;pulldown-cmark&quot;&gt;pulldown-cmark&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Not too many themes. I don&#x27;t like many of the options available. I could probably create one myself, but I have sunk too much effort to just migrate to Zola.&lt;&#x2F;li&gt;
&lt;li&gt;While migrating, having to swith to toml in order for taxonomies to pick up tags and categories. Exhausting.&lt;&#x2F;li&gt;
&lt;li&gt;What happens to the project when the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Keats&quot;&gt;maintainer&lt;&#x2F;a&gt; runs out of steam?&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Zola has a better &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.getzola.org&#x2F;documentation&#x2F;templates&#x2F;overview&#x2F;&quot;&gt;templating engine&lt;&#x2F;a&gt; but I haven&#x27;t had to create any yet. I did play with the youtube embed. I like what I see so far.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Web Notes: December 2022</title>
        <published>2022-12-19T00:00:00+00:00</published>
        <updated>2022-12-19T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/clips-december/"/>
        <id>https://asun9.com/clips-december/</id>
        
        <content type="html" xml:base="https://asun9.com/clips-december/">&lt;h3 id=&quot;article-food-that-can-spike-your-blood-sugar&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.levelshealth.com&#x2F;blog&#x2F;five-of-the-worst-types-of-food-for-metabolic-health&quot;&gt;Food that can spike your blood sugar&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;And that in turn leads to metabolic dysfunction.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Repeatedly eating too much of any kind of sugar can &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.levelshealth.com&#x2F;blog&#x2F;8-reasons-glucose-is-worth-measuring&quot;&gt;cause several forms of damage&lt;&#x2F;a&gt; to the body. Whether consumed in “natural” foods such as honey, fruit, or milk, or as added sugar, your body breaks down the carbohydrates from food into smaller sugar molecules (such as glucose, galactose, and fructose). &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.levelshealth.com&#x2F;blog&#x2F;what-is-glucose&quot;&gt;Glucose&lt;&#x2F;a&gt; is then sent directly into the bloodstream. There, it triggers the pancreas to release insulin, which shuttles glucose into your cells for immediate fuel, or into your muscle or fat cells for storage, where it becomes glycogen, so that your body can call upon it when circulating glucose is low. Foods high in sugar and carbohydrates, especially in the absence of fiber, protein, and fat, tend to cause sharper elevations in blood sugar and subsequent insulin responses that can be damaging over the long term when eaten frequently.&lt;&#x2F;li&gt;
&lt;li&gt;Whole &lt;strong&gt;wheat flour&lt;&#x2F;strong&gt;. While it does contain some fiber (it’s added back after milling) to help slow digestion slightly, whole wheat flour, just like all wheat flours—including bread flour, pastry flour, all-purpose flour, and cake flour—has a high &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.eatright.org&#x2F;food&#x2F;nutrition&#x2F;dietary-guidelines-and-myplate&#x2F;what-is-glycemic-index&quot;&gt;glycemic index&lt;&#x2F;a&gt;(GI), a measure of how quickly and how much a food raises your blood sugar.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;blog-writing-what-is-useful&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;http:&#x2F;&#x2F;jerobison.blogspot.com&#x2F;2022&#x2F;03&#x2F;thoughts-on-writing.html?m=1&quot;&gt;Writing what is useful&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;On the career paths writing can open up. &quot;Many people believe you get a job in academia by going to college, getting a doctorate, and then applying for work. In my case, my academic appointments at William &amp;amp; Mary and then at Landmark College were a direct result of the power of my written words.  No doctorate was involved.  That may seem unusual today but 100 years ago it was common.  Words have a power that transcends more ephemeral things like a college degree. A degree cannot convey your powers of reason the way your words can.&quot;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;comment-john-carmack-in-a-slashdot-comment-from-2002&quot;&gt;Comment: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;http:&#x2F;&#x2F;slashdot.org&#x2F;comments.pl?sid=25551&amp;amp;cid=2775698&quot;&gt;John Carmack, in a Slashdot comment from 2002&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;&quot;Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren&#x27;t sure which way to do something, do it both ways and see which works better.&quot;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;blog-writing-to-learn&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;dwarkeshpatel.com&#x2F;well-read&#x2F;&quot;&gt;Writing to learn&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;A major point the author makes is to curate well: picks the books you want to invest time in carefully.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;So knowledge has gotten cheaper at the same time that it is gotten more valuable. If you’re reasonably intelligent, curious, and motivated, an hour a day of reading could really add up to a comprehensive summary of much that has transpired and been thought and discovered in history.
- People don’t engage with the ideas in book, say by writing a book review or reading books and articles with a different thesis on the same topic. It’s incredibly easy to forget what you read (or to fail to absorb it in the first place). Again, I suggest in my barbell strategies post:
-  &amp;gt; You could read a book a week, but you’ll inevitably end up forgetting even the main thesis of most of the titles you pick up (the auxiliary ideas and information will be gone even faster). Here’s another idea. Don’t read a book the following week but instead spend your allotted reading time writing a Scott Alexander type book review, where you explain the book’s main points and think carefully about its weaknesses, implications, and lessons. Go on Wikipedia and Google Scholar goose chases for all the interesting topics which the author didn’t go into enough detail on. For extra brownie points, start a podcast and invite the author on for an interview. It was only after I started my podcast that I learned to read with judicious skepticism of the author’s claims and deductions, sensitivity to his message and intent, and genuine openness to his explanatory models and challenging conclusions.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;article-focusing-as-a-tool-to-battle-addiction&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;http:&#x2F;&#x2F;previous.focusing.org&#x2F;addictions&#x2F;experiential_focusing_twelve_step.htm&quot;&gt;Focusing as a tool to battle addiction&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;&quot;Experiential Focusing can be quite useful for allowing the spiritual program of the Twelve Step Recovery process to be experienced and realized in a bodily way. Actual change in one’s life of recovery goes faster and is realized at a deeper level than without Focusing. This article examines how Focusing allows personal growth to occur and how the Experiential Focusing process parallels the 12 Step Recovery process.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;Also, a primer on what &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;http:&#x2F;&#x2F;previous.focusing.org&#x2F;gendlin&#x2F;docs&#x2F;gol_2234.html&quot;&gt;Focusing&lt;&#x2F;a&gt; is.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;blog-the-only-productivity-advice-one-needs&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.spakhm.com&#x2F;p&#x2F;productivity-advice&quot;&gt;The only productivity advice one needs&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;&quot;Do the work. That&#x27;s all the productivity advice you need, and the only &lt;em&gt;useful&lt;&#x2F;em&gt; productivity advice you&#x27;re ever going to get. You can direct your attention to a million optimizations— email, meetings, notes, calendar, time tracking, goals, todo lists, time estimates, prioritization frameworks, quantified self sensors, analytics, apps, documents, journaling. But don&#x27;t. Ignore all this, and do the work. When you do the work, everything else optimizes itself.&quot;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;talks-go-positive-go-first-and-be-constant-in-doing-it&quot;&gt;Talks: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;fs.blog&#x2F;great-talks&#x2F;multidisciplinary-approach-thinking-peter-kaufman&#x2F;&quot;&gt;Go positive, go first, and be constant in doing it&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;&quot;How do you want to spend your one lifetime? Do you want to spend your one lifetime like most people do, fighting with everybody around them? No. I just told you how to avoid that. And in exchange have what? A celebratory life. Instead of an antagonistic fighting life. All you have to do is go positive, go first, be patient enough. You know we have to be patient for a week with this puppy. Do you know how long it usually takes for a human being to do all the probing and testing that Emily was going to do and to find out that you’re for real? It takes six months.&quot;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;blog-keep-shipping&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;blog.codinghorror.com&#x2F;how-to-achieve-ultimate-blog-success-in-one-easy-step&#x2F;&quot;&gt;Keep shipping&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Another post making the claim that writing a blog is the most important thing they have done in their entire career. This is in the golden age of blogging, still an interesting data point.&lt;&#x2F;p&gt;
&lt;p&gt;&quot;I wrote this blog for a year in utter obscurity, but I kept at it because I enjoyed it. I made a commitment to myself, under the banner of personal development, and I planned to meet that goal. My schedule was six posts per week, and &lt;strong&gt;I kept jabbing, kept shipping, kept firing&lt;&#x2F;strong&gt;. Not every post was that great, but I invested a reasonable effort in each one. Every time I wrote, I got a little better at writing. Every time I wrote, I learned a little more about the topic, how to research topics effectively, where the best sources of information were. Every time I wrote, I was slightly more plugged in to the rich software development community all around me. Every time I wrote, I&#x27;d get a morsel of feedback or comments that I kept rolling up into future posts. Every time I wrote, I tried to write something just the &lt;em&gt;tiniest bit&lt;&#x2F;em&gt; better than I did last time.&quot;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;blog-financial-independence-as-a-software-engineer&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;software.rajivprab.com&#x2F;2021&#x2F;12&#x2F;26&#x2F;my-path-to-financial-independence-as-a-software-engineer&#x2F;&quot;&gt;Financial independence as a software engineer&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Interviewing elsewhere every ~3 years. This requires effort in interview prep and dealing with rejection, but you can secure significant pay increases and promotions. Practicing your interview skills is the best financial investment you can make.&lt;&#x2F;li&gt;
&lt;li&gt;Tell recruiters what compensation you’re expecting, not what you’re currently making. As a rule of thumb, whenever I switch jobs, I expect a 30% compensation increase. Anything less than 20%, I would recommend waiting for something better to come along.&lt;&#x2F;li&gt;
&lt;li&gt;The higher your compensation expectations are, the more you’ll have to impress them during interviews and on the job. So this is a double-edged sword. Be prepared to deliver on what you’re asking for&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;article-awareness-practice-to-increase-surface-area-of-luck&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;every.to&#x2F;superorganizers&#x2F;you-can-only-respond-to-what-you-notice&quot;&gt;Awareness practice to increase surface area of luck&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;You probably already use some tricks to expand your awareness when you need to. Setting a reminder reflects the fact that something important probably won&#x27;t be in your awareness when it needs to be. A to-do app puts tasks in your awareness at the right moment, while regular reviews encourage you to notice things that you wouldn&#x27;t normally engage with day to day. Similarly, journaling shows you parts of your mental and emotional lives that may be hidden, which can help reduce internal conflicts, while outside perspectives from friends, coaches and therapists can snap you out of stuck loops of familiar thoughts, emotions and beliefs.&lt;&#x2F;li&gt;
&lt;li&gt;Finally, for a bit more fun, start paying attention to the state of other people’s awareness, particularly in conversation. As highly social creatures, we’re sensitive both to what other people are paying attention to and how aware they are of us and the wider world. You’ll be surprised by just how much you can pick up on and what you can learn. You can notice, for example, whether you’re really in someone’s awareness or not. Are they talking to &lt;em&gt;you&lt;&#x2F;em&gt; or just projecting sounds into space that you happen to be in? Having someone in your awareness is what creates a true sense of connection and makes the conversation come alive.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;blog-rust-over-go&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;fasterthanli.me&#x2F;articles&#x2F;i-want-off-mr-golangs-wild-ride&quot;&gt;Rust over Go&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Over and over, every piece of documentation for the Go language markets it as &quot;simple&quot;. This is a lie.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;blog-twitter-is-a-waste-of-human-potential&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.robinsloan.com&#x2F;lab&#x2F;lost-thread&#x2F;&quot;&gt;Twitter is a waste of human potential&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;&quot;The amount that Twitter omits is breathtaking; more than any other social platform, it is indifferent to huge swaths of human experience and endeavor. I invite you to imagine this omitted content as a vast, bustling city. Scratching at your timeline, you are huddled in a single small tavern with the journalists, the nihilists, and the chaotic neutrals.&quot;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;article-religion-and-meaning&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;psyche.co&#x2F;ideas&#x2F;religion-gives-life-meaning-can-anything-else-take-its-place&quot;&gt;Religion and meaning&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;&quot;...one clear implication of this research is that a person’s sense that their life is meaningful depends on their perceptions of their own significance. But a person can be significant in various ways. Hence, those seeking to lead more meaningful lives would do well to seek out ways in which they can matter – whether that means mattering to other individuals, to their communities, or perhaps even in the grand scheme of the Universe.&quot;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;article-the-way-of-dharma&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;aeon.co&#x2F;essays&#x2F;how-ancient-dharma-stories-encourage-a-life-of-compassion&quot;&gt;The way of Dharma&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Dharma, Krishna suggests, is not a programme to achieve moral perfection but &lt;strong&gt;rather a practice to live better with each passing day&lt;&#x2F;strong&gt;, contingent on where we find ourselves in history and society.&lt;&#x2F;li&gt;
&lt;li&gt;His is a form of radical conservatism – conservative because he values the preservation of a traditional social order, and yet radical because he enjoins the individual to see beyond the world and its accompanying despair, and sublimate one’s ego unto a theophanic vision of god. And, amid these socioreligious valences, Krishna is also an embodiment of an ancient idea of dharma that is of this world and beyond it, a way of being in which, as Arindam Chakrabarti &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.bloomsbury.com&#x2F;us&#x2F;realisms-interlinked-9781350044487&#x2F;&quot;&gt;put it&lt;&#x2F;a&gt; in 2020: ‘one lives, with a wonderful lightness, without any interest in world-affirmation or world-denial’.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;blog-women-religion-and-patriarchy&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.draliceevans.com&#x2F;post&#x2F;3-things-i-got-wrong-about-patriarchy&quot;&gt;Women, religion, and patriarchy&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&quot;Culture - I quickly realised - mediates the rate at which women seize opportunities created by development and democratisation.&quot;&lt;&#x2F;li&gt;
&lt;li&gt;It presumes that farm-work raises women&#x27;s status as well as social acceptance of their labour market participation. By studying the global history of gender, I realised this is incorrect.
&lt;ul&gt;
&lt;li&gt;Farm-work does not guarantee women&#x27;s esteem, autonomy or protection from violence. Even if women work long days harvesting crops, pounding grain and fetching firewood, their labour may be unrecognised and unappreciated. Ethnographies, focus groups, and surveys all tell us that rural women&#x27;s contributions are scarcely considered &#x27;work&#x27;, even by women themselves. As a 19th century Haryana saying goes, &quot;jeore se nara ghisna hai&quot;: women as cattle bound, working and enduring all.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Before Islam, gender relations were diverse across MENA. In Ancient Egypt, women had equal rights under the law. Queen Zenobia (of what is now Syria) led 70,000 men into battle against the Roman Empire. The Amazigh (Berber) revered women leaders: goddess Tanit, warrior queen Tin Hinan, and military commander Dihya. Seclusion only became normative after the Arab-Islamic conquests and subsequent influence of Ghazali.&lt;&#x2F;li&gt;
&lt;li&gt;North India&#x27;s low female employment is sometimes attributed to its loamy soils which enabled the plough. But gender relations were once significantly different – as indicated by 2nd century CE statues of naked goddesses in Uttar Pradesh.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;blog-the-dishonesty-of-tamil-intellectuals&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;pakrishnan.com&#x2F;2018&#x2F;03&#x2F;10&#x2F;the-dishonesty-of-tamil-intellectuals&#x2F;&quot;&gt;The dishonesty of Tamil intellectuals&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&quot;But the fact remains that Periyar’s fulminations against Brahmins (emphatically not Brahminism as the Periyarist liars want us to believe) is just a milder version of Nazism, pure and simple. Like the Nazis, he too did not believe in democracy. When the Venmani massacres took place he said without mincing words that kings should return in order that people are kept under the heel. It is all very well to say that he wanted all Tamils minus the Brahmins to remain as one. Hitler too wanted all Germans to unite minus the Jews. His annexation of Sudetenland and Austria are cases in point.&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;blog-first-we-shape-our-social-graph-then-it-shapes-us&quot;&gt;Blog: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;escapingflatland.substack.com&#x2F;p&#x2F;first-we-shape-our-social-graph-then&quot;&gt;First we shape our social graph then it shapes us&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Two-and-a-half-year-olds can extract knowledge from people just by watching them move about a room. They start to &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Mimetic_theory&quot;&gt;desire what&lt;&#x2F;a&gt; those around them desire. They pick up &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;commoncog.com&#x2F;blog&#x2F;the-tacit-knowledge-series&#x2F;&quot;&gt;tacit knowledge&lt;&#x2F;a&gt;. They change their dialect to match their peer groups. And after a handful of years of hanging about with people more skilled than themselves, our babies—these tiny, soft-skulled creatures—can out-compete chimpanzees in all but close combat.&lt;&#x2F;li&gt;
&lt;li&gt;You are &lt;em&gt;always&lt;&#x2F;em&gt; internalizing the culture around you. Even when you wish you didn’t. So you better surround yourself with something you want inside—curate a culture.&lt;&#x2F;li&gt;
&lt;li&gt; But what has struck me, more than anything else, is &lt;em&gt;the&lt;&#x2F;em&gt; &lt;em&gt;insane__quality of the cultures they internalized&lt;&#x2F;em&gt;. The pedagogies their guardians employed differed radically; they had differing temperaments; they mastered different disciplines, &lt;strong&gt;but they all had this in common: they spent their days around highly competent people.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>The futility of worry</title>
        <published>2022-12-18T00:00:00+00:00</published>
        <updated>2022-12-18T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/futility-worrying/"/>
        <id>https://asun9.com/notes/futility-worrying/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/futility-worrying/">&lt;p&gt;A few reminders from across the centuries about anticipatory worrying, a state that&#x27;s not unfamiliar to me.&lt;&#x2F;p&gt;
&lt;p&gt;From Tokme Zango, 14th century Kadampa master, in Thirty-Seven Practices of a Bhodisattva:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;All forms of suffering are like dreaming &lt;br &#x2F;&gt;
that your child has died. &lt;br &#x2F;&gt;
Taking confusion as real wears you out. &lt;br &#x2F;&gt;
When you run into misfortune, &lt;br &#x2F;&gt;
Look at it as confusion — this is the &lt;br &#x2F;&gt;
practice of a bodhisattva. &lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-1-1&quot;&gt;&lt;a href=&quot;#fn-1&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;And these famous lines from Seneca:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;There are more things … likely to frighten us than there are to crush us; we suffer more often in imagination than in reality.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;What I advise you to do is, not to be unhappy before the crisis comes; since it may be that the dangers before which you paled as if they were threatening you, will never come upon you; they certainly have not yet come. Accordingly, some things torment us more than they ought; some torment us before they ought; and some torment us when they ought not to torment us at all. We are in the habit of exaggerating, or imagining, or anticipating, sorrow.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;br&#x2F;&gt;
&lt;p style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;FOOTNOTES&lt;&#x2F;b&gt; &lt;&#x2F;p&gt;
&lt;footer class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-1&quot;&gt;
&lt;p&gt;Ken McLeod&#x27;s commentary on the above verse: &quot;When you encounter difficulties, the feelings and stories that arise in reaction are just that, feelings and stories. They are whirlwinds of confusion, based not in what is happening now but in deeply held beliefs about you and your relationship to the world. Let them swirl — leaves in the wind. Sometimes you fall back into them and lose touch with the present, but a moment of recognition always comes. &lt;em&gt;Right then, come back to your body, come back to your breath, and rest&lt;&#x2F;em&gt;. The confusion, the stories and the feelings are still there. They continue to swirl, but you are not lost in them.&quot; &lt;a href=&quot;#fr-1-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;footer&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>On Obsidian</title>
        <published>2022-12-18T00:00:00+00:00</published>
        <updated>2022-12-18T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/on-obsidian/"/>
        <id>https://asun9.com/on-obsidian/</id>
        
        <content type="html" xml:base="https://asun9.com/on-obsidian/">&lt;p&gt;I have used Apple Notes before for note-taking and Scrivener for journaling. Over the past year, I have switched to &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;obsidian.md&#x2F;&quot;&gt;Obsidian&lt;&#x2F;a&gt; for both these activities. The rapidity of the transition left me wondering why it was Obsidian that finally led me to part with tooling I had used for close to a decade. The primary advantage Obsidian has over these others seems to be the low friction to produce, record and organize content. For me, the elements of low friction are:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Painless syncing across my devices. Scrivener fares particularly badly on this.&lt;&#x2F;li&gt;
&lt;li&gt;Markdown. Aside from lists, Markdown has the other attributes I care about: ability to insert quotes, headings, and code. I never have to leave my keyboard. And it&#x27;s an open format.&lt;&#x2F;li&gt;
&lt;li&gt;Plain text organized as folders on disk. I prefer structure reorganization using the file and folder abstraction over whatever it is that Apple provides. If I move away from Apple, I will still have my files and folders - this is a format that will last as long as Unix&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-1-1&quot;&gt;&lt;a href=&quot;#fn-1&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; is around. And if Lindy&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-2-1&quot;&gt;&lt;a href=&quot;#fn-2&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; is true, this will be a long time. It&#x27;s also not hard to find what I am looking for given the right folder structure.&lt;&#x2F;li&gt;
&lt;li&gt;A simple, intuitive UI that you almost never have to mess with. The default Obsidian UI serves this purpose well enough. Along with the daily note prompt, this is downright powerful for my purposes.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;The other feature from Obsidian I use daily is the templating interface. It is very easy to produce templates and insert them into your docs. I have templates for weekly reviews, annual reviews, tracking bookmarks, inserting time and so on. Each of these templates in turn help me structure the data and when in the form of questions, encourage creating even more content in the form of introspection.&lt;&#x2F;p&gt;
&lt;p&gt;I also use &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;help.obsidian.md&#x2F;Plugins&#x2F;Backlinks&quot;&gt;backlinks&lt;&#x2F;a&gt;. However I only use it as another form of emphasizing text or headings, which is obviously not its primary purpose. It was a nice toy to play with when I first started. I might still have some use for it.&lt;&#x2F;p&gt;
&lt;br&#x2F;&gt;
&lt;p style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;FOOTNOTES&lt;&#x2F;b&gt; &lt;&#x2F;p&gt;
&lt;footer class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-1&quot;&gt;
&lt;p&gt;Central to Unix&#x27;s philosophy is the use of plain text as an universal format. Eric S Raymond, in The Art of Unix Programming, says “Text streams are a valuable universal format because they’re easy for human beings to read, write, and edit without specialized tools. These formats are (or can be designed to be) transparent.” &lt;a href=&quot;#fr-1-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-2&quot;&gt;
&lt;p&gt;The Lindy effect is a theorized phenomenon by which the future life expectancy of some non-perishable things, like a technology or an idea, is proportional to their current age. Thus, the Lindy effect proposes the longer a period something has survived to exist or be used in the present, the longer its remaining life expectancy. From &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Lindy_effect&quot;&gt;wikipedia&lt;&#x2F;a&gt;. &lt;a href=&quot;#fr-2-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;footer&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Bothering with an annual review</title>
        <published>2022-12-17T00:00:00+00:00</published>
        <updated>2022-12-17T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/why-annual-review/"/>
        <id>https://asun9.com/notes/why-annual-review/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/why-annual-review/">&lt;p&gt;I am not talking about a professional one, the one that&#x27;s expected of you at work. I am talking about a personal annual review. While it could include elements from the professional review, you are doing this entirely for yourself.  I look at it as an opportunity to reflect on the past year and make an account of all the highlights. Even if at this present moment it may seem like all that the year had to offer was a relentless train of ill fortune, you should force yourself to write about things you are grateful for. You might find this revealing and therapeutic, as I did.&lt;&#x2F;p&gt;
&lt;p&gt;One cannot trust one&#x27;s state of mind. With each passing hour your thoughts will swing between various highs and lows, like a fly alighting on a blade of grass one moment and shit the very next moment. In such a scenario, an annual review is an attempt at constructing a more reasonable, even happy narrative. It&#x27;s an opportunity to reinforce some memories and not leave it to chance and mood swings. Be systemic about it: ask yourself who or what you are grateful for, what experiences affected you positively, and what lessons you have learnt. List the circumstances you found yourself in that you are thankful for. Do not bother recording your misfortunes here. Leave it aside for another day.&lt;&#x2F;p&gt;
&lt;p&gt;Once you start and overcome the initial inertia, you may find it hard to stop. Keep going till you have recorded everything you can recall. Even the act of allocating time and working on producing such a document and completing it is satisfying. It could even be that you will remember the year kindly and acknowledge the blessings it has brought.&lt;&#x2F;p&gt;
&lt;p&gt;Narratives are powerful. They determine our actions in the world. You may never revisit your review. That&#x27;s okay. What&#x27;s important is that you awaken to the fact that you can exercise some choice when crafting the narratives of your life.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>A Year of Writing</title>
        <published>2022-12-11T00:00:00+00:00</published>
        <updated>2022-12-11T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/a-year-of-writing/"/>
        <id>https://asun9.com/a-year-of-writing/</id>
        
        <content type="html" xml:base="https://asun9.com/a-year-of-writing/">&lt;p&gt;This is the most I have written publicly in any year. It has mostly been book reviews. Despite the lack of quality, the overwhelming feeling I have is that it has been worth it. It seems like I have made learning an active choice, rather than leaving it to chance. In fact, a major regret I now have is not just that I didn&#x27;t write more this year but that I didn&#x27;t start writing publicly earlier in life.&lt;&#x2F;p&gt;
&lt;p&gt;Here are some reflections about the process from the past year.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;The inertia to write is immense. I try putting it off till I can&#x27;t any more, till I am compelled by some inner force to do it. I am unable to explain what this inner force is.&lt;&#x2F;li&gt;
&lt;li&gt;I am never happy with any of my posts. Even after I publish them I continuing tweaking the structure, changing a word here or a paragraph there. This usually continues for a few days.&lt;&#x2F;li&gt;
&lt;li&gt;Paradoxically, there is a feeling of satisfaction when I finish writing a post, even before I have published it. The very act of grappling with words and text and trying to make sense makes all the effort worthwhile.&lt;&#x2F;li&gt;
&lt;li&gt;I only stop the tweaking drafts when I grow tired of it after a few days and I convince myself that it is a waste of time. This is preceded by the thought that no one cares. I find the fact that most people will not read what I write freeing. It means I do just enough to not be too ashamed if a friendly stranger does happen to chance upon my posts while also having the freedom to write about anything I please. Writing in public is also a forcing function to produce what others might consider useful. For everything else, there&#x27;s journaling.&lt;&#x2F;li&gt;
&lt;li&gt;While I am never happy about the quality, seeing the number of posts is satisfying. Writing is proof of work, evidence that I have worked through some books and ideas.&lt;&#x2F;li&gt;
&lt;li&gt;A few years ago I read Matt Ridley&#x27;s The Origins of Virtue. It clearly had some effect on me because I remember recommending it to at least two friends. I now can&#x27;t recall what the central point of the book is except that evolution has got to do why humans care so much about virtue. I have read some longer and harder books since then. There is David Reich&#x27;s book on &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;pop-gen-india-reich&#x2F;&quot;&gt;population genetics&lt;&#x2F;a&gt;, Andre Wink on the &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;al-hind-andre-wink&#x2F;&quot;&gt;Indo Islamic world&lt;&#x2F;a&gt;, and John Stratton Hawley on the &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;bhakti-decon&#x2F;&quot;&gt;Bhakti movement&lt;&#x2F;a&gt; in India. Then there is David Gaeber on &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;graeber-debt&#x2F;&quot;&gt;debt&lt;&#x2F;a&gt;. Thanks to writing about these books, I can recall what exactly their major theses are and what I think about them. I can now articulate some of my worldviews in a manner I find persuasive and can explain where these ideas that I hold dear could have possibly originated.&lt;&#x2F;li&gt;
&lt;li&gt;Even when I feel I have nothing to say, it seems that I can force myself to write and discover what I really think about something. This has happened with all of the posts. I never know the shape these would eventually take. I just start writing and in the act discover the form and arguments. I do need an initial impetus though, a spark to trigger the writing. This has taken the shape of books, mainly. For this current post though, it was the question &quot;What did I learn from a year of writing?&quot;.&lt;&#x2F;li&gt;
&lt;li&gt;Producing 700 or 800 words, which is not much, takes a lot of my time! 2 or 3 hours, for the first draft and initial editing. Once I start, I am pretty absorbed by the process and I am not even aware of the time passing by.&lt;&#x2F;li&gt;
&lt;li&gt;Lowering the friction to write has helped me produce more. I have had wordpress blogs and squarespace sites before where the editor is in the browser. Now I write markdown files on VSCode or iA Writer. I find writing with these tools to be a more pleasurable experience. I generate a static website automatically with a commit. No more login issues, or dealing with two factor authentication. Now that I think about it, I hated working with squarespace editor.&lt;&#x2F;li&gt;
&lt;li&gt;When I write, I am creating a narrative. I am telling a story that feels coherent to me. When I do this, I choose to engage with only some parts of the book. I am aware I am ignoring other sections and ideas from the author. I don&#x27;t feel too beat up about this curation process. The author also does the same thing with the subject matter and with the evidence they have marshaled. This is the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.lesswrong.com&#x2F;tag&#x2F;narrative-fallacy&quot;&gt;narrative fallacy&lt;&#x2F;a&gt;. I am at peace with the fact that we can never know everything about any thing. Each of us choose to connect dots in ways that makes sense to us conditional on what we know of the world. Only after I started writing and making these editorial choices did it sink into me how much this is baked into everything we do.&lt;&#x2F;li&gt;
&lt;li&gt;Bonus: It seems true after all, that the more one writes, the more one can write.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Debt: The First 5,000 Years</title>
        <published>2022-12-05T00:00:00+00:00</published>
        <updated>2022-12-05T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/graeber-debt/"/>
        <id>https://asun9.com/graeber-debt/</id>
        
        <content type="html" xml:base="https://asun9.com/graeber-debt/">&lt;p&gt;Book: &lt;strong&gt;Debt: The First 5,000 Years&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;David Graeber&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;In this ambitious book, Graeber - anthropologist, anarchist and polemicist - makes a case for debt as the primary mover of civilizations. Along the way he takes to the cleaners everyone from Adam Smith to Niall Ferguson. He spends a considerable amount of time showing the difficulty in even explaining the word &#x27;debt&#x27; given the layers of meaning it has accrued. The notion of debt, we learn, is possibly as old as humanity. It is present in the earliest writing systems that man has produced. In the Vedas, humans are shown to be in debt to the universe. Debts, as it happens, is also a fundamental part of the market economy. In contrast to market economies, there is such a thing as human economies. Human economies function on favors. There&#x27;s no human relation that is free from exchange. These exchanges are not just that of tangible goods, but that of intangible ones like respect, honor and such. Given all that, Graeber&#x27;s definition of debt is that amount that can be precisely calculated.&lt;&#x2F;p&gt;
&lt;p&gt;One of the author&#x27;s major theses is the rejection of the market as the highest form of human freedom. Markets arise from wars and slaves. This he shows with example after example from the pages of history in exhaustive detail. The market and the state are presented as in conflict with each other in popular discourse. This popularity is only about two centuries old, ever since Adam Smith defined &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Political_economy&quot;&gt;political economy&lt;&#x2F;a&gt; and &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;The_Wealth_of_Nations&quot;&gt;expounded&lt;&#x2F;a&gt; on a theory about how it could it have come about. This is a false dichotomy. States and markets need each other and there has never been a market that&#x27;s not backed by the resources a state can provide. The earliest markets were the side effects of elaborate administrative systems of ancient Mesopotamia, operating primarily on credit. That idea that markets could exist outside states came only with the Middle Ages. He makes the case for this by interrogating the Indo-Islamic world and the entrepôts flourishing therein. Human economies eventually give way to markets, but it is not inevitable. One of the possible origins of money is as a proxy to show how impossible it is really to consider it as a means of any measure at all, whether it&#x27;s trading human beings or other goods. It&#x27;s only when humans are taken from their complex web of relationships that they can be traded. Like I said, he asserts that all our political and legal systems derive from slavery. We haven&#x27;t really abolished slavery either, only relabeled it:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Formal slavery has been eliminated, but (as anyone who works from nine to five can testify) the idea that you can alienate your liberty, at least temporarily, endures. In fact, it determines what most of us have to do for most of our waking hours, except, usually, on weekends. The violence has been largely pushed out of sight.&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Graeber&#x27;s grouse with Adam Smith is that in his model of barter as origin of human economic systems, Smith ignored debt altogether. Another opposite view of debt is of debt as a central substance of human relations, using the recording in the Vedas as evidence. The universally accepted sequence to explain our system of economic systems now is that there was a prehistoric stage of barter, followed by an ancient stage of coinage and after a brief revision to barter in the Middle Ages, a modern stage of credit economy. Graeber instead prefers to see the world as dominated by cycles, with periods dominated by credit money and periods dominated by coinage, primarily gold and silver. The original form of money was virtual money. Credit systems, tabs, expense accounts existed long before cash. Bullion predominates in periods of generalized violence. This seems to be an accurate description of Warring States China, Iron Age Greece, and pre-Mauryan India. After all, soldiers tend to have access to a great deal of loot and will always seek to trade it. Credit systems dominate in periods of social peace, where there are networks of trust. The current credit system began in 1971, when Richard Nixon made the dollar a fiat currency by unpinning it from the value of gold. The United States&#x27; military machine ensures that the dollar remains the fiat currency of choice and is willing to go to war to keep it that way. It is still the early stages of the current cycle, but the consequences of credit are not hard to imagine - it has always ended in violence. Not everyone pays their debt, only a few do.&lt;&#x2F;p&gt;
&lt;p&gt;I am persuaded by Graeber&#x27;s thesis only because I don&#x27;t know better. I haven&#x27;t read up on any monetary theory and this is my first exposure to it. I do find myself sympathetic to his cause. Why is working for money virtuous? Why does increasing the output of goods and services by a certain amount each year the purpose of this species? Why is working 9 to 5 the only way of being in this world? There are other economic systems possible. Utopian communities did &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;List_of_American_utopian_communities&quot;&gt;pop up all the time&lt;&#x2F;a&gt; in America once. There are a few in India too, for example, Auroville. However, I doubt that their vision of the world will ever come to pass for the vast majority of mankind. After all, states are bigger and more centralized than ever. And as Graeber repeatedly emphasizes, states, wars and markets go hand in hand.&lt;&#x2F;p&gt;
&lt;p&gt;If you can forgive the polemics and the roundabout way of getting to &lt;em&gt;any&lt;&#x2F;em&gt; point, this is a very educative and even entertaining read.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Some Memories</title>
        <published>2022-11-26T00:00:00+00:00</published>
        <updated>2022-11-26T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/some-mem/"/>
        <id>https://asun9.com/some-mem/</id>
        
        <content type="html" xml:base="https://asun9.com/some-mem/">&lt;p&gt;I thought I knew love. It was only when playing with a kid, a little one that&#x27;s no longer a two year old, that I learned what it is to love unconditionally. Unidirectional, without any self-absorption. I did read somewhere that love in families flows downwards. From parents to children. From grandparents to grandchildren. I now understand that sentiment. It is by being with him I know how my parents feel. A mixture of love and duty. Of enjoying the privilege of being liked in return.&lt;&#x2F;p&gt;
&lt;p&gt;As I am with him I wonder, did my parents spend as much time with me? Did other adults? My uncle, aunt? I don&#x27;t remember much of my younger years. My earliest memory is that of my father taking me to school for the first time. I was probably the last to enter the class. I remember crying. I did not want my father to leave. I remember him waiting for me to enter the classroom. There might have been a teacher escorting me inside. There are other memories. I remember writing my name for the first time. I remember writing my grandmother&#x27;s name and showing it to her. I remember a wedding in Chennai. There was paati and V athimber walking with me to the marriage hall from the railway station. I recall the smell of dried cow dung on the streets as we walked. I remember when my little cousin had to be taken to hospital to get his sinus fixed. Me and his sister waiting in the house for him to come back. Stray memories that I almost never revisit.&lt;&#x2F;p&gt;
&lt;p&gt;I expect my young friend&#x27;s memories of his early years to be just as sparse and random. I want him to know how much joy he has brought to a few adults around him, just by doing what children do. Self-awareness will inevitably set in, and the loss of innocence along with it. We will cherish all of it.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>An Exegesis of Dvaya Mantra</title>
        <published>2022-11-24T00:00:00+00:00</published>
        <updated>2022-11-24T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/dvaya-mantra-exegesis/"/>
        <id>https://asun9.com/dvaya-mantra-exegesis/</id>
        
        <content type="html" xml:base="https://asun9.com/dvaya-mantra-exegesis/">&lt;p&gt;While looking into understanding the Dvaya Mantra, &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;kainkarya&#x2F;&quot;&gt;meditation on which is regarded&lt;&#x2F;a&gt; by the eleventh century theologian &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Ramanuja&quot;&gt;Ramanuja&lt;&#x2F;a&gt; as one of the duties of a Vaishnava, I came across &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.jstor.org&#x2F;stable&#x2F;25691048&quot;&gt;this&lt;&#x2F;a&gt; wonderful paper by Fancis X Clooney. Clooney explores the significance of the Dvaya Mantra in the Srivaishnava tradition and the exegesis of the mantra by the thirteenth century polymath &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Vedanta_Desika&quot;&gt;Vedanta Desika&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;The Dvaya Mantra can suprise one by its apparent simplicity. There are two statements or clauses, and at first glance they seem to be saying the same thing:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;srimannarayanacaranau saranam prapadye &lt;br &#x2F;&gt;
srimate narayanaya namah&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;I approach for refuge the feet of Narayana with Sri; &lt;br &#x2F;&gt;
Praise to Narayana with Sri!&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;There is more to it than simple reaffirmation of faith, however. The Srivaishnava community regards it as a summarization of the tradition:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Concern for the meaning of dvayam is a concern for the double content communicated in the mantra: the means is also the goal, and the lord is the means to the lord as the goal. This is in a way the essential teaching of the Srivaisnava tradition as a living transmission of truths from one generation to the next.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;The mantra offers itself to multiple meanings, and deconstructing it reveals significant theological claims, which in turn involves taking seriously the mantra&#x27;s elegant complexity. Francis X Clooney, via Vedanta Desika, breaks it down in the following manner:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;dvaya-first-clause.png&quot; alt=&quot;Dvaya Mantra, First Clause&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;dvaya-second-clause.png&quot; alt=&quot;Dvaya Mantra, Second Clause&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;As an example of the involved exegesis undertaken by early second millennium theologians, this is one of the readings Vedanta Desika offers for the &lt;em&gt;namah&lt;&#x2F;em&gt; in the second clause:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;This word &quot;namah&quot; indicates the ending of all obstacles in the form of ignorance and karma and the tendencies based on them, such as desire and attachment to matter. But in accord with the scripture regarding the analysis of namah, some say that the primary intention [of the second clause] is to weed out the notion of being an agent for one&#x27;s own purposes and while depending on oneself or being an enjoyer for one&#x27;s own sake while depending on oneself. Such goals suffer by comparison with the result that is perfect service, in accord with the maxim about &quot;experiencing another result&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;The Dvaya Mantra is regarded as one of the rahasyas. Why is it a secret when Vedanta Desika seems to have written a treatise on it, and other members of the Srivaishna community similarly seem to have written commentaries on it? Francis Clooney holds thus:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;The mantra is rahasya because, as it is uttered, reflected upon, and understood, it forces upon the reader truths not immediately accessible to uncommitted observers. It demands a surrender to God that would not ordinarily be considered accessible or practicable. Rahasya is tantamount to the truth that becomes available to and powerful for those who take to heart wisdom transmitted from generation to generation by acaryas, encoded in the mantra as properly read in accord with the tradition. This rahasya is the &quot;mystery of God&quot; in a deeper and richer sense, evocative of the sacred realm wherein intelligent and attentive human beings are transformed, irreversibly, blissfully. On this basis we can say that the Rahasyatrayasaram is not merely about the Dvaya Mantra; it is rather part of the life of the Dvaya Mantra. To read the Rahasyatrayasaram is to share in that vitality.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Kaiṅkarya</title>
        <published>2022-11-23T00:00:00+00:00</published>
        <updated>2022-11-23T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/kainkarya/"/>
        <id>https://asun9.com/kainkarya/</id>
        
        <content type="html" xml:base="https://asun9.com/kainkarya/">&lt;p&gt;Some notes from SM Srinivasa Chari&#x27;s &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.amazon.com&#x2F;Vaisnavism-Philosophy-Theology-Religious-Discipline&#x2F;dp&#x2F;8120810988&quot;&gt;Vaishnavism: Its Philosophy, Theology and Religious Discipline&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;br&#x2F;&gt;
&lt;p&gt;In Vaishnavism, kaiṅkarya is a service (seva) rendered to others. It is laid down as an obligatory duty for a Vaishnava. The performance of religious duties as laid down by sacred texts takes the form of kaiṅkarya, if these duties are carried out without any selfish motive, purely for the pleasure of God (bhagavat-priti). In the same way, social and ethical duties performed in the spirit of &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Nishkama_Karma&quot;&gt;Nishkama karma&lt;&#x2F;a&gt; as advocated by Bhagavad Gita would fall under kaiṅkarya. Some Vaishnava acharyas extoll the kaiṅkarya done in the physical world to God manifested in the archaa form as beautiful idols in the temples. The spiritual delight and inner joy derived from such services is compared to the experience of God by mystics.&lt;&#x2F;p&gt;
&lt;p&gt;In addition to the sankalpa, the orthodox Vaishnavas say at the commencement of a karma with sincere faith that the very Supreme Being caused it (svayameva karayati). Similarly, at the conclusion of the karma, they repeat that it was got accomplished with the grace of God (svayameva karitavan). The implication of it is that the individual is a tool in the hands of the Almighty and whatever he does is not for his selfish purpose but for the pleasure of God. This is the height of renouncement of the ego (ahamkara) and the notion of mine (mamakara). A service done in this spirit removes the sins by earning the grace of God and thereby gradually leads one to the attainment of God which is the highest goal of human life.&lt;&#x2F;p&gt;
&lt;p&gt;Under Ramanuja, kaiṅkarya changed its form a little, with an emphasis on service in the temples. The three major and oldest Vaishnava temples at Srirangam, Kanchipuram and Melkote follow to this day the mode of worship introduced by Ramanuja in the eleventh century. Any service done in a temple ranging from the simplest act of bringing flowers to the highest task of construction of a temple, is a kaiṅkarya for God. There are a variety of such services that one can render in a temple. To name a few, lighting the oil lamp, offering flowers, waving the fan before the deity, bringing water from the river or pond for Lord&#x27;s worship, arranging food offering for God, taking out the deity in procession, recitation of songs or hymns about God, prostration before God, going round the temples, cleaning of the floor of the temples and many such acts. All these are regarded as kaiṅkarya. According to one&#x27;s capacity and choice any one of these acts performed with devotion is bound to earn the grace of God. Irrespective of one&#x27;s caste or social status, everyone can easily participate in such activities.&lt;&#x2F;p&gt;
&lt;p&gt;Ramanuja has recommended five kinds of services which can be brought under the category of kainkriyas. According to tradition, these were the last words uttered by Ramanuja for the benefit of his pupils at the time of his death. According to him, a Vaisnava should not worry about his afterlife since he has been assured of moksa with the performance of self-surrender to God. Nor should he worry about his present life since that will go on in accordance with his past karma. He should, therefore, engage himself to the extent possible in one of the five services. The first and the most important one in the opinion of Ramanuja, is to study the Sri-bhäsya, the learned commentary on the Vedänta-sütra and propagate the teachings contained therein. Secondly, if a person is not competent to do the first task, he should engage himself in listening to the teachings contained in the Tamil hymns of the Alvars and impart the same to others. Thirdly, if a person is not able to do it, he can undertake the services at the holy temples in the form of arranging for the offer of food stuffs, flowers, lighting of lamps etc. If a person cannot perform any of these services for the temples, it is suggested that as a fourth type of kaiṅkarya, he may chant the sacred secret mantra (dvaya&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-1-1&quot;&gt;&lt;a href=&quot;#fn-1&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;) along with contemplation on its inner philosophic meaning&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-2-1&quot;&gt;&lt;a href=&quot;#fn-2&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;. Even if this cannot be done, it is advised, as the fifth easy type of service, that one should spend the time in the company of a devout Vaisnava.&lt;&#x2F;p&gt;
&lt;br&#x2F;&gt;
&lt;p style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;FOOTNOTES&lt;&#x2F;b&gt; &lt;&#x2F;p&gt;
&lt;footer class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-1&quot;&gt;
&lt;p&gt;&quot;śrīman nārayaṇa caraṇau śaraṇam prapadye; śrīmate nārayaṇāya namo namaḥ&quot;. An exploration of this mantram by Fracis X Clooney is &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.jstor.org&#x2F;stable&#x2F;25691048&quot;&gt;here&lt;&#x2F;a&gt;. Francis X Clooney translates it as thus: &quot;I approach for refuge the feet of Narayana with Sri; praise to Narayana with Sri&quot;. He also says, echoing Natatoor Ammal, &quot;Although its utterane is precious to the orthodox tradition and expresses the truth of aum, it is not exclusive to makes or certain castes but is common to all.&quot; &lt;a href=&quot;#fr-1-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-2&quot;&gt;
&lt;p&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Parasara_Bhattar&quot;&gt;Parasara Bhattar&#x27;s&lt;&#x2F;a&gt; Asthaloki lists the ten key truths learned from the ten component parts of the mantra: &quot;This mantra of six words and two clauses, learned in the Veda, protects the person who meditates on its ten meanings: [Sri&#x27;s] leading the way [Sri]; [their] eternal union [mar]: the class of appropriate qualities [narayana]; reference to [Narāyana&#x27;s] body [caranau]; the means [Saranam]: the part to be done [by the individual, prapadye]; the supreme couple as the well-known goal [Srimate nararayandya]; lordship [narayana]; the prayer [for protection, expressed in - aya]: the destruction of the greater obstacles (namah).&quot; &lt;a href=&quot;#fr-2-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;footer&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Kanooru Heggadithi</title>
        <published>2022-11-01T00:00:00+00:00</published>
        <updated>2022-11-01T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/kuvempu-kanooru/"/>
        <id>https://asun9.com/kuvempu-kanooru/</id>
        
        <content type="html" xml:base="https://asun9.com/kuvempu-kanooru/">&lt;p&gt;Book: &lt;strong&gt;The House of Kanooru&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Kuvempu&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;This is a fantastic bildungsroman set in the hill country of Southern Karnataka. Captures the arrival of modernity in a village called Kanooru and the surrounding areas and the disappearing of the old ways and gods. MN Srinivas&#x27;s Sanskritization is evident through the choices the protagonists make, for example naming a child Ramesha over the traditional Hiriyanna or Thimayya. The impetus here is not the seeking of status or upward mobility. It is already the long dominant landed caste that&#x27;s making these choices. The momentum instead is provided by the wider national movement, and the enormous impact of the Bengal renaissance on the lay religion. The author doesn&#x27;t characterize it as such, but we can now clearly identify the reshaping of popular religion in early 20th century, by the Brahmo Samaj first, and eventually the influence of Vivekananda, Ramakrishna, Tagore and Aurobindo.&lt;&#x2F;p&gt;
&lt;p&gt;The book is set in a fascinating place and time and I found myself  unable to put it down. A caste, the Halepaikadas,  is characterized as low, with the dominant caste landlords denying them entry into the house. But this caste was once part of the Vijayanagara armed forces. How did they fall in status? The depiction of the relationship between the castes endlessly interesting. Halepaikada Thimma is not allowed inside the Kanooru house, but he&#x27;s a drinking buddy of the lord Chandrayya Gowda. Every landlord is a Vokkaliga, and they are the patrons of the brahmins from the nearby agrahara. The brahmin depends entirely on this patronage for sustenance. The aberrant josiya from the agrahara is as ignorant as the people he&#x27;s serving. The Belas who work in the fields seem like bonded labourers without much agency, but the Tulu speaking Shettys who they work alongside are active agents, making their own fortunes while being subservient to the Gowda. Everyone, high or low, is shown petty in their own way.&lt;&#x2F;p&gt;
&lt;p&gt;It&#x27;s the landed folks who can afford to get a modern education first - Hoovayya, Ramayya, Vasu etc, and they carry everyone else along with them headlong into the future. As with any good bildungsroman, it is love that throws dust on everyone&#x27;s plans. There is more to this book than caste. Kuvempu captures the beauty of Malnadu that comes across strongly even in translation. The animals in the peoples lives have names - Nandi the bull, Tiger the dog. One learns that the cheetah was prevalent in that region once upon a time. An extraordinarily moving scene in the beginning of the book describes the destruction of a bird and its chicks. What&#x27;s evident is the worshipful attitude Kuvempu had towards nature, as reverent as the attitude Hoovayya once seemed to have towards the Baghavad Gita.&lt;&#x2F;p&gt;
&lt;p&gt;First published in 1936, the cheerily optimistic ending shows the age of the book. Who after all writes fiction these days set in India that shows as much zest for life and the future?&lt;&#x2F;p&gt;
&lt;p&gt;Much recommended.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>The Golden Rule</title>
        <published>2022-10-21T00:00:00+00:00</published>
        <updated>2022-10-21T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/the-golden-rule/"/>
        <id>https://asun9.com/the-golden-rule/</id>
        
        <content type="html" xml:base="https://asun9.com/the-golden-rule/">&lt;blockquote&gt;
&lt;p&gt;Listen to the entirety of Dharma &lt;br &#x2F;&gt;
and follow its injunctions. &lt;br &#x2F;&gt;
Do not do unto others &lt;br &#x2F;&gt;
what is unacceptable to you. &lt;br &#x2F;&gt;
&lt;br &#x2F;&gt;
--&lt;cite&gt; The Mahabharata, from the Shanti Parva &lt;&#x2F;cite&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;The more I look at the various fault lines that is India today, the more I find the above sentiment appealing.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>The Power and The Glory</title>
        <published>2022-10-14T00:00:00+00:00</published>
        <updated>2022-10-14T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/power-glory/"/>
        <id>https://asun9.com/notes/power-glory/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/power-glory/">&lt;p&gt;Book: &lt;strong&gt;The Power And The Glory&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Graham Greene&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;I couldn&#x27;t help but think of parallels to state control over religion in India around the same time period as this book. Quite certainly a few religious institutions put up a fight (the Dharmapuram adheenam still controls a few temples today), but the Madras Presidency and the Indian state eventually won. There are other themes in book - on duty, the sense of sacred, the need to confide in a infallible figures, the all too human-ness of the priests and the people who seek their services etc. There is also a Judas-like figure that reminded me of a similar character in Scorsese’s Silence. This is someone our protagonist knows better than to trust, but does so anyway. This is the sort of thing that interests me these days and this book should have kept me engaged throughout. It didn’t. Thankfully, it was short.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>That Book From Stephen Covey</title>
        <published>2022-10-12T00:00:00+00:00</published>
        <updated>2022-10-12T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/steven-covey-pms/"/>
        <id>https://asun9.com/steven-covey-pms/</id>
        
        <content type="html" xml:base="https://asun9.com/steven-covey-pms/">&lt;p&gt;Book: &lt;strong&gt;Seven Habits of Highly Effective People&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Stephen Covey&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;I re-visited Stephen Covey&#x27;s Seven Habits Of Highly Effective People (SHHEP) recently thanks to its availability on  Prime Reading. I last read this book around 20 years ago, when it was part of my father&#x27;s bookshelf. I can&#x27;t recall what I took away from the book then. I certainly didn&#x27;t finish it. I don&#x27;t think it informed my life at all since then. Reading this book now is different. I now expect each book to potentially change my life, to either reinforce my thinking in someway or to challenge it. So when I read, I am interrogating the texts, and not being just a passive receptacle for ideas.&lt;&#x2F;p&gt;
&lt;p&gt;I found most of the ideas here passé, for the lack of a better word. The one thing I found appealing is the focus on personal mission statement. I have been encountering this in other places - Kamal Ravikant, Clayton Christensen, in &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;values-in-therapy&#x2F;&quot;&gt;therapy&lt;&#x2F;a&gt;. All of them have been published in the last decade. None of them referred to Covey and it&#x27;s possible they encountered this idea in different ways. Clayton Christensen most definitely picked this idea from Covey, or from the Church of Latter Day Saints, of which both Covey and Christensen were part of.&lt;&#x2F;p&gt;
&lt;p&gt;I am quite sold on the idea that each one of us can determine our own principles and values. This process of picking and revising one&#x27;s values is the most important thing one can do, and trying to live a life in accordance with these self-chosen values imbues a life with meaning. Few other things can match the satisfaction of living a life in pursuit of your values. Covey says that his encounter with Victor Frankl was the impetus for the philosophy he presents in SHHEP. While admitting that picking ones values is hard, he presents a process that he claims worked for him and others he coached in surfacing these values. This is by introspecting on the duties each one has - towards family, towards oneself, to one&#x27;s friend, to one&#x27;s employees and so on. I find this appealing. I suspect that is because it maps nicely to my understanding of swadharma, the Hindu concept of individual duty, famously articulated in the Gita. While traditional commentators sometimes reduced that to the constraints on one&#x27;s behavior thanks to the varna one is born into, plenty of others re-interpret it in terms of duty to society and family (Vivekananda, Aurobindo, Gandhi etc). Both traditional and modern commentators assert that the values for those in the Hindu fold should be the purusharthas (literally, object of human pursuit). This is artha (wealth), kama (love), dharma (virtue) and moksha (enlightenment). Most of the Hindu texts, in Sanskrit and the vernacular (for example, Thirukural), approach life through the above lens.&lt;&#x2F;p&gt;
&lt;p&gt;Covey makes the claim that principles are universal, while values are personal. I will probably be pushing it if I were to compare this with the concept of Sāmānya-dharma (general values) versus Viśeṣa-dharma (literally, perculiar duty. eg. varnashradharma). Given all that, no wonder I am predisposed to find Covey&#x27;s personal mission statement strategy appealing. It is also probably effective, considering that &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;contextualscience.org&#x2F;act&quot;&gt;similar strategies&lt;&#x2F;a&gt; are used in therapy.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Simple Passion by Anne Ernaux</title>
        <published>2022-10-03T00:00:00+00:00</published>
        <updated>2022-10-03T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/simple-passion-ernaux/"/>
        <id>https://asun9.com/simple-passion-ernaux/</id>
        
        <content type="html" xml:base="https://asun9.com/simple-passion-ernaux/">&lt;p&gt;An examination of the past self, a stranger who one is intimately familiar with and yet whom one cannot identify with. An examination of a madness. Writing and dissecting the memory as a medication. I don&#x27;t think I have read anything as searingly honest as this account of an affair, and now I want to read more of Annie Ernaux. Thankfully, there&#x27;s no judgement and shame here, just a clinical dismemberment. What does it mean to make someone you cannot have the object of your existence? She tries to reclaim herself. She visits the site of an old abortion. She takes a vacation in Florence. Early in the book, she writes:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;When he left me more time between his phone call and his visit, three or four days, I imagined with disgust all the work I would have to do and the social engagements I would have to attend before seeing him again. I would have liked to have done nothing else but wait for him.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Five thousand miles away from Annie Ernaux, and fifteen hundred years apart, Valluvar had written:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Sleepless when he&#x27;s not here, sleepless when he is, &lt;br &#x2F;&gt;
Either way my eyes never rest. &lt;br &#x2F;&gt;
--&lt;cite&gt; Ku.1179 &lt;&#x2F;cite&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;I suppose to give in, break, and pick what&#x27;s left up, this is part of everyone&#x27;s journey.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Two Mary Oliver Books</title>
        <published>2022-09-28T00:00:00+00:00</published>
        <updated>2022-09-28T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/mary-oliver-two/"/>
        <id>https://asun9.com/mary-oliver-two/</id>
        
        <content type="html" xml:base="https://asun9.com/mary-oliver-two/">&lt;p&gt;Thanks to daily deals on Amazon, I discovered two Mary Oliver books that I otherwise wouldn&#x27;t have purchased at full price&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-stingy-1&quot;&gt;&lt;a href=&quot;#fn-stingy&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;. Both are  a collection of essays and poetry released this past two decades. These essays and poems have previously appeared in various journals and books. Reading Mary Oliver is like reading sacred scripture. She forces me to stop and consider my day and to pay attention to the littlest things. She doesn&#x27;t tell this to the reader directly, of course, but by being the person who pays obeisance to the world, to its invisible creatures, she makes you do the same.&lt;&#x2F;p&gt;
&lt;p&gt;Reading the first one&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-firstOlBook-1&quot;&gt;&lt;a href=&quot;#fn-firstOlBook&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;, I realized that Mary Oliver can be regarded as one of the American Transcendentalists. I hadn&#x27;t thought of her that way, and she doesn&#x27;t describe herself that way either. But watching her examine Hawthrone and Emerson, it&#x27;s obvious she&#x27;s couldn&#x27;t be anything else. You become what you admire.&lt;&#x2F;p&gt;
&lt;p&gt;I cherish the second book&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-secondOlBook-1&quot;&gt;&lt;a href=&quot;#fn-secondOlBook&quot;&gt;3&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; more than the first, because in it she goes through her writing process. She knows what she wants from her poetry.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;What I want to describe in my poems is the nudge, the prick of the instant, the flame of appreciation that shoots from my heels to my head when compass grass bends its frilled branches and draws a perfect circle on the cold sand; or when the yellow wasp comes, in fall, to my wrist and then to my plate, to ramble the edges of a smear of honey.&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;She has rules and systems to compose poems. These rules have been accreting over a life time.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;I want the poem to ask something and, at its best moments, I want the question to remain unanswered. I want it to be clear that answering the question is the reader’s part in an implicit author-reader pact. Last but not least, I want the poem to have a pulse, a breathiness, some moment of earthly delight. (While one is luring the reader into the enclosure of serious subjects, pleasure is by no means an unimportant ingredient.)&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Morning, for me, is the time of best work. My conscious thought sings like a bird in a cage, but the rest of me is singing too, like a bird in the wind. Perhaps something is still strong in us in the morning, the part that is untamable, that dreams willfully and crazily, that knows reason is no more than an island within us.&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Writing as a vocation is a spiritual endeavor.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Now I think there is only one subject worth my attention and that is the recognition of the spiritual side of the world and, within this recognition, the condition of my own spiritual state. I am not talking about having faith necessarily, although one hopes to. What I mean by spirituality is not theology, but attitude. Such interest nourishes me beyond the finest compendium of facts. In my mind now, in any comparison of demonstrated truths and unproven but vivid intuitions, the truths lose.&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;The last line is hard to disagree with. As even the most idealist among us would be forced to acknowledge, it&#x27;s the best stories that win. What&#x27;s history after all?&lt;&#x2F;p&gt;
&lt;p&gt;My favorite Mary Oliver poem remains the much celebrated &quot;The Summer Day&quot;. It&#x27;s not part of the above collections, and I really can&#x27;t be writing about Mary Oliver without reproducing it.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Who made the world? &lt;br &#x2F;&gt;
Who made the swan, and the black bear? &lt;br &#x2F;&gt;
Who made the grasshopper? &lt;br &#x2F;&gt;
This grasshopper, I mean – &lt;br &#x2F;&gt;
the one who has flung herself out of the grass, &lt;br &#x2F;&gt;
the one who is eating sugar out of my hand, &lt;br &#x2F;&gt;
who is moving her jaws back and forth instead of up and down – &lt;br &#x2F;&gt;
who is gazing around with her enormous and complicated eyes. &lt;br &#x2F;&gt;
Now she lifts her pale forearms and thoroughly washes her face. &lt;br &#x2F;&gt;
Now she snaps her wings open, and floats away. &lt;br &#x2F;&gt;
I don’t know exactly what a prayer is. &lt;br &#x2F;&gt;
I do know how to pay attention, how to fall down &lt;br &#x2F;&gt;
into the grass, how to kneel down in the grass, &lt;br &#x2F;&gt;
how to be idle and blessed, how to stroll through the fields, &lt;br &#x2F;&gt;
which is what I have been doing all day. &lt;br &#x2F;&gt;
Tell me, what else should I have done? &lt;br &#x2F;&gt;
Doesn’t everything die at last, and too soon? &lt;br &#x2F;&gt;
Tell me, what is it you plan to do &lt;br &#x2F;&gt;
with your one wild and precious life? &lt;br &#x2F;&gt;
-- &lt;cite&gt;Mary Oliver&lt;&#x2F;cite&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;br&#x2F;&gt;
&lt;p style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;FOOTNOTES&lt;&#x2F;b&gt; &lt;&#x2F;p&gt;
&lt;footer class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-stingy&quot;&gt;
&lt;p&gt;Given the joy both have given me, how many books have I thus missed by being choosing to spend my money on those with a more &quot;practical&quot; value instead? &lt;a href=&quot;#fr-stingy-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-firstOlBook&quot;&gt;
&lt;p&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.amazon.com&#x2F;Long-Life-Essays-Other-Writings&#x2F;dp&#x2F;0306814129&quot;&gt;Long Life: Essays and Other Writings&lt;&#x2F;a&gt; &lt;a href=&quot;#fr-firstOlBook-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-secondOlBook&quot;&gt;
&lt;p&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.amazon.com&#x2F;dp&#x2F;0395850878&#x2F;ref=cm_sw_em_r_mt_dp_F4SYTK6V200NDHY4H9F0&quot;&gt;Winter Hours: Prose, Prose Poems, and Poems&lt;&#x2F;a&gt; &lt;a href=&quot;#fr-secondOlBook-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;footer&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>The Vachanas of Allama Prabhu</title>
        <published>2022-09-19T00:00:00+00:00</published>
        <updated>2022-09-19T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/allama-prabhu/"/>
        <id>https://asun9.com/allama-prabhu/</id>
        
        <content type="html" xml:base="https://asun9.com/allama-prabhu/">&lt;p&gt;Book: &lt;strong&gt;God is Dead, There is no God: The Vachanas of Allama Prabhu&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Manu Devadevan&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Manu Devadevan&#x27;s translations of a selection of Allama Prabhu comes with a long introduction to the Bhakti poets of the Kannada region. They called themselves as Sharanas in their poems, &quot;proteges of Shiva&quot;, and their poetry came to be called vachanas. AK Ramanujan translates vachanas  as &quot;poetry in free verse&quot;. They are short, and even in translation, powerful.&lt;&#x2F;p&gt;
&lt;p&gt;While AK Ramanujan translated beautifully, he is rather infamous for disregarding the structure of the original poems. He did very successfully capture the contents and the message in his renderings, but the resulting poems bore little resemblance to the original. This raises the questions of authenticity - what was the original poet&#x27;s voice, and what is the translators? Manu Devadevan tries to address these questions in his translation, and also provides a framework to understand the huge volume of vachanas produced by Allama Prabhu. This meta-structure, as captured by the chapter titles, proceeds from individual piety (&quot;The Mist of Maya&quot;) and ends with existential pseudo-nihilism (&quot;Passions of the Void&quot;). It is a pseudo-nihilism because the void of Allama Prabhu is not really bereft of meaning. It is an active principle, as Manu Devadevan puts it. It contains the universe and seems to participate in creation and sustenance. The author asserts that Allama Prabhu&#x27;s void was force fit into the greater Veerashaiva narrative by the fifteenth century exegetists, and it doesn&#x27;t really belong there. I wish he spent more time on persuading us why this is the case. To me, Allama Prabhu’s “void” doesn’t seem to be at odds with ideas from other non-Śramaṇic Indic streams of thoughts, for example that of the Nath jogis. Manu Devadevan contrasts this void with Nagarjuna&#x27;s shunya, but I was more than reminded of Nisargadatta, with some echos of Shankara.&lt;&#x2F;p&gt;
&lt;p&gt;The Veerashaiva poets were staunchly anti-caste, a feature - among other things - that makes their poems attractive to the modern mind. Allama Prabhu in the 12th century CE, as Manu Devadevan shows, was opposed to all systems, everything the mind could conceive. His poems are designed to put the listeners&#x27; mind in that space without any ego, similar to what the Zen koans were intended to do.&lt;&#x2F;p&gt;
&lt;p&gt;Here are a few of my favourites.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Why another shrine &lt;br &#x2F;&gt;
When there’s one in the body? &lt;br &#x2F;&gt;
No one asked for two, &lt;br &#x2F;&gt;
My Lord.&lt;br &#x2F;&gt;
Goggeshvara, &lt;br &#x2F;&gt;
What am I, &lt;br &#x2F;&gt;
When you’re a stone?&lt;&#x2F;p&gt;
&lt;p&gt;-- &lt;cite&gt;VAV 213&lt;&#x2F;cite&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;br&#x2F;&gt;
&lt;blockquote&gt;
&lt;p&gt;There’s no such thing as ‘I’ and ‘You’. &lt;br &#x2F;&gt;
There’s nothing, nothing indeed, &lt;br &#x2F;&gt;
After the self is known. &lt;br &#x2F;&gt;
From where does the no-ness that doesn’t exist &lt;br &#x2F;&gt;
Arrive? &lt;br &#x2F;&gt;
Goggeshvara—who forgot the body &lt;br &#x2F;&gt;
After knowing the state of being— &lt;br &#x2F;&gt;
Is the one without acts of the mind.&lt;&#x2F;p&gt;
&lt;p&gt;-- &lt;cite&gt;VAV 305&lt;&#x2F;cite&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;br&#x2F;&gt;
&lt;blockquote&gt;
&lt;p&gt;They hold food &lt;br &#x2F;&gt;
For the love of hunger. &lt;br &#x2F;&gt;
They’ve a shower &lt;br &#x2F;&gt;
For the love of thirst. &lt;br &#x2F;&gt;
&lt;br &#x2F;&gt;
There’s no Lord, &lt;br &#x2F;&gt;
No devotees. &lt;br &#x2F;&gt;
I don’t exist. &lt;br &#x2F;&gt;
Neither do you. &lt;br &#x2F;&gt;
Goggeshvara, &lt;br &#x2F;&gt;
There’re no worshippers, &lt;br &#x2F;&gt;
Nor the worshipped.&lt;&#x2F;p&gt;
&lt;p&gt;-- &lt;cite&gt;VAV 626&lt;&#x2F;cite&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>கவிதை #1</title>
        <published>2022-09-16T00:00:00+00:00</published>
        <updated>2022-09-16T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/poem-children/"/>
        <id>https://asun9.com/poem-children/</id>
        
        <content type="html" xml:base="https://asun9.com/poem-children/">&lt;p&gt;Reaching, &lt;br &#x2F;&gt;
stretching, &lt;br &#x2F;&gt;
screaming, &lt;br &#x2F;&gt;
looking, &lt;br &#x2F;&gt;
listening, &lt;br &#x2F;&gt;
dancing, &lt;br &#x2F;&gt;
To watch a little one &lt;br &#x2F;&gt;
express herself in the world, &lt;br &#x2F;&gt;
this absorption, &lt;br &#x2F;&gt;
is this what they call bliss?&lt;&#x2F;p&gt;
&lt;br&#x2F;&gt;
&lt;hr &#x2F;&gt;
&lt;br&#x2F;&gt;
&lt;p&gt;Notes:&lt;&#x2F;p&gt;
&lt;p&gt;This came to me in a fit of inspiration after I read some of Mary Oliver&#x27;s &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.amazon.com&#x2F;Long-Life-Essays-Other-Writings&#x2F;dp&#x2F;0306814129&quot;&gt;essays&lt;&#x2F;a&gt;, and playing with the children of a few friends.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Baby Talk</title>
        <published>2022-09-08T00:00:00+00:00</published>
        <updated>2022-09-08T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/baby-talk/"/>
        <id>https://asun9.com/baby-talk/</id>
        
        <content type="html" xml:base="https://asun9.com/baby-talk/">&lt;p&gt;He&#x27;s ahead of me on the path next to his house, waddling furiously on his tricycle. His legs don&#x27;t have the strength to pedal yet. The bike is small enough that his legs gets stuck once in a while between the wheels. He stops and looks back to see if I am still following him. &quot;Come Abhi mama&quot; he coos. I immediately go to him, ready to do his bidding. He looks at his stuck foot and I free it. He shakes his little legs and starts forward again. At every intersection he asks me which path he should take. I reply to him in Tamil. It delights me when he understands.&lt;&#x2F;p&gt;
&lt;p&gt;What does the little one like to do? &lt;br &#x2F;&gt;
He likes to watch squirrels. &quot;kkurruvee..&quot; he says pointing at sparrows. &quot;kutti palli&quot; he admonishes the lizards.&lt;&#x2F;p&gt;
&lt;p&gt;What does the little one like to do? &lt;br &#x2F;&gt;
He likes his scooter and his tricycle. He likes to go around the complex racing with his parents or his mama.&lt;&#x2F;p&gt;
&lt;p&gt;What does the little one like to do? &lt;br &#x2F;&gt;
He likes to be carried around, and he always has an obliging adult to do that. Who can deny him?&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>The Lives of Sri Aurobindo</title>
        <published>2022-09-05T00:00:00+00:00</published>
        <updated>2022-09-05T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/lives-of-sri-aurobindo/"/>
        <id>https://asun9.com/lives-of-sri-aurobindo/</id>
        
        <content type="html" xml:base="https://asun9.com/lives-of-sri-aurobindo/">&lt;p&gt;Book: &lt;strong&gt;The Lives of Sri Aurobindo&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Peter Heehs&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Aurobindo was active in the Indian public life from the years 1906 to 1910. Of that, he spent a year in Alipore jail, awaiting trail. He was the editor of the paper Bande Matram for two years. Along with Tilak, he was the face of the uncompromisingly nationalistic front of the Indian National Congress. The Aurobindo many Indians are most familiar with&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-famClaim-1&quot;&gt;&lt;a href=&quot;#fn-famClaim&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; is the one from these four years, out of the seventy-five that was his. These few years changed the character of the Indian freedom movement. I find this remarkable, and consider it a testimony to the power of ideas and the press in mobilizing the masses. No one insisted on a policy of absolute independence till Aurobindo articulated it. Aurobindo and the so-called Extremist faction of the Congress would go on to inspire the actions of Gandhi, Bhagat Singh, Subash Chandra Bose and KM Munshi. And these were just four short years out of India&#x27;s sixty odd years of formal freedom struggle. Aurobindo spent the rest of his life focusing on his Yoga, which is what initially led to my interest in him. Why would someone like that, a self-professed man of action, retire from public life? This also puzzled everyone inspired by the early Aurobindo speaking from the pages of Bande Mataram. Bose would later go on to diss him&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-boseOnBindo-1&quot;&gt;&lt;a href=&quot;#fn-boseOnBindo&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;, and Nehru said &quot;most of the people of my generation, who were immersed in political aspects of our struggle, did not understand why he did so [retire from politics].&quot; In Aurobindo&#x27;s own mind, his efforts at Yoga were just as important to India and world as his writings and uncompromising push for the exit of the British crown from India. He assumed India&#x27;s freedom was a foregone conclusion - this in the early 1900s, when the British Empire was at its apogee. Congress would press for complete freedom only in 1930, and the British would leave only in 1947. He regarded his experiments in Yoga not as a selfish endeavor, but one tied closely to India&#x27;s emancipation.&lt;&#x2F;p&gt;
&lt;p&gt;What was his Yoga? This is a system of practices he discovered on his own. In some ways Aurobindo can be regarded as one in the line of the exegetists Shankara, Ramanuja and Madhava. Like traditional orthodox philosophers, he had his commentaries on the Gita and the principal Upanishads and the insights of the Vedic seers. Unlike them however, he entirely ignored rituals, didn&#x27;t care to write in Sanskrit and ignored existing social realities. He rejected the world denying Maya of Shankara, as popularly understood. “Whatever others may do,” Aurobindo wrote, “the Karmayogin must not remove himself from the field of action and give up work in the world.” The motto of his spiritual practice was &quot;All life is Yoga.&quot; Rejecting the ascetic life, he did yoga as a “householder.” While teaching students in Baroda in 1900, Aurobindo encouraged his students to think about what they read and to put their ideas down on paper. It&#x27;s apparent he followed the same dictum with his forays into the Vedas and the Gita. He was an insistently critical interpreter of these texts, and they had to pass through the filter of his experience before he would accept them&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-bindoOnYoga-1&quot;&gt;&lt;a href=&quot;#fn-bindoOnYoga&quot;&gt;3&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;. Initially using terms from Greek and Sanskrit to describe various states he encountered in his meditation, he eventually invented his own words to do the same - the Overmind, Supermind and such. Never intending to have students or an Ashram, he found himself with both. I couldn&#x27;t help but be reminded of Raju from RK Narayanan&#x27;s Guide. Unlike Raju, Aurobindo was sincere about his &lt;em&gt;sadhana&lt;&#x2F;em&gt;. &quot;In the end, ...mystical experiences remain subjective&quot; says Peter Heehs in the foreword. The author, to his credit, doesn&#x27;t ignore these experiences and tries to square them as much as possible with available evidence.&lt;&#x2F;p&gt;
&lt;p&gt;Peter Heehs is a sympathetic biographer, but not uncritical. Supported by a trove of footnotes and references, he leads us on a tour of Aurobindo&#x27;s life and the Indian freedom movement. The section about Aurobindo&#x27;s books can serve as an introduction to his philosophy, and a solid foundation for understanding his works. I very much enjoyed learning about the Bengal revolutionaries and the machinations of the Congress, especially about how rowdy political disagreements could get. In contrast to the sanitized history presented to us in school, the Moderates and Extremists were at each others throats. In the 1907 session of the Congress at Surat, a slipper is thrown at Surendranath Banerjea, and Tilak and associates get into a fist fight. Aurobindo is spat at. Clearly this is a period I need to spend more time investigating. I didn&#x27;t know Subramania Bharati and Sri Aurobindo were acquainted with each other and that it was Bharati who introduced Aurobindo to the hymns of the Tamil Alwars. Aurobindo in turn introduced Bharati to the Vedas. A favourite Bharati verse of mine from this unexpected crossover is &quot;Intha janmathil jayamundu bayamillai manamey, Guhaney, paraman mahanay, guhayil valarum kanalay.&quot;&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-bharatiTrans-1&quot;&gt;&lt;a href=&quot;#fn-bharatiTrans&quot;&gt;4&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; Yet another area to explore, and I could always do with more Bharati in my life.&lt;&#x2F;p&gt;
&lt;br&#x2F;&gt;
&lt;p style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;FOOTNOTES&lt;&#x2F;b&gt; &lt;&#x2F;p&gt;
&lt;footer class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-famClaim&quot;&gt;
&lt;p&gt;I am making this claim based on what I knew of Aurobindo before I started reading him, and what others around me know about him. The first and usually the last exposure of Indians to Aurobindo is via public school texts. &lt;a href=&quot;#fr-famClaim-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-boseOnBindo&quot;&gt;
&lt;p&gt;Bose&#x27;s disillusionment is understandable. He resigned from the Indian Civil Service in 1921 following Aurobindo’s example. “It was widely believed about this time,” Bose wrote, that Aurobindo “would soon return to active political life.” &lt;a href=&quot;#fr-boseOnBindo-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-bindoOnYoga&quot;&gt;
&lt;p&gt;“A perfect yoga requires perfect balance. That was the thing that saved me—the perfect balance. First I believed that nothing was impossible and at the same time I could question everything.” One can view Aurobindo&#x27;s Record of Yoga as a self-critical journal of a practitioner. &lt;a href=&quot;#fr-bindoOnYoga-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-bharatiTrans&quot;&gt;
&lt;p&gt;&quot;Victory in this life is certain O Mind, fear there is none, In the secret cave, O growing Flame, Son of the Supreme.&quot; As recorded by &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.wisdomlib.org&#x2F;history&#x2F;compilation&#x2F;triveni-journal&#x2F;d&#x2F;doc70937.html&quot;&gt;Kapali Sastri&lt;&#x2F;a&gt; &lt;a href=&quot;#fr-bharatiTrans-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;footer&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Reading In Clusters</title>
        <published>2022-08-29T00:00:00+00:00</published>
        <updated>2022-08-29T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/cluster-reading/"/>
        <id>https://asun9.com/cluster-reading/</id>
        
        <content type="html" xml:base="https://asun9.com/cluster-reading/">&lt;p&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.spakhm.com&#x2F;p&#x2F;how-i-read&quot;&gt;Slava Akhmechet&lt;&#x2F;a&gt; suggests that reading five books on a topic can make you as close to well-informed as anything can. Reading just one book doesn&#x27;t cut it.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;A single book is a pinhole view of the world set up by the author. You have no input into its contents, and therefore cannot change the orientation of this view. But you do choose the books you select. That means you can stitch together multiple pinhole views into a unique lens to examine the world— one that no one else will have unless they use the same list of books to stitch together the same lens.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;I settled on clusters of five and almost never read a single book in isolation. Less than five feel lacking; more than five gets repetitive. Every cluster has a goal of the form &quot;study X through Y&quot;. Study American history through technological expansion, or study failure through one term presidents are just a few examples. I try to be creative and make Y unusual. For instance, everyone likes to read about presidents who are believed to be successful. A simple trick is to inverse it and read about unsuccessful ones instead. Or skip the presidents altogether, and read about vice presidents. It doesn&#x27;t matter what Y is because you&#x27;re trying to study X, and it&#x27;s more fun to make Y unusual.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;This strategy is similar to Tyler Cowen&#x27;s, who also happens to read a lot, lot more (five to ten books a day seems rather excessive to me). From &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.econtalk.org&#x2F;tyler-cowen-on-reading&#x2F;&quot;&gt;EconTalk&#x27;s podcast with Cowen&lt;&#x2F;a&gt;:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;I brought the books I&#x27;m reading now. So, here&#x27;s a book: It&#x27;s called Land, Politics and Nationalism: A Study of the Irish Land Question, by Philip Bull. He goes through Irish land debates in the 19th century. I read about two thirds of this book. It&#x27;s from the library. I&#x27;m going to read most of it again, but only after I&#x27;ve read other books about Irish land history. So, to reread it twice in a row makes no sense. To read it again 10 years from now for me makes no sense. &lt;strong&gt;But I like to read books in clusters;&lt;&#x2F;strong&gt; and overall, it&#x27;s a good book. Much of what Bull says will have much more meaning to me after I&#x27;ve read four or five other books on the 19th century Irish land question. That is how and why I&#x27;m going to reread, say, at least two thirds of this book.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;It&#x27;s interesting that Cowen does not take notes. Cowen uses books to extract contexts - frameworks, models - and he has good enough memory to remember them. I hardly remember the books I read unless I write about them. I can only hope, like Emerson says, that the books have made me even if I don&#x27;t remember how.&lt;&#x2F;p&gt;
&lt;p&gt;Both Cowen and Russ Roberts insist that you don&#x27;t have finish books you have started if they don&#x27;t hold your interest. Life is short and all that. I have come around to that view lately, although I wish I had learnt that lesson much earlier. When you are younger you think you will live forever. At 30, you wake up one day and realize that your parents have grown smaller, look weaker and that you will eventually get to where they are. It put things in perspective, helps one prioritize. As much as I would have liked it, I doubt I would have learnt this lesson earlier.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Rural Society in Southeast India</title>
        <published>2022-08-22T00:00:00+00:00</published>
        <updated>2022-08-22T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/rural-society-india-gough/"/>
        <id>https://asun9.com/rural-society-india-gough/</id>
        
        <content type="html" xml:base="https://asun9.com/rural-society-india-gough/">&lt;p&gt;Book: &lt;strong&gt;Rural Society in Southeast India&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Kathleen Gough&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;This is a fascinating ethnographic study of two very rural, small villages in Thanjavur from early 1950s, one Brahmin dominated and the other mainly Non-Brahmin. These are Kumbapettai and Kirippur, respectively. It&#x27;s effectively a snapshot of a society in rapid transition, a world that doesn&#x27;t exist any more. There&#x27;s horrifying feudal justice in Kumbapettai, with the parties preferring to not involve the police and the law. Kathleen Gough - a Marxist - chalks most of it down to class conflict. It&#x27;s always the landed folks administering what passes as justice on the landless. When conflicts happen between the Brahmins and other landed castes, the Brahmins find themselves unable to enforce any sort of &quot;justice&quot;. The police is bribed in all cases. It&#x27;s interesting to note that there were more caste conflicts and aggression in Kirippur, because it was not a &quot;traditional&quot; village with a clearly defined caste hierarchy (half the families migrated to the village in the preceding century). This means that there was constant competition and bickering among the largest groups - the Padaiyacchis, Naidus, and Sengunda Mudaliars - for authority and status. Women in both the villages get a raw deal. Kumbapettai is mainly illiterate, but with a number of houses empty and the owners having transitioned to urban life in the city. Kirippur has a much higher literacy rate among both men and women.&lt;&#x2F;p&gt;
&lt;p&gt;The jatis, low or high, are not agency-less automatons carrying out their prescribed role. They are also not necessarily heroic transgressors of injustice they are subjected to. Fortunes change with arrival of modernity. The agents of change are both education and travel (migration correlates to less rigidity in some practices), and electoral politics - the Communists, DK and Congress. The landlords, unsurprisingly, prefer the Congress. As an aside, Kathleen Gough uses the quaint term &quot;Harijans&quot; to refer to the groups that now call themselves Dalits. Given the care with which she writes about various castes, I doubt that she would have used that term if she regarded it as patronizing. This makes me wonder, did these groups call themselves Harijans at the time of writing?&lt;&#x2F;p&gt;
&lt;p&gt;Kathleen Gough is unafraid of presenting her political opinions, and is a committed and concerned social scientist. As she says in the beginning of the book:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Both there and in Kerala, I came to feel that the ruling Congress party would not make the radical, let alone revolutionary changes that were needed to improve the lot of common people, and that the Communist Party had policies that were more likely to bring these changes about . . . especially after living in Kirippur, I felt that the Communists were essentially correct in their analysis of agrarian problems and that they are the only party that truly sought the welfare of the most downtrodden.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;While I do not find myself persuaded by her analysis of an entire millennium of Thanjavur history through Marxist modes of production, this is an excellent ethnographic survey, with an overview of various castes involved in agriculture in two very different environments, and some insights on the influence of the environment on prevailing social structures.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Book Notes: Values in Therapy</title>
        <published>2022-08-03T00:00:00+00:00</published>
        <updated>2022-08-03T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/values-in-therapy/"/>
        <id>https://asun9.com/values-in-therapy/</id>
        
        <content type="html" xml:base="https://asun9.com/values-in-therapy/">&lt;h3 id=&quot;summary&quot;&gt;Summary&lt;&#x2F;h3&gt;
&lt;p&gt;A deep dive into values for therapists who specialize in acceptance and commitment therapy (ACT). I am not a therapist, and I picked up the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.amazon.com&#x2F;gp&#x2F;product&#x2F;B07MT7DW5T&quot;&gt;book&lt;&#x2F;a&gt; because I was curious and wondered if it was an extension of Victor Frankl&#x27;s logotheraphy. He&#x27;s briefly mentioned before we are guided head along into values. The fundamental tenet of the book is that exploring values with clients can help them navigate through personal crises and problems that they choose to have therapy for. Values aren&#x27;t words, but actions, what people invest their time and energy in. Values are not goals. I found the first few chapters exploring values, contrasting them with goals and the role it plays in therapy very engrossing. The remaining chapters are about strategies to cultivate valued living. That became repetitive after a while. I suspect I will only do the exercises if I ever actually go to therapy.&lt;&#x2F;p&gt;
&lt;p&gt;As an aside, it looks like what separates self-help books from therapy ones are randomized controlled trials and peer reviews.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;notes&quot;&gt;Notes&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Values aren’t about words. They are found in watching what people actually do with their lives, where they invest their time, energy, and focus. The goal of exploring values in therapy is to help build a person’s ability to contact and experience the patterns of living they might choose.&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;blockquote&gt;
&lt;p&gt;Harry, there’s two kinds of tired. There’s good tired and there’s bad tired… Ironically enough, bad tired can be a day that you won. But you won other people’s battles; you lived other people’s days, other people’s agendas, other people’s dreams. And when it’s all over, there was very little you in there. And when you hit the hay at night, somehow you toss and turn; you don’t settle easy… Good tired, ironically enough, can be a day that you lost, but you don’t even have to tell yourself because you knew you fought your battles, you chased your dreams, you lived your days and when you hit the hay at night, you settle easy, you sleep the sleep of the just and you say ‘take me away’… Harry, all my life I wanted to be a painter and I painted; God, I would have loved to have been more successful, but I painted and I painted and I’m good tired and they can take me away.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Singer-songwriter Harry Chapin (1988)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Key characteristics of values: they are freely chosen and they are appetitive (people are drawn towards it rather than focused on moving away from it)&lt;&#x2F;li&gt;
&lt;li&gt;Valuing relies more on things like choosing, creating, assuming, and dreaming than it does weighing out a list of pros and cons.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h4 id=&quot;what-could-values-be&quot;&gt;What could values be?&lt;&#x2F;h4&gt;
&lt;ul&gt;
&lt;li&gt;What a well-lived life would be for you personally&lt;&#x2F;li&gt;
&lt;li&gt;How you are living when you are living a meaningful life&lt;&#x2F;li&gt;
&lt;li&gt;Those qualities that, when you get to the end of everything, you want to have embodied in your life What you want your life to stand for&lt;&#x2F;li&gt;
&lt;li&gt;What is meaningful and what you would want to matter to you&lt;&#x2F;li&gt;
&lt;li&gt;The journey you would choose for this one life you know you have to live&lt;&#x2F;li&gt;
&lt;li&gt;What you want the journey to have been about once you get to the end of this life&lt;&#x2F;li&gt;
&lt;li&gt;The kind of person you want to be as you move through this world&lt;&#x2F;li&gt;
&lt;li&gt;The qualities of living that would lead you to say, “Ah, now that was a life well lived!” once you have gotten to the end of it&lt;&#x2F;li&gt;
&lt;li&gt;Intentionally constructing a well-lived life.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h4 id=&quot;psychological-flexibility&quot;&gt;Psychological Flexibility&lt;&#x2F;h4&gt;
&lt;ul&gt;
&lt;li&gt;Values are reflected through effective action, on where we focus our time and effort. This required psychological flexibility: 1) Willingness, 2) Defusion, 3) Present Moment, 4) Flexible Perspective Taking.&lt;&#x2F;li&gt;
&lt;li&gt;Willingness is choosing to be with what is without struggling or attempting to run away from it.&lt;&#x2F;li&gt;
&lt;li&gt;This process of being able to look at thoughts and evaluate them in terms of their workability, rather than being caught up in what they present themselves to be—literal truths about the world—is called cognitive defusion.&lt;&#x2F;li&gt;
&lt;li&gt;Flexible perspective taking: our thoughts about us shape our conception of self.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h4 id=&quot;tools-to-discover-and-cultivate-values&quot;&gt;Tools to discover and cultivate values&lt;&#x2F;h4&gt;
&lt;ul&gt;
&lt;li&gt;The Feared Eulogy: Write out a detailed eulogy you would want to have read at your funeral, one that reflected your ideal, well-lived life. Be as detailed as possible about what you would want said about the life you’d most want to have lived. What did you make important in your life? What kind of an impact did you have? What and who mattered to you? What or who didn’t really matter to you? How did you act toward the people in your life that were important to you?&lt;&#x2F;li&gt;
&lt;li&gt;Starting small makes experimenting with new behavior and learning from those experiments easier. But even very small shifts in a trajectory result in vastly different ending points over the course of years or decades. So, start small and go day by day, focusing on one action by valued action at a time. Over the course of a lifetime, those little molehills of valued action will become a mountain of a well-lived life.&lt;&#x2F;li&gt;
&lt;li&gt;A &lt;strong&gt;dead person goal&lt;&#x2F;strong&gt; is any goal that a dead person can accomplish better than a living person can. For example, if the client’s goal is to not fight with their sister, any dead person is always going to fight less with their sister than any living person will. Not fighting with your sister is a dead person goal. Dead person goals create lifelessness as opposed to a life of vitality. &lt;strong&gt;But expressing love and appreciation to your sister is something that a dead person can’t do; it’s an active goal that has potential.&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;If you were an actor playing a character who was feeling “confident&#x2F;happy&#x2F;good about themself,” how would that character behave? What do you imagine that character would be able to do that you don’t feel is possible in your life as it is now?&lt;&#x2F;li&gt;
&lt;li&gt;If you could take a pill that would mean you would feel good all of the time without ever feeling anxiety, sadness, worry, self-doubt, or anger, then how do you think you would spend your time?&lt;&#x2F;li&gt;
&lt;li&gt;Write the Character of You exercise or Superhero Alter Ego metaphor. If a client is caught up in the past or future, sometimes the best thing to do is start from scratch. One way to do this is with the Write the Character of You exercise. In this exercise, &lt;strong&gt;the client is asked to imagine that they are developing the main character for a screenplay or novel they are writing. The character they are developing is an alternate version of themselves. This character has no predetermined backstory, no habits that define them, no history that limits them. The character should represent who they would most want to be, in their ideal world&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Imagine you could start all over again and reinvent yourself in your job. It’s a clean slate and you can embody any qualities you want as a new you. How would you ideally want to be if you could start over? What qualities would you want this reinvented self to embody?&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Book Notes: High Output Management By Andy Grove</title>
        <published>2022-08-01T00:00:00+00:00</published>
        <updated>2022-08-01T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/high-output-management/"/>
        <id>https://asun9.com/high-output-management/</id>
        
        <content type="html" xml:base="https://asun9.com/high-output-management/">&lt;h3 id=&quot;summary&quot;&gt;Summary&lt;&#x2F;h3&gt;
&lt;p&gt;Thanks to a reading group at work I finally got through this book after starting and putting it off multiple times these past six years. The factory analogy at the beginning would always zone me out. There are a few such - in my opinion, forced - analogies in the book, but sticking with it does surface plenty of gems. Thanks to the sheer success of Andy Grove&#x27;s Intel, none of the insights are surprising since they have become foundational to how every valley company is now run. Grove&#x27;s framework for running one on ones, how to make meetings useful, thoughts on what makes a manager a manager, managing by objectives, all these are now common place in tech companies (and maybe beyond). It can be argued that all management books written by valley executives these past two decades are downstream of High Output Management. There&#x27;s almost no fluff here. Grove transformed Bob Noyce&#x27;s and Gordon Moore&#x27;s Intel into his own image, rescuing it from certain death at least twice. This book captures Intel&#x27;s managing principles from the 80s and the 90s that allowed it to survive and thrive. That alone makes it worthwhile for any engineer to read. At the least, it will make concrete some of things you are already thinking of regarding this job that you are doing.&lt;&#x2F;p&gt;
&lt;p&gt;The Intel of 2022 doesn&#x27;t have the same shine it did during Grove&#x27;s days. I wonder if these ideas needed a Grove or someone very like him to execute at scale. Entropy is inevitable, but can organizations delay it? Are there any such organizations at all? What went wrong with Intel under his successors? Grove is no longer around to illuminate us, and I would quite like a book that explores and tries to answer some of these questions.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;notes&quot;&gt;Notes&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;You are responsible for your career. This is the lowest level of management.&lt;&#x2F;li&gt;
&lt;li&gt;Fix problems as early as possible. Uses the analogy of a factory. You want to address issues as close to the source as possible.&lt;&#x2F;li&gt;
&lt;li&gt;Indicators - paired indicators, leading indicators. You need to measure your system, and you need to come up with metrics to do that. There will be multiple metrics. Examples include sales forecast, raw material inventory, equipment, man power.&lt;&#x2F;li&gt;
&lt;li&gt;There are two ways to increase productivity: do what you are already doing faster, or change the nature of your work. The second one has more leverage. &quot;Work smarter, not harder&quot;. Arrange your workflow so that you can produce more with your activity.&lt;&#x2F;li&gt;
&lt;li&gt;Management is a team game. A manager&#x27;s output is the output of his or her organization plus the output of the neighbouring organizations under his influence.
&lt;ul&gt;
&lt;li&gt;It&#x27;s not enough for a manager to do his own individual work well.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Andy Grove doesn&#x27;t consider only people managers as &quot;managers&quot;. &quot;Individual contributors who gather and disseminate know-how and information should also be seen as middle managers, because they exert great power within the organization.&quot;&lt;&#x2F;li&gt;
&lt;li&gt;Written reports don&#x27;t provide timely information - the life blood of any high leverage managerial activity. So why are written reports important? &quot;Reports are more a medium of self-discipline than a way to communicate information. Writing the report is important, reading it often is not.&quot;
&lt;ul&gt;
&lt;li&gt;Similar reasoning applies to the preparation of an annual plan.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Values and behavioural norms are simply not transmitted by talk or memo, but are conveyed very effectively by doing, and doing visibly. Managers should be exemplars.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;The art of management lies in the capacity to select from the many activities of seemingly comparative significance the one or two that provide leverage well beyond others and concentrate on them.&lt;&#x2F;strong&gt;
&lt;ul&gt;
&lt;li&gt;For Grove, this was listening to customer complaints.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Meetings are mediums through which managerial work is performed. There are two kinds: process-oriented and mission-oriented. Know which meeting you are going to.
&lt;ul&gt;
&lt;li&gt;Process-oriented: knowledge is shared and information is exchanged.&lt;&#x2F;li&gt;
&lt;li&gt;Mission-oriented: solve a specific problem.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Grove&#x27;s Principle of Didactic Management: &quot;Ask one more question!&quot;
&lt;ul&gt;
&lt;li&gt;&quot;When the supervisor thinks that the subordinate has said all that he wants to about a subject, he should ask another question. He should keep the flow of thoughts coming by prompting the subordinate with queries till both feel satisfied that they have gotten to the bottom of a problem.&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;One-on-ones can exert enormous leverage: this happens through the development of a common base of information and similar ways of doing and handling things between the supervisor and the subordinate.&lt;&#x2F;li&gt;
&lt;li&gt;Peer-group syndrome: When peers meet together to solve a problem, a decision doesn&#x27;t get made. Peers tend to look for a more senior manager, even if he&#x27;s not the most competent or knowledgable person involved, to take over and shape a meeting. Most people are just afraid to stick their necks out.&lt;&#x2F;li&gt;
&lt;li&gt;A manager&#x27;s key task is to settle six important questions in advance:
&lt;ul&gt;
&lt;li&gt;What decision needs to be made?&lt;&#x2F;li&gt;
&lt;li&gt;When does it have to be made?&lt;&#x2F;li&gt;
&lt;li&gt;Who will decide?&lt;&#x2F;li&gt;
&lt;li&gt;Who will need to be consulted prior to making the decision?&lt;&#x2F;li&gt;
&lt;li&gt;Who will ratify or veto the decision?&lt;&#x2F;li&gt;
&lt;li&gt;Who will need to be informed of the decision?&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Management by objective system needs to answer two questions:
&lt;ul&gt;
&lt;li&gt;Where do  want to go? (the objective)&lt;&#x2F;li&gt;
&lt;li&gt;How will I pace myself to see if I am getting there (the key results)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Our behaviour in a work environment can be controlled by three invisible and pervasive means.
&lt;ul&gt;
&lt;li&gt;free-market forces&lt;&#x2F;li&gt;
&lt;li&gt;contractual obligations&lt;&#x2F;li&gt;
&lt;li&gt;cultural values&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;At any time at work, all three of the above will govern what one does. Exercise of power must keep an awareness of the above in the mind. Carrot and stick.&lt;&#x2F;li&gt;
&lt;li&gt;The manager is a coach managing a sports team. An ideal coach doesn&#x27;t take personal credit for the success of the team, and due to that the team trusts him. He is tough on the team, and by being critical can extract the best performance. The coach should have once been a good player himself and understands the game.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Patterns in programming puzzles</title>
        <published>2022-04-24T00:00:00+00:00</published>
        <updated>2022-04-24T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/coding-puzzles-patterns/"/>
        <id>https://asun9.com/notes/coding-puzzles-patterns/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/coding-puzzles-patterns/">&lt;p&gt;When presented with a programming puzzle, some tools to consider.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If the input data structure is sorted, use binary search and&#x2F;or two pointers.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Whenever there’s a requirement to find two data elements in an array that satisfy a certain condition, the two pointers pattern should be the first strategy to come to mind. Example:
&lt;ul&gt;
&lt;li&gt;whether a string is a valid palindrome.&lt;&#x2F;li&gt;
&lt;li&gt;Reversing an array&lt;&#x2F;li&gt;
&lt;li&gt;pair with a given sum in an array.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Sliding window if the problem requires repeated computations on a contiguous set of data elements (a subarray or a substring), such that the window moves across the input array from one end to the other.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;If asked for all permutations&#x2F;subsets, use &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Backtracking&quot;&gt;Backtracking&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Backtracking tries to explore all possible paths to a solution. It is better than brute-force since we don’t have to generate all possible solutions and choose our required solution from among these. It provides us with the option to check our required condition at each possible recursive call. If the condition is met, we continue exploring that path. If it isn’t, we take a step back and explore another path. In this way, we avoid generating redundant solutions.&lt;&#x2F;li&gt;
&lt;li&gt;To implement backtracking, we implement a backtrack function that makes some changes to the state, calls itself again, and then when that call returns it undoes those changes.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;If given a tree or a graph then use BFS or DFS.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;BFS is a good choice for finding the shortest path in an unweighted graph because it brings up the best possible solution at a particular vertex before moving forward. It visits all vertices at a given distance from the source vertex before visiting vertices farther away.&lt;&#x2F;li&gt;
&lt;li&gt;DFS, on the other hand, is a good choice to find a path in a maze when you want to explore vertices that are far away from the source vertex before visiting vertices that are closer. This makes DFS a good choice for problems that require the traversal of deep branches of the graph.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Matrix problems, example finding connected components, use BFS or DFS.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;If given a linked list then, two pointers (one fast, other slow)&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Or other directional data structures such as an array.&lt;&#x2F;li&gt;
&lt;li&gt;Used to determine data structure traits, such as cycles.&lt;&#x2F;li&gt;
&lt;li&gt;Other examples:
&lt;ul&gt;
&lt;li&gt;middle node of a linked list (make the fast pointer move 2 nodes forward each time slow pointer moves one node.)&lt;&#x2F;li&gt;
&lt;li&gt;Determine if a number is a happy number. Repeatedly sum the squares of its digits.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;If you can&#x27;t use recursion, use stack.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;If you must solve in-place, swap corresponding values, or overload a pointer with multiple values.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;If asked for maximum&#x2F;minimum subarray&#x2F;subset&#x2F;options then use &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Dynamic_programming&quot;&gt;Dynamic Programming&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;leetcode.com&#x2F;problems&#x2F;house-robber&#x2F;solution&#x2F;&quot;&gt;Find maximum sum in an array, with no two adjacent numbers contributing to the array&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;leetcode.com&#x2F;problems&#x2F;maximum-subarray&#x2F;description&#x2F;?envType=list&amp;amp;envId=xi4ci4ig&quot;&gt;Maximum subaray&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Can be used if:
&lt;ul&gt;
&lt;li&gt;Overlapping subproblems, that is, we can use the results of one subproblem when solving another, possibly larger subproblem.&lt;&#x2F;li&gt;
&lt;li&gt;Optimal substructure, that is, if the final solution can be constructed from the optimal solutions to its subproblems.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;If asked for top&#x2F;least K items, use Heap.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;repeatedly calculate two maxima, two minima, or one maximum and one minimum, and the input data is not sorted.&lt;&#x2F;li&gt;
&lt;li&gt;Real world examples:
&lt;ul&gt;
&lt;li&gt;Uber: Select at least the n nearest drivers within the user’s vicinity, avoiding the drivers that are too far away&lt;&#x2F;li&gt;
&lt;li&gt;Stocks: Given the set of IDs of brokers, determine the top K broker’s performance with the frequently repeated IDs in the given data set.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;If asked for common strings, use a map or trie.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;sliding-window&quot;&gt;Sliding Window&lt;&#x2F;h3&gt;
&lt;p&gt;Longest Window Substring&lt;&#x2F;p&gt;
&lt;p&gt;Track the index of each character. If an char is already present, the new substring to track will start from the next index.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;class &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;Solution&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;longestSubstringWithoutRepeat&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;s&lt;&#x2F;span&gt;&lt;span&gt;: str):
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# Your code goes here
&lt;&#x2F;span&gt;&lt;span&gt;        state = {}
&lt;&#x2F;span&gt;&lt;span&gt;        start = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0
&lt;&#x2F;span&gt;&lt;span&gt;        _max = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;end &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;in &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;range&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;(s)):
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;s[end] in state:
&lt;&#x2F;span&gt;&lt;span&gt;                start = state[s[end]] + &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;1
&lt;&#x2F;span&gt;&lt;span&gt;            state[s[end]] = end
&lt;&#x2F;span&gt;&lt;span&gt;            _max = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;max&lt;&#x2F;span&gt;&lt;span&gt;(_max, end - start + &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;_max
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;binary-search-tree&quot;&gt;Binary Search Tree&lt;&#x2F;h3&gt;
&lt;p&gt;With &lt;code&gt;n&lt;&#x2F;code&gt; nodes in the tree:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Add or remove element: &lt;code&gt;O(n)&lt;&#x2F;code&gt; worst case. &lt;code&gt;O(log n)&lt;&#x2F;code&gt; average case.&lt;&#x2F;li&gt;
&lt;li&gt;Check if element exists: &lt;code&gt;O(n)&lt;&#x2F;code&gt; worst case. &lt;code&gt;O(log n)&lt;&#x2F;code&gt; average case.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;binary-tree&quot;&gt;Binary Tree&lt;&#x2F;h2&gt;
&lt;p&gt;Given &lt;code&gt;n&lt;&#x2F;code&gt; as the number of nodes in the tree, most algorithms will run in &lt;code&gt;O(n⋅k)&lt;&#x2F;code&gt; time, where &lt;code&gt;k &lt;&#x2F;code&gt;is the work done at each node, usually &lt;code&gt;O(1)&lt;&#x2F;code&gt;. This is just a general rule and not always the case. We are assuming here that BFS is implemented with an efficient queue.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;dfs-recursive-and-iterative&quot;&gt;DFS - recursive and iterative&lt;&#x2F;h3&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;dfs&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;root&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;not root:
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    ans = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# do logic
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;dfs&lt;&#x2F;span&gt;&lt;span&gt;(root.left)
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;dfs&lt;&#x2F;span&gt;&lt;span&gt;(root.right)
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;ans
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;dfs&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;root&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;    stack = [root]
&lt;&#x2F;span&gt;&lt;span&gt;    ans = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;while &lt;&#x2F;span&gt;&lt;span&gt;stack:
&lt;&#x2F;span&gt;&lt;span&gt;        node = stack.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;pop&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# do logic
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;node.left:
&lt;&#x2F;span&gt;&lt;span&gt;            stack.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;append&lt;&#x2F;span&gt;&lt;span&gt;(node.left)
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;node.right:
&lt;&#x2F;span&gt;&lt;span&gt;            stack.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;append&lt;&#x2F;span&gt;&lt;span&gt;(node.right)
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;ans
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;bfs&quot;&gt;BFS&lt;&#x2F;h3&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;collections &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;deque
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;bfs&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;root&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;    queue = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;deque&lt;&#x2F;span&gt;&lt;span&gt;([root])
&lt;&#x2F;span&gt;&lt;span&gt;    ans = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;while &lt;&#x2F;span&gt;&lt;span&gt;queue:
&lt;&#x2F;span&gt;&lt;span&gt;        current_length = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;(queue)
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# do logic for current level
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;_ &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;in &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;range&lt;&#x2F;span&gt;&lt;span&gt;(current_length):
&lt;&#x2F;span&gt;&lt;span&gt;            node = queue.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;popleft&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# do logic
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;node.left:
&lt;&#x2F;span&gt;&lt;span&gt;                queue.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;append&lt;&#x2F;span&gt;&lt;span&gt;(node.left)
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;node.right:
&lt;&#x2F;span&gt;&lt;span&gt;                queue.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;append&lt;&#x2F;span&gt;&lt;span&gt;(node.right)
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;ans
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;heap&quot;&gt;Heap&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Add an element: &lt;code&gt;O(logn)&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Delete minimum element: &lt;code&gt;O(log n)&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Find minimum element: &lt;code&gt;O(1)&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Check if element exists: &lt;code&gt;O(n)&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;A heap is a complete binary tree where each node is associated with a key that satisfies a heap property. Heap data structures are particularly useful for finding the minimum or maximum value in a data set, and are eﬀectively used as priority queues.&lt;&#x2F;p&gt;
&lt;p&gt;Find top k elements in heap&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;heapq
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;arr&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;k&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;    heap = []
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;num &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;in &lt;&#x2F;span&gt;&lt;span&gt;arr:
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# do some logic to push onto heap according to problem&amp;#39;s criteria
&lt;&#x2F;span&gt;&lt;span&gt;        heapq.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;heappush&lt;&#x2F;span&gt;&lt;span&gt;(heap, (&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;CRITERIA&lt;&#x2F;span&gt;&lt;span&gt;, num))
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;(heap) &amp;gt; k:
&lt;&#x2F;span&gt;&lt;span&gt;            heapq.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;heappop&lt;&#x2F;span&gt;&lt;span&gt;(heap)
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;[num &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;num &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;in &lt;&#x2F;span&gt;&lt;span&gt;heap]
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;backtracking&quot;&gt;Backtracking&lt;&#x2F;h2&gt;
&lt;p&gt;The time complexity of backtracking is determined by:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;The size of the decision tree: This depends on the number of choices at each step and the depth of recursion.&lt;&#x2F;li&gt;
&lt;li&gt;Work done at each node: Any additional operations performed at each recursive call.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Common Scenarios:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Subset Generation&lt;&#x2F;strong&gt;: If there are n elements, each element can either be included or excluded, leading to 2^n subsets. The time complexity is O(2^n) for generating subsets. If additional work like copying subsets is done, it becomes O(n⋅2^n).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Permutations&lt;&#x2F;strong&gt;: Generating permutations involves n! recursive calls since there are n! permutations of a set. The time complexity is O(n!).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Sudoku Solver or N-Queens&lt;&#x2F;strong&gt;: These problems depend on constraints and branching factors. In the worst case, they often have exponential time complexity, such as O(k^n), where k is the number of choices per step and n is the depth of recursion.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Problem Type&lt;&#x2F;th&gt;&lt;th&gt;Time Complexity&lt;&#x2F;th&gt;&lt;th&gt;Space Complexity&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Subset Generation&lt;&#x2F;td&gt;&lt;td&gt;O(2^n) or O(n·2^n)&lt;&#x2F;td&gt;&lt;td&gt;O(n·2^n) (if storing results)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Permutations&lt;&#x2F;td&gt;&lt;td&gt;O(n!)&lt;&#x2F;td&gt;&lt;td&gt;O(n·n!) (if storing results)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Sudoku&#x2F;N-Queens&lt;&#x2F;td&gt;&lt;td&gt;Exponential (k^n)&lt;&#x2F;td&gt;&lt;td&gt;O(n)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;backtrack&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;curr&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;OTHER_ARGUMENTS&lt;&#x2F;span&gt;&lt;span&gt;...):
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;BASE_CASE&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# modify the answer
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    ans = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;ITERATE_OVER_INPUT&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# modify the current state
&lt;&#x2F;span&gt;&lt;span&gt;        ans += &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;backtrack&lt;&#x2F;span&gt;&lt;span&gt;(curr, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;OTHER_ARGUMENTS&lt;&#x2F;span&gt;&lt;span&gt;...)
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# undo the modification of the current state
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;ans
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;dp-top-down-memoization&quot;&gt;DP: Top-down memoization&lt;&#x2F;h2&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Problem Area&lt;&#x2F;th&gt;&lt;th&gt;Specific Problem&lt;&#x2F;th&gt;&lt;th&gt;Time Complexity&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Sequence Problems&lt;&#x2F;td&gt;&lt;td&gt;Longest Common Subsequence (LCS)&lt;&#x2F;td&gt;&lt;td&gt;O(mn)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;Longest Increasing Subsequence (LIS)&lt;&#x2F;td&gt;&lt;td&gt;O(n^2) or O(n log n)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;String Problems&lt;&#x2F;td&gt;&lt;td&gt;String Matching (e.g., Regex)&lt;&#x2F;td&gt;&lt;td&gt;O(mn)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;Edit Distance&lt;&#x2F;td&gt;&lt;td&gt;O(mn)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Optimization Problems&lt;&#x2F;td&gt;&lt;td&gt;Knapsack Problem&lt;&#x2F;td&gt;&lt;td&gt;O(nW)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;Rod Cutting&lt;&#x2F;td&gt;&lt;td&gt;O(n^2)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Matrix Chain Multiplication&lt;&#x2F;td&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;O(n^3)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Graph Problems&lt;&#x2F;td&gt;&lt;td&gt;Shortest Path (Floyd-Warshall)&lt;&#x2F;td&gt;&lt;td&gt;O(V^3)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;Traveling Salesman Problem (TSP)&lt;&#x2F;td&gt;&lt;td&gt;O(n^2 * 2^n)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Numeric Problems&lt;&#x2F;td&gt;&lt;td&gt;Fibonacci Sequence&lt;&#x2F;td&gt;&lt;td&gt;O(n)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;Catalan Numbers&lt;&#x2F;td&gt;&lt;td&gt;O(n^2) or O(n)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Interval Problems&lt;&#x2F;td&gt;&lt;td&gt;Weighted Interval Scheduling&lt;&#x2F;td&gt;&lt;td&gt;O(n log n)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Partition Problems&lt;&#x2F;td&gt;&lt;td&gt;Matrix Chain Multiplication&lt;&#x2F;td&gt;&lt;td&gt;O(n^3)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;Optimal Binary Search Tree&lt;&#x2F;td&gt;&lt;td&gt;O(n^3)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;Note:
n, m: typically represent input sizes or lengths
W: represents capacity in Knapsack problem
V: represents number of vertices in graph problems&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;arr&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;dp&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;STATE&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;BASE_CASE&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;STATE &lt;&#x2F;span&gt;&lt;span&gt;in memo:
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;memo[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;STATE&lt;&#x2F;span&gt;&lt;span&gt;]
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        ans = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;RECURRENCE_RELATION&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;STATE&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;        memo[&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;STATE&lt;&#x2F;span&gt;&lt;span&gt;] = ans
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;ans
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    memo = {}
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;dp&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;STATE_FOR_WHOLE_INPUT&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;trie&quot;&gt;Trie&lt;&#x2F;h2&gt;
&lt;p&gt;Insertion: O(n), where n is the length of the string being inserted.
Deletion: O(n), where n is the length of the string being deleted.
Search: O(n) in the average and worst case, where n is the length of the string being searched. In the best case, it can be O(1)&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;class &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;TrieNode&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;__init__&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# you can store data at nodes if you wish
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.data = None
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.children = {}
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;words&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;    root = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;TrieNode&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;word &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;in &lt;&#x2F;span&gt;&lt;span&gt;words:
&lt;&#x2F;span&gt;&lt;span&gt;        node = root
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;c &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;in &lt;&#x2F;span&gt;&lt;span&gt;word:
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;c not in node.children:
&lt;&#x2F;span&gt;&lt;span&gt;                node.children[c] = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;TrieNode&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# Update, keep going down the chain.
&lt;&#x2F;span&gt;&lt;span&gt;            node = node.children[c]
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# at this point, you have a full word at curr
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# you can perform more logic here to give curr an attribute if you want
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;root
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;graph&quot;&gt;Graph&lt;&#x2F;h2&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Problem Type&lt;&#x2F;th&gt;&lt;th&gt;Time Complexity&lt;&#x2F;th&gt;&lt;th&gt;Space Complexity&lt;&#x2F;th&gt;&lt;th&gt;Notes&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;BFS (Breadth-First Search)&lt;&#x2F;td&gt;&lt;td&gt;O(V + E)&lt;&#x2F;td&gt;&lt;td&gt;O(V)&lt;&#x2F;td&gt;&lt;td&gt;V: vertices, E: edges&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;DFS (Depth-First Search)&lt;&#x2F;td&gt;&lt;td&gt;O(V + E)&lt;&#x2F;td&gt;&lt;td&gt;O(V)&lt;&#x2F;td&gt;&lt;td&gt;V: vertices, E: edges&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Dijkstra&#x27;s Algorithm&lt;&#x2F;td&gt;&lt;td&gt;O((V + E) log V)&lt;&#x2F;td&gt;&lt;td&gt;O(V)&lt;&#x2F;td&gt;&lt;td&gt;With binary heap&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Bellman-Ford Algorithm&lt;&#x2F;td&gt;&lt;td&gt;O(VE)&lt;&#x2F;td&gt;&lt;td&gt;O(V)&lt;&#x2F;td&gt;&lt;td&gt;Detects negative cycles&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Floyd-Warshall Algorithm&lt;&#x2F;td&gt;&lt;td&gt;O(V^3)&lt;&#x2F;td&gt;&lt;td&gt;O(V^2)&lt;&#x2F;td&gt;&lt;td&gt;All-pairs shortest path&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Prim&#x27;s Algorithm&lt;&#x2F;td&gt;&lt;td&gt;O((V + E) log V)&lt;&#x2F;td&gt;&lt;td&gt;O(V)&lt;&#x2F;td&gt;&lt;td&gt;Minimum Spanning Tree&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Kruskal&#x27;s Algorithm&lt;&#x2F;td&gt;&lt;td&gt;O(E log E) or O(E log V)&lt;&#x2F;td&gt;&lt;td&gt;O(V)&lt;&#x2F;td&gt;&lt;td&gt;Minimum Spanning Tree&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Topological Sort&lt;&#x2F;td&gt;&lt;td&gt;O(V + E)&lt;&#x2F;td&gt;&lt;td&gt;O(V)&lt;&#x2F;td&gt;&lt;td&gt;For Directed Acyclic Graphs (DAG)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Union Find&lt;&#x2F;td&gt;&lt;td&gt;O(α(n)) ≈ O(1)&lt;&#x2F;td&gt;&lt;td&gt;O(V)&lt;&#x2F;td&gt;&lt;td&gt;α(n) is the inverse Ackermann function&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Strongly Connected Components&lt;&#x2F;td&gt;&lt;td&gt;O(V + E)&lt;&#x2F;td&gt;&lt;td&gt;O(V)&lt;&#x2F;td&gt;&lt;td&gt;Kosaraju&#x27;s or Tarjan&#x27;s algorithm&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Bipartite Graph Check&lt;&#x2F;td&gt;&lt;td&gt;O(V + E)&lt;&#x2F;td&gt;&lt;td&gt;O(V)&lt;&#x2F;td&gt;&lt;td&gt;Using BFS or DFS&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Cycle Detection&lt;&#x2F;td&gt;&lt;td&gt;O(V + E)&lt;&#x2F;td&gt;&lt;td&gt;O(V)&lt;&#x2F;td&gt;&lt;td&gt;Using DFS&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Articulation Points&lt;&#x2F;td&gt;&lt;td&gt;O(V + E)&lt;&#x2F;td&gt;&lt;td&gt;O(V)&lt;&#x2F;td&gt;&lt;td&gt;Using DFS&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Bridges in Graph&lt;&#x2F;td&gt;&lt;td&gt;O(V + E)&lt;&#x2F;td&gt;&lt;td&gt;O(V)&lt;&#x2F;td&gt;&lt;td&gt;Using DFS&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Maximum Flow (Ford-Fulkerson)&lt;&#x2F;td&gt;&lt;td&gt;O(EF)&lt;&#x2F;td&gt;&lt;td&gt;O(V^2)&lt;&#x2F;td&gt;&lt;td&gt;F is the maximum flow value&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Maximum Flow (Edmonds-Karp)&lt;&#x2F;td&gt;&lt;td&gt;O(VE^2)&lt;&#x2F;td&gt;&lt;td&gt;O(V^2)&lt;&#x2F;td&gt;&lt;td&gt;Improvement over Ford-Fulkerson&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Traveling Salesman Problem&lt;&#x2F;td&gt;&lt;td&gt;O(n^2 * 2^n)&lt;&#x2F;td&gt;&lt;td&gt;O(n * 2^n)&lt;&#x2F;td&gt;&lt;td&gt;Using dynamic programming, n is number of cities&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;Dijkstra&#x27;s algorithm&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;math &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;inf
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;heapq &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;*
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;distances = [inf] * n
&lt;&#x2F;span&gt;&lt;span&gt;distances[source] = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0
&lt;&#x2F;span&gt;&lt;span&gt;heap = [(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;, source)]
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;while &lt;&#x2F;span&gt;&lt;span&gt;heap:
&lt;&#x2F;span&gt;&lt;span&gt;    curr_dist, node = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;heappop&lt;&#x2F;span&gt;&lt;span&gt;(heap)
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;curr_dist &amp;gt; distances[node]:
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;continue
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;nei, weight &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;in &lt;&#x2F;span&gt;&lt;span&gt;graph[node]:
&lt;&#x2F;span&gt;&lt;span&gt;        dist = curr_dist + weight
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;dist &amp;lt; distances[nei]:
&lt;&#x2F;span&gt;&lt;span&gt;            distances[nei] = dist
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;heappush&lt;&#x2F;span&gt;&lt;span&gt;(heap, (dist, nei))
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;example-network-time-delay&quot;&gt;Example: Network time delay.&lt;&#x2F;h3&gt;
&lt;p&gt;A network of $n$ nodes labeled 1 to $n$ is provided along with a list of travel times for directed edges represented as
$times[i] = (x_i, y_i, t_i)$, where $x_i$ is the source node, $y_i$ is the target node, and $t_i$ is the delay time from the source node to the target node.&lt;&#x2F;p&gt;
&lt;p&gt;Considering we have a starting node, $k$, we have to determine the minimum time required for all the remaining $n - 1$ nodes to receive the signal. Return $-1$ if it&#x27;s not possible for all $n - 1$ nodes to receive the signal.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;queue &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;PriorityQueue
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;collections &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;defaultdict
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;network_delay_time&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;times&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;n&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;k&lt;&#x2F;span&gt;&lt;span&gt;):
&lt;&#x2F;span&gt;&lt;span&gt;    adjacency = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;defaultdict&lt;&#x2F;span&gt;&lt;span&gt;(list)
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;src, dst, t &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;in &lt;&#x2F;span&gt;&lt;span&gt;times:
&lt;&#x2F;span&gt;&lt;span&gt;        adjacency[src].&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;append&lt;&#x2F;span&gt;&lt;span&gt;((dst, t))
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    pq = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;PriorityQueue&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;    pq.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;put&lt;&#x2F;span&gt;&lt;span&gt;((&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;, k))
&lt;&#x2F;span&gt;&lt;span&gt;    visited = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;    delays = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;while &lt;&#x2F;span&gt;&lt;span&gt;not pq.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;empty&lt;&#x2F;span&gt;&lt;span&gt;():
&lt;&#x2F;span&gt;&lt;span&gt;        time, node = pq.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;get&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;node in visited:
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;continue
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        visited.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;add&lt;&#x2F;span&gt;&lt;span&gt;(node)
&lt;&#x2F;span&gt;&lt;span&gt;        delays = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;max&lt;&#x2F;span&gt;&lt;span&gt;(delays, time)
&lt;&#x2F;span&gt;&lt;span&gt;        neighbours = adjacency[node]
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;neighbour &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;in &lt;&#x2F;span&gt;&lt;span&gt;neighbours:
&lt;&#x2F;span&gt;&lt;span&gt;            neighbour_node, neighbour_time = neighbour
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;neighbour_node not in visited:
&lt;&#x2F;span&gt;&lt;span&gt;                new_time =  time + neighbour_time
&lt;&#x2F;span&gt;&lt;span&gt;                pq.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;put&lt;&#x2F;span&gt;&lt;span&gt;((new_time, neighbour_node))
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;(visited) == n:
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;delays
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;1
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;example-prim-s-alg-for-minimum-spanning-tree&quot;&gt;Example: Prim&#x27;s Alg for Minimum Spanning Tree&lt;&#x2F;h3&gt;
&lt;p&gt;There are n cities labeled from 1 to n. You are given the integer n and an array connections where connections[i] = [xi, yi, costi] indicates that the cost of connecting city xi and city yi (bidirectional connection) is costi.&lt;&#x2F;p&gt;
&lt;p&gt;Return the minimum cost to connect all the n cities such that there is at least one path between each pair of cities. If it is impossible to connect all the n cities, return -1,&lt;&#x2F;p&gt;
&lt;p&gt;The cost is the sum of the connections&#x27; costs used.&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;minimumCost&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;n&lt;&#x2F;span&gt;&lt;span&gt;: int, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;connections&lt;&#x2F;span&gt;&lt;span&gt;: list[list[int]]) -&amp;gt; int:
&lt;&#x2F;span&gt;&lt;span&gt;    adj = {}
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;x, y, cost &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;in &lt;&#x2F;span&gt;&lt;span&gt;connections:
&lt;&#x2F;span&gt;&lt;span&gt;        adj[x] = adj.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;get&lt;&#x2F;span&gt;&lt;span&gt;(x, []) + [(y, cost)]
&lt;&#x2F;span&gt;&lt;span&gt;        adj[y] = adj.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;get&lt;&#x2F;span&gt;&lt;span&gt;(y, []) + [(x, cost)]
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    heap = [(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;)]
&lt;&#x2F;span&gt;&lt;span&gt;    heapq.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;heapify&lt;&#x2F;span&gt;&lt;span&gt;(heap)
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    visited = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;    min_cost = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;while &lt;&#x2F;span&gt;&lt;span&gt;heap:
&lt;&#x2F;span&gt;&lt;span&gt;        cost, node = heapq.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;heappop&lt;&#x2F;span&gt;&lt;span&gt;(heap)
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;node in visited:
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;continue
&lt;&#x2F;span&gt;&lt;span&gt;        visited.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;add&lt;&#x2F;span&gt;&lt;span&gt;(node)
&lt;&#x2F;span&gt;&lt;span&gt;        min_cost += cost
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;neighbor, cost &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;in &lt;&#x2F;span&gt;&lt;span&gt;adj[node]:
&lt;&#x2F;span&gt;&lt;span&gt;            heapq.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;heappush&lt;&#x2F;span&gt;&lt;span&gt;(heap, (cost, neighbor))
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# assert
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;min_cost &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;(visited) == n &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;else &lt;&#x2F;span&gt;&lt;span&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;1
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;topological-sort&quot;&gt;Topological Sort&lt;&#x2F;h2&gt;
&lt;p&gt;The &lt;strong&gt;topological sort&lt;&#x2F;strong&gt; pattern is used to find valid orderings of elements that have dependencies on or priority over each other. These elements can be represented as the nodes of a graph, so in technical terms, topological sort is a way of ordering the nodes of a directed graph such that for every directed edge $[a, b]$ from node $a$ to node $b$, $a$ comes before $b$ in the ordering.&lt;&#x2F;p&gt;
&lt;p&gt;Topological sort is only applicable to DAGs, meaning there&#x27;s no cycle present in the graph.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;compilation-order-in-a-process&quot;&gt;Compilation order in a process&lt;&#x2F;h3&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;graph &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;*
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;from &lt;&#x2F;span&gt;&lt;span&gt;collections &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;import &lt;&#x2F;span&gt;&lt;span&gt;deque
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;find_compilation_order&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;dependencies&lt;&#x2F;span&gt;&lt;span&gt;: list[str]):
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# Replace this placeholder return statement with your code
&lt;&#x2F;span&gt;&lt;span&gt;  g = {}
&lt;&#x2F;span&gt;&lt;span&gt;  indegrees = {}
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;child, parent &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;in &lt;&#x2F;span&gt;&lt;span&gt;dependencies:
&lt;&#x2F;span&gt;&lt;span&gt;    g[parent] = g.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;get&lt;&#x2F;span&gt;&lt;span&gt;(parent, []) + [child]
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;child not in g:
&lt;&#x2F;span&gt;&lt;span&gt;      g[child] = []
&lt;&#x2F;span&gt;&lt;span&gt;    indegrees[child] = indegrees.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;get&lt;&#x2F;span&gt;&lt;span&gt;(child, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;) + &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;1
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;parent not in indegrees:
&lt;&#x2F;span&gt;&lt;span&gt;      indegrees[parent] = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;(g) &amp;lt;= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;[]
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;  sources = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;deque&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;node, indegree &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;in &lt;&#x2F;span&gt;&lt;span&gt;indegrees.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;items&lt;&#x2F;span&gt;&lt;span&gt;():
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;not indegree:
&lt;&#x2F;span&gt;&lt;span&gt;      sources.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;append&lt;&#x2F;span&gt;&lt;span&gt;(node)
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;  sorted_list = []
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;while &lt;&#x2F;span&gt;&lt;span&gt;sources:
&lt;&#x2F;span&gt;&lt;span&gt;    node = sources.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;popleft&lt;&#x2F;span&gt;&lt;span&gt;()
&lt;&#x2F;span&gt;&lt;span&gt;    sorted_list.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;append&lt;&#x2F;span&gt;&lt;span&gt;(node)
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;for &lt;&#x2F;span&gt;&lt;span&gt;child &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;in &lt;&#x2F;span&gt;&lt;span&gt;g[node]:
&lt;&#x2F;span&gt;&lt;span&gt;      indegrees[child] -= &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;1
&lt;&#x2F;span&gt;&lt;span&gt;      &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;indegrees[child] == &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;        sources.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;append&lt;&#x2F;span&gt;&lt;span&gt;(child)
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;sorted_list
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;linked-list&quot;&gt;Linked List&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;swapping-every-pair-of-nodes&quot;&gt;Swapping every pair of nodes&lt;&#x2F;h3&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;class &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;Solution&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;swapPairs&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;head&lt;&#x2F;span&gt;&lt;span&gt;: Optional[ListNode]) -&amp;gt; Optional[ListNode]:
&lt;&#x2F;span&gt;&lt;span&gt;        dummy = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;ListNode&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;)
&lt;&#x2F;span&gt;&lt;span&gt;        dummy.next = head
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;        prev_node = dummy
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;while &lt;&#x2F;span&gt;&lt;span&gt;head and head.next:
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;            first_node = head
&lt;&#x2F;span&gt;&lt;span&gt;            second_node = head.next
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;            prev_node.next = second_node
&lt;&#x2F;span&gt;&lt;span&gt;            first_node.next = second_node.next
&lt;&#x2F;span&gt;&lt;span&gt;            second_node.next = first_node
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;            prev_node = first_node
&lt;&#x2F;span&gt;&lt;span&gt;            head = first_node.next
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;dummy.next
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;check-if-linked-list-is-a-palindrome&quot;&gt;Check if linked list is a palindrome&lt;&#x2F;h3&gt;
&lt;pre data-lang=&quot;python&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-python &quot;&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;class &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;Solution&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;reverse&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;head&lt;&#x2F;span&gt;&lt;span&gt;: ListNode) -&amp;gt; ListNode:
&lt;&#x2F;span&gt;&lt;span&gt;        prev = None
&lt;&#x2F;span&gt;&lt;span&gt;        curr = head
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;while &lt;&#x2F;span&gt;&lt;span&gt;curr:
&lt;&#x2F;span&gt;&lt;span&gt;            next_temp = curr.next
&lt;&#x2F;span&gt;&lt;span&gt;            curr.next = prev
&lt;&#x2F;span&gt;&lt;span&gt;            prev = curr
&lt;&#x2F;span&gt;&lt;span&gt;            curr = next_temp
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;prev
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;def &lt;&#x2F;span&gt;&lt;span style=&quot;color:#fad07a;&quot;&gt;isPalindrome&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;head&lt;&#x2F;span&gt;&lt;span&gt;: Optional[ListNode]) -&amp;gt; bool:
&lt;&#x2F;span&gt;&lt;span&gt;        slow = head
&lt;&#x2F;span&gt;&lt;span&gt;        fast = head
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;while &lt;&#x2F;span&gt;&lt;span&gt;fast and fast.next:
&lt;&#x2F;span&gt;&lt;span&gt;            slow = slow.next
&lt;&#x2F;span&gt;&lt;span&gt;            fast = fast.next.next
&lt;&#x2F;span&gt;&lt;span&gt;        rev = &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;reverse&lt;&#x2F;span&gt;&lt;span&gt;(slow)
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;while &lt;&#x2F;span&gt;&lt;span&gt;rev:
&lt;&#x2F;span&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;if &lt;&#x2F;span&gt;&lt;span&gt;head.val != rev.val:
&lt;&#x2F;span&gt;&lt;span&gt;                &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;False
&lt;&#x2F;span&gt;&lt;span&gt;            head = head.next
&lt;&#x2F;span&gt;&lt;span&gt;            rev = rev.next
&lt;&#x2F;span&gt;&lt;span&gt;        &lt;&#x2F;span&gt;&lt;span style=&quot;color:#8fbfdc;&quot;&gt;return &lt;&#x2F;span&gt;&lt;span&gt;True
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Book Notes: Designing Data Intensive Applications</title>
        <published>2022-04-22T00:00:00+00:00</published>
        <updated>2022-04-22T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/ddia-notes/"/>
        <id>https://asun9.com/notes/ddia-notes/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/ddia-notes/">&lt;h1 id=&quot;chapter-1-foundations&quot;&gt;Chapter 1: Foundations&lt;&#x2F;h1&gt;
&lt;p&gt;Scalability, Reliability and Maintainability&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Reliability: continuing to work correctly, even when things go wrong.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Things that go really wrong: faults.&lt;&#x2F;li&gt;
&lt;li&gt;Hardware and software faults. Hardware faults are more common than you think. Hard disks have a mean time to failure of 10 to 50 years. On a storage cluster with 10k disks, we should expect on average one disk to die per day.&lt;&#x2F;li&gt;
&lt;li&gt;One solution: redundancy.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Scalability: Ability of a system to cope with increased load.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Load can be described by load parameters: requests per second to a web server, ratio of reads to writes in a database, hit rate on cache, etc.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;An architecture that is appropriate for one level of load is unlikely to cope with 10 times that load. &lt;strong&gt;If you are working on a fast-growing service, it is therefore likely that you will need to rethink your architecture on every order of magnitude load increase — or perhaps even more often than that.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;An architecture that scales well for a particular application is built around assumptions of which operations will be common and which will be rare — the load parameters. If those assumptions turn out to be wrong, the engineering effort for scaling is at best wasted, and at worst counterproductive.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Maintainability: Operability, Simplicity, Evolvability&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Making life easy for operations: track down problems faster, monitor health of system, establishing good practices.&lt;&#x2F;li&gt;
&lt;li&gt;Simplicity: managing complexity.&lt;&#x2F;li&gt;
&lt;li&gt;Evolvability: making change easy.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;chapter-2-data-models-and-query-languages&quot;&gt;Chapter 2: Data Models and Query Languages&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;Most applications are built by layering one data model on top of another. For each layer, the key question is: how is it represented in terms of the next-lower layer?&lt;&#x2F;li&gt;
&lt;li&gt;Some commonly used data models are examined: relational , document and graph models. Also examine how storage engines work.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;relational-versus-document-model&quot;&gt;Relational Versus Document Model&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Famous example: SQL as data model (for relational model examples)&lt;&#x2F;li&gt;
&lt;li&gt;The goal of relational model is to hide implementation detail behind a cleaner interface.&lt;&#x2F;li&gt;
&lt;li&gt;NoSQL in the last decade has challenged relational model&#x27;s dominance:
&lt;ul&gt;
&lt;li&gt;Supports very large datasets and high write throughputs.&lt;&#x2F;li&gt;
&lt;li&gt;Mostly free and open source&lt;&#x2F;li&gt;
&lt;li&gt;Specialized query operation.&lt;&#x2F;li&gt;
&lt;li&gt;Less restrictive then relational schemas.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;When it comes to representing many-to-one and many-to-many relationships, relational and document model are not very different: the related item is referenced by an unique identifier in both the cases, called &lt;em&gt;foreign key&lt;&#x2F;em&gt; in relational model, &lt;em&gt;document reference&lt;&#x2F;em&gt; in document model.&lt;&#x2F;li&gt;
&lt;li&gt;Why document data model? Schema flexibility, closer representation to the data structures used by application.&lt;&#x2F;li&gt;
&lt;li&gt;Why relational models? Better joins and many-to-one and many-to-many relationships.&lt;&#x2F;li&gt;
&lt;li&gt;Document vs Relational: schema on read versus schema on write.
&lt;ul&gt;
&lt;li&gt;schema on read: application code handles cases on backward compatibility (for example) or any schema changes.&lt;&#x2F;li&gt;
&lt;li&gt;schema on write: needs a migration for old data if new data requires schema change. Schema changes can be slow and require downtime. Running an &lt;em&gt;UPDATE&lt;&#x2F;em&gt; statement on a large table can be slow.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;If your application uses many-to-many relationships, the document model becomes less appealing. For highly interconnected data, document model is awkward, relational model is acceptable, graph models are most natural.&lt;&#x2F;li&gt;
&lt;li&gt;Data locality for queries: if you want to access large parts of the document at the same time, there&#x27;s performance advantage in storage locality. If data is split across multiple tables, multiple index lookups are required to relieve it all.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;purpose-of-ids&quot;&gt;Purpose of IDs&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;It has no meaning to humans: it needn&#x27;t ever change. Can always be the same, even if the information it identifies changes.&lt;&#x2F;li&gt;
&lt;li&gt;Anything meaningful to humans need to change in the future. This will incur write overheads etc.&lt;&#x2F;li&gt;
&lt;li&gt;Removing duplication is the idea behind normalization.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;query-languages-for-data&quot;&gt;Query languages for data&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;SQL is a declarative query language.
&lt;ul&gt;
&lt;li&gt;In declarative query language, you specify the pattern of data you want, what conditions the results should meet, how the data should be transformed, but not how to achieve that goal.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;IMS&#x2F;CODASYL uses imperative code.
&lt;ul&gt;
&lt;li&gt;Imperative language tells the computer to perform certain operations in a certain order. Ex: for loop, updating variables, evaluating conditions within the loop etc.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;A declarative language hides implementation details of the database engine, which allows one to make performance improvements without requiring any changes to the queries.&lt;&#x2F;li&gt;
&lt;li&gt;Imperative code is hard to parallelize across multiple cores. For declarative query languages, the database is free to use a parallel implementation of the query language.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;mapreduce&quot;&gt;MapReduce&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Programming model for processing large amounts of data in bulk across many machines.&lt;&#x2F;li&gt;
&lt;li&gt;In between fully declarative and fully imperative: logic of the query is expressed in snippets of code, which are called repeatedly by the processing framework.&lt;&#x2F;li&gt;
&lt;li&gt;MapReduce is low-level programming model for distributed execution on a cluster of machines. SQL can be implemented as a pipeline of MapReduce operations (but that&#x27;s optional - there are implementations of SQL that don&#x27;t use MapReduce).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;chapter-3-storage-and-retrieval&quot;&gt;Chapter 3: Storage and Retrieval&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;How can we store the data we are given, and how can we find it again when we are asked for it?&lt;&#x2F;li&gt;
&lt;li&gt;There&#x27;s a difference between storage engines optimized for &lt;strong&gt;transactional workloads&lt;&#x2F;strong&gt; and those that are optimized for &lt;strong&gt;analytics&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Two most common families of storage engines: log-structured and page-oriented.&lt;&#x2F;li&gt;
&lt;li&gt;An &lt;strong&gt;index&lt;&#x2F;strong&gt; is an additional data structure derived from primary data. The choice of the index determines the performance of the queries. Most DBs allow one to add or remove indexes.&lt;&#x2F;li&gt;
&lt;li&gt;Hash tables for indexing, or  SSTables, LSM-Trees.&lt;&#x2F;li&gt;
&lt;li&gt;The most widely used indexing structure is the B-Tree.
&lt;ul&gt;
&lt;li&gt;Standard index implementation in almost all relational databases, and many nonrelational databases.&lt;&#x2F;li&gt;
&lt;li&gt;B-Trees keep key-value pairs sorted by keys, which allows efficient key-value lookups and range queries.&lt;&#x2F;li&gt;
&lt;li&gt;B-trees break the database down into fixed-size blocks or pages, traditionally 4 KB in size (sometimes bigger), and read or write one page at a time. This design corresponds more closely to the underlying hardware, as disks are also arranged in fixed-size blocks.&lt;&#x2F;li&gt;
&lt;li&gt;Each page can be identified using an address or location, which allows one page to refer to another—similar to a pointer, but on disk instead of in memory.&lt;&#x2F;li&gt;
&lt;li&gt;The basic underlying write operation of a B-tree is to overwrite a page on disk with new data. It is assumed that the overwrite does not change the location of the page; i.e., all references to that page remain intact when the page is overwritten.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;A secondary index can easily be constructed from a key-value index. The main difference is that in a secondary index, the indexed values are not necessarily unique; that is, there might be many rows (documents, vertices) under the same index entry. This can be solved in two ways: either by making each value in the index a list of matching row identifiers (like a postings list in a full-text index) or by making each entry unique by appending a row identifier to it. Either way, both B-trees and log-structured indexes can be used as secondary indexes.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;transaction-processing-or-analytics&quot;&gt;Transaction Processing or Analytics?&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Typically two kinds of applications use databases.
&lt;ul&gt;
&lt;li&gt;Online transaction processing: look up small number of records by some key, using an index. Insert or update record based on user&#x27;s input. These are expected to be highly available.&lt;&#x2F;li&gt;
&lt;li&gt;data analytics: scan over a huge number of records, reading only a few columns per record, calculate aggregate statistics.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;A data warehouse is a separate database that analysts can query to their hearts’ content, without affecting OLTP operations. The data warehouse contains a read-only copy of the data in all the various OLTP systems in the company.
&lt;ul&gt;
&lt;li&gt;A big advantage of using a separate data warehouse, rather than querying OLTP systems directly for analytics, is that the data warehouse can be optimized for analytic access patterns.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;The internals of a data warehouse and oltp database are very different, though both have a SQL interface. Most vendors now support one or the other, but not both. Exceptions are Microsoft SQL server and SAP HANA.&lt;&#x2F;li&gt;
&lt;li&gt;Commercial data warehouse vendors: Teradata, Vertica, SAP HANA, ParAccel. Amazon RedShift is hosted version of ParAccel.&lt;&#x2F;li&gt;
&lt;li&gt;Opensource data warehouse vendors: Apache Hive, Spark SQL, Cloudera Impala, Facebook Presto, Apache Tajo, Apache Drill.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;star-schema&quot;&gt;Star Schema&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;The most common data model used in a data warehouse is star schema.&lt;&#x2F;li&gt;
&lt;li&gt;A fact table is central to how data is organized. Every event gets recorded here.&lt;&#x2F;li&gt;
&lt;li&gt;Fact tables contain columns with foreign keys, references to other tables called dimension tables. The dimensions represent who, what, where, when, how and why of the event.&lt;&#x2F;li&gt;
&lt;li&gt;In a typical data warehouse, tables are often very wide: fact tables often have over 100 columns, sometimes several hundred. Dimension tables can also be very wide, as they include all the metadata that may be relevant for analysis—for example, the dim_store table may include details of which services are offered at each store, whether it has an in-store bakery, the square footage, the date when the store was first opened, when it was last remodeled, how far it is from the nearest highway, etc.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;column-oriented-storgage&quot;&gt;Column oriented storgage&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;In most OLTP databases, storage is laid out in a row-oriented fashion: all the values from one row of a table are stored next to each other. Document databases are similar: an entire document is typically stored as one contiguous sequence of bytes.
&lt;ul&gt;
&lt;li&gt;In order to process a query efficiently, you use an index to tell the storage engine where to find something, But then, a row-oriented storage engine still needs to load all of those rows (each consisting of over 100 attributes) from disk into memory, parse them, and filter out those that don’t meet the required conditions. That can take a long time.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;The idea behind column-oriented storage is simple: don’t store all the values from one row together, but store all the values from each column together instead. If each column is stored in a separate file, a query only needs to read and parse those columns that are used in that query, which can save a lot of work.
&lt;ul&gt;
&lt;li&gt;Column oriented storage lends itself to compression.&lt;&#x2F;li&gt;
&lt;li&gt;Besides reducing the volume of data that needs to be loaded from disk, column-oriented storage layouts are also good for making efficient use of CPU cycles, making use of vectorized processing.&lt;&#x2F;li&gt;
&lt;li&gt;In ready heavy data warehouse, materialized views are common (i.e store the results of some aggregate function, such as COUNT, SUM, AVG, MIN, MAX etc)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Example: Parquet is a columnar storage format that supports a document data model.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;chapter-4-encoding-and-evolution&quot;&gt;Chapter 4: Encoding and Evolution&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;Features are added or modified to applications over time. In relational databases, this takes the form of schema changes, with corresponding changes in application code.&lt;&#x2F;li&gt;
&lt;li&gt;Old and new versions of code exist with old and new data formats, potentially all at the same time. When we design systems, we need to keep in mind backward and forward compatibility.&lt;&#x2F;li&gt;
&lt;li&gt;Programs work with data in two representations: in-memory and on-disk.&lt;&#x2F;li&gt;
&lt;li&gt;The translation from the in-memory representation to a byte sequence is called encoding (also known as serialization or marshalling), and the reverse is called decoding (parsing, deserialization, unmarshalling).&lt;&#x2F;li&gt;
&lt;li&gt;Arguments against using Python&#x27;s pickle, Java&#x27;s serializable etc:
&lt;ul&gt;
&lt;li&gt;Reading in other languages is very difficult.&lt;&#x2F;li&gt;
&lt;li&gt;You are committing yourself to your current programming language for a long time.&lt;&#x2F;li&gt;
&lt;li&gt;The decoding process needs to instantiate arbitrary classes -&amp;gt; this is a source of security problems.&lt;&#x2F;li&gt;
&lt;li&gt;Usually no versioning, and bad efficiency (it&#x27;s optimized for speed)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;json-xml-binary-variants&quot;&gt;JSON, XML, Binary Variants&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;JSON is popular due it its built-in support in web browsers. But text formats have some problems:
&lt;ul&gt;
&lt;li&gt;Ambiguity around encoding: how do you differentiate between text and string? JSON doesn&#x27;t distinguish between integers and floating point numbers.&lt;&#x2F;li&gt;
&lt;li&gt;Don&#x27;t support binary strings. You can get around it by encoding binary data as text using Base64. This increases data size by 33%.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;You can choose a data format that is more compact or faster to parse, especially for small datasets. For larger datasets using the text formats can have a huge impact.&lt;&#x2F;li&gt;
&lt;li&gt;Binary encodings for JSON: MesagePack, BSON, BJSON, BISON etc.&lt;&#x2F;li&gt;
&lt;li&gt;Other binary encoding libraries: Apache Thrift, Protocol Buffers.
&lt;ul&gt;
&lt;li&gt;Better support for schema evolution.&lt;&#x2F;li&gt;
&lt;li&gt;Both come with field tags and field names (and data needs to be captured in a schema)&lt;&#x2F;li&gt;
&lt;li&gt;Field names can change, but not field tags. Each field is given a field tag.&lt;&#x2F;li&gt;
&lt;li&gt;As long as each field has a unique tag number, new code can always read old data, because the tag numbers still have the same meaning.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;avro&quot;&gt;Avro&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Another binary encoding format. Uses a schema to specify the structure of the data. .The schema can be specified in JSON or Avro IDL. There are no field tag numbers like in Thrift and Protocol Buffers.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;This means that the binary data can only be decoded correctly if the code reading the data is using the exact same schema as the code that wrote the data.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;When applications write data to Avro, they encode using whatever version of schema it knows about. Applications that decode use its own schema. Writers&#x27;s schema and readers schema. These two needn&#x27;t be the same, but they need to be compatible. Avro translates data from the writer&#x27;s schema into reader&#x27;s schema.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;To maintain compatibility, you can only add or remove a field that has a default value.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;If you were to add a field that has no default value, new readers wouldn’t be able to read data written by old writers, so you would break backward compatibility.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;If you were to remove a field that has no default value, old readers wouldn’t be able to read data written by new writers, so you would break forward compatibility.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Avro is friendlier to dynamically generated schemas.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;By contrast, if you were using Thrift or Protocol Buffers for this purpose, the field tags would likely have to be assigned by hand: every time the database schema changes, an administrator would have to manually update the mapping from database column names to field tags.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Having a schema is a valuable form of documentation.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;For users of statically typed programming languages, the ability to generate code from the schema is useful, since it enables type checking at compile time.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;dataflow&quot;&gt;Dataflow&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Data outlives code.&lt;&#x2F;strong&gt; Easy to deploy new version of application. But database contents remains in old encoding.&lt;&#x2F;li&gt;
&lt;li&gt;Rewriting (migrating) data into a new schema is certainly possible, but it’s an expensive thing to do on a large dataset, so most databases avoid it if possible.&lt;&#x2F;li&gt;
&lt;li&gt;There are two popular approaches to web services: REST and SOAP. They are almost diametrically opposed in terms of philosophy, and often the subject of heated debate among their respective proponents.&lt;&#x2F;li&gt;
&lt;li&gt;REST is a not a protocol, but a design philosophy. It emphasizes simple data formats, using URLs for identifying resources and using HTTP features for cache control, authentication, and content type negotiation.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;chapter-5-replication&quot;&gt;Chapter 5: Replication&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;Shared nothing architectures (horizontal scaling or scaling out): Each machine running the database software is called a node. Each node uses CPU, RAM, disks independently. Coordination between nodes is done at software level, using conventional network.&lt;&#x2F;li&gt;
&lt;li&gt;Data is distributed across multiple nodes in two ways:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Replication&lt;&#x2F;strong&gt;: Keeping the copy of the same data on several nodes, potentially at different locations.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Partitioning&lt;&#x2F;strong&gt;: Splitting a big database into smaller subsets called partitions, with each partition assigned to different nodes (also called as sharding).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;If data doesn&#x27;t change, replication is easy.&lt;&#x2F;li&gt;
&lt;li&gt;Most problems arise with handing changes in data. There are three popular algorithms for replicating changes between nodes: single-leader, multi-leader and leaderless replication&lt;&#x2F;li&gt;
&lt;li&gt;Every write to the database needs to be processed by every replica, otherwise the replicas would no longer contain the same data.&lt;&#x2F;li&gt;
&lt;li&gt;Leader based replication:
&lt;ul&gt;
&lt;li&gt;Writes are sent to a node marked as a leader. Other replicas are knows as followers (read replicas, slaves, secondaries, hot standbys). The leader sends data change to all its followers as part of a replication log or change stream.&lt;&#x2F;li&gt;
&lt;li&gt;A client can read from any of the replicas, writes are only accepted on the leader.&lt;&#x2F;li&gt;
&lt;li&gt;Built in feature of PostgresSQL, MySQL, MongoDB, RethinkDB, Espresso.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Changes can be relayed to the replicas synchronously or asynchronously.
&lt;ul&gt;
&lt;li&gt;Synchronous could be slow. If one of the followers crash, the whole system will grind to a halt. Advantage of synchronous replication is followers are guaranteed to have an up to date copy of the data that is consistent with the leader.
&lt;ul&gt;
&lt;li&gt;If the synchronous follower becomes unavailable or slow, one of the asynchronous followers is made synchronous. This guarantees that you have an up-to-date copy of the data on at least two nodes: the leader and one synchronous follower. This configuration is sometimes also called semi-synchronous&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Often replication is asynchronous. If the leader fails and is not recoverable, writes not yet been replicated to followers are lost.
&lt;ul&gt;
&lt;li&gt;Advantage of asynchronous replication is that the leader can continue processing writes even if followers have fallen behind.&lt;&#x2F;li&gt;
&lt;li&gt;if an application reads from an asynchronous follower, it may see outdated information if the follower has fallen behind. If you run the same query on the leader and a follower at the same time, you may get different results, because not all writes have been reflected in the follower. This inconsistency is just a temporary state—if you stop writing to the database and wait a while, the followers will eventually catch up and become consistent with the leader. For that reason, this effect is known as &lt;strong&gt;eventual consistency&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;implementation-of-replication-logs&quot;&gt;Implementation of Replication Logs&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;In the simplest case, the leader logs every write request (statement) that it executes and sends that statement log to its followers. For a relational database, this means that every INSERT, UPDATE, or DELETE statement is forwarded to followers, and each follower parses and executes that SQL statement as if it had been received from a client.
&lt;ul&gt;
&lt;li&gt;Many ways to breakdown. Example, a statement that calls a nondeterministic function, such as NOW() or RAND(). Or autoincrementing a column.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;We can use a replication log instead. The log is an append-only sequence of bytes containing all writes to the database. We can use the exact same log to build a replica on another node: besides writing the log to disk, the leader also sends it across the network to its followers. When the follower processes this log, it builds a copy of the exact same data structures as found on the leader.
&lt;ul&gt;
&lt;li&gt;Used in PostgresSQL and Oracle.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;leaderless-replication&quot;&gt;Leaderless Replication&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Relational databases use single leader or multi leader replication algorithms.&lt;&#x2F;li&gt;
&lt;li&gt;Amazon&#x27;s Dynamo uses a leader-less system. Riak, Cassandra, and Voldemort are open source datastores with leaderless replication models inspired by Dynamo, so this kind of database is also known as Dynamo-style.&lt;&#x2F;li&gt;
&lt;li&gt;In some leaderless implementations, the client directly sends its writes to several replicas, while in others, a coordinator node does this on behalf of the client. However, unlike a leader database, that coordinator does not enforce a particular ordering of writes.&lt;&#x2F;li&gt;
&lt;li&gt;Lots of details about the algorithm here. Quorum consistency, Strict and sloppy quorums etc. Details about Dynamo (which is different from DynamoDB - which is a single-leader replication system).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;chapter-6-partitioning&quot;&gt;Chapter 6: Partitioning&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;Called sharding in MongoDB, Elasticsearch, SolrCloud. Region in HBase, tablet in BigTable.&lt;&#x2F;li&gt;
&lt;li&gt;Each partition can be regarded as a small database if its own.&lt;&#x2F;li&gt;
&lt;li&gt;Main reason - scalability: query load can be distributed across many disks.&lt;&#x2F;li&gt;
&lt;li&gt;Partitioning can be combined with replication: copes of partition are stored on multiple nodes.&lt;&#x2F;li&gt;
&lt;li&gt;A partition with disproportionately high load is called a hotspot; happens when partitioning is skewed, where some partitions have more data or queries than others.
&lt;ul&gt;
&lt;li&gt;The simplest approach for avoiding hot spots would be to assign records to nodes randomly. That would distribute the data quite evenly across the nodes, but it has a big disadvantage: when you’re trying to read a particular item, you have no way of knowing which node it is on, so you have to query all nodes in parallel.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;partitioning-by-key-range&quot;&gt;Partitioning by key range&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;One way of partitioning is to assign a continuous range of keys (from some minimum to some maximum) to each partition, like the volumes of a paper encyclopedia. Knowing boundaries between ranges, you can easily determine which partition contains a given key.&lt;&#x2F;li&gt;
&lt;li&gt;Downside is hotspots, for example while writing. If using timestamps as keys, and time range for partitions, when writing sensor data all writes end up going to the same partition.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;partitioning-by-hash-of-key&quot;&gt;Partitioning by Hash of key&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;To avoid risks of skews and hotspots when using key range.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;A good hash function takes skewed data and makes it uniformly distributed. Say you have a 32-bit hash function that takes a string. Whenever you give it a new string, it returns a seemingly random number between 0 and 2^32 − 1. Even if the input strings are very similar, their hashes are evenly distributed across that range of numbers.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;MongoDB used MD5, Cassandra uses Murmer3&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Once you have a suitable hash function for keys, you can assign each partition a range of hashes (rather than a range of keys), and every key whose hash falls within a partition’s range will be stored in that partition.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Over time things change in a database, necessitating a rebalancing of partitions. Eg, dataset size increases, so you need to add more disks and RAM to store it, query throughput increases, machine fails.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;While rebalancing database should continue to accept reads and writes, no more data than necessary should be moved between nodes.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Some rebalancing strategies:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;create more partitions than there are nodes, assign several partitions to each node.&lt;&#x2F;li&gt;
&lt;li&gt;dynamic partitioning: split those partitions that grow beyond a configured size (on HBase, this is 10GB).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;chapter-7-transactions&quot;&gt;Chapter 7: Transactions&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;Lots of things can go wrong during the operation of data systems: software or hardware crashes, network interruptions, resource contention, race conditions.&lt;&#x2F;li&gt;
&lt;li&gt;One solution to simply the above issues: transactions&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Transaction: A way to group several reads and writes together into a logical unit.&lt;&#x2F;strong&gt;
&lt;ul&gt;
&lt;li&gt;Either the entire transaction succeeds (commits) or it fails (abort, rollback)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;The safety guarantees provided by transactions is described the acronym ACID: Atomicity, Consistency, Isolation, Durability.
&lt;ul&gt;
&lt;li&gt;Non -ACID systems, usually NoSQL databases, subscribe to BASE: Basically Available, Soft State, and Eventually Consistent.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;You want to retry an aborted transaction, but there are possible pitfalls to keep in mind when handling errors:
&lt;ul&gt;
&lt;li&gt;The transaction actually succeeded, but the network failed while the server tried to acknowledge the transaction. In this case, retrying could lead to data duplication (unless you have application level deduplication mechanism in place).&lt;&#x2F;li&gt;
&lt;li&gt;If the error is due to overload, you really don&#x27;t want to retry - will make things worse. Use rate limiting.&lt;&#x2F;li&gt;
&lt;li&gt;Retry only after transient errors (deadlock, isolation violation, network interruptions).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Most databases don&#x27;t provide serializable isolation: i.e a guarantee that transactions have the same effect as if they ran serially (no concurrency).
&lt;ul&gt;
&lt;li&gt;Because of performance costs associated with it.&lt;&#x2F;li&gt;
&lt;li&gt;Instead they provide weaker levels of isolation, which protect from some concurrency issues, but not all.&lt;&#x2F;li&gt;
&lt;li&gt;Serialization isolation is the strongest isolation level.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;read-committed&quot;&gt;Read Committed&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;The most basic level of transaction isolation. Makes two guarantees:
&lt;ul&gt;
&lt;li&gt;When reading from the database, you will only see data that has been committed (no dirty reads).&lt;&#x2F;li&gt;
&lt;li&gt;When writing to the database, you will only overwrite data that has been committed (no dirty writes).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;chapter-8-the-trouble-with-distributed-systems&quot;&gt;Chapter 8: The Trouble With Distributed Systems&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;Assume anything that can go wrong will go wrong.&lt;&#x2F;li&gt;
&lt;li&gt;An individual computer with good software is usually either fully functional or entirely broken, but not something in between.&lt;&#x2F;li&gt;
&lt;li&gt;In a distributed system, there may well be some parts of the system that are broken in some unpredictable way, even though other parts of the system are working fine. This is known as a partial failure.
&lt;ul&gt;
&lt;li&gt;The difficulty is that partial failures are nondeterministic: if you try to do anything involving multiple nodes and the network, it may sometimes work and sometimes unpredictably fail.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;For a distributed system, always accept that there&#x27;s a possibility of partial failure and build fault tolerance mechanisms into the software.&lt;&#x2F;li&gt;
&lt;li&gt;Old idea in computing: you can construct a reliable system from less reliable underlying base. Examples: Internet protocol, wireless networks function due to error correcting codes.&lt;&#x2F;li&gt;
&lt;li&gt;Even if network faults are rare in your environment, the fact that faults can occur means that your software needs to be able to handle them. Whenever any communication happens over a network, it may fail—there is no way around it.&lt;&#x2F;li&gt;
&lt;li&gt;A system is Byzantine fault-tolerant if it continues to operate correctly even if some of the nodes are malfunctioning and not obeying the protocol, or if malicious attackers are interfering with the network. Relevant in circumstances such as:
&lt;ul&gt;
&lt;li&gt;corruption of CPU registers due to radiation, in aerospace environments. Could be disastrous if flight control systems are not fault tolerant.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Most Byzantine fault-tolerant algorithms require a supermajority of more than two-thirds of the nodes to be functioning correctly (i.e., if you have four nodes, at most one may malfunction). To use this approach against bugs, you would have to have four independent implementations of the same software and hope that a bug only appears in one of the four implementations.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;chapter-9-consistency-and-consensus&quot;&gt;Chapter 9: Consistency and Consensus&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;Discusses some algorithms and protocols for building fault tolerant distributed systems.&lt;&#x2F;li&gt;
&lt;li&gt;The best way of building fault-tolerant systems is to find some general-purpose abstractions with useful guarantees, implement them once, and then let applications rely on those guarantees.
&lt;ul&gt;
&lt;li&gt;An example of such an abstraction is a transaction. By using a transaction, the application can pretend that there are no crashes (atomicity), that nobody else is concurrently accessing the database (isolation), and that storage devices are perfectly reliable (durability).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Another abstraction is &lt;strong&gt;consensus&lt;&#x2F;strong&gt;: getting all of the nodes to agree on something.&lt;&#x2F;li&gt;
&lt;li&gt;Consistency: if two database nodes are looked at the same time, they need to reflect the same data.
&lt;ul&gt;
&lt;li&gt;Most replicated databases are eventually consistent. Means there&#x27;s a delay. &quot;A better name could be convergence, all replicas should converge eventually to the same value.&quot;&lt;&#x2F;li&gt;
&lt;li&gt;You could build system with stronger guarantees on consistency; there could be trade offs - worse performance, less fault tolerance.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;linearizability&quot;&gt;Linearizability&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Also called atomic consistency, strong consistency, external consistency.
&lt;ul&gt;
&lt;li&gt;&quot;The basic idea is to make a system appear as if there were only one copy of the data, and all operations on it are atomic. With this guarantee, even though there may be multiple replicas in reality, the application does not need to worry about them.&quot;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Maintaining the illusion of a single copy of the data means guaranteeing that the value read is the most recent, up-to-date value, and doesn’t come from a stale cache or replica. In other words, linearizability is a recency guarantee.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;chapter-10-batch-processing&quot;&gt;Chapter 10: Batch Processing&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;MapReduce is a programming framework with which you can write code to process large datasets in a distributed filesystem like HDFS.&lt;&#x2F;li&gt;
&lt;li&gt;While Unix tools use stdin and stdout as input and output, MapReduce jobs read and write files on a &lt;strong&gt;distributed filesystem&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Hadoop&#x27;s implementation of MapReduce&#x27;s distributed file system is called HDFS (Hadoop distributed File System). There are others such as GlusterFS, Quantcast File System. Object storage services such as Amazon S3, Azure Blog Storage and OpenStack Swift are similar.&lt;&#x2F;li&gt;
&lt;li&gt;HDFS consists of a daemon process running on each machine, exposing a network service that allows other nodes to access files stored on that machine (assuming that every general-purpose machine in a datacenter has some disks attached to it).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;key-value-stores-as-batch-process-output&quot;&gt;Key-value stores as batch process output&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;The output of those batch jobs is often some kind of database: for example, a database that can be queried by user ID to obtain suggested friends for that user, or a database that can be queried by product ID to get a list of related products&lt;&#x2F;li&gt;
&lt;li&gt;These databases need to be queried from the web application that handles user requests, which is usually separate from the Hadoop infrastructure.&lt;&#x2F;li&gt;
&lt;li&gt;It is a bad idea to write one record at a time into a database via the client library:
&lt;ul&gt;
&lt;li&gt;making a network request for every single record is orders of magnitude slower than the normal throughput of a batch task.&lt;&#x2F;li&gt;
&lt;li&gt;MapReduce jobs often run many tasks in parallel. If all the mappers or reducers concurrently write to the same output database, with a rate expected of a batch process, that database can easily be overwhelmed, and its performance for queries is likely to suffer. This can in turn cause operational problems in other parts of the system&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;chapter-11-stream-processing&quot;&gt;Chapter 11: Stream Processing&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;A big  assumption with batch processes: input is bounded, i.e. of a known and finite size.
&lt;ul&gt;
&lt;li&gt;For example, the sorting operation that is central to MapReduce must read its entire input before it can start producing output: it could happen that the very last input record is the one with the lowest key, and thus needs to be the very first output record, so starting the output early is not an option.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Batch processes must artificially divide the data into chunks of fixed duration,. For example, processing a day&#x27;s worth of data at the end of the day, or processing an hour&#x27;s worth of data at the end of every hour.&lt;&#x2F;li&gt;
&lt;li&gt;Processing events continuously as it happens without delay is called stream processing.&lt;&#x2F;li&gt;
&lt;li&gt;In batch processing, a file is written once and then potentially read by multiple jobs. Analogously, in streaming terminology, an event is generated once by a producer (also known as a publisher or sender), and then potentially processed by multiple consumers (subscribers or recipients)&lt;&#x2F;li&gt;
&lt;li&gt;Polling a database for triggering events is suboptimal. You want to avoid overheads on the db server.
&lt;ul&gt;
&lt;li&gt;Instead use a messaging system: a producer sends a message containing the event , which is then pushed to consumers.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;A message broker or a message queue is a database that is optimized for handling message stream. It runs as a server, with producers and consumers connecting to it as clients.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;message-brokers-compared-to-databases&quot;&gt;Message brokers compared to databases&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Message brokers automatically delete a message when it has been successfully delivered. Databases keep data until it is explicitly deleted.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Databases offer various ways of searching through data, while brokers only support some way of subscribing to a subset of topics matching some common pattern.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;In order to ensure that the message is not lost, message brokers use acknowledgments: a client must explicitly tell the broker when it has finished processing a message so that the broker can remove it from the queue.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;chapter-12-the-future-of-data-systems&quot;&gt;Chapter 12: The Future of Data Systems&lt;&#x2F;h1&gt;
&lt;ul&gt;
&lt;li&gt;The author speculates that there are two avenues by which different storage and processing tools can be composed into a cohesive system:
&lt;ul&gt;
&lt;li&gt;Federated databases: unifying reads&lt;&#x2F;li&gt;
&lt;li&gt;Unbundled databases: unifying writes&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;You don&#x27;t want to build for scale and lock yourself into an inflexible design.&lt;&#x2F;li&gt;
&lt;li&gt;Lots of thoughts on data flow, managing state.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Use Collections in Jekyll to group content</title>
        <published>2022-04-21T00:00:00+00:00</published>
        <updated>2022-04-21T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/jekyll-collections/"/>
        <id>https://asun9.com/notes/jekyll-collections/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/jekyll-collections/">&lt;p&gt;To group related content on your jekyll site, use collections.&lt;&#x2F;p&gt;
&lt;p&gt;Add this to _config.yaml:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;yaml&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-yaml &quot;&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# Collections -&amp;gt; grouping your posts
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;collections&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#888888;&quot;&gt;# this is the name of the directory at root.
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;notes&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;output&lt;&#x2F;span&gt;&lt;span&gt;: True
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Create a directory called _notes and add your markdown files there with the usual front matter.&lt;&#x2F;p&gt;
&lt;p&gt;Create a html or markdown page in root to host your collections. Eg:
{% raw %}&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;html&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-html &quot;&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span&gt;{% for working_note in site.notes %}
&lt;&#x2F;span&gt;&lt;span&gt;  {%- assign date_format = site.minima.date_format | default: &amp;quot;%b %-d, %Y&amp;quot; -%}
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;div class&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;splitscreen&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;style&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;display:flex;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;      &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;h3 class&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;post-meta1&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;style&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;flex:&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;; text-align:left; color: rgba(&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;26&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;22&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;22&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0.712&lt;&#x2F;span&gt;&lt;span&gt;); font-size: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;90%&lt;&#x2F;span&gt;&lt;span&gt;; padding-top:&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0.6%&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;        {{ working_note.date | date: date_format }}
&lt;&#x2F;span&gt;&lt;span&gt;      &amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;h3&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;      &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;h3 style&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;flex:&lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;4&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;        &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;a href&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;{{ working_note.url | relative_url }}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;            {{ working_note.title | escape }}
&lt;&#x2F;span&gt;&lt;span&gt;        &amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;a&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;      &amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;h3&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;div&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;{% endfor %}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;{% endraw %}&lt;&#x2F;p&gt;
&lt;p&gt;And voila, you should see this md appear as one of your header pages.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Web Notes: March 2022</title>
        <published>2022-04-17T00:00:00+00:00</published>
        <updated>2022-04-17T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/clips-march-2022/"/>
        <id>https://asun9.com/clips-march-2022/</id>
        
        <content type="html" xml:base="https://asun9.com/clips-march-2022/">&lt;h3 id=&quot;article-all-news-is-bad-news&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;thomasjbevan.substack.com&#x2F;p&#x2F;all-news-is-bad-news?s=r&quot;&gt;All news is bad news&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;I need to remind myself every once in a while that news is not optimized to educate, but to entertain, and I shouldn&#x27;t use it to construct a model of the world. Prefer long form. Prioritize books with a large list of references.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;In &lt;em&gt;Anna Karenina&lt;&#x2F;em&gt; Tolstoy wrote: &lt;em&gt;“The newspapers published a great deal that was superfluous and exaggerated, with the sole aim of attracting attention and talking one another down.”&lt;&#x2F;em&gt; He wrote that in 1877. Human nature does not change.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;The democracy and society improving aspects of news-following are its foundational doctrine, as we have hinted at above, but they do not hold up to the light of reason. Think about it. As the Swiss writer and former news junkie turned anti-news advocate Rolf Dobelli has observed “[The average person] has devoured 20,000 news items in the past 12 months- 60 per day at a conservative estimate. Did a single one help you make a better decision about your life, family, career, well-being or business?”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Now I don’t know about you but when I encountered this question and truly reflected the answer was no. All of this time spent staying in-the-loop and it had not made a jot of positive difference to my real life and the things I truly care about. Further, not only had the news not helped me I also could barely remember any of it. It was just an amorphous grey blur of vice, crime, folly, greed, violence, war, disease and natural disasters. A swirl of unconnected events with no context. A vast cluster of individual dots with no explanatory lines to connect them together.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;article-working-long-hours-and-start-up-success&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;allisonpickens.substack.com&#x2F;p&#x2F;a-contrarian-take-on-working-long?s=r&quot;&gt;Working long hours and start up success&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;From a Silicon Valley VC. Makes a case for other forms of building a successful company, one where employees are not overworked or forced to compromise on their relationships.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Last year I met (and invested in) the fastest growing SaaS company ever. They grew from zero to $40M in ARR in 9 months, with 9 employees. The founders work roughly 9am to 5pm and are attentive parents. They don&#x27;t subscribe to many Silicon Valley values. They think Twitter is a waste of time; it&#x27;s the home of amateurs who aren&#x27;t focused on building real businesses.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;When I say &quot;long hours&quot; and &quot;short hours,&quot; I&#x27;m referring to aggregate, cumulative metrics: how much does the entire team work, over time. Of course, there are some weeks when specific people end up working longer hours, and that can be good for a company. A founder might work harder when closing new capital. Deadlines are natural impetuses to work longer hours for a period of time: e.g. sales people might work harder at the end of the quarter than the beginning; engineers might work harder in the lead-up to a new release. The departure of a team member may result in a short-term overload for a couple of other team members, and it&#x27;s probably good that they&#x27;re covering the gap. But, for the reasons above, aggregate, sustained long hours can be a sign of fundamental problems.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Work is religion for many talented people. Many of the most talented people actually want to work long hours, because it&#x27;s their source of meaning in life and&#x2F;or because they lack meaning in other parts of their lives. I was that person for most of my life. This bullet point in itself is controversial enough to warrant its own blog post, which I may muster up the courage to write in the future. The point here is that talented people work hard for reasons unrelated to the potential impact of that work on future results.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;article-reading-is-a-super-power&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;kk.org&#x2F;thetechnium&#x2F;the-super-power-of-reading&#x2F;&quot;&gt;Reading is a super power&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;By Kevin Kelley. From the anthology &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;amzn.to&#x2F;2Yawryb&quot;&gt;The Velocity of Being: Letters to a Young Reader&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Reading is a superpower that also gives you a type of teleportation. It can transport your mind to a different place than where your body is. The feeling of being immersed in a different place, or even a different time period, can be so strong you may not want to leave.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;In the real world of course, you would not be the only person with this superpower. Many other people acquire this power. This doesn’t diminish your power, it actually increases it. Because others can read, they can write, which increases the number of living minds you can connect your mind with. With the power of reading today you can connect with billions of other minds, in almost real time. Their minds can be funneled from anywhere on the globe right to your mind.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;The more you write, the better you read; the more you read, the better you write. It does not matter where you read, whether on bits of paper, or on a screen. It does not matter where you write, whether on bits of paper or on a screen.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;video-how-you-can-make-the-world-a-better-place-today&quot;&gt;Video: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?app=desktop&amp;amp;v=RbIM_7rrMh4&quot;&gt;How you can make the world a better place today&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Ignore the title of the video and watch it. It&#x27;s short. What are you doing with the materials you are accumulating? Over the years? Are you creating something with it? Otherwise what&#x27;s the point?&lt;&#x2F;p&gt;
&lt;h3 id=&quot;software-taskwarrior&quot;&gt;Software: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;taskwarrior.org&#x2F;&quot;&gt;Taskwarrior&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Desktop based open source task manager. It&#x27;s been around for over a decade. Tried it for a bit and I liked it. If I hadn&#x27;t discovered Things 3, this might have been my task manager of choice. One can track time on projects using &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;timewarrior.net&quot;&gt;Timewarrior&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;article-why-we-lose-friends-with-age&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.theatlantic.com&#x2F;magazine&#x2F;archive&#x2F;2022&#x2F;03&#x2F;why-we-lose-friends-aging-happiness&#x2F;621305&#x2F;&quot;&gt;Why we lose friends with age&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;I really enjoyed this one. Nobody tells you that you will change and grow away from once close friends. Keeping a relationship alive requires effort.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Back in the 1980s, the Oxford psychologists Michael Argyle and Monika Henderson wrote a seminal paper titled “The Rules of Friendship.” Its six takeaways are obvious, but what the hell, they’re worth restating: In the most stable friendships, people tend to stand up for each other in each other’s absence; trust and confide in each other; support each other emotionally; offer help if it’s required; &lt;strong&gt;try to make each other happy; and keep each other up-to-date on positive life developments.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;When I consider the people I know with the greatest talent for friendship, I realize that they do just this. They make contact a priority. They jump in their cars. They appear at regular intervals in my inbox. One told me she clicks open her address book every now and then just to check which friends she hasn’t seen in a while—and then immediately makes a date to get together.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;article-derek-sivers-on-journaling&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;sive.rs&#x2F;dj&quot;&gt;Derek Sivers on Journaling&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;blockquote&gt;
&lt;p&gt;I especially like my “Regrets” journal. Whenever I do something I regret, I write it down there, noting why I regret it, what I wish I would have done instead, and how I hope to prevent this in the future.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;If I’m planning on doing something, I ask myself what I hope to get out of it, why, and whether there are other ways to get what I want.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;When I’m feeling conflicted, especially, I’ll ask myself a bunch of questions to work through my feelings, looking for the source of the conflict, then ask myself more questions around the clash in values, and work through other alternate ways I’d like things to be.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;article-the-art-of-plain-text&quot;&gt;Article: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.netmeister.org&#x2F;blog&#x2F;the-art-of-plain-text.html&quot;&gt;The Art of Plain Text&lt;&#x2F;a&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Discovered via &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;blog.jim-nielsen.com&#x2F;2022&#x2F;reading-notes-march&#x2F;&quot;&gt;Jim Nielsen&#x27;s blog&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;The two most important ways to make your text easy to read
are a short line-length and the copious use of paragraphs.
Viewing a single large block of run-away text with no line
breaks immediately puts stress on the reader, as absorbing
the information provided therein requires a high degree of
concentration and eye movement.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Use short sentences, even (and especially) if you&#x27;re German.
Just like one single block of text is hard to read, so are
never ending sentences with multiple conditionals and
subclauses.  You are not writing Molly Bloom&#x27;s Soliloquy.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Resist the temptation to use images.  This helps you clarify
your thoughts and keeps the content searchable.  Use
illustrations as supplementary, not instead of information.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Thoughts on debugging</title>
        <published>2022-03-27T00:00:00+00:00</published>
        <updated>2022-03-27T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes-on-debugging/"/>
        <id>https://asun9.com/notes-on-debugging/</id>
        
        <content type="html" xml:base="https://asun9.com/notes-on-debugging/">&lt;p&gt;I recently found myself working with some new graduates and helping them through a debugging process. They took their time with the code, and it was an interesting experience watching them go about it. I  was in their place a decade ago and quite certainly as bad. I have learnt a few tricks since then, and this gave me an opportunity to articulate it, so here goes.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;1-know-what-you-want-to-achieve&quot;&gt;1. Know what you want to achieve&lt;&#x2F;h1&gt;
&lt;p&gt;First you must know what the system requirements are. Any bugs or problems you encounter are bugs or problems only because they prevent you from achieving your system goals.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;2-describe-the-problem-s&quot;&gt;2. Describe the problem(s)&lt;&#x2F;h1&gt;
&lt;p&gt;In writing, explain what the current problems of the system are. It&#x27;s important to write this down rather than just talking about it. Writing things down is important because,&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;You get more clarity on the problem. Sometimes it will make the solution obvious.&lt;&#x2F;li&gt;
&lt;li&gt;You can use it for documentation.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;When writing, remember to talk only about the problem. Don&#x27;t confuse potential solutions with the problem statement. We will get to solutions later.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;3-pick-one-problem-to-solve&quot;&gt;3. Pick one problem to solve&lt;&#x2F;h1&gt;
&lt;p&gt;Tackle one problem at a time. This is actually the fastest way to get through your problems list. Don’t try to do more than one thing at a time. &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.lesswrong.com&#x2F;posts&#x2F;4FZfzqMtwQZES3eqN&#x2F;slow-is-smooth-and-smooth-is-fast&quot;&gt;Slow is smooth, smooth is fast.&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Debugging consists of two stages: figuring out what’s causing the bugs you see, and squashing those bugs.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;h1 id=&quot;4-root-cause-analysis&quot;&gt;4. Root cause analysis&lt;&#x2F;h1&gt;
&lt;h4 id=&quot;a-generate-hypotheses&quot;&gt;a. Generate hypotheses&lt;&#x2F;h4&gt;
&lt;p&gt;Generate a list of hypotheses about why you might be seeing the problem.&lt;&#x2F;p&gt;
&lt;p&gt;Your list will be a combination of what you know from experience and what stack overflow tells you.&lt;&#x2F;p&gt;
&lt;p&gt;You must have a model about what’s happening in your head before you start tacking the issue. You will constantly revisit this and update this list.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;b-validate-hypotheses&quot;&gt;b. Validate hypotheses&lt;&#x2F;h4&gt;
&lt;p&gt;Conduct experiments to verify which of the hypotheses holds true.&lt;&#x2F;p&gt;
&lt;p&gt;If you are going to comment parts of code while doing this, make sure you do it in an organized manner. Keep a record of the experiments run so as to not waste effort.&lt;&#x2F;p&gt;
&lt;p&gt;Ideally, your code should already be modular and customizable, so you can turn off components with a flag when experimenting.&lt;&#x2F;p&gt;
&lt;p&gt;To conduct experiments,&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Get your code in order like I have indicated above. The whole purpose is to isolate the problem you have picked. Turn off other components unrelated to this issue. We want to &lt;strong&gt;reproduce this one issue consistently, with the simplest set of inputs&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Sometimes, you will have to write newer, simpler code that exercises the components with the issue, especially if the code base is big.&lt;&#x2F;li&gt;
&lt;li&gt;Increase complexity if you are unable to reproduce the issue with the simplest use case. Include more and more components.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h4 id=&quot;c-repeat-4a-and-4b&quot;&gt;c. Repeat 4a and 4b&lt;&#x2F;h4&gt;
&lt;p&gt;Repeat the steps &lt;code&gt;a&lt;&#x2F;code&gt; and &lt;code&gt;b&lt;&#x2F;code&gt; till you know what&#x27;s causing the problem with high certainty. At the end of this process you should know what the root cause of the issue is.&lt;&#x2F;p&gt;
&lt;p&gt;In each iteration, refine the hypotheses, the experiments, or both. Do not keep doing the same thing again and again and expect different results. You don’t want to waste time. Refine. Add new hypotheses, discard old ones. Update experiments.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;5-squash-the-bug&quot;&gt;5. Squash the bug&lt;&#x2F;h1&gt;
&lt;p&gt;You now know what the root cause is, figure out a solution. Use google. Ask your fellow engineers. Some solutions are readily apparent once you discover the root cause. Others need time and sleeping. Some can be solved with the tools we have at the moment. Others will require a different set of tools that may not be easy to acquire.&lt;&#x2F;p&gt;
&lt;p&gt;Getting to root cause is 70% of debugging&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-1-1&quot;&gt;&lt;a href=&quot;#fn-1&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;. Solving the problem requires a different &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;youtu.be&#x2F;f84n5oFoZBc&quot;&gt;set of heuristics&lt;&#x2F;a&gt;, but many can be tackled with just stack-overflow and asking your fellow engineers.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;6-documentation&quot;&gt;6. Documentation&lt;&#x2F;h1&gt;
&lt;p&gt;Document the problem and solution both for yourself and others. This is as important as the previous steps. In your programming and problem solving career, you will keep hitting the same issues again and again and you want to be able to refer to your previous attempts at solving them.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;7-repeat-3-6&quot;&gt;7. Repeat 3 - 6&lt;&#x2F;h1&gt;
&lt;p&gt;Repeat steps 3 to 6 with the other problems in your list.&lt;&#x2F;p&gt;
&lt;br&#x2F;&gt;
&lt;p style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;FOOTNOTES&lt;&#x2F;b&gt; &lt;&#x2F;p&gt;
&lt;footer class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-1&quot;&gt;
&lt;p&gt;I made this up. It needn&#x27;t be 70%, but it&#x27;s a not insignificant number and likely higher. &lt;a href=&quot;#fr-1-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;footer&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Updating github token</title>
        <published>2022-03-15T00:00:00+00:00</published>
        <updated>2022-03-15T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes/git-token-refresh/"/>
        <id>https://asun9.com/notes/git-token-refresh/</id>
        
        <content type="html" xml:base="https://asun9.com/notes/git-token-refresh/">&lt;ol&gt;
&lt;li&gt;Get your token from &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;settings&#x2F;tokens&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;List your existing origin via: &lt;code&gt;git remote -v&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Remove existing remote: &lt;code&gt;git remote remove origin&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Update your remote: &lt;code&gt;git remote add origin https:&#x2F;&#x2F;[TOKEN]@github.com&#x2F;[USER]&#x2F;[REPO]&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;git remote set-url origin git@github.com:[USER]&#x2F;[REPO].git&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;git branch --set-upstream-to=origin&#x2F;gh-pages gh-pages&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>On understanding consciousness</title>
        <published>2022-02-20T00:00:00+00:00</published>
        <updated>2022-02-20T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/programing-conciousness/"/>
        <id>https://asun9.com/programing-conciousness/</id>
        
        <content type="html" xml:base="https://asun9.com/programing-conciousness/">&lt;p&gt;I am currently reading David Deutsch&#x27;s Beginning of Infinity where he proposes a test for judging claims explaining nature of consciousness:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you cannot program it, you haven&#x27;t understood it.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;This is inspired by the Turing test, which is a test of a machine&#x27;s ability to exhibit behaviour that is indistinguishable from that of a human. Deutsch&#x27;s test is evaluating humans instead, a gentle poke at Daniel Dennett and other&#x27;s claims of having &quot;solved&quot; consciousness.&lt;&#x2F;p&gt;
&lt;p&gt;Paul Graham, in his latest &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;http:&#x2F;&#x2F;www.paulgraham.com&#x2F;words.html&quot;&gt;essay&lt;&#x2F;a&gt;, says:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Writing about something, even something you know well, usually shows you that you didn&#x27;t know it as well as you thought. Putting ideas into words is a severe test.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;If writing down your ideas always makes them more precise and more complete, then no one who hasn&#x27;t written about a topic has fully formed ideas about it. And someone who never writes has no fully formed ideas about anything nontrivial.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Taking both Deutsch&#x27;s and Graham&#x27;s assertions seriously, one can understand consciousness only by first writing about it, and then programming it. Understanding consciousness then is a special case of the general rule that writing about anything enriches your understanding of it. In contrast, Eastern conceptions&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-1-1&quot;&gt;&lt;a href=&quot;#fn-1&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; of the mind have it that you can understand it&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-2-1&quot;&gt;&lt;a href=&quot;#fn-2&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;, but you cannot explain it.&lt;&#x2F;p&gt;
&lt;br&#x2F;&gt;
&lt;p style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;FOOTNOTES&lt;&#x2F;b&gt; &lt;&#x2F;p&gt;
&lt;footer class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-1&quot;&gt;
&lt;p&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Mind_in_eastern_philosophy&quot;&gt;Mind in eastern philosophy&lt;&#x2F;a&gt; &lt;a href=&quot;#fr-1-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-2&quot;&gt;
&lt;p&gt;See &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Thanu_Padmanabhan&quot;&gt;another physicist&#x27;s&lt;&#x2F;a&gt; &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;http:&#x2F;&#x2F;www.iucaa.in&#x2F;~paddy&#x2F;answer&#x2F;answer.pdf&quot;&gt;perspective&lt;&#x2F;a&gt;:&quot;The Direct Experience is the only way to bypass systems of thought, intellectual pre-conditioning and Aristotelian logic. But this Experience, by its very definition, is not communicable by standard procedures. This basic difficulty should be obvious. All standard forms of precise communication are isomorphic to verbalization based on some system of generalized grammar; so how does one convey that which is beyond the systems of thought?&quot; &lt;a href=&quot;#fr-2-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;footer&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>What do we know about Indian prehistory?</title>
        <published>2022-02-05T00:00:00+00:00</published>
        <updated>2022-02-05T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/pop-gen-india-reich/"/>
        <id>https://asun9.com/pop-gen-india-reich/</id>
        
        <content type="html" xml:base="https://asun9.com/pop-gen-india-reich/">&lt;p&gt;Book: &lt;strong&gt;Who We Are and How We Got Here: Ancient DNA and the New Science of the Human Past&lt;&#x2F;strong&gt; &lt;br &#x2F;&gt;
Author: &lt;strong&gt;David Reich&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The past two decades have seen a revolution in population genetics, in no small part due to David Reich&#x27;s work at Harvard. This revolution, as I understand it, is the ability to extract DNA from ancient bones and to be able to fully sequence it, and by building models of gene frequency dynamics, provide accounts of human migrations. This has allowed reconstruction of population history in more details than had been possible before. Reich&#x27;s book is a scientist&#x27;s overview of the field, and a summary of what we know so far about human prehistory.&lt;&#x2F;p&gt;
&lt;p&gt;Reich establishes over many chapters, with examples from Europe, the Americas, Asia that no population group is &quot;pure&quot; in the Nazi sense of the word. Every ethnic group present today is a mixture of many distinct groups from before, and those previous populations themselves were composites. Another fact that he conclusively establishes is that &lt;strong&gt;to be human is to migrate&lt;&#x2F;strong&gt;, and existing populations in geographic locations often don&#x27;t have any genetic relation with the ancestors that they remember via cultural memory. Take for example, Britain. Considered to the home of an indigenous Celtic people, who later mixed with the invading Anglo-Saxons. It turns out the Celts themselves are a population group that migrated around three thousand years ago. The Stonehenge, the earliest prehistoric monument in Britain, was built five thousand years ago by a people that no longer exists, before the arrival of ancestors of modern Europeans (and hence Indo-European languages)! Such population replacements have happened many times in human history in many places. A recent example is the genocide and replacement of the Dzungar people by the Han Chinese, Hui muslims and Turkic Taranchis in Xinjiang in the eighteenth century.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;the-early-indians&quot;&gt;The Early Indians&lt;&#x2F;h3&gt;
&lt;p style=&quot;text-align:center;&quot;&gt;&lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;Sintashta_culture.jpg&quot; alt=&quot;Sintastha Culture Within the Eurasian Steppe&quot; class=&quot;center&quot;&gt;&lt;&#x2F;p&gt;
&lt;p style=&quot;text-align:center;&quot;&gt;&lt;i&gt;Sintastha Culture within the confines of the Eurasian steppe&lt;&#x2F;i&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Around five thousand years ago, the Yamnaya became the predominant power in the Steppe. To be a superpower back then was to possess two technologies: horses and wheels. The Yamnaya and their descendants migrated in multiple waves to Europe and India, and were so successful that every Indian living today (except the Andamanese) has an Yamnaya as an ancestor. The mitochondrial DNA, a tiny portion of the human genome, is passed along the maternal line from mother to daughter to granddaughter. It can be used to trace the diversity along the female line, and for most population groups, it&#x27;s very diverse. The Y-chromosome, another portion of the human genome, is a lot less diverse - for all population groups. The Y-chromosome comes only from the male line, passed from father to son. While the Y-chromosome of most Indians show steppe and Iranian farmer ancestry, the mitochondrial DNA of Indians is unique - it&#x27;s not found outside of the subcontinent. What this indicates is that these migrant groups from the steppes and West Eurasia were in all likelihood composed entirely of men. As it has happened in Americas these past few centuries&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-1-1&quot;&gt;&lt;a href=&quot;#fn-1&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-2-1&quot;&gt;&lt;a href=&quot;#fn-2&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;, males from a population with more power were more successful in competing for mates and replaced almost entirely the Y-chromosome of the existing population group.&lt;&#x2F;p&gt;
&lt;p&gt;The Yamnaya were Indo-European speakers, and they bought the language with them which later became Old Sanskrit. While it is true that Sanskrit and Hindu mythology developed entirely within the confines of the Indian subcontinent - the oldest layers of the Vedas clearly reflect early Indian geography and memories - there are echoes of the shared Proto-Indo-European past in the most ancient of these myths. Indra and Zeus are gods of thunder and lightening and the kings of their respective pantheon. The Ashvin twins correspond to the Greek twins, Castor and Pollox. One tradition of the Vedic religion was the Asvamedha, horse sacrifice. The Roman religion had its own horse sacrifice ritual, the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;October_Horse&quot;&gt;October Horse&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;What population group did the descendants of the Yamnaya encounter during their eastward expansion into India? This was also a composite group, a mixture of ancient Iranian farmers expanding eastwards to the Indus Valley after nine thousand years ago&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-3-1&quot;&gt;&lt;a href=&quot;#fn-3&quot;&gt;3&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;, and an earlier population group of hunter gatherers. This composite group has been termed the ASI (Ancestral South Indian), and the descendants of the Yamnaya constitute a population group now called ANI (Ancestral North Indian). Every population group in India is a mixture of the ASI and the ANI. There&#x27;s no purely ASI or purely ANI group in India. Brahmins from Kashmir have as much ASI mixture in them as the members of some of the isolated tribe in deep South India have ANI, about 30%. Indian endogamous groups - jatis - cluster around various blends of ASI to ANI when plotted along a cline.&lt;&#x2F;p&gt;
&lt;p&gt;David Reich&#x27;s chapter on India ends with some speculation about the Indus Valley Civilization (IVC). Were they Iranian-related farmers, or were they already ASI? Could they be ANI? These were folks at the crossroads of all these movements of people. Since the book was published in 2018, his lab has &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.ncbi.nlm.nih.gov&#x2F;pmc&#x2F;articles&#x2F;PMC6800651&#x2F;&quot;&gt;successfully&lt;&#x2F;a&gt; sequenced a genome from Rakhigiri, an Indus Valley site. To no one&#x27;s surprise, there&#x27;s no population group in India that&#x27;s purely IVC. The IVC folks share more than 75% of their ancestors with people living in ancient pre-Indo-European Iran. About 55% of ASI&#x27;s ancestry comes from IVC. For ANI, that&#x27;s 70%. It looks like much of the formation of the ASI and the ANI occurred in the second millennium BCE, a time that also coincides with the decline of the IVC&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-4-1&quot;&gt;&lt;a href=&quot;#fn-4&quot;&gt;4&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;coda&quot;&gt;Coda&lt;&#x2F;h3&gt;
&lt;p&gt;I think we know enough now to tell the story of early Indians, at least something that&#x27;s more than a speculation. &lt;strong&gt;Either all Indians are indigenous or no one is&lt;&#x2F;strong&gt;. The Yamnaya gave almost all Indians&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-5-1&quot;&gt;&lt;a href=&quot;#fn-5&quot;&gt;5&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; their genes, and their memes. Dravidian&#x2F;Aryan (~= native&#x2F;outsider) race-based classification of Indian peoples makes no sense, considering &lt;strong&gt;everyone is a composite mixture of ASI and ANI&lt;&#x2F;strong&gt;. The AASI&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-6-1&quot;&gt;&lt;a href=&quot;#fn-6&quot;&gt;6&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; have been entirely within the borders of the subcontinent for the last ten thousand years, and &lt;em&gt;could&lt;&#x2F;em&gt; be regarded as indigenous to the subcontinent (unless we find evidence otherwise). Every Indian&#x27;s mitochondrial DNA reflects this heritage.&lt;&#x2F;p&gt;
&lt;p&gt;Regarding the book itself, it&#x27;s dry as hell. And I mean dry! I am not a fan of Reich&#x27;s narrative framing - he assumes that the reader has one perspective, explains reasons for the prevailing model and finally leads the reader to what the latest science says. I had no preconceived notions when I started, and these were the parts I found a slog to get through, not to mention confusing. My review covered only those portions that were of interest to me, but Reich has a much larger canvas than just India - he covers the prehistory of Japan, China, the Pacific Islands, the Americas, Africa and Europe. Despite the caveats, this is a book that deserves to be on everyone&#x27;s shelves. A familiarity with some of its conclusions will only enrich the conversations happening right now about race, caste, nationality and culture.&lt;&#x2F;p&gt;
&lt;br&#x2F;&gt;
&lt;p style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;FOOTNOTES&lt;&#x2F;b&gt; &lt;&#x2F;p&gt;
&lt;footer class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-1&quot;&gt;
&lt;p&gt;&quot;Comparison of Y-chromosome and mitochondrial DNA types that are highly different in frequency between African Americans and Europeans also shows that by far the majority of the European ancestry in these populations comes from males, the result of social inequality in which mixed-race couplings were primarily between free males and female slaves.&quot; Quoting Reich from this book. &lt;a href=&quot;#fr-1-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-2&quot;&gt;
&lt;p&gt;&quot;Andrés Ruiz-Linares and colleagues have documented how in the Antioquia region of Colombia, which was relatively isolated between the sixteenth and nineteenth centuries, about 94 percent of the Y chromosomes are European in origin, whereas about 90 percent of the mitochondrial DNA sequences are of Native American origin. This reflects social selection against Native American men.&quot; Quoting Reich from his book. &lt;a href=&quot;#fr-2-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-3&quot;&gt;
&lt;p&gt;It&#x27;s been hypothesized that these expanding farmers brought some form of proto-Dravidian to India. See &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;&quot;&gt;Elamo-Dravidian languages&lt;&#x2F;a&gt;. &lt;a href=&quot;#fr-3-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-4&quot;&gt;
&lt;p&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.ncbi.nlm.nih.gov&#x2F;pmc&#x2F;articles&#x2F;PMC6822619&#x2F;&quot;&gt;The Formation of Human Populations in South and Central Asia&lt;&#x2F;a&gt; &lt;a href=&quot;#fr-4-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-5&quot;&gt;
&lt;p&gt;One notable exception: the Pulliyar tribe in South India is almost 100% ASI. All the population groups in the Indian subcontinent can be plotted along a cline, one end of which is 100% ANI (represented by the Kalash of Pakistan&#x27;s Chitral district), and the other end is 100% ASI, represented by Pulliyar. &lt;a href=&quot;#fr-5-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-6&quot;&gt;
&lt;p&gt;Ancient Ancestral South Indian, a ghost population. The Andamanese Islanders are hypothesized to be related to them. They don&#x27;t have any West Eurasian ancestry. &lt;a href=&quot;#fr-6-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;footer&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Perfect Clarity</title>
        <published>2022-01-30T00:00:00+00:00</published>
        <updated>2022-01-30T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/perfect-clarity/"/>
        <id>https://asun9.com/perfect-clarity/</id>
        
        <content type="html" xml:base="https://asun9.com/perfect-clarity/">&lt;p&gt;Book: &lt;strong&gt;Perfect Clarity: A Tibetan Buddhist Anthology of Mahamudra and Dzogchen&lt;&#x2F;strong&gt; &lt;br &#x2F;&gt;
Translated By: &lt;strong&gt;Erik Pema Kunsang&lt;&#x2F;strong&gt; &lt;br &#x2F;&gt;
Compiled By: &lt;strong&gt;Marcia Schmidt&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;This book is a collection of carefully selected excerpts from the works of various Tibetan masters from the last thousand years. It is expected that the reader will have some passing familiarity with meditation and of the praxis of Dzogchen and Mahamudra. If you do&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-1-1&quot;&gt;&lt;a href=&quot;#fn-1&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;, it&#x27;s not hard to get into. It striking how practical the instructions are (given the age of some of them), and often, quite straight forward. It&#x27;s also interesting to contrast Tibetan Buddhism with Srivaishnavism or other Indian traditions, where the object of meditation is not just the breath (as in Theravada), but various demigods, and frequently, one&#x27;s Guru. One starts the practice by offering supplications to the gods. There&#x27;s constant emphasis on devotion:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;For completely realizing this teaching. &lt;br &#x2F;&gt;
Always concentrate on devotion &lt;br &#x2F;&gt;
To the guru, the Lord of Uddiyana, &lt;br &#x2F;&gt;
And apply your body, speech, and mind to what is virtuous&lt;&#x2F;p&gt;
&lt;p&gt;-- &lt;cite&gt;Jamgon Kongtrul&lt;&#x2F;cite&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Devotion is more important than scholarship.&lt;&#x2F;p&gt;
&lt;p&gt;-- &lt;cite&gt;Tulku Urgyen Rinpoche&lt;&#x2F;cite&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Considering that Tilopa and Naropa, Indian monks regarded as pivotal figures in various Tibetan Buddhist lineages, are from Bengal, I would be really interested in a comparative study of the evolution of Vajrayana and Bengal Vaishnavism.&lt;&#x2F;p&gt;
&lt;p&gt;Perfect Clarity&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-2-1&quot;&gt;&lt;a href=&quot;#fn-2&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; is not meant to be read cover-to-cover, though I did exactly that. Consequently, I found it repetitive after a while. The pith of the instructions are always the same, even while being presented in a distinctive manner by different teachers over the centuries. My favourites are the ones from &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;mahamudra-perfect-clarity&#x2F;&quot;&gt;Pema Karpo&lt;&#x2F;a&gt; and Mipham Rinpoche, easiest and most direct for this modern mind to understand.&lt;&#x2F;p&gt;
&lt;p&gt;I am not sure why I am still reading books like this though. They end up being variations on the same theme. Tulku Urgyen Rinpoche does say at the beginning, &quot;Have you heard of anyone who recognized nondual awareness simply by reading books?&quot; Given that he&#x27;s the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Tulku&quot;&gt;Tulku&lt;&#x2F;a&gt;, he&#x27;s probably right. Why do I still read these sorts of books? At least part of the answer is curiosity, an attempt at answering the question: how does this compare with the contemplative traditions I am familiar with? The rest is entertainment.&lt;&#x2F;p&gt;
&lt;br&#x2F;&gt;
&lt;p style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;FOOTNOTES&lt;&#x2F;b&gt; &lt;&#x2F;p&gt;
&lt;footer class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-1&quot;&gt;
&lt;p&gt;Wikipedia helps. &lt;a href=&quot;#fr-1-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-2&quot;&gt;
&lt;p&gt;Learnt from the preface that this work was made possible by the Richard Gere Foundation. Hadn&#x27;t thought of him in years, and didn&#x27;t realize he was making material contributions to Tibetan culture. Impressed. &lt;a href=&quot;#fr-2-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;footer&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Migrating to Jekyll</title>
        <published>2022-01-25T00:00:00+00:00</published>
        <updated>2022-01-25T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/jekyll-foo/"/>
        <id>https://asun9.com/jekyll-foo/</id>
        
        <content type="html" xml:base="https://asun9.com/jekyll-foo/">&lt;p&gt;I migrated this site, on a whim, to Jekyll and now it is deployed via Netlify, with the data on github. I am glad I did it, though it has taken longer than I expected to move the few posts I had on my old Squarespace site. Since I have spent all this time, I should rationalize my decision: I don&#x27;t have to pay Squarespace $150 a year any more for hardly using their services. Squarespace&#x27;s analytics product is nice, but not nice enough to keep me there, considering no one visits this site outside the family and the bots anyway. Besides, there appear to be some &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.goatcounter.com&quot;&gt;free&lt;&#x2F;a&gt; &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;analytics.google.com&#x2F;&quot;&gt;alternatives&lt;&#x2F;a&gt; that I could always use&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-1-1&quot;&gt;&lt;a href=&quot;#fn-1&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;A good thing about the process I now have is I don&#x27;t have to keep making copies of my posts - which have always been written in markdown - before publishing it. I own my content, and it be versioned and tracked. Plus the whole migration was fun (and inadvertent - I only wanted to check Jekyll out, but it was so easy to get the initial site up on github pages that I went the whole way). And just as important, I finally have working footnotes&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-2-1&quot;&gt;&lt;a href=&quot;#fn-2&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;I am listing some of the resources I used in order to get this site up and running in case I ever have to do this again (and if you need yet another migrating-to-jekyll reference post #9991212).&lt;&#x2F;p&gt;
&lt;h3 id=&quot;intial-setup&quot;&gt;Intial Setup&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;jekyllrb.com&#x2F;docs&#x2F;installation&#x2F;macos&#x2F;&quot;&gt;Setting up jekyll on macOS&lt;&#x2F;a&gt;.
&lt;ul&gt;
&lt;li&gt;Hit issues with using the ruby that ships with macOS. I ended up using  &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rbenv&#x2F;rbenv&quot;&gt;rbenv&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Using a custom domain on &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;docs.github.com&#x2F;en&#x2F;pages&#x2F;configuring-a-custom-domain-for-your-github-pages-site&#x2F;managing-a-custom-domain-for-your-github-pages-site&quot;&gt;github pages&lt;&#x2F;a&gt;.
&lt;ul&gt;
&lt;li&gt;Configuring external dns on &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;docs.netlify.com&#x2F;domains-https&#x2F;custom-domains&#x2F;configure-external-dns&#x2F;&quot;&gt;netlify&lt;&#x2F;a&gt;. Very easy to do. I have to say Netlify docs are excellent!&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Started with Github Pages, later moved to Netlify because I want to keep my repo private. If Netlify axes their very generous free tier, there are other alternatives: &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;pages.cloudflare.com&quot;&gt;Cloudfare Pages&lt;&#x2F;a&gt;, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;surge.sh&quot;&gt;Surge&lt;&#x2F;a&gt;, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;render.com&quot;&gt;Render&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;tags-categories-permalinks-redirects&quot;&gt;Tags, Categories, Permalinks, Redirects&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Started using categories on my posts the way I would use tags, without realizing that the links generated would have these categories in the path. I swtiched later to using an explicit &lt;code&gt;tags&lt;&#x2F;code&gt; concept in the Front Matter, and using an explicit permalink field.&lt;&#x2F;li&gt;
&lt;li&gt;In order to generate these tags and have them display on my post, I found these two resources very helpful:
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;http:&#x2F;&#x2F;www.jasonemiller.org&#x2F;2020&#x2F;12&#x2F;23&#x2F;tagging-posts-in-jekyll-minima.html&quot;&gt;Jason Miller&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;longqian.me&#x2F;2017&#x2F;02&#x2F;09&#x2F;github-jekyll-tag&#x2F;&quot;&gt;Long Qian&lt;&#x2F;a&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Add an archive.html to _includes:
{% raw %}&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;html&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-html &quot;&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;h2&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;Archive&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;h2&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;{% capture temptags %}
&lt;&#x2F;span&gt;&lt;span&gt;  {% for tag in site.tags %}
&lt;&#x2F;span&gt;&lt;span&gt;    {{ tag[1].size | plus: 1000 }}#{{ tag[0] }}#{{ tag[1].size }}
&lt;&#x2F;span&gt;&lt;span&gt;  {% endfor %}
&lt;&#x2F;span&gt;&lt;span&gt;{% endcapture %}
&lt;&#x2F;span&gt;&lt;span&gt;{% assign sortedtemptags = temptags | split:&amp;#39; &amp;#39; | sort | reverse %}
&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;p&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;{%- for temptag in sortedtemptags -%}
&lt;&#x2F;span&gt;&lt;span&gt;  {% assign tagitems = temptag | split: &amp;#39;#&amp;#39; %}
&lt;&#x2F;span&gt;&lt;span&gt;  {% capture tagname %}{{ tagitems[1] }}{% endcapture %}
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;span style&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;white-space:nowrap&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;a href&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;&#x2F;tag&#x2F;{{ tagname }}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;code class&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;highligher-rouge&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;{{ tagname }}&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;code&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;a&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;span&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;{%- endfor -%}
&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;p&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;{% endraw %}&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Add a tagpage.html to _includes:
{% raw %}&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;html&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-html &quot;&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span&gt;---
&lt;&#x2F;span&gt;&lt;span&gt;layout: default
&lt;&#x2F;span&gt;&lt;span&gt;---
&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;div class&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;post&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;h1&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;Tag: {{ page.tag }}&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;h1&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;ul&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;{% for post in site.tags[page.tag] %}
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;li&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;a href&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;{{ post.url }}&lt;&#x2F;span&gt;&lt;span style=&quot;color:#556633;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;{{ post.title }}&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;a&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; ({{ post.date | date_to_string }})&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;br&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;    {{ post.description }}
&lt;&#x2F;span&gt;&lt;span&gt;  &amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;li&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;{% endfor %}
&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;ul&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;{% include archive.html %}
&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;div&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;hr&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;{% endraw %}&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Then one needs to run a script that will generate the tag markdown file for each of the tags one has.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;I later learnt about the gem &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;jekyll&#x2F;jekyll-archives&quot;&gt;jekyll-archives&lt;&#x2F;a&gt; that does the same thing sketched out by the above two, and a few other things. Probably easier to get it working this way. When I find myself with more time to kill I will probably move to the gem.&lt;&#x2F;li&gt;
&lt;li&gt;Customizing &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;http:&#x2F;&#x2F;man.hubwiz.com&#x2F;docset&#x2F;Jekyll.docset&#x2F;Contents&#x2F;Resources&#x2F;Documents&#x2F;jekyllrb.com&#x2F;docs&#x2F;permalinks&#x2F;index.html&quot;&gt;permalinks&lt;&#x2F;a&gt;.
&lt;ul&gt;
&lt;li&gt;In _config.yaml, you can use placeholders from front matter like this:&lt;pre style=&quot;background-color:#151515;color:#e8e8d3;&quot;&gt;&lt;code&gt;&lt;span&gt;permalink: &#x2F;:categories&#x2F;:year&#x2F;:month&#x2F;:day&#x2F;:title:output_ext
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;For redirects, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;docs.netlify.com&#x2F;routing&#x2F;redirects&#x2F;&quot;&gt;this&lt;&#x2F;a&gt; is as good a resource as any.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;styling&quot;&gt;Styling&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Adding css attributes to &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;boringrails.com&#x2F;tips&#x2F;jekyll-css-class&quot;&gt;kramdown&lt;&#x2F;a&gt;.
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Creating &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;pmarsceill&#x2F;just-the-docs&#x2F;issues&#x2F;171#issuecomment-538794741&quot;&gt;callout blocks&lt;&#x2F;a&gt;, like I have at the bottom of &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;buddhism-chola-chicago&#x2F;&quot;&gt;this&lt;&#x2F;a&gt; page.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Styling &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;talk.jekyllrb.com&#x2F;t&#x2F;want-to-use-default-github-jekyll-code-formatting-and-quote-formatting&#x2F;5221&#x2F;2&quot;&gt;blockquotes&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;To add the custom css, I copied over the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;jekyll&#x2F;minima&#x2F;blob&#x2F;v2.5.1&#x2F;assets&#x2F;main.scss&quot;&gt;main.scss&lt;&#x2F;a&gt; from minima to the &#x2F;assets directory and edited the file.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;My blockquote, for example:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;scss&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-scss &quot;&gt;&lt;code class=&quot;language-scss&quot; data-lang=&quot;scss&quot;&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;blockquote &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;    color: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#7697d6;&quot;&gt;#20151fe8&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;    border-left: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;4px &lt;&#x2F;span&gt;&lt;span&gt;solid &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;$grey-color-light&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;    padding-left: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;$spacing-unit &lt;&#x2F;span&gt;&lt;span&gt;&#x2F; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;    font-style: normal;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;    &amp;gt; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;:last-child &lt;&#x2F;span&gt;&lt;span&gt;{
&lt;&#x2F;span&gt;&lt;span&gt;    margin-bottom: &lt;&#x2F;span&gt;&lt;span style=&quot;color:#cf6a4c;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;;
&lt;&#x2F;span&gt;&lt;span&gt;    }
&lt;&#x2F;span&gt;&lt;span&gt;}
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;I will probably set custom attributes for post fonts and title, using a template similar to the blockquote.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Adding &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;ptc-it.de&#x2F;add-favicon-to-mm-jekyll-site&#x2F;&quot;&gt;favicon&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;To add pagination, I found &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;blog.webjeda.com&#x2F;jekyll-pagination&#x2F;&quot;&gt;this&lt;&#x2F;a&gt; most helpful. Unfortunately, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;jekyll&#x2F;jekyll-paginate&quot;&gt;jekyll-paginate&lt;&#x2F;a&gt; is not under active development, and the last release was in 2014. I expect this to break sometime, and I need to find something better to replace it.&lt;&#x2F;li&gt;
&lt;li&gt;I used &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.bytedude.com&#x2F;jekyll-previous-and-next-posts&#x2F;&quot;&gt;this&lt;&#x2F;a&gt; very good guide for adding next and previous post links at the bottom of each post. Had to get rid of index.markdown that I started with and use a index.html instead.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;misc&quot;&gt;Misc.&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;To add markdown files to the root directory, and not have them show up in the header, make use of &lt;code&gt;header_pages&lt;&#x2F;code&gt; in _config.yaml:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;yaml&quot; style=&quot;background-color:#151515;color:#e8e8d3;&quot; class=&quot;language-yaml &quot;&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#ffb964;&quot;&gt;header_pages&lt;&#x2F;span&gt;&lt;span&gt;:
&lt;&#x2F;span&gt;&lt;span&gt;    - &lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;links.markdown
&lt;&#x2F;span&gt;&lt;span&gt;    - &lt;&#x2F;span&gt;&lt;span style=&quot;color:#99ad6a;&quot;&gt;about.markdown
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Add &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;38419441&quot;&gt;table of contents&lt;&#x2F;a&gt;. Need to get this in someday.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;br&#x2F;&gt;
&lt;p style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;FOOTNOTES&lt;&#x2F;b&gt; &lt;&#x2F;p&gt;
&lt;footer class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-1&quot;&gt;
&lt;p&gt;I tried google analytics and I didn&#x27;t like it. It&#x27;s also the best known tracker, which means many users can block it - like I do. Plus we know it&#x27;s not really free. There are paid alternatives like Fathom, but at $14&#x2F;month, too expensive for a tiny site like this. All I want to know is which posts are popular with some accuracy. There are self-hosted analytics like &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;ackee.electerious.com&quot;&gt;Ackee&lt;&#x2F;a&gt; and &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;plausible.io&quot;&gt;Plausible&lt;&#x2F;a&gt; that I will have to try one of these days. Cloudfare Pages comes with analytics support in the free tier. So there are options. &lt;a href=&quot;#fr-1-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-2&quot;&gt;
&lt;p&gt;Yay! &lt;a href=&quot;#fr-2-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;footer&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Notes on Mahamudra</title>
        <published>2022-01-17T00:00:00+00:00</published>
        <updated>2022-01-17T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/mahamudra-perfect-clarity/"/>
        <id>https://asun9.com/mahamudra-perfect-clarity/</id>
        
        <content type="html" xml:base="https://asun9.com/mahamudra-perfect-clarity/">&lt;p&gt;Pema Karpo, 16th century Tibetan teacher of Vajrayana Buddhism:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Don’t reflect on the past. Don’t imagine the future. Don’t meditate with deliberate conceptual labeling. And don’t regard emptiness as being nothingness. Without evaluating as right or wrong any of the objects of the five senses you perceive, face inward and, leaving your attention in naturalness, remain naturally just like an infant. Don’t let your attention wander for even an instant.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Completely abandoning the thinker and what is thought, &lt;br &#x2F;&gt;
Remain naturally like a child. &lt;br &#x2F;&gt;
If you diligently apply yourself to the words of the guru, &lt;br &#x2F;&gt;
The coemergent will surely dawn.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Tilopa&quot;&gt;Tilopa&lt;&#x2F;a&gt; also said:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Don&#x27;t reflect, don&#x27;t imagine, and don&#x27;t evaluate. Don&#x27;t meditate, don&#x27;t think, rest in naturalness.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;As the Abhidharma mentions, this mindfulness means nondistraction: “Mindfulness is not to forget the related object.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;I found this in a book on &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Dzogchen&quot;&gt;Dzogchen&lt;&#x2F;a&gt; and &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Mahamudra&quot;&gt;Mahamudra&lt;&#x2F;a&gt; meditation, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.amazon.com&#x2F;Perfect-Clarity-Padmasambhava-Guru-Rinpoche-ebook&#x2F;dp&#x2F;B00H6UOFS0&#x2F;ref=tmm_kin_swatch_0?_encoding=UTF8&amp;amp;qid=&amp;amp;sr=&quot;&gt;Perfect Clarity&lt;&#x2F;a&gt;. As straight forward an instruction as any. Now if only there were time.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>The Mughal Empire and the Unified State</title>
        <published>2022-01-08T00:00:00+00:00</published>
        <updated>2022-01-08T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/mughals-modern-state/"/>
        <id>https://asun9.com/mughals-modern-state/</id>
        
        <content type="html" xml:base="https://asun9.com/mughals-modern-state/">&lt;p&gt;The Mughal empire is usually described from the perspective of a modern state. The accepted tenet in Indian scholarship is that it was more or less a successful forerunner of the British Raj, an united political structure with an all-powerful center. For example, Irfan Habib asserts, “For a hundred and fifty years the Mughal empire covered a whole subcontinent, united under a highly centralized administration. To what did it owe its great success? … The unity and cohesion of the Mughal ruling class found its practical expression in the absolute power of the emperor.” Similar beliefs are found in Anglo-American scholarship, for example, in John F. Richards. In his work, &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.goodreads.com&#x2F;book&#x2F;show&#x2F;694023.The_Mughal_Empire&quot;&gt;The Mughal Empire&lt;&#x2F;a&gt;, he attributes the success of the Mughals to &quot;autocratic centralism.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;This view was not espoused by contemporary travelers to the Mughal empire, and all contemporary observers describe Mughal politics as an unscrupulous double game. &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Niccolao_Manucci&quot;&gt;Niccolao Manucci&lt;&#x2F;a&gt;, the 17th century Venetian writer and traveler, for example: &quot;My third book will explain the way in which the generals and commanders behave in Hindustan. They aim only at their personal advantage, and ordinarily make no account of the royal commands, except only when it is necessary in order not to be expressly found out as traitors … This sort of thing is very common in the Mughal regime … I noticed that when vassals are in the royal presence they feign to be timid and afraid of His Majesty. These gestures please him, they being the custom. The combats and conquests made by both ancient and modern Mogul kings, it is to be noted, have for the major part been won rather by deceit and false oaths than by force of arms. Never does the Mogul attack any stronghold or give battle unless he is secure of having some traitor to help him.&quot;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;history.wisc.edu&#x2F;people&#x2F;wink-andre&#x2F;&quot;&gt;Andre Wink&lt;&#x2F;a&gt;, in his book “Making of the Indo-Islamic World”, spends a considerable amount of time dismantling the commonly accepted version of the Mughal state, and makes a case for why the empire was unable to transition to a modern state. Mughal politics was the politics of sedition (fitna), and our modern concepts of the state, justice, and the law are fundamentally incompatible with the self-conception of Mughal India.&lt;&#x2F;p&gt;
&lt;p&gt;The political and legal foundations of the state were rooted in the matrix of clan rule and shared sovereignty in which feuding, sedition, self-help, and armed opposition were central and legitimate elements. The constitution of the Mughal imperialism was the tora (or code) of Genghiz Khan. The Mongols and the Timurids in Central Asia were always at war, because according to &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Turco-Mongol_tradition&quot;&gt;Turko-Mongol&lt;&#x2F;a&gt; customary law, kingship was still the shared possession or property of a corporate clan. So once a ruler dies, all the successors have an equal claim to the throne, and these successors include not just direct descendants but also close and distant relatives.&lt;&#x2F;p&gt;
&lt;p&gt;The consequences of this heritage can clearly be observed in the Mughals&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-1-1&quot;&gt;&lt;a href=&quot;#fn-1&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;. Every single emperor came to the throne by displacing rival claimants to the throne, and this displacement included acts of blinding, imprisonment and murder of ones siblings, fathers, nephews, sons and grandsons. Humayun’s reign is a long uninterrupted narrative of dramatic scenes with his three younger brothers, each rebelling and setting up their own dominions, then being captured and begging for forgiveness and starting all over again. The Mughal nobles who rebelled against Akbar were Timurids such as his half-brother Mirza Muhammad Hakim in Kabul and other Mirzas in Hindustan and Gujarat. Akbar’s dominion only increased slowly, thanks to his alliance building with the Rajputs, who were used to keep the overweening power of Akbar’s immigrant Perso-Tunisian nobilities in check. The conquest of Bengal and Gujarat Sultanate by the Akbar happened over his lifetime and was not a single event. Under Akbar, an innovation was made to the succession politics. How exactly he effected that change is not made clear, but after Akbar, the competitors to the throne were only those in the direct line, and not the extended ruling family.&lt;&#x2F;p&gt;
&lt;p style=&quot;text-align:center;&quot;&gt;&lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;mughals-modernstate&#x2F;akbarjahangir.jpg&quot; alt=&quot;Akbar and Jehangir&quot; class=&quot;center&quot;&gt;&lt;&#x2F;p&gt;
&lt;p style=&quot;text-align:center;&quot;&gt;&lt;i&gt;Akbar and Jehangir, from an European chromolithograph produced in 1801. Image from &lt;a href=&quot;http:&#x2F;&#x2F;www.columbia.edu&#x2F;itc&#x2F;mealac&#x2F;pritchett&#x2F;00routesdata&#x2F;1600_1699&#x2F;french&#x2F;racinet&#x2F;racinet.html&quot;&gt;this&lt;&#x2F;a&gt; very interesting collection.&lt;&#x2F;i&gt;&lt;&#x2F;p&gt;
&lt;p&gt;This change by Akbar did not so much signal a break with the customary law of the Turko-Mongol steppe nomads or the Code of Genghiz Khan as a transformation of it. Instead of undermining the consolidation and extension of the empire over generations by competing for loyalties within a single, delimited, fixed, and semipermanent territorial appanage, in the seventeenth century the princes were challenged to build up a support network of allies on a stage that spanned the entire empire. Rather than weakening the dynasty, princely feuding and sedition became an incorporative mechanism that allowed the empire to succeed as a distributive enterprise. It permitted the Mughal nobility to have infusions of fresh blood every few decades. As princes pursued alliances and built up their own political networks, they drew groups already subject to Mughal power into deeper relations with the dynasty. At the same time they also fostered ties to powerful individuals and groups who were on the political margins or even opposed to the dynasty. It was this transformation of Turko-Mongol succession practices that set the Mughal dynasty unique among all the empires – Islamic and otherwise – of the early modern world.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;mughals-modernstate&#x2F;jehanghir-khurram.jpg&quot; alt=&quot;Jehangir and Shah Jahan&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p style=&quot;text-align:center;&quot;&gt;&lt;i&gt;&lt;a href=&quot;https:&#x2F;&#x2F;g.co&#x2F;arts&#x2F;dRrkqxNoPXjskiJG7&quot;&gt;Emperor Jehangir Weighing His Son, Khurram&lt;&#x2F;a&gt;&lt;&#x2F;i&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Salim, later Jehangir, moved against his father Akbar, almost immediately when he was granted full adult status at the age of 16, even though he was the quasi-designated heir and his brothers had yet to reached adulthood. Inevitably, Jehangir’s reign can be described as an extended family feud, with the empire convulsed by the successive rebellions and feuds of the four sons and one grandson. Khurram, later Shah Jahan, blinded his brother and killed him, and also put to death his brother’s sons. He also killed his uncle’s two surviving sons within days of ascending the throne. Shah Jahan deliberately restricted the number of his children and only preserved four sons and four daughters, apparently by aborting other pregnancies, a practice of which his sons and grandsons also made use. Shah Jahan’s sons, virtually from the day they reached adulthood and were allowed to build their own households, and “animated by deadly hatred towards the others,” each of the sons exerted himself to the utmost to increase his political support at the expense of the others, and of their father, who “trembled for his personal safety.” Aurangzeb, who succeeded his father to the throne by first imprisoning him, put to death his brothers, and later in life, fought with his sons to keep his patrimony, killing his eldest. The career of Aurangzeb’s third son, Muhammed Akbar, is a record of almost constant obstruction, especially as viceroy of the Deccan, where he plotted with Golkonda, Bijapur, and the Maratha leader Shivaji, yet largely because of his connections in the Deccan among the Marathas and the Rajputs, as also among the Sikhs of the Panjab antagonized by his father, ultimately emerged victorious and succeeded his father in 1707 as Bahadur Shah I.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;mughals-modernstate&#x2F;shahjahan-and-sons.jpg&quot; alt=&quot;Shah Jahan and Sons&quot; &#x2F;&gt;
&lt;em&gt;Emperor Shah Jahan, with his father-in-law Asaf Khan, and his three sons, Dara Shikoh, Shah Shuja and Aurangzeb. &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.agakhanmuseum.org&#x2F;collection&#x2F;artifact&#x2F;shah-jahan-his-three-sons-and-asaf-khan-akm124&quot;&gt;Aga Khan Musem&lt;&#x2F;a&gt;&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;p&gt;After Aurangzeb and Bahadur Shah I, the Mughal empire became a shell of its former self, with the real power being wielded by the Mughal successor states like the Marathas, Hyderabad, Awadh, and briefly, the Nawabs of Bengal. There would be a Mughal emperor for another 150 years, but he was reduced to a figurehead. When the British Raj finally took over in 1857, it was the Marathas they had to confront, not the Mughals. The Marathas fought “to protect the Sultan of Taimur.”&lt;&#x2F;p&gt;
&lt;p&gt;Given the politics of succession under the Mughals, the absence of written law anywhere in Mughal India, and the confederate nature of the enterprise, a modern state based on formal rules and centralized legal order could have never arose during the time of one of the Great Mughals&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-2-1&quot;&gt;&lt;a href=&quot;#fn-2&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;. Andre Wink suggests that it would be better to consider the Mughal empire a negotiated state with a customary legal order that was based more on diplomacy and pressure and not a modern state. A state not quite at war, but also not quite at peace.&lt;&#x2F;p&gt;
&lt;br&#x2F;&gt;
&lt;p style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;FOOTNOTES&lt;&#x2F;b&gt; &lt;&#x2F;p&gt;
&lt;footer class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-1&quot;&gt;
&lt;p&gt;It is interesting to note that the Mughals - the Persianized form of Mongol - didn’t call themselves as that. They referred to themselves as Gurkanid dynasty (silsila-i-gurkaniya). Babur, in his memoirs, in fact downplays his Mongol ancestry and preferred to identify with his Turkic forbears. Gurkan was the title Timur assumed after his marriage to a Chingisid princess. &lt;a href=&quot;#fr-1-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-2&quot;&gt;
&lt;p&gt;Babur, Humayun, Akbar, Jehangir, Shah Jahan, Aurangzeb &lt;a href=&quot;#fr-2-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;footer&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>E.O. Wilson on academic in-fighting</title>
        <published>2022-01-02T00:00:00+00:00</published>
        <updated>2022-01-02T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/eo-wilson-pointers/"/>
        <id>https://asun9.com/eo-wilson-pointers/</id>
        
        <content type="html" xml:base="https://asun9.com/eo-wilson-pointers/">&lt;p&gt;Some excerpts from &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;quillette.com&#x2F;2021&#x2F;12&#x2F;29&#x2F;speaking-with-e-o-wilson&#x2F;&quot;&gt;this interesting&lt;&#x2F;a&gt; interview, recorded in 2009. Speaks a lot to the current zeitgeist.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;ON THE LEFT BIAS IN ACADEMIA&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;AD: Well, extreme leftism does seem to have become embedded in academia.&lt;&#x2F;p&gt;
&lt;p&gt;EOW: Yes, it has been. In fact, I’m glad you mentioned that. I’ve often said that the only place certain subjects are completely taboo is the university. In other words, you simply don’t bring up race anymore. You don’t bring up gender differences anymore except very gingerly in a roundabout way. And so, here at Harvard, we got rid of President [Larry] Summers, based on his slip about gender differences in physics abilities. I don’t want overstate it, but it is true that far-leftist ideology has been pretty well embedded.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;ON MISREPRESENTATION&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;AD: It must have been extremely frustrating to witness, again and again, blatant misrepresentations of your work by colleagues who ought to have known better.&lt;&#x2F;p&gt;
&lt;p&gt;EOW: It was blatantly unethical. Basically, they were seized by a kind of moral imperative. They believed what they said. Or at least they believed their assumptions about the blank slate.&lt;&#x2F;p&gt;
&lt;p&gt;AD: And they were rewarded for it. Clearly, people like Gould and Lewontin were rewarded for what they did to you and your work.&lt;&#x2F;p&gt;
&lt;p&gt;EOW: That’s why I have a certain cynical feeling towards Gould. Gould was going around attacking racists wherever he found them, especially in the early part of his career. He was the great anti-racism crusader. He acted as though other scientists were all racists or incipient racists. He almost implied that he was the champion who would step out of science as a scientist and fight racism everywhere. He had a technique. I knew him when he was a graduate student following me around. He used to be very polite and solicitous. I watched him develop into a very different kind of person.&lt;&#x2F;p&gt;
&lt;p&gt;He had a technique he repeated. He would examine some 19th century figure—one of his favorites was Louis Agassiz at Harvard, a heroic figure, a founder of the National Academy of Sciences, a man favored by Lincoln and Grant. Then Gould would “discover” a horror—that Agassiz was a racist or that he believed in the inferiority of blacks—and he would eviscerate him. But he would not note this was an almost universal misunderstanding or belief in 19th-century American society. But that was okay. Louis Agassiz’s reputation could hold up. But then Gould had a way of saying “this deeply racist sentiment has not disappeared at all in modern biology. We find it among some modern biologists.” That gave him the launching point to start attacking human genetics.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;ON DEALING WITH THE ABOVE&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;AD: Imagine for a moment that you are watching a younger version of yourself struggle with a younger version of Gould and Lewontin. How would you advise that younger version of you?&lt;&#x2F;p&gt;
&lt;p&gt;EOW: &lt;strong&gt;I think I would tell him to ignore it. Pay attention, I mean, and respond if there is some really scurrilous thing being said. But, as much as possible, ignore it, and keep working, and you’ll win in the end&lt;&#x2F;strong&gt;. I know it isn’t easy during fights. I always said to myself, “&lt;strong&gt;Don’t get into a pissing contest with a skunk.&lt;&#x2F;strong&gt;” If you ask me what I most resent about that period looking back now, I think the answer is the amount of time I wasted. I spent countless hours talking with journalists who were writing stories about all this. They’d come to me and say, “Well, Professor Lewontin just said so-and-so, Professor Gould just said so-and-so.” Or, “I’ve read in the latest thing that they’ve said this. What do you say to that?” I felt that I couldn’t sit by and let them declare me to be a racist and a proto-Nazi. I couldn’t just say, “No comment.” So, I wasted enormous amounts of energy and time I could have used for something much more valuable. &lt;strong&gt;So, my advice would be, this too shall pass. Ignore it as much as you can. Conduct yourself with dignity and with courtesy and let it pass.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;br &#x2F;&gt;
You can sense E.O. Wilson&#x27;s heavy regret at spending time defending himself when he could have used it more productively. Though E.O. Wilson was not talking about it, what’s twitter if not a pissing contest?</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Antilibrary</title>
        <published>2022-01-01T00:00:00+00:00</published>
        <updated>2022-01-01T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/antilibrary/"/>
        <id>https://asun9.com/antilibrary/</id>
        
        <content type="html" xml:base="https://asun9.com/antilibrary/">&lt;p&gt;Books I own that I hope to get to someday.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;mitpress.mit.edu&#x2F;books&#x2F;art-insight-science-and-engineering&quot;&gt;Art of Insight In Science and Engineering&lt;&#x2F;a&gt;, Sanjoy Mahajan&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;http:&#x2F;&#x2F;www.inference.org.uk&#x2F;mackay&#x2F;itila&#x2F;&quot;&gt;Information Theory, Inference, and Learning Algorithms&lt;&#x2F;a&gt;, David McKay&lt;&#x2F;li&gt;
&lt;li&gt;Structures, Or Why Things Don&#x27;t Fall Down, J.E. Gordon&lt;&#x2F;li&gt;
&lt;li&gt;The Concise Yoga Vasishta, translated by Venkatesananda&lt;&#x2F;li&gt;
&lt;li&gt;The Vernacular Veda, Vasudha Narayanan&lt;&#x2F;li&gt;
&lt;li&gt;Factfulness, Hans Rosling&lt;&#x2F;li&gt;
&lt;li&gt;The Opposing Shore, Gracq&lt;&#x2F;li&gt;
&lt;li&gt;Lolita, Nabakov&lt;&#x2F;li&gt;
&lt;li&gt;Pathways Through To Space, Franklin Merrell-Wolff&lt;&#x2F;li&gt;
&lt;li&gt;Poems to Siva: The Hymns of the Tamil Saints, Indrani Viswanathan Peterson&lt;&#x2F;li&gt;
&lt;li&gt;The Quark and the Jaguar, Gell-Mann&lt;&#x2F;li&gt;
&lt;li&gt;Other Minds, Peter Godfrey-Smith&lt;&#x2F;li&gt;
&lt;li&gt;Textures of Time: Writing History in South India 1600-1800, Narayana Rao, Shulman and Subrahmanyam&lt;&#x2F;li&gt;
&lt;li&gt;India: A Sacred Geography, Diana L. Eck&lt;&#x2F;li&gt;
&lt;li&gt;Reflections, Walter Benjamin&lt;&#x2F;li&gt;
&lt;li&gt;Lectures on the Ramayana, V.S. Srinivasa Sastri&lt;&#x2F;li&gt;
&lt;li&gt;Vachana Bharata, A.R. Krishnasastri&lt;&#x2F;li&gt;
&lt;li&gt;From Space To Sea, Abraham E Muthunayagam&lt;&#x2F;li&gt;
&lt;li&gt;Moral Dilemmas In The Mahabharata, Bimal Krishna Matial&lt;&#x2F;li&gt;
&lt;li&gt;The Seven Great Untenables (Sapta-vidhaa Anupapatti), John Allen Grimes&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>The Era of Baji Rao</title>
        <published>2022-01-01T00:00:00+00:00</published>
        <updated>2022-01-01T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/baji-rao-era/"/>
        <id>https://asun9.com/baji-rao-era/</id>
        
        <content type="html" xml:base="https://asun9.com/baji-rao-era/">&lt;p&gt;Book: &lt;strong&gt;The Era of Baji Rao: An Account of the Empire of the Deccan&lt;&#x2F;strong&gt; &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Uday S Kulkarni&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Most Indian history books are written by partisans, including many of the pop-academic ones. The ones that especially get my goat are those that try to rationalize their narrative choices under the guise of being objective, while being firmly informed by present day politics. This book is not one of those. While the author doesn&#x27;t hide his sympathies for the Marathas, at the same time he goes out of his way to present various sources describing the same event - from the Mughal archives, the Company minutes to various Maratha bakhars. Uday S Kulkarni is also admirably restrained and many times he refuses to speculate beyond a point. The book is littered with footnotes and there are some correspondences by the principal characters presented at the end.&lt;&#x2F;p&gt;
&lt;p&gt;I knew little about Baji Rao before this book, but he does seem like a worthy candidate if one were to give a name to that particular era - the first 40 years of the 18th century. He turned what was essentially a small redoubt based out of Pune and Satara into an empire spanning a large part of the country, all the way from Tungabadra to the Yamuna. The politics of the land and affairs between the various stakeholders are vividly captured - the weakened Mughal throne after Aurangzeb, the Nizam and the Marathas each maintaining the fiction that they were only governors of the Mughal emperor but essentially carving out huge chunks of the country for themselves, while also being also being at each others throats, an Mughal court that knew this but powerless to do anything about it and everyone going along with the charade. Game of thrones, anyone? Then there are the others - the Portuguese and the English on the Konkan coast doing their thing, the Siddhis and the Angrias, the Rajputs.&lt;&#x2F;p&gt;
&lt;p&gt;Everyone, including the Nizam, leveraged Maratha power to their advantage, changing allies when needed. The Nizam-ul-Mulk, even more than Muhammed Shah &#x27;Rangeela&#x27;, comes off very poorly here - bested by Baji Rao in each of their encounters, colluding with Nadir Shah and then subsequently humiliated by him during the latter&#x27;s invasion of India. It&#x27;s easy to forget that he still managed to create the most important Islamic state outside Ottoman Turkey, one that lasted till the middle of the twentieth century. Even so, it was the Marathas that were the most continuously expansionist Mughal successor state throughout much of the eighteenth century, not Hyderabad.&lt;&#x2F;p&gt;
&lt;p&gt;One thing I wish the book did better was to speculate a bit and complete the arc of some of the minor characters. For example, there’s a Brahmendra Swami, who is presented as the spiritual counsel of Baji Rao and Chimaji Appa (Rao&#x27;s brother). Their correspondences with him are used by the author to synthesize the narrative. At the end of the book, one learns that he was also a creditor - Baji Rao owed him a significant amount of money. In one instance, he is also a prime mover of the action, providing the impetus for the Maratha campaign against the Siddhis. It would have been interesting to learn more about him - Where did he come from? How did he become such a big lender? What happened to him after the deaths of Baji Rao and Chimaji Appa? There&#x27;s not much about this very interesting character on the internet either.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Shelf</title>
        <published>2022-01-01T00:00:00+00:00</published>
        <updated>2022-01-01T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/pages/recs/"/>
        <id>https://asun9.com/pages/recs/</id>
        
        <content type="html" xml:base="https://asun9.com/pages/recs/">&lt;p&gt;A list of things that I am conscious of having contributed to my world-view. Some significantly, others only slightly so. Yet others have become emotional touch-stones.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;books&quot;&gt;Books&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;The Path to Power (The Years of Lyndon Johnson, Volume 1), Robert Caro&lt;&#x2F;li&gt;
&lt;li&gt;Man’s Search For Meaning, Victor Frankl&lt;&#x2F;li&gt;
&lt;li&gt;Seeking Wisdom, Peter Bevelin&lt;&#x2F;li&gt;
&lt;li&gt;Ponniyin Selvan, Kalki.&lt;&#x2F;li&gt;
&lt;li&gt;Buddhism in the Shadow of Brahmanism, Johannes Bronkhorst and &lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;snake-mongoose-mcgovern&#x2F;&quot;&gt;The Snake and The Mongoose&lt;&#x2F;a&gt;, Nathan McGovern&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;al-hind-andre-wink&#x2F;&quot;&gt;The Making of the Indo-Islamic World, Andre Wink&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Thirukural&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;infinite-vision&#x2F;&quot;&gt;Infinite Vision&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;How will you measure your life? Clayton Christensen&lt;&#x2F;li&gt;
&lt;li&gt;Reflections on Silver River: Tokme Zongpo, translation and commentary by Ken McLeod&lt;&#x2F;li&gt;
&lt;li&gt;Who we are and how we got here, David Reich&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;movies&quot;&gt;Movies&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Aboorva Sagodhargal&lt;&#x2F;li&gt;
&lt;li&gt;Virumandi&lt;&#x2F;li&gt;
&lt;li&gt;Le Samouraï&lt;&#x2F;li&gt;
&lt;li&gt;Chinatown&lt;&#x2F;li&gt;
&lt;li&gt;Jiro Dreams of Sushi&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;video-games&quot;&gt;Video Games&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Dark_Souls_III&quot;&gt;Dark Souls 3&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;sites&quot;&gt;Sites&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Farnam Street&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;andymatuschak.org&quot;&gt;Andy Matuschak&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;commoncog.com&#x2F;blog&#x2F;a-framework-for-putting-mental-models-to-practice&#x2F;&quot;&gt;Common Cog&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;miscellaneous&quot;&gt;Miscellaneous:&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;fs.blog&#x2F;a-lesson-on-worldly-wisdom&#x2F;&quot;&gt;Charlie Munger&#x27;s USC speech.&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;fs.blog&#x2F;2015&#x2F;10&#x2F;charlie-munger-dubridge-lecture&#x2F;&quot;&gt;Charlie Munger&#x27;s Caltech Talk.&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=tuFvZ0x2GO8&quot;&gt;Ilaiyaraaja and Kamal composing.&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;thewire.in&#x2F;caste&#x2F;periyar-dalit-politics-ambedkar&quot;&gt;Constructing one particular narrative&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.thehindu.com&#x2F;society&#x2F;history-and-culture&#x2F;the-temple-was-not-a-vedic-institution-manu-v-devadevan&#x2F;article26149218.ece&quot;&gt;On mediocre Indian political discourse&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;quotes-and-anecdotes&quot;&gt;Quotes and Anecdotes&lt;&#x2F;h2&gt;
&lt;figure class=&quot;quote&quot;&gt;
    &lt;blockquote&gt;
        So convenient a thing to be a reasonable creature, since it enables one to find or make a reason for every thing one has a mind to do.
        &lt;figcaption
            style=&quot;
                font-size: 1rem;
                color: #6b7280;
                margin-top: 0.5rem;
                text-align: right;
                font-style: normal;
            &quot;
        &gt;
            — &lt;cite&gt;Ben Franklin&lt;&#x2F;cite&gt;  
        &lt;&#x2F;figcaption&gt;
    &lt;&#x2F;blockquote&gt;
&lt;&#x2F;figure&gt;
&lt;figure class=&quot;quote&quot;&gt;
    &lt;blockquote&gt;
        Books have led some to learning and others to madness.
        &lt;figcaption
            style=&quot;
                font-size: 1rem;
                color: #6b7280;
                margin-top: 0.5rem;
                text-align: right;
                font-style: normal;
            &quot;
        &gt;
            — &lt;cite&gt;Petrarch&lt;&#x2F;cite&gt;  
        &lt;&#x2F;figcaption&gt;
    &lt;&#x2F;blockquote&gt;
&lt;&#x2F;figure&gt;
&lt;figure class=&quot;quote&quot;&gt;
    &lt;blockquote&gt;
        The policy of the emperors and the senate, as far as it concerned religion, was happily seconded by the reflections of the enlightened, and by the habits of the superstitious, part of their subjects. The various modes of worship, which prevailed in the Roman world, were all considered by the people, as equally true; by the philosopher, as equally false; and by the magistrate, as equally useful. And thus toleration produced not only mutual indulgence, but even religious concord.
        &lt;figcaption
            style=&quot;
                font-size: 1rem;
                color: #6b7280;
                margin-top: 0.5rem;
                text-align: right;
                font-style: normal;
            &quot;
        &gt;
            — &lt;cite&gt;Edward Gibbon&lt;&#x2F;cite&gt; , &lt;em&gt;The Decline and Fall of the Roman Empire&lt;&#x2F;em&gt; 
        &lt;&#x2F;figcaption&gt;
    &lt;&#x2F;blockquote&gt;
&lt;&#x2F;figure&gt;
&lt;figure class=&quot;quote&quot;&gt;
    &lt;blockquote&gt;
        By Yoga is meant union through divine works done without desire, with equality of soul to all things and all men, as a sacrifice to the Supreme...
        &lt;figcaption
            style=&quot;
                font-size: 1rem;
                color: #6b7280;
                margin-top: 0.5rem;
                text-align: right;
                font-style: normal;
            &quot;
        &gt;
            — &lt;cite&gt;Aurobindo&lt;&#x2F;cite&gt; , &lt;em&gt;Essays on the Gita&lt;&#x2F;em&gt; 
        &lt;&#x2F;figcaption&gt;
    &lt;&#x2F;blockquote&gt;
&lt;&#x2F;figure&gt;
&lt;figure class=&quot;quote&quot;&gt;
    &lt;blockquote&gt;
        Riches should come as the reward for hard work, preferably by one&#x27;s forebears.
        &lt;figcaption
            style=&quot;
                font-size: 1rem;
                color: #6b7280;
                margin-top: 0.5rem;
                text-align: right;
                font-style: normal;
            &quot;
        &gt;
            — &lt;cite&gt;Steven Runciman&lt;&#x2F;cite&gt;  
        &lt;&#x2F;figcaption&gt;
    &lt;&#x2F;blockquote&gt;
&lt;&#x2F;figure&gt;
&lt;figure class=&quot;quote&quot;&gt;
    &lt;blockquote&gt;
        I believe one thing holds it all together. Everything I&#x27;ve ever done was done with excitement, because I wanted to do it, because I loved doing it. The greatest man in the world for me, one day, was Lon Chaney, was Orson Welles in Citizen Kane, was Laurence Olivier in Richard III. The men change, but one thing remains always the same: the fever, the ardor, the delight. Because I wanted to do, I did. Where I wanted to feed, I fed.
        &lt;figcaption
            style=&quot;
                font-size: 1rem;
                color: #6b7280;
                margin-top: 0.5rem;
                text-align: right;
                font-style: normal;
            &quot;
        &gt;
            — &lt;cite&gt;Ray Bradbury&lt;&#x2F;cite&gt; , &lt;em&gt;Zen And The Art of Writing&lt;&#x2F;em&gt; 
        &lt;&#x2F;figcaption&gt;
    &lt;&#x2F;blockquote&gt;
&lt;&#x2F;figure&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>An History of the Indo-Islamic World</title>
        <published>2021-12-27T00:00:00+00:00</published>
        <updated>2021-12-27T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/al-hind-andre-wink/"/>
        <id>https://asun9.com/al-hind-andre-wink/</id>
        
        <content type="html" xml:base="https://asun9.com/al-hind-andre-wink/">&lt;p&gt;Book: &lt;strong&gt;The Making of the Indo-Islamic World, 700 CE - 1800 CE&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Andre Wink&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;1864MapHindostan.jpg&quot; alt=&quot;Johnson&amp;#39;s 1866 Map of Indian Subcontinent&quot; &#x2F;&gt;
&lt;em&gt;Johnson&#x27;s 1866 map of the Indian Subcontinent&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;br&#x2F;&gt;
&lt;p&gt;Al-hind, named as such in Arabic geographical and navigational works, corresponds to the regions encompassing present-day Indian subcontinent and parts of South East Asia, all the way to the Malay-Indonesian archipelago. These are regions that share a common history where earlier Indic religions and forms of kingship flourished, followed by Islamization that took a very different form here compared to the Mediterranean world and Persia, in turn followed by complete colonization by the European empires. Andre Wink&#x27;s thesis is that history of this region can be examined as result of the interaction between the nomadic frontier and settled society and this has determined to a large extent the parameters of the Indo-Islamic world. Consequently, geography plays a big role in this thesis. The frontier society includes both the arid steppe&#x2F;saharan regions and the Indian ocean world. The books covers many different aspects of the region and its history, all viewed exclusively via this framework. Below is only a little of the many - sometimes contrarian - views that I found interesting and educational:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;The assertion that there was no continuous urban tradition in India, in contrast to Cairo, Alexandria, Cordoba and the Medterrean world. This meant while the Arab Caliphate could take over the heart of the ancient world and its urban life, it couldn&#x27;t in India.&lt;&#x2F;li&gt;
&lt;li&gt;The Shakas, Kushans, Hepthalites, and Turks being part of the nomadic continuum, with innovations by the Turks that make the Turks last longer than the other post-nomadic empires. All the nomadic empires had one superior military technology: horses. The Turks combined that with compound bow and iron armor, and importantly made an innovation in tribal political organization: the idea of absolute kingship. This military and organizational innovation made the Turko-mongols near-invincible across the Eurasian continent for several centuries.&lt;&#x2F;li&gt;
&lt;li&gt;Even the rise of Vijayanagar Empire on the back of Telugu warriors is ascribed to the deeply entrenched pastoralism of the semi-arid Deccan lands, and is also used to explain the eventual rise of the Marathas.&lt;&#x2F;li&gt;
&lt;li&gt;The Indus borderlands turned to Islam for reasons different from the Bengal frontier, with the historical trajectories of both these regions being very different from rest of the subcontinent. Here he disagrees with Richard M Eaton on how this Islamization came about. Wink says that while Bengal may have been very loosely Hindu and hence spread of Islam could be linked to the process of agricultural sedentarization, the same cannot be said for Punjab and Sindh (or for that matter, Kashmir). Here the population turned to Islam after getting battered repeatedly via multiple invasions and top-down pressure, and not because it was less Hindu in the first place (in fact, it was deeply integrated into the religious and social framework of medieval Hinduism). The tirthas and holy places that constitute the sacred geography of Hinduism gave way to Islamic shrines and “holy man” Islam. There was a good deal of iconoclastic destruction of Hindu temples. The historical trajectories of both these regions are very different from rest of the subcontinent, but for different reasons. Wink dismisses Eaton&#x27;s theory saying, &quot;..it is largely designed to fit the evidence from East Bengal.&quot;&lt;&#x2F;li&gt;
&lt;li&gt;Wink also disagrees with Eaton regarding the extent of Islamic iconoclasm. He holds that it was far more widespread than Eaton allows, and it was not just a phenomenon of the political frontier.&lt;&#x2F;li&gt;
&lt;li&gt;The Indo-Islamic world is largely the making of the Turks, not Arabs. Arabs, via trade, did influence Malabar and the Malay-Indonesian archipelago, but the Islam in the North was shaped entirely by Turko-Mongols.&lt;&#x2F;li&gt;
&lt;li&gt;Wink rejects the notion that Mughals were a a gunpowder empire. He convincingly argues that in India, even up to the times of the Marathas, cavalry played a significant role in deciding fortunes at war, not infantry and artillery.&lt;&#x2F;li&gt;
&lt;li&gt;There was no written law in Mughal India anywhere, so forget Sharia, or any Hindu code of laws. In courts of justice, payment of bribes decided the outcome of disputes. As is the case in the modern successor states, Pakistan and India, the arbitration of justice and law was usually politics by other means.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;asun9.com&#x2F;mughals-modern-state&#x2F;&quot;&gt;He also shows&lt;&#x2F;a&gt;, decisively in my mind, why the Mughal empire couldn’t have transitioned to a modern state - the Mughal politics was the politics of sedition. It encouraged sons to rebel and make alliances against their fathers and brothers and remained so till the end.&lt;&#x2F;li&gt;
&lt;li&gt;He also asserts that it is only with the collapse of the Mughals and the rise of the successor states - Hyderabad, Awad, Bengal, Marathas, Mysore and Travancore in the 18th century that &quot;.. the Indo-Islamic civilization most truly developed its hybrid potential&quot;.&lt;&#x2F;li&gt;
&lt;li&gt;&quot;Fastidious about rights and shares of revenue and taxes, the Marathas left a detailed administrative record, the largest single mass of extant indigenous material of the whole of eighteenth-century India.&quot;&lt;&#x2F;li&gt;
&lt;li&gt;To paraphrase Wu Tang Clan, C.R.E.A.M - Commerce Rules Everything Around Me. Some rulers are good at keeping a cash cow, eg Hyder Ali. Others destroy what is a good thing by needless wars in pursuit of a monopoly, eg: Tipu Sultan&#x27;s invasion of Calicut.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The scope of the book is truly monumental. Andre Wink talks about everything from the rise of the Jats and Rajputs to the spread of the Brahmins, the Indizication and Islamization of the Malay-Indonesian archipelago, chivalry in the Indo-Islamic North , the explosion of ports in India in the 16th and 17th century and along side it, the rise in trade, the origin of the mopillas, Marakkars, the fall of Surat, Calicut and Masulipatnam and the rise of Bombay, Madras and Calcutta, and a lot more.&lt;&#x2F;p&gt;
&lt;p&gt;I have highlights on almost every page, and this is probably a work I will revisit often. I do have more than a few disagreements. One day I will have to tackle the 5 volume predecessor, which Wink references often in his footnotes.&lt;&#x2F;p&gt;
&lt;p&gt;Very much recommended.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Reading the Ramayana as an Adult</title>
        <published>2021-12-24T00:00:00+00:00</published>
        <updated>2021-12-24T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/reading-ramayana-as-adult/"/>
        <id>https://asun9.com/reading-ramayana-as-adult/</id>
        
        <content type="html" xml:base="https://asun9.com/reading-ramayana-as-adult/">&lt;p&gt;Book: &lt;strong&gt;Ramayana, A Modern Retelling&lt;&#x2F;strong&gt; &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Ramesh Menon&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;It is said that in India you never read the Ramayana or Mahabharata for the first time. As a child you are already exposed to many re-tellings from your parents, aunts, grand parents and passing strangers before you even learn to read. I thought this was a story I was already very familiar with. I only discovered how little I remembered when one afternoon I found myself having to entertain a dear friend’s baby and got done with it in a few minutes.&lt;&#x2F;p&gt;
&lt;p&gt;I started reading &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.amazon.com&#x2F;Ramayana-Modern-Retelling-Great-Indian&#x2F;dp&#x2F;0865476950&#x2F;ref=sr_1_1?crid=14M83A359ED87&amp;amp;keywords=Ramesh+Menon+Ramayana&amp;amp;qid=1659626160&amp;amp;s=books&amp;amp;sprefix=ramesh+menon+ramayana%2Cstripbooks%2C184&amp;amp;sr=1-1&quot;&gt;Ramesh Menon&#x27;s version of Ramayana&lt;&#x2F;a&gt; to refresh my memory and to ensure that I keep other babies I encounter engaged for more than a few minutes. Of course I also want contribute to the child’s moral upliftment, thus continuing at least one grand Indian tradition. Hopefully the parents will be appropriately grateful for my services.&lt;&#x2F;p&gt;
&lt;p&gt;Considering the other books I am reading at the moment, I found this version very refreshing, without any cynicism I had come to expect with writing about Indian mythology (or history, if you will). The author’s attitude towards the text is stated at the beginning - that of Bhakti towards Rama. All through the various retellings in most of it&#x27;s history in India, this is also how the text was recieved, with reverence. Menon writes well, with the right amount of translations of Sanskrit terms that doesn’t affect the flow of the text. There are some missing parts that I remember from popular narrative - nothing of Angada’s growing throne of tail, for example. I am assuming that&#x27;s to keep the plot tight. I have versions of Kamban&#x27;s Ramavataram and Tulisdas&#x27; Ramcharitramanas on my shelf. I don&#x27;t have Valmiki&#x27;s Ramayanam however. I do hope to get my hands on it some day and more importantly, make some time to explore further this long-beating heart of India.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Deconstructing Bhakti Movement</title>
        <published>2021-02-06T00:00:00+00:00</published>
        <updated>2021-02-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/bhakti-decon/"/>
        <id>https://asun9.com/bhakti-decon/</id>
        
        <content type="html" xml:base="https://asun9.com/bhakti-decon/">&lt;p&gt;Book: &lt;strong&gt;Storm of Songs: India and the Idea of the Bhakti Movement&lt;&#x2F;strong&gt; &lt;br &#x2F;&gt;
Author: &lt;strong&gt;John Stratton Hawley&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Hawley, a professor of religion at Barnard College of Columbia University, contests the idea of a Bhakti “movement” . There was an outpouring of devotional literature in the late medieval - early modern India, but the narrative of a movement, a fire starting with the Alwars and Nayanmars in the south in the middle of the first millennium spreading to the north till it encompasses the whole country is just that, a narrative. The Bhakti movement idea meant - and means - many things to many people, based on their caste affiliation, their community, their region, language and faith. It cannot be a movement because there was no well considered goal, nor a people’s agenda. Hawley&#x27;s thesis is that the idea of a movement to describe what happened originated during the independence movement at Tagore’s Shantiniketan. One reason for this is Hazaripradas Dvivedi’s and others reading of Nabhadas’ Bhatkamal, composed in the 16th century, and accepting it at face value. Bhatkamal proposes a sampradaya for each for different 800 different bhaktas it describes, and each of the sampradayas has a southern origin - Ramanuja, or Madhava, or Visnuswami. Hawley suggests this is the reason for the south-north journey of bhakti in common imagination. He finds no evidence for this southern origin, and contends that the popularity of the sampradaya model of northern Bhakti is itself of early modern origin, thanks to the attempts of a Sawai Jai Singh to homologize the public religious culture of 18th century Jaipur. Before that, Mughal rule, ironically, led to the explosion of distinct Hindu communities in the north around the 15th and 16th centuries, thanks to improvement in trade routes, guilds and road networks.&lt;&#x2F;p&gt;
&lt;p&gt;By now it should be evident that Bhakti movement described in this book is a purely northern (and eastern) affair, even though it claims a southern origin. There is no mention of any of the Virasaivas - Basavanna, Allama Prabhu - or any other southern expressions of Bhakti, including that of the Alvars and Annamayya in the anthologies and hagiographies produced in the North till the early twentieth century. If there’s no movement, how does one describe the explosion of the devotional literature that heralded the 15th and 16th and thence? Hawley prefers to call it a network, in part to displace the notion that the individual bhaktas - Surdas, Kabir, Tulsidas, Chaitanya - are the engines of history, and instead focus on the acts of collective authorship, a construction of collective memory. This makes sense in a way, since it seems like many people composed in the name of the historical Kabir and Surdas. When one speaks of Kabir&#x27;s dohe, what one is speaking of is the community that ended up producing the songs in his name and in his style. So a network, not a movement, but plenty of movement within the network. Genres and tropes are shared. For example, the bhaktas meet in the hagiographies - Mira goes in search of Kabir and Ravidas, Ravidas in search of Kabir, Namdev is a friend of Cokhamela. In Tamil, there’s the story of how Alvars became Alvars in the first place: three of them took refuge from a torrential downpour in a hut. With three there was no place to sleep or rest, so they sing the night away. If there was a flow in a direction, it’s probably from north to south as the Marathas make court in Tanjavur. That has its documented effect on Carnatic music, for example. &lt;&#x2F;p&gt;
&lt;p&gt;How curious that the South was an ideal in the northern mind in the 15th century. How curious that the Bhakti bhajans of the north are decisively Vaisnavite in character. How did Nabhadas get the idea of Ramanuja? And if he did, Ramanuja from the South as a signifier of prestige was already available for him. How did the idea of Ramanuja make that journey from Srirangam? While Hawley interrogates all the narratives available to us that answer some of these questions, he is unable to provide any convincing alternatives. His reframing of the bhakti movement as a bhakti network is also a tad pedantic - all I could think of during the denouement was, “so what?”. He also, like many other historians of Medieval India, has his eyes firmly on the current political landscape. While he spends a considerable amount of time on Vrindavan and the building of the Keshavadeva temple, he nimbly skips any mention of its eventual destruction. Reading this text one would assume that the original temple was still standing. At the same time he doesn’t show as much reticence when talking about current zeitgeist and the events in India over the past few decades. These quibbles aside, I enjoyed this exploration of the late medieval north, one that is not focused on king and empire.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Book Notes: Writing To Learn By William Zinsser</title>
        <published>2021-02-02T00:00:00+00:00</published>
        <updated>2021-02-02T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/notes-on-writing-to-learn/"/>
        <id>https://asun9.com/notes-on-writing-to-learn/</id>
        
        <content type="html" xml:base="https://asun9.com/notes-on-writing-to-learn/">&lt;p&gt;&lt;strong&gt;Summary&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Writing is an aid to thinking. By forcing oneself to put things on paper, one forces oneself to think and reason clearly. Good writing is lots of editing. Writing is also a craft. Go to work everyday.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Notes&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Clear writing is the logical arrangement of thought; a scientist who thinks clearly can write as well as the best writer. My book, in short, would be mainly an anthology—a guided tour of good writing in different crannies of the B.A. curriculum.&lt;&#x2F;li&gt;
&lt;li&gt;I thought of how often the act of writing even the simplest document—a letter, for instance—had clarified my half-formed ideas. Writing and thinking and learning were the same process.&lt;&#x2F;li&gt;
&lt;li&gt;Writing is thinking on paper. Anyone who thinks clearly should be able to write clearly—about any subject at all.&lt;&#x2F;li&gt;
&lt;li&gt;Writing is learned by imitation. “I learned to write mainly by reading writers who were doing the kind of writing I wanted to do and by trying to figure out how they did it. S. J. Perelman told me that when he was starting out he could have been arrested for imitating Ring Lardner. Woody Allen could have been arrested for imitating S. J. Perelman.”&lt;&#x2F;li&gt;
&lt;li&gt;Writing organizes and clarifies our thoughts. Writing is how we think our way into a subject and make it our own. Writing enables us to find out what we know—and what we don’t know—about whatever we’re trying to learn. Putting an idea into written words is like defrosting the windshield: The idea, so vague out there in the murk, slowly begins to gather itself into a sensible shape. Whatever we write—a memo, a letter, a note to the baby-sitter—all of us know this moment of finding out what we really want to say by trying in writing to say it.&lt;&#x2F;li&gt;
&lt;li&gt;Probably no subject is too hard if people take the trouble to think and write and read clearly. Maybe, in fact, it’s time to redefine the “three R’s”—they should be reading, ’riting and reasoning. Together they add up to learning. It’s by writing about a subject we’re trying to learn that we reason our way to what it means&lt;&#x2F;li&gt;
&lt;li&gt;&quot;...one is that writing is linear and sequential. If sentence B logically follows sentence A, and if sentence C logically follows sentence B, I’ll eventually get to sentence Z. I also try to remember that the reader should be given only as much information as he needs and not one word more. Anything else is a self-indulgence.&quot;&lt;&#x2F;li&gt;
&lt;li&gt;Prior knowledge of the subject, incidentally, isn’t a requirement; only the ability to arrange information in narrative order.&lt;&#x2F;li&gt;
&lt;li&gt;Readers must be given room to bring their own emotions to a piece so crammed with emotional content; the writer must tenaciously resist explaining why the material is so moving.&lt;&#x2F;li&gt;
&lt;li&gt;“I don’t like to write, but I take great pleasure in having written—in having finally made an arrangement that has a certain inevitability, like the solution to a mathematical problem. Perhaps in no other line of work is delayed gratification so delayed.”&lt;&#x2F;li&gt;
&lt;li&gt;Only by repeated applications of process—writing and rewriting and pruning and shaping—can we hammer out a clear and simple product.&lt;&#x2F;li&gt;
&lt;li&gt;Writing is a tool that enables people in every discipline to wrestle with facts and ideas. It’s a physical activity, unlike reading. Writing requires us to operate some kind of mechanism—pencil, pen, typewriter, word processor—for getting our thoughts on paper. It compels us by the repeated effort of language to go after those thoughts and to organize them and present them clearly. It forces us to keep asking, “Am I saying what I want to say?” Very often the answer is “No.” It’s a useful piece of information.&lt;&#x2F;li&gt;
&lt;li&gt;My advice to Type A writers begins with one word: Think! Ask yourself, “What do I want to say?” Then try to say it. Then ask yourself, “Have I said it?” Put yourself in the reader’s mind: Is your sentence absolutely clear to someone who knows nothing about the subject? If not, think about how to make it clear. Then rewrite it. Then think: “What do I need to say next? Will it lead logically out of what I’ve just written? Will it also lead logically toward where I want to go?” If it will, write the sentence. Then ask yourself, “Did it do the job I wanted it to do, with no ambiguity?” If it did, think: “Now what does the reader need to know?” Keep thinking and writing and rewriting. If you force yourself to think clearly you will write clearly. It’s as simple as that. The hard part isn’t the writing; the hard part is the thinking.&lt;&#x2F;li&gt;
&lt;li&gt;Type B writing—exploratory writing—requires no such cogitation, no prior decisions about which road to take; the road will reveal itself.&lt;&#x2F;li&gt;
&lt;li&gt;Ambiguity is noise. Redundancy is noise. Misuse of words is noise. Vagueness is noise. Jargon is noise. Pomposity is noise. Clutter is noise: all those unnecessary adjectives (“ongoing progress”), all those unnecessary adverbs (“successfully avoided”), all those unnecessary prepositions draped onto verbs (“order up”), all those unnecessary phrases (“in a very real sense”). Information is your sacred product, and noise is its pollutant. Guard the message with your life.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Writing is a craft, and a writer is someone who goes to work every day with his tools&lt;&#x2F;strong&gt;, like the carpenter or the television repairman, no matter how he feels, and if one of the things he wants to produce by 6 P.M. is a sense of enjoyment in his writing, he must generate it by an act of will. Nobody else is going to do it for him.&lt;&#x2F;li&gt;
&lt;li&gt;&quot;...that chance favors the prepared mind, and certainly it’s true that writers, in some corner of their conscious or subconscious brain, are always working. A writer should always be ready to be lucky.&quot;&lt;&#x2F;li&gt;
&lt;li&gt;Writers who think they are being criticized when only their writing is being criticized are beyond a teacher’s reach. Writing can only be learned when a writer coldly separates himself from what he has written and looks at it with the objectivity of a plumber examining a newly piped bathroom to see if he got all the joints tight.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Infinite Vision</title>
        <published>2021-01-25T00:00:00+00:00</published>
        <updated>2021-01-25T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/infinite-vision/"/>
        <id>https://asun9.com/infinite-vision/</id>
        
        <content type="html" xml:base="https://asun9.com/infinite-vision/">&lt;p&gt;Book: &lt;strong&gt;Infinite Vision&lt;&#x2F;strong&gt; &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Pavithra Mehta&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Looking back on my years in India, I realized a while ago that I didn&#x27;t have many examples of excellence from the subcontinent growing up, outside sport and culture. Since I only consumed books in english as a child, my heroes were all British or American. Or folks that the Brits or Americans regarded as exceptional, who almost always turned out to be from the West. Edison. Faraday. Maxwell. Newton. Einstein. There were some exceptional Indians I was aware of though, in part due to conversations with my mother and uncle, both part of the ISRO&#x2F;DoD universe - Homi Bhabha, Satish Dhawan, CV Raman. Of them, all I knew was that they were institution builders, which back then I didn&#x27;t think much of. No case studies, no narratives about the effort it takes to build these extremely effective scientific institutions in India. Nothing to inspire a child. As a consequence, they did not have as much of an impact as these other, better documented lives.&lt;&#x2F;p&gt;
&lt;p&gt;Only lately have I realized that India over the last century has produced some remarkable people who have had an outsized impact on the country, and directly or indirectly, on me. There are engineering, scienc-y, non-traditional heroes in India, the anglophone world just doesn&#x27;t talk about them. And by the virtue of the media I consume, I have remained ignorant of their achievements so far. I am trying to compensate for it now, well into adulthood. At the very top of this list is Dr Govindappa Venkataswamy (Dr. V), and the organization he started, Aravind.&lt;&#x2F;p&gt;
&lt;p&gt;Aravind is a chain of eye hospitals based out of Madurai. By all measures it&#x27;s enormously successful. Aravind has a presence in many big and small towns in Tamil Nadu, and in Tirupati, Andhra Pradesh.  Aravind also has partnership projects in Calcutta, India, Nigeria, Bangladesh. Aravind, via Aurolabs, also make intraoracular lenses, manufacturing and selling these lenses at a fraction of the cost it sells in other countries. Most of Aurolabs profits in turn go to charities. But what&#x27;s remarkable about Aravind is not its growth and success. It&#x27;s the model in which it&#x27;s run that belies belief. Aravind is for all means and purposes a charity. No, it doesn&#x27;t accept donations, but &lt;strong&gt;patients are free to pay what they want for its services&lt;&#x2F;strong&gt;. No obligations. Aravind might be most successful eye care clinic in the world. In its 40 year existence, it has treated nearly 32 million patients and successfully performed 4 million surgeries, with a complication rate less than that of UK hospitals. In the context of India&#x27;s largely unregulated health care system, this is remarkable, along with the devotion to quality expressed by Aravind. How can a business whose model is based on &quot;pay-as-you-like&quot; thrive? To answer that question, we must go Dr V.&lt;&#x2F;p&gt;
&lt;p&gt;Ralph Waldo Emerson said institutions are lengthened shadow of the men who found them. This is true as far as Aravind is concerned. Dr V wanted a career in obstetrics, and found his dreams crash when he became permanently crippled by rheumatoid arthritis. He remained phlegmatic, “It was difficult, but then you move on.” He turned to the eye department in his university instead. Operating on the eye required more nimble skill than physical strength in the fingers. He still had to train his gnarled fingers to hold the scalpel and cut the eye for cataract operations. He did that, through his official career, running government programs. By the time he was 58, India’s mandatory retirement age from government service, Dr. V had served as an ophthalmologist, an educator, and a national public health figure. He had already personally performed over 100,000 surgeries, pioneered a hugely successful outreach model, trained hundreds of young doctors as vice principal and dean of the Madurai Medical College, and been awarded a Padma Shri (one of India’s highest honors). He then decided, at his retirement, he would dedicate the rest of his life to eliminating needless blindness. To do that, he recruited his siblings, and they joined without needing much persuasion. After all, he brought them up, and for all means he was their father. In India, at one time, this was enough. He did not have capital or business, but he did have a punishing work ethic, and that would do at the beginning.&lt;&#x2F;p&gt;
&lt;p&gt;Aravind, right from the start, was conceived as a vehicle to eliminate blindness, not make money. Its purpose was set. Every action will revolve around compassion. No compromise on quality. The only question was how to build a self-sustaining organization around that purpose. It would not depend on charity and it needed to be self-sufficient. His sister, Dr. Natchiar, says:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;“Dr. V was able to get into the lives of the patients. Before they suffered, he suffered. ‘Blindness kills a person every day,’ he used to say. ‘It takes away their sight, respect, and decision-making authority. Our job is not just to bring them vision,’ he would tell us. ‘How do we get them back their dignity?’&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;How did Dr V manage to pull it off? Among other things, he was a systems thinker before that term became popular in the valley. He viewed blindness as  a systems problems with severe consequences for the society. First he tackled the pipeline problem - getting enough patients to come to Aravind. If they wouldn’t come, he would send buses to villages to bring them in, for free. Then he focused on the quality of the hospitals itself. It had to look like a hotel. People should feel safe there. It should reflect that Indian ethos, “athiti devo bhava”, and not repel people. Then there was the recruiting. Since the problem he was solving needed compassion foremost, he didn’t focus on skills. He regarded character as more important and hired young women. Training he could offer. Character would be harder. He had protocols for everything - hiring, devising career tracks for employees, mentoring individual doctors into leadership positions. Most importantly, he ensured that the personal growth of his doctors and nurses and staff was tied to the growth of Aravind, and that there was no conflict on interest. Anything that would drive and reinforce the core values of equitable care, high quality, compassion, and transparency. &quot;He knew that strong, mission-aligned processes and protocols could mitigate the threat introduced by individual deviations. In an organization that functioned at such a massive scale, this was all the more important”, says Fred Munson, a friend of Aravind and Dr.V. There’s a remarkable anecdote by Dr. Ramachandra Pararajasegaram, a consultant with the World Health Organization. He had travelled with Dr.V for a conference: “In Frankfurt, we were at the airport together, and he called me to watch a plane land. You could see one trolley coming to take baggage, another for loading the trash. ‘That’s how we should run our operating theater,’ Dr. V said. He is able to pick up cues like that. He even asks housekeepers at hotels about their training curriculum and the proper method of bed making. He has that kind of inquiring mind, and he applies the lessons he learns to Aravind.”&lt;&#x2F;p&gt;
&lt;p&gt;Dr V spent all his time thinking about making Aravind serve its purpose. His journals record his obsessions. &quot;How to bring that hospitality and culture in our hospitals and camps. The ordinary man must feel at home. At Aravind, the nurses—themselves from villages—are beacons of comfort, guiding patients through the maze of medical care. Their specialized skills, honed by repetition, not only enhance quality and allow for high patient throughput but also nurture a sense of individualized care. I have been doing yoga since 1936, from the age of 18 years, consciously, or unconsciously. My interest in my profession is how to make this work a field for inner growth and perfection. Aravind Hospital aims at bringing higher consciousness to transform mind and body and soul of people. It is not a mechanical structure repairing eyes. It has a deeper purpose. Intelligence and capability are not enough. There must be the joy of doing something beautiful. Institutions should be like temples. I must spend more time developing the children mentally and physically,&quot; (He uses the word yoga to define any movement toward perfection. In medical school, Dr. V had a professor who upheld Sri Aurobindo’s maxim “All life is yoga.”)&lt;&#x2F;p&gt;
&lt;p&gt;Yoga. Sri Aurobindo. Higher consciousness. Dr. V’s engine of personal transformation was his spirituality. In one of his journal entries he asks “How do I become the perfect instrument?”  One cannot divorce Aravind’s success from Dr V, and likewise Dr V’s from his “sadhana”. He spent every morning with Sri Aurobindo’s Savitri. Before starting Aravind, he consulted the “mother” at Auroville - Aurobindo’s Ashram in Pondicherry. He regarded his work as a means to transcendence. This reminds me of something that Gandhi once said in his journals: “What I want to achieve—what I have been striving and pining to achieve these thirty years—is self-realization, to see God face to face... All that I do by way of speaking and writing, and all my ventures in the political field, are directed to this same end.” Dr. V believes Aravind’s work is a manifestation of Sri Aurobindo and the Mother’s influence. Whether this is true is irrelevant. The objectives, systems, and culture of Aravind certainly do not demand belief in spirituality. But the fact remains that they were created and distinctly shaped by one man’s sense of an inner reality. This is why you cannot give short shrift to Dr. V’s spirituality when tracing the path of Aravind’s evolution. It threads through everything: his priorities and perspectives, his vision for Aravind, his leadership practices, and the unique impact he has on the people who work with him. It is what linked this man’s individual quest to the evolution of the largest eye care facility in the world.&lt;&#x2F;p&gt;
&lt;p&gt;If this is the effect religion has on some people, there should be more of it.&lt;&#x2F;p&gt;
&lt;p&gt;Dr V was fond of pointing out that the Madurai Meenakshi Amman temple, whose proud towers stud the skyline of that city, was not the work of a single ruler. It was a creation of dedication, ingenuity, and selflessness that spanned multiple generations. And the result is a transcendent gift to the world. According to Dr. V, it could be the same with institutions. This was part of his aspiration for Aravind, and because of it, he held himself and his team to a set of powerful, unwritten directives.&lt;&#x2F;p&gt;
&lt;p&gt;I am glad to have discovered Dr V this past year. And I am glad this book exists, especially in these cynical times where anything related to India or religion is only examined with a hyper-critical lens. Aravind Eye Hospital, Madurai is proof ethical wealth creation is possible, and compassionate businesses can not just exist, but thrive.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Lessons from Aravind Eye Care System</title>
        <published>2021-01-25T00:00:00+00:00</published>
        <updated>2021-01-25T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/lessons-aravind-eye/"/>
        <id>https://asun9.com/lessons-aravind-eye/</id>
        
        <content type="html" xml:base="https://asun9.com/lessons-aravind-eye/">&lt;p&gt;From &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.mckinsey.com&#x2F;~&#x2F;media&#x2F;mckinsey&#x2F;dotcom&#x2F;client_service&#x2F;Healthcare%20Systems%20and%20Services&#x2F;Health%20International&#x2F;Issue%2011%20new%20PDFs&#x2F;HI11_18%20AravindEyeCareSys_noprint.ashx&quot;&gt;this&lt;&#x2F;a&gt; interview of Dr. Srinivasan from Aravind Eye Hospitals:&lt;&#x2F;p&gt;
&lt;p&gt;Q: What lessons have you learned that explain Aravind&#x27;s success?&lt;&#x2F;p&gt;
&lt;p&gt;Dr. Srinivasan: Perhaps the most important lesson we have learned is this: keep everything very simple. &lt;strong&gt;And keep everything close to mission so that people understand why we do what we do.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Second, &lt;strong&gt;we have also learned how important it is to have a strong value system - a value system we believe in passionately.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Third, we have realized that we have to keep a sharp focus on our delivery system. When Dr. V kept talking initially about McDonald&#x27;s, most of us didn&#x27;t get his point. But now that we have seen the impact of his approach, we understand his vision. Achieving scale and improving productivity has enabled us to keep costs down and treat hundreds of thousands of patients each year. It has allowed us to give back to society, to the communities.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Questions As Models</title>
        <published>2021-01-09T00:00:00+00:00</published>
        <updated>2021-01-09T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/questions-as-models/"/>
        <id>https://asun9.com/questions-as-models/</id>
        
        <content type="html" xml:base="https://asun9.com/questions-as-models/">&lt;p&gt;Some questions stop me in my tracks and force me to examine my assumptions about the world. As mental models, I think they are very valuable tools in enabling one to step back from the default processes running in our heads and consider other perspectives. This is a running list of questions that have done that for me. Often, this is the only thing I take away from the books I consume, no matter what else the book is about.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;When thinking about where you’re going, really look around at who you’ve been, who you are now, where you are now. &lt;br &#x2F;&gt;
To begin to figure those things out, it’s helpful to reflect on questions like, “Have I been and am I being kind? Am I being curious? Am I leaning into difficult places?” That’s where I think our opportunity is.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Jerry Colonna, Reboot&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;A great commonality we all share is that we only have today to invest in what could outlive us. After today, there are no guarantees. As Mark taught me, every hour you devote to answering the question “What are you doing for others?” becomes something that gets to live on.
Every morning, wake up and remind yourself: it’s not about me. Then ask yourself: How can I contribute to another person’s life today?&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Tom Rath, It’s Not About You&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;The questions you ask shape the answers you find. “How much can we give?” was not the end of Dr. V’s querying. A journal entry from the 1980s, written in a series of eclectic questions (and with his trademark absence of question marks), illustrates how intertwined matters of service delivery, leadership, and spirituality are to Dr. V.
It opens with the magnificent obsession he is known for: How to organize and build more hospitals like McDonalds. And then with no warning, it shifts to, How was Buddha able to organize in those days a religion that millions follow. This question dramatically changes the plane of inquiry. Other searching questions swiftly follow: Who were the leaders. How were they shaped. How did the disciples of Christ spread their mission around the world.
And then a final question that he would ask in a thousand different ways: How do I become a perfect instrument.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Dr.V, Infinite Vision&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;What Should You Spend Less Time Doing:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;What do I spend too much time doing?&lt;&#x2F;li&gt;
&lt;li&gt;What bores me? What do I dread doing?&lt;&#x2F;li&gt;
&lt;li&gt;What do I do that other people could do?&lt;&#x2F;li&gt;
&lt;li&gt;Where do I procrastinate?&lt;&#x2F;li&gt;
&lt;li&gt;What time-consuming activities do I repeat?&lt;&#x2F;li&gt;
&lt;li&gt;Where do I usually make mistakes?&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;David Perrell&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;What You Should Spend More Time Doing:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;What gives me energy?&lt;&#x2F;li&gt;
&lt;li&gt;What are my unique gifts in the world?&lt;&#x2F;li&gt;
&lt;li&gt;What makes me feel alive?&lt;&#x2F;li&gt;
&lt;li&gt;What puts me into a flow state?&lt;&#x2F;li&gt;
&lt;li&gt;What feels like play to me, but looks like work to others?&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;David Perrell&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;We dabbled in enterprise, and we sucked at it. This is a humbling business. It’s really hard to be good. We asked ourselves, and every startup should ask itself, ‘What do you do better than others, and how does that concentration work in your favor? What do you do well?’&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Dan Levitan, A Dozen Lessons for Entrepreneurs&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;The thing that worked best for me is to be relentlessly driven by the desire to solve problems I really care about, and to be open to changing my mind along the way when I learn new things. A lot of successful entrepreneurs do this. They pick a vision of something that’s important, and work as hard as they can to make it happen. Act as if you already know that you won’t fail. What would you do if you knew that you wouldn’t fail?&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Sebastian Thurn, some reddit AMA&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;“How would you compete against yourself?” Every business should be thinking about what could threaten them since their competitors are almost certainly doing so. The mental exercise I am suggesting here is essentially a stress test: Ask yourself, “What would we do if we were our competitors?”&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Vinod Khosla, A Dozen Lessons for Entrepreneurs&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;How will you measure you life?&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Clayton Christensen&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Edited: Feb 10, 2025:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;i hate how well asking myself &quot;if i had 10x the agency i have what would I do&quot; works&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;nickcammarata.com&quot;&gt;Nick Cammarata&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;, on twitter.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Fruits of Our Desiring</title>
        <published>2020-07-06T00:00:00+00:00</published>
        <updated>2020-07-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/fruits-desiring/"/>
        <id>https://asun9.com/fruits-desiring/</id>
        
        <content type="html" xml:base="https://asun9.com/fruits-desiring/">&lt;p&gt;Book: &lt;strong&gt;The Fruits of Our Desiring: An Enquiry Into the Ethics of the Bhagavadgītā for Our Times&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Multiple&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;A wonderful collection of essays from some of the leading theologians and Indologists of the 90s (and now?) on the Gita and its many interpretations. That both Gandhi and his killer Godse both used Gita to develop a framework for their actions only speaks to the fact that many such interpretations are possible and continue to be made, and attests to the status of the Gita as a living text. Julius Lipner, in the introduction, makes a case against those claiming to be objective when examining the text:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;... the &quot;objective&quot; scholar inevitably, indeed constitutionally, brings a host of &quot;subjective&quot; selective criteria to bear in pursuit of his or her professional work, such as one&#x27;s particular academic conditioning, temperament and personal prejudices, and the current political environment in which one must function (think of the corrective and distortive effects of political correctness). These guiding and constitutive criteria of &quot;objective&quot; scholarship are expressions of faiths&#x2F;personal commitments too, and affect the form and content of one&#x27;s conclusions.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Since I have been emotionally committed to that conclusion for a while now, I endorse the sentiment wholeheartedly. Interestingly, the essay&#x2F;interpretation that I thought was the weakest, &quot;Possessing the world&quot;, is by the lone Indian in the group.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>LKY: From Third World to the First</title>
        <published>2020-04-13T00:00:00+00:00</published>
        <updated>2020-04-13T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/lky-third-world-first/"/>
        <id>https://asun9.com/lky-third-world-first/</id>
        
        <content type="html" xml:base="https://asun9.com/lky-third-world-first/">&lt;p&gt;I really like books by old folks looking back on a life well-lived. This is one of those. Below are some of my thoughts on the book.&lt;&#x2F;p&gt;
&lt;p&gt;LKY chose to organize the book by issues he had to tackle, and the countries he had relations with. Each chapter covers Singapore’s dealings with a country or response to a crisis, from its genesis to the end of the 1990s. This is unlike most other memoirs or biographies where the narrative progresses linearly through time. One advantage of LKY’s approach is that it didn’t overwhelm this reader, and simultaneously offered a view into LKY’s mind. Each problem, spanning a few chapters, was clearly explicated, with the motivations of all the parties involved examined. Some problems take decades to solve, if it could be solved at all. Unfortunately this approach to telling LKY’s story is also a slight disservice to the man. Halfway through the book one realizes that while Singapore is dealing with American spies, they were also trying to convince the Tunku of Malaysia into giving concessions, survive Indonesia’s Konfrontasi, avoid insurrection by the Singaporean and Malay communists, figuring out how to make English the language of the union without losing popular support, greening the city, and the training of their armed forces by the then-unrecognized state of Israel. All at the same time! This is not at all evident from the narrative. That LKY did all this simultaneously and came on top of each one speaks to the man’s talents.&lt;&#x2F;p&gt;
&lt;p&gt;One also learns that he meditated daily and took personal notes after every meeting. That he had to take notes was evident from the book - he wouldn’t have been able to write about every encounter so throughly if he were not recording them. Meditation was surprising. I do not know yet of any world leader making a habit of meditation, or ascribing to it therapeutic qualities. Even more interesting was the fact that LKY took up meditation after it was recommended to him by the Japanese PM Yashuhiro Nakasone. Nakasone, it turns out, was a practicing Zen Buddhist who meditated for two hours in a temple every week, sitting in the lotus position.&lt;&#x2F;p&gt;
&lt;p&gt;I particularly enjoyed the recounting of his tussles with the western press and academia, and the dismantling of their sanctimonious attitudes towards Singapore’s version of a prosperous society. LKY might be dead, but Singapore is thriving and did not implode, contrary to what the “free” press liked to proclaim then (and still does). Not all systems are equal, and none universal. Each society must find its own way. Of the many examples available, one only needs to look at Singapore’s response to the current pandemic versus that of the Western world regarding the effectiveness of its approach. The government is radically transparent and its citizens have a high level of trust in it, in no small part because of the system of checks and balances established by LKY and his compatriots. Who wouldn’t want a society and a governance like that? Singapore is evidence that the carrot and stick approach to designing human behavior works as well with kids as it does in a creating a civil society.&lt;&#x2F;p&gt;
&lt;p&gt;LKY, in the last chapter, says &lt;strong&gt;“If there was one formula for our success, it was that we were constantly studying how to make things work, or how to make them work better. I was never a prisoner of any theory. What guided me were reason and reality. The acid test I applied to every theory or scheme was, would it work? This was the golden thread that ran through my years in office. If it did not work, or the results were poor, I did not waste more time and resources on it. I almost never made the same mistake twice, and I tried to learn from the mistakes others had made.”&lt;&#x2F;strong&gt; Words to live by in any line of work.&lt;&#x2F;p&gt;
&lt;p&gt;P.S: Now that I am working my way through Caro’s LBJ series, it is interesting to contrast LBJ’s effectiveness with LKY’s. LKY’s appraisals of U.S. presidents include LBJ. Two men acquiring and wielding political power in two very different climates to do a great amount of good, that deserves an essay by itself.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>On Curiosity</title>
        <published>2019-12-19T00:00:00+00:00</published>
        <updated>2019-12-19T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/on-curiosity/"/>
        <id>https://asun9.com/on-curiosity/</id>
        
        <content type="html" xml:base="https://asun9.com/on-curiosity/">&lt;p&gt;&lt;strong&gt;SEBASTIAN THURN&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The thing that worked best for me is to be relentlessly driven by the desire to solve problems I really care about, and to be open to changing my mind along the way when I learn new things. A lot of successful entrepreneurs do this. They pick a vision of something that’s important, and work as hard as they can to make it happen. Act as if you already know that you won’t fail. What would you do if you knew that you wouldn’t fail?&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;PAUL GRAHAM&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;When you look at the lives of people who&#x27;ve done great work, you see a consistent pattern. They often begin with a bus ticket collector&#x27;s obsessive interest in something that would have seemed pointless to most of their contemporaries. One of the most striking features of Darwin&#x27;s book about his voyage on the Beagle is the sheer depth of his interest in natural history. His curiosity seems infinite. Ditto for Ramanujan, sitting by the hour working out on his slate what happens to series.&lt;&#x2F;p&gt;
&lt;p&gt;If I had to put the recipe for genius into one sentence, that might be it: to have a disinterested obsession with something that matters.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;JOHN CARMACK&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;“Cultivating interest” has played out well for me. When lots of things are deeply fascinating, you have the option of picking and choosing.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;RICHARD FEYNMAN&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The worthwhile problems are the ones you can really solve or help solve, the ones you can really contribute something to… No problem is too small or too trivial if we can really do something about it.&lt;&#x2F;p&gt;
&lt;p&gt;Study hard what interests you the most in the most undisciplined, irreverent and original manner possible.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;LEE KUAN YEW&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;If there was one formula for our success, it was that we were constantly studying how to make things work, or how to make them work better. I was never a prisoner of any theory. What guided me was reason and reality. The acid test I applied to every theory or scheme was, would it work?  This was the golden thread that ran through my years in office. If it did not work, or the results were poor, I did not waste more time and resources on it. I almost never made the same mistake twice, and I tried to learn from the mistakes others had made.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>A Game called Graft</title>
        <published>2019-09-19T00:00:00+00:00</published>
        <updated>2019-09-19T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/game-graft/"/>
        <id>https://asun9.com/game-graft/</id>
        
        <content type="html" xml:base="https://asun9.com/game-graft/">&lt;p&gt;Corruption (specifically, graft&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-1-1&quot;&gt;&lt;a href=&quot;#fn-1&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;) in public offices has a really bad name - erodes public trust, offsets growth, destabilizes institutions. It’s also just happens to be a matter of fact that corruption cannot be eliminated. It has been present in many forms in various institutions though human history. Every state has grappled with it, and eventually accomodated it. I wonder if corruption as that extremely bad thing that should be the first thing to be dealt with to the exclusion of everything else in South Asian democracies is primarily a modern concern.&lt;&#x2F;p&gt;
&lt;p&gt;The Communist Party of China has had corrupt members&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-2-1&quot;&gt;&lt;a href=&quot;#fn-2&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; since its inception. It didn’t hinder China’s progress through the 20th century, pulling millions of people into the middle class and becoming the world’s second largest economy. The overall literacy in China was 20% in the 1950s compared to 95% today. One would be hard pressed to find anything else in the history of civilization like what the Chinese did in one generation.&lt;&#x2F;p&gt;
&lt;p&gt;In India, in the state of Tamil Nadu, the two parties which have held power in the state for the last half-century are infamous for being incredibly venal - prone to not just graft, but to rent-seeking as well. That didn’t stop them from winning elections and coming back to power again and again&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-3-1&quot;&gt;&lt;a href=&quot;#fn-3&quot;&gt;3&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;. In the 50 years that the two main parties in the state has held power, Tamil Nadu (TN) has become the most urban state in the country, having the highest per-capita GDP. Female teen illiteracy has fallen to less than 3% (compared to  another state, Gujarat, at 16.3%, which is worse than TN today than it was at the time of independence, when it was actually ahead of TN), and its correlate,  total fertility rate (TFR) is 1.7. China’s TFR today is 1.67 after a generation of one-child policy. TN’s achievement is the same as China’s on a smaller scale, but unaccompanied by the loss of life as seen in communist China in the 1950s&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-4-1&quot;&gt;&lt;a href=&quot;#fn-4&quot;&gt;4&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;. That’s 50 million people who can read and write and whose kids can read and write, in one generation.&lt;&#x2F;p&gt;
&lt;p&gt;Despite the picture that’s generally painted, corruption in public politics is not uncommon outside of Asia and Africa, even in the first world countries. Consider the United States. In Path to Power, Robert Caro shows how the future president Lyndon B. Johnson cultivated the political machinery of Texas to get power, bestowing favours on the Dallas oil men and Houston’s Brown &amp;amp; Root. Brown &amp;amp; Root became extremely rich thanks to the federal contracts Johnson obtained for them. He in turn was patronized by them, and had funds funneled to the Democratic party and himself through them, using the money to manipulate members of Congress in order to further both his career and his backers&#x27; cause. Corrupt? No doubt. He also bought electricity and modern amenities to the bypassed Hill Country of Texas as a congressman, and as a President was pivotal in the passage of the Civil Rights Bill, the Equal Voting Rights bill, and the Civil Rights Act. Would one have been possible without the other? Likely. At what timescale?&lt;&#x2F;p&gt;
&lt;p&gt;The point I am trying to make is growth happens despite public corruption. Using public corruption as political talking point when it is so commonplace is to make it a distraction - the questions should be about policy decisions and what the overall direction of progress should look like. If one attributes the failures of certain democracies to graft, can one also attribute successes&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-5-1&quot;&gt;&lt;a href=&quot;#fn-5&quot;&gt;5&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; of some large democracies to turning a blind eye to graft? To not be corrupt when everyone else is, is to not be effective, and to be playing a losing game. If you are a player in this game, should you be battling entrenched graft or making decisions that will provide housing to multi-generation landless poor even if it means paying off someone? What&#x27;s the cost of trying to change the rules of the game instead? It is true that if you have operated in a system where you never had to deal with graft, it imposes an undue mental burden on you to navigate another system where it’s accepted. Case in point, moving to India after living in the United States or Singapore for a while. It also seems to me like it is one of those things humans learn to adjust quite rapidly to, like eating spicier food or jaywalking&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-6-1&quot;&gt;&lt;a href=&quot;#fn-6&quot;&gt;6&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; in heavy traffic. We do not mind paying the cost as long as it doesn&#x27;t hinder our overall sense of autonomy.&lt;&#x2F;p&gt;
&lt;br&#x2F;&gt;
&lt;p style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;FOOTNOTES&lt;&#x2F;b&gt; &lt;&#x2F;p&gt;
&lt;footer class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-1&quot;&gt;
&lt;p&gt;By graft, I mean use of a politican&#x27;s authority for personal gain. &lt;a href=&quot;#fr-1-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-2&quot;&gt;
&lt;p&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;carnegieendowment.org&#x2F;publications&#x2F;index.cfm?fa=view&amp;amp;id=19628&quot;&gt;Endemic corruption in China&lt;&#x2F;a&gt; &lt;a href=&quot;#fr-2-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-3&quot;&gt;
&lt;p&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Elections_in_Tamil_Nadu&quot;&gt;Election results in Tamil Nadu&lt;&#x2F;a&gt; &lt;a href=&quot;#fr-3-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-4&quot;&gt;
&lt;p&gt;See &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Great_Chinese_Famine&quot;&gt;Great Leap Forward&lt;&#x2F;a&gt; &lt;a href=&quot;#fr-4-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-5&quot;&gt;
&lt;p&gt;Success&#x2F;failure metrics: Per-capita GDP, female illiteracy, overall literacy, TFR &lt;a href=&quot;#fr-5-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-6&quot;&gt;
&lt;p&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Y9DLlMMXhKg&quot;&gt;Chicken crossing the road&lt;&#x2F;a&gt; &lt;a href=&quot;#fr-6-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;footer&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Kavaludaari</title>
        <published>2019-05-20T00:00:00+00:00</published>
        <updated>2019-05-20T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/kavaludaari/"/>
        <id>https://asun9.com/kavaludaari/</id>
        
        <content type="html" xml:base="https://asun9.com/kavaludaari/">&lt;p&gt;This was a delicious little Kannada film I saw over the past weekend. During a road-widening project in present day Bangalore, skeletons are discovered. A relentless cop - a traffic cop(!) -  investigates the past, and that leads to some very severe consequences in the present. Like Blow Out (1981), Chinatown (1974), and closer home, Shanghai (2012), the protagonist is compelled by some unknown force to investigate a particular situation in the face of apathy by everyone else around him, and the strings he pulls leads to disastrous consequences to people close to him.&lt;&#x2F;p&gt;
&lt;p&gt;Unlike the other three, Kavaludaari holds on to a bit of hope at the end. Usually when that happens, it feels like a cheap compromise. In this case though, it feels like it coudln&#x27;t have ended any other way, considering our protagonist, Shyam. He is dedicated to his job, and is very likable unlike Jake Gittes or the sleazy Joginder Parmar.  He wants to move to the crime branch, but he just happens to be too good at his job to be let go of. His parents want him to get married, and we are introduced to the girls, one after after another. They all reject him because they don&#x27;t want to lead a cop&#x27;s life. He seems to take it in his stride. You have to like him, right? No self-pity unlike his Tamil counterparts.&lt;&#x2F;p&gt;
&lt;p&gt;Only thing I wish this movie did better was to resist the temptation to tie all the knots. Some threads could have been left alone, giving the audience more to chew on. But it doesn&#x27;t over-explain in its attempts at doing that, and for that alone I would recommend it. As a bonus, it&#x27;s a much more polished thriller than Thadam or the other recent Tamil ones.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Solomon&#x27;s Vineyard</title>
        <published>2019-02-18T00:00:00+00:00</published>
        <updated>2019-02-18T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/solomon-vineyard/"/>
        <id>https://asun9.com/solomon-vineyard/</id>
        
        <content type="html" xml:base="https://asun9.com/solomon-vineyard/">&lt;p&gt;Book: &lt;strong&gt;Solomon&#x27;s Vineyard&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Jonathan Latimer&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Don’t recall ever having as much fun with a pulp fiction as I did with this one. I dare you to read the first page and put the book down:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;“FROM THE WAY her buttocks looked under the black silk dress, I knew she’d be good in bed. The silk was tight and under it the muscles worked slow and easy. I saw weight there, and control, and, brother, those are things I like in a woman. I put down my bags and went after her along the station platform.”&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;With a plot involving assassins, shady lawyers, religious cults, femme fatales, tommy gun wielding gangsters and just a tiny bit of necrophilia, I was reminded of Kiss Me Deadly, and what was said of that film - “designed to ruin young viewers”.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Buddhism in the Shadow of Brahmanism</title>
        <published>2018-02-23T00:00:00+00:00</published>
        <updated>2018-02-23T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/bronkhorst-buddhism/"/>
        <id>https://asun9.com/bronkhorst-buddhism/</id>
        
        <content type="html" xml:base="https://asun9.com/bronkhorst-buddhism/">&lt;p&gt;Book: &lt;strong&gt;Buddhism in the Shadow of Brahmanism&lt;&#x2F;strong&gt;  &lt;br &#x2F;&gt;
Author: &lt;strong&gt;Johannes Bronkhorst&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Among all the ideas this book introduced to me, the one that I am going to spend a long time chewing over is the hypothesis that Brahmanism was just another religion in the Greater Magadha region; and that it played no role in the Indian polity under the Nandas, Mauryas and Ashoka and later rulers till the first centuries of the 1st millennium CE. A consequence of this hypothesis is the rejection of the idea of &lt;em&gt;resurgence&lt;&#x2F;em&gt; of Brahmanism in the 2nd half of the first millennium CE after some stiff competition with Buddhism. That’s because it was not a predominant feature in the landscape in the first place, and in fact only now did it spread all over the subcontinent and beyond for the first time.&lt;&#x2F;p&gt;
&lt;p&gt;Also as a consequence of the hypothesis, Buddha’s teachings were not a rebellion against Brahmanism (the earliest recorded sayings make no mention of Brahmanism). If it did rebel against an existing order, it could have been against Ajivikism or Jainism or other prevailing mores of Greater Magadha. The earliest epigraphical recording we have in the subcontinent in Sanskrit (Rudradaman I&#x27;s Junagad rock inscription, 150 CE) was also the first one to make note of the varna system. None of the older indo-aryan inscriptions mention the caste system because it was not a feature of the society under the Mauryas and Ashoka and likely before that. Buddhism competed with Brahmanism and lost in the subcontinent, even while initially having the patronage of kings that Brahmanism did not have till later. And these final centuries BCE, when Brahmanism almost died, reshaped it into the form we know today, and spread all over South&#x2F;East Asia. And what an extraordinarily successful transformation it was - an ideology that predominated in an immense area, from Vietnam and Indonesia to Afghanistan, a not tiny portion of the earth(a phenomenon that has been called the ‘Sanskrit cosmopolis’ by Sheldon Pollock).&lt;&#x2F;p&gt;
&lt;p&gt;This book tries to answer why Buddhism lost, why it had to adopt Sanskrit as a means of propagating ideas after successfully using Pali&#x2F;Prakrit for half a millennium, and how that led to the reframing of how Buddhists in India saw themselves. An most excellent sort of detective work by Bronkhorst, and eminently readable to boot.&lt;&#x2F;p&gt;
&lt;p&gt;Lots to chew over. These are just my initial thoughts, will write a detailed review after I spend some time thinking about it.&lt;&#x2F;p&gt;
&lt;p&gt;P.S: The way Bronkhorst uses Brahmanism through the book is specific, and I will let him define it: “For all those who are not practising Brahmins themselves, Brahmanism is not, or not primarily, the religious culture which finds expression in the vedic texts. Brahmanism, as we have seen, implies for them a socio- political order. Rulers can adopt this order without “converting” to Brahmanism. Strictly speaking, Brahmanism did not make converts, at least not religious converts. It promoted a vision of society, and brahmanical influence will manifest itself through this vision as much as, if not more than, through the performance of sacrifices.”&lt;&#x2F;p&gt;
&lt;p&gt;This socio-political order is, of course, the varna system with a pre-eminent place for Brahmins at the top.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Su. Ra.: Why Write</title>
        <published>2017-10-29T00:00:00+00:00</published>
        <updated>2017-10-29T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/sundara-ram-ezhutal/"/>
        <id>https://asun9.com/sundara-ram-ezhutal/</id>
        
        <content type="html" xml:base="https://asun9.com/sundara-ram-ezhutal/">&lt;p&gt;நான் எனக்காக மட்டும் எழுதக் கூடியவனாக இருக்க வேண்டுமென்றே ஆசைப்படுகிறேன்…&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;ramasamy.png&quot; alt=&quot;Sundara Ramasamy on writing&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Coromandel: A Personal History of South India</title>
        <published>2017-10-17T00:00:00+00:00</published>
        <updated>2017-10-17T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/coromandel-charles-allen/"/>
        <id>https://asun9.com/coromandel-charles-allen/</id>
        
        <content type="html" xml:base="https://asun9.com/coromandel-charles-allen/">&lt;p&gt;I am always looking out for South Indian history books, or ones that talk about South Indian pop culture, and was really excited to see this book on twitter late October. Of course I ordered it immediately. There were only third party sellers on Amazon, and my copy shipped all the way from London.&lt;&#x2F;p&gt;
&lt;p&gt;Like the subtitle says, this is a personal history of South India, which means the history that Charles Allen covers is that which interests him the most. So one must be prepared to not expect much (or in fact anything at all) about the Kadambas, Pandyas, Pallavas, the Vijayanagar Empire, the Nayaks, the brief Madurai Sultanate and so on.&lt;&#x2F;p&gt;
&lt;p&gt;What Charles does very well is to cover the pre-Pallavan, pre-Chalukyan South. This is the Buddhist and Jain heritage of South India explored through its ruins. I now have a whole bunch of places on my travel list that I did not have before. I had never heard of Phanigiri or Kanagahalli, built by the Satavahanas, themselves Hindus but patrons of Buddhism. Kanagahalli contains the earliest craving of Ashoka in India, and was discovered only in the 1980s. I always knew it, but I am constantly surprised at how much what we know of India is because of the work done in the last two centuries - that of a dynasty called Satavahanas whose trade with the Romans funded their empire building, Ashoka and the deciphering of Brahmi script, establishing the antiquity of Tamil and Kannada, etc.&lt;&#x2F;p&gt;
&lt;p&gt;As I read about Iravatham Mahadevan and his work on Tamizh-Brahmi, and about the theft of antiquities from the sites that Charles Allen explores, I couldn&#x27;t help but feel a undercurrent of sadness and rage at the state of the country, this lack of respect for history and even a remote appreciation for it.&lt;&#x2F;p&gt;
&lt;p&gt;Charles Allen himself is a pretty light writer, unbiased towards India and her citizens. He treats the inequities of the Namboodiris in Kerala after the death of Martand Varma, the Mappila rioters and the Turko-Afghan invaders from the North the same way - things that are beyond the pale of civilization by any current metric. He has his blindspots, however. For example, I recall him saying Ramcharitmanas was the first popular version of the Ramayana. Kamban&#x27;s Ramavataram in Tamil is indisputably older, composed 400 years before Tulsidas&#x27;, and it was and is still popular.&lt;&#x2F;p&gt;
&lt;p&gt;If you are a product of the Indian school system (with all its bias towards the North, and assumption that North Indian history is Indian history - or at least like it was in mid 2000s), I would highly recommend this book. It does its share in unveiling that overlooked regions south of the Vindhyas, and will act as a stepping stone for more thorough explorations in the future.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>கவிதை?</title>
        <published>2017-08-26T00:00:00+00:00</published>
        <updated>2017-08-26T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/manushya-puthiran/"/>
        <id>https://asun9.com/manushya-puthiran/</id>
        
        <content type="html" xml:base="https://asun9.com/manushya-puthiran/">&lt;blockquote&gt;
&lt;p&gt;நான் உன்னுடன் &lt;br &#x2F;&gt;
இருப்பதாலேயே &lt;br &#x2F;&gt;
நான் உனக்கு &lt;br &#x2F;&gt;
எதுவுமாகவும் &lt;br &#x2F;&gt;
இல்லாமல் போகிறேன்&lt;&#x2F;p&gt;
&lt;p&gt;-- &lt;cite&gt;மனுஷ்ய புத்திரன்&lt;&#x2F;cite&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>The Buddha from Nagapattinam</title>
        <published>2017-01-29T00:00:00+00:00</published>
        <updated>2017-01-29T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://asun9.com/buddhism-chola-chicago/"/>
        <id>https://asun9.com/buddhism-chola-chicago/</id>
        
        <content type="html" xml:base="https://asun9.com/buddhism-chola-chicago/">&lt;p&gt;A couple of weeks ago, I saw this magnificent 11th century Buddha from Nagapattinam at the Art Insititue, Chicago, and I feel compelled to write a few words about the things he might have witnessed.&lt;&#x2F;p&gt;
&lt;p style=&quot;text-align:center;&quot;&gt;
    &lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;aic-buddha-tn.jpg&quot; alt=&quot;11th Century Nagapattinam Buddha&quot; class=&quot;center&quot; style=&quot;pointer-events: none;&quot;&gt;
    &lt;br&gt;
    &lt;small style=&quot;font-size: 0.8em; color: #777;&quot;&gt;&amp;copy; Abhishek Sundararajan. All Rights Reserved.&lt;&#x2F;small&gt;
&lt;&#x2F;p&gt;
&lt;br&#x2F;&gt;
&lt;p&gt;Nagapattinam was a Buddhist enclave in the Hindu kingdom of the Cholas. The Pallavas, before the Cholas, were the first important kingship in Tamil Nadu. Their relationship with the ocean is self-evident from the shore temples of Mahabalipuram, from where ships once sailed to Southeast Asia. One of the Pallava emperors, Nandivarman, was for all means a Vietnamese prince, born and brought up in Champa before being called to Kanchipuram and offered the throne. The Cholas had their capital first at Uraiyur, and then Tanjavur, both of which are further inland than Kanchipuram. But it&#x27;s the Cholas&#x27; naval expeditions to Kadaram and Srivijaya that&#x27;s remembered today, and it was the Cholas who were the most aggresively expansionist.&lt;&#x2F;p&gt;
&lt;p&gt;Under the Cholas, there is evidence of an active Tamil diaspora spread across Southeast Asia, all the way up to China, especially in the Chinese mercantile port of Quanzhou. Consider this itinerary recorded in the Chinese sources&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-1-1&quot;&gt;&lt;a href=&quot;#fn-1&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;. Rajaraja Chola, or his son Rajendra Chola, sent a contingent of fifty-two courtiers to Song China, led by a Chola Samudran. The party, in a leisurely fashion, first travelled from Tanjavur to Nagapatinnam, then onwards to Sri Lanka; then to Rammanadesam in Burma, onto the Malay peninsula and to some of the cities of Srivijaya before arriving  in Southern China after three years. This is where Chola Samudran spent the rest of his life, and this is where he died. The Chinese emperor is said to have sent an official to offer libations at the grave.&lt;&#x2F;p&gt;
&lt;p&gt;At every port along the way, Chola Samudran and company would have found Tamil speaking merchants such as the Nakarattar Chettis who turn up in an inscription from 1088 CE in Sumatra. This must be how Chola aesthetics and religion spread through SE Asia, through merchant guilds like the &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Ainnurruvar&quot;&gt;Five Hundred&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;By the end of the 13th century, after a few centuries of Tamil school masters, ship builders, merchants, temple architects establishing their presence in Southeast Asia, we find a Tamil temple with bilingual Tamil-Chinese inscriptions, dedicated to Shiva, in the same port of Quanzhou.&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-2-1&quot;&gt;&lt;a href=&quot;#fn-2&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;&lt;&#x2F;p&gt;
&lt;p&gt;One of the revelations I have had over the past year is that cosmopolitanism is not something that arose in the wake of modernity in the West. Consider this: In the cities of Southern China in the 12th century, one could hear Tamil voices - fighting, haggling, selling - along side Chinese and Arabic. Ibn Batuta, and Marco Polo, both would spend time in Quanzhou. Where there are trade networks there are cosmopolitans.&lt;&#x2F;p&gt;
&lt;br&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;d1wkx8p06zd9y1.cloudfront.net&#x2F;images&#x2F;Chola_Empire_map2.png&quot; alt=&quot;Chola Empire Between 10th and 11th Century&quot; &#x2F;&gt;
&lt;em&gt;The extent of the Chola empire between the 10th and 11th centuries.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;br&#x2F;&gt;
&lt;p&gt;Back to Nagapatinam. There was a substantial Southeast Asian presence here, and through the Coromandel coast. A famous Buddhist vihara was established here by one Srivijaya king, Maravijayottungavarma&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-3-1&quot;&gt;&lt;a href=&quot;#fn-3&quot;&gt;3&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;. Grants were added to the maintenance of the vihara by Rajaraja I and Rajendra Chola. The Chinese sources also mention the establishment of a &quot;Chinese Pagoda&quot; there in 1267. This survived till the 19th century, when it was pulled down under orders of the Governer to build a missionary school. Before the British, the Dutch East India Company made Nagapattinam their new headquarters after wresting it from the Portugese. With its abundant rice fields, and away from military operations and famines&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-4-1&quot;&gt;&lt;a href=&quot;#fn-4&quot;&gt;4&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;, Nagapattinam was also close to Sri Lanka, another Dutch conquest from the Portugese. This must be around when our Buddha found himself displaced from his native lands.&lt;&#x2F;p&gt;
&lt;br&#x2F;&gt;
&lt;p style=&quot;font-size:100%;&quot;&gt;&lt;b&gt;FOOTNOTES&lt;&#x2F;b&gt; &lt;&#x2F;p&gt;
&lt;footer class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-1&quot;&gt;
&lt;p&gt;This is from &lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.amazon.com&#x2F;Tamil-Biography-David-Shulman&#x2F;dp&#x2F;0674059921&quot;&gt;Tamil: A Biography&lt;&#x2F;a&gt; by David Shulman and also found in K.A. Nilakanta Shastri&#x27;s History of South India. &lt;a href=&quot;#fr-1-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-2&quot;&gt;
&lt;p&gt;&lt;a rel=&quot;noopener&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.semanticscholar.org&#x2F;paper&#x2F;Constructing-Community%3A-Tamil-Merchant-Temples-in-Lee&#x2F;8eb18f004970902b2fa183e76773d019ff8302d1&quot;&gt;Tamil Merchant Temples In India And China, by Risha Lee&lt;&#x2F;a&gt; &lt;a href=&quot;#fr-2-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-3&quot;&gt;
&lt;p&gt;I wonder if this is the vihara that our hero, Arulmozhi Varman, spends time recuperating in, in Kalki&#x27;s Ponniyin Selvan. &lt;a href=&quot;#fr-3-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li id=&quot;fn-4&quot;&gt;
&lt;p&gt;The Dutch Company had a settlement in Masulipatnam on the Andhra coast in early 17th century. They moved further south because of political frictions at Golkonda, and the disruptive conditions caused by almost uninterrupted military campaigns conducted by the Deccan Sultanates, the Marathas and the Mughals. &lt;a href=&quot;#fr-4-1&quot;&gt;↩&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;&#x2F;footer&gt;
</content>
        
    </entry>
</feed>
