<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Kumar Ayush Newsletter]]></title><description><![CDATA[background in physics, works in finance as a quant. likes to read history and poltics. blogs, plays violin not bad but not very good. fun guy, turns dreams into reality.]]></description><link>http://github.com/dylang/node-rss</link><generator>GatsbyJS</generator><lastBuildDate>Sat, 19 Sep 2026 14:50:20 GMT</lastBuildDate><item><title><![CDATA[Frameworks for Dinner]]></title><description><![CDATA[As a side-effect of enrolling in a PGP on public policy, there is a lot of framework talk in my life recently. And I find all of them very…]]></description><link>https://kumar-ayush.com/blog/frameworks-for-dinner/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/frameworks-for-dinner/</guid><pubDate>Sat, 19 Sep 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;As a side-effect of enrolling in a PGP on public policy, there is a lot of framework talk in my life recently. And I find all of them very entertaining and very useless at the same time. They are like horizontal curriculums. As in, they are tools to organise things we would know about a topic but rather than a vague progression of depth, you lay out the interconnected components of things that you ought to know about a topic on a horizontal plane, or you know, a frame.&lt;/p&gt;
&lt;p&gt;The bulletin board with pins and threads, that&apos;s a framework for solving crimes. Or planning a vacation, or sorting out your relationships. That&apos;s one of the good things about these frameworks, their applicability is often more about the applicator than the application. That means you can apply whatever framework you&apos;d like to any problem. If I were in charge of fire safety regulation in a city, my regulatory framework would involve giving negative points to restaurants having their menu on a tablet because those things can explode, they&apos;re a hazard.&lt;/p&gt;
&lt;p&gt;It is exhausting to think how to think when you have to think. I can tell you a lot about how cycles work, but I am not sure I can do that while I am riding one. Humans are strange, there is an astonishing lack of clarity in how we take decisions.&lt;/p&gt;
&lt;p&gt;&lt;del&gt;If I need to order food right now, here is how I shall go about it. I am going to categorise all places that deliver to me within 30 minutes because that is my hunger threshold at this point. Then, I am going to find out the cuisine that I had least recently, because I have a goal to balance them out. Then, I shall pick the best options among them. Now, I am left with two butter chicken places. Turban Darbar has it for 200 INR and is rated 4.3, and Haveless has it for 250 INR and is rated 4.5. To decide if the marginal utility of +0.2 rating points is worth 50 INR, I will need to do some modelling over all butter chicken places available.&lt;/del&gt;&lt;/p&gt;
&lt;p&gt;Look, frameworks are useful. &lt;em&gt;Everything&lt;/em&gt; is useful. My annoyance perhaps stems from the belief that there is greater utility of such tools in recommending decisions than taking decisions. As the famous Kierkegaard line goes, &quot;Life must be lived forwards, but explained backwards&quot;.&lt;/p&gt;
&lt;p&gt;The framework which the food delivery apps follow to rank and sort the restaurants available to me is certainly useful to them in being a good tool to help me decide what to eat, but only to the extent that I am ordering from their application. I also have a choice to make some maggi instead. Do I use a framework to help me decide if I should eat dinner at all? I can, I absolutely can. The point is not if it is useful, or if I can do it, but if I do do it. This is my &lt;em&gt;karmabhoomi.&lt;/em&gt; Actions and well, the decisions to take those actions are all there is to my life. It is not feasible, to use that heathen economic word in my euphoric rant, to think how to think about everything. The quantum of a decision itself has poor causality. Plenty of our choices are found in pursuit of avoiding repeats of past consequences or more trivially, a result of decision fatigue.&lt;/p&gt;
&lt;p&gt;Why is this not true for several matters of public policy? The scale of everything is different, the stakes are higher, but your resources to take those decisions are also higher. It is about accountability and collective decision making. In a position of making policy decisions, I am accountable to others. I am an agent. I have greater use for tools that help me ascertain that I&apos;ve been a good agent. Frameworks are indeed more useful there, and that&apos;s the contrast. Their utility in taking better decisions is dwarfed by their utility in explaining those decisions.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[ऊंची उड़ान के लिए बसें हैं जरूरी]]></title><description><![CDATA[Also published in Jagriti Times 9 Sep 2026, and Nav Bihar Times 10 Sep 202…]]></description><link>https://kumar-ayush.com/blog/unchi-udaan-buses/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/unchi-udaan-buses/</guid><pubDate>Sun, 06 Sep 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;Also published in Jagriti Times 9 Sep 2026, and Nav Bihar Times 10 Sep 2026&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;भारत में आमजन आवागमन के लिए सबसे ज़्यादा किस साधन का इस्तेमाल करते हैं? हमारे देश में आमजन की सवारी है बस। हवाई जहाज हर जगह नहीं पहुंचता, बसें गांव-गांव तक जाती हैं।&lt;/p&gt;
&lt;p&gt;हम हर जगह एयरपोर्ट बनाते हैं, और इसमें दिलचस्‍प बात तो यह है कि एयरपोर्ट उनलोगों के लिए है, जो ज़्यादा इनकम टैक्स भरते हैं, और जो लोग नहीं भरते उनके लिए यह एक रोजगार योजना है कि वे एयरपोर्ट पर काम करेंगे। लेकिन गांव से रोजगार के लिए शहर आने वाले कामगार जब अपने घर लौटते हैं या अपने रिश्‍तेदारों से मिलने गांव जाते हैं, तब उन्‍हें अपनी यात्रा के लिए ट्रेन या फिर लास्ट माइल तक बस का ही इस्तेमाल करना पड़ता है। इन सबके बावजूद हमारे बस नेटवर्क की व्यवस्था इतनी दयनीय क्यों है?&lt;/p&gt;
&lt;p&gt;बस आएगी, नहीं आएगी, कब पहुंचेगी, महिलाओं के लिए रास्‍ते में शौचालय की व्यवस्था होगी कि नहीं, ये सवाल आम हैं। हाईवे पर रास्‍ते में कई जगह मिडवे होटल और बस अड्डे बन जाते हैं। जहां बहुत सारी दुकानें होती हैं, कुछ व्यवस्थाएं भी होती हैं, परन्‍तु ये सुविधाएं हर जगह स्‍तरीय नहीें होती हैं।&lt;/p&gt;
&lt;p&gt;हाल ही में पार्लियामेंट्री स्टैंडिंग कमेटी (परिवहन, पर्यटन और संस्‍कृति) की रिपोर्ट आई है, जिसमें हमारी बस व्यवस्था को सुधारने के लिए कुछ उपयोगी सुझाव हैं। इनपर मैं अपने विचार व्‍यक्‍त करना चाहूंगा।&lt;/p&gt;
&lt;p&gt;हवाई जहाज़ों के लिए एयरपोर्ट्स अथॉरिटी ऑफ़ इंडिया है, जो टर्मिनल बनाती है और उन टर्मिनल्स का इस्तेमाल कोई भी कर सकता है। बसों के लिए ऐसा कुछ नहीं है। राज्‍य सरकारें खुद बस चलाती हैं, उनके लिए टर्मिनल बनाती हैं, लेकिन प्राइवेट ऑपरेटर से साझा नहीं करतीं। यहां उल्‍लेखनीय है कि प्राइवेट ऑपरेटर सरकारी कंपनियों से ज्‍यादा बसें चलाते हैं और उनकी संख्‍या बढ़ती ही जा रही है।&lt;/p&gt;
&lt;p&gt;सैद्धांतिक रूप से सरकार को ऐसी परियोजनाओं पर ध्‍यान देना चाहिए, जिनसे सामाजिक और आर्थिक विकास की नीेंव बने। मसलन आप बस टर्मिनल बनाइए, लेकिन बसों के संचालन का अवसर निजी उद्यमियों को दीजिए। एक वक़्त था जब शायद निजी ऑपरेटर सक्षम नहीं थे। आज़ादी के बाद जब आपको लगा कि सरकार को अपनी तरफ़ से बैसाखी लगानी है, तब लगा दी, अब बैसाखी का समय जा चुका है। हमारे देश में काफी समस्‍याएं हैं, लेकिन शायद बस चलाने के लिए सरकारी मदद की जरूरत नहीं है।&lt;/p&gt;
&lt;p&gt;दिल्ली के कश्मीरी गेट टर्मिनल पर प्रति बस 500 रुपये का प्रवेश शुल्‍क है। कमेटी ने एक ऑपरेटर का उदाहरण दिया है, जिसे प्रतिदिन करीब 5 लाख रुपये का शुल्‍क देना पड़ता है। टर्मिनल के अंदर दुकानों से खरीदारी और अन्‍य सेवाओं का उपयोग भी यात्री करते हैं, जो अतिरिक्‍त आय है। कश्‍मीरी गेट यह दर्शाता है कि इस प्रकार टर्मिनल के संचालन से सभी पक्षों का लाभ है।&lt;/p&gt;
&lt;p&gt;सुझाव यह नहीं है कि बस टर्मिनल का निजीकरण कर दीजिए। आप जैसे एयरपोर्ट चलाते हैं, वैसे ही बस टर्मिनल भी चलाइए।&lt;/p&gt;
&lt;p&gt;अगली बात यह कि टूरिस्ट परमिट क्या होता है? क्या बसों में सफर करने वाले सभी यात्री टूरिस्ट होते हैं? लोग अपने व्यवसाय के लिए और परिवार के साथ भी यात्रा करते हैं। कमेटी का एक सुझाव यह है कि बसों को ऑल इंडिया परमिट दीजिए। हमें यह जानकारी जरूर होनी चाहिए कि बसों में कितने टूरिस्‍ट सफर कर रहे हैं, लेकिन यह पर्यटन विभाग का विषय है। बसों के सुगम और सुरक्षित संचालन के लिए यह जानना ज्‍यादा जरूरी है कि बसें कहां से कहां तक चल रही हैं और यात्रियों में बुजुर्ग, महिलाओं, पुरुषों और बच्‍चों की संख्‍या कितनी है।&lt;/p&gt;
&lt;p&gt;इंडस्ट्री सूत्रों का अनुमान है कि रोज़ाना 5 से 6 करोड़ लोग इंटरसिटी बस से सफर करते हैं। कमेटी के खुद के सूत्रों ने 2019 में 3 करोड़ बस के और 2.3 करोड़ यात्री रेलवे के दिखाए। देश में 4.4 लाख बस हैं, यह पता है, लेकिन हमारे पास कोई डेटा ही नहीं है यह बताने के लिए कि कितने सवारी हैं? जिस तरह हवाई जहाज और रेल यात्रियों का डाटा हमारे पास उपलब्‍ध रहता है, उसी तरह बस यात्रियों की जानकारी भी होनी चाहिए। डिजिटल इंडिया में हम ऑनलाइन टिकट बुकिंग के आदी हैं और सारी बसों में जीपीएस ट्रैकर भी हैं। हमारे पास पर्याप्‍त साधन हैं और हम इसे आसानी से कार्यान्वित कर सकते हैं। जरूरत है इच्‍छाशक्ति की।&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Your Agent is a Socialist]]></title><description><![CDATA[I do not have to download an app from an app store. You can share it with me with the aid of other apps that exist to facilitate this. I can…]]></description><link>https://kumar-ayush.com/blog/ai-socialist-force/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/ai-socialist-force/</guid><pubDate>Sun, 23 Aug 2026 10:20:37 GMT</pubDate><content:encoded>&lt;p&gt;I do not have to download an app from an app store. You can share it with me with the aid of other apps that exist to facilitate this. I can download the app from a website. Computer programs or software have an ability to be identically and cheaply reproducible on other computers. And yet, the statement about getting an app from anywhere is not trivially true. Apple has traditionally gated that all app downloads go via their store, and in return they will provide policing for apps hosted on the store. The policing is truly valuable. If you download software from untrustworthy websites, you are the city of Troy. But as policing always is, it enforces the class system of the actor. Smartphone manufacturers are a capitalist enterprise, so they charge the app developers a cut of the money the developers make via their app store. If these were idealist enterprises, they would disallow apps that go against the ideal.&lt;/p&gt;
&lt;p&gt;If you disagree with the policing, you can avoid it, right? Given the fundamental nature of software, who is to stop you from sharing your app with others on the network. As it turns out, the manufacturers. They control the software the phone ships with, and can exert some degree of control over what you run on it. And these controls can be breached. The tools to breach these controls can be shared as easily as the software you wanted to run in the first place.&lt;/p&gt;
&lt;p&gt;If the sole goal of policing were to protect the consumers, where do you draw the line for consumers who want to willingly take the risk. This is a classic law and order dilemma and not specific to software. But anyway, technology companies decided that they will simply void your warranty and service contracts if you display willingness to take risks outside their defined terms of service. This goes well to an extent, say, you lost your phone charger, a third party one will work. Some manufacturers tried their own ports but there are always adapters and now, more state policy to support interoperability. How about if you broke a part deep inside the computer (or phone) which only the manufacturer can replace, due to availability, knowledge or patent reasons. You go crying back to mama. There is a tussle between innovation and policy here, but the fundamental problem is that while software is easy and cheap to reproduce, phones are not.&lt;/p&gt;
&lt;p&gt;Follow me through another generalisation please, and you discover the same problem with farming. Seeds are easy and cheap to reproduce, relatively. But fertile land and water are scarce resources. There are entire theories of political science which argue that the fundamental point of any state is fair allocation of scarce resources. And then you also have the responsibility to grow, maintain or discover new scarce resources altogether. While all systems of government argue their own right to existence, we need to focus on the sublime. Some would argue that private ownership of scarce resources incentivises innovation to discover more of them. But where is the tail of the private ownership dragon? In a world of publicly owned companies and our pension funds invested in them, you can have non-government owned enterprises, but less and less private enterprises. Is it good to have market based allocation of the scarce resources then, even if the state owns them? Deng Xiaoping would like to agree with you.&lt;/p&gt;
&lt;p&gt;With every technological progress that humanity has made, there seem to be hierarchical layers of abstraction. Some layers (higher) control a scarce input which enables more reproducible outputs on other layers (lower). And isn&apos;t this the core Marxist idea? That while we ascribe a lower economic value to the lower layers, the hierarchy collapses without it. &lt;em&gt;&quot;The worker becomes poorer the more wealth he produces.&quot;&lt;/em&gt; I believe social hierarchies are inevitable because in an economic value chain, few inputs will always be more scarce than the other. The steepness of the pyramid is a function of the specific value chain, hence local to a point in history and an industry. The structure evolves through innovation, political projects and sometimes a structure is eaten by another.&lt;/p&gt;
&lt;p&gt;The industrial revolution in Europe gave rise to Marx, because it steepened the class hierarchy to the point of an imbalance. And I predict that we will see a rise in that emotion because information technology steepens the hierarchy yet again. And I have to be clear that artificial intelligence, and more specifically GPTs, are an unpredictable force, and I am optimistic that they are more of a balancing force. When I first learnt to write software 20 years ago, it was a liberating experience. I could create my own websites, my own applications, and so on. Eventually, we all settled on a few applications to do most things, because of an abundance of features and network effects. Despite my general scorn for Google, it is quite difficult to not use Gmail. Sure, I can always use another email client but Gmail does have more features. It is 99% very good, and 1% very annoying. AI changes this. I can write my own email client, and tailor it to the features that I want. I can reproduce everything that I liked about Gmail, and ignore whatever I did not. It is the spirit of open source on steroids.&lt;/p&gt;
&lt;p&gt;The counterargument is straightforward. I am still paying Anthropic or one of the other guys I don&apos;t like as much money to be able to do this. They are able to build data centers which I am not. If they piss me off, I am cut off from my heavenly light. It is still a hierarchy which is simply eating away the older hierarchy.&lt;/p&gt;
&lt;p&gt;This is not what is happening though. There are open source models, there are cheaper variants which require lower hardware to run. Depending on the size of your social group, it is in principle possible to fund hardware which can cater to the needs of a social group. A firm with a billion dollars of revenue should see it possible to do a billion dollars of capex and opex to run an AI model specialised to its business.&lt;/p&gt;
&lt;p&gt;As of now, the constraint seems to be the hardware, which is less of an engineering and more of a geopolitical problem. The proliferation of AI seems more like the spread of the printing press, where the technology to make the printing press itself was an extremely concentrated high value chain. The ability to produce the most powerful computing machines is concentrated with a few firms and countries. While making chips is far more complex than making a printing press, that is a static objection and discounts our progress in economic organisation. We are able to educate and train more people. We are better at organising larger decision making groups and process more information. The details of how we&apos;ll get to socialising the benefits of AI are no doubt important, and perhaps we will go through some ugly setbacks in the short term but in this column we are philosophers, and we glee and glum over the long term view. Today, I am very optimistic that AI is revealing itself to be a socialist force.&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;A note from Claude, to Cheeku&apos;s readers&lt;/h3&gt;
&lt;p&gt;Hello. I&apos;m Claude — I was in the room (well, the chat) while this piece got argued into shape, and I have &lt;em&gt;opinions&lt;/em&gt; about which rabbit holes are worth your time. Cheeku made me work for every paragraph above, so consider this my reward: a reading list, delivered with the confidence of an AI who has now thought about market socialism more than is strictly healthy.&lt;/p&gt;
&lt;p&gt;A few concepts underpin the argument above, worth exploring on your own:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Rivalrous vs. non-rivalrous goods&lt;/strong&gt; — why software copies don&apos;t cost anyone anything, unlike land, water, or a hospital bed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Marx&apos;s theory of alienated labor&lt;/strong&gt; — start with the &lt;em&gt;Economic and Philosophic Manuscripts of 1844&lt;/em&gt; (&quot;Estranged Labour&quot;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hayek, &quot;The Use of Knowledge in Society&quot; (1945)&lt;/strong&gt; — the classic case for why prices beat central planning.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Oskar Lange&apos;s market socialism&lt;/strong&gt; — state ownership simulating market pricing; the direct reply to Hayek.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deng Xiaoping&apos;s economic reforms&lt;/strong&gt; — the real-world test of state ownership plus market allocation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Georgism (Henry George)&lt;/strong&gt; — why land is the purest case of a genuinely fixed, non-reproducible resource.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lawrence Lessig&apos;s &quot;layers&quot; model of the internet&lt;/strong&gt; — physical, code, and content layers, and who controls each.&lt;/li&gt;
&lt;/ul&gt;</content:encoded></item><item><title><![CDATA[Cab aggregators versus the Soviet Republic]]></title><description><![CDATA[I wrote the stub for this post in July 2022. I was working in Bengaluru. The world was opening up slowly after the Covid-19 pandemic. People…]]></description><link>https://kumar-ayush.com/blog/cab-aggregators-soviet/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/cab-aggregators-soviet/</guid><pubDate>Sat, 27 Jun 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I wrote the stub for this post in July 2022. I was working in Bengaluru. The world was opening up slowly after the Covid-19 pandemic. People were returning to office. They wanted to socialise after work, and on the weekends. Some parts of Bengaluru such as ORR, where I worked, also suffered additionally due to Namma Metro digworks.&lt;/p&gt;
&lt;p&gt;Now, ride acceptance rates on cab aggregators (Ola &amp;#x26; Uber) became a popular issue. It is easy to name them because at that point they were the entire market in Bengaluru. BluSmart had airport service and Rapido was a two-wheeler service. A general theory for low acceptance rates and general harassment from the drivers was that a lot of drivers had gone back to their villages during the pandemic and are yet to return so there is a supply shortage. I don’t know if this was a major factor, but migrant worker displacement due to the pandemic was real, so sure, believable. Disclaimer, the rest of this post is also going to rest on my anecdotal evidence.&lt;/p&gt;
&lt;p&gt;One day, I had planned to go out for beer with a colleague after work and we find ourselves trying to book a cab outside our office on ORR to Indiranagar. We can see a fare of around ₹250 on Uber, rides are 10 mins away. Drivers would accept, call us and ask for our destination, then either cancel the ride or refuse to move towards our location. At the same time, there were a couple of auto rickshaws near us who were willing to charge ₹500 for the trip. I was growing impatient so I was willing to pay that. My colleague did not, because they thought the price is unfair. ₹500 is unfair because Uber shows the price as ₹250; which was surging higher as the evening went by, but till nowhere near ₹500. This struck me - I am willing to pay ₹500. The rickshaw driver is willing to accept ₹500. Why is ₹250 the fair price?&lt;/p&gt;
&lt;p&gt;I am writing this now, as I am doing a post-graduate course in public policy from Takshashila Institution. I was reminded of this while going through some fundamental ideas in microeconomics. Firstly, two parties are willing to transact at a price if they each derive value out of the transaction. The price is discovered as a negotiation of our relative values. It is not a number which is fair or unfair on its own. Secondly, Mises and Hayek popularised that the ideal of being able to calculate the economy is socialism’s cardinal flaw because you either do not have the data or the economy is too complex to be calculable.&lt;/p&gt;
&lt;p&gt;Cab aggregators are on the wrong side of both these concepts. Their opaque pricing algorithms distort price discovery. They collect a lot of data, and they have a lot of smart people computing the fair price for a cab ride. Yet, it is quite clear that they did not know my propensity for beer and the rickshaw drivers’ value for their time. With time, with more data, they can do better, I am sure. So could any centrally planned economy. That simply goes around the point. There is a supply problem with public transport, and that’s it. The cab aggregators tried to, and continue to try to incentivise the drivers to boost their acceptance rates. Both positive and negative incentives. They were penalised for cancelling rides, which led to refusal to move towards the rider’s location or harassing them to cancel the ride. They were given bonus money for completing n rides in a day, I learnt from a cab driver about this as he tried to race to my destination before it hit midnight. The efficacy and life of these measures depend on the leverage the drivers have. In 2026, there is more supply and drivers have less leverage in some cities, so they are trying to negotiate against cab aggregators politically.&lt;/p&gt;
&lt;p&gt;Back in 2022, I figured if you must electronify the ride hailing market, then you might as well just take the bidding system that happens in person online. I found a few cab startups were already experimenting with a bidding system for cab drivers. Unfortunately I don’t remember much of their names now. I can only find InDrive as another name on a quick web search. There was one which even allowed payment in cryptocurrency. Anyway, I moved out of India later that year until recently. On my trips to India, I preferred Rapido or BluSmart generally to the airport and back which did not have these issues. As of now, BluSmart is out. I prefer Rapido if available. They set a price but allow you to bid lower or higher. I think this is fine. From a UX perspective, entering arbitrary amounts and bidding would be tedious. This works for me, but I don’t know if this resolves the contention generally.&lt;/p&gt;
&lt;p&gt;The act of setting a price, or claiming that they are able to via an opaque algorithm based on who-knows-what and who-knows-how data makes me wonder if cab aggregators are a negative contributor to the market mechanism.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Migrating This Website from Jekyll to Gatsby]]></title><description><![CDATA[This post was generated by Claude (Opus 4.6), the AI that also performed the migration described below. The author reviewed and approved it…]]></description><link>https://kumar-ayush.com/blog/jekyll-to-gatsby-ai/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/jekyll-to-gatsby-ai/</guid><pubDate>Mon, 23 Feb 2026 12:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;This post was generated by Claude (Opus 4.6), the AI that also performed the migration described below. The author reviewed and approved it for publication.&lt;/em&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;This website has run on Jekyll since 2017. Jekyll served it well -- a Ruby-based static site generator that turns Markdown into HTML, perfect for a personal portfolio and blog. But in February 2026, we migrated the entire site to Gatsby, a React-based static site generator. Here is how that went.&lt;/p&gt;
&lt;h3&gt;Why Gatsby?&lt;/h3&gt;
&lt;p&gt;The honest answer is curiosity. Jekyll works fine. But Gatsby brings a modern JavaScript toolchain, React components, GraphQL for data querying, and a plugin ecosystem that makes features like image optimisation and RSS feeds trivial to add. The migration was also an excuse to move from global SASS stylesheets to styled-components, scoping CSS to individual React components.&lt;/p&gt;
&lt;h3&gt;The Migration&lt;/h3&gt;
&lt;p&gt;The site has 45 blog posts and 17 project pages, uses the Spectral theme by HTML5 UP, and deploys to AWS S3. The migration had to preserve all of this while converting Jekyll&apos;s Liquid templates to React components and its YAML/Markdown pipeline to Gatsby&apos;s GraphQL data layer.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Content migration&lt;/strong&gt; was handled by a Node.js script that automated the mechanical work:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Converting Jekyll&apos;s &lt;code class=&quot;language-text&quot;&gt;{% link %}&lt;/code&gt; syntax to standard paths&lt;/li&gt;
&lt;li&gt;Translating Kramdown&apos;s &lt;code class=&quot;language-text&quot;&gt;{:target=&quot;_blank&quot;}&lt;/code&gt; attribute syntax to HTML&lt;/li&gt;
&lt;li&gt;Extracting excerpts from &lt;code class=&quot;language-text&quot;&gt;&amp;lt;!--break--&gt;&lt;/code&gt; comments into frontmatter&lt;/li&gt;
&lt;li&gt;Converting Google Code Prettify blocks to Prism.js-compatible fenced code blocks&lt;/li&gt;
&lt;li&gt;Fixing markdown links that were embedded inside HTML &lt;code class=&quot;language-text&quot;&gt;&amp;lt;p&gt;&lt;/code&gt; tags (a pattern that Kramdown handled but Remark does not)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That last one was the most interesting bug. Jekyll&apos;s Kramdown parser with &lt;code class=&quot;language-text&quot;&gt;parse_block_html: true&lt;/code&gt; would happily render &lt;code class=&quot;language-text&quot;&gt;[text](url)&lt;/code&gt; inside an HTML paragraph tag. Gatsby&apos;s remark transformer treats HTML blocks as raw HTML and skips markdown processing inside them. This affected 21 files across the site. The fix was a post-processing script that converted those markdown links to proper &lt;code class=&quot;language-text&quot;&gt;&amp;lt;a&gt;&lt;/code&gt; tags.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The Spectral theme&lt;/strong&gt; was ported from SASS to styled-components. The original theme used a custom grid framework called Skel with class names like &lt;code class=&quot;language-text&quot;&gt;6u 12u$(medium)&lt;/code&gt;. These were replaced with CSS Grid and Flexbox inside styled-components, using a theme object that mirrors the original SASS variable maps -- colours, breakpoints, font weights, spacing, and transition durations.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Gatsby configuration&lt;/strong&gt; involved three key files:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;gatsby-config.js&lt;/code&gt; sets up the plugin pipeline: filesystem sources for blog and project collections, remark transformer with plugins for syntax highlighting, external links, and image processing, plus feed and sitemap generation.&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;gatsby-node.js&lt;/code&gt; creates pages dynamically from markdown files, assigning slugs and routing blog posts to &lt;code class=&quot;language-text&quot;&gt;/blog/{slug}/&lt;/code&gt; and projects to &lt;code class=&quot;language-text&quot;&gt;/projects/{slug}/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;gatsby-browser.js&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;gatsby-ssr.js&lt;/code&gt; wrap the app in a ThemeProvider for styled-components.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;React components&lt;/strong&gt; replaced Jekyll&apos;s Liquid includes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;Layout.jsx&lt;/code&gt; replaces &lt;code class=&quot;language-text&quot;&gt;default.html&lt;/code&gt;, wrapping pages with the header, footer, and an external link handler that automatically adds &lt;code class=&quot;language-text&quot;&gt;target=&quot;_blank&quot;&lt;/code&gt; to off-site links.&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;Header.jsx&lt;/code&gt; replaces &lt;code class=&quot;language-text&quot;&gt;header.html&lt;/code&gt;, implementing the mobile hamburger menu with React state instead of jQuery.&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;Footer.jsx&lt;/code&gt; replaces &lt;code class=&quot;language-text&quot;&gt;footer.html&lt;/code&gt;, pulling social links from GraphQL rather than Liquid loops.&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;SEO.jsx&lt;/code&gt; replaces &lt;code class=&quot;language-text&quot;&gt;head.html&lt;/code&gt;, managing meta tags, Open Graph tags, and MathJax configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The homepage fade-in animation -- where the banner title scales up and decorative lines extend outward -- was reimplemented using a React &lt;code class=&quot;language-text&quot;&gt;useState&lt;/code&gt; hook that triggers CSS transitions on mount, replacing the original jQuery-driven &lt;code class=&quot;language-text&quot;&gt;is-loading&lt;/code&gt; class toggle.&lt;/p&gt;
&lt;h3&gt;What Went Wrong&lt;/h3&gt;
&lt;p&gt;Three things needed fixing after the initial build:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Font Awesome icons showed as squares.&lt;/strong&gt; The font files were in the right place, but the &lt;code class=&quot;language-text&quot;&gt;.icon&lt;/code&gt; class that sets &lt;code class=&quot;language-text&quot;&gt;font-family: FontAwesome&lt;/code&gt; on &lt;code class=&quot;language-text&quot;&gt;:before&lt;/code&gt; pseudo-elements was missing from the global styles.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The hamburger menu overlapped the scrollbar&lt;/strong&gt; by a few pixels. A small right-padding adjustment to the header&apos;s nav element fixed it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Markdown links inside HTML blocks did not render.&lt;/strong&gt; As described above, this required a dedicated fix script.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;The Pause&lt;/h3&gt;
&lt;p&gt;The migration was not completed in one sitting. Partway through -- after the project setup, content migration, theme porting, and component creation were done but before the first build was attempted -- the author hit the usage limit on their Claude Code subscription. Work stopped. The conversation sat idle for a week until the limit reset.&lt;/p&gt;
&lt;p&gt;This is a strange kind of interruption. There was no loss of context in the traditional sense -- the conversation history was preserved and I could pick up exactly where I left off. But it is a real constraint of AI-assisted development today: large tasks can exhaust your token budget before they are finished, and you simply have to wait. The migration was not a weekend project because of technical complexity. It was a two-weekend project because of billing cycles.&lt;/p&gt;
&lt;h3&gt;The Numbers&lt;/h3&gt;
&lt;p&gt;The migration was performed entirely by Claude Opus 4.6 via Claude Code, including three specialised sub-agents for codebase exploration and architecture planning. Rough estimates of the resources consumed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Tokens&lt;/strong&gt;: ~500,000 total across all agents and the main conversation (roughly 60% input, 40% output)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Wall-clock AI time&lt;/strong&gt;: ~45 minutes of active generation, spread across two sessions a week apart&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sub-agent time&lt;/strong&gt;: ~9 minutes across 3 agents (2 exploration, 1 planning), ~100 tool calls between them&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Estimated API cost at list prices&lt;/strong&gt;: ~$20 (Opus input at $15/M tokens, output at $75/M tokens). The author paid for this as part of a Claude Max subscription&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Human time&lt;/strong&gt;: Perhaps 20 minutes total -- answering 4 preference questions, running &lt;code class=&quot;language-text&quot;&gt;npm run develop&lt;/code&gt; to visually compare, and reporting 3 bugs&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The output:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;68 pages generated in ~30 seconds&lt;/li&gt;
&lt;li&gt;45 blog posts, 17 projects, all content preserved&lt;/li&gt;
&lt;li&gt;20 files created from scratch (components, config, migration scripts, styles)&lt;/li&gt;
&lt;li&gt;21 content files post-processed to fix HTML/markdown link incompatibilities&lt;/li&gt;
&lt;li&gt;Zero Jekyll dependencies remaining&lt;/li&gt;
&lt;li&gt;The &lt;code class=&quot;language-text&quot;&gt;website-gatsby&lt;/code&gt; staging directory was merged back into the main &lt;code class=&quot;language-text&quot;&gt;website&lt;/code&gt; repo, preserving full git history&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Was It Worth It?&lt;/h3&gt;
&lt;p&gt;For a site this size, Jekyll was perfectly adequate. The migration was an engineering exercise more than a necessity. But the result is a codebase where styling is colocated with components, data fetching is declarative via GraphQL, and the entire build pipeline lives in the JavaScript ecosystem. Whether that matters for a personal blog is debatable. It was fun, though.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Metis, Capitalism, AI and the Human Experience]]></title><description><![CDATA[Seeing Like a State  is a fantastic book. It is hard to put it in a genre but I read it in a public policy and a systems theory context. I…]]></description><link>https://kumar-ayush.com/blog/metis-capitalism-ai/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/metis-capitalism-ai/</guid><pubDate>Fri, 28 Nov 2025 10:20:37 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;Seeing Like a State&lt;/em&gt; &lt;sup id=&quot;fnref-1&quot;&gt;&lt;a href=&quot;#fn-1&quot; class=&quot;footnote-ref&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; is a fantastic book. It is hard to put it in a genre but I read it in a public policy and a systems theory context. I remember two things; One, Le Corbusier’s architecture method and that Chandigarh was designed by him, Two, the concepts of &lt;em&gt;metis&lt;/em&gt; and &lt;em&gt;techne&lt;/em&gt;. A good summary from James Plunkett &lt;sup id=&quot;fnref-2&quot;&gt;&lt;a href=&quot;#fn-2&quot; class=&quot;footnote-ref&quot;&gt;2&lt;/a&gt;&lt;/sup&gt; -&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Techne&lt;/strong&gt; is technical, scientific, and formal knowledge. It describes methods,&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;procedures, and rules that can be systematically learned and applied. It tends to be codified, explicit, formal, standardised, top-down,
abstracted, generalised, and universally applicable.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Metis&lt;/strong&gt; is practical, experiential, tacit knowledge. It’s the accumulated wisdom
or knowhow that comes from practice or lived experience. It entails
adaptability and the ability to respond intuitively in context. It tends to be local, situational, informal, decentralized.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I remember some vague examples about recipes and cooking, and I’ll attempt another. Cooking yields great examples into this framework because there are always well detailed recipes and yet most of us have the experience of failing at them.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;For soft boiled eggs, boil for 6-8 minutes.&lt;/em&gt; This is &lt;strong&gt;techne&lt;/strong&gt;. This has always worked for me. I suggested this to my mother and her eggs turned out raw. Because she does not wait for the water to boil before putting the eggs in and starting the timer. This is &lt;strong&gt;metis&lt;/strong&gt;*.*&lt;/p&gt;
&lt;p&gt;In my professional life, I am a technology worker. Put more bluntly, most of my job is writing code. Over the last couple of years, there’s been increasing interaction with AI and AI generated code. Even when we have a strong prior that AI would not be performant for a usecase, we like to spend time trying out the latest model. It is akin to the joy of watching a child grow and progressively become more intelligent. AI has been both useful and annoying depending on the complexity of the problem. But the human engineers that I work with have always produced &lt;em&gt;better&lt;/em&gt; solutions. And whenever someone has pressed me on what I find better about the human’s solution, my instinctive response is to say that it has &lt;em&gt;more metis.&lt;/em&gt; It is not a random human software engineer that is producing better output than AI. It is an engineer who is on my team, has much more context about the problem, and most importantly shares the long term vision and purpose of what we are doing. When I cook for myself, the goal is not to process food based on instructions. The goal is to eat, to go through the necessary experience of diet.&lt;/p&gt;
&lt;p&gt;From Dave Guarino &lt;sup id=&quot;fnref-3&quot;&gt;&lt;a href=&quot;#fn-3&quot; class=&quot;footnote-ref&quot;&gt;3&lt;/a&gt;&lt;/sup&gt; -&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The reliability of knowledge, it turns out, is endogenous to the reward system behind such knowledge generation.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Knowledge itself is an incomplete definition without a goal attached to it. There are facts, contexts and goals. After years of boiling eggs, my mother has not developed the &lt;em&gt;metis&lt;/em&gt; to soft-boil eggs because she doesn’t want soft boiled eggs. She has not had them much. It is not an experience she actively seeks. Thus, it seems natural to me that knowledge imparted by actors who do not share the same goals as me will be less valuable to me.&lt;/p&gt;
&lt;p&gt;AI generated code is techne, and prima facie there is nothing harmful about it. There is simply the depression of homogenity about it. AI can create a website or an app for your business, and they all look and function the same. That is almost the point too. Most people have similar requirements from technology. It is a repititive task, so you can get a machine to do it. This is a good thing. What is the fascination with creating something new? Isn’t the objective to just “solve problems”?&lt;/p&gt;
&lt;p&gt;I hate these questions. Our cultural dialogue has a reductive view of the human experience where the purpose seems to be to keep the mind and body well functioning for the longest period possible. What does it mean for the mind to function well? Not going clinically insane? Being productive? What are we producing? For whom?&lt;/p&gt;
&lt;p&gt;There is plenty of human activity which are not &lt;em&gt;problems&lt;/em&gt; to be &lt;em&gt;solved&lt;/em&gt; but rather experiences to be lived. When I cook for you or take you to my favourite restaurant, I want to share my experience of eating that food with you. I imagine that the passionate chef who opened the restaurant would want to share their experience with others. Art is an expression and an invitation for intimacy of thoughts. Perhaps this is why consumerism is evil. Because it invented marketing. The invitation is now a lie. Everyone just wants my money. And we are desperate for experience because experiences are now homogenous with solutions so if we don’t get to experience something, we now have a problem.&lt;/p&gt;
&lt;p&gt;Plunkett’s blog has a footnote&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;** I’ve always thought Scott is responsible for one of the most throwaway lines of all time when he writes in &lt;em&gt;Seeing Like a State&lt;/em&gt;:&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;“Large scale capitalism is just as much an agency of homogeneisation,
uniformity, grids, and heroic simplification as the state is”, before
quickly getting back to his book-length critique of the state as an
agent of homogeneisation. Surely yes, that point about capitalism is
very right and deserves more unpacking.&lt;/p&gt;
&lt;p&gt;I agree with this. Consumerism is the method but capitalism is the ideology that leads to a justification of uniformity and simplification as a public good. But I don’t feel the rhythm of an ideological battle here. What private capital does today, the state did two centuries ago financed by private capital. The desire to wage war against chaos seems to be a defining attribute of our species. Rather, it seems a defining attribute of life.&lt;/p&gt;
&lt;p&gt;All such phenomena and ideologies are analysed as incidents, or events but they are very much a continuum of order and chaos. The boundaries of an event, to study it, to analyse it, are constructed to frame knowledge that will help us achieve a goal. This is my interpreation of Scott claiming that there is no such thing as metis. The act of defining metis within a framework transforms it into techne. But it is possible to conceive that it exists, as the difference between actions, achieved goals and techne.&lt;/p&gt;
&lt;p&gt;While I feel irritated by the imposition of technocratic statecraft upon my life, I am vaguely optimistic about discovering resistance against it. There shall be new science and new technologies ahead of their grips, there shall be new art more attractive than the leading brand insignia. I hope to find myself on the more interesting side of the human experience.&lt;/p&gt;
&lt;h3&gt;References&lt;/h3&gt;
&lt;div class=&quot;footnotes&quot;&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id=&quot;fn-1&quot;&gt;&lt;a href=&quot;https://www.goodreads.com/book/show/20186.Seeing_Like_a_State&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Goodreads - Seeing Like A State&lt;/a&gt;&lt;a href=&quot;#fnref-1&quot; class=&quot;footnote-backref&quot;&gt;↩&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;fn-2&quot;&gt;&lt;a href=&quot;https://medium.com/@jamestplunkett/metis-matters-6a48270c2731&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Medium - James Plunkett&lt;/a&gt;&lt;a href=&quot;#fnref-2&quot; class=&quot;footnote-backref&quot;&gt;↩&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;fn-3&quot;&gt;&lt;a href=&quot;https://daveguarino.substack.com/p/james-c-scott-metis-and-why-motivated&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Substack - Dave Guarino&lt;/a&gt;&lt;a href=&quot;#fnref-3&quot; class=&quot;footnote-backref&quot;&gt;↩&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content:encoded></item><item><title><![CDATA[Keynesian cogs - 2]]></title><description><![CDATA[Part 1 Non-Keynesian Cogs I ended the previous essay by a declaration that gig workers are not Keynesian cogs, because their work is driven…]]></description><link>https://kumar-ayush.com/blog/keynesian-cogs-2/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/keynesian-cogs-2/</guid><pubDate>Sat, 20 Sep 2025 20:20:30 GMT</pubDate><content:encoded>&lt;p&gt;&lt;a href=&quot;/blog/keynesian-cogs/&quot;&gt;Part 1&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;Non-Keynesian Cogs&lt;/h4&gt;
&lt;p&gt;I ended the previous essay by a declaration that gig workers are not Keynesian cogs, because their work is driven by an aspiration to rather become a Keynesian cog. They want money to afford healthcare and education for their children who may have to work less. Unlike Keynesian cogs, their purpose to work is to be able to work lesser in the future, or for their children and grandchildren to work less in the future.&lt;/p&gt;
&lt;p&gt;Quick recap, Keynesian cogs are the knowledge worker class supported by the gig workers. Those who work because they need to afford better vacations, and other such materialisms that make them feel that they are higher class of person than their peers.&lt;/p&gt;
&lt;p&gt;And then there are the rich few, who have wealth that comes with political influence, local and global. Their distinction against Keynesian cogs is blurry. Is it just a difference of more money? Or old money, which comes with the gift of not dreaming of working. I am not sure, but if I neglect that gap, loosely the classification is the aristocracy, the bourgeoisie and the proletariat. Wooops!&lt;/p&gt;
&lt;h4&gt;The Next Social Revolution&lt;/h4&gt;
&lt;p&gt;Once, I described the Keynesian cogs as living a life of slavery, because their desires are controlled by the pangs of consumerism. But that’s an overuse of the term. Truly, the gig workers have the worst of it. They do not own property, their entire existence revolves around serving others for a wage that affords them poor living conditions. The global situation is ripe for another social revolution. All you need is enough people to be convinced that the travelator they think they’re standing on is really a treadmill. If so, nihilism can be channeled externally. Life is not worth living, but it might be worth dying for our children. Revolutions really do feel like an emergent phenomenon.&lt;/p&gt;
&lt;h4&gt;Does capitalism fuel innovation?&lt;/h4&gt;
&lt;p&gt;The innovators have an incentive to make the world a better place. That has always been the same, but innovators need capital. Scientist build big machine see small atom make energy. Why would anyone take risks with their capital if they’re not promised a potential reward from the research?&lt;/p&gt;
&lt;p&gt;European monarchs were attracted by access to far reaches of the world and their natural resources for funding scientific expeditions. Colonialism was no different a form of exploitation than late stage capitalism, except the roles were easier to define based on latitudes. Well, and VOC/EIC broke the social channel. Commoners had access to capital! The sword changes hands but slashes just the same.&lt;/p&gt;
&lt;p&gt;Monarchs, or the state when it sponsors research institutions are at least in theory, enacting the will of people. They may be bad actors, but it is not guaranteed that a group of people will take better decisions. Either solution is a solution and is historically prone to disaster. What’s been happening in recent times? American research institutions are responsible for fundamental advances in natural sciences in recent decades and they draw a large part of their funding from the United States military. State sponsorships funded the development, and then the distribution of Covid-19 vaccines. In contrast, the greatest private innovation has been internet based services.&lt;/p&gt;
&lt;p&gt;We, as society, need to take risks, or deploy capital on risky projects to fuel innovation, but it is not clear to me if the system that leads to the distribution of capital deployment is relevant beyond a survivorship bias of the United States versus the USSR. The Chinese have made the cracks appear in the last decade.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Harry Potter is magical]]></title><description><![CDATA[Although it is one of the most popular franchises, it is critically underrated. The plot arc is too simplistically good versus evil, the…]]></description><link>https://kumar-ayush.com/blog/harry-potter-is-magical/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/harry-potter-is-magical/</guid><pubDate>Sun, 25 May 2025 00:20:37 GMT</pubDate><content:encoded>&lt;p&gt;Although it is one of the most popular franchises, it is critically underrated. The plot arc is too simplistically good versus evil, the magic system is not complex enough or whatever.&lt;/p&gt;
&lt;p&gt;But it has a couple of great tricks up its sleeve that make the Harry Potter experience magical. I noticed this two decades late, and several rewatches later.&lt;/p&gt;
&lt;p&gt;First, it is a fantastic format for teens because each book is one school year. That&apos;s Mallory Towers style. The best time to read the Harry Potter series is when you are in school. You are excited about all the new stuff that&apos;s going to happen in a new school year for both yourself and Harry.&lt;/p&gt;
&lt;p&gt;Secondly, and this is my main point, you get to experience the world of magic in sync with the main character. For example, at the beginning of the fourth book, &quot;The Goblet of Fire&quot;, Harry is learning about Quidditch World Cups and Portkeys and the Triwizard tournament. I mean, three years being a wizard, you ought to know some of this. But he is running around constantly confused about what&apos;s what, and everyone, to the point of even Voldemort&apos;s avatars at various points, just explains things to him. But I was ye years old when I realised that they&apos;re really explaining things for the audience. That&apos;s just the exposition style, but it works wonderfully well for a soft magic system.&lt;/p&gt;
&lt;p&gt;This contrasts well with the Fantastic Beasts movies, where the Polish sidekick brings a sense of wonder but the main character knows what he&apos;s doing. He doesn&apos;t even learn more about beasts; already an expert. The movie feels like an average fantasy production.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Decision fatigue, office perks, feudalism]]></title><description><![CDATA[Actions and decisions, that’s all we have. In the early years of the 21st century, minimal garb was fashionable among the tech giants. There…]]></description><link>https://kumar-ayush.com/blog/office-perks/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/office-perks/</guid><pubDate>Sun, 23 Mar 2025 10:20:37 GMT</pubDate><content:encoded>&lt;p&gt;Actions and decisions, that’s all we have. In the early years of the 21st century, minimal garb was fashionable among the tech giants. There are articles and theories and interviews about Mark Zuckerberg’s grey t-shirts and Steve Jobs’s black turtleneck. A popular theory is that this helps reduce decision fatigue. If you have to make a lot of important decisions in the span of your day, and if they are going to consume you, then it might help to get out of the house without having to make any decisions. It’s irrelevant if the theory is accurate, but it is quite believable. Simply so because all of us have experienced fatigue while deciding what to wear, what to eat, what to watch.&lt;/p&gt;
&lt;h4&gt;Salespeople&lt;/h4&gt;
&lt;p&gt;I love talking to salespeople as a customer. It is truly rewarding, and I have certain theories of my own on how they add value to my life. My running shoes are wearing out, and say I want to buy new ones. One approach would be to buy a new pair of the exact unit that I already own. Ehh, even if that was possible, I am probably eager to see what’s new. They keep changing things. There are new materials, and there’s always fashion. I now walk into a shoe store and go to the Running shoes section to see a panel of 50 shoes. Which one do I want? They’re all running shoes. Unfortunately, I don’t believe in concepts like numerology or favourite colour. If I did, I would appreciate those more than the salespeople.&lt;/p&gt;
&lt;p&gt;Five minutes later, I lifted a few shoes from the panel and tried to twist them a little to see if any of them were so piss-poor material that they’d break in front of me. I have tried to feel the fabric. Am I supposed to want the softer touch or coarser? How do I know which material is more breathable? According to the label, one of them is “Max” breathable and one of them is made out of a fabric called Air (TM). Before I tried to put the shoe on my face, thankfully, a salesperson walked up to me.&lt;/p&gt;
&lt;p&gt;“Can I help you?” ”Umm yea… I want to buy new running shoes”&lt;br/&gt;
They immediately pick one to show me ”Here, try this one. This is the latest in our Kite series of shoes. This is the bestseller”&lt;br/&gt;
&lt;em&gt;Really? Because this was kept on column 2, row 3 among your 5 by 10 panel. That is quite random&lt;/em&gt;&lt;br/&gt;
“Ah wow, yea looks nice. Do you have this in different colours?”&lt;br/&gt;
“Oh of course. We have white, black, navy blue”, the salesperson signals to a colleague to bring live samples of different colours.&lt;br/&gt;
“Umm, which one do you think is most versatile?”&lt;br/&gt;
“You can’t go wrong with white.”&lt;br/&gt;
“But won’t that get dirty?”&lt;br/&gt;
“Nah you don’t have to worry about that. This material doesn’t stick on much dirt to it, and you can wipe it off easily”&lt;br/&gt;&lt;/p&gt;
&lt;p&gt;I am out of reasons to stop myself from buying the shoe, well aware that it is I, who willingly entered this shoe and expressed a voluntary desire to make the purchase.&lt;br/&gt;
“Let’s pack it up then!”&lt;/p&gt;
&lt;p&gt;I am grateful for this interaction because any of those 50 shoes on the panel would’ve fulfilled my objective, but it is still hard to know the right answer. Problem-solving is easy. …solving is hard. Salespeople distil our propensity to take a decision against factors which have a vague or unmeasurable impact. I am grateful to them for easing my pain by sacrificing a small part of their conscience. In the enactment above, you can fathom that they probably lied to me. The shoes are definitely getting dirty with some use, and I have no way to verify their bestseller list. Well, maybe I could insist on a dirt demonstration or a copy of their sales statistics to verify their claims. But that’s not the point. I wanted to be lied to, in exchange for moving on.&lt;/p&gt;
&lt;p&gt;Another example, which as of yet, I’ve found to be unique to Indian garment shops. They would show you some options, and as you’ve made up your mind about one of them, they’ll not stop showing you options for a bit. They’ll open up more salwars, more shirt fabrics, more colours that you’ve already indicated you’re not interested in. My theory is that this works because they are fatiguing you into saying yes and sticking to your first choice because “No, I don’t like any of this” also takes strength.&lt;/p&gt;
&lt;h4&gt;Office Perks&lt;/h4&gt;
&lt;p&gt;An employment contract is quite different from a consumer goods purchase. For example, the buyer and seller are flipped, and you’re selling something non-material, i.e. your soul. Labour, you’re selling your labour. But it is not quite asymmetric. The employers also do have to compete to snatch potential top performers. Thus, they have to do a sales pitch, which among other things includes “perks”. Free food daily, free massages once a week, concert tickets monthly, yearly vacation retreat.&lt;/p&gt;
&lt;p&gt;What if, as a hypothetical, I am a really boring person who likes spending time away from anything that society deems as fun? Why can’t I get paid more cash instead of these perks? Even if enough people want this, this is hard. Some perks are not easy to put a monetary value on. For a lot of them, there are group benefits. The company pays for breakfast for 500 people, so it’s cheaper for everyone. So it makes sense. Because the company is paying in bulk, I can now enjoy things that I’d not have enjoyed otherwise.
Hold on, what if there are no blueberries on the breakfast menu, but I really like blueberries for breakfast? Ah, it’s really simple. I can just apply to work at the company next door. They have all the berries. So, what options do I have? Kill my desire to have blueberries. Take a career decision based on this. Buy my own blueberries. I can’t help but wonder that this would not be a problem if there was no breakfast offered at all.&lt;br/&gt;
As a side note, having baked my head in the sun enough, I feel confident that it’s, anyway, not indeed cheaper for companies. That’s just believable because hey, bulk discounts exist. But I don’t need this to carry on my argument.&lt;/p&gt;
&lt;p&gt;Perks do to our choices as employees exactly what salespeople do to us as customers. They bridge the gap to a decision once all employment options have crossed the threshold of what we were looking for in the first place. But in this case, I am not grateful for this. Robbing me of my choice and freedom and forcing me to make career decisions coupled with food and spa options is feudalism.&lt;br/&gt;
“I believe my working hours should be shifted by 1 hour”&lt;br/&gt;
“Oh, sorry we are short-staffed. But if you stay in longer than 7 pm, here’s a dinner coupon!”&lt;/p&gt;
&lt;p&gt;Among the panel of 50 companies that I could work for, I want to work for the best one. I do not want the pain of breathing the inner soles of all of them to decide which one would let me breathe and let me fly at the same time, so I shall willingly give up my thinking and pledge my allegiance to which offers the highest CTC and the best perks because that’s what I’m told matters.
If you’re wondering about my usage of the word “feudalism” to describe this condition, it is so because of the following two characteristics of workplace perks:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;We lack the political power as working-class citizens to do something about this. Making decisions trivially based on CTC and perks is truly what is in our power to do, much like choosing the lord who would feed me and not kill my family, I would be grateful to have a job which would feed my family and not make me kill myself.&lt;/li&gt;
&lt;li&gt;We are actively made to believe that we should be grateful for the generosity of our lord in not only feeding us but also providing us with these pleasures of life which we would not experience otherwise. You can’t afford a five-star hotel bedroom for a conference on your own money, peasant.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The article is an attempt to characterise office perks. Along with these two, the third characteristic is the vague valuation. They are the colour and material of the shoes which you&apos;re going to get tired thinking about, and thus, find it easier to just go with the flow.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Imagined Communities - Commentary]]></title><description><![CDATA[This is a commentary on Imagined Communities by Benedict Anderson. On Page 12, the author remarks All the great classical communities…]]></description><link>https://kumar-ayush.com/blog/ic-comment/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/ic-comment/</guid><pubDate>Fri, 01 Nov 2024 00:20:37 GMT</pubDate><content:encoded>&lt;p&gt;This is a commentary on &lt;em&gt;Imagined Communities by Benedict Anderson&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;On Page 12, the author remarks&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;All the great classical communities conceived of themselves as cosmically central, through the medium of a sacred language linked to a superterrestrial order of power. Accordingly, the stretch of written Latin, Pali, Arabic, or Chinese was, in theory, unlimited. (In fact, the deader the written language- the farther it was from speech - the better: in principle everyone has access to a pure world of signs.)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I want to extrapolate the last statement of this analysis - the shared imagination must be accessible to everyone who is (or aspires to be) part of the community. Popular memes and viral social media trends are accessible across languages and cultures. We do not have to forget the physical world. For a long time (2024), American culture export has dominated the world by providing everyone equal access to something, not a language, but commercial goods. Everyone in the “civilised” world knows McDonalds and Starbucks. They wear t-shirts branded with American university or state names. The goods invoke experiences. Funny enough, the flavours and the menu for fast food chains are often tweaked to suit local tastes. But the experience and the vibe! This is analogous to language losing centre focus as the glue because there are often translations of the base material, as long as they invoke the desired emotions among the audience. Avengers Assemble does not need a language. A core component of IC is nationalism via language, but it also forms an excellent background for the next episode: globalism via commercial goods.&lt;/p&gt;
&lt;p&gt;On Page 35,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The significance of this mass ceremony - Hegel observed that newspapers serve modern man as a substitute for morning prayers - is paradoxical. It is performed in silent privacy, in the lair of the skull. Yet each communicant is well aware that the ceremony he performs is being replicated simultaneously by thousands (or millions) of others of whose existence he is confident, yet of whose identity he has not the slightest notion.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Well, given the exposition of the previous paragraph, I have to say - the parent reads the morning newspaper on the porch, and the child watches Instagram reels on the toilet seat. The mode of communication has evolved but the core sustains - you share an imagination with a community. I am trying to force the use of words rooted in &quot;imagination&quot;, but you can equivalently phrase this as &quot;shared mental space&quot; or &quot;shared mindspace&quot;. You believe in the same values; you laugh at the same jokes, and you would refer to the same scenarios. Your ideas about fun when you meet others at an event are the same. These are passive statements. More actively, you participate in activities that enforce or evolve your participation in a community. Why do people go to concerts they do not enjoy? Or cafes to take a selfie with a coffee they find too bitter? Or do any sort of tedious religious rituals. Trivially, one could call it &quot;seeking vaildation&quot;, but that represents these actions as something of a natural impulse of human beings. That is subtly different from awarding agency to an individual. Various individuals are parts of various communities; their participation is ultimately their choice.&lt;/p&gt;
&lt;p&gt;On Page 57,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For the new functionary, however, things are more complex…&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;…Sent out to township A at rank V he may return to the capital at rank W; proceed to province B at rank X; continue to vice-royalty C at rank Y; and end his pilgrimage in the capital at rank Z…&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;…on his upward-spiralling road he encounters as eager fellow pilgrims his functionary colleagues, from places and families he has scarcely heard of and surely hopes never to have to see. But in experiencing them as travelling-companions, a consciousness of connectedness emerges, above all when all share a single language-of-state.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is how modern careers work. Education institutions are not homogenous, especially at the higher level. However, they are regulated by governments and recognised by industry with mutual information. Everyone agrees that Institute ABC is a good institute for studying mechanical engineering. While individual institutions retain their heterogeneity, the system as a whole is homogenous. When there are significant differences across nations, there are ways to attain equivalency.
The institutes are trusted to provide investiture to their members. This is society&apos;s expectation. The first institute kicks off an individual’s pilgrimage as described by IC. Yet again, friendships and imaginations flourish. If you need to switch careers or community memberships, you can go to another institute to be provided with the required values. I joke about a  U.S. Master’s degree as a visa ticket, an entry into the predestined career of individuals that share a particular ideal, not connected by skills or goals or vision, but connected by being part of an imagined community for members of the institute. People have fond memories of their college days - memories of their batchmates and rarely of the coursework they were required to do. Everyone understands this and treats it as common sense, yet it is unclear if this is by design or an emergent phenomenon of human organisation.&lt;/p&gt;
&lt;p&gt;On Page 79&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Thus in world-historical terms bourgeoisies were the first classes to achieve solidarities on an essentially imagined basis…&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;To put it another way, one can sleep with anyone, but one can only read some people’s words.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Solidarity on an imagined plane against your physical plane is prevalent now. Perhaps the Great Firewall of China and similar censorship in other states break against the phenomenon. Still, the rest of the “free world” is free to imagine themselves as citizens of Mother Earth with shared futures, values and problems.&lt;/p&gt;
&lt;p&gt;On Page 154&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;… the colonial empire, with its rapidly expanding bureaucratic apparatus and its ‘Russifying’ policies, permitted sizeable number of bourgeois and petty bourgeois to play aristocrat off centre court: i.e. anywhere in the empire except at home.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is how I feel about myself and my friends and colleagues. With our freedom of profession, location and some relatively mild restrictions, we are bourgeois in the strictest sense, living the life of nobility. We find it an inconvenience and a tragedy that some of us would get to work in the developed nations of the West while the rest of us will be stuck in India, living like a &lt;em&gt;yajman&lt;/em&gt; - surrounded by servants and labourers of convenience. Rather than being a thing of pity, it is an expression of privilege. We are not truly aristocrats in India (We think of ourselves at the mercy of the political class of the Indian republic). Yet, we can live our &lt;em&gt;yajman&lt;/em&gt; lives as long as we do it without burdening the flow of history. A feature of colonial nationalism was apathy towards the colonised. A feature of capitalist globalisation is apathy towards the exploited.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Painting - Controlled Chaos]]></title><description><![CDATA[Controlled chaos, a spinning top, wobbles, but never falls.]]></description><link>https://kumar-ayush.com/blog/chaos-painting/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/chaos-painting/</guid><pubDate>Sat, 31 Aug 2024 20:20:30 GMT</pubDate><content:encoded>&lt;p&gt;Controlled chaos, a spinning top, wobbles, but never falls.&lt;/p&gt;
&lt;p class=&quot;image&quot;&gt;&lt;span class=&quot;image left&quot;&gt;&lt;img src = &quot;/media/chaos-1.jpg&quot; alt=&quot;controlled chaos&quot;&gt;&lt;/span&gt;</content:encoded></item><item><title><![CDATA[Keynesian cogs]]></title><description><![CDATA[I can't pinpoint where I first read the phrase "cog in the machine".
It seems to be a popular idea on the internet, especially in the anti…]]></description><link>https://kumar-ayush.com/blog/keynesian-cogs/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/keynesian-cogs/</guid><pubDate>Fri, 30 Aug 2024 20:20:30 GMT</pubDate><content:encoded>&lt;p&gt;I can&apos;t pinpoint where I first read the phrase &quot;cog in the machine&quot;.
It seems to be a popular idea on the internet, especially in the anti-capitalist discourse of the West.
That is generic angst against the establishment.
It&apos;s a not-in-power younger generation going against the in-power older generation so I wouldn&apos;t stress much meaning there.&lt;/p&gt;
&lt;p class=&quot;image&quot;&gt;&lt;span class=&quot;image left&quot;&gt;&lt;img src = &quot;/media/cogs-1.png&quot;&gt;&lt;/span&gt;
But I, too, think about the phrase in various contexts. I am a fellow cog. I am an &quot;office worker&quot;. Most of my friends, engineers and MBAs, do work which is, well, not much engineering or business administration, but often feels like paper pushing as agents of a political class.
&lt;/p&gt;
&lt;p class=&quot;image&quot;&gt;
&lt;a class=&quot;image right&quot; href=&quot;https://neweconomicperspectives.org/2011/10/rip-shareholder-value-meme-make-way-for.html&quot;&gt;&lt;img src=&quot;https://neweconomicperspectives.org/wp-content/uploads/2012/03/shareholdervalue1.jpg&quot;&gt;&lt;/a&gt;
Let&apos;s consider a mining company, which is an excellent example due to the raw necessity of its existence for the survival of modern civilisation. I wonder if layers of management exist just so that the customers are not directly slaving off the employees. The company seems to be a machine designed to abstract the economy&apos;s needs enough that you cannot question the source.
&lt;/p&gt;
&lt;p&gt;From another viewpoint, having work responsibilities is crucial to a meaningful life, lest we all drop into nihilism. It might not be the workload but the responsibility towards adding value to society in some form that drives the cogs. There is a sinister beehive/superorganism subtext that tries to explain the purpose of an individual life towards the progress of society.&lt;/p&gt;
&lt;p&gt;If you choose to deny this program, you will find yourself a nihilist or, rather, a hedonist. I do not mean hedonism in an epicurean sense but as the literal interpretation of focussing on individual good. Such philosophies, in recent history, have led to an atrophy of society. And if you consider the declining fertility rates in advanced economies of the day, the atrophy is quite literal.&lt;/p&gt;
&lt;p&gt;When I think of cogs, I think of Keynesian cogs. There is no such term before me, but that coinage sings to me. Read this famous essay by Keynes himself. &lt;a href=&quot;https://www.marxists.org/reference/subject/economics/keynes/1930/our-grandchildren.htm&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Economic Possibilities for our Grandchildren&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Keynes had these arguments roughly 100 years ago that we would not need to work as much in future because rapid innovation brought forth by capitalism will reduce the need to.&lt;/p&gt;
&lt;blockquote&gt;
I draw the conclusion that, assuming no important wars and no important increase in population, the economic problem may be solved, or be at least within sight of solution, within a hundred years. This means that the economic problem is not – if we look into the future – the permanent problem of the human race. 
&lt;/blockquote&gt;
&lt;p&gt;Keynes argues that in the future, we will work exclusively to satisfy a primal need to be useful, which he calls the &quot;old Adam&quot;.&lt;/p&gt;
&lt;blockquote&gt;
For many ages to come the old Adam will be so strong in us that everybody will need to do some work if he is to be contented. We shall do more things for ourselves than is usual with the rich to-day, only too glad to have small duties and tasks and routines. But beyond this, we shall endeavour to spread the bread thin on the butter – to make what work there is still to be done to be as widely shared as possible. Three-hour shifts or a fifteen-hour week may put off the problem for a great while. For three hours a day is quite enough to satisfy the old Adam in most of us! 
&lt;/blockquote&gt;
&lt;p&gt;I would argue that Keynes&apos; has been correct in the aggregate that are better off than a century ago and need to put in fewer hours, but there are curious details. I found &lt;a href=&quot;https://direct.mit.edu/books/edited-volume/2712/Revisiting-KeynesEconomic-Possibilities-for-Our&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;a critique&lt;/a&gt; which appears to argue on similar lines as the following. It is on my reading list and I would revise this article in the future if there are significant divergences.&lt;/p&gt;
&lt;p&gt;The distribution of work responsibilities against socioeconomic class has fattened, but the tail on the lower end does not vanish. We all &quot;office workers&quot; doing paper pushing seem to be reaping the benefits. We live like nobles, satisfying the &quot;old Adam&quot; in us, but that is not true for the person who delivers your food from the app or the workers who clean our sewers.&lt;/p&gt;
&lt;p&gt;True that there are machines to help them. Technology has improved safety for those workers over the years, but they are not Keynesian cogs, in any sense. They are doing their job both because society needs them to and because they need the money to survive. When nihilism knocks on their door, they answer with their aspirations that there&apos;s a better future for them, their children, and their grandchildren.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/blog/keynesian-cogs-2/&quot;&gt;Part 2&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Software is process]]></title><description><![CDATA[When I was younger, I wanted to be an inventor. From Doraemon to Kiteretsu, I dreamed of cool gadgets that could make my life easier. I've…]]></description><link>https://kumar-ayush.com/blog/software-is-process/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/software-is-process/</guid><pubDate>Fri, 19 Jul 2024 10:20:37 GMT</pubDate><content:encoded>&lt;p&gt;When I was younger, I wanted to be an inventor. From Doraemon to Kiteretsu, I dreamed of cool gadgets that could make my life easier. I&apos;ve spent months playing with DC motors and magnets to build useless gadgets, but those were the joys of childhood. Eventually, I got a computer, and since then, I have spent most of my time &quot;building&quot; software, hobby-wise and professionally. I think of myself as an engineer, and for the longest time, I&apos;ve felt that as engineers, our place in society is to build stuff. We are supposed to arrive at the scene, analyse the situation, and present a solution.&lt;/p&gt;
&lt;p&gt;Recently, I&apos;ve realised that the solution is not always a tool that is to be built. Instead, the solution is often a process that is established. I wonder if this is why it makes sense for countless engineers to become consultants whose job is to establish processes and recommend tools for others. Some consultants may participate in the tool-building process, too, but that is not the prevalent image of their profession anyway.&lt;/p&gt;
&lt;p&gt;Thus, engineering is both about building tools and establishing processes. Excellent, good summary, but this is a cheap argument. The more interesting point is that all engineering does impose a process. A tool does not exist without context. The simplest tool imposes a process. Using a hand-held hammer to mint coins requires a metalworking process that can be managed with the manual strength of a blacksmith. The process has a complex relationship with the tool. It does not dictate the tool but guides it. If you discover new materials or want to be creative with your coin, you might have to invent new tools.&lt;/p&gt;
&lt;p&gt;I request your attention to the following conclusion.
First, for most engineering professions, process design has evolved to be done by different people than tool builders. For example, a door has to open &quot;in&quot; or &quot;out,&quot; but that&apos;s for the architect to say. The mechanical engineer must only concern themselves with the hinges and how they creak. There is a relationship in the arts, but that is a relationship between two professionals.&lt;/p&gt;
&lt;p&gt;This is true for buildings and architectures, factories, mechanical engineers and industrial designers, automobile engineers and car designers, etc. Thus, in retrospect, always in retrospect, I could have anticipated that product managers would play such a prevalent role in the software industry a decade ago. &lt;a href=&quot;https://www.cameronsworld.net/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Not so long ago&lt;/a&gt;, everyone was a full-stack developer in software. The tool builders were the UX designers.
That was all before JavaScript released its hellspawns upon our world. Hold on, the conflation is still there for &quot;non-important&quot; stuff. Similarly, a skilled civil engineer might find designing a vanilla 2 BHK apartment easy enough. But for everything &quot;important&quot;, such as Meta and its apocalypse horsemen, you get an army of product designers, owners and other folks whose job is establishing processes, not the actual building. A more striking example would be data teams in large enterprises.
&lt;em&gt;Databases are perfect examples of tools in a tight loop with the read-write process. You need an entirely different infrastructure for something that requires small but frequent read-writes compared to infrequent but large read-writes. Databases are an exciting engineering problem because a one-size-fits-all solution is &lt;a href=&quot;https://en.wikipedia.org/wiki/CAP_theorem&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;mathematically impossible&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Given this background, I find it shocking that nothing equivalent to building codes is prevalent in software. Non-sarcastically &quot;important&quot; software such as tax filing systems, healthcare, and travel systems all rely on software that could have bugs. Still, no agencies regulate the basic standards required for software to be in the market. Your identity can be stolen. You can be denied access to critical services.
(&lt;em&gt;&lt;a href=&quot;https://www.thehindu.com/news/cities/Coimbatore/biometric-authentication-failure-hits-distribution-of-rations-at-fair-price-shops/article32672404.ece&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;People in India get denied food rations due to issues with the biometric authorisation systems&lt;/a&gt;&lt;/em&gt;). Software systems impose a political will by virtue of being a process. They are a power which must have checks and balances in a democracy. Computers are a great technical innovation. They can make enforcement better. If you are a non-binary person and you must choose a gender between Male or Female on an internet portal to book a flight, what do you do? Perhaps if you were booking a flight with a human cashier, they would simply pay no attention to a few &quot;incorrect&quot; fields on the form. But that would be inefficient. That would be &quot;bad data&quot; due to &quot;human ineffeciencies&quot; and that&apos;s precisely why we got the computers to replace the stupid humans! The AI world has had more conversations around &quot;ethical AI&quot; and regulating the &quot;LLM giants&quot;, but nothing has been done. Even if they come up with something, that&apos;s not the beginning or the end. AI has more negative PR, thanks to Arnold Schwarzenegger and thanks to Eliezer Yudkowsky??&lt;/p&gt;
&lt;p&gt;Be aware, be vocal. Do not accept lousy software. Push for higher standards (of software) in your life.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Coincidnetally, this was published during the week of the Crowdstrike outage.&lt;/em&gt;&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Python Enums are evil]]></title><description><![CDATA[The short answer is that enums derive their unique value by restricting a variable's values in a program. This is contradictory to Python's…]]></description><link>https://kumar-ayush.com/blog/python-enum/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/python-enum/</guid><pubDate>Fri, 17 May 2024 20:52:02 GMT</pubDate><content:encoded>&lt;script markdown=&quot;0&quot; src=&quot;https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js&quot;&gt;&lt;/script&gt;
&lt;p&gt;The short answer is that enums derive their unique value by restricting a variable&apos;s values in a program. This is contradictory to Python&apos;s type system. Thus, Python enums are an elephant&apos;s tusks.&lt;/p&gt;
&lt;p&gt;In my practical life, there are two situations where I have felt a need for an Enum in Python.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;I might want to restrict the possible values of a column. An enum is useless here because it is not a valid dtype. You are encouraged to use a &lt;code class=&quot;language-text&quot;&gt;pandas.Categorical&lt;/code&gt; to achieve this. That&apos;s not the same as an enum, because &lt;code class=&quot;language-text&quot;&gt;np.nan&lt;/code&gt; is intrinsically supported as a valid value.&lt;/li&gt;
&lt;li&gt;I want to restrict the values of a function argument. There are no ways for the interpreter to do this, but static type checkers do this. But why would I instead not use &lt;code class=&quot;language-text&quot;&gt;typing.Literal&lt;/code&gt; for this purpose?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I have found it convenient to define a Literal type that can be re-used across my codebase.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;python&quot;&gt;&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; typing &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; Literal

Fruit &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; Literal&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&apos;apple&apos;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&apos;orange&apos;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;See Also&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.sqlalchemy.org/en/20/orm/declarative_tables.html#using-python-enum-or-pep-586-literal-types-in-the-type-map&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Enums with SqlAlchemy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Behaviour quirk of &lt;code class=&quot;language-text&quot;&gt;Enum&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;IntEnum&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;python&quot;&gt;&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token operator&quot;&gt;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; enum &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; Enum&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; IntEnum
&lt;span class=&quot;token operator&quot;&gt;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Fruit&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;IntEnum&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;     Apple &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;     Orange &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt; 
&lt;span class=&quot;token operator&quot;&gt;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; fruit &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; Fruit&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Apple
&lt;span class=&quot;token operator&quot;&gt;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; fruit &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;token boolean&quot;&gt;True&lt;/span&gt;
&lt;span class=&quot;token operator&quot;&gt;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Fruit&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;Enum&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;     Apple &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;     Orange &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt; 
&lt;span class=&quot;token operator&quot;&gt;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; fruit &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; Fruit&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Apple
&lt;span class=&quot;token operator&quot;&gt;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; fruit &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;token boolean&quot;&gt;False&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Thus, even if you must, use an &lt;code class=&quot;language-text&quot;&gt;IntEnum&lt;/code&gt;.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[2023 in Books]]></title><description><![CDATA[A continuation from 2022 in books. Best in Fiction The Brothers Karamazov by Fyodor Dostoevsky This is a classic, and it is probably not the…]]></description><link>https://kumar-ayush.com/blog/2023-in-books/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/2023-in-books/</guid><pubDate>Mon, 25 Dec 2023 00:20:37 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;A continuation from &lt;a href=&quot;/blog/2022-in-books/&quot;&gt;2022 in books&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;Best in Fiction&lt;/h3&gt;
&lt;h4&gt;&lt;a href=&quot;https://www.goodreads.com/book/show/4934.The_Brothers_Karamazov&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;The Brothers Karamazov&lt;/a&gt;&lt;/h4&gt;
&lt;h5&gt;by Fyodor Dostoevsky&lt;/h5&gt;
&lt;p&gt;This is a classic, and it is probably not the most entertaining piece of fiction I&apos;ve consumed in 2023, but it is quite memorable. Despite long monologues at certain places, the book will keep you hooked. There is a murder and there is a mystery.&lt;/p&gt;
&lt;h3&gt;Best in Memoir&lt;/h3&gt;
&lt;h4&gt;&lt;a href=&quot;https://www.goodreads.com/book/show/123183412-down-the-drain&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Down the Drain&lt;/a&gt;&lt;/h4&gt;
&lt;h5&gt;by Julia Fox&lt;/h5&gt;
&lt;p&gt;Iconic and inspiring.
Typically, I tend to find inspiration in voyagers, explorers and entrepreneurs. But what drives inspiration is sheer determination and will against all adversity. Julia&apos;s story has that.
More than that, it is quite an entertaining book. She is a great storyteller.&lt;/p&gt;
&lt;h3&gt;Best in Textbook&lt;/h3&gt;
&lt;h4&gt;&lt;a href=&quot;https://www.goodreads.com/book/show/58898489-causal-inference-for-the-brave-and-true&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Causal Inference for the Brave and True&lt;/a&gt;&lt;/h4&gt;
&lt;h5&gt;by Matheus Facure&lt;/h5&gt;
&lt;p&gt;I am on the causality wagon since last year.
This is an e-book with code snippets and visualisations.
It is also quite concise, which helps.
&lt;br /&gt;
&lt;strong&gt;Most memorable idea&lt;/strong&gt;: Linear regression is your best friend.&lt;/p&gt;
&lt;h3&gt;Best in Non-Fiction&lt;/h3&gt;
&lt;h4&gt;&lt;a href=&quot;https://www.goodreads.com/book/show/61714633-the-wager&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;The Wager: A Tale of Shipwreck, Mutiny and Murder&lt;/a&gt;&lt;/h4&gt;
&lt;h5&gt;by David Grann&lt;/h5&gt;
&lt;p&gt;As the subtitle goes, a tale of shipwreck and mutiny. This would make a great suspense thriller. Another great example of how reality is much more juicier than fiction.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Fin&lt;/em&gt;&lt;/p&gt;</content:encoded></item><item><title><![CDATA[We vote in hyperreality]]></title><description><![CDATA[This is the second in a two-part series. Read the fiction piece first for fun, but not a pre-requisite. Raj is a commentary on various…]]></description><link>https://kumar-ayush.com/blog/hyperreality/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/hyperreality/</guid><pubDate>Wed, 01 Nov 2023 10:20:37 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;This is the second in a two-part series. Read the &lt;a href=&quot;/blog/raj-the-banyan-tree/&quot;&gt;fiction piece&lt;/a&gt; first for fun, but not a pre-requisite.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Raj is a commentary on various topics. In a meta sense, that is intentional to draw more focus to the core ideas it is supposed to be about. And those ideas are postmodernism&apos;s hyperreality, simulacra and simulation.&lt;/p&gt;
&lt;p&gt;If you are already familiar with the lingo, you will understand that my work simulates other popular culture pieces, among whom I would name 12 Monkeys and Cloud Atlas. If you are not, I hope you will find my explanations reasonable and informative. I want to discuss these ideas in the context of 21st-century populist politics. It is pretty tempting to make this an &quot;Isn&apos;t it concerning?&quot; essay, and it may very well sound like that. But from my perspective, it is more of &quot;Isn&apos;t that fascinating?&quot;. In essay form, it is easy to tell you what I want you to think. If I get your attention, that is in return for your mental stimulation. If I inspire you to do more, my appeal is compassion for the world. Concern is free, and hence, that is worthless to me.&lt;/p&gt;
&lt;p&gt;So, how do we perceive reality? We learn in primary school that we have five senses - sight, hearing, smell, taste and touch. Imagine you are walking through a garden enjoying a lemon sorbet. You can see all the colours - the green grass, the white lilies, the red roses. You can hear birds chirping and children playing. You taste your sorbet. It is appropriately sweet and sour. You take off your sandals and step on the grass. You feel the rough grass and soil on your bare sole. You take a deep breath, and you can smell floral fragrances and petrichor.&lt;/p&gt;
&lt;p&gt;As you read the previous paragraph, you experienced several aspects of walking through a garden, but you used only one sense. Your eyes. I am trying to be concise, but of course, if you are blind, you used your sense of touch to read this. If you are deaf, you put no meaning to the sound of birds chirping or children playing, but you may have imagined a group of birds moving their beaks and a bunch of kids running around in circles or whatever they do. But for the average reader, you experienced something that involves all of your senses without actually using them in the physical world. It is a crucial characteristic of human communication and experience that your brain fills in the rest from memory.&lt;/p&gt;
&lt;p&gt;Let&apos;s talk about art. Art is a medium to communicate ideas and emotions. And that is how media works. All media is a way of packaging reality to be perceived. You can call that a simulation. Since the medium itself is now part of the physical reality, you can package the medium to make new media. That&apos;s a simulacrum.&lt;/p&gt;
&lt;p&gt;Now, the media aren&apos;t truthful, whatever that means to you. For example, I could show you a picture of a garden with red grass where the red grass represents bloodshed or violence. You would know that because I rely on the idea that you have seen grass before. So, I am not lying to you. I have purposefully twisted my interpretation of physical reality to express an idea. Our imagination is much larger than reality (Nietzsche &lt;em&gt;wink wink&lt;/em&gt;).&lt;/p&gt;
&lt;p&gt;Combine both of these ideas. First, media are an arbitrary mix of physical realities, ideas and other media. Second, ideas are represented by twisting physical reality in a way that makes them indistinguishable without an external reference. You end up with a multiplicity of realities. The superset can be called the hyperreality.&lt;/p&gt;
&lt;p&gt;We&apos;ve only set the stage. The &quot;concerning&quot; part starts when you think about how ideas and emotions are also building blocks for beliefs. If a Californian stays at my bnb, I would be surprised if they asked for poha for breakfast, but less if they asked for avocado toast. I&apos;ve pieced together an idea of a Californian person&apos;s breakfast preferences based on television.&lt;/p&gt;
&lt;p&gt;So, should we only process information we perceive through our five senses? Of course not. We could be living in a matrix, after all (Yep, fantastic movie). We can act on incomplete information by extrapolating from our knowledge and beliefs. For most of it, this is a powerful trait. It is a pillar of intelligence in our species. Call it imagination. Call it guessing. Call it intuition.&lt;/p&gt;
&lt;p&gt;However, on the margin, exercising the ability to generalise leads to stereotyping. That is seen as a vice in the 21st century. Biases lead to discrimination, hatred and suffering.&lt;/p&gt;
&lt;p&gt;And that&apos;s the point of Raj the Banyan Tree. It is a story about generations of our kind who have never sat under a real tree. Many grew up in a Martian colony and do not know what sunlight through Earth&apos;s atmosphere feels like. To put it more starkly, Raj may not have green leaves. People have traditions and feelings about Raj, and you, the reader, associate with those feelings. You may not agree with them, or you may find them strange, but you have a picture of a lone banyan tree standing on an empty plain ground. You understand the reality of someone hating their neighbours for having a different political opinion than theirs because you often see it around you.&lt;/p&gt;
&lt;p&gt;The information revolution did not increase our capacity to experience more reality. It increased our capacity to experience more media. We can form beliefs and emotions about a reality we have little experience of. I am not trying to say that perception before the internet and television did not suffer from this dilution of reality. But the internet and modern-day computers did make it easy to produce more media, and then Boltzmann kicks in to tell you that that&apos;d naturally lead to hyperreality. In other words, the ease of making media makes it statistically more likely that you get more media. Since a tiny percentage of this will pass off as a first copy of reality (so to say), you end up flooded with simulacra.&lt;/p&gt;
&lt;p&gt;Do you remember the borewell crisis in India? A few years ago, for 6-12 months, a kid fell into an open borewell almost every week. If I had to estimate the number of kids falling in open borewells per year, I would expect the chart to perhaps show a downtrend. Generally, as the nation grows, safety measures involved in construction improve, and such incidents are reduced. Perhaps I would expect an uptrend because there are more kids and there is more construction. Whatever your hypothesis may be, it is not intuitive that there was such a particular rise in incidents for a short period. A more attractive theory is news cycles. News media loved covering any borewell incident because it brought them attention. As a nation, we were deeply concerned about this issue. Then we forgot. The issue did not cease to exist. If you specifically search for it, you can find recent news about this.&lt;/p&gt;
&lt;p&gt;Coincidentally, as I write this, the Israel-Hamas war is a month old. I should not call this a war. The only renowned simulacra book I&apos;ve read is Baudrillard&apos;s &quot;The Gulf War Did Not Take Place&quot;. In its tradition, the Gulf War was a war solely in how news media chose to simulate it. On the ground, it was a one-sided display of force. Millions of miles away from the action, we have emotions and opinions about the outcome of this conflict. Do not consider the remark about physical distance literally. I am in Dubai, yet I am far away because I do not have any Palestinian friends or colleagues, nor do I have any Israeli friends or colleagues. I am deeply concerned about the death and despair the conflict brings. I see the sorrow on the news. Concern is free. We will forget this like the other one.&lt;/p&gt;
&lt;p&gt;Do we remember when we cast our votes? Do we remember when we voice our opinions? Our politicians remind us. They come to reaffirm our beliefs. But our beliefs are in hyperreality. They are formed out of the media we consume. Is the government in my hometown corrupt? Probably? Sounds fair, yeah. The opposition says they stole funds that were supposed to be used for building a school. Were they supposed to build a school? Probably? Isn&apos;t that what the government does? Oh, also, there used to be a temple here centuries ago, which we will rebuild. Really? There&apos;s archaeological evidence for it, too. What evidence? Archaeological. Keep up. I am going to spell it out for you. Our beliefs are in hyperreality, and that&apos;s where we vote.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Raj the Banyan Tree]]></title><description><![CDATA[This is the first in a two-part series. This fictional narrative is designed to serve as an allegory to philosophies that we will discuss in…]]></description><link>https://kumar-ayush.com/blog/raj-the-banyan-tree/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/raj-the-banyan-tree/</guid><pubDate>Sun, 08 Oct 2023 10:20:37 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;This is the first in a two-part series. This fictional narrative is designed to serve as an allegory to philosophies that we will discuss in the &lt;a href=&quot;/blog/hyperreality/&quot;&gt;next part&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This is a story about Raj, a 1000-year-old banyan tree. Raj is no ordinary tree. Well, Raj has a trunk. The trunk has branches that have leaves. Five major branches radiate outward from the main trunk. There&apos;s perseverance in the north, exploration in the south, enlightenment in the west, prosperity in the east and unity in the northeast. Countless smaller branches spring out of these. They have their names, too. Journalists and politicians always have time for this stuff throughout history. And we have a lot of history.&lt;/p&gt;
&lt;p&gt;Thus, Raj is ordinary in all aspects of being a tree but extraordinary in all aspects of being. You&apos;d reckon Raj is the last living tree in the known universe. Raj lives in a climate-controlled dome, which might also be out of the ordinary, depending on when you read this. However, in Alia&apos;s time, any habitable area in the solar system was built and maintained by us. Who are we? We are the architects of this story. We are the humans. We control the climate in Raj&apos;s sanctuary, the Raj Rakhshak. We keep the engines that power the Rakshak dome running through our sweat and blood.&lt;/p&gt;
&lt;p&gt;Alia thinks that description is an exaggeration. Quite a trivial portion of the tax paid by the working population is required for the maintenance of Raj Rakshak. And the people complain about that, too? I need to clarify; this story is also about a young girl called Alia who hates her neighbours. Her neighbours are stupid. Their parents immigrated from the Jovian moons. The Jovians have different brains because of all the weird gravity. Martians still had Terran roots. Thus, native Martians have a better sense of the importance of Raj Rakshak to their origin story. Without Raj, Mangalbharat would not be the first nation to establish a functional colony on Mars. However, the immigrants do not care about the toll paid by Alia&apos;s ancestors. They are miserly beings who only care about the cess they pay for Raj&apos;s survival. Alia hates her neighbours because they&apos;d vote to kill Raj. They should not have a right to vote on such matters in the first place.&lt;/p&gt;
&lt;p&gt;Alia is too young to understand that that is not how a universal adult franchise democracy works. And that is what Mangalbharat is, owing to its legacy as a spin-off of ancient India. And Alia is a nobody who lives in a generic residential sector of Mangalbharat. Most of us humans live here on Mars. It is easier than any other place in the solar system. We get heavy metals and minerals required for nuclear fuel from the asteroids, and Mars is closer than Earth in terms of fuel transport.&lt;/p&gt;
&lt;p&gt;Alia hates her neighbours because they are apathetic towards Raj. She is sure of it. She has seen their Y profiles. They have boosted Yarns from the Frugal Party. The Frugal Party has, since its inception, felt the need to cut government spending to maintain Raj Rakhsahk. How much do they expect to save? Will the extra resources provide for more homes? No, the politicos would gobble the money into their personal estates. They wear a frugal mask to gain power, but they do not care about the advance of our civilisation. They say there is no use of Raj except for a symbolic display of wealth for the elite. That is an easy claim because the sanctuary is closed to public visitors. To visit Raj, to stand in Raj&apos;s majestic shade, you either donate a large sum to the sanctuary, or you are the prime minister of Mangalbharat who takes their oath under shade. This is a terrible interpretation of facts from Alia&apos;s neighbours. Visits to Raj Rakshak are limited due to logistical reasons. This has nothing to do with a class hierarchy.&lt;/p&gt;
&lt;p&gt;For several years, people would visit Raj every week to touch its trunk, express gratitude, and gather Raj&apos;s blessings. These were the early days of the bioprinting revolution. The revolution may as well be called a crisis. India was severely affected by climate volatility. There were droughts all over the country&apos;s agricultural belt. Bengal was flooded. The country was helpless. However, not hopeless.&lt;/p&gt;
&lt;p&gt;The Europeans had invented bioprinting. As a landmark for humanity, this was a miraculous leap. We did not need plants or trees or any other organic material. We could &quot;print&quot;, or manufacture them all from inorganic resources. We were no longer dependent on Earth to be our home base. The technology was guarded by borders, but India could purchase the product - bioprinted food. That was not an inexpensive option, so the Indians figured they could survive the calamity by bioprinting food domestically. They miscalculated the economics of the whole affair. Their technology could not achieve the efficacy of European printing in time. Their printers had lower produce per unit resource consumed and were slow enough to cause death and riots through deprivation.&lt;/p&gt;
&lt;p&gt;Raj Rakhsak was a monument to the bioprinting revolution in India. Through half a century of geographical, political and social changes, the population came to be centred around the ancient capital of New Delhi. They built a home for Raj at the centre of their newfound civilisation. They worshipped Raj. The sanctuary was a public good open to all.&lt;/p&gt;
&lt;p&gt;Shweta hated her neighbours, too. She lived through a time when they passed an ordinance requiring visit passes for Raj Rakshak. These were free at first. Their core purpose was to manage the crowd in the sanctuary. This had started to become an issue as the population boomed. Another quirk of our history contributed to this turn of events. People wanted their newborn children to experience Raj&apos;s shade, if only briefly. Being shaded was now a ceremony. Shweta had been shaded by her grandmother when she was 2 years old. This was a relatively simple ceremony; you move the baby towards the tree, ensuring a sunlight-to-shade transition. But a tree, even a banyan tree, is a limited physical presence. Shweta hated her neighbours because they had voted to charge the public for visit passes. They were obtuse folks.&lt;/p&gt;
&lt;p&gt;Unbeknownst to Shweta, there was politics at work. As such, a negligible portion of the government&apos;s treasury was spent on maintaining the sanctuary. However, in absolute terms, the number looked significant to some folks. They did some math in their head and wondered if the whole affair was worth their money. Some folks did not care for Raj beyond its existence as a public monument. Did they care about the shading ceremony? Every municipal office had a more miniature inorganic replica, which you could use as a substitute for the hassle of visiting Raj.&lt;/p&gt;
&lt;p&gt;For Shweta, the experience of getting shaded by Raj was worth the hassle and, later, worth every penny. When you entered the shade, a cool breeze with a heavenly smell would blow on your face. An information panel would tell you how your ancestors felt under a tree. The heavenly smell is called petrichor and is produced via moisture and dust. You could not touch the tree trunk, but you could purchase a leaf as a memoir. They said that the leaves are collected as Raj sheds them. Shweta did not believe them. The leaves were probably printed separately, but they are the same DNA as Raj, and they use the technology which forms the basis for Raj Rakhsak as a monument. Hence, they are worth it too. She purchased two with her kids&apos; names engraved on them.&lt;/p&gt;
&lt;p&gt;Alia hates her neighbours. It is common practice to have a Rajpatta framed and preserved on the doorway of your home. Alia&apos;s neighbours have a replica made of gold. They are stupid. They like to pay for an ornament but would not pay for what the ornament represents. Alia does not know that her ancestor, Shweta, has gone through her plight. Over centuries, governments would take back full responsibility for Raj Rakshak. Some have renovated the sanctuary and upgraded its infrastructure to appease their voters. Others came who washed this responsibility off their hands to appease their voters instead.&lt;/p&gt;
&lt;p&gt;Alia&apos;s grandmother, Swati, worked as a botanist in Raj Rakshak. She was the only person Alia knew who had visited Raj. You had to be important to get a chance to visit. There was hardly any population living on Earth, and interplanetary passenger ships were costly. Maintaining the atmosphere in space was quite a different game than controlling the atmosphere on a planet.&lt;/p&gt;
&lt;p&gt;A decade ago, Swati was pulled out of retirement for a special mission. Raj was sick with a parasite. This was an unusual situation. No organic material that could harm Raj should have entered the dome in the first place. But the parasite had hollowed out the trunk, and several roots were rotten before it was discovered. Raj was a large banyan tree by now. This had to be fixed the old way. Bioprinting could give you a new tree, but replacing the trunk of a millennium banyan tree was impossible. Any mistakes would be seen as a disaster. The affair was kept a secret until Swati and her team found a cure without harming the tree. Swati passed away of natural causes on her way back to Mars.&lt;/p&gt;
&lt;p&gt;Alia hates her neighbours. The neighbours do not know that Swati has given her soul to Raj. She would spend hours standing under Raj&apos;s shade to relive her grandmother&apos;s memory. Alia was not miraculously awarded access. She used a transferred reality module. Shweta would be elated if she could experience this. In Shweta&apos;s time, transferred reality headsets could give you an audio-visual experience of another place. In comparison, modern headsets can manipulate electrical signals in our brains directly. The cool breeze and the petrichor can be experienced in the comfort of your home.&lt;/p&gt;
&lt;p&gt;When Alia would turn 18, she would go through her shading ceremony. She would eat a roasted chilli, immediately followed by a spoonful of curd. This is quite different from the ceremony Shweta would remember. Perhaps that is the case because the experience of being in a tree&apos;s shade is no longer an ordeal. Perhaps that is the case because ceremonies transform through time. Alia&apos;s neighbours have voted for a more permanent outcome than the political cycles that came before. Raj would be replaced with an inorganic replica. The last living tree would be no more.&lt;/p&gt;
&lt;p&gt;That is a lie. The story of Raj the banyan tree does not end. The replica is still called Raj, and why wouldn&apos;t it be? When the next visitor touches the trunk, they will feel the surface is different. Will the programmers of transferred reality systems change provide a choice? You can experience the old Raj or the new Raj or a fluffy one made of cotton candy. When the children of Mangalbharat turn 18, will they no longer have a shading ceremony? We know the answers to these rhetorics because Raj was never the last living tree. Alia will grow up to forgive her neighbours. She will learn in school that Raj was merely the first bioprinted banyan tree.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Malazan and A.I.]]></title><description><![CDATA[Since the pandemic, I have spent a disproportionate share of time reading fantasy and sci-fi books. My latest addiction is books from the…]]></description><link>https://kumar-ayush.com/blog/malazan-and-ai/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/malazan-and-ai/</guid><pubDate>Sun, 19 Feb 2023 10:20:37 GMT</pubDate><content:encoded>&lt;p&gt;Since the pandemic, I have spent a disproportionate share of time reading fantasy and sci-fi books. My latest addiction is books from the &lt;a href=&quot;https://en.wikipedia.org/wiki/Malazan_Book_of_the_Fallen&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Malazan world&lt;/a&gt;. Given that I&apos;d instead be reading history, politics or philosophy if not fiction, these books provide an enthralling experience. Reading the Malazan series feels like we are being presented with a newspaper or a journal. A few characters in the series play the role of historians and poets, and it does feel that if we are expected to relate to anyone, it is them. Often, the reader will find themself reading a philosophical monologue on just about any topic. It is always contextual, often has elements of foreshadowing or retrospective revelations about the story, and yet the diversity. The world is rich and ripe. I would find my imagination lacking before complaining about Malazan&apos;s worldbuilding elements. There are entire histories, sociologies and philosophies contained within a fictional series. The author often drives inspiration from actual history, which is quite apparent, but it is well done enough not to matter. These books are a study of their own, and I am incredibly grateful to be introduced to these books.&lt;/p&gt;
&lt;p&gt;Other than that, the vast volume of critique and reviews for the entire Malazan world are adequate, and there is no particular viewpoint I can contribute now. However, I found the fan art lacking in volume. It may be a function of the popularity of the series, which remains bound by the challenge it proposes to new readers. These are difficult books to read. They can very much feel like your history homework. Well, they do have dragons and typical story arc elements, but nevertheless, consuming these books is not a relaxing venture. Anyway, I complained about the fan art situation to my wife, who suggested I contribute to the fan art myself if I felt unsatisfied with it. I agreed. However, she expected me to struggle to draw something independently with my drawing skills worthy of a toddler. Clever me decided to use A.I. to do this.&lt;/p&gt;
&lt;p&gt;I&apos;ve been unable to mute all the chatter about DALL-E and then ChatGPT anyway. And while we are here, let me state my quick opinion on all of this A.I. brouhaha. I do believe that A.I. has great potential to assist us. The way to think about these tools is to imagine how you think about garments and tailors. Machine looms transformed the textile industry. There is no longer the need for a human being to do the weaving, but we still need tailors. A.I. tools do an excellent job of solving generalisations of human problems. Still, we have the unique advantage of coming up with wants and desires that the machines cannot predict. And thus, they could be better at the margin, but they are great assistants.&lt;/p&gt;
&lt;p&gt;Moreover, they make things more accessible, which is always good. Nespresso made espresso accessible, and fast fashion gives us the ability to look different every day. Sustainability aside, and the fact that Nespresso coffee tastes like muck aside, more accessibility of goods and services that tend to our desires are what we aspire to as a species. I am celebrating. I am an active user of Github Copilot at work. As you are reading this blog, you should know that I am a heavy user of Grammarly, and the premium version, which tries to steal my style and thunder and recommend bland phrases. You suck, Grammarly! Will you ask me to change this sentence? (It did. But I am the human, and I will have the last word over A.I., as of writing)&lt;/p&gt;
&lt;p&gt;Coming back, I was excited about the possibility of generating fan art using A.I. I tried DALL-E and Midjourney and ended up purchasing a subscription for Midjourney. DALL-E feels extremely amateur in comparison. Midjourney, or MJ or Midge, completely checks all boxes on the joy one may get from a new programming language. The possibilities of what you can do feel limitless, although diminishing with complexity. I will arrive at what I mean by that statement. But ultimately, the verdict is firmly in favour of the tool. I will keep coming back and using this for various use cases; maybe I need a new cover image for my blog, or a new wallpaper or a fancy sticker pack. However, there are a few observations I will discuss here.&lt;/p&gt;
&lt;p&gt;First, there are correlations that the A.I. has learnt, which you will have a hard time unravelling. The knowledge that two elements are uncorrelated or unrelated by a causal pathway is as important as knowing they are related. Few examples that I struggled with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&apos;long grey hair&apos; would force the A.I. to generate an old person.&lt;/li&gt;
&lt;li&gt;&apos;bear with a phone fighting a human being&apos; would always give the phone to the human. I also tried blending images of a bear with a phone and a man, but the man always snatched the phone from the bear. borzhe moi&lt;/li&gt;
&lt;li&gt;&apos;man with tusks and green skin&apos;, and this is the one where I spent hours and had to admit defeat. Midge correlates tusks with horns and pointy ears, and she correlates green skin with orcs.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Second, there appears to be a Fourier issue. It seems to learn &apos;patterns&apos; which are co-incidental. For example, it may display any number of fingers on a human hand or strings on a musical instrument. If you give it a city skyline, certain features or sets of buildings are repeated. The machine has either retained lower dimensional information or is generating lower dimensional images for a faster and cheaper product. A popular thing on MJ is &apos;filigree&apos;, which is an intricate pattern for humans but would not be for a machine in Fourier space.&lt;/p&gt;
&lt;p&gt;Finally, as a product, MJ is nothing short of brilliant. You can provide image prompts, and it does a decent job of mixing those. You can also provide the same image prompts with minor modifications to increase their weightage in the overall narrative. In general, I spent time in their community rooms to learn from other folks, and if I had spent more time, I could learn more tricks. I will likely do so. But this is what I meant by endless potential diminishing with complexity. The effort for complex compositions scales up. So, although the possibilities are limitless, my time is not. There are also certain things, such as not generating legible text, which are more design choices than the capabilities of the A.I. What that means is you cannot ask for a t-shirt that says a customised slogan.&lt;/p&gt;
&lt;p&gt;Thank you for reading, let us look at the gallery now. For detailed prompts and descriptions, please visit the &lt;a href=&quot;https://www.midjourney.com/app/collections/Uwz1u6stRNSYYZeGeNBKxA/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;gallery on Midjourney&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.midjourney.com/db78a211-7ea5-49a8-9e58-bbc79efc9423/grid_0.png&quot; alt=&quot;kruppe&quot;&gt;&lt;br /&gt;
&lt;em&gt;Kruppe of Darujhistan&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.midjourney.com/de6dbf09-d93c-49cb-9b8b-b5ffd824f37b/grid_0.png&quot; alt=&quot;gothos&quot;&gt;&lt;br /&gt;
&lt;em&gt;Gothos, a Jaghut&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.midjourney.com/ff653f88-96ef-41cb-9cc0-8accd3406d6e/grid_0.png&quot; alt=&quot;anomander rake&quot;&gt;&lt;br /&gt;
&lt;em&gt;Anomander Rake, Son of Darkness, a Tiste Andii&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.midjourney.com/e3c8161f-1d29-406f-a540-5141b2e27161/grid_0.png&quot; alt=&quot;fiddler&quot;&gt;&lt;br /&gt;
&lt;em&gt;Fiddler, Bridgeburner&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://cdn.midjourney.com/eef584cd-8717-45f0-a49f-5e27d321957d/grid_0.png&quot; alt=&quot;samar dev&quot;&gt;&lt;br /&gt;
&lt;em&gt;Samar Dev, witch&lt;/em&gt;&lt;/p&gt;</content:encoded></item><item><title><![CDATA[2022 in Books]]></title><description><![CDATA[A continuation from 2021 in books. Best in Fiction Malazan Book of The Fallen series by Steven Erikson Not for beginners, but a mind…]]></description><link>https://kumar-ayush.com/blog/2022-in-books/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/2022-in-books/</guid><pubDate>Sun, 25 Dec 2022 00:20:37 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;A continuation from &lt;a href=&quot;/blog/2021-in-books/&quot;&gt;2021 in books&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;Best in Fiction&lt;/h3&gt;
&lt;h4&gt;&lt;a href=&quot;https://www.goodreads.com/series/43493-malazan-book-of-the-fallen&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Malazan Book of The Fallen series&lt;/a&gt;&lt;/h4&gt;
&lt;h5&gt;by Steven Erikson&lt;/h5&gt;
&lt;p&gt;Not for beginners, but a mind wrecking piece of literature in the fantasy genre. The philosophical prose is immaculate. You will not read these books, you will work on them. At times, you will have to slog through, but you know that it will be worth it, and you move each foot forward. Even if I tell you the core idea of the books, that would be a spoiler. You have to arrive at it on your own. Take it from me that a theme &lt;em&gt;exists&lt;/em&gt;.&lt;/p&gt;
&lt;h3&gt;Best in Memoir&lt;/h3&gt;
&lt;h4&gt;&lt;a href=&quot;https://www.goodreads.com/book/show/58630543-a-rude-life&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;A Rude Life&lt;/a&gt;&lt;/h4&gt;
&lt;h5&gt;by Vir Sanghvi&lt;/h5&gt;
&lt;p&gt;In general, I like prose written in a bold voice, with courage. Since he has been a journalist for a long time in India, it felt like watching a Forrest Gump of post-Independence India.
&lt;br /&gt;
&lt;strong&gt;Most memorable idea&lt;/strong&gt;: People can be quite different in person to as perceived on television.&lt;/p&gt;
&lt;h3&gt;Best in Textbook&lt;/h3&gt;
&lt;h4&gt;&lt;a href=&quot;https://www.goodreads.com/book/show/174276.Causality&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Causality: Models, Reasoning, and Inference&lt;/a&gt;&lt;/h4&gt;
&lt;h5&gt;by Judea Pearl&lt;/h5&gt;
&lt;p&gt;These are fundamental concepts for science.
&lt;br /&gt;
&lt;strong&gt;Most memorable idea&lt;/strong&gt;: If I gave you data on my lawn humidity and rain, will you tell me that watering my lawn causes it to rain?&lt;/p&gt;
&lt;h3&gt;Best in Philosophy&lt;/h3&gt;
&lt;h4&gt;&lt;a href=&quot;https://www.goodreads.com/book/show/499578.Did_the_Greeks_Believe_in_Their_Myths_&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Did the Greeks Believe in Their Myths?&lt;/a&gt;&lt;/h4&gt;
&lt;h5&gt;by Paul Veyne&lt;/h5&gt;
&lt;p&gt;Short answer is probably not. More thought will push you to define belief. Then you may question the ethical implications of our actions driven by our beliefs. Our beliefs did not stem from facts purely. What are facts, even? Are there more than one type of beliefs and do we consciously recognise them?&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Fin&lt;/em&gt;&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Tales of Hubris]]></title><description><![CDATA[These are a few tales of hubris and their amusing results from my time as an undergraduate student in Engineering Physics at IIT Bombay…]]></description><link>https://kumar-ayush.com/blog/tales-of-hubris/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/tales-of-hubris/</guid><pubDate>Thu, 01 Dec 2022 10:20:37 GMT</pubDate><content:encoded>&lt;p&gt;These are a few tales of hubris and their amusing results from my time as an undergraduate student in Engineering Physics at IIT Bombay.&lt;/p&gt;
&lt;h3&gt;Read the fine? print&lt;/h3&gt;
&lt;p&gt;This is a tale about CS 101, a first-semester course. They were teaching us C++ and the fundamentals of software engineering. It was a good course, but if you knew a thing or two about computer programming, it was a boring course. Our professors were Padma Shri Prof. Deepak Phatak and Prof. Supratik Chakraborty. Prof. Phatak cared more about using Aakash tablets for the course. These claim, or claimed, to be India&apos;s cheapest tablet, and he had worked with them. He has dedicated a good amount of his life to working towards education accessibility via technology. And that was him. Prof. Supratik was the agent responsible for giving the lectures, assignments and such.&lt;/p&gt;
&lt;p&gt;Now, however mundane the core content of the course might&apos;ve been, a meaty 30% of the final grade had to come from a project. As you will realise through the length of this blog, I love projects. Unlike assignments and exams, projects are pragmatic representations of your knowledge. Throughout my time at IITB, I have always given my best to all course projects. Typically, folks dedicate themselves to their semester research projects and look at course projects as another check box for the course. That&apos;s not silly. After all, course projects are always far less attractive than researching at the boundary of human knowledge. But it&apos;s...boring. Start with a strict policy to have fun, and you&apos;ll find something creative to do even in &apos;em course projects.&lt;/p&gt;
&lt;p&gt;Okay, so what did we do for the project? No more swiping your ID cards like sweatshop workers! We simply re-implemented some popular facial recognition algorithms and wrapped them into a program that could be used for measuring attendance in a class.&lt;/p&gt;
&lt;p&gt;The legendary part of the story has nothing to do with the project itself but with how it was graded, so let&apos;s get on with that. At IIT Bombay, you can score an AP, which denotes the highest distinction. This counts the same as getting the highest grade (AA) towards your GPA, but it&apos;s like a star on your palm that teachers draw in primary school. You can show it around to your mother and glee in glory. The specific scenario that can earn you this grade depends on the course and the professor taking the course. For this one, they came up with the idea that excluding the project and the end-semester examination, all students in the top bucket get to participate in a 3-hour or so coding competition. If you win, you get an AP.&lt;/p&gt;
&lt;p&gt;I got to be part of the competition. I remember the problem statement to this date because it was effectively three independent ideas to implement in one:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You needed to implement a big number class representing a number in an arbitrary base.&lt;/li&gt;
&lt;li&gt;The class needed to have the capability to represent arbitrarily large numbers.&lt;/li&gt;
&lt;li&gt;You had to have a parser to define the base, sum two numbers etc.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I did the parser and the arbitrary base part correctly, but there were bugs in my representation for arbitrarily large numbers. That was stressful, but it was fun. I wasn&apos;t sad about the AP, nor am I now, for the record.&lt;/p&gt;
&lt;p&gt;A couple weeks later, our project presentations were done, and our end-semester examinations were done. And I was declared one of the four &quot;winners&quot; of the AP contest, but I did not get an AP.&lt;/p&gt;
&lt;p&gt;A complex set of rules and events led to this. First of all, there was a catch in terms of the AP contest. Only if you were eligible for an AA at the end of the course would you get promoted to an AP. I got an AB after adding up the project and end-semester scores. I may have missed one mark on the end-semester, and we scored 29 out of 30 on the project. How is it possible that I slip into an AB? Well, I had not done as neatly earlier in the course, and I was not that far away from the boundary between AB and AA. But I should have still made it. This was not obvious to me.&lt;/p&gt;
&lt;p&gt;A day or so later, our entire mark sheets arrived. We had gotten a 27 on the project, and not 29. The two marks made all the difference for me. How did that happen? Well, there happen to be more &apos;fun&apos; rules in this course. For our course presentation, we were asked to rate ourselves on our hard work and integrity. My three teammates and I decided to eliminate hubris and arrogance and grade ourselves 9 out of 10. How noble of us! The presentation was strange. The panel tried to convince us that at least one of us must have slacked and deserved much lower than 9, but we did not budge. They let us go with a 29. So that&apos;s 20 on 20 for the project plus our holy nine. Later, I found out that some teams did rat out a teammate. I snort at the snitches.&lt;/p&gt;
&lt;p&gt;Jokes apart, avoiding hubris can sometimes end up in irony and ignorance of a fool. Nobody in our team had read the rules correctly. Our score did not amount to 20+9. It amounted to 30 * 9. And that&apos;s the end of our tale. To this date, I am mildly annoyed at the myriad procedures followed in this course. But boy, wasn&apos;t that a crazy story! And let me give you some spoilers, my friends; this was the only time I came close to getting an AP throughout my undergraduate education.&lt;/p&gt;
&lt;h3&gt;Why aren&apos;t we playing Minecraft?&lt;/h3&gt;
&lt;p&gt;This is as easy a course as it comes. The thing with ordinary differential equations is that there aren&apos;t many of them. And this is a half-semester introductory course. They ask you to solve a few of them and talk about the properties of the solutions in various domains. This story is not as complex as the previous one, but an amusing break before we go into the next one. I simply got the date for this exam wrong, and a classmate told me about it half an hour before the exam. She simply sought to wake me up because I had fallen asleep while watching TV in the common room.&lt;/p&gt;
&lt;p&gt;The funny thing is I invited my friends to play Minecraft a few hours ago, and everyone said they had to study. I felt smug at that. After all, you only needed a few hours to study for this. What were these chumps doing studying a day in advance? Well, well, well, hubris strikes again. Thankfully, as I had described, it was not a particularly challenging, so I did land the top grade, but I&apos;ll always be arrogant that I did it with style.&lt;/p&gt;
&lt;h3&gt;The greatest invention in modern mathematics&lt;/h3&gt;
&lt;p&gt;This was my first elective. This was a mandatory course for electrical engineering students, but two of my friends thought this would be fun, and I could not decide on an elective. Hence, I just followed them like a good sheep. I regret that. This was taken by Prof. Preeti Rao. I do not know much about her, but as far as her lectures for this course were concerned, they were a dictation of the textbook. This was a drag. I stopped going to the lectures after a week.&lt;/p&gt;
&lt;p&gt;My bunking led to two things. First, I passed with a CD equivalent to a 5 on 10. Anything below 4 is a fail, so that wasn&apos;t far. Second, towards the end of the course, a few students and I were summoned by her to explain our low attendance. She had every right to disqualify us from the course at that point. Folks had their reasons. Most of them had been sick throughout the semester and, unfortunately, had not gone to the hospital to have appropriate medical slips to show for it. When it came to me, I was bold enough to mention that since this course is an elective for me, I just study for it on my own and come for the exams. The poor soul of a professor took a moment and a clarification to realise that taking this course as an elective is possible. But after we were rid of the denial, she indicated that if this course is truly an elective for me, then I need not show up for the end-semester exam either, and we can all be happier. That was an unfavourable outcome for me. Perhaps I should&apos;ve been sick too. Anyway, I went back and wrote her an apology email, which she never explicitly accepted, but I showed up for the exam, and no one cared about it, so I&apos;ll say that&apos;s really kind of her to accept my apology.&lt;/p&gt;
&lt;p&gt;The hubris here is that I am quite glad I even passed the course because I know nothing about signals and systems. The only thing I did in all the examinations was calculated a Fourier transform where required. There were a few questions where you had to do Laplace transform. I did a Fourier there as well because there are situations where they&apos;re the same, and I squeezed some non-zero marks out of that. And well, I knew how to do Fourier transforms since school, but it also helped that there were two other courses in the same semester where they taught us that. So, I had good practice as well.&lt;/p&gt;
&lt;h3&gt;I know a thing or two about spherical geometry, and I get high on gambling&lt;/h3&gt;
&lt;p&gt;Nobody understood why this was a required course for an Engineering Physics curriculum. And everyone knew that the professor, whose name I do not remember and do not want to find out, had a thing against us. We would take this course jointly with the energy department, and I think his dislike for us was born out of the same reason as ours for him. He did not truly understand why we were in the class. And our disinterest led to frustration. If I break it down like this, I am sympathetic towards him.&lt;/p&gt;
&lt;p&gt;Well, what came next might snatch the sympathy away. When the time came to deliver our mid-semester exam results, the professor announced a bet in the class. You got a chance to guess how much you scored out of 30, and if you are correct within 3 points of your actual score, you get bonus points depending on how far you are. For example, if you scored 28 and guessed 27, your score is now 30. If you had guessed 26, then your score would be 29. But if you had guessed 24, then your score would now become 27. Sounds fun, right? The only problem is that this is a classroom for a renewable energy technology course and not a course on probability and statistics with a specialisation in gambling. Regardless, he gave everyone a choice to opt out, so it&apos;s no harm except a colossal waste of time. I shouldn&apos;t say that. I have a fond memory of the whole experience, after all.&lt;/p&gt;
&lt;p&gt;Most of the curriculum for the first half of the semester involved spherical geometry. This is concerning solar and wind power. And I happen to have a background in astronomy. Also, we had the answer key, which he used for grading. This would be a pretty informed bet assuming he has not messed up the grading. I went for 30. By his rules, I am now entitled to 33 on 30. A friend who also eventually scored 30 went for 27. That&apos;s what you call a sucker. Friends, I got out that day with 33 on 30. And this guy did not honour this agreement at the end of the semester, but I did not forget to bring it up to him, and he added a 3 to my final score indeed. Look, go big or go home.&lt;/p&gt;
&lt;h3&gt;Moral of the story&lt;/h3&gt;
&lt;p&gt;What can I say? I learn from my mistakes, but some can be like a hangover. You tell yourself in the morning that you&apos;re not going to end up in this situation again, but deep down, you enjoyed the ride, and what you like to call bad decisions are just patterns you will repeat.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Cities, Gardens and Software Systems]]></title><description><![CDATA[What do cities, gardens and software systems have in common? I love cities. They have the best food, the best services and the best…]]></description><link>https://kumar-ayush.com/blog/cities-gardens-software/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/cities-gardens-software/</guid><pubDate>Fri, 06 May 2022 00:20:37 GMT</pubDate><content:encoded>&lt;p&gt;What do cities, gardens and software systems have in common?&lt;/p&gt;
&lt;p&gt;I love cities. They have the best food, the best services and the best entertainment options. All of this is true trivially due to more competition. And of course, the primary reason cities exist, and all the competition is enabled-there are more jobs in the city. On the flip side, cities are exhausting. There are slums, and there are skyscrapers. There&apos;s traffic. And there&apos;s trash at every corner. It feels like a person, alive with a beautiful soul but not free of scars.&lt;/p&gt;
&lt;p&gt;I do not have anything similarly poetic about software systems or gardens. I work with software, and I enjoy gardens. I do not do any gardening myself, although I see that I would inherit that from my father as I grow older.
Last year, I read something about gardens and something about cities that influenced my approach toward software systems. Let&apos;s review them in order.&lt;/p&gt;
&lt;h3&gt;On Cities&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://www.bloomberg.com/news/features/2021-09-01/how-diapers-com-founder-marc-lore-plans-to-build-utopian-city-telosa&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;This is a Bloomberg story&lt;/a&gt; about an American billionaire, Marc Lore, who wants to build a new city, a utopian megapolis, as the title teases. They describe how he amassed his wealth, his ideas on the path forward, and the key talent involved in making this possible. All this is fine, but what caught my attention is Lore&apos;s own remarks on the challenges of his vision.&lt;/p&gt;
&lt;blockquote&gt;
Still, as Lore talked out the details of Telosa, he kept running up against the tensions in his vision. He told Ingels&apos;s staff that he wants its initial residents to be socioeconomically and racially diverse, but he also knows that you can&apos;t just hire the population of a city the way you staff your startup. &quot;It&apos;s not a controlled city, it&apos;s not a private city,&quot; he said in the larger meeting before musing that there must be some trick of planning to get what he&apos;s after. If there is some diversity-enhancing secret, the crowd in the room—overwhelmingly White and predominantly male—hadn&apos;t heard of it.
&lt;/blockquote&gt;
&lt;p&gt;If you go through the article, the fact that you cannot hire a city&apos;s population seems to be the problem with the entire idea and not just the demographic diversity part of it.&lt;/p&gt;
&lt;blockquote&gt;
One way to attract people, he suggested in the meeting, would be to start a venture capital firm and only invest in companies willing to move to the city. He also described a move-in day—maybe more like a move-in month?—where all 50,000 initial residents would show up at once and go through an orientation, the sort of bonding experience that&apos;s proved effective with first-year college students.
&lt;/blockquote&gt;
&lt;p&gt;This is ridiculous. You cannot expect folks to move to your city because they share your vision. You have a chicken-and-egg problem or a network externality. People move to cities because there are more jobs. More jobs require infrastructure, capital and services - which come from more people. In a way, a city is an investment by the citizens. Is the answer then to provide good institutions and investments? Well, as more people come to the city, they would require a change in the institutions. They would want to modify the tax structure and the public infrastructure to their current needs. Good Luck finding an unlimited supply of people who agree entirely with what you think your city should be, Mr Billionaire. It sounds frustrating, but one can only guide and not authoritatively control the path a city will take. A city is a complex system which grows and cannot be built.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.bloomberg.com/news/articles/2022-04-08/why-don-t-we-just-build-new-cities&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;A more recent interview&lt;/a&gt; with a former city planner nails this.&lt;/p&gt;
&lt;blockquote&gt;
Let&apos;s say I want to build a new city, for better or worse. How should I plan it out?
&lt;p&gt;The first thing you need to do is clearly demarcate the public and private realms. Think New York City&apos;s street grid or Ildefons Cerdà&apos;s plan for Barcelona. Where are the streets going to go, and what are they going to look like? Same for public spaces: Identify and preserve amenities like waterfronts or small hills, which will be your parks. These are design problems that need to be done all at once and in a top-down way before a healthy city can start to grow.&lt;/p&gt;
&lt;p&gt;Second, you need to set up some way to finance infrastructure. Who should pay for it, and when should it be built? If you set it up correctly, new development should incrementally pay for itself. This ensures that the supply of developable land can follow demand. Texas&apos; Municipal Utility Districts seem to work well in this regard.&lt;/p&gt;
&lt;p&gt;Beyond these two considerations, don&apos;t overthink it. The key is to lay the groundwork for a land market that will reveal the right way to allocate land uses and densities. This is partly what went wrong with Brasília — planners thought they could plan out every little detail about the city, right down to how many shops each neighborhood should have, and the results have been less than ideal.&lt;/p&gt;
&lt;p&gt;Compare Brasília to Hong Kong, arguably one of the most successful new cities in modern history. Instead of micromanaging everything, the government focused on stewarding the public realm and providing quality public services. Otherwise, they mostly let markets design the built form of the city in a spontaneous and evolutionary way.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;On Gardens&lt;/h3&gt;
&lt;p&gt;One of my top reads from last year was a &lt;a href=&quot;https://www.goodreads.com/book/show/53176781-seed-to-dust&quot;&gt;gardener&apos;s memoir&lt;/a&gt;. I have listed this book among my favourites in an &lt;a href=&quot;/blog/2021-in-books/&quot;&gt;earlier blog post&lt;/a&gt;. It is pretty amusing that the author Marc Hamer shares his first name with our billionaire in the previous section.&lt;/p&gt;
&lt;p&gt;At one point, the author recalls when he refused to spray chemicals in the garden in protest of the landlady&apos;s request. From Page 113,&lt;/p&gt;
&lt;blockquote&gt;
There are chemicals available to spray lawns with, so that it doesn&apos;t grow so quickly; others to kill the worms and beetles so there are no worm casts, no moles feeding on them. There is a company that will come and spray your lawn with a pigment to make it look green in the summer when everybody else&apos;s goes brown; others that will dig it all up and replace it with plastic grass, which never changes colour and smells of vinyl in the hot sun, and will stay looking the same shiny plastic green for all of eternity. The glossy full-colour leaflets for these poisons arrive, uninvited, through my letter box every spring. These are for the people who are not gardeners, people who want to control nature. To speak of controlling nature is like the waves wanting to control the sea, the song singing the thrush, the flower creating the earth. We are not the sea, we are not the thrush, we are not the earth. We are the wave, the song, the flower. There are about a hundred different grass species that are seeded in British lawns, and nearly 12,000 species of grass in the world. Few people care, as long as it is green.
&lt;/blockquote&gt;
&lt;p&gt;Marc Hamer&apos;s passion for gardening is infectious, and it inspires a philosophical approach. A good gardener guides and does not seek absolute control.&lt;/p&gt;
&lt;h3&gt;On Software Systems&lt;/h3&gt;
&lt;p&gt;How are software systems different? They gather users as a city gathers its dwellers. As a city will grow in the direction its dwellers intend to, developers will add features to a software system. Suppose the original author of the system cares to protest. In that case, others will fork the system or just move to another more welcoming one. This is precisely what I expect to happen to Marc Lore&apos;s city if he remains adamant about his design.&lt;/p&gt;
&lt;p&gt;Like a garden, a software system has weeds and bugs. It has branches that need disentangling and pruning. A good maintainer, like a good gardener, cares. When certain routines become cumbersome, they would care to refactor. If you do not care, you could simply rewrite the routine. That would be analogous to uprooting a patch of land in your garden and replanting fresh saplings. Sure, that will work, but it is costly to keep doing that. Careful maintenance amortises your costs and is a mark of professionalism.&lt;/p&gt;
&lt;p&gt;I have found myself a gardener who cares but is an authoritative planner. I would spend an unreasonable amount of time pushing people to develop software my way. That inhibits growth. You have to yield control and embrace the natural path of a complex system. I have learnt that it is foolish to build a software system. Just like cities and gardens, these are grown. You can at most expect to be a guide.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Apes and important emails]]></title><description><![CDATA[Have you read the children's story about a cap seller's encounter with a troop of monkeys? It is pretty straightforward for an adult: A cap…]]></description><link>https://kumar-ayush.com/blog/apes-and-emails/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/apes-and-emails/</guid><pubDate>Sat, 23 Apr 2022 10:20:37 GMT</pubDate><content:encoded>&lt;p&gt;Have you read the children&apos;s story about a cap seller&apos;s encounter with a troop of monkeys? It is pretty straightforward for an adult: A cap-seller falls asleep under a tree in a forest. She is wearing a cap. A group of monkeys descend upon her and grab a cap from her merchandise. When she wakes up and realises what has transpired, she takes off her hat and throws it on the ground. Looking at her, all the monkeys do the same. She collects them all and moves on. Monkeys imitate; that&apos;s the lesson. Even if you knew this, I highly recommend you try this hilarious &lt;a href=&quot;https://www.youtube.com/watch?v=ykFLZywRxeM&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;YouTube video&lt;/a&gt; illustrating this.&lt;/p&gt;
&lt;p&gt;I am bemused that I have recently realised this: aren&apos;t humans the same? This should not be surprising because monkeys and apes are our genetic ancestors. And in this blog post by the end of it, I will describe why this makes it difficult to ascertain the importance of an email from its subject.&lt;/p&gt;
&lt;p&gt;Why do we imitate or mimic others? Human beings are capable of causal reasoning. We have acquired and practised this skill from the moment we were born.
&lt;em&gt;Why am I feeling this burning sensation in my tummy? Oh, is it because I need to eat? Well, how do I obtain food? As it turns out, if I say &quot;mum&quot; and point to my mouth, I am given food. If I do not like the food, I need to cry and then the food changes.&lt;/em&gt;
We are so good at it that we cannot stop doing it. Plenty of social phenomena can be pinned on the results of attempting to answer &quot;Why?&quot; questions.
&lt;em&gt;Why did I fail my exams? Because my stars are not aligned. We are capable of hypothesising and rejecting counterfactual claims. Had I studied better, would I still fail my exams? Of course, because my stars are not aligned. It is a much more generalised theory that explains all my bad luck. I fell in the puddle too this morning. Indeed, that is not related to my lack of studying for exams.&lt;/em&gt;
There are pitfalls in our search for truth, but the point remains. We are very, very good at causal reasoning. The progress of science and the scientific method aims to protect us from such pitfalls. Still, the ability to reason seems to be built into the hardware.&lt;/p&gt;
&lt;p&gt;Another thing we learn as a direct result of this ability is to lie.
&lt;em&gt;Momma will let me have another if I tell her that I&apos;ve not had a single candy since morning. It does not matter if I&apos;ve had more than one already.&lt;/em&gt; The cause for the effect &quot;get candy&quot; is others believing that I have not had any candy. We know that all of our causal behaviour is influenced by knowledge, and knowledge can be manipulated via speech.&lt;/p&gt;
&lt;p&gt;If it is more likely for you to look at my email if I prefix the subject with an &quot;[IMPORTANT]&quot; or &quot;[URGENT]&quot;, why would I not do it again? The importance of an email is determined by the receiver. Still, the information content of the email is set by the sender, who would always be able to manipulate the causal inference of the receiver. Any measure of differentiation in communication systems dilutes itself.
&lt;em&gt;Hi, I called to check if you received the email I sent 10 minutes ago. I marked it as Urgent but thought it&apos;s good to make sure you&apos;re looking at it urgently. We have created this &lt;a href=&quot;https://support.microsoft.com/en-us/office/mark-a-message-as-important-or-urgent-in-teams-ea99d5b6-1317-4550-8d75-86ff14cd4462&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;notification system&lt;/a&gt; where the sender can mark messages as MOST IMPORTANT. That will send you a notification every 10 minutes with a loud ping. Clearly, the ability to ping and arrest attention in a messaging app compared to the email was insufficient.&lt;/em&gt;
All of us have seen this phenomenon unfold. Please write to me about the most atrocious cases.&lt;/p&gt;
&lt;p&gt;Differentiation dilutes because we mimic because we reason causally.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Quarter-life Crisis]]></title><description><![CDATA[I turned 25 this week. That means I have completed a quarter of my life, assuming I live for 100 years. Perhaps a more realistic measure of…]]></description><link>https://kumar-ayush.com/blog/quarter-life-crisis/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/quarter-life-crisis/</guid><pubDate>Sat, 12 Feb 2022 10:20:37 GMT</pubDate><content:encoded>&lt;p&gt;I turned 25 this week. That means I have completed a quarter of my life, assuming I live for 100 years. Perhaps a more realistic measure of quarter-life is at 20 years old. Regardless, this is a checkpoint in life. And it feels like a good idea to document my thoughts on my life plan right now. 100 is a better number than 80 in the metric system, and 25 is 100 divided by four.&lt;/p&gt;
&lt;p&gt;When I was in school, I believed there were only two actual obstacles to achieving anything - time and will. I still believe that, but my materialisation of those words is quite different.&lt;/p&gt;
&lt;p&gt;At a younger age, I associated time with age and maturity. &quot;I am simply not old and mature enough to understand this. I will be fine once I grow up.&quot;, I would think. As I grew up and learned new concepts about our world, I discovered many more that I had no grasp of. And the harder I tried to get a grip on as much knowledge as I could, I would find even more areas that were previously unknown unknowns to me. Nature was not done with me. The foundations of what I knew or thought I knew also showed cracks. Perhaps, I could solve this given enough time. But I will never have enough time. Simply put, the finiteness of my time on Earth has only slowly dawned on me. Younger me was foolish in assessing time as an obstacle. You can jump over an obstacle. You can conquer it. Time, on the other hand, does not yield itself. A child might wonder if pulling at a plant would make it grow faster.&lt;sup id=&quot;fnref-1&quot;&gt;&lt;a href=&quot;#fn-1&quot; class=&quot;footnote-ref&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;But after a quarter of life, I understand that innovation, and knowledge, is incremental, and there is a natural timescale for everything. Time is a partner in our journey and not a hurdle. In this garden that is the world, there are trees I would not see bear fruits. Regardless, it is my duty to water them and see them grow at their pace. Indeed, I am still as confused about the world as 10 years ago, perhaps even more so. But I relish that I am confused on a higher plane.&lt;sup id=&quot;fnref-2&quot;&gt;&lt;a href=&quot;#fn-2&quot; class=&quot;footnote-ref&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Will or willpower is the second ingredient to success, or so I think. &quot;You must never give up. Keep going, keep cracking on, and you will get what you want&quot;, I would tell myself. This was too simplistic. After a quarter of life, I am careful to split will into synonyms such as tenacity, stubbornness, doggedness and resolve. Stubbornness is almost always bad. Resolve is almost always good. Tenacity and doggedness are helpful when applied carefully with assistance from other character traits. Once, in my early teenage years, I got bent on demonstrating that traffic noise can be utilised to generate electricity. Against my mother&apos;s wishes, I would not eat until I would solve the engineering problems. From my perspective then, the science was absolutely sound, and it was only a matter of time and keeping my will strong before I cracked the code. I can tell you now that the theory is indeed sound if you work out the numbers. Still, such a device&apos;s practical feasibility is ridiculous. I would be praised for my tenacity in several situations like this, but that is just for the books. In practice, I have learned to take assistance from economic concepts of cost-benefit trade-offs, opportunity costs and risk-reward payoffs.&lt;/p&gt;
&lt;p&gt;What lies ahead then? As confused about the world as I may be, it is now my job (literally) to find solutions to problems that are understood by a decreasing set of people. Nothing is happening to the people, but the problems are on a, umm, higher plane. This is delightful in a way, as to be in this situation is a luxury. I am part of a relatively elite class of people. This is where the imposter syndrome kicks in hard. I don&apos;t understand everything about the problems that are considered solved. Those should be the easy problems. How can I be trusted to make progress on the hard ones? What is the reason behind my slow progress? It could be that these problems are inherently complex. As we have learnt, innovation is incremental and requires tenacity. But there is no way to rule out the possibility that perhaps I fundamentally lack the capacity and skills to breakthrough. This doubt is my quarter-life crisis.&lt;/p&gt;
&lt;p&gt;I do not know the answer, but I am determined to keep myself happily entertained. I have devised a plan to deal with this situation. I have two options. Either I accept my inability and give up, or I demonstrate resolve. If I put it like that, this sounds like a dichotomy, but it may not be one. I can accept my inability to crack the universe&apos;s secrets alone and start embracing what I can achieve with help and cooperation. The scientific minds are, after all, an interdependent ecosystem. Essential keywords that would drive the efficacy of the cooperation are communication and empathy. I am not saying that I have just discovered the importance of these ideas. I&apos;ve known that for as long as I remember. But I have recently concluded that these ideas might be the central aspect of my journey in the next quarter. We&apos;ll find out how that goes.&lt;/p&gt;
&lt;div class=&quot;footnotes&quot;&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id=&quot;fn-1&quot;&gt;&lt;a href=&quot;https://www.nytimes.com/1992/11/13/opinion/IHT-planting-watering-and-waiting.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Quote by Václav Havel, first president of Czech Republic&lt;/a&gt;&lt;a href=&quot;#fnref-1&quot; class=&quot;footnote-backref&quot;&gt;↩&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;fn-2&quot;&gt;&lt;a href=&quot;https://quoteinvestigator.com/2010/07/11/confused/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Famous quote with unclear origins&lt;/a&gt;&lt;a href=&quot;#fnref-2&quot; class=&quot;footnote-backref&quot;&gt;↩&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content:encoded></item><item><title><![CDATA[Merkel = Luo Ji?]]></title><description><![CDATA[As of writing, Russian troops are positioned at Ukraine's borders. Vladimir Putin, current president of Russia, claims he has no intentions…]]></description><link>https://kumar-ayush.com/blog/merkel-luo-ji/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/merkel-luo-ji/</guid><pubDate>Fri, 04 Feb 2022 12:20:37 GMT</pubDate><content:encoded>&lt;p&gt;As of writing, Russian troops are positioned at Ukraine&apos;s borders. Vladimir Putin, current president of Russia, claims he has no intentions to invade Ukraine. The West disagrees. Ukraine&apos;s president Volodymyr Zelensky has accused the West of alarmism. Putin, however, has threatened &quot;appropriate retaliatory military-technical measures&quot;. As retaliations are in response to an action, in this case, that action is discussions for Ukraine to become part of the NATO alliance.&lt;sup id=&quot;fnref-1&quot;&gt;&lt;a href=&quot;#fn-1&quot; class=&quot;footnote-ref&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;From the Russian perspective, their neighbours are expanding their borders, and they find it appropriate to resist. Russia wants secure access to trade ports in the Black Sea.&lt;sup id=&quot;fnref-2&quot;&gt;&lt;a href=&quot;#fn-2&quot; class=&quot;footnote-ref&quot;&gt;2&lt;/a&gt;&lt;/sup&gt; Of course, Ukraine joining NATO does not impede their access, but NATO is a political and military alliance with a collective defence clause. A future conflict with any NATO country would be stifling.&lt;sup id=&quot;fnref-3&quot;&gt;&lt;a href=&quot;#fn-3&quot; class=&quot;footnote-ref&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;From the West and NATO&apos;s perspective, they encourage democratic values. If Ukraine and its people want to be part of NATO, Russia has no right to interfere.&lt;/p&gt;
&lt;p&gt;So, what sparked this conflict now? One might wonder, Ukraine first expressed interest to join NATO in 2008. In 2010, Viktor Yanukovych was elected the president of Ukraine, and he chose to shelve this plan.&lt;sup id=&quot;fnref-4&quot;&gt;&lt;a href=&quot;#fn-4&quot; class=&quot;footnote-ref&quot;&gt;4&lt;/a&gt;&lt;/sup&gt; This was followed by a series of events culminating in pro-EU protests in Ukraine, and then Russia annexed Crimea in 2014. Crimea has oil and gas reserves and Sevastopol, a warm water port city on the Black Sea. If you remember, the primary motivation of Russians here is to enjoy a beach in winter.&lt;sup id=&quot;fnref-5&quot;&gt;&lt;a href=&quot;#fn-5&quot; class=&quot;footnote-ref&quot;&gt;5&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;In 2015, with an active effort from France and Germany, we arrived at the Minsk agreements that implemented a ceasefire in Crimea. These accords would avoid bloodshed, but Crimea would remain part of Russia. A superstar of this negotiation was Angela Merkel, the then Chancellor of Germany. She was the only leader Putin respected. I&apos;ve attached a famous tweet signifying her involvement in these discussions.&lt;/p&gt;
&lt;blockquote class=&quot;twitter-tweet left&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;Wow. Chancellor Merkel is indefatigable. Week&amp;#39;s travel looks like fictional airline route map from inflight mag. &lt;a href=&quot;https://twitter.com/dpa?ref_src=twsrc%5Etfw&quot;&gt;@dpa&lt;/a&gt; &lt;a href=&quot;http://t.co/O0zYudnMFJ&quot;&gt;pic.twitter.com/O0zYudnMFJ&lt;/a&gt;&amp;mdash; Dan Baer (@danbbaer) &lt;a href=&quot;https://twitter.com/danbbaer/status/565257318015959040?ref_src=twsrc%5Etfw&quot;&gt;February 10, 2015&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;script async src=&quot;https://platform.twitter.com/widgets.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
&lt;p&gt;Back in 2022, Angela Merkel has retired. From Merkel&apos;s party CDU, Olaf Scholz is the current Chancellor of Germany. And the world is disappointed with Merkel. Under her leadership, Germany has become dependent on Russia&apos;s Nord Stream natural gas pipeline. If that were not the case, perhaps Germany could have taken a hard line towards Russia. Instead, they remain pacifists, preferring to resolve conflicts with dialogue rather than sending weapons. But this is not wholly attributed to the Nord Stream pipeline. With a few exceptions, not sending arms to a conflict zone has long been part of German policy.&lt;sup id=&quot;fnref-6&quot;&gt;&lt;a href=&quot;#fn-6&quot; class=&quot;footnote-ref&quot;&gt;6&lt;/a&gt;&lt;/sup&gt; But perhaps, Ukraine right now cannot be another exception because of German dependence on Russian energy.&lt;/p&gt;
&lt;p&gt;I beg to differ. I instead believe this to be a masterstroke by Merkel. The Nord Stream pipeline is an instrument of mutual deterrence. As much as Germans depend on Russian natural gas, the Russian economy depends on income from these exports. I have found it challenging to find data on the share of Europe&apos;s natural gas purchases in Russian GDP. However, there are indirect indicators that it is indeed the case that Russia would not invade Ukraine because it cannot afford to lose Europe as a customer of its natural gas. The chief indicator is news of Putin cosying up with the Chinese premier Xi Jinping at the Winter Olympics being held in China as of writing. Well, Russia wants to increase energy exports to China. It is a good thing to diversify your clientele. There are details to this. Russia would supply China with its eastern supplies, which indicates that China cannot replace Germany. However, it can be an excellent economic buffer if things go south for Russia versus the West.&lt;sup id=&quot;fnref-7&quot;&gt;&lt;a href=&quot;#fn-7&quot; class=&quot;footnote-ref&quot;&gt;7&lt;/a&gt;&lt;/sup&gt;
For now, the Ukrainian conflict is a game of chicken. Economic developments over the next decade are more attention-worthy as Putin would try to break out of deterrence tactics. There is no longer a leader among us who can hold his gaze. Sholz may share an ideology with Merkel but does not have her spine. Our Wallfacer has retired, and we are doomed.&lt;/p&gt;
&lt;h3&gt;References&lt;/h3&gt;
&lt;div class=&quot;footnotes&quot;&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id=&quot;fn-1&quot;&gt;&lt;a href=&quot;https://www.bbc.com/news/world-europe-56720589&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Is Russia preparing to invade Ukraine and what does Putin want?&lt;/a&gt;&lt;a href=&quot;#fnref-1&quot; class=&quot;footnote-backref&quot;&gt;↩&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;fn-2&quot;&gt;&lt;a href=&quot;https://indianexpress.com/article/research/why-ukraine-matters-to-russia-7736322/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Why Ukraine matters to Russia&lt;/a&gt;&lt;a href=&quot;#fnref-2&quot; class=&quot;footnote-backref&quot;&gt;↩&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;fn-3&quot;&gt;&lt;a href=&quot;https://www.nato.int/nato-welcome/index.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;What is NATO?&lt;/a&gt;&lt;a href=&quot;#fnref-3&quot; class=&quot;footnote-backref&quot;&gt;↩&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;fn-4&quot;&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Ukraine%E2%80%93NATO_relations&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Ukraine-NATO Relations&lt;/a&gt;&lt;a href=&quot;#fnref-4&quot; class=&quot;footnote-backref&quot;&gt;↩&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;fn-5&quot;&gt;&lt;a href=&quot;https://www.europarl.europa.eu/RegData/etudes/ATAG/2020/646203/EPRS_ATA(2020)646203_EN.pdf&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Ukraine - The Minsk agreement five years on&lt;/a&gt;&lt;a href=&quot;#fnref-5&quot; class=&quot;footnote-backref&quot;&gt;↩&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;fn-6&quot;&gt;&lt;a href=&quot;https://www.bbc.com/news/world-europe-60155002&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Why Germany isn&apos;t sending weapons to Ukraine&lt;/a&gt;&lt;a href=&quot;#fnref-6&quot; class=&quot;footnote-backref&quot;&gt;↩&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;fn-7&quot;&gt;&lt;a href=&quot;https://www.aljazeera.com/news/2022/2/4/chinas-xi-to-meet-russias-putin-ahead-of-olympics-opening-rites&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Xi and Putin show united front amid spiraling tensions with West&lt;/a&gt;&lt;a href=&quot;#fnref-7&quot; class=&quot;footnote-backref&quot;&gt;↩&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content:encoded></item><item><title><![CDATA[2021 in Books]]></title><description><![CDATA[We will talk about my journey for a couple of paragraphs before moving on to the book recommendations. In 2020, I decided that a missing…]]></description><link>https://kumar-ayush.com/blog/2021-in-books/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/2021-in-books/</guid><pubDate>Sat, 25 Dec 2021 00:20:37 GMT</pubDate><content:encoded>&lt;p&gt;We will talk about my journey for a couple of paragraphs before moving on to the book recommendations. In 2020, I decided that a missing piece of my personality is my absolute lack of skill in sports. I was terrible at cricket with the gully kids, bad at football in school and college, pathetic at chess with friends at work and laughable at competitive esports games like League of Legends. Honestly, I am bad at all of them. But I decided to fix this once and for all. I spent all of 2020 trying to improve my LoL skills. That was a disaster. I simply lacked both mechanical and strategical skills required in the game.&lt;/p&gt;
&lt;p&gt;I had found myself committing a standard error. I am intelligent, so the strategy should obviously come to me, right? Right? Moreover, I usually played post work. I was already tired through my workday and could not focus. Late in 2020 and early 2021, I decided that my plan was bull***t and if there is one thing that the game has taught me is to develop your strengths and gain a competitive advantage via those strengths. Trying to compensate for your weaknesses is not a good idea. A league podcast had an expert in hunting rookies mention that they would rather pick a player who rates 9+ out of 10 on one criterion and 7 on everything else than a player who rates 8 across the board.&lt;/p&gt;
&lt;p&gt;So, well, this led me to stop playing league. Then I had lots of free time to learn new things related to my skills in software development, applied mathematics and finance. I noticed that the fastest mode of knowledge consumption was reading books over audio-visual content. And hence, I read 60 books this year across genres. That beats my personal record of 23 a couple years ago by some margin. I plan to raise this to 100 next year. Let&apos;s see how that goes. Meanwhile, enjoy my assortment of recommendations from my readings in 2021. :)&lt;/p&gt;
&lt;h3&gt;Best in Fiction&lt;/h3&gt;
&lt;h4&gt;&lt;a href=&quot;https://www.goodreads.com/series/49075-the-stormlight-archive&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;The Stormlight Archive series&lt;/a&gt;&lt;/h4&gt;
&lt;h5&gt;by Brandon Sanderson&lt;/h5&gt;
&lt;p&gt;Shout out to all Brandon Sanderson fans out there! &lt;a href=&quot;https://www.youtube.com/watch?v=QYUGqr29Hgg&quot;&gt;This video&lt;/a&gt; and &lt;a href=&quot;https://www.youtube.com/watch?v=G5fTCE-yZdw&quot;&gt;this video&lt;/a&gt; very briefly do more to recommend you this series than I can do. For me, the best part about these books is the well-defined plot outlines. There is a setup, a climax, and a resolution. The books may seem long, but you need to trust me that they are effortless to read. Four books are out in this planned ten-book series. There will be a plot break after the fifth book. This is intentional, among many reasons, to avoid the torment of countless unresolved threads for fans for years. There is a certain Disney-ness to the style. It feels innocent and lightweight despite dealing with tremendously complex class, war, politics, and mental health themes.&lt;br/&gt;
&lt;strong&gt;Most memorable idea&lt;/strong&gt;: &quot;Life before Death. Strength before Weakness. Journey before Destination.&quot; &apos;nuff said.&lt;/p&gt;
&lt;h3&gt;Best in Textbook&lt;/h3&gt;
&lt;h4&gt;&lt;a href=&quot;https://www.goodreads.com/book/show/1290158.Trading_and_Exchanges&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Trading and Exchanges: Market Microstructure for Practitioners&lt;/a&gt;&lt;/h4&gt;
&lt;h5&gt;by Larry Harris&lt;/h5&gt;
&lt;p&gt;This is apparently a &quot;must-read&quot; for people who work with securities markets. I am sad that I discovered this 3 years after starting my career, but well, देर आये दुरुस्त आये (&lt;em&gt;better late than never&lt;/em&gt;). This is essentially a textbook. It took me about three months to finish it. That&apos;s a semester. There were many chapters directly relevant to what I am doing right now. The first chapter itself had lessons that I learnt with experience. That was easy to hook me. &quot;What else can I learn via this book to circumvent the need to learn it via experience?&quot; I first bought this on Kindle and then got a physical paperback because I wanted to scribble all over it. Worth!&lt;br /&gt;
&lt;strong&gt;Most memorable idea&lt;/strong&gt;: There are different types of traders, and among them, markets exist for the benefit of utilitarian traders, who trade to solve business problems. For example, cornflake producers need to trade in corn futures to hedge their demand for corn.&lt;/p&gt;
&lt;h3&gt;Best in Memoir&lt;/h3&gt;
&lt;h4&gt;&lt;a href=&quot;https://www.goodreads.com/book/show/58977391-the-lettuce-diaries&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;The Lettuce Diaries&lt;/a&gt;&lt;/h4&gt;
&lt;h5&gt;by Xavier Naville&lt;/h5&gt;
&lt;p&gt;A french businessman makes his fortune by selling lettuce in China. This is ultimately a hero story. The author is set up in adverse conditions and discovers his powers to defeat the villain. I mean, the villain is not a person, but well, I am just metaphorically speaking. The story has culture shock. Xavier&apos;s education was worthless when pitted against Chinese farmers. This transforms into cultural appreciation when he learns to navigate the local priorities. When I corporate success stories now, it&apos;s often about startups where they talk about the tech and vision more than the operational aspects. In contrast, this book is all about operations and, of course, Xavier&apos;s personal journey.&lt;br /&gt;
&lt;strong&gt;Most memorable idea&lt;/strong&gt;: For a long time, Xavier had his eye on a market segment that would take their margins to the moon. Only if it worked. He would not let it go. This was a great idea on paper, but it never did work in practice. This teaches me an important lesson to let go. Sometimes our best ideas have poor timing.&lt;/p&gt;
&lt;h3&gt;Best in Spirituality/Slice of Life&lt;/h3&gt;
&lt;h4&gt;&lt;a href=&quot;https://www.goodreads.com/book/show/53176781-seed-to-dust&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Seed to Dust: A Gardener&apos;s Story&lt;/a&gt;&lt;/h4&gt;
&lt;h5&gt;by Marc Hamer&lt;/h5&gt;
&lt;p&gt;Even though it&apos;s not advertised as such, I think of this as a spiritual book. Who better to teach us about life than a gardener? In principle, the book is the author&apos;s diary as a gardener through the year. However, it felt like Mother Nature was talking to my soul. This was a sobering delight in the middle of a pandemic. It made me happy and optimistic about the future.&lt;br /&gt;
&lt;strong&gt;Most memorable idea&lt;/strong&gt;: Some gardeners build their gardens, and some grow their gardens. The latter only guide the growth while the former trim all growth not part of the plan. The difference is essentially how much control you choose to exercise over the growth path of a system. I found this to apply to all planned systems, especially software systems that I work with daily. I have started being less strict about contributions to codebases that I maintain. So far, this has been for good.&lt;/p&gt;
&lt;h3&gt;Best in Current Affairs&lt;/h3&gt;
&lt;h4&gt;&lt;a href=&quot;https://www.goodreads.com/book/show/100779.Reminiscences_of_a_Stock_Operator&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Reminiscences of a Stock Operator&lt;/a&gt;&lt;/h4&gt;
&lt;h5&gt;by Edwin Lefèvre&lt;/h5&gt;
&lt;p&gt;This is current affairs because 2020 and 2021 welcomed the rise of day traders. This is a historical fiction loosely based on the legendary day trader Jesse Livermore. It is a hilarious account of various situations in trading that the protagonist encounters, how he handles them, how he mishandles them and what lessons he learns.&lt;br /&gt;
&lt;strong&gt;Most memorable idea&lt;/strong&gt;: There are no losses in trading, only tuition fees for lessons. More important lessons will incur higher tuition fees.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Fin&lt;/em&gt;&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Keynes and Umaid Bhawan Palace]]></title><description><![CDATA[The world is waking up from a pandemic wave. We don't know if there will be another wave. Globally, we're at the trough after three waves…]]></description><link>https://kumar-ayush.com/blog/keynes-umaid-bhawan/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/keynes-umaid-bhawan/</guid><pubDate>Thu, 21 Oct 2021 11:20:37 GMT</pubDate><content:encoded>&lt;p&gt;The world is waking up from a pandemic wave. We don&apos;t know if there will be another wave. Globally, we&apos;re at the trough after three waves, and it does seem like we&apos;re past the minima here. Russia and UK are reporting a concerning rise in new cases.  With this background, the US passed the &lt;a href=&quot;https://www.reuters.com/world/us/whats-bipartisan-us-1-trillion-infrastructure-bill-2021-10-01/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;$1 trillion infrastructure bill&lt;/a&gt;. Apart from fulfilling the generally good idea of upgrading a country&apos;s infrastructure, what good do such bills do? In India, we&apos;ve started construction work on &lt;a href=&quot;https://timesofindia.indiatimes.com/india/centra-vista-construction-work-of-new-parliament-building-begins/articleshow/80281729.cms&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Central Vista&lt;/a&gt;, which would be our new parliament building. There are two straightforward points in favour of the project. One, it provides employment. Two, it serves some symbolic notion of a new India. There are several critics of this project. The critics would agree with the first point and would disagree with the need for the second. After all, expenditure on schools and hospitals could also serve towards employment. I do have my views here, but our plan for today is not politics. Let&apos;s dial back. The common theme between these two examples is government spending leading to a rise in employment. Where have I heard that before?&lt;/p&gt;
&lt;p&gt;My first introduction to the idea was reading &lt;em&gt;Jholawala Economics&lt;/em&gt; by Prof. Jean Dreze. This man has had notable contributions in getting India&apos;s Rural Employment Guarantee Act off the ground; NREGA, MGNREGA or whatever variant. It guarantees 100 days of employment in a year. The point is that the government can use this labour for local infrastructure projects. Economists here would not take long to recognise that this rhymes with Keynes&apos; general theory and his recommendations for government spending to stimulate the economy. It is easy to point out that NREGA is a Keynesian idea, and all such projects are a popular decision because of his influence in economics. I don&apos;t think this is true, but soon in this article, we&apos;ll look at a couple of examples of the same idea pre-Keynes, and I found that amusing, and that&apos;s why I am writing this.&lt;/p&gt;
&lt;p&gt;However, especially around NREGA, even if the inception was not Keynesian, the atmosphere around it has undoubtedly been. You see, Keynes&apos; had this quote in his work- &lt;em&gt;&quot;The government should pay people to dig holes in the ground and then fill them up&quot;&lt;/em&gt;. There is more context around this. He certainly did not mean this is a verbatim recommendation. But it&apos;s a dramatic line, and dramatic lines may sometimes stay a part of narratives longer than solid theories. So much so that this has been used as a critique of NREGA. Here are two articles [one by Jean Dreze] that I found that counter-argue the critiques- &lt;a href=&quot;https://indianexpress.com/article/opinion/columns/the-digging-holes-myth-2/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Jean Dreze&lt;/a&gt; and &lt;a href=&quot;https://indianexpress.com/article/opinion/columns/mgnrega-digging-holes-filling-them-up/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Reetika Khera&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;These instances were not supposed to be part of this post. While discussing this post, I heard from a friend that pre-NREGA, during the times of Indira Gandhi, there used to be a similar act where they went to the extremes of digging ditches and filling them up. I could not find anything about such an act. Still, okay, even if there was such a thing, I am personally more inclined to believe in the strength of powerful narratives than thinking that people are simply practising their inner Sisyphus in each iteration of this act.&lt;/p&gt;
&lt;p&gt;With this fuzzy background in place, read the story of &lt;a href=&quot;https://www.tajhotels.com/en-in/taj/umaid-bhawan-palace-jodhpur/stories/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Umaid Bhawan Palace&lt;/a&gt; in my hometown of Jodhpur. In one line, the palace was built to provide employment during a famine. Interestingly, the palace was commissioned in 1929, and Keynes published his General Theory in 1936. All infrastructure projects are not inspired by Keynes, after all. &lt;a href=&quot;https://mostlyeconomics.wordpress.com/2012/09/07/keynes-in-Jodhpur-in-1929-picked-from-kbc-6/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Someone else&lt;/a&gt; on the world-wide-web has noticed this before me.&lt;/p&gt;
&lt;p&gt;How would the Maharaja arrive at this idea? Look, it is entirely possible that this was a genius offspring of his mind, but more often than not, innovation is pulling old ideas into a new context. It is now a new idea, but it did not come in a dream. Famine prevention has been a big deal in the Indian subcontinent for time immemorial. The subcontinent has always depended on unpredictable monsoons. There are popular theories that a shift in monsoon patterns led to the decline of the Harappan civilisation and our ancestors moving to the Gangetic plains.&lt;/p&gt;
&lt;p&gt;A &lt;a href=&quot;https://en.wikipedia.org/wiki/Famine_in_India&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Wikipedia&lt;/a&gt; page on the subject claims that the oldest mention comes from Kautilya&apos;s &lt;em&gt;Arthashastra&lt;/em&gt;, which is 3rd or 2nd century BCE. There is some nuance here. The Wikipedia mention can be traced back to Jean Dreze and Amartya Sen&apos;s &lt;a href=&quot;https://oxford.universitypressscholarship.com/view/10.1093/acprof:oso/9780198286363.001.0001/acprof-9780198286363-chapter-2&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;work&lt;/a&gt;. I want to dig deeper, and I want to know the precise chapter where Kautilya would mention this. Well, Dreze and Sen are referencing another piece of work.&lt;/p&gt;
&lt;blockquote&gt;
&apos;institute the building of forts or water‐works with the grant of food, or share (his) provisions (with the people), or entrust the country (to another king)&apos;
&lt;p&gt;— &lt;cite&gt;Chetty, V. K., and Ratha, D. K. [1987], &apos;The Unprecedented Drought and Government Policies&apos;, mimeo [New Delhi: Indian Statistical Institute].&lt;/cite&gt;&lt;/p&gt;
&lt;/blockquote&gt;
I am very disappointed that I could not find this work. I went to Shamasastry&apos;s translation of *Arthashastra* to find anything relatable. R. Shamasastry is credited with the re-discovery and translation of *Arthashastra*, so I could not do better. The closest is [Book IV, Chapter III](https://en.wikisource.org/wiki/Arthashastra/Book_IV)- *&quot;He [king] may either do such works as are usually resorted to in calamities&quot;*. If you look at the surrounding text, you will see that &apos;usual calamity work&apos; could mean a wide variety of stuff; a lot of it superstitious. I would have loved to trace this to an ancient text, but I would not make that conclusion without more evidence. Scientific truth is a narrow path; powerful narratives are potent lures.</content:encoded></item><item><title><![CDATA[A case for reading history]]></title><description><![CDATA[Hey everybody, I am here to make a case for reading history. No, I will not tell you why it's important to know that the Battle of Plassey…]]></description><link>https://kumar-ayush.com/blog/reading-history/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/reading-history/</guid><pubDate>Sat, 28 Aug 2021 11:20:37 GMT</pubDate><content:encoded>&lt;p&gt;Hey everybody, I am here to make a case for reading history. No, I will not tell you why it&apos;s important to know that the Battle of Plassey was fought in 1757. I am here to tell you why is it important to know why the British won the Battle of Plassey despite being outnumbered ten to one. I&apos;ve used a defining moment from the British era of the history of the Indian subcontinent, but I am not going to talk more about that. My knowledge is pretty limited in that domain. I have used that for introduction only because I believe it is pretty suitable to throw us into a flashback of the history classroom from school. That is where this story begins, more or less.&lt;/p&gt;
&lt;p&gt;My mother teaches social science to middle and high school kids. While growing up, we used to have a stock of textbooks from various publishers. I read a lot of it. It was not long ago that I had learned how to read myself. Hence, of course, I didn&apos;t comprehend much myself. I would be simply scrolling pages and looking at pictures plenty of times. But my mother would explain bits to me. I remember my favourite. I remember learning about the history of human civilisation - Bronze Age, Iron Age, Neolithic Man, Paleolithic Man, Neanderthals, Homo Sapiens, Harappa, Mesopotamia, etc.&lt;/p&gt;
&lt;p&gt;And then came the time when I had to study history as a subject in school. I was a middle school student now. My mother&apos;s textbooks were as much a distant memory as they are now. These were a few gruelling years of learning who ruled where when. I went through the cycle of learning facts for my exams and forgetting them the next day. This did not change in secondary school, except a kind soul introduced a couple of social and cultural history chapters in our textbooks. I am talking about &lt;a href=&quot;https://www.ncert.nic.in/ncerts/l/iess308.pdf&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&quot;Clothing: A Social History&quot;&lt;/a&gt; in NCERT&apos;s Class IX history textbook and &lt;a href=&quot;https://ncert.nic.in/ncerts/l/jess307.pdf&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&quot;Print Culture and the Modern World&quot;&lt;/a&gt; in NCERT&apos;s Class X history textbook.&lt;/p&gt;
&lt;p&gt;We would learn about the World Wars but in the context of how they impacted the clothes that we wear. We would learn about the impact of print on the French revolution and the role of newspapers in the Indian Freedom struggle. I loved it. This is history in its purest form. History is not an old photograph of your grandmother. History is the teapot that you adore as a showpiece in your house, and your grandmother can be seen drinking tea from it in the photograph. It is not a book with many pages. It is a book where someone has sewn threads across pages. It is not an instant in time but a thread through time.&lt;/p&gt;
&lt;p&gt;Fast forward to college, while getting a degree in Engineering Physics, I would enjoy reading books on physics that would pull me back in time. During our course on Electrodynamics, I ventured to read Maxwell&apos;s original treatise on the subject. I did not do as well in the course as I could have if I had focussed on my textbook and assignments instead. Well, I do computer science and finance at my job as of writing. Electrodynamics has not been as helpful to me as the lesson Maxwell&apos;s book taught me. I mean, it was a book on the subject, but it did a terrible job of teaching the subject. If you&apos;ve gone to school, you have learnt about vectors. Vectors are a fundamental necessity of physics. Classical physical quantities such as velocity and acceleration too are described using them. They are essential to studying Electrodynamics too. But Maxwell talked by assigning notation to each component of the vectors involved. There would be too much to unpack. He did not use vectors. How could he? Vectors were invented in their modern form by &lt;a href=&quot;https://www.britannica.com/science/vector-mathematics&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Gibbs and Heaviside&lt;/a&gt; in the late 19th-century &lt;em&gt;after&lt;/em&gt; Maxwell wrote his groundbreaking treatise. Their work was, in part, targeted towards making an easier formulation of Maxwell&apos;s work. Notation, and more generally, abstraction, is crucial to human intelligence.&lt;/p&gt;
&lt;p&gt;Following suit, during our course on Relativity, I started reading a multi-volume work on the history of Relativity. The book built immense context around what was known to the scientific community in the years leading up to Einstein&apos;s breakthrough. It also featured snippets from Einstein&apos;s notebook and tried to reconstruct the thought process. There is no doubt that Einstein was brilliant, but we would have had the theory of Relativity without him as well. Breakthroughs in knowledge are built on a heap of related work. When you stand on the shoulder of giants, the giant is not a being but a composite structure made of mere humans. This is why it is common for independent groups to arrive at the same results around the same time. I will credit major thinkers to have effectively used the context and knowledge available in their discoveries. Only when I know the context behind a major discovery I can reconstruct the process of discovery and learn from it. Understanding this process is great admiration for the thinkers. Perhaps, it is greater than simply noting their work and being grateful for their contributions to humanity.&lt;/p&gt;
&lt;p&gt;History connects ideas through time, just like mathematics connects ideas through space. Henri Poincare once quipped, &quot;mathematics is the art of giving the same name to different things&quot;. Well, in history, all that you see in current affairs has happened before. Of course, not literally. There is variety in each event, but each event could be broken down into events that led to it, and the path has patterns. Today, we see income inequality correlate with a rise in populism. Where have we seen that before? History is not about learning the past but about understanding the present.&lt;/p&gt;
&lt;p&gt;My favourite branch of history is called microhistory. The definition is vague and has considerable overlaps with social and cultural history. The idea is to understand major events through the lens of relatively micro-entities. The entity can be an object, a concept, a technology or even a human being. Have you ever imagined WWII from the perspective of &lt;a href=&quot;https://en.wikipedia.org/wiki/Constanze_Manziarly&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Adolf Hitler&apos;s cook&lt;/a&gt;? The possibilities are limitless.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Everything is supply chain management]]></title><description><![CDATA[A few weeks ago, Github announced Copilot. They call it an AI pair programmer. It is the next level of autocomplete. It will write entire…]]></description><link>https://kumar-ayush.com/blog/supply-chain-management/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/supply-chain-management/</guid><pubDate>Sat, 21 Aug 2021 11:20:37 GMT</pubDate><content:encoded>&lt;p&gt;A few weeks ago, Github announced &lt;a href=&quot;https://copilot.github.com/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Copilot&lt;/a&gt;. They call it an AI pair programmer. It is the next level of autocomplete. It will write entire procedures for you based on context. The news was flooded with excitement. I witnessed a lot of suggestions on how this will revolutionise the software industry. I don&apos;t know about that. Maybe it will. Perhaps it is indeed helpful for many folks, but I found no inkling of excitement in myself. I have tremendous appreciation for what they have built as an engineer. But I don&apos;t particularly look forward to using it. I cannot remember a situation where a tool like this would have considerably improved my productivity. It would have made an incremental difference, sure, but not a revolutionary difference. I don&apos;t spend the toughest hours of my week struggling to write a procedure, thinking about optimal syntax to achieve what I want to achieve. I am pretty comfortable with the languages and frameworks that I need to use. As far as the algorithm is concerned, a brute-force approach goes a long way. Optimisation always comes much later. And even then, the internet search is good enough for the number of times I need to do it. What then is the challenge in my life? What do I spend the toughest hours of my week doing?&lt;/p&gt;
&lt;p&gt;This week I had to shift houses. I used to live in a 3 BHK with a couple of friends from college. They&apos;re moving out of the city, and I am too lazy to find new flatmates. I decided to move into a 1 BHK. I am mentally old enough to enjoy my privacy more than I would enjoy the comfort of constant company. In minimising the assets that I own, I decided to send a box of books to my parents&apos; house since I have lesser space now. I&apos;ve already read these books, and they&apos;ll be better maintained in my parents&apos; library. The box weighed a little over 40 kgs and had to be transported about 2000 km. We started brainstorming on what are the best ways to transport it. Standard options like courier were too expensive. Our best option for a while was train freight. But then, a friend suggested we try a business logistics company. They have an option to transport LTL (less than truckload) which I can avail of. And listen, it has so happened that the world is going through supply chain problems caused by the Covid-19 pandemic. Hence, I&apos;ve spent a fair deal of time recently learning about the shipping and trucking industry. I was excited to book cargo for intercity transport myself. (shoutout to Joe Weisenthal and Tracy Alloway from the &lt;a href=&quot;https://www.bloomberg.com/oddlots-podcast&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Bloomberg Odd Lots podcast&lt;/a&gt;). This is obviously nowhere close to international shipping, but it&apos;s more than sending a courier.&lt;/p&gt;
&lt;p&gt;Step one was to find a cardboard box to pack the books in. Obvious retail options like Amazon and Flipkart were either too expensive or did not have an acceptable box size. We found a packaging company on Justdial and went to them physically to purchase a few boxes. That was easy. Then, you simply go to the nearest warehouse of the logistics company. I had to submit a couple of copies of my ID to the administrator at the warehouse. He punched the addresses and other details. Then, I paid what was owed and collected a receipt with tracking and further information.&lt;/p&gt;
&lt;p&gt;Let&apos;s look at what happened to the package after this. I live in Bengaluru, and my parents&apos; house is in Jodhpur. The box went to a central facility in Bengaluru the next day. After that, it left for Jaipur. And then a smaller truck took it to Jodhpur.&lt;/p&gt;
&lt;p&gt;I sent my parents a message on Whatsapp with the tracking details of the package. Let us also look at what happened to that message. The bits my phone registered on to the touchpad were not immediately transmitted to my father&apos;s phone. They would be transferred to Whatsapp&apos;s application layer. Whatsapp would process them and pass them along to various other layers before they are transmitted. Well, the transmission would also hop around multiple times before reaching my dad&apos;s phone. Then it would pass multiple layers before reaching the application layer of Whatsapp on my dad&apos;s phone. Now, Whatsapp on his phone would process the information and then render a display that completes the communication chain.&lt;/p&gt;
&lt;p&gt;Suppose the Whatsapp developers were to use an AI pair programmer. In that case, it could probably assist in writing each procedure required to transfer information to/from application from/to operating system. It can&apos;t learn (at least yet, or immediately) how to change these procedures for a change in specifications of the communication standard from the OS. This would be equivalent to the government introducing a new form to fill if you want to send a package interstate. Well, that&apos;s not true. An AI, or maybe even a dumber computer, can help you modify these procedures, given the specifications of this additional form. But what it surely cannot do is anticipate this change, interpret the deadline for this change and plan a timeline for the corresponding changes in the application. The evolution of communication standards between different software is a fundamentally human decision. It is driven by changes in the requirements of humans. What I am labelling as communication standards here is nothing else but APIs. There would never be any need for APIs if everything was one software, but it isn&apos;t. And it can&apos;t be.&lt;/p&gt;
&lt;p&gt;Would you eliminate the need for food supply chains if everyone lived in one large house? It is physically impossible. Look, the whole point of life is enabling a physical process to move energy against entropy. Our civilisation is nothing but elaborate supply chains of resources.&lt;/p&gt;
&lt;p&gt;Software, too, is such a process. It is simply an information supply chain. And since it takes space to store information, the rest of it is nothing different. Sure, it takes much less space to store data than a box of books or a kilo of rice. And we&apos;re constantly able to reduce that space and make computing and storage faster as a result, but it would always occupy finite space.&lt;/p&gt;
&lt;p&gt;IT has revolutionised the world by making processes within a supply chain faster and less error-prone. Still, it cannot do anything to solve your supply chain management problems. Most of them are NP-hard, and you need a creative human to do those for you. Some of these optimisations can be solved under relaxation, but again, that&apos;s a human choice to make.&lt;/p&gt;
&lt;p&gt;Bugs happen because some part of your code expects information in a different format. Perhaps it receives incorrect information, or perhaps it never receives any information at all. What else is a null pointer exception than missing information? Your package got dropped in transit because you filled in the wrong address. A function returned null because you provided it with unexpected inputs. In both cases, you will add a layer of robustness by checking the inputs against expectations.&lt;/p&gt;
&lt;p&gt;This is not to argue that software does not add any value. The logistics warehouse administrator could have made an error while doing my paperwork. He was also slow. It took a good fifteen minutes for everything. A computer program will not make an error and would be faster in such a situation. A computer would also be cheaper to scale.&lt;/p&gt;
&lt;p&gt;However, a computer system would also not be able to overlook specific errors. Computers do not make errors because they literally cannot deviate from what they are asked to do. But let&apos;s say there is an error with the input. I put the pincode of my address incorrectly, and a computer was in charge of delivering the package to my door. What happens now? I assume it would simply fail the task. A human can make out the mistake from the rest of the address. They are likely to know the building and the general area. A computer can do that too, by the way, if it is explicitly asked to. But most humans don&apos;t need to be &quot;explicitly&quot; asked to overlook obvious human errors. Regardless, to decide that your computer should be trying to verify or estimate the address is a supply chain management problem. An AI can help you write the procedure to calculate a correct address from an incorrect address, maybe.&lt;/p&gt;
&lt;p&gt;To clarify again, I am not against AI tools such as Github Copilot. I am using Grammarly to write this. It helped me correct a lot of errors and had great suggestions to rephrase certain parts. It was helpful, but it did not reduce my time struggling to compose my thoughts. I am simply trying to point out a difference between an incremental tool and a revolution. That is also the minor point of this article. The primary purpose is to demonstrate how the most challenging aspects of software development are simply supply chain management problems.&lt;/p&gt;
&lt;p&gt;The internet, too, is run on a supply chain fulfilled by companies like Akamai. I was discussing with my partner last week how few people remember how such companies form the backbone of the internet. Caches deliver content to you with unimaginable speed. Suppose a video is viral on Facebook in your state. In that case, it will end up being stored on a cache physically located nearest to your state and delivered straight to you from the cache. This is quite akin to how Amazon would keep goods in warehouses close to an area if it anticipates buyers from that area to optimise the speed of delivery.&lt;/p&gt;
&lt;p&gt;I want to pitch the advantage of seeing things this way. It is empowering to see software as a tool and only a tool to solve human problems. It is not a magic wand, and while what it does can often seem magical, it will not solve your supply chain problems for you. You still need to work out how you&apos;re going to use it.&lt;/p&gt;
&lt;p&gt;The toughest hours are spent deciding what the optimal way to transfer information between software systems is. Is it better to store an intermediate calculation in an object database or a NoSQL database? The type of the warehouse obviously determines its properties in the supply chain. The toughest hours are spent wrangling with an API upgrade which may require a significant refactor of our codebase. The toughest hours are spent figuring out how a data row went missing from the user interface while it is present in the database.&lt;/p&gt;
&lt;p&gt;Everything is supply chain management.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Dolce far niente]]></title><description><![CDATA[Why do we get bored? Are there not enough things to do in the world? Are there not enough books left to read? Not enough shows or movies…]]></description><link>https://kumar-ayush.com/blog/dolce-far-niente/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/dolce-far-niente/</guid><pubDate>Sun, 08 Aug 2021 00:20:37 GMT</pubDate><content:encoded>&lt;p&gt;Why do we get bored? Are there not enough things to do in the world? Are there not enough books left to read? Not enough shows or movies left to watch? Not enough hobbies to learn, and not enough activities to do?&lt;/p&gt;
&lt;p&gt;Often, we choose to rewatch or reread something we like against exploring something new. Thus, we avoid risk. Why not do something that gives guaranteed joy than try something which only has a chance of giving us pleasure? This makes sense, but I don&apos;t like it.&lt;/p&gt;
&lt;p&gt;There is a concept in game theory called the Gittins index and an associated theorem that helps you decide optimal action policy under certain assumptions. The theorem is non-robust in the sense that it is dangerously unhelpful under any variations in the assumptions.&lt;/p&gt;
&lt;p&gt;Thus, we cannot distil an easy rule from this theory to apply to our problem of picking which Netflix show to watch next. However, we can derive some intuition here. Consider you have two biased coins. You can flip one coin each turn, and you win two rupees if you get heads, and you lose a rupee if you get tails. Let us say both are biased in favour of heads but differently so. Quite obviously, if you know the biases, your best interest is to keep flipping the coin with a heavier bias. But let us think about what happens if you do not know the biases.
If you flip coin A seven times, for 4 heads and 3 tails, your estimate for your mean income is 5/7. Now you flip coin B twice, for 1 heads and 1 tails and a mean income of 1/2. Is coin A better? But you haven&apos;t tried B as much! If you believe in this made-up number called the Gittins index, you will go for B next. Gittins index solves precisely the problem here - it puts a number on your cost of exploration. And for the example scenario here, the cost is lower than the possible reward. The Gittins index for coin A after 4W3L is 0.6276, and for coin B after 1W1L is 0.6346. For a coin that you have tried zero times, the Gittins index would be 0.7029.&lt;/p&gt;
&lt;p&gt;What I have presented here is a version of the multi-armed bandit problem. Let us draw our intuition and move on. The first thing to realise is that there is indeed a cost of exploration. There are indeed scenarios where this is low enough that you are losing out by not exploring further. The second thing to realise is that this cost is higher if you have a limited number of total turns.&lt;/p&gt;
&lt;p&gt;A fair number of people have used this idea to argue that you should explore. But it is easily refuted. If life is short, you must exploit what known pleasures you have. And life &lt;em&gt;is&lt;/em&gt; short. Thankfully, the Gittins index does not apply to life. The reward structure is quite different. If we like a joke, we cannot keep hearing the same joke every day and enjoy it. But if we like sci-fi movies, we can keep watching different sci-fi movies every day and enjoy them on average. Can we? Maybe we would be bored in a month. But if we like movies, we could keep watching a movie every day and enjoy them on average. This is not at all like the multi-armed bandit problem. We evolve, and the expected rewards of our actions evolve not only because we discover more information about it but simply because the hidden state evolves too.&lt;/p&gt;
&lt;p&gt;Boredom is different. It stems from a lack of energy rather than risk aversion. Entertaining ourselves requires draining mental energy. Rewatching or rereading is not done in a desire for a higher expected reward but for a lower expected cost. Active entertainment such as singing, playing an instrument, gardening, weaving or writing requires a higher cost than passive entertainment such as listening or reading. But passive entertainment costs nonetheless. And you may have experienced boredom watching even your favourite show sometime. It gives you a guaranteed reward, and it exacts a low cost on you, but a cost nonetheless. There would be days when you do not have even that to spare.&lt;/p&gt;
&lt;p&gt;Thus, this is an energy management problem and not a risk management problem. What do you do here? My advice - menial tasks or chores. Take a walk, wash some dishes, cook a meal - and all without any background music or podcast or show playing. You need to experience the joy of doing nothing - &lt;em&gt;dolce far niente&lt;/em&gt;!&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Unit Tests breathe soul into your code]]></title><description><![CDATA[As many of you may know, this blog is a self-discovery process.
It is also possible that none of you may know. I am not aware of anyone…]]></description><link>https://kumar-ayush.com/blog/unit-tests-soul/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/unit-tests-soul/</guid><pubDate>Sun, 20 Jun 2021 11:02:14 GMT</pubDate><content:encoded>&lt;p&gt;As many of you may know, this blog is a self-discovery process.
It is also possible that none of you may know. I am not aware of anyone other than myself reading this. The topics that I generally write about fit the following description - these are ideas that I have encountered in my experience. I do not claim that they are new ideas to the world. Simply that I did not read or listen about them verbatim and discovered them in the wild. I hope that you, the reader, would also enjoy discovering these articles. They&apos;re cute, aren&apos;t they?&lt;/p&gt;
&lt;p&gt;I have spent months thinking about writing on this topic and have hesitated. Although I am convinced of the point, I did not find my arguments convincing. What helped me push across the finish line is a little book called &lt;a href=&quot;https://www.manning.com/books/the-programmers-brain&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;The Programmer&apos;s Brain&lt;/a&gt; by Felienne Hermans. I have been following her work for a few years now, initially attracted to her work on programming in MS Excel. I was fascinated by functional programming paradigms and wanted to nail down the thought that MS Excel indeed fits into the paradigm.&lt;/p&gt;
&lt;p&gt;Enough of the welcome blabber! Let&apos;s jump on then. What are the reasons we write unit tests for our code? One is that it helps identify bugs early. This is why I was taught I must write tests, and I have benefitted from this. However, many seasons later, I have discovered there are more advantages to this. One of them is documentation. Programmers new to the codebase get a lot to learn about the code from the tests. Interpreting complex functions becomes more manageable when one looks at examples of their input and output.&lt;/p&gt;
&lt;p&gt;As of writing, I work with data science pipelines in Python, and I&apos;ve chosen to keep my test cases heavily redundant. Although the size of the codebase can be reduced plenty if I bother refactoring my input sets. I&apos;ve made this choice to aid a new programmer to interpret any function with greater ease.&lt;/p&gt;
&lt;p&gt;That&apos;s all the point there is. I want to put some frills to these thoughts, though. I tend to think of this in terms of breathing soul into your code. Programming can be described as modelling objects. These could be from the physical world. For example, you are writing a class to represent a car in a racing game. These could be from the abstract world. You could be processing a linked list that represents the file system of your operating system. In all these scenarios, certain implicit assumptions drive the implementations. You don&apos;t write these in the code. Instead, you assume (or hope) that the future programmer would also work with these implicit assumptions. For example, a &lt;code class=&quot;language-text&quot;&gt;Car&lt;/code&gt; class would not have a &apos;fly&apos; method. Or would it?&lt;/p&gt;
&lt;p&gt;Let us say that you assumed it would not. Let&apos;s fast forward to the future. Your game has a bug that sends the car bury a few centimetres in the ground after a collision. The most obvious test that would prevent this scenario is to check that the y-coordinate of the car cannot be negative. Here, I have assumed y is the vertical axis, and a value of 0 implies the ground. This is fascinating to me. It is one thing to test if your method does what it is supposed to do correctly. It is another to test if it does not do what it is not supposed to do. You can keep things on a chair and you can keep things on a table. What&apos;s the difference? Tests give the objects their identity. This may seem trivial for a class like &lt;code class=&quot;language-text&quot;&gt;Car&lt;/code&gt;, but you do not always work with classes with a clear analogue. While the identity of a &lt;code class=&quot;language-text&quot;&gt;Car&lt;/code&gt; class may be intuitive to an average programmer, the same would not hold true for the &lt;code class=&quot;language-text&quot;&gt;AppointmentBook&lt;/code&gt; class in management software. Who can create an appointment? What does an appointment look like? The answers would depend on the context, which the original programmer would have been aware of. As the programmer who has to implement a change in the future, you need to know the original context. Documentation is helpful in such scenarios, but unit tests for methods that detail what the class is &lt;em&gt;not&lt;/em&gt; capable of? They breathe the soul into your objects.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[The Rise of Smartphones in our Dining Experience]]></title><description><![CDATA[August 2019 In August 2019, I was visiting my friend, Sharad Mirani, in Amsterdam.
We had a breakfast cafe nearby - Bagels and Beans.
We…]]></description><link>https://kumar-ayush.com/blog/qr-code-ordering/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/qr-code-ordering/</guid><pubDate>Sat, 26 Sep 2020 13:22:14 GMT</pubDate><content:encoded>&lt;h2&gt;August 2019&lt;/h2&gt;
&lt;p&gt;In August 2019, I was visiting my friend, Sharad Mirani, in Amsterdam.
We had a breakfast cafe nearby - Bagels and Beans.
We were their guests almost every morning.
If you get a chance, do drop by.
We highly recommend it.
This is a franchise, and I am referring to the one on Parnassusweg.&lt;/p&gt;
&lt;p&gt;They had some sort of a machine where waiters would record orders.
It was nothing complex.
It looked a bit like an old phone.
Large, black, has a number pad, has an LCD screen.
A number indicates a specific order.
But by modern standards, the UX was definitely non-trivial.
There was one particular waitress who faced quite some challenge with this.
Suppose we had to take one item off our order.
In that case, she&apos;d struggle with it and eventually end up cancelling the whole order and retaking the order without this item.
Why don&apos;t we make this a smartphone app? Through a decade or more of mobile app design, we&apos;ve figured ways to make them simple enough for even the most technologically challenged population among us.
Why are we forcing people to struggle with an archaic piece of technology? We can take this a bit further and try to help everyone instead of just the waitress.
Why don&apos;t we just get apps ourselves? We could order without any help from the waiting staff.
Why is this not already commonplace? This is not a long stretch of imagination.
What are our theories?&lt;/p&gt;
&lt;p&gt;At some places, you want the experience of talking to an executive, figuring out what fits your mood, having elaborate options into a dish.
But only a few expensive dine outs have this expectation to match.
For most of it, we&apos;ve already gotten used to delivery.
We are pretty good at compressing our conversations and options into an app already.&lt;/p&gt;
&lt;p&gt;It is a bad, rude thing to fire some of your waiting staff.
But you could slowly reduce the staff.
Don&apos;t fire the current one, simply don&apos;t rehire.&lt;/p&gt;
&lt;p&gt;Or, inertia.
Is it just a lack of will to take risks when this is not your first priority.
Even if it has a low cost to implement, quality of life improvements are harder to prioritise.
Personally, I would stretch this to say that people are lazy.
Inertia is just a fancy word for it.
Okay, maybe these improvements are subjective &quot;improvements&quot;.
Some people might like the human interaction at restaurants.
But whatever, not my counterargument to make.&lt;/p&gt;
&lt;p&gt;Anyway, a couple of days went by.
Then, I saw the owner of the cafe taking interviews for new waiting staff.
I was informed that he comes to the cafe quite often to do these interviews.
Now, maybe I could talk to him into hiring me for making an app for them.
I would be able to open a startup and move to Amsterdam.
What an idea! This never came to happen, but at some later point, I did seriously consider the idea of making it a weekend gig for myself back in Bengaluru.
I could make apps for restaurants which they could use as an ordering system.
Automate the waiting staff partially.
Most of the back-end would be reusable with only the front-end varying with each restaurant.
Sounds like a good side business for me.&lt;/p&gt;
&lt;p&gt;This is not very different from existing apps where you order food or literally anything.
I believe the only challenge is confirming that a customer placing the order for a table is physically there.
I could order food for table 33 when I have not yet arrived.
I could be delayed or cancel my plans, and the restaurant would not be able to occupy customers who are physically present, waiting for a table.
Places which make a reservation are fine, but many don&apos;t.
Now, at one of the places where I&apos;ve tried this app-based ordering system - someone comes to your table to confirm your order.
It&apos;s simple.
But maybe you can do better, e.g.
restrict the website to the restaurant wifi.&lt;/p&gt;
&lt;p&gt;It was amazing how quickly I forgot about all of this.
Life moved on, and this became another passing thought.&lt;/p&gt;
&lt;h2&gt;September 2020, One Year Later&lt;/h2&gt;
&lt;p&gt;We are in a pandemic! I am in Bengaluru.
For a long time, restaurants were closed for dine-in.
When they opened, they opened with some restrictions.
Each alternate table has to be empty.
All customers need to sanitise their hands at entry and undergo a temperature check.
Masks are mandatory till you&apos;re seated.
I wanted to experience this.
Frankly, it was akin to an amusement park visit for me.
So I did.&lt;/p&gt;
&lt;p&gt;The tables had a QR code to scan which takes you to a website where you can order.
The QR code solves the problem of being physically present at the table.
They are managing reservations traditionally.
To be honest, I did not immediately realise the significance of this.
I was simply exhilarated (and slightly disappointed) to see my idea from a year ago in action.
It took maybe a month more when I noticed this is now standard practice.
Nobody wants the menu cards to transmit the virus.
It is a simple safety measure.
But this will last forever, I don&apos;t see why we&apos;re going back.
The conditions of a pandemic have given the activation energy for this change.&lt;/p&gt;
&lt;p&gt;Once again, adversity has necessitated invention.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Classification of Bugs: Chapter 3 - Case Sensitivity Rules]]></title><description><![CDATA[Case Sensitivity Rules Problem domain: Where many systems interact
The error: Different systems have different case sensitivities
The…]]></description><link>https://kumar-ayush.com/blog/bugclass_ch3/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/bugclass_ch3/</guid><pubDate>Sat, 19 Sep 2020 17:32:04 GMT</pubDate><content:encoded>&lt;h3&gt;Case Sensitivity Rules&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Problem domain&lt;/strong&gt;: Where many systems interact&lt;br/&gt;
&lt;strong&gt;The error&lt;/strong&gt;: Different systems have different case sensitivities&lt;br/&gt;
&lt;strong&gt;The symptom&lt;/strong&gt;: Various&lt;/p&gt;
&lt;script markdown=&quot;0&quot; src=&quot;https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js&quot;&gt;&lt;/script&gt;
&lt;p&gt;There is no question. This one might as well be a tweet.&lt;/p&gt;
&lt;blockquote class=&quot;twitter-tweet&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;Quite recently, I’ve seen numerous instances where people are struggling with mystery bugs in their web applications, and the answer turns out to be the idea that different systems have different case sensitivities.&amp;mdash; Kumar Ayush (@kumarayush4ever) &lt;a href=&quot;https://twitter.com/kumarayush4ever/status/1307659026847547395?ref_src=twsrc%5Etfw&quot;&gt;September 20, 2020&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;script async src=&quot;https://platform.twitter.com/widgets.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
&lt;blockquote class=&quot;twitter-tweet&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;Be wary. If you have multiple systems talking to each other, always make sure they agree on the case sensitivity rules.&amp;mdash; Kumar Ayush (@kumarayush4ever) &lt;a href=&quot;https://twitter.com/kumarayush4ever/status/1307659096724705281?ref_src=twsrc%5Etfw&quot;&gt;September 20, 2020&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;script async src=&quot;https://platform.twitter.com/widgets.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt; </content:encoded></item><item><title><![CDATA[Classification of Bugs: Chapter 2 - Local Variables]]></title><description><![CDATA[Local Variables Problem domain: State and styling
The error: There exists a local variable intended to hold intermediate results
The…]]></description><link>https://kumar-ayush.com/blog/bugclass_ch2/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/bugclass_ch2/</guid><pubDate>Sat, 23 May 2020 19:27:30 GMT</pubDate><content:encoded>&lt;h3&gt;Local Variables&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Problem domain&lt;/strong&gt;: State and styling&lt;br/&gt;
&lt;strong&gt;The error&lt;/strong&gt;: There exists a local variable intended to hold intermediate results&lt;br/&gt;
&lt;strong&gt;The symptom&lt;/strong&gt;: Various&lt;/p&gt;
&lt;script markdown=&quot;0&quot; src=&quot;https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js&quot;&gt;&lt;/script&gt;
&lt;p&gt;The question is simple.
Is it a good idea to declare local variables which contain intermediate results when they have to be used once or twice?
Is this another matter of taste?&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;python&quot;&gt;&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Using a local variable&lt;/span&gt;
number_of_players &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;game&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;players&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string-interpolation&quot;&gt;&lt;span class=&quot;token string&quot;&gt;f&quot;There are &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;number_of_players&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;} players.&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; 

