<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Stalin Subramani on Medium]]></title>
        <description><![CDATA[Stories by Stalin Subramani on Medium]]></description>
        <link>https://medium.com/@stalee.subramani?source=rss-b1ef482f4cbe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rqaUwKGZIL6IPo2V_GgV9g.jpeg</url>
            <title>Stories by Stalin Subramani on Medium</title>
            <link>https://medium.com/@stalee.subramani?source=rss-b1ef482f4cbe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 22:27:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@stalee.subramani/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why do I need to learn ‘Activation’ Function?]]></title>
            <link>https://medium.com/@stalee.subramani/why-do-i-need-to-learn-activation-function-233514abf197?source=rss-b1ef482f4cbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/233514abf197</guid>
            <dc:creator><![CDATA[Stalin Subramani]]></dc:creator>
            <pubDate>Tue, 23 Dec 2025 04:55:05 GMT</pubDate>
            <atom:updated>2025-12-23T04:55:05.076Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NXD_45aTkEDyTtOOqX7S4A.png" /><figcaption>‘Machine Sees Pattern Through Math’ — Stalin Subramani</figcaption></figure><p>If you haven’t read my previous article yet, you may want to take a look-it adds useful context and can help you get more from this one. No worries if you don’t, though!</p><p>The equation y = mX + b is the break-even formula. Believe it or not, this single equation is the fundamental building block that powers machine learning. However, by itself, it cannot approximate non-linear data .</p><p>oh, what is non-linear data?</p><p>If we plot data on a graph and the pattern looks like a rainbow kind if structure or curve like structure, we call it non-linear data. A straight line cannot approximate rainbow-shaped data, so we need a way to bend the line .</p><p>We start with y = mX + b , which produces a straight line. To bend this line, we pass the output y into another mathematical function. This second function transforms the straight line into a curve.</p><p>So the question becomes: what kind of function can do this?</p><p>This is where Euler’s number, e , becomes one of the foundations of activation functions. One of the simplest functions that can bend a straight line is:</p><p>activation function ( Sigmoid ) = 1 / (1 + e⁻ʸ)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*d7KFE1405_bgnxUQcV5YXQ.png" /></figure><p>Here, y is the output of the linear function y = mX + b . When we pass this output through the activation function, the straight line is bent into a curve, allowing the model to approximate rainbow-shaped or any non-linear patterns.</p><p>There are many activation functions, and each one bends the straight line in a different way. Based on the data pattern and the problem we are trying to solve, we choose the activation function that best fits our use case and data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fGzS3-DfkJdbFHRwyG2WiA.png" /></figure><p>Activation Function from ‘Machine Sees Pattern Through Math’ By Stalin Subramani</p><p>A simple curve-producing function becomes the fundamental tool for approximating non-linear data, and this simple idea opens the door to solve complex problems.</p><p>So never underestimate simple things, because it is these simple ideas that ultimately build the most complicated and powerful systems.</p><p>I have written book <a href="https://www.linkedin.com/pulse/why-do-i-need-learn-activation-function-stalin-subramani-rtykc/?trackingId=gxAS%2BjUtQpeL%2FkhRQ9dSzA%3D%3D">“ Machine Sees Pattern Through Math: Machine Learning Building Blocks”</a> which talks about all the simple tools that power the complicated machine learning algorithms.</p><p><em>Originally published at </em><a href="https://www.linkedin.com/pulse/why-do-i-need-learn-activation-function-stalin-subramani-rtykc/?trackingId=gxAS%2BjUtQpeL%2FkhRQ9dSzA%3D%3D"><em>https://www.linkedin.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=233514abf197" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine don’t think, So how do they learn!]]></title>
            <link>https://medium.com/@stalee.subramani/machine-dont-think-so-how-do-they-learn-b559065208ab?source=rss-b1ef482f4cbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/b559065208ab</guid>
            <category><![CDATA[calculus]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Stalin Subramani]]></dc:creator>
            <pubDate>Sat, 20 Dec 2025 11:45:11 GMT</pubDate>
            <atom:updated>2025-12-20T11:45:11.301Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5_TtzVMJDC1czTTz" /></figure><p>Anybody who starts learning ML will eventually face a question that takes time to gain clarity on:</p><p>“How can a machine learn?”</p><p>There is no surprise here, This is the natural thinking. We cannot make the machine to think the same way how we think — We need different tools to simulate it, and that is the reason it takes time to understand and this is natural.</p><p>Let’s take any game we are very interested in: it can be cricket, football, or golf. One thing is very clear in these games: we need to hit the ball to the destination.</p><p>There are only two possibilities:</p><ul><li>The ball lands on the destination</li><li>The ball does not land on the destination</li></ul><p>If the ball lands on the destination, it’s good — no issues. But what if it does not? How can the machine identify this and make adjustments?</p><p>Before that, let’s understand how humans make adjustments. If you take the game of golf, the force and direction of the hit are adjusted based on the previous try. Suppose the previous hit was very light and the ball landed before the destination — the player will add a little more force to push the ball closer to the destination. In case the ball lands beyond the destination, the player needs to reduce the force to make the ball land at the destination.</p><p>These adjustments can go through multiple iterations, but finally, after many trials, the ball might land exactly on or close to the destination. That’s what we call experience .</p><p>The learning here is the player making adjustments in force and direction. Now, it’s time to think: how can we implement these adjustments in a machine?</p><p>This is the million-dollar question for anyone who starts learning ‘machine learning’. Let’s consider the place where the ball landed and the destination place.</p><p>If the ball landed exactly at the destination, then the difference between the destination and where the ball landed will be 0 .</p><p>But what if the ball landed somewhere else? The difference will be non-zero .</p><p>What can we do with this non-zero value, and how can we provide feedback for the next try, which is ideally what we call learning?</p><p>We need to take these differences and make them into a curve-like property. You may be thinking:</p><p>Why do we need to make it a curve-like function? What is the purpose of it?</p><p>The reason is that we need a way to identify how close the ball is to the destination. If we square the difference [ f(error) = error² ] the function forms a parabola.</p><p>If you look at the parabola, the bottom of the parabola is the key point-it indicates the exact destination. You may be wondering how that point represents the destination.</p><p>If we model the function based on the squared difference as a parabola, and map the slope at every point to the different between the prediction and expected output, then the slope will be 0 only at the bottom point of the parabola . So it’s all about how we model our error so that we can use the slope to adjust it.</p><p>If the slope is positive or negative, then we are not at the destination. Only when the slope is 0 can we say that we have reached the destination. We adjust the slope bit by bit toward the bottom of the bowl by making adjustments to the actual prediction function.</p><p>The prediction function’s output is the input to the error function. The error function is simply the difference between the expected output and the predicted output. Hence, any change in the prediction function will affect the error.</p><p>So the final question is: how do we change the prediction function, or how can we adjust the prediction function parameters, so that the error moves toward the bottom of the bowl where the slope is 0?</p><p>This is done using differential calculus .</p><p>To understand this concept very clearly, refer to the book:</p><p>“Machine Sees Pattern Through Math” by Stalin Subramani</p><p><em>Originally published at </em><a href="https://www.linkedin.com/pulse/how-can-machine-learn-stalin-subramani-hv0pc/?trackingId=LQ8n0HqkrsIwHwX%2F8CIWew%3D%3D"><em>https://www.linkedin.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b559065208ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Bet on 3 and Won — How a Simple Game Proved That Probability Isn’t Just Luck]]></title>
            <link>https://medium.com/@stalee.subramani/i-bet-on-3-and-won-how-a-simple-game-proved-that-probability-isnt-just-luck-5aac63be741a?source=rss-b1ef482f4cbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/5aac63be741a</guid>
            <category><![CDATA[probability]]></category>
            <category><![CDATA[inference]]></category>
            <category><![CDATA[bell-curve]]></category>
            <category><![CDATA[machine-leanring]]></category>
            <category><![CDATA[normal-distribution]]></category>
            <dc:creator><![CDATA[Stalin Subramani]]></dc:creator>
            <pubDate>Mon, 05 May 2025 13:35:27 GMT</pubDate>
            <atom:updated>2025-05-05T13:40:12.732Z</atom:updated>
            <content:encoded><![CDATA[<h3>I Bet on 3 and Won — How a Simple Game Proved That Probability Isn’t Just Luck</h3><p>A few days ago, five of us including my daughter got together to play an old traditional Indian game called <strong>Dhayam</strong>. It’s similar to dice games but instead uses two sticks or dice-like pieces, each marked with the numbers <strong>0, 1, 2, 3</strong>. The goal is simple — roll both sticks and move based on the total.</p><p>We decided to make it a bit more fun: each of us would <strong>bet on which number would appear most frequently</strong> after multiple rolls. It seemed like a game of luck at first. But I had a different thought — maybe this wasn’t just luck. Maybe it was a matter of <strong>probability</strong>.</p><h3>How the Game Works</h3><p>Each player rolls <strong>two Dhayam sticks</strong>. Since each stick has four values (0 to 3), there are <strong>16 possible combinations</strong> when rolling both together.</p><p>The sums you can get range from 0 (0+0) to 6 (3+3). But importantly, not all of these sums are equally likely to appear. Some have more combinations that can lead to them.</p><h3>Finding the Most Likely Number</h3><p>I quickly did the math in my head (and later verified it). Here’s what I found:</p><ul><li><strong>Sum of 3</strong> can come from the combinations (0+3), (1+2), (2+1), and (3+0) — that’s <strong>4 ways</strong>.</li><li><strong>Sum of 2 and 4</strong> each have <strong>3 combinations</strong>.</li><li>Other sums like 0, 1, 5, and 6 are even less likely.</li></ul><p>That meant <strong>3 had the highest chance</strong> of appearing — 4 out of 16 possibilities. It’s not a huge percentage, but it’s the best option among all.</p><h3>Placing the Bet</h3><p>Each of us picked a number we believed would win. I bet on <strong>3</strong>, simply because <strong>math said it had the best chance</strong>.</p><p>We each rolled around <strong>20 times</strong> over the course of the game. Sure enough, when we looked at the results, <strong>3 showed up more than any other number</strong>.</p><p>I won the bet — not because I was lucky, but because I trusted the math.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M6c4RR5CaRI1XAQOyMoFUg.jpeg" /></figure><h3>What I Learned</h3><p>This experience reminded me of something important:</p><blockquote><strong><em>Probability isn’t just luck. It’s science.</em></strong></blockquote><p>It’s easy to think dice games or coin flips are purely random. But if you look a little deeper, you’ll start to see patterns. When you understand how the numbers work, you can make smarter choices — even in a game that looks like chance.</p><h3>A Traditional Game with Hidden Lessons</h3><p>Dhayam isn’t just a fun game — it’s a small lesson in <strong>math and decision-making</strong>. Games like this, passed down through generations, actually teach us the basics of <strong>probability and logic</strong>, even if we don’t realize it.</p><p>And sometimes, that’s all you need to win — not luck, just a little bit of math.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5aac63be741a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How the Dot Product can Power Horoscope Matching and Recommendation Engines: An Amazing Concept!]]></title>
            <link>https://medium.com/@stalee.subramani/how-the-dot-product-can-power-horoscope-matching-and-recommendation-engines-an-amazing-concept-e7512567372b?source=rss-b1ef482f4cbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7512567372b</guid>
            <category><![CDATA[cosine-similarity]]></category>
            <category><![CDATA[linear-algebra]]></category>
            <category><![CDATA[recomendation-systems]]></category>
            <category><![CDATA[dot-product]]></category>
            <category><![CDATA[cosine]]></category>
            <dc:creator><![CDATA[Stalin Subramani]]></dc:creator>
            <pubDate>Wed, 26 Feb 2025 18:36:53 GMT</pubDate>
            <atom:updated>2025-02-26T18:36:53.522Z</atom:updated>
            <content:encoded><![CDATA[<h3>How the Dot Product can Power Horoscope Matching and Recommendation Engines: An Amazing Concept! (Cosine similarity)</h3><p>I don’t believe in horoscope but i thing this is one of the best example of dot product to explain!!!</p><blockquote><strong>Where it does really useful in Machine learning?</strong></blockquote><p>In Indian culture, horoscope matching is a traditional practice used to find the best match for marriage. Families compare the horoscopes of the bride and groom to check for compatibility, believing that a good match leads to a harmonious life. This idea of matching is similar to a concept in mathematics called <strong><em>cosine similarity</em>.</strong></p><p>In simple terms, <strong>cosine similarity</strong> measures how similar two things are by calculating the angle between them.</p><p>Imagine the personalities of the boy and girl as vectors (arrows pointing in specific directions). The smaller the angle between these vectors, the more <strong>similar their personalities</strong> are. If the <strong>angle is zero</strong> (meaning the vectors are perfectly aligned), the <strong>cosine similarity is 1</strong>, indicating a <strong>perfect match</strong>. This is like saying the boy and girl have very similar traits and would be a great pair for marriage.</p><p>The <strong>underlying math</strong> for <strong>cosine similarity</strong> is closely related to the <strong><em>dot product</em></strong>, a method used to calculate the alignment of two vectors. If the dot product is high, it means the two vectors are closely aligned and very similar. The same idea applies in horoscope matching — if the traits of the boy and girl align well, they are considered a good match.</p><p>Interestingly, this same concept of cosine similarity is used in <strong>recommendation engines</strong>, such as those found on Netflix, Amazon, or Spotify. These systems <strong>analyze user preferences</strong>, represented as vectors, and compare them. If two users have similar tastes, the system recommends items based on what similar users liked. Just as horoscope matching tries to find compatibility in marriage, recommendation engines use similar principles to find compatibility in user preferences, helping people discover things they might enjoy.</p><blockquote>Dot product : A.B = |A||B|cos θ</blockquote><p>Lets see the math behind the dot product</p><p>Imagine we have two people, ‘Marx’ and ‘Liya,’ represented as vectors based on their thinking patterns, which we have plotted on a 2D graph.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*JB_9ETgliLXs0RK6P_Cpwg.png" /></figure><p>We need to assess their similarity based on the input features.</p><p>By calculating the dot product of these two vectors, we obtain a scalar value that indicates their similarity. However, this value is influenced by the magnitude of the vectors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IBsw4MXv8poozAx2GD5epg.png" /></figure><p>Since the number 9 is positive, it indicates that the two vectors are similar or pointing in the same direction. However, this interpretation is somewhat subjective because the magnitude is influenced by the length of the vectors. To better understand the strength of their similarity, we should calculate the angle between the vectors or use cosine similarity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*gwaGh7zHSNX1Ur1UzlHudQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZjGjlODn1visFFCF__K_bA.png" /></figure><p>The cosine similarity is 0.79, which is close to 1, indicating a high degree of similarity between individuals ‘Marx’ and ‘Liya.’ Their thought processes are very similar</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gik7_YuvImcauyKu3dbsLA.png" /></figure><p>Just to add final touch point is — what is cos theta?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*YE5gaobYitlw0x4-4BXYEA.png" /></figure><p>In the coordinate representation the x axis is the cos theta.</p><p>Hope this would have given you the basic understanding of the cosine similarity and the rational behind dot product.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7512567372b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to run program without Operating System?]]></title>
            <link>https://medium.com/@stalee.subramani/how-to-run-program-without-operating-system-d9992ce28538?source=rss-b1ef482f4cbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9992ce28538</guid>
            <category><![CDATA[operating-systems]]></category>
            <category><![CDATA[system-programming]]></category>
            <category><![CDATA[assembly-language]]></category>
            <category><![CDATA[8086-microprocessor]]></category>
            <category><![CDATA[bootloader]]></category>
            <dc:creator><![CDATA[Stalin Subramani]]></dc:creator>
            <pubDate>Sun, 16 Feb 2025 16:19:46 GMT</pubDate>
            <atom:updated>2025-02-16T16:19:46.186Z</atom:updated>
            <content:encoded><![CDATA[<p>This is one of the fascinating questions that came to my mind while i was in college:</p><ul><li>What happens when we turn on the computer?</li><li>What is the first instruction the computer executes?</li><li>Where is this first instruction stored in RAM?</li><li>How does the computer know to execute the instruction?</li></ul><p>These were some of the most interesting questions I had at the time. Specifically, what occurs when we power on an IBM PC 8086 system?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7XIWQ-pG2ORsgKZbFcdRZg.jpeg" /></figure><p>The IBM PC 8086 family of systems first executes instructions at the address</p><blockquote><strong>0x00007C00</strong>.</blockquote><p>This is a “magic address” — whenever the system is powered on, the first instruction is executed from this location. This serves as the entry point for discussing how to write our own <strong>BOOT LOADER</strong>.</p><p>We can write any program and load it into the address <strong>0x00007C00</strong>, allowing our code to be executed by the processor.</p><blockquote>What does this mean?<br>This refers to running a program without an operating system.</blockquote><p><strong>How can we achieve this?</strong></p><p>We can write code and flash it into a boot loader. In the past, this was done using floppy disks or CDs, but now we can use any external hard drive as a bootable disk by placing the code on it.</p><p>However, there is a prerequisite: the code must originate from <strong>0x00007C00</strong>. The machine instructions need to be generated in such a way that the code generated by an assembler is relative to the magic address, which requires some understanding of assembly language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*12f7JRi9LPRvY1hdaYHhLg.jpeg" /></figure><p>Lets have look at simple boot loader of “staOS” [ Stalin OS]</p><pre>org 0x7c00<br>bits 16<br><br>      cli<br>      mov     ax,0<br>      mov     ds, ax<br><br>      mov     es,ax<br>      mov     gs,ax<br>      mov     ss,ax<br>      mov     sp,0xffff<br><br>      sti<br><br>      <br>      mov si,msg<br>      call DisplayMessage<br>      <br>      mov ax, 0x0050<br>      mov es, ax <br>      mov bx, 0x0000<br>      call ReadSector<br><br>      mov ax, 0x0050<br>      mov es, ax <br>      mov bx, 0x2200<br>      call ReadSector1<br>    <br>      mov si, msg1<br>      call DisplayMessage<br><br>      mov si, beforeOS<br>      call DisplayMessage<br>       <br>      jmp  0x0050:0x2800<br><br>      mov si, afterOS<br>      call DisplayMessage<br>      cli <br><br>      hlt<br><br>ReadSector:<br>      mov ah, 0x02<br>      mov al, 0x11<br>      mov ch, 0x00<br>      mov cl, 0x02<br>      mov dh, 0x00<br>      mov dl, 0x00<br>      int 0x13<br>      jc ReadSector<br>      ret<br><br>ReadSector1:<br>      mov ah, 0x02<br>      mov al, 0x0d<br>      mov ch, 0x01<br>      mov cl, 0x01<br>      mov dh, 0x00<br>      mov dl, 0x00<br>      int 0x13<br>      jc ReadSector1<br>      ret<br><br><br>DisplayMessage:<br>     lodsb                                       <br>     or      al, al                              <br>     jz      .DONE<br>     mov     ah, 0x0e                            <br>     mov     bh, 0x00                           <br>     mov     bl, 0x14                          <br>     int     0x10                                <br>     jmp     DisplayMessage<br>.DONE:<br>     ret<br><br>msg db &quot;Boot Loader searching for OS...&quot;,0x0d,0x0a,0x00<br>msg1 db &quot;Stalin OS found in Floppy DISK, Loading staOS...&quot;,0x0d,0x0a,0x00<br>reading db &quot; Reading sector... please wait...&quot;, 0x0d,0x0a,0x00<br>finished db &quot; Finished Reading.&quot;,0x0d,0x0a,0x00<br>beforeOS db &quot;Before jump to 0x0050:0x2800 !&quot;, 0x0d,0x0a,0x00<br>afterOS db &quot; back to loader &quot;,0x00<br>sectorloaded db &quot; after loaded sector in memory ready to move control&quot;, 0x0d,0x0a,0x00 <br><br>     TIMES 510-($-$$) DB 0<br>     DW 0xAA55</pre><p>The code above can be compiled using NASM (<a href="https://www.nasm.us/">https://www.nasm.us/</a>). If you look at the first line, the origin address is specified as<br>org 0x7C00.<br>This means that the entire code will be generated relative to the address <strong>0x7C00</strong>. Once we place the compiled version into the boot sector, whatever is specified in the code will be executed. This could include displaying a simple message on the console.</p><p>The boot loader above loads “staOS,” an operating system designed to run simple assembly programs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dBC5Q2EsI9zyeCq6Sbza_g.jpeg" /></figure><p>The memory architecture of staOS is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dGVxrO9wYFZuIEPPq7DUKw.jpeg" /></figure><p>staOS code</p><pre>org 0x00<br>BITS 16<br>        jmp near MainLoop<br>   call os_print_string<br>   ret<br>   call os_input_string<br>   ret<br>   call os_string_compare<br>   ret<br>   call os_wait_for_key<br>   ret<br>   call New_Line<br>   ret   <br><br>        times 10240-($-$$) db 0       <br><br><br>   cli<br>            mov     ax,0x0050<br><br>          mov     ds, ax<br>          mov     es,ax<br>          mov     gs,ax<br>          mov     ss,ax<br><br>     mov     sp,0xffff<br>         sti<br><br>      <br>        mov si, before_draw<br>        call os_print_string<br><br>        mov si, before_input<br>        call os_print_string<br>   call os_clear_screen<br><br>   call os_draw_background<br><br>MainLoop:        <br>        mov si, .prompt<br>        call os_print_string<br>                <br>        mov ax, .input <br>        call os_input_string<br><br>        <br>   call New_Line<br><br>        call os_cursor_end_line<br><br>        mov si, .input    <br>      cmp byte [si], 0<br>   je MainLoop<br><br><br>   mov si, .input    <br>     mov di, .exit_string<br>   call os_string_compare<br>   jc near ExitPgm<br><br>   mov si, .input<br>   mov di, .helpcmd<br>   call os_string_compare<br>   jc near helpprocess<br>   <br>   mov si, .input<br>   mov di, .clscmd<br>   call os_string_compare<br>   jc near clsprocess<br><br>   mov si, .input<br>   mov di, .dircmd<br>   call os_string_compare<br>   jc near dirprocess<br><br>          mov si, .input<br>          call check_runcmd<br>          jc near runprocess<br><br><br>        mov si, .cmdnotfound<br>   call os_print_string<br><br>   call os_cursor_end_line<br><br>   jmp MainLoop<br>.dircmd db &quot;dir&quot;,0x00<br>.runhellocmd db &quot;run hello.com&quot;,0x00<br>.input times 255 db 0<br>.exit_string db &#39;exit&#39;,0x00<br>.tmp_buf dw 0<br>.prompt db &quot;staOS&gt;&quot;,0x00<br>.cmdnotfound db &quot; 10 kb for user pgm : Commmand Not Found&quot;,0x0d,0x0a,0x00<br>.helpcmd db &quot;help&quot;,0x00<br>.clscmd db &quot;cls&quot;,0x00<br>.loadhello db &quot;run hello.com&quot;,0x00<br>before_draw db &#39;before draw&#39;,0x0d,0x0a,0x00<br>before_input db &#39;before input&#39;,0x0d,0x0a,0x00<br><br>New_Line:<br>  mov si, .newLine<br>       call os_print_string  <br>  ret<br>.newLine db 0x0d,0x0a,0x00<br><br>runprocess:<br>        add si, 4<br>        jmp near LOAD_display_files_in_disk<br> <br>dirprocess:<br> call display_files_in_disk<br> jmp near MainLoop<br><br>loadhello: <br>      mov bx, 0x100<br>      mov ah, 0x02<br>      mov al, 0x01<br>      mov ch, 0x03<br>      mov cl, 0x01<br>      mov dh, 0x00<br>      mov dl, 0x00<br>      int 0x13<br>      jc loadhello<br>      jmp near 0x100<br>      jmp near MainLoop<br><br>LoadProcess:<br> mov bx, 0x100<br>      mov ah, 0x02<br>      mov al, 0x05<br>      mov cl, 0x01<br>      mov dh, 0x00<br>      mov dl, 0x00<br>      int 0x13<br>      jc LoadProcess<br>      jmp near 0x100<br>clsprocess:<br>   <br>   call os_draw_background<br>   jmp near MainLoop <br><br>.prompt1 db &quot;staOS&gt;&quot;,0x00<br><br>helpprocess:<br> <br>   mov si, .help<br>   call os_print_string<br>   call os_cursor_end_line<br>   jmp near MainLoop<br> <br>.help db &quot;run &lt;filename&gt; | dir | help | cls | exit &quot;,0x0d,0x0a,&quot;This Tiny OS is only for understanding how operating system works&quot;,0x0d,0x0a,0x00<br><br><br>os_string_compare:<br> pusha<br><br>.more:<br> mov ax, [si]   <br> mov bx, [di]<br><br> cmp byte [si], 0  <br> je .terminated<br><br> cmp ax, bx<br> jne .not_same<br><br> inc si<br> inc di<br> jmp .more<br><br><br>.not_same:<br> popa<br> clc<br> ret<br><br><br>.terminated:<br> cmp byte [di], 0  <br> jne .not_same<br><br> popa<br> stc<br> ret<br><br><br>          <br>os_input_string:<br> pusha<br><br> mov bx, ax   <br><br>        ;mov ax, 0x2000                  <br>        ;mov ds, ax<br>        ;mov es, ax<br><br> mov di, bx   <br> mov cx, 0   <br><br> mov ax, 0                       <br><br>.loop_blank:<br> stosb<br><br> cmp byte [di], 0  <br> je .blank_done<br><br> jmp .loop_blank<br><br>.blank_done:<br> mov di, bx<br> mov cx, 0<br><br><br>.more:     <br> call os_wait_for_key<br><br> cmp al, 13   <br> je .done<br><br> cmp al, 8   <br> je .backspace   <br><br> cmp al, 32   <br> jl .more<br><br> cmp al, 126<br> jg .more<br><br> jmp .nobackspace<br><br><br>.backspace:<br> cmp cx, 0   <br> je .more<br><br> pusha<br> mov ah, 0Eh   <br> mov al, 8<br> mov bl, 8<br> int 10h    <br> mov al, 32<br> int 10h<br> mov al, 8<br> int 10h<br> popa<br><br> mov byte [di], 0  <br><br> dec cx    <br> dec di<br><br> jmp .more<br><br><br>.nobackspace:<br> pusha<br> mov ah, 0Eh   <br> int 10h<br> popa<br><br> inc cx<br> cmp cx, 250   <br> je near .done<br><br> stosb    <br><br> jmp near .more<br><br><br>.done:<br> popa<br> ret<br><br>os_wait_for_key:<br> pusha<br><br> xor ax, ax<br> mov ah, 00   <br> int 16h<br><br> mov [.tmp_buf], ax  <br><br> popa    <br> mov ax, [.tmp_buf]<br> ret<br> .tmp_buf dw 0<br><br>os_move_cursor:<br> pusha<br><br> xor bh, bh<br> mov ah, 2<br> int 10h<br><br> popa<br> ret<br>os_show_cursor:<br> pusha<br><br> mov ch, 0   <br> mov cl, 7<br> mov ah, 1<br> mov al, 3   <br> int 10h<br><br> popa<br> ret<br>os_hide_cursor:<br> pusha<br><br> mov ch, 32<br> mov ah, 1<br> mov al, 3   <br> int 10h<br><br> popa<br> ret<br>os_cursor_end_line:<br> pusha<br> <br> mov ah, 3<br> mov bh, 0<br> int 10h<br>      cmp dh, 23<br> jl no_scroll<br><br> mov dh, 23<br> mov dl, 0<br> call os_move_cursor <br>      call os_scroll_up_oneline<br><br>no_scroll:<br>         <br> popa<br> ret<br><br>os_draw_background:<br> pusha<br>        ;push ax                         <br>        ;push bx<br>        ;push cx<br><br> call os_clear_screen<br><br> mov ah, 09h   <br> xor bh, bh<br> mov cx, 80<br>        mov bl, 01010000b<br> mov al, &#39; &#39;<br> int 10h<br> mov si, .screenmsg<br> call os_print_string<br><br> mov dh, 1<br> mov dl, 0<br> call os_move_cursor<br><br> mov ah, 09h   <br> xor bh, bh<br> mov cx, 1840<br>        mov bl, 00000110b                          <br> xor bh, bh<br> mov al, &#39; &#39;<br> int 10h<br><br> mov dh, 24<br> mov dl, 0<br> call os_move_cursor<br><br> mov ah, 09h   <br> xor bh, bh<br> mov cx, 80<br>        mov bl, 01010000b<br> mov al, &#39; &#39;<br> int 10h<br><br> mov dh, 24<br> mov dl, 1<br> call os_move_cursor<br><br><br> mov dh, 0<br> mov dl, 1<br> call os_move_cursor<br><br> mov dh, 1   <br> mov dl, 0<br> call os_move_cursor<br> popa<br> ret<br>.screenmsg db &quot;                        16 Bit Demo staOS 1.0&quot;,0x00<br><br>os_print_string:<br> pusha<br><br> mov ah, 0Eh  <br> mov bl, 12<br><br>.repeat:<br> lodsb   <br> cmp al, 0<br> je .done  <br> int 10h   <br> jmp .repeat<br><br>.done:<br> popa<br> ret<br><br>os_scroll_up_oneline:<br> pusha<br> <br> mov ah, 6   <br> mov al, 1   <br> mov bh, 6   <br> mov ch, 1<br> mov cl, 0   <br> mov dh, 23<br> mov dl, 79<br> int 10h<br><br> popa<br> ret<br><br>os_clear_screen:<br> pusha<br><br> mov dx, 0   <br> call os_move_cursor<br><br> mov ah, 6   <br> mov al, 0   <br> mov bh, 12   <br> mov ch, 0<br> mov cl, 0   <br> mov dh, 24<br> mov dl, 79<br> int 10h<br><br> popa<br> ret<br><br>ReadSector:<br> pusha<br>      mov ah, 0x02<br>      mov al, 0x03<br>      mov ch, 0x02<br>      mov cl, 0x01<br>      mov dh, 0x00<br>      mov dl, 0x00<br>      int 0x13<br>      jc ReadSector<br> popa<br>      ret<br><br>display_files_in_disk:<br> pusha<br> mov bx, .dir_buff<br> call ReadSector<br> mov si, .dir_buff<br> call display_files<br><br> popa<br> ret <br>.dir_buff times 1536 db 0xff<br><br>display_files:<br> pusha<br>  NEXT:<br> cmp byte [si], 0xFF <br> jz end_display_files<br><br> mov di, .file_name<br> <br> call FILE<br> call FILE_EXT<br>        mov byte [di],0<br><br> push si<br> mov si, .file_name<br>        call STA_print_string<br> pop si<br><br> inc si<br> inc si<br> inc si<br> push si<br>        call New_Line <br> pop si<br> jmp NEXT<br><br><br><br>.file_name times 17 db 0 <br><br><br>  FILE:<br> mov cx, 10<br>    FILE_name: <br> mov al, [si]<br>        cmp al, &#39; &#39;<br>        jz bypass<br> mov [di], al<br>        inc di<br>    bypass:<br>        inc si<br> loop FILE_name<br><br> mov al, &#39;.&#39;<br> mov [di], al<br> inc di<br> ret<br><br><br><br>  FILE_EXT:<br> mov cx, 3<br>    FILE_EXT_name:<br> mov al, [si]<br> mov [di], al<br> inc si<br> inc di<br> loop FILE_EXT_name   <br> ret<br><br>end_display_files:<br> popa<br> ret<br><br>STA_print_string:<br> pusha<br><br> mov ah, 0Eh  <br>        mov bl, 12<br><br>.repeat:<br> lodsb   <br> cmp al, 0<br> je .done  <br> int 10h   <br> jmp .repeat<br><br>.done:<br> popa<br> ret<br><br>convert_to_decimal:<br>        pusha<br>        push si<br>        mov cx, 3<br>     EOS:<br>        mov al, [si]<br>        sub al, 48<br>        mov [si],al<br>        inc si<br>        loop EOS<br>        pop si<br>        mov al, [si]<br>        mov bl, 10<br>        mul bl<br>        add al, [si+1]<br>        mov [si], al <br>        popa<br>        ret<br><br>check_runcmd:<br>        pusha<br>     CRCMD:<br>        mov al, [si]<br>        cmp al, &#39;r&#39;<br>        jnz RCexit<br>        mov al, [si+1]<br>        cmp al, &#39;u&#39;<br>        jnz RCexit<br>        mov al, [si+2]<br>        cmp al, &#39;n&#39;<br>        jnz RCexit<br><br>        popa<br>        stc<br>        ret<br>RCexit<br>        popa<br>        clc        <br>        ret<br><br><br>LOAD_display_files_in_disk:<br>     <br>        <br>      mov [compareFile], si<br> mov bx, dir_buff<br>      call ReadSector<br> mov si, dir_buff<br>      jmp LOAD_display_files<br><br>        <br>         <br>dir_buff times 1536 db 0xff<br><br>LOAD_display_files:<br>        <br>  LOAD_NEXT:<br>   cmp byte [si], 0xFF <br>        jz near MainLoop<br>        mov di, LOAD_file_name <br>        call LOAD_FILE<br>        call LOAD_FILE_EXT<br>        mov byte [di],0<br>        <br>   push di<br>   push si        <br>        mov di, LOAD_file_name<br>        mov si, [compareFile]<br>   call os_string_compare<br>   jc near matchFound        <br>        <br>RR:<br>        pop si<br>        pop di<br>        add si, 3<br>        jmp LOAD_NEXT<br>        jmp near MainLoop<br><br>compareFile dw 0<br>LOAD_file_name times 17 db 0<br><br><br><br>matchFound:<br>   pop si<br>   pop di<br>   mov byte [si+3], 0<br>   call convert_to_decimal<br>   mov ch, [si]<br>   jmp near LoadProcess<br><br>matchFound1:<br>   mov si, notfound<br>   call os_print_string<br>   jmp RR<br><br>notfound db &quot;not found&quot;,0x0d,0x0a,0x00<br>matchStr db &quot;match found &quot;,0x00,0x0d,0x0a        <br><br>  LOAD_FILE:<br>      push cx<br>      push ax<br>        <br> mov cx, 10<br>    LOAD_FILE_name: <br> mov al, [si]<br>        cmp al, &#39; &#39;<br>        jz LOAD_bypass<br> mov [di], al<br>        inc di<br>    LOAD_bypass:<br>        inc si<br>        loop LOAD_FILE_name<br><br> mov al, &#39;.&#39;<br> mov [di], al<br> inc di<br>      pop ax <br>      pop cx<br>        <br> ret<br><br><br><br>  LOAD_FILE_EXT:<br>        push cx <br>          push ax<br> mov cx, 3<br>    LOAD_FILE_EXT_name:<br> mov al, [si]<br> mov [di], al<br> inc si<br> inc di<br>        loop LOAD_FILE_EXT_name<br>        pop ax<br>      pop cx<br> ret<br><br><br>ExitPgm:<br> int 0x19<br><br><br><br><br><br><br><br><br><br></pre><p>Screen shot of “staOS”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RmgO5XR58KACVQRHT473AA.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9992ce28538" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linear Algebra for Machine Learning]]></title>
            <link>https://medium.com/@stalee.subramani/linear-algebra-for-machine-learning-543a4ae8752e?source=rss-b1ef482f4cbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/543a4ae8752e</guid>
            <category><![CDATA[linear-regression]]></category>
            <category><![CDATA[matrix-transformation]]></category>
            <category><![CDATA[math-for-machine-learning]]></category>
            <category><![CDATA[linear-algebra]]></category>
            <category><![CDATA[linear-transformation]]></category>
            <dc:creator><![CDATA[Stalin Subramani]]></dc:creator>
            <pubDate>Sat, 15 Feb 2025 09:54:29 GMT</pubDate>
            <atom:updated>2025-02-15T10:05:19.657Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Machine learning is about turning events into numbers and visualising them to find meaning and build prediction based on the meaning.</blockquote><p>Everything can be represented with numbers because math is a universal language. In machine learning, we can represent groups of numbers as vectors. The dimensions of the space change based on these numbers. Once we convert information into numbers, we can use vectors to organize it. After that, it’s all about manipulating the numbers, which is known as linear transformation.</p><blockquote>vector</blockquote><blockquote>vector transformation ( linear transformation, matrix multiplication )</blockquote><blockquote>determinant</blockquote><blockquote>dot product</blockquote><p>these concepts hels extracting the meaning out of the information rendered as vector.</p><p>Knowing these ideas is important for anyone who wants to get started in machine learning.</p><p><strong>Vector:</strong> A vector is a key building block in machine learning. Information is essentially represented as vectors. We convert information into numbers and then express those numbers as vectors. Ultimately, this visual representation provides insights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Aj2vicYtPK1c1AHquSrg3w.jpeg" /></figure><p><strong>Matrices ( Linear Transformation ):</strong> After we have the vectors, we can manipulate them to uncover patterns or group them based on their characteristics. To do this, we need to apply transformations, specifically linear transformations, which serve as the tools for extracting meaning from the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VPox8DybTHLIC-a7Rsf-MQ.jpeg" /></figure><p><strong>Determinants:</strong> Determinants help us understand how a transformation affects the scale and volume of vectors in a space</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mGfTod_ZhRISbCStOdqxkA.jpeg" /></figure><p><strong>Dot Products:</strong> The dot product does measure the similarity between vectors. A positive dot product indicates that the vectors point in the same direction, while a negative dot product indicates that they point in opposite directions. A dot product of zero indicates that the vectors are orthogonal (perpendicular) to each other. This information is indeed useful for understanding how similar or related vectors are, which can help in grouping or clustering them effectively.</p><ol><li>If the dot product of two vectors is positive, it indicates that the vectors point in the same direction. This suggests that the two vectors share common properties or are similar in nature. As a result, we can group these vectors together, as they exhibit similarity.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dcIA4VphxZW0wBCt-x_nRA.jpeg" /></figure><p>2. If the dot product is zero, the vectors are perpendicular to each other, indicating that they are independent.</p><p>3. If the dot product is negative, the vectors are pointing in opposite directions.</p><p>The four concepts mentioned above are fundamental for building a strong foundation in machine learning</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=543a4ae8752e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What’s the Fundamental Design Difference Between SQL and NoSQL?]]></title>
            <link>https://medium.com/@stalee.subramani/whats-the-fundamental-design-difference-between-sql-and-nosql-08989f0b9869?source=rss-b1ef482f4cbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/08989f0b9869</guid>
            <category><![CDATA[memtable]]></category>
            <category><![CDATA[compaction]]></category>
            <category><![CDATA[databased]]></category>
            <category><![CDATA[lsm-tree]]></category>
            <dc:creator><![CDATA[Stalin Subramani]]></dc:creator>
            <pubDate>Sun, 02 Feb 2025 18:03:35 GMT</pubDate>
            <atom:updated>2025-02-02T18:03:35.000Z</atom:updated>
            <content:encoded><![CDATA[<p>When someone asks about the difference between SQL and NoSQL, the common answer is that SQL is for structured data and NoSQL is for unstructured data. This is true, but it raises another question:</p><p>Why did unstructured data require a new database design? What’s the issue with SQL that prevents it from storing unstructured data?</p><p>In SQL, the storage engine is built around fixed-length records. Since all records are the same length, finding any record on a page is straightforward, taking O(log N) time if indexed.</p><p>However, unstructured data has variable-length records, making it harder to manage. This is a key reason NoSQL databases were developed. We need a way to store variable-length records efficiently.</p><p>This challenge is addressed using the LSM Tree data structure, which includes:</p><ul><li><strong>MemTable</strong></li><li><strong>SSTable</strong></li><li><strong>Compaction process</strong></li></ul><p>The LSM (Log Structured Merge) Tree helps solve this problem. It works like a “write-ahead log,” tracking new or updated records by appending them to a file. Each time a record is modified, it is added to the end of the storage.</p><p><strong>MemTable</strong> is an in-memory table that holds recent records. Updates, deletions, and new insertions happen here, and the MemTable is kept sorted. When it reaches a certain size (usually around 4KB but configurable), it is flushed to disk, becoming an <strong>SSTable</strong> (Sorted String Table). Before this flush, duplicates are removed, and metadata is created for faster searching.</p><p>Over time, records in each SSTable will be unique, but duplicates can occur across SSTables. To reduce these duplicates, a <strong>compaction process</strong> merges two SSTable blocks into one, eliminating duplicates.</p><p>However, this compaction process can lead to issues in languages with automatic garbage collection. For example, Discord experienced significant memory problems with Apache Cassandra. The garbage collection wasn’t freeing memory effectively, causing accumulation. To resolve this, they switched to ScyllaDB, which is built in C++ and allows programmers to manage memory directly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=08989f0b9869" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dynamic Programming — Introduction]]></title>
            <link>https://medium.com/@stalee.subramani/dynamic-programming-introduction-71f710d3a025?source=rss-b1ef482f4cbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/71f710d3a025</guid>
            <category><![CDATA[dynamic-programming]]></category>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[problem-solving]]></category>
            <dc:creator><![CDATA[Stalin Subramani]]></dc:creator>
            <pubDate>Tue, 29 Oct 2024 08:06:21 GMT</pubDate>
            <atom:updated>2024-10-29T08:33:44.774Z</atom:updated>
            <content:encoded><![CDATA[<h3>Dynamic Programming — Introduction</h3><p>Dynamic programming is a method for solving problems that involve overlapping subproblems and repeated computation for the same sub-structure. This approach optimizes by breaking down complex problems and avoiding redundant work.</p><p>To make this clearer, let’s consider a real-world example: imagine there are 200 houses in an apartment complex, and four people are tasked with checking which houses are locked. Each person checks and records the state of the houses every hour. However, if they don’t coordinate, some houses might be checked multiple times, wasting time and resources. Instead, if the four people share real-time information about which houses they’ve already checked, they can avoid redundant checks, speeding up the process and saving energy.</p><p>In computer science, this is called “Dynamic Programming.” When a problem has overlapping sub-structures, its time complexity can become exponential. By using techniques like memoization or bottom-up dynamic programming, we can often reduce this complexity to linear or polynomial time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71f710d3a025" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>