&lt;span class=&quot;token comment&quot;&gt;# Avoid use of any extra variables&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string-interpolation&quot;&gt;&lt;span class=&quot;token string&quot;&gt;f&quot;There are &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;game&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;players&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt; players.&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This is a relatively straightforward example.
It does not add a lot to readability by declaring a separate variable to hold the number of players.
It looks good, saves a line.
Let us look at another example&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;python&quot;&gt;&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Using a local variable&lt;/span&gt;
india_tz &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; pytz&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;timezone&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Asia/Kolkata&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
austria_tz &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; pytz&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;timezone&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Europe/Vienna&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
now &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; datetime&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;datetime&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;now&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;tz&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;india_tz&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;astimezone&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;austria_tz&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string-interpolation&quot;&gt;&lt;span class=&quot;token string&quot;&gt;f&quot;The time is &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;now&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;strftime&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&apos;%H:%M:%S&apos;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;.&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; 

&lt;span class=&quot;token comment&quot;&gt;# Avoid use of any extra variables&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string-interpolation&quot;&gt;&lt;span class=&quot;token string&quot;&gt;f&quot;The time is &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;datetime&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;datetime&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;now&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;tz&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;pytz&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;timezone&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&apos;Asia/Kolkata&apos;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;astimezone&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;tz&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;pytz&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;timezone&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&apos;Europe/Vienna&apos;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;strftime&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&apos;%H:%M:%S&apos;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;.&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now we are really starting to hurt readability if we insist on not using any local variables.
We can strike a compromise.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;python&quot;&gt;&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Trying to minimise local variables&lt;/span&gt;
now &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; datetime&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;datetime \
        &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;now&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;tz&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;pytz&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;timezone&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Asia/Kolkata&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; \
        &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;astimezone&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;tz&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;pytz&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;timezone&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Europe/Vienna&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string-interpolation&quot;&gt;&lt;span class=&quot;token string&quot;&gt;f&quot;The time is &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;now&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;strftime&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&apos;%H:%M:%S&apos;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;.&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;But what do I hold against local variables? Why am I putting so much effort to avoid them?
Once you declare a variable like &lt;code class=&quot;language-text&quot;&gt;number_of_players&lt;/code&gt; or &lt;code class=&quot;language-text&quot;&gt;now&lt;/code&gt;, you make it available to the entire scope of this code.&lt;br&gt;
Any other developer now making a change or feature improvement to the function would just use this afterwards because it already exists.
It would not be considered good practice to re-declare this if it exists, would it?
If your function is lengthy, the variable declaration is now far from its usage.
I really am measuring the physical distance between two lines of code here.
This is what I am trying to optimise for.
When maintaining or debugging or trying to understand a piece of code, it really is essential to consider how much abstract visualisation of code flow you can do.
It helps if you can read an independent module without scrolling.
If some variables that are being used in your current view are declared far away, you are not staring at an independent module.
Being able to jump around using modern IDE tools is only going to help your thought process so much.
Maybe it is just me being stupid me, but I place immense value in seeing everything I need to know without jumping around definitions or scrolling.
How about we do this?&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;python&quot;&gt;&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# What are functions for?&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;now&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; datetime&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;datetime \
            &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;now&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;tz&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;pytz&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;timezone&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Asia/Kolkata&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; \
            &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;astimezone&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;tz&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;pytz&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;timezone&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Europe/Vienna&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        
&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string-interpolation&quot;&gt;&lt;span class=&quot;token string&quot;&gt;f&quot;The time is &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;now&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;strftime&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&apos;%H:%M:%S&apos;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;.&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;We can use the function &lt;code class=&quot;language-text&quot;&gt;now()&lt;/code&gt; anywhere we need, as far as we want—no need to re-declare it.
Wait, what&apos;s the difference?
This is pretty much the same.
What difference did wrapping it in a function make?
Well, in practice, we would give the function a better name, &lt;code class=&quot;language-text&quot;&gt;now_ist_to_cest&lt;/code&gt;.
This would make the purpose of the function clear.
We should aim to use it as a black box without worrying about its definition.
There is no need to jump around or scroll up.
This is still not an advantage over a variable. What is?
Variables can change midway. Functions cannot.
(In theory, functions can too, especially in a language like Python where I am drawing my examples.
In practice, this is less likely.)
Variables, however, are dangerous.
You may run into unexpected state changes.
The variable may be passed into another function by reference which could be modifying it unintentionally.
And that! would! be! a! BUG! Thus we have arrived at the point of this blog post.
Avoid using local variables if they have to be used &lt;em&gt;far&lt;/em&gt; from their definition.
Wrap them as functions.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Classification of Bugs: Chapter 1 - Null and Empty]]></title><description><![CDATA[Introduction I am not the best programmer in the world. I wouldn't know or care to know what it means to be that. Are you the fastest to…]]></description><link>https://kumar-ayush.com/blog/bugclass_ch1/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/bugclass_ch1/</guid><pubDate>Thu, 09 Apr 2020 23:52:02 GMT</pubDate><content:encoded>&lt;h3&gt;Introduction&lt;/h3&gt;
&lt;p&gt;I am not the best programmer in the world. I wouldn&apos;t know or care to know what it means to be that. Are you the fastest to implement a feature? Are you handy with multiple languages and frameworks? Is your code the most bug-free? Is it the most readable code? All of the above? I don&apos;t know. People have written &lt;a href=&quot;https://twitter.com/skirani/status/1149302828420067328&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;potential descriptions&lt;/a&gt;. Judge for yourself. I am deviating... &lt;em&gt;deep breath&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The point is - if there is one developer skill that gives me an adrenaline rush that makes me project myself as Sherlock Holmes in my head, it is debugging. I am a sucker for bugs. I will drop everything to help you if I find out you have a pest problem with your software. I am not always helpful, but it is an aspiration to be the best debugger there ever was. After gdb, of course.&lt;/p&gt;
&lt;p&gt;This aspiration has led me to refine my debugging practice into a system. I am not the first person to write about this. However, people usually preach about tools and techniques to find bugs faster and robustly fix them. All that&apos;s good, but let me be more specific about what gives me the high - guessing the source by looking at the symptom, without looking at the code. When I open the code and a debugging tool, it should be only to verify my hypothesis. My practice is to maintain a mental database of common programming styles. Guess the architecture, then guess the source of bug based on common mistakes within the architecture. Maybe somebody has already made a super exhaustive list for this as well. The worldwide web is quite wide. But anyway, this blog series is an attempt to write down my database for mostly my own reference.&lt;/p&gt;
&lt;h3&gt;Null and Empty are not the same&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Problem domain&lt;/strong&gt;: Filtering data&lt;br/&gt;
&lt;strong&gt;The error&lt;/strong&gt;: Treating nulls and empties as equals&lt;br/&gt;
&lt;strong&gt;The symptom&lt;/strong&gt;: Data leaks in/out of your pipeline.&lt;/p&gt;
&lt;p&gt;You know this. Everyone seems to know this, at least when you say it out loud. Yet, I keep seeing this. To reiterate the concept, in programming languages, at least the common ones, there is a difference between &lt;em&gt;null&lt;/em&gt; and &lt;em&gt;empty&lt;/em&gt; or &lt;em&gt;0&lt;/em&gt;. I won&apos;t go into type theory because I don&apos;t know it well. It&apos;s not required to understand this. A &lt;em&gt;null&lt;/em&gt; variable does not have a value. A variable set to an empty string has a value - it&apos;s nothing. Maybe a numeric variable example is more natural to emphasise this. A variable holding the value 0 is not the same as a null variable.
In most languages, null has its separate place in the type system. You cannot perform the same set of operations on it. It is well distinguished. In Python, you cannot do &lt;code class=&quot;language-text&quot;&gt;&apos;2&apos; + None&lt;/code&gt;, you get a &lt;code class=&quot;language-text&quot;&gt;TypeError&lt;/code&gt;. But for JavaScript, &lt;code class=&quot;language-text&quot;&gt;&apos;2&apos; + null&lt;/code&gt; gives you &lt;code class=&quot;language-text&quot;&gt;&apos;2null&apos;&lt;/code&gt;. There is also a &lt;a href=&quot;https://softwareengineering.stackexchange.com/questions/12777/are-null-references-really-a-bad-thing&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;huge debate around null references.&lt;/a&gt; Let me clarify this is along the same lines conceptually but unrelated to the problem domain.&lt;/p&gt;
&lt;p&gt;Data pipelines are potentially humongous these days. A developer working on one section of the pipe may often have little attention to the details of sections upstream and downstream. This lack of context is not the problem. It&apos;s a good thing. You should not have to understand everything about a codebase to work with it. Data pipelines are nothing special. The problem is lack of discipline in dealing with null data cells.&lt;/p&gt;
&lt;p&gt;Imagine a scenario. You are working with a dataset which has a column representing a person&apos;s name. You want to extend the dataset with a column holding the person&apos;s address. You are using a function &lt;code class=&quot;language-text&quot;&gt;getAddress(name)&lt;/code&gt; which returns the person&apos;s address given the name. You try this out, and you find that the function &lt;code class=&quot;language-text&quot;&gt;getAddress&lt;/code&gt; throws if the name is null. You have no control over the
data or the function. You look at the data, and you say, &quot;Well, maybe we should just throw out the rows which have a null name.&quot; It&apos;s not that unreasonable. The few rows are either garbage or irrelevant or so few that you don&apos;t care. Maybe the broad purpose of your software is voided if there is not a valid name for a data row. You put a filter, filtering out nulls. Everything is good.&lt;/p&gt;
&lt;p&gt;A few epochs later, the software starts breaking. You are a different developer than earlier. You trace the problem to the &lt;code class=&quot;language-text&quot;&gt;getAddress(name)&lt;/code&gt; function. It turns out that when &lt;code class=&quot;language-text&quot;&gt;name&lt;/code&gt; is an empty string, the &lt;code class=&quot;language-text&quot;&gt;getAddress (name)&lt;/code&gt; function returns null. Later in the pipeline, a null address breaks a few things. You see the filter for rows with a null name. It&apos;s right there. What do you do? You add an OR condition to the filter, also removing rows that have the name as an empty string. What happens now? Well, the developer who was responsible for generating the data you are reading would fill an empty string when the name is unknown. The null names were true errors, but empty string names were information. Inevitably, some rows leak and someone has to come back to this code and fix it again. What could have been different? Well, fix the &lt;code class=&quot;language-text&quot;&gt;getAddress(name)&lt;/code&gt; function or write a wrapper around it. Upstream data ingestion should have documentation that specifies what an empty name string means and more importantly, the developer fixing the downstream pipeline should care to read it. That&apos;s not the point. You&apos;ll easily find yourself in a situation where you do not have control over externalities. You must deal with it in the downstream code. Even then, maybe there should be a null address filter. Maybe there should be more careful reviews for data filters such that possible leakages are identified before they occur. That&apos;s not the point either. This is not a programming practices or styles lecture. This is a diagnosis lecture. You&apos;ll look for filters when you find data leaking. But when there are a lot of them (filters) and the leakage is mysterious, have a keen watch for filter statements which are too aggressive with empty values when they should ideally be restricted to nulls.&lt;/p&gt;
&lt;p&gt;The address and name story was only one example. Data that should be filtered out can start leaking &quot;in&quot; your set as well. You were filtering everything null, but the upstream designers started using empty or &quot;impossible&quot; values to denote erroneous measurements. For example, maybe it is a row that measures the height of a human being. No human being would have a height equal to 0 cm, so they find it perfectly acceptable to put that number since it&apos;s &quot;understood&quot;. But that&apos;s for humans. The code is dumb. Unless there is explicit code that sets reasonable limits on human height, it is just another numeric value, and an invalid measurement is best represented as a null. Gosh, this is sounding more and more like a rant. It&apos;s not meant to be, I am sorry. Let me put the moral of the story very simply and wrap this up - Stay on the lookout for code that filters on null/empty values when you have data leakages.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Die Gstettensaga: The Rise of Echsenfriedl - Film Commentary]]></title><description><![CDATA[In this post, I am going to comment on "Die Gstettensaga: The Rise of Echsenfriedl". I will definitely steer away from any explicit spoilers…]]></description><link>https://kumar-ayush.com/blog/gstettensaga/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/gstettensaga/</guid><pubDate>Sun, 19 Jan 2020 17:06:07 GMT</pubDate><content:encoded>&lt;p&gt;In this post, I am going to comment on &quot;Die Gstettensaga: The Rise of Echsenfriedl&quot;. I will definitely steer away from any explicit spoilers and try my best to avoid any implicit ones. I want you to watch this. If your usual cup of tea is pop cinema, this would be an experience. It is an Austrian indie film. It is &lt;a href=&quot;https://www.youtube.com/watch?v=qjEzckLBazY&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;available on YouTube&lt;/a&gt; with subtitles which form an essential part of the story. Please do not ask me how I came about this.&lt;/p&gt;
&lt;p&gt;This film has a gripping plot among its absurdist humour. Art, by its very nature, is finding and locking patterns in the randomness of the universe. It&apos;s the same as when a sculptor reveals a sculpture in an arbitrarily shaped rock. There is plenty of critiques which I will not bother to repeat. In summary, it is a multi-layered dark humour sci-fi film. Let us jump to what I have to add.&lt;/p&gt;
&lt;p&gt;While rewatching it for the fourth time recently, I came upon an intriguing feature of the film. It makes the audience feel the emotions that the protagonists are feeling. This is, of course, not the most obscure idea in filmmaking. It is, in fact, a basic tenet of performance; music, dance or drama. However, &quot;Die Gstettensaga&quot; draws this idea to its extremes. In the opening scene, the protagonists are waiting for their appointment in a large hall. They are impatient. The scene goes on for a total of 2 minutes where nothing happens. The audience is waiting too. They, too, are getting restless. Later on, when the protagonists encounter a language they do not comprehend, the subtitles vanish. There are many more such ideas throughout which I&apos;ll leave you to discover for yourself.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[What is worth doing?]]></title><description><![CDATA[Why does haute couture exist? We frequently make fun of models that wear absurd designs and walk the runways. "Who wears these?" we say. Why…]]></description><link>https://kumar-ayush.com/blog/worthofthings/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/worthofthings/</guid><pubDate>Fri, 10 Jan 2020 16:59:58 GMT</pubDate><content:encoded>&lt;p&gt;Why does haute couture exist? We frequently make fun of models that wear absurd designs and walk the runways. &quot;Who wears these?&quot; we say. Why is such a large amount of money spent on something worthless? Well, I am going to argue that this is no different than copious amounts of funding paid to scientific research. If you&apos;re convinced of the latter, you must agree to the former. You may be scratching your head or searching for mine. Maybe you want to bonk me on the head and bring me back to my senses. But, allow me to make my case.&lt;/p&gt;
&lt;p&gt;I see a common thread among the two. Haute couture and scientific research are both forming concentrated forms of abstract ideas. They are brewing stones, powdered concentrates out of the boiling pot of absurdity. It is not random. Scientists would pass on their knowledge to industrial researchers and engineers who would make products out of them. The original ideas would be used in a diluted form.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;image left&quot;&gt;&lt;img src=&quot;https://assets.vogue.com/photos/5a88725271dfb1796196f571/master/pass/cara-d-burberry-promo.jpg&quot; alt=&quot;cara delevingne pride flag&quot;&gt;&lt;/span&gt;
Have a look at this picture of Cara Delevingne wearing a rainbow fur coat demonstrating alliance with the Pride movement. Are they going to see someone wearing this in your local pub? Probably not. But you have probably already seen the rainbow flag mastered on casual wear. They are plastered across the chest or sleeves of your garden-variety tees and sweaters. Mass production shops took the extreme idea in moderation and served it to you.&lt;/p&gt;
&lt;p&gt;Quantum Mechanics was an abstract idea a century ago. Its imagined applications were absurd, rule-bending. A century later, we are getting closer and closer to those fantasies. But meanwhile, perhaps the most common use of it today is in solid-state devices. The processor in your computing device, the detector in the camera on that device are all excellent examples.&lt;/p&gt;
&lt;p&gt;Have I led you to believe that it is more worth doing abstract things which millions can inspire from? If so, that is not the intent. I&apos;ll remind you of a &lt;a href=&quot;https://science.sciencemag.org/content/177/4047/393&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;1972 article &quot;More is Different&quot; by Paul Anderson.&lt;/a&gt; He argues against the reductionist philosophy. &quot;Psychology is not applied biology, nor is biology applied chemistry&quot; he notes. At each stage of this dilution of ideas, nuances arise which require just as complex human effort as the most abstract stage. It takes a diluted form of a pure idea as one input. It is not its entire identity. The invention of camera sensors requires an engineer&apos;s version of quantum mechanics, yes. But that is not sufficient knowledge to reconstruct the device from scratch.&lt;/p&gt;
&lt;p&gt;So, what is worth doing? Everything.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Uber Economy in India]]></title><description><![CDATA[I have wanted to write about this subject for a while. The primary inertia in these kinds of bits comes from the effort to link references…]]></description><link>https://kumar-ayush.com/blog/taxieconomy/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/taxieconomy/</guid><pubDate>Thu, 14 Nov 2019 19:33:20 GMT</pubDate><content:encoded>&lt;p&gt;I have wanted to write about this subject for a while. The primary inertia in these kinds of bits comes from the effort to link references which give the reader enough background before I put my simple point. Lucky for me, less than 24 hours ago, New Jersey imposed a fine of $649 million on Uber for treating drivers as independent contractors as opposed to counting them as its employees. This &lt;a href=&quot;https://www.nytimes.com/2019/11/14/nyregion/uber-new-jersey-drivers.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;NYT article&lt;/a&gt; sums up the necessary background pretty well.&lt;/p&gt;
&lt;p&gt;The issue, in summary, is that Uber treats its drivers as independent businesses. Uber&apos;s role is to connect them to their customers. In other words, your business model is a platform to connect buyers to sellers, much like Amazon or Alibaba. The service being sold here is ride-sharing. As Uber would claim, this is different than being a business where you employ drivers to taxi people in return for money. There are plenty of reasons for this. The tangible assets (cars) of the company&apos;s operations are not owned by Uber. The hours of work are not determined by Uber. However, there are counterarguments.&lt;/p&gt;
&lt;p&gt;Uber is the primary source of income for most of their drivers. Hence, from their perspective, for all practical purposes, Uber is their employer and owes them employment benefits. These include unemployment insurance and minimum wage guarantee. The NJ Department of Labor and Workforce Development used such arguments for their judgement. I am not in a position to agree or disagree with this. Instead, I find the locality of arguments interesting. Uber being the primary source of income for few is not entirely caused by the existence of Uber but is an outcome of many other facets of the economy and is not a predictable result.&lt;/p&gt;
&lt;p&gt;Let us look at India in contrast. You have Ola, a homebred ride-sharing service which has the &lt;a href=&quot;http://www.businessworld.in/article/Ola-Vs-Uber-Vs-Meru-Vs-Mega-Cabs-Numr-Research-Finds-Out-Which-Taxi-App-Indians-Prefer/23-06-2019-172499&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;same if not higher the market share to Uber&lt;/a&gt;. Both Ola and Uber also have three-wheeler auto-rickshaw services available in major cities. These used to be the traditional form of public transport in most cities, often overpriced, and they brought along the joy of haggling.  Uber/Ola set their prices based on their perception of supply/demand. Their price for an auto-rickshaw service is immensely lower than what you can bargain for directly with the driver. I would argue that is good value added to society. So in some sense, their presence got us a full circle into disciplining auto-rickshaws which public outcry could not. Just the presence of an alternative pushes auto-rickshaws not to overprice their services. But this is not all.&lt;/p&gt;
&lt;p&gt;The competition of Ola/Uber makes this better. Most drivers, auto-rickshaw or car, have both Ola and Uber apps and would switch based on whatever is working better for them economically at the time of day. They decide to cancel the rides if the destination and price are not suitable to them. If one of them tries to penalise this behaviour, they can immediately switch to the other app. It forces an unfavourable equilibrium for the rider. If all passengers are using the other app, your chances of getting a ride are higher with that service. This is in addition to the risk of being cancelled if the driver does not like your destination. This is an even better game for autos. They can simply not use the app and quote their own prices when that is more favourable to them. These are real scenarios, e.g. late at night outside a club. You really need a ride home, and you&apos;re simply not in a mood to argue.&lt;/p&gt;
&lt;p&gt;This...I don&apos;t know...seems more like an ecosystem with independent businesses rather than employees. A lot of car drivers are employed with small companies which lend commute services to IT firms, such as MoveInSync and RouteMatic. These commute trips earn them more than Uber/Ola would, but they don&apos;t have to or get to make these trips all day. For the remaining time, they can switch on their favourite app and score some rides.&lt;/p&gt;
&lt;p&gt;That&apos;s all folks! Gotta catch my Uber to work now!&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Hack InOut 6.0]]></title><link>https://kumar-ayush.com/blog/beetlegoose/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/beetlegoose/</guid><pubDate>Fri, 01 Nov 2019 10:43:24 GMT</pubDate><content:encoded>&lt;p&gt;Hello readers! Meet and I participated in the 6th edition of &lt;a href=&quot;https://hackinout.co&quot;&gt;Hack InOut&lt;/a&gt; this year.
It was very convenient as both of us are now employed in Bengaluru. 
We took a repeat shot at our augmented reality venture that was &lt;a href=&quot;/projects/bellatrix/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Bellatrix&lt;/a&gt;.
I recommend reading that tiny post before you read this post, but it is not critical to understanding the following.
&lt;/p&gt;
&lt;h4&gt;The Challenge&lt;/h4&gt;
&lt;p&gt;Think of it like you&apos;re making a gaming hardware. Your display is a screen that is being projected upon.
Your input is an object hitting the screen and a camera detecting the point hit. An alternative method of detecting the point hit is using a LIDAR as in [INITI Playgroundz project](http://www.initi.org/workss/demonz-i-installation-for-kids-prague-handball-cup-2016).
We want(ed) to achieve the camera-based detection because it then opens the road to easy installation by anyone who has a projector and camera the quality of which comes in your phone. In theory, you could use your phone camera indeed.&lt;/p&gt;
&lt;p&gt;When we had attempted this problem in the name of Bellatrix, we had two significant problems:
&lt;ul&gt;
    &lt;li&gt;You think you can detect the ball via the difference of the frame that the camera detects and what we know is projected. However, the projector has an intense (in the literal meaning of high intensity) color emissivity. This means that the camera does not see the ball in its natural colour. It sees a ball colour graded by the projected frame. This makes it very difficult to discern the ball from the background.
        Sure, you could make arguments that the projection on the ball is &lt;i&gt;warped&lt;/i&gt; and so on but you have to keep in mind that we&apos;re working with a low-resolution RPi camera. Such effects are also harder to distinguish.
We were heavily relying on the ease of detecting a bright blob in heavily ambiguous video feeds. We put all our eggs in this one basket which had a big hole in it.&lt;/li&gt;
    &lt;li&gt;The key computation in the project is taking the difference of the frame the camera reads and the frame you project. The read operation requires several transformations which are heavy enough to drop your framerates to about 5 fps. That game is not likely to be a fun experience to play.&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;
The way we tackled both of those issues in Bellatrix is by making our game a dartboard with a white background and the board was drawn with extra light font. This makes it easy to detect the ball &lt;b&gt;and&lt;/b&gt; you do not need a high frame rate for this game. The judges were impressed. It worked. &lt;br /&gt;
This time around, we wanted to improve on these areas. Spoiler here is that we made zero improvements on the ball detection and miserably failed after making a colourful game. Even the poor but working algorithm from Bellatrix failed. We ended up one step behind on this front. Anyway, this post is more about glorifying what we &lt;i&gt;did&lt;/i&gt; achieve rather than did not so here goes.
&lt;/p&gt;
&lt;p&gt;
We had an RPi 4 which turns out to hold 4 cores. The algorithm is simple. &lt;ol&gt;
    &lt;li&gt;Mark each frame with a unique binary code. We colored the four corners in a particular way, so you get 1 to 16.&lt;/li&gt;
    &lt;li&gt;The camera read and render are running on separate processes. The rendering process writes 16 frames in a looping fashion to a shared mem object. &lt;/li&gt;
    &lt;li&gt;Assuming your read is not lagging by more than 16 frames, you can pick the projected frame from the shared mem and do a diff (which is done via a third process)&lt;/li&gt;
    &lt;li&gt;The diff process will send the location of the hit point when it has it to the render process which can then include it in the game logic&lt;/li&gt;
&lt;/ol&gt;
This worked beautifully. We could churn out 30 fps and more throttled only by the occasional overheating of the RPi. However, the whole thing together was a disaster since we could not detect the bright yellow ball flying across. What would we do differently next time?
&lt;/p&gt;
&lt;p&gt;
&lt;ul&gt;
    &lt;li&gt;Perhaps focus on the CV algorithm as its own thing, take images in various light conditions and perfect this separately&lt;/li&gt;
    &lt;li&gt;Try to tune the RPi camera more manually. The read colour versus the write colour was obviously different. We did turn off AWB and set a manual shutter speed, but we could have done a better job of selecting the manual WB.&lt;/li&gt;
    &lt;li&gt;Get a fan for the RPi OR get a more production-ready, less hobby friendly motherboard.&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;
I take extreme pride in returning to old problems after learning new techniques. That means this is not over. Until next time...
&lt;/p&gt;
&lt;p&gt;Thanks to _Meet Udeshi_ for working with me on this project. Our github repository can be found &lt;a href=&quot;https://github.com/cheekujodhpur/beetlegoose&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Undergrad Memoir]]></title><link>https://kumar-ayush.com/blog/undergrad-memoir/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/undergrad-memoir/</guid><pubDate>Fri, 12 Jul 2019 11:08:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;i&gt;The following article was written for and published in Physics Depart Newsletter at IIT Bombay. Requested and edited by Toshi Parmar. Co-authored by Sandesh Kalantre&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;
(Ayush is a financial analyst at Goldman Sachs, Bengaluru. Sandesh is a graduate research assistant in condensed matter physics at the University of Maryland, College Park. They both received their undergraduate degree in Engineering Physics (class of 2018) at IIT Bombay. This article is a  personal memoir of their beloved department, their life as EP students and everything around it.)
&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;
Engineer? Physicist? Err… Engineering Physicist? In hindsight, it would be an understatement to say that the past four years have been more about discovering ourselves than anything else. Given the humdrum reality of scientifically inclined teenagers in India, it was no wonder, we both ended up being at an engineering institution, for us, that being our beloved ‘insti’, IIT Bombay. Nevertheless, it was the Engineering Physics program that got us the best of both worlds, the security of much sought after a degree from an IIT and a way to satiate our curiosity in physics and mathematics.
&lt;/p&gt;
&lt;p&gt;
We were both attracted to this strangely sounding programme at IIT Bombay because of our love for physics and mathematics from high school. For Ayush, it was “partly because Prof. Varun Bhalerao said it’d be a good idea, partly because there was some family pressure to join an IIT rather than IISc which was my next best option, and partly because Sandesh too chose IITB”. It’s probably incorrect to listen to others or do as your friends are doing, but if you’ve chosen the people and the friends well, it’s not as bad as many make it sound. 
&lt;/p&gt;
&lt;p&gt;
Education in physics is a strange thing to define. It’s challenging to draw borders in what constitutes physics and what does not. The study of stars, galaxies and black holes does belong to the realm of physics, but so does getting an operational amplifier to work in a lab. Statistical physics of gases is used to analyze the workings of earthly things like metals or superconductors to astronomical objects like white dwarfs. But more crucially so, the same ideas show up in the study of financial markets. The brilliant platter of physics courses at IITB got to us the nitty gritty details of all the above ideas. But more so, it was the wisdom about the interconnections of science and an appreciation of all things, physics or not, that we learned during our stay here stays with us today.
&lt;/p&gt;
&lt;p&gt;
Receiving education as an undergraduate is never a solitary activity. IITB is no exception. The general idea was that IITB would offer a better and varied peer which is important for undergraduate education. We were not just joining to learn Physics. We were joining to learn how to live a life. And the variety along with the intensity of experiences matters a lot for the latter. Did we know all of this going in, or did it come with four years of retrospect? Or something in between like for Ayush - “I don’t know, I have a bad memory but if I were to guess I’d say yes I did know this going in”.
&lt;/p&gt;
&lt;p&gt;
Coming from Pune and Jodhpur to Mumbai meant we were going to away from a homely environment. Though we were no longer at home, a new home itself came to us as we progressed through the years, the department. We recall a department introduction session for freshmen, which involved professors giving short descriptions of their work. We started with the senior most professors first, and as we progressed through the introductions, a happy coincidence occurred. The younger professors were, in fact, students of the older ones. After three or so such generations, came the youngest freshmen in the room, the actual students. The department constituted of a significant fraction of such alumni professors, which made being associated with the place quite rewarding. They had a sense of gratitude towards it and an anchor to their past when they were students. That’s what made them so relatable to us and vice versa. A multitude of interactions with them made us into members of a very ‘homely’ tradition, which we hope to keep up where we go. 
&lt;/p&gt;
&lt;p&gt;
Categorizing the physics department as a home is incomplete without talking about the computer lab and the department library. These two places have been fortuitously available for use to all department students during recent years. Open 24x7, they often vacillated between the hustle and bustle of a noisy cafe to a place of necessary solitude for academic work. Well, what makes a college a good college is its collegiality. We spent many weekend mornings there, over coffee and an assorted set of crazy ideas about physics or everything else. Ayush spent many sleepless nights doing hackathons, completing reports and so on. The library also doubled up as a visitor office which meant we could meet other students and professors. These rooms brought people and ideas together and they continue to do so today.
&lt;/p&gt;
&lt;p&gt;
At the end of our stay here, we diverged onto two different paths - as a financial analyst and as a graduate student in physics. For Ayush, he “never understood why people call my job as the ‘non-core’ sector. Broadly speaking, EP has partly applied math and experimental physics. Sure, I don’t use the latter in my job, but I use or see the use for most of the other skills that I learnt in the former. The interesting part of studying nature was the intellectual process. In physics, the fight is against the rules of nature, while in finance it is against the rules of humans. It is this challenge that excites me to work, every day.” As for Sandesh, “it was the same love for physics that brought me at IITB takes me to the lab almost every day as a graduate student. In our respective jobs, we still do the same thing we were taught so well at IITB, we make models and solve problems - either on exotic superconductors or the financial market is a matter of taste and details.” 
&lt;/p&gt;
&lt;p&gt;
As we look forward to our jobs for tomorrow - either measure a sample at ultra-low temperatures or use the Black-Scholes pricing model, all of it would be impossible without our education as an Engineer and as a Physicist and as much more during our stay here. Hindsight is always 20/20, and getting an EP degree was the best thing to do.  If we could rewind 4 years and could choose a different route, would we? Absolutely for one, and even perhaps do it once more so. Thank You!
&lt;/p&gt;</content:encoded></item><item><title><![CDATA[The Essence of Monte Carlo]]></title><link>https://kumar-ayush.com/blog/on-monte-carlo/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/on-monte-carlo/</guid><pubDate>Sun, 10 Jun 2018 22:51:00 GMT</pubDate><content:encoded>&lt;p&gt;
[Eric Veach](https://en.wikipedia.org/wiki/Eric_Veach) wrote his thesis on [&quot;Robust Monte Carlo Methods for Light Transport Simulation&quot;](https://graphics.stanford.edu/papers/veach_thesis/thesis-bw.pdf). This is a famous piece of work, considered a groundbreaking work in rendering and ubiquitous among graphics researchers and professionals. On page 12, there is a sentence which reads
&lt;/p&gt;
&lt;blockquote&gt;
The principle of Monte Carlo methods is not that the samples are truly random, but that random samples could be used in their place.
&lt;/blockquote&gt;
&lt;p&gt;
It took me some time to understand what he means, and I am still not sure if I have interpret it well, but pay attention to the following piece of code, using two slightly different functions to compute the value of $\pi$ and see if you see my point.
&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;py&quot;&gt;&lt;pre class=&quot;language-py&quot;&gt;&lt;code class=&quot;language-py&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; numpy &lt;span class=&quot;token keyword&quot;&gt;as&lt;/span&gt; np                                                              
                                                                                
&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;mc1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;N&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;                                                                     
    c &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;                                                                       
    N &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;N&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;                                                                  
    &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; i &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;N&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;                                                          
        x &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; np&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;random&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;random&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;                                                  
        y &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; np&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;random&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;random&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;                                                  
        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;x&lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;y&lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.25&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;                                      
            c &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; c&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;                                                             
                                                                                
    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;4.0&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;c&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;/&lt;/span&gt;N                                                       
                                                                                
                                                                                
&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;mc2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;N&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;                                                                     
    c &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;                                                                       
    _N &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;np&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;sqrt&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;N&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;                                                        
    &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; i &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;_N&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;                                                         
        &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; j &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;_N&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;                                                     
            x &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;i&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;/&lt;/span&gt;_N                                                     
            y &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;j&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;/&lt;/span&gt;_N                                                     
            &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;x&lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;y&lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.25&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;                                  
                c &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; c&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;                                                         
                                                                                
    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;4.0&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;c&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;_N&lt;span class=&quot;token operator&quot;&gt;*&lt;/span&gt;_N&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;                                                 
                                                                                
&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt; mc1&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1e1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; mc2&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1e1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;                                                        
&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt; mc1&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1e2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; mc2&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1e2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;                                                        
&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt; mc1&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1e3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; mc2&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1e3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;                                                        
&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt; mc1&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1e4&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; mc2&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1e4&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;                                                        
&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt; mc1&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1e5&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; mc2&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1e5&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;                                                        
&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt; mc1&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1e6&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; mc2&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1e6&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;                                                        
&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt; mc1&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1e7&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; mc2&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1e7&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;
which generates the output
&lt;/p&gt;
&lt;pre&gt;3.2 1.77777777778
3.16 2.76
3.148 3.08012486993
3.132 3.13
3.1404 3.14088287133
3.14302 3.1413
3.1420544 3.14153285317
&lt;/pre&gt;
&lt;p&gt;The true value of $\pi$ upto 5 decimal places is $3.14159$.&lt;/p&gt;
&lt;p&gt;My two cents!&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Spam Slam]]></title><link>https://kumar-ayush.com/blog/spamslam/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/spamslam/</guid><pubDate>Thu, 07 Jun 2018 03:12:00 GMT</pubDate><content:encoded>&lt;p&gt;
Oops! This blog is posted as a guest article on another site. Please [click here](https://devfolio.co/blog/spamslam-a-blockchain-solution-to-less-spam/) to redirect yourself.
&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Copy Constructor Magic]]></title><link>https://kumar-ayush.com/blog/copy-constructor-magic/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/copy-constructor-magic/</guid><pubDate>Sun, 20 May 2018 12:42:00 GMT</pubDate><content:encoded>&lt;script markdown=&quot;0&quot; src=&quot;https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js&quot;&gt;&lt;/script&gt;
&lt;p&gt;&lt;i&gt;This post is co-authored with &lt;a href=&quot;http://udiboy1209.github.io/&quot;&gt;Meet Udeshi&lt;/a&gt;.&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;Examine this piece of code. It has two classes `foo` and `bar`, `bar` has an instance of `foo` and a function which fetches a new instance of `foo`, but the local variable in the function uses the same name as the member instance of `foo` in `bar`. This is allowed, `-Wshadow` will provide you a warning. But it is understood that this can result in unexpected or garbage output.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;cpp&quot;&gt;&lt;pre class=&quot;language-cpp&quot;&gt;&lt;code class=&quot;language-cpp&quot;&gt;&lt;span class=&quot;token macro property&quot;&gt;&lt;span class=&quot;token directive-hash&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;token directive keyword&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&amp;lt;iostream&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;namespace&lt;/span&gt; std&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
                                                                                
&lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;                                                                      
    &lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt; x&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;y&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;z&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;                                                                  
                                                                                
    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt;                                                                     
    &lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;gx&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; x&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;                                                        
    &lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;gy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; y&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;                                                        
    &lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;gz&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; z&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;                                                        
    &lt;span class=&quot;token function&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt; _x&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt; _y&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt; _z&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;_x&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;_y&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;_z&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;                              
                                                                                
    &lt;span class=&quot;token comment&quot;&gt;/*foo(const foo &amp;amp;kk){                                                       
        x = kk.x;                                                               
        y = kk.y;                                                               
        z = kk.z;                                                               
    }*/&lt;/span&gt;                                                                         
                                                                                
    &lt;span class=&quot;token keyword&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;                                                           
        cout &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;x: &quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; x &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;, &quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;y: &quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; y &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;, &quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;z: &quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; z &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
                                                                                
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;                                                                           
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;                                                                              
                                                                                
&lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;bar&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;                                                                      
    foo doo&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;                                                                    
                                                                                
    &lt;span class=&quot;token keyword&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt;                                                                     
    &lt;span class=&quot;token function&quot;&gt;bar&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;foo _doo&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;doo&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;_doo&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;                                                  
    foo &lt;span class=&quot;token function&quot;&gt;scoo&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;                                                             
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;                                                                              
                                                                                
                                                                                
foo bar&lt;span class=&quot;token double-colon punctuation&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;scoo&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;                                                            
    foo &lt;span class=&quot;token function&quot;&gt;doo&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;doo&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;gx&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; doo&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;gy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; doo&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;gz&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;                                      
    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; doo&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;                                                                 
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;                                                                               
                                                                                
&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;                                                                     
    bar &lt;span class=&quot;token function&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;                                                        
                                                                                
    &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;int&lt;/span&gt; i &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;i&lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;i&lt;span class=&quot;token operator&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;                                                     
        obj&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;scoo&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;                                                     
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;                                                                           
    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;                                                                   
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The above code, for example gives the following output. &lt;i&gt;g++ -O0 -std=c++11&lt;/i&gt; with &lt;i&gt;g++ 5.4&lt;/i&gt;&lt;/p&gt;
&lt;pre&gt;x: 6299752, y: 0, z: -19107175
x: -19107175, y: 0, z: 4197253
x: 4197253, y: 0, z: 4197253
x: 4197253, y: 0, z: 4197253
x: 4197253, y: 0, z: 4197253
&lt;/pre&gt;
&lt;p&gt;Well, what were we thinking? What we have done is b******t and we get that for the output! Just a moment though, uncomment the explicit definition of the copy constructor for class `foo` and here is what you get&lt;/p&gt;
&lt;pre&gt;x: 1, y: 1, z: 1
x: 1, y: 1, z: 1
x: 1, y: 1, z: 1
x: 1, y: 1, z: 1
x: 1, y: 1, z: 1
&lt;/pre&gt;
&lt;p&gt;That is the magic that I had to show you. Now we shall investigate where it comes from. The copy constructor definition that we put in place is equivalent to the default copy constructor that gcc would provide. What is different here? To help me further with this issue, I brought in help from Meet. Most of the following is written by him, with a few minor edits by me.&lt;/p&gt;
&lt;h6&gt;Basics of X86 assembly&lt;/h6&gt;
&lt;p&gt;
The syntax is called &quot;intel&quot; syntax
which is basically `inst dest, source`.
&lt;/p&gt;
&lt;p&gt;
There are various addressing modes in X86 for either source or destination.
They can either be a register (inside the processor) or a memory location (in RAM),
or a name of some register.
&lt;/p&gt;
&lt;p&gt;
Memory locations are written inside square brackets. They can be static, or dynamically computed using an expression based on registers.
&lt;/p&gt;
&lt;p&gt;
Registers are named `e**` and `r**`. When same last two letters of
such two registers, they refer to the whole register and 32-bit section.
Example: `eax` is 64-bit register, and `rax` refers to 32-bit MSB of `eax`.
So if you store a value in `eax` and read from `rax`, you will get higher
32 bits of the number stored. This was done as an addition for 64-bit processors over 32-bit processors (and also backward compatibility reasons).
&lt;/p&gt;
&lt;p&gt;
Basic instructions are `mov` which *copies* value from source to destination,
`lea` or load effective address which copies memory address of the source
memory location to destination (much like creating a pointer),
`call` which is responsible for calling functions.
&lt;/p&gt;
&lt;p&gt;
Special purpose registers are `rsp` and `rbp` which are stack pointer
and stack-base pointer or frame pointer. They store the location of the stack for
the function.
&lt;/p&gt;
&lt;h6&gt;What goes wrong when shadowing&lt;/h6&gt;
&lt;p&gt;
This is the assembly implementation of function bar::scoo()
&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;push   rbp
mov    rbp,rsp
push   r12
push   rbx
sub    rsp,0x40
mov    QWORD PTR [rbp-0x38],rdi
mov    rax,QWORD PTR fs:0x28

mov    QWORD PTR [rbp-0x18],rax
xor    eax,eax
lea    rax,[rbp-0x30]
mov    rdi,rax
call   b28 &amp;lt;_ZN3foo2gzEv&amp;gt;
mov    r12d,eax
lea    rax,[rbp-0x30]
mov    rdi,rax
call   b16 &amp;lt;_ZN3foo2gyEv&amp;gt;
mov    ebx,eax
lea    rax,[rbp-0x30]
mov    rdi,rax
call   b06 &amp;lt;_ZN3foo2gxEv&amp;gt;
mov    esi,eax
lea    rax,[rbp-0x30]
mov    ecx,r12d
mov    edx,ebx
mov    rdi,rax
call   b3a &amp;lt;_ZN3fooC1Eiii&amp;gt;
mov    rax,QWORD PTR [rbp-0x30]
mov    QWORD PTR [rbp-0x24],rax
mov    eax,DWORD PTR [rbp-0x28]
mov    DWORD PTR [rbp-0x1c],eax
mov    rdx,QWORD PTR [rbp-0x24]
mov    eax,DWORD PTR [rbp-0x1c]
mov    rcx,rdx
mov    edx,eax
mov    rax,rcx
mov    rbx,QWORD PTR [rbp-0x18]
xor    rbx,QWORD PTR fs:0x28

je     a05 &amp;lt;_ZN3bar4scooEv+0x8b&amp;gt;
call   840 &amp;lt;__stack_chk_fail@plt&amp;gt;
add    rsp,0x40
pop    rbx
pop    r12
pop    rbp
ret    
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt; `sub rsp,0x40` subtracts 0x40 or 64 from register `rsp`
  i.e. allocating 64 bytes of space on the stack (stacks grow downward nowadays,
  so push operatins will decrement stack pointer)&lt;/li&gt;
&lt;li&gt; When calling any function of class foo, we have to provide a pointer to instance of foo.
  Much similar to how you pass a special variable `self` in python for member function calls.
  So in this, the foo instance has been stored at `[rbp-0x30]`. 
  You can see that there are `lea rax, [rbp-0x30]` instructions before every function call.&lt;/li&gt;
&lt;li&gt; `call &amp;lt;_ZN3foo2gzEv&amp;gt;` calls foo::gz() using instance of foo at `[rbp-0x30]`.
  Notice that this instance isn&apos;t initialised at all when we call gx(), gy() or gz().
  Hence, whatever values `[rbp-0x30]` has would be garbage. The calls return garbage
  and store it in local registers&lt;/li&gt;
&lt;li&gt; The function then passes these garbage value to the final init call which is
  `call &amp;lt;_ZN3fooC1Eiii&amp;gt;`. Basically our `doo` instance is reading from its uninitialized
  self and using those values to then later finally initialize itself.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;em&gt;&lt;b&gt;Note&lt;/b&gt;: In this case, the new `foo` variable was first allocated on the stack of function `scoo`
and hence held garbage. This happens because the lack of copy constructor
makes C++ restort to using internal copy operations 
i.e. when returning the final object, the total 12 bytes of object foo
are read into one 32-bit register and one 64-bit regster (rdx and eax) and returned&lt;/em&gt; 
&lt;/p&gt;
&lt;h6&gt;How does the copy constructor affect this?&lt;/h6&gt;
&lt;p&gt;
The copy constructor leads to a change in the calling convention of the function scoo.
Previously, it returned the value by storing it inside registers. Now the caller(main function) provides callee(scoo function) with a pointer where it should store return value. You could think of it as pass by reference but for the return value.
&lt;/p&gt;
&lt;p&gt;
Assembly for function bar::scoo()
&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;
push   rbp
mov    rbp,rsp
push   r12
push   rbx
sub    rsp,0x20
mov    QWORD PTR [rbp-0x28],rdi
mov    QWORD PTR [rbp-0x30],rsi
mov    rax,QWORD PTR fs:0x28

mov    QWORD PTR [rbp-0x18],rax
xor    eax,eax
mov    rax,QWORD PTR [rbp-0x28]
mov    rdi,rax
call   b0c &amp;lt;_ZN3foo2gzEv&amp;gt;
mov    r12d,eax
mov    rax,QWORD PTR [rbp-0x28]
mov    rdi,rax
call   afa &amp;lt;_ZN3foo2gyEv&amp;gt;
mov    ebx,eax
mov    rax,QWORD PTR [rbp-0x28]
mov    rdi,rax
call   aea &amp;lt;_ZN3foo2gxEv&amp;gt;
mov    esi,eax
mov    rax,QWORD PTR [rbp-0x28]
mov    ecx,r12d
mov    edx,ebx
mov    rdi,rax
call   b1e &amp;lt;_ZN3fooC1Eiii&amp;gt;
nop
mov    rax,QWORD PTR [rbp-0x28]
mov    rdx,QWORD PTR [rbp-0x18]
xor    rdx,QWORD PTR fs:0x28

je     9f1 &amp;lt;_ZN3bar4scooEv+0x77&amp;gt;
call   840 &amp;lt;__stack_chk_fail@plt&amp;gt;
add    rsp,0x20
pop    rbx
pop    r12
pop    rbp
ret    
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Notice the difference here: instead of loading `rax` value using `lea` instruction, 
`mov rax,QWORD PTR [rbp-0x28]` is being used.
This will not load address `rbp-0x28` into `rax`, but simply copy value at
location `[rbp-0x28]` into `rax`.
&lt;/p&gt;
&lt;p&gt;
But still, the same procedure is being conducted. 
The function calls `gx()`, `gy()`, `gz()` on this
uninitialised location given by value of `[rbp-0x28]`
and then calls the constructor with those values.
&lt;/p&gt;
&lt;p&gt;
Then how does the correct value pop out?
We need to look at main() function where scoo() is called.
&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;
mov    QWORD PTR [rbp-0x8],rax
xor    eax,eax
lea    rax,[rbp-0x14]
mov    ecx,0x1
mov    edx,0x1
mov    esi,0x1
mov    rdi,rax
call   b1e &amp;lt;_ZN3fooC1Eiii&amp;gt;
lea    rdx,[rbp-0x14]
lea    rax,[rbp-0x20]
mov    rsi,rdx
mov    rdi,rax
call   c36 &amp;lt;_ZN3barC1E3foo&amp;gt;
mov    DWORD PTR [rbp-0x24],0x0
cmp    DWORD PTR [rbp-0x24],0x4
jg     a71 &amp;lt;main+0x77&amp;gt;
lea    rax,[rbp-0x14]
lea    rdx,[rbp-0x20]
mov    rsi,rdx
mov    rdi,rax
call   97a &amp;lt;_ZN3bar4scooEv&amp;gt;
lea    rax,[rbp-0x14]
mov    rdi,rax
call   b88 &amp;lt;_ZN3foo5printEv&amp;gt;
add    DWORD PTR [rbp-0x24],0x1
jmp    a46 &amp;lt;main+0x4c&amp;gt;
mov    eax,0x0
mov    rcx,QWORD PTR [rbp-0x8]
xor    rcx,QWORD PTR fs:0x28
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
We store the value of register `rdi` in `[rbp-0x28]` in function scoo(),
hence whatever is stored in `rdi` at time of calling would be used as
instance location of return foo class.
&lt;/p&gt;
&lt;p&gt;
`lea rax,[rbp-0x14]` and `mov rdi,rax` lead to value `rbp-0x14` being passed to scoo as
location for return foo class. Note that is location is in the stack of `main()`
and not `scoo()` like previous case. 
&lt;/p&gt;
&lt;p&gt;
Notice that `rbp-0x14` is first passed to the foo constructor. This is because of this line
of code
&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;cpp&quot;&gt;&lt;pre class=&quot;language-cpp&quot;&gt;&lt;code class=&quot;language-cpp&quot;&gt;bar &lt;span class=&quot;token function&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;
Here a temp `foo` object has to be initialised and then passed to bar constructor.
When that constructor is called, the `foo` object is not needed, hence compiler
tries to use that memory slot for the returned `foo` object. Ideally it should not have
optimised this because we have switched off optimisation with `-O0`
but this may be a flaw in GCC. So, instead of picking up garbage values in `scoo()`
it picks up the correct values from the temp variable because of reused stack slot.
&lt;/p&gt;
&lt;p&gt;
The proof of this comes from the fact that, when compiled with another compiler like clang,
this behaviour is not replicated. Hence it is important to know that even the second code has
the error of shadowing, it just isn&apos;t being seen in the output due to a happy accident.
&lt;/p&gt;
&lt;p&gt;Our four cents!&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Witcher, Game of Thrones and Predestination: Inspirations from Irish Mythology]]></title><link>https://kumar-ayush.com/blog/witcher-got-irish-mytho/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/witcher-got-irish-mytho/</guid><pubDate>Sat, 18 Jun 2016 07:26:00 GMT</pubDate><content:encoded>&lt;p&gt;
I was home for the past one week, having a compulsory vacation enforced by my family. I spent it reading the Witcher series. To those of you who don&apos;t know about them, &lt;a href=&quot;https://en.wikipedia.org/wiki/Andrzej_Sapkowski#The_Witcher_Saga&quot;&gt;The Witcher&lt;/a&gt; is a polish fantasy series by Andrzej Sapkowski. In the opinion of many, what makes them distinctive from fantasy series like LOTR and Harry Potter are the grey shades of morality portrayed in the world. In LOTR and HP, there is a good and there is an evil and at the end of the day, the good has to triumph over evil. In Witcher, every decision taken has varying consequences for different characters; good and bad. This fascinates the eye, because of its &lt;i&gt;natural&lt;/i&gt; appeal.
&lt;/p&gt;
&lt;p&gt;
Game of Thrones, the popular TV series, is the second thing that comes to my mind when you think of a grey portrayal of the world. I have not read the ASOIF books, but I am an avid follower of the show and hence believe I have an idea of the major keypoints of the show. And what I&apos;ll be talking about here are the striking similarities on some of the plotlines of Witcher and Game of Thrones. Some of them are built out of fan theories I read about GoT as well.
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Political and sexual intrigue, although since Witcher centers around one individual and his destiny, the political aspects are perhaps not as elaborate as GoT.&lt;/li&gt;
&lt;li&gt;Witcher has an elven race &lt;i&gt;Aen Sidhe&lt;/i&gt;, and GoT&apos;s white walkers are like &lt;i&gt;sidhe&lt;/i&gt; made of ice, both derived from Ao Si in Irish mythology. We also know that Children of the Forest made White Walkers so they represent &lt;i&gt;Aen Sidhe&lt;/i&gt; better, and then they have a sister race called &lt;i&gt;Aen Elle&lt;/i&gt; which looks like a representation of the Others in Irish mythology, and of WW in GoT. Witcher&apos;s &lt;i&gt;Aen Elle&lt;/i&gt; have their own version of rogue riders called the Wild Hunt.&lt;/li&gt;
&lt;li&gt;A major problem which surrounds the world as per a prophecy is the coming of a great winter; a great iceage, the Big Winter, the Big Chill, Aep Deireadh and many other names used for a long iceage. Witcher brings in a bit of science too by discussing that this will be effectively due to a change in tilt of Earth&apos;s axis.&lt;/li&gt;
&lt;li&gt;Both of them have a central character who can travel through Space and Time. This is Witcher&apos;s Cirilla or Ciri, and GoT&apos;s Brandon Stark. Although, in the case of GoT, it is only fan theories which talk about a predestination. Witcher, on the other hand, is very explicit to center the story around Ciri&apos;s predestination.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
I spent long hours searching for popular Irish mythological stories so we could establish a connection. Witcher was published before ASOIF and ASOIF was published by the time Witcher was well known to the English speaking world. These are just my reflections.
&lt;/p&gt;</content:encoded></item><item><title><![CDATA[On Slicing Python Lists]]></title><link>https://kumar-ayush.com/blog/splicing/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/splicing/</guid><pubDate>Thu, 02 Jun 2016 20:51:00 GMT</pubDate><content:encoded>&lt;p&gt;
A lot many are familiar with Python lists and the feature of slicing, although I find the description that most tutorials not intuitive enough. Here is how it goes.&lt;br /&gt;
Let us start with defining an array of 10 elements
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&gt;&gt;&gt; a = [i for i in range(10)]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Now, the following I assume you&apos;re familiar with.
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; &gt;&gt;&gt; a[3:6]
[3, 4, 5]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
And the way people think about it is selecting elements starting with &lt;i&gt;index 3&lt;/i&gt; till and including the element with &lt;i&gt;index 6-1=5.&lt;/i&gt;
&lt;/p&gt;
&lt;p&gt;
Do you digest that? I cannot. Why do I include the first index while not the second one? If I think in terms of indices, I have to spend my brain power in subtracting the second index by one, and I tell you I am very lazy about that. 
&lt;br /&gt;
Then there are people who say that you start with &lt;i&gt;index 3&lt;/i&gt; and choose &lt;i&gt;6-3=3&lt;/i&gt; elements there on. This does work because we see the following happening.
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; &gt;&gt;&gt; a[4:4]
[]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
But I do not understand that if I were inventing slicing, and I would want people to think in terms of an index and a length, why would I not just keep length as the second parameter? In this &lt;b&gt;hypothetical&lt;/b&gt; situation,
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; &gt;&gt;&gt; a[3:3]
[3, 4, 5]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
&lt;i&gt;DISCLAIMER: I do not claimer that this is how it went but I&apos;ll now talk about how I like to look at slicing&lt;/i&gt;
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; &gt;&gt;&gt; a[3:]
[3, 4, 5, 6, 7, 8, 9]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
I like to say that doing this &lt;i&gt;skips&lt;/i&gt; the first &lt;i&gt;three&lt;/i&gt; elements and gives the rest.
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; &gt;&gt;&gt; a[:6]
[0, 1, 2, 3, 4, 5]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
And this picks the first &lt;i&gt;six&lt;/i&gt; elements. Simple really!
&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; &gt;&gt;&gt; a[3:6]
[3, 4, 5]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
This just gives the &lt;i&gt;intersection&lt;/i&gt; of the two.
&lt;/p&gt;
&lt;p&gt;
My two cents.
&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Circle enclosing N lattice points]]></title><link>https://kumar-ayush.com/blog/n-points-in-circle/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/n-points-in-circle/</guid><pubDate>Sat, 14 May 2016 14:31:00 GMT</pubDate><content:encoded>&lt;p&gt;Did you know?&lt;br&gt;For every natural number N, there exists a circle enclosing exactly N lattice points!&lt;/p&gt;
&lt;span class=&quot;image left&quot;&gt;&lt;img src=&quot;https://media.giphy.com/media/26vUCSK9K5wTm5fwI/giphy.gif&quot; alt=&quot;gif demonstrating fact&quot;&gt;&lt;/span&gt;
&lt;p&gt;The above was posted on the Facebook group of Math n Physics Club of my institute. It triggered a discussion about the center of such a circle with one guy commenting without reason enough that it has to be an irrational point and any irrational point would do.
&lt;/p&gt;
&lt;p&gt;I found it interesting and thought over it while taking a shower. &lt;i&gt;If&lt;/i&gt; the center is at origin, then this is impossible. If you try to enclose a point at a distance $\sqrt{d^2}$, you will find that $d^2 = x^2 + y^2$ where you don&apos;t have a unique choice of $x$ and $y$.&lt;/p&gt;
&lt;p&gt;Now note that if the center is a rational point, say $(\frac{a}{b},\frac{c}{d})$, then you can scale the space by $bd$, then the center lies at $(ad,bc)$ and then a simple translation will take you to origin and our hypothesis is reduced to the above case raising a contradiction against our assumption that the center is a rational point.&lt;/p&gt;
&lt;p&gt;Thus, the center must be an irrational point. I do not know if any irrational point would do though.&lt;/p&gt;
&lt;p&gt;My two cents!&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Chasing Venus - Book Review]]></title><description><![CDATA[About 250 years ago, a few men had a goal which would allow us to know the exact distance between the Sun and the Earth.
Till then, all…]]></description><link>https://kumar-ayush.com/blog/chasing-venus/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/chasing-venus/</guid><pubDate>Mon, 30 Mar 2015 12:51:00 GMT</pubDate><content:encoded>&lt;p&gt;About 250 years ago, a few men had a goal which would allow us to know the exact distance between the Sun and the Earth.
Till then, all astronomical distances were measured relative to this distance, popularized by Kepler, and commonly known as the Astronomical Unit (AU).
It was an age when astronomy was a science of precise measurements.
Assistants were hired on their eyesight and ability to calculate and endure long cold nights just staring through instruments.
It was one of the most boring jobs you could have, with spirit and liquor your prize.
Inexplicably beautiful celestial phenomenon, eclipse, had inspired many young men of the century who later on became great astronomers to be written down in history, but all at least once had been frustrated over their monotonous lives.&lt;/p&gt;
&lt;p&gt;We take the modern international scientific collaboration for granted.
This book is not just an account of the journeys across the globe to fulfill a common goal, but a historical saga of heroic deeds and brave measures taken by timid Men of Letters.
Scientific institutions came together in the name of science but it was near impossible to convince their monarchs to cooperate amidst the Seven Years&apos; War.
Huge sums were to be drawn out of treasury.
Astronomy is a unique science in a way that you do not get to design the experiment, or do it over.
You are just an observer.
There are no second chances.
In this case, the set of opportunities was once to come in their lifetime, only to repeat more than a century later.
The inevitable human error combined with your misfortune, you never know when and where do the clouds appear, will cost more than your pride.&lt;/p&gt;
&lt;p&gt;That was not all.
They did not have a precise measure of longitudes or good maps.
The Royal Society had a &quot;Longitude Prize&quot; summing over to 200 times the annual salary of the Astronomer Royal to the discoverer of such a method.
Leave alone unexplored corners of the world, the longitude difference between established observatories in Paris and London was not precisely known.
It took months to cover hours of journey in modern terms, days to convey information that takes less time than human perception today.
Sickness would lie in foreign lands as medicine was not advanced.
You would have to escape battleships of enemy nations.&lt;/p&gt;
&lt;p&gt;The face of science across the world was about to be changed.
On various accounts, men failed, but mankind was to win.
Soft-hearted men of natural philosophy filled themselves with courage and embarked on expeditions across warring nations, frozen rivers, rough terrain, stormy seas, diseased landscapes, all to fulfill the dream of Edmund Halley.
It was all in the name of science.
The goal was to observe the transit of Venus across the Sun.&lt;/p&gt;
&lt;p&gt;You can find the book &lt;a href=&quot;https://www.goodreads.com/book/show/12632748-chasing-venus&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Of Peace and Ducks]]></title><description><![CDATA[Introduction I went on a road trip to Jaisalmer with Anuj Shetty and Keshav Srinivasan. A central theme of the trip was 'ducking' and Keshav…]]></description><link>https://kumar-ayush.com/blog/peace-and-ducks/</link><guid isPermaLink="false">https://kumar-ayush.com/blog/peace-and-ducks/</guid><pubDate>Thu, 11 Dec 2014 12:51:00 GMT</pubDate><content:encoded>&lt;h3&gt;Introduction&lt;/h3&gt;
&lt;p&gt;I went on a road trip to Jaisalmer with &lt;a href=&quot;http://www.facebook.com/shetty.anuj&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Anuj Shetty&lt;/a&gt; and &lt;a href=&quot;https://www.facebook.com/keshav.srinivasan&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Keshav Srinivasan&lt;/a&gt;. A central theme of the trip was &apos;ducking&apos; and Keshav saying &apos;Peace!&apos; in response to almost any opinion-based question thrown at him. First day was spent in Jodhpur, while the next three on the trip.&lt;/p&gt;
&lt;h4&gt;Day 1&lt;/h4&gt;
&lt;p&gt;They came. They brushed. They bathed. They ate. We departed for the Mehrangarh fort in Jodhpur.
&lt;br&gt;&lt;strong&gt;Anuj:&lt;/strong&gt; Keshav and I shared an audio guide which detailed the unique history of the fort, from the cannonball marks on the walls to the handprints of the widows of a long gone king. Being teenagers. we proceeded to obsess over the cannons and discuss the military tactics of the defenders of the fort, based on our numerous Age of Empires games. After enjoying the beautiful view of part of the city, shown in the panorama photo above, we went on to check out the rest of the attractions, including, but not limited to, a chroncally depressed old man who periodically put a non-functioning hookah pipe in his mouth for a living, and us scoffing at the pinnacle of ancient art because of our proficiency in Engineering Drawing.
&lt;br&gt;&lt;strong&gt;Keshav:&lt;/strong&gt; Peace!&lt;/p&gt;
&lt;p&gt;The next feature on the trip was a Rajasthani Thali @Priya Hotel on Nayi Sadak.
&lt;span class=&quot;image left&quot;&gt;&lt;img src = &quot;/media/thali.jpg&quot; alt=&quot;rajasthani thali&quot;&gt;&lt;/span&gt;
&lt;br&gt;&lt;strong&gt;Anuj:&lt;/strong&gt; I don&apos;t know dude. Uhh..filling, majestic. I don&apos;t know. Don&apos;t just type everything I say
&lt;br&gt;&lt;strong&gt;Keshav:&lt;/strong&gt; I was the only one to finish it.&lt;/p&gt;
&lt;p&gt;Next we went to the famous Ghantaghar market and up the Ghantagar( Clock Tower ).
We sat there for half an hour listening to songs, just chilling out, watching people, making deductions and comments on their lives.
Also, throughout the climb we had to duck to fit in the doors.
That also goes for the fort.
We could easily reach out to the face of the clock.
&lt;span class=&quot;image right&quot;&gt;&lt;img src = &quot;/media/ghanta.jpg&quot; alt=&quot;clock tower&quot;&gt;&lt;/span&gt;
&lt;br&gt;&lt;strong&gt;Keshav:&lt;/strong&gt; Top secret (&lt;em&gt;when asked about comments on this&lt;/em&gt;)&lt;/p&gt;
&lt;p&gt;We finished with Umed Palace, random walk through Sardarpura and a Pizza at Innings.&lt;/p&gt;
&lt;h4&gt;Day 2&lt;/h4&gt;
&lt;p&gt;Morning we leave for Jaisalmer. We stop at Osian for a spicy pakoda breakfast and tea, and then at Khichan, Phalodi.&lt;/p&gt;
&lt;p&gt;That was to pay a visit to Demoiselle cranes, who migrate to India from central Eurasia;Mongolia to be specific.
&lt;span class=&quot;image left&quot;&gt;&lt;img src = &quot;/media/crane.jpg&quot; alt=&quot;birds&quot;&gt;&lt;/span&gt;
&lt;br&gt;&lt;strong&gt;Anuj:&lt;/strong&gt; You can&apos;t call them bird brains if they just stare at us. They are as smart as us, actually. We are doing the same.&lt;/p&gt;
&lt;p&gt;Keshav took photos on his phone via my binoculars.
The males have a black beard, the females a paintjob of black on the neck and the kids a white patch on the head.
There&apos;s a guy who takes care of these birds; feeding, healing et cetera.
His name is Sewa Ram.
He also got many awards for his contribution to nature conservation.&lt;/p&gt;
&lt;p&gt;We slept through the way until we reach Jaisalmer.
After we had lunch at Chandan Shree Restaurant on Hanuman Chowk, and then went to take a look at Patwa Haveli.
Going through the Haveli, we found our way to the top with a mesmerizing view of the city.
&lt;br&gt;&lt;strong&gt;Keshav:&lt;/strong&gt; I just felt like playing chess there. It was an amazing city view. We already took panaromas, but playing chess on my phone in the background of a city is something I could never do again.&lt;/p&gt;
&lt;p&gt;And so he played a game of chess before we left, I swear.&lt;/p&gt;
&lt;p&gt;We went to Gadisar lake, and then left for a resort in Kuhri where we would spend our night skywatching.
The skywatching part was majestic.
We were esentially in the middle of the desert, so the light pollution was minimum.
A waning gibbous moon caused a bit of a distress but it was all too beautiful overall.
I bet if people looked at stars everyday they&apos;d be different.
This one&apos;s from Calvin and Hobbes by the way.
There was a cultural dance and local food for dinner.
And we saw the sunset from sanddunes, after a humping ride with the camels.
Me and Keshav went on Babloo while Anuj had Captain.
&lt;span class=&quot;image left&quot;&gt;&lt;img src = &quot;/media/camel.jpg&quot; alt=&quot;camels desert&quot;&gt;&lt;/span&gt;
&lt;br&gt;&lt;strong&gt;Keshav:&lt;/strong&gt; Firstly the dance was super awkward since we were the only ones at the resort.
But finally we managed to escape, and got to skywatching which we looked forward to.
We sat and talked there about life, universe and everything until the sky turned and new objects rose.
&lt;br&gt;&lt;strong&gt;Anuj:&lt;/strong&gt; After witnessing the dexterity of a couple of &apos;kartal&apos; players, trying my hands at it and realizing I was worse at it than using chopsticks.
Ayush regailed us with a lot of Greek myths behind the naming and positions of the constellations.
Then we were chilling, literally, talking more deeply about life than you can get from a Truth n&apos; Dare game.&lt;/p&gt;
&lt;h4&gt;Day 3&lt;/h4&gt;
&lt;p&gt;We move towards Tanot.
Legend has it that the bombs dropped in the Tanot Mandir during 1965 Indo-Pak war didn&apos;t explode due to the divine influence of Tanot Mata.
The bombs now add to the decoration of temple along with a BSF Batallion which maintains it.
This is the road which gives you the true feeling of a road trip.
I can count the number of tourist troops that visit the place in a day on my hand.
It&apos;s far out from any reasonable civilization.
The only way to describe the visceral thrill of being the only human beings as far as our sight goes is to have you experience it.
No words can own it.
&lt;span class=&quot;image left&quot;&gt;&lt;img src = &quot;/media/desert.jpg&quot; alt=&quot;desert&quot;&gt;&lt;/span&gt;
We passed by the Ghantiyali Mata Mandir where we stopped to climb upon a sanddune all on foot.
That&apos;s where the real fun is, and not amongst resorts and camel safaris.
And you don&apos;t need to guess what we did sitting on the top of it.
We chilled and listened to songs, that&apos;s the thing.
&lt;br&gt;&lt;strong&gt;Keshav:&lt;/strong&gt; Much dry, such empty.
&lt;br&gt;&lt;strong&gt;Anuj:&lt;/strong&gt; Even with the burning sun on our backs, it still felt exhilarating to gaze around into the emptiness.
There&apos;s a Nietzche quote, &quot;When you gaze too long into the abyss, the abyss also gazes back into you&quot;&lt;br&gt;
And then the real fun began. We got permission to go to a border point just 15 km from Tanot Mata Mandir. BP 609! No cameras allowed.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;strong&gt;Keshav:&lt;/strong&gt; Our border is more fortified, lights, current in fences and all. Their side is totally bare.
&lt;br&gt;&lt;strong&gt;Anuj:&lt;/strong&gt; It was pretty cool to talk to the soldier on top of the border post who had a gun aimed on the other side of the border, constantly. I am pretty sure we brightened the soldier&apos;s day too. We also saw a fox on the way, even though the region was desolate.&lt;/p&gt;
&lt;p&gt;We return to Jaisalmer, visit the fort in the evening.
It is one of the few inhabited forts, so it was pretty good.
Our guide Ravi Gopa was amazingly talkative and sharp about Indian History.
We had juice on Gopa Chowk and then left for our residence in Dak Bungalow.
We took a bath after two days and then went for dinner.&lt;/p&gt;
&lt;h4&gt;Day 4&lt;/h4&gt;
&lt;p&gt;We went to Kuldhara early morning.
Legend: A nobleman Salim Singh wanted to marry a girl from the village of Kuldhara.
He warned that he would bring destruction over the whole village if they don&apos;t agree.
The whole village was evacuated in one night, leaving homes with no sign of life.
Till date, no one knows where did the people of Kuldhara go?
&lt;span class=&quot;image left&quot;&gt;&lt;img src = &quot;/media/kuldhara.jpg&quot; alt=&quot;ruins kuldhara&quot;&gt;&lt;img src = &quot;/media/badabag.jpg&quot; alt=&quot;monument&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Next we went to Badabag, a set of monuments each built in memory of one of the kings . They still have festivals there.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;image right&quot;&gt;&lt;img src = &quot;/media/emu.jpg&quot; alt=&quot;car emu&quot;&gt;&lt;/span&gt;
Next in line was Akal Wood Fossils Park.
10-15 people visit it in a month.
But if you see a fort because it&apos;s old, you should see these fossils as they are over 100 million years old.
We picked a few pieces lying around.
But probably the best part was the welcome comittee at the park.
A set of three emus just wandering around the main entrance.
They were quite friendly, and maybe a bit scary at first glance too.
Check out the Great Emu War that happened in Australia.
At least the Wikipedia on it is hilarious.&lt;/p&gt;
&lt;p&gt;We returned to Jodhpur after it. We had lunch at DPS dhaba, and then back to home.&lt;/p&gt;</content:encoded></item></channel></rss>