<?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 Amshavarthana Srisivanathasarma on Medium]]></title>
        <description><![CDATA[Stories by Amshavarthana Srisivanathasarma on Medium]]></description>
        <link>https://medium.com/@amsha09sarma11?source=rss-7c8c4a0c0c08------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*752VqkZCkf83oLOj</url>
            <title>Stories by Amshavarthana Srisivanathasarma on Medium</title>
            <link>https://medium.com/@amsha09sarma11?source=rss-7c8c4a0c0c08------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 18:07:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amsha09sarma11/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[Securing a Stall Reservation System: OWASP Top 10 Remediation and an OIDC Migration]]></title>
            <link>https://medium.com/@amsha09sarma11/securing-a-stall-reservation-system-owasp-top-10-remediation-and-an-oidc-migration-2a495923c765?source=rss-7c8c4a0c0c08------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a495923c765</guid>
            <dc:creator><![CDATA[Amshavarthana Srisivanathasarma]]></dc:creator>
            <pubDate>Sun, 30 Aug 2026 18:05:58 GMT</pubDate>
            <atom:updated>2026-08-30T18:06:45.247Z</atom:updated>
            <content:encoded><![CDATA[<p>Notes from an Information Security assessment on the Bookfair stall reservation platform</p><h4>Introduction</h4><p>For this assessment, my task wasn’t to build a web application from scratch it was to take one that already existed, find where it was insecure, and fix it properly. The application in question is Bookfair, a stall reservation management system originally built for the Colombo International Book Fair, where vendors reserve exhibition stalls and organizers manage the venue.</p><p>The brief had two parts:</p><p>(1) go through the app and remediate OWASP Top 10 vulnerabilities, and</p><p>(2) replace whatever authentication existed with a proper OpenID Connect (OIDC) flow backed by a cloud Identity Provider, with every access-control decision derived from the token the IdP issues not from anything the client claims about itself.</p><p>The application, briefly</p><p>Bookfair is a two sided system:</p><p>Stall Vendors register, browse an interactive venue map, reserve up to three stalls, get a QR entry pass by email, and manage their own reservations and payment records.</p><p>Exhibition Organizers oversee stall availability, pricing, all vendor reservations, and payment/QR status across the whole event.</p><p>The stack is a React + Tailwind single-page frontend talking to a Spring Boot + Hibernate + MySQL backend. Originally, authentication was a self-rolled JWT system: a login endpoint issued a token, a custom filter validated it, and role checks were sprinkled through the controllers. That setup is exactly the kind of thing this assessment exists to interrogate.</p><p><strong>Part 1:</strong> Finding and fixing the OWASP Top 10</p><p>I went through the codebase category by category rather than fixing things opportunistically as I noticed them it’s too easy to feel “done” after patching the obvious stuff while missing something less visible.</p><p>Injection (SQLi). Every repository and query in the codebase was audited for string concatenation. The app already leaned on Spring Data JPA method-derived queries and parameterized <a href="http://twitter.com/Query">@Query</a> annotations, but I went through each one to confirm there was no place where a request parameter could end up directly inside a query string.</p><p>Broken authentication. This was the big one, and it’s really Part 2 of this whole project: I removed the custom JWT login/registration flow entirely and replaced it with OIDC through Asgardeo. Rolling your own auth means you’re also on the hook for secret rotation, token invalidation, password storage, and every edge case an IdP has already spent years getting right. Deleting AuthController, AuthService, and the custom JWT filter felt like the right call rather than trying to harden something that shouldn’t have existed in an app this size to begin with.</p><p>One thing that’s easy to miss when you migrate auth: leftover seed data. The original codebase had a CommandLineRunner that silently created a default <a href="/service/mailto:admin@example.com">admin@example.com</a> account with a hardcoded password on every application startup, and printed that password to the console log. Once login is fully delegated to an IdP, that kind of local password-based account is dead code that nobody remembers to remove and dead code with a hardcoded credential is still a real finding. I deleted it outright rather than leaving it “just in case.”</p><p>Sensitive data exposure. Database credentials, mail server credentials, and (previously) JWT secrets were pulled out of application.properties and the frontend source entirely, replaced with environment-variable placeholders, with .example files committed instead of the real config and everything real excluded via .gitignore.</p><p>Broken access control (IDOR). This is the category I spent the most time on, because it’s the one most specific to what this app actually does. A vendor should only ever see their own reservations not be able to change a number in a URL and see someone else’s. I added a SecurityService with methods like isReservationOwner and isOwner, wired into every relevant controller method via <a href="http://twitter.com/PreAuthorize">@PreAuthorize</a>, so ownership is checked server-side against the authenticated token’s identity claim, not trusted from anything the client sends. Organizer-only endpoints got the equivalent role-based check.</p><p>Security misconfiguration. Since the app now uses stateless bearer tokens rather than cookies, CSRF protection is handled by that design choice rather than a CSRF token but I made sure CORS was locked down to specific allowed origins rather than left wide open, and added Content-Security-Policy, X-Frame-Options: DENY, and X-Content-Type-Options: nosniff headers. I also made sure HTTPS was actually configured for local development both the Vite dev server and the Spring Boot backend rather than just documented as a step for whoever runs the project next.</p><p>Cross-Site Scripting (XSS). React escapes rendered content by default, which handles most of this class of bug for free, but I specifically audited every place user-supplied text business names, reservation comments, genre entries gets rendered, to confirm nothing used dangerouslySetInnerHTML with unsanitized input.</p><p>Insecure deserialization and XXE. Neither native Java serialization nor XML parsing exists anywhere in this codebase, so both were “not applicable” findings worth explicitly checking and documenting rather than assuming.</p><p>Vulnerable components. I ran npm audit on the frontend and reviewed backend dependency versions, and replaced the custom JWT library dependency with Spring’s own spring-boot-starter-oauth2-resource-server, which is maintained as part of the Spring Security project rather than a smaller third-party JWT library.</p><p>Insufficient logging and monitoring. I added logging for access-denial events (403s) and for reservation creation/cancellation, so there’s an audit trail for both security-relevant denials and the actual business actions vendors take.</p><p><strong>Part 2:</strong> Why OIDC instead of hardening the custom JWT system</p><p>It’s tempting, when an app already has working JWT auth, to just harden it: rotate the secret, add refresh tokens, fix the obvious holes. I chose not to, for a fairly simple reason the assessment’s actual requirement is that access control be driven by tokens from a real Identity Provider, and more broadly, authentication is one of the areas where “write less of your own code” is genuinely the more secure choice, not just the easier one.</p><p>I used Asgardeo as the IdP and implemented the Authorization Code flow with PKCE on the frontend via react-oidc-context, with the Spring Boot backend configured as an OAuth2 Resource Server that validates every incoming token’s signature against Asgardeo’s JWKS endpoint, along with issuer and expiry. Two groups StallVendor and ExhibitionOrganizer are defined in Asgardeo and mapped to local authorities on the backend, so a vendor’s and an organizer’s access is governed entirely by group membership the IdP controls, not by any field the client can influence.</p><p>Logout ends both the local frontend session and the Asgardeo session, so a “log out” click actually logs someone out rather than just clearing a local token while the IdP session stays alive.</p><h4>Challenges</h4><p>The trickiest part wasn’t the security logic itself Spring Security’s resource-server support is well documented it was the surrounding plumbing: getting local HTTPS working correctly for both the frontend dev server and the backend (OIDC redirect URIs and secure cookie behavior generally require it, and self-signed certs mean extra setup on every machine that runs the project), and making sure the migration away from custom JWT didn’t leave orphaned code paths (like the seeded admin account mentioned above) that quietly reintroduced the exact class of risk the migration was supposed to remove.</p><p>The other real lesson: committing as you go matters. It’s easy to do a large body of security work locally and only realize afterward that none of it made it into version control in reviewable, logical commits. Treating each OWASP category and each migration step as its own commit made the change much easier to explain and to actually verify was pushed.</p><h4>Learning outcomes</h4><p>Working through this assessment reinforced a few things I’d summarize as:</p><p>Access control bugs are rarely about missing authentication they’re about missing authorization. Almost every interesting finding here was “a valid, authenticated user can reach data that isn’t theirs,” not “an unauthenticated user can log in.”</p><p>Delegating authentication to an IdP is a security decision, not just a convenience one. It removes an entire class of self-inflicted bugs (password storage, token signing mistakes, session fixation) at the cost of an external dependency.</p><p>Dead code is still attack surface. A hardcoded password nobody uses anymore is still a hardcoded password.</p><p>Documentation is part of the security posture. A README that accurately explains how auth and access control work is what makes the next person’s changes safe too.</p><h4>Conclusion</h4><p>This assessment took an application that worked but trusted itself too much validating a user’s identity with logic it had written itself, and trusting client-supplied identifiers for access decisions — and moved that trust to where it belongs: a dedicated Identity Provider on the authentication side, and server-side ownership checks on every access decision. The result is an app that does the same thing it did before, but where a compromised or malicious client can no longer talk its way into someone else’s data.</p><p>Source code: https://github.com/Amshavarthana-S/secure-bookfair-reservation-system.git</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a495923c765" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Neural Networks: The Brain Analogy That Actually Makes Sense]]></title>
            <link>https://medium.com/@amsha09sarma11/neural-networks-the-brain-analogy-that-actually-makes-sense-2905b81f1275?source=rss-7c8c4a0c0c08------2</link>
            <guid isPermaLink="false">https://medium.com/p/2905b81f1275</guid>
            <dc:creator><![CDATA[Amshavarthana Srisivanathasarma]]></dc:creator>
            <pubDate>Sun, 31 May 2026 15:05:06 GMT</pubDate>
            <atom:updated>2026-05-31T15:11:45.488Z</atom:updated>
            <content:encoded><![CDATA[<p>You use one 100 times a day. Here’s what’s actually happening inside.</p><p>Every morning, millions of people unlock their phones with their face.</p><p>Not a password. Not a PIN. Just a glance.</p><p>In that split second less time than it takes to blink a neural network scans your face, compares it against a stored model, and decides: <em>yes, that’s them.</em> Open.</p><p>No human programmed the rules for what your face looks like. The system figured it out on its own.</p><p>That’s the quiet miracle of neural networks. And once you understand how they work, you’ll start seeing them everywhere.</p><h3>First, Where Did the Name Come From?</h3><p>Back in 1943, two scientists Warren McCulloch and Walter Pitts asked a wild question: <em>what if we could model the human brain in mathematics?</em></p><p>They knew that biological neurons in your brain fire electrical signals to each other, forming thoughts, memories, and decisions. What if you could recreate that artificially using math?</p><p>That idea sat in labs for decades. Then in 1958, a scientist named Frank Rosenblatt built the <strong>perceptron </strong>the very first machine that could learn to recognize simple patterns.</p><p>It was primitive. It could barely tell the difference between a triangle and a circle.</p><p>But it was the seed. Today’s neural networks the ones powering ChatGPT, Google Translate, and Netflix recommendations are the full grown tree.</p><h3>The Basic Idea: Neurons That Talk to Each Other</h3><p>Here’s the core concept, no math required.</p><p>A neural network is made of <strong>neurons </strong>tiny mathematical units that do one simple job: take in some information, decide how important it is, and pass a signal forward.</p><p>Each neuron has two things:</p><ul><li><strong>Weights - </strong>dials that control how much attention to pay to each input</li><li><strong>Biases - </strong>a nudge that decides how easily the neuron activates</li></ul><p>Think of it like a panel of judges at a cooking competition.</p><p>Each judge (neuron) watches the dish being presented. One judge cares a lot about taste. Another weighs presentation heavily. A third barely looks at creativity. They each score the dish differently and combined, their votes produce a final verdict.</p><p>That’s what a layer of neurons does. One input, many weighted opinions, one output.</p><h3>The Factory Floor: How Layers Work</h3><p>A neural network isn’t just one neuron. It’s thousands arranged in <strong>layers</strong>.</p><p>There are three kinds:</p><ol><li><strong>Input Layer - </strong>where raw data enters. Pixels of an image. Words in a sentence. Numbers from a spreadsheet.</li><li><strong>Hidden Layers - </strong>where the real work happens. These layers transform the raw input into increasingly meaningful patterns. The first hidden layer might detect edges in a photo. The next might recognize shapes. The one after that might identify a face.</li><li><strong>Output Layer - </strong>where the answer comes out. “This is a cat.” “This email is spam.” “You might like this movie.”</li></ol><p>Think of it like an airport security line.</p><p>The first scanner checks for metal. The second checks for liquids. The third checks IDs. By the end, the system has a clear picture not from one check, but from many layers working together.</p><h3>Real World Example</h3><h3>1: How Gmail Knows It’s Spam</h3><p>You’ve probably never thought about how Gmail catches spam. It just works.</p><p>Here’s what’s actually happening:</p><p>An email lands in Gmail’s servers. A neural network immediately scans it looking at words like “FREE,” “WINNER,” “Click here now,” the sender’s history, and dozens of other signals.</p><p>Each of those signals gets a weight. “FREE” in the subject line? High suspicion weight. Sent from a known contact? Low suspicion weight.</p><p>The network combines all of those signals, passes them through its layers, and spits out a number: the probability this is spam. If it’s above a certain threshold it goes to your spam folder before you ever see it.</p><p>No human wrote a rule that said <em>“if the word FREE appears three times, it’s spam.”</em> The network learned that pattern on its own, by studying millions of real spam emails.</p><h3>How Does It Actually Learn? The Magic Loop</h3><p>This is the part most people never hear about and it’s the most interesting.</p><p>Neural networks learn through a loop called <strong>training</strong>. Here’s how it works:</p><p><strong>Step 1- Make a guess.</strong> Feed the network an email. It guesses: spam or not spam?</p><p><strong>Step 2- Check how wrong it was.</strong> Compare its guess to the real answer. If it said “not spam” but it <em>was</em> spam, that’s an error.</p><p><strong>Step 3- Work backwards.</strong> The network traces back through its layers to figure out which weights caused the mistake. This process is called <strong>backpropagation</strong> essentially the network asking itself, <em>“where did I go wrong?”</em></p><p><strong>Step 4- Adjust and try again.</strong> The weights get nudged in the direction that reduces the error. Then the next email comes in. And the next. And the next.</p><p>After seeing millions of emails, the network gets incredibly good at spotting spam not because someone told it what spam looks like, but because it learned from its own mistakes.</p><p>It’s like learning to ride a bike. You wobble. You correct. You wobble less. Eventually, it becomes natural.</p><h3>Real World Example</h3><h3>2: How Spotify Knows What You Want to Hear</h3><p>You finish a song. Spotify immediately suggests the next one and it’s somehow perfect.</p><p>A neural network is working behind the scenes.</p><p>It’s not just looking at what genre you like. It’s analyzing the tempo, energy, and mood of every song you’ve ever played. It’s noticing that you always skip upbeat songs on Monday mornings. That you listen on repeat after midnight. That your taste shifts when you’re at the gym.</p><p>All of those signals get fed into a neural network that builds a model of <em>you</em> your musical fingerprint. Then it matches that fingerprint against millions of songs to find the one most likely to keep you listening.</p><p>That’s not a playlist someone curated. That’s a machine that learned your taste better than most of your friends know it.</p><h3>Real World Example</h3><h3>3: How Doctors Are Using It to Catch Cancer Earlier</h3><p>In 2020, Google’s DeepMind trained a neural network on tens of thousands of mammogram scans.</p><p>The result? The system detected breast cancer more accurately than six expert radiologists and with fewer false alarms.</p><p>How? The network had seen so many scans that it learned to recognize subtle patterns in tissue that human eyes, after years of training, still sometimes miss.</p><p>It doesn’t replace doctors. But it flags the cases that need a second look catching things earlier, when treatment is most effective.</p><p>That’s a neural network saving lives.</p><h3>Not All Networks Are the Same</h3><p>Just like there are different types of cars for different roads, there are different types of neural networks for different jobs.</p><p><strong>CNNs (Convolutional Neural Networks)-</strong> built for images. They’re the ones identifying your face at airport check-in, detecting tumors in X-rays, and powering self-driving cars.</p><p><strong>RNNs (Recurrent Neural Networks)-</strong> built for sequences. They power speech recognition, autocomplete on your keyboard, and real-time transcription.</p><p><strong>Transformers-</strong> the modern powerhouses. These use a mechanism called “attention” to understand context in language. ChatGPT, Google Translate, and most modern AI chatbots run on this architecture.</p><p>Same core idea. Different wiring. Different superpowers.</p><h3>The Honest Truth: They’re Not Perfect</h3><p>Neural networks are impressive. But they have real limits worth knowing.</p><p><strong>They’re black boxes.</strong> Even their creators often can’t fully explain <em>why</em> a network made a specific decision. That’s a serious concern in healthcare, law, and finance.</p><p><strong>They need a lot of data.</strong> A neural network is only as good as what it’s trained on. Feed it biased data, you get biased decisions.</p><p><strong>They can “overfit.”</strong> Sometimes a network memorizes training data instead of learning general patterns like a student who memorizes practice exam answers but can’t handle a real test.</p><p><strong>They’re hungry for power.</strong> Training large neural networks requires massive computing power. Some of today’s biggest models needed weeks of training on thousands of specialized chips.</p><p>The brain analogy is useful, but it has limits. Your brain runs on roughly 20 watts about the power of a dim light bulb. Some of these models need entire data centres just to train.</p><h3>Why This Matters to You</h3><p>You don’t need to be an engineer to understand neural networks. But knowing they exist and roughly how they work changes how you see the world.</p><p>When your bank flags a suspicious transaction before you notice it, that’s a neural network.</p><p>When your phone’s camera automatically adjusts for a low-light photo, that’s a neural network.</p><p>When a hospital system flags a patient as high risk before symptoms appear, that’s a neural network.</p><p>These aren’t future technologies. They’re already woven into the everyday fabric of modern life.</p><p>The question isn’t whether neural networks affect you.</p><p>The question is: now that you know how they work, what else do you want to understand?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2905b81f1275" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning Explained: The Map Every Engineer Needs]]></title>
            <link>https://medium.com/@amsha09sarma11/machine-learning-explained-the-map-every-engineer-needs-00e1e9e55d86?source=rss-7c8c4a0c0c08------2</link>
            <guid isPermaLink="false">https://medium.com/p/00e1e9e55d86</guid>
            <dc:creator><![CDATA[Amshavarthana Srisivanathasarma]]></dc:creator>
            <pubDate>Mon, 04 May 2026 06:01:01 GMT</pubDate>
            <atom:updated>2026-05-04T06:01:01.417Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>We’ve built things. Now let’s understand how they actually work under the hood.</blockquote><p>You’ve heard the word a thousand times. Machine Learning. But what actually is it?</p><p>Simple answer - it’s teaching computers to learn from examples instead of following rules you write. You don’t program a spam filter by listing every possible spam word. You show it 10,000 emails, tell it which ones are spam, and it figures out the pattern itself. That’s it. That’s the whole idea.</p><h4>Why It’s Matter Right Now</h4><p>Every product you use today has ML inside it. Netflix recommendations. Google search ranking. Your bank flagging a suspicious transaction. Face unlock on your phone. None of these were hand-coded with rules. They were all trained on data. If you want to build serious software in 2025, ML is no longer optional.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1uuydgYENEeU4uzt.png" /></figure><h4>The 3 types - Start here</h4><p>All of machine learning splits into three camps. Get these three right and everything else clicks.</p><p><strong>1. Supervised Learning - Learning with a Teacher</strong></p><p>You give the model data where every example already has the right answer attached. Input goes in, correct output is already labeled. The model learns the pattern between them.</p><p>Two things it can do:</p><ul><li><strong>Classification - </strong>put things into categories. Is this tumor malignant or benign? Is this review positive or negative? Spam or not spam?</li><li><strong>Regression - </strong>predict a number. What will this house sell for? How many units will we ship next month?</li></ul><p>The algorithms here are names you’ll see everywhere: Linear Regression, Logistic Regression, Decision Trees, Random Forest, SVM, KNN, Naive Bayes. Each one is just a different strategy for finding the same thing the pattern in your labeled data.</p><p><strong>2. Unsupervised Learning - Finding Hidden Patterns</strong></p><p>No labels. No right answers. Just raw data and a model trying to make sense of it.</p><p>Three things it can do:</p><ul><li><strong>Clustering - </strong>group similar things together. A retailer discovers 4 natural customer types it never knew existed. Nobody told the model what the groups were. It found them.</li><li><strong>Dimensionality Reduction - </strong>compress complex data into simpler form without losing what matters. This is quietly happening inside every embedding model powering your RAG pipeline.</li></ul><p><strong>Association Rules- </strong>find relationships between items. Customers who buy bread also buy butter. Sounds simple. At Amazon’s scale, it prints money.</p><p><strong>3. Reinforcement Learning - Learning by Doing</strong></p><p>No dataset at all. An agent takes actions, gets rewards or penalties, and slowly figures out what works exactly like a child learning to walk. Fall down enough times, eventually you figure it out.</p><p>This is how AlphaGo became the greatest Go player in history. It played itself millions of times until it got good. No human labeled a single “correct move.”</p><p>This is also the secret behind why ChatGPT feels natural to talk to. RLHF Reinforcement Learning from Human Feedback is how OpenAI tuned GPT to sound like a helpful assistant instead of a raw prediction machine.</p><p><strong>Two Bonus Types the Industry Uses</strong></p><ul><li><strong>Semi-Supervised Learning- </strong>you have a little labeled data and a lot of unlabeled data. Use both. Labeling data by hand is expensive and slow. This approach gets you most of the benefit at a fraction of the cost.</li><li><strong>Self-Supervised Learning- </strong>the model creates its own labels from the data. GPT was trained by predicting the next word in a sentence. The “label” was just the next word. No human labeled anything. This is what made training on the entire internet possible.</li></ul><p><strong>Before the Algorithm - The Real Work</strong></p><p>Here’s what most tutorials skip. The algorithm is usually the last 10% of the work.</p><p>Before any model sees your data, you need to clean it. Handle missing values. Remove outliers. Scale your numbers so big values don’t bully small ones. Engineer new features that better represent what you’re predicting. This part data preprocessing and feature engineering is where real ML engineers spend most of their time. It’s unglamorous. It’s also what separates working models from broken ones.</p><p><strong>How You Know It’s Actually Working</strong></p><p>Training a model is easy. Knowing whether it works is harder.</p><p>For classification problems you check precision, recall, F1-score, and AUC-ROC. Each one reveals a different kind of failure. For regression you track error margins. Cross-validation tells you if your model actually generalizes or just memorized the training data. Hyperparameter tuning squeezes out the last few percentage points.</p><p>A model with great training accuracy but terrible real world performance is called overfitting. It’s the most common mistake beginners make, and metrics catch it before your users do.</p><p><strong>From Notebook to Production</strong></p><p>A model sitting in a Jupyter notebook helps exactly nobody.</p><p>Real ML engineering means wrapping your model in a Flask or FastAPI endpoint, building a UI with Streamlit or Gradio, and then managing the full lifecycle versioning, monitoring, retraining when the model drifts. This is MLOps, and it’s where ML meets software engineering. It’s also the skill gap most companies are desperate to fill right now.</p><blockquote><strong><em>The One-Line Takeaway</em></strong></blockquote><blockquote>Supervised learning predicts. Unsupervised learning discovers. Reinforcement learning decides.</blockquote><blockquote>Pick the right one for your problem, clean your data properly, measure what actually matters, and ship it. That’s machine learning in production not the textbook version, the version that actually gets used.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=00e1e9e55d86" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RAG Explained: How Modern AI Finds Accurate Answers (Without Guessing)]]></title>
            <link>https://medium.com/@amsha09sarma11/rag-explained-how-modern-ai-finds-accurate-answers-without-guessing-630b4b3d5b1c?source=rss-7c8c4a0c0c08------2</link>
            <guid isPermaLink="false">https://medium.com/p/630b4b3d5b1c</guid>
            <dc:creator><![CDATA[Amshavarthana Srisivanathasarma]]></dc:creator>
            <pubDate>Fri, 17 Apr 2026 17:30:01 GMT</pubDate>
            <atom:updated>2026-04-17T17:30:01.581Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever wondered why some AI chatbots give outdated or incorrect answers?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*84jM6pvBMiQi_RKkBT78-Q.png" /></figure><h3>What’s the problem?</h3><p>When an AI model is trained, it learns from massive amounts of data — books, websites, and articles.<br>But once training stops, its knowledge becomes <strong>frozen in time</strong>.</p><p>So when you ask:</p><blockquote><em>“What happened in the news today?”</em></blockquote><p>The AI may not know or worse, it might <strong>make something up</strong> (this is called hallucination).</p><h3>The idea (simple way to understand it)</h3><p>Think of a student in an exam:</p><p>Without a book → they rely on memory and might guess<br>With a book → they look up accurate information before answering</p><p>👉 <strong>RAG gives AI that “open book.”</strong></p><h3>What is RAG?</h3><p><strong>RAG (Retrieval-Augmented Generation)</strong> is simple:</p><p>➡️ User asks a question<br>➡️ AI searches relevant documents<br>➡️ Retrieves useful information<br>➡️ Generates a grounded answer</p><p>Instead of guessing, the AI <strong>finds first then answers</strong>.</p><h4>How RAG works</h4><p>User Query → Embeddings → Vector Search → Retrieve Documents → LLM → Final Answer</p><h3>Types of RAG (simplified)</h3><p><strong>1. Naive RAG - Basic version</strong><br>Break documents into chunks and retrieve the most relevant ones.<br><em>Like Ctrl+F, but smarter.</em></p><p><strong>2. HyDE RAG - Imagine first</strong><br>Generates a hypothetical answer to improve search.<br><em>Like picturing what you need before searching.</em></p><p><strong>3. Corrective RAG - Verify before answering</strong><br>Checks if results are good enough; retries if needed.<br><em>Like double-checking your sources.</em></p><p><strong>4. Graph RAG - Follow relationships</strong><br>Uses connections between ideas for complex queries.<br><em>Like navigating Wikipedia links.</em></p><p><strong>5. Hybrid RAG - Two searches in one</strong><br>Combines keyword search + semantic search.<br><em>Like asking both Google and a friend.</em></p><p><strong>6. Adaptive RAG - Smart selection</strong><br>Chooses the best strategy based on the question.<br><em>Like a skilled librarian.</em></p><p><strong>7. Multimodal RAG - Beyond text</strong><br>Works with images, tables, charts, and PDFs.<br><em>Like learning from both text and visuals.</em></p><p><strong>8. Agentic RAG - Autonomous search</strong><br>Decides when and how to search until it finds a solid answer.<br><em>Like a persistent researcher.</em></p><h3>Real-world examples</h3><p><strong>●Customer support chatbot</strong><br>→ Finds exact product details + understands user intent</p><p><strong>●</strong> <strong>Hospital AI assistant</strong><br>→ Analyzes medical records and images together</p><p><strong>●</strong> <strong>University search tool</strong><br>→ Answers student questions using large knowledge bases</p><p><strong>●</strong> <strong>Legal document analysis</strong><br>→ Traces relationships between laws and regulations</p><h3>Why this matters</h3><p>RAG transforms AI from something that <em>guesses</em><br>into something that <em>searches, verifies, and answers with context.</em></p><p>If you’re building real-world AI systems, this isn’t optional it’s essential.</p><p>I’m currently exploring how to build better RAG systems and improve retrieval accuracy.<br>If you’re working on similar problems, let’s connect and share ideas 🚀</p><p>💡 <strong>Big takeaway:</strong><br>AI today isn’t just about asking better questions - <br>it’s about building smarter systems that find the <em>right</em> answers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=630b4b3d5b1c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Small Languages Models: The AI Skill Most Engineers Are Overlooking]]></title>
            <link>https://medium.com/@amsha09sarma11/small-languages-models-the-ai-skill-most-engineers-are-overlooking-322701417614?source=rss-7c8c4a0c0c08------2</link>
            <guid isPermaLink="false">https://medium.com/p/322701417614</guid>
            <dc:creator><![CDATA[Amshavarthana Srisivanathasarma]]></dc:creator>
            <pubDate>Thu, 02 Apr 2026 07:22:00 GMT</pubDate>
            <atom:updated>2026-04-02T07:40:05.614Z</atom:updated>
            <content:encoded><![CDATA[<p><em>While the industry fixates on large models, a quieter and more practical shift is happening in production AI one that demands a different kind of engineering expertise.</em></p><p>The conversation around artificial intelligence has been dominated by large language models. ChatGPT, Gemini, Claude these tools have reshaped how professionals work, communicate, and build software. Most engineers are familiar with them, and many have integrated them into their projects.</p><p>Yet there exists a category of AI models that receives considerably less attention, despite being more widely deployed in real-world production environments. These are <strong>Small Language Models </strong>and understanding them is quickly becoming one of the most sought-after skills in the industry.</p><h4><strong>What Is a Small Language Model?</strong></h4><p>A Small Language Model, or SLM, is a language model trained on a focused, domain-specific dataset rather than the broad corpus of data used to train large models. While an LLM is designed to respond to virtually any question across any subject, an SLM is deliberately constrained trained to perform exceptionally well within a defined scope.</p><p>Consider the distinction this way. A large language model resembles a highly educated generalist someone capable of discussing medicine, law, engineering, and literature with equal fluency. A small language model, by contrast, is a domain expert. It knows its subject deeply, responds with precision, and does so using a fraction of the computational resources.</p><blockquote>“ An LLM knows almost everything. An SLM knows exactly what you trained it on and that specificity is its greatest strength.”</blockquote><p>To illustrate with a practical scenario: suppose an organisation wishes to build an internal chatbot for its employees one that answers questions about HR policies, leave entitlements, and internal procedures. A general-purpose LLM has no knowledge of that organisation’s specific data. An SLM, trained on that company’s documentation, would answer every relevant query with accuracy while keeping all data entirely within the organisation’s control.</p><h4>Why Production Environments Favour SLMs</h4><p>Many engineers assume that deploying AI means integrating a large, cloud hosted model via an API. In reality, a significant number of companies particularly those handling sensitive data take a different approach.</p><p>There are three principal reasons for this preference:</p><p><strong>1.Data Privacy and Security</strong></p><p>When data is sent to an external LLM API, it leaves the organisation’s infrastructure. For companies in healthcare, finance, legal services, or government, this is not acceptable. An SLM deployed in house ensures that no data ever leaves the organisation’s servers.</p><p><strong>2.Cost Efficiency</strong></p><p>LLM API usage at scale is expensive. Every query incurs a cost. An SLM, once built and deployed, runs on internal infrastructure with no per call charges making it significantly more economical for high volume applications.</p><p><strong>3.Performance for Specific Tasks</strong></p><p>For narrow, well-defined tasks, a purpose-built SLM frequently outperforms a general purpose LLM. The model is not distracted by irrelevant training data it is optimised for exactly the task at hand.</p><h4>LLM vs SLM - A Structural Comparison</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*stJYRH-_6GlM0fGO5WZm7A.png" /></figure><p><strong>Practical Applications of SLMs</strong></p><p>Small Language Models are already in active use across a range of industries and contexts. The following represent the most prominent application areas:</p><ul><li><strong>Internal Knowledge Assistants - </strong>Chatbots trained on company documentation, policies, and procedures, deployed entirely within an organisation’s infrastructure.</li><li><strong>Text Prediction and Auto-Correction -</strong> The predictive text and autocorrect features on mobile devices are powered by small, on device language models.</li><li><strong>Customer Support Automation - </strong>Support bots trained on product-specific FAQs and documentation, providing accurate, in context responses.</li><li><strong>Smart and IoT Devices -</strong> SLMs are compact enough to run on embedded hardware, enabling AI capabilities in devices without cloud dependency.</li></ul><blockquote>A well constructed SLM does not attempt to know everything. <br>It is engineered to know the right things and to know them reliably.</blockquote><h4>Notable SLMs Available Today</h4><p>The ecosystem of small language models has matured considerably. Several leading technology organisations have released capable, openly available SLMs:</p><ul><li><strong>Phi-3</strong> (Microsoft) - A highly efficient SLM optimised for reasoning tasks on limited hardware.</li><li><strong>GPT-4o Mini</strong> (OpenAI) - A compact variant of GPT-4, designed for cost-effective deployment.</li><li><strong>Gemma</strong> (Google) - An open-source SLM well-suited for fine-tuning on domain-specific data.</li><li><strong>Mistral 7B - </strong>A widely adopted open-source model that delivers strong performance at modest scale.</li><li><strong>TinyLlama - </strong>An extremely lightweight model capable of running on very constrained hardware.</li></ul><p>Platforms such as <strong>Hugging Face</strong> host hundreds of pre trained SLMs across domains all freely available for download, fine tuning, and deployment.</p><h4>The Engineering Opportunity</h4><p>Building a system using a large, pre trained LLM via an API is relatively straightforward. The configuration is minimal and the capability is immediately available. However, that convenience comes at the cost of privacy, control, and long term affordability.</p><p>Designing, fine tuning, and deploying an SLM that meets the precise requirements of an organisation and doing so in a way that is efficient, maintainable, and production ready is a considerably more nuanced undertaking. It requires an understanding of model selection, data preparation, embedding strategies, retrieval mechanisms, and deployment infrastructure.</p><p>This is precisely why companies are actively seeking engineers with this capability. It is a skill set that remains underrepresented in the profession, despite its growing relevance in production AI environments.</p><blockquote>“Building a small, efficient SLM tailored to a company’s needs and deploying it in production that is real engineering.”</blockquote><p>📌 <strong>Key Takeaways</strong></p><p>✅ An SLM is trained on specific data - it excels within its domain, not beyond it.</p><p>✅ LLMs know almost everything. SLMs know exactly what you train them on and that specificity is their strength.</p><p>✅ SLMs run on standard hardware - laptops, mobile devices, and IoT systems. No powerful servers needed.</p><p>✅ For organisations with data privacy requirements, SLMs are the preferred production choice.</p><p>✅ Pre-trained SLMs from Microsoft, Google, and the open source community are freely available on Hugging Face.</p><p>✅ Building and deploying SLMs in production is a rare and in demand engineering skill.</p><p>✅ You do not always need a large model - the right small model, well deployed, solves real problems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=322701417614" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python & the Libraries That Will Actually Start Your Data Science Career]]></title>
            <link>https://medium.com/@amsha09sarma11/python-the-libraries-that-will-actually-start-your-data-science-career-62505bd8ff3f?source=rss-7c8c4a0c0c08------2</link>
            <guid isPermaLink="false">https://medium.com/p/62505bd8ff3f</guid>
            <dc:creator><![CDATA[Amshavarthana Srisivanathasarma]]></dc:creator>
            <pubDate>Mon, 30 Mar 2026 06:31:51 GMT</pubDate>
            <atom:updated>2026-04-02T03:10:19.256Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sdlvdHQNICLEYp3xJCymsQ.png" /></figure><p>Everyone starts somewhere. When I first heard terms like “<strong>data science</strong>” and “<strong>machine learning</strong>,” it felt like a world built for people with fancy degrees and years of experience. But the more I dug in, the more I realized something important the tools are not the hard part. Python is beginner friendly by design, and the libraries built around it are some of the most thoughtfully crafted tools in all of software.</p><p>If you’re thinking about breaking into data science, this article is your starting point. We’ll cover four essential libraries what they do, why they matter, and how they’re actually used in the real world. By the end, you’ll know exactly what to learn and why each piece fits together.</p><p><em>You don’t need to know everything before you start. You just need to know enough to begin and these four libraries are exactly that.</em></p><h4>Why Python? Because it reads like English.</h4><p>Before learning the libraries, you need to understand the language itself. Python is widely used in data science not because it’s the fastest, but because it’s easy to read and has a huge collection of useful tools.</p><p>For beginners, this is really important. Python allows you to focus more on solving problems instead of struggling with complicated syntax. The code you write often feels simple and clear, almost like reading plain English. That simplicity is one of the main reasons why Python has become the top choice for people working with data.</p><pre>● REAL WORLD<br>Netflix uses Python to analyze viewing patterns across millions of users and <br>decide which shows to recommend to you next.Every time you open Netflix and see <br>&quot;Top Picks for You,&quot; Python based data pipelines made that happen.<br></pre><h3>Numpy - The Engine Running Everything Else</h3><p>NumPy stands for Numerical Python. It gives you a data structure called an array think of it as a next level list that can do math across thousands of values in a single line. Almost every other data science library, including pandas and scikit-learn, is built on top of NumPy under the hood.</p><p>You won’t always use NumPy directly, but understanding it makes everything else click faster. When you see someone compute an average, normalize values, or reshape data NumPy is working behind the scenes.</p><pre>● REAL WORLD<br>Hospital systems use NumPy to process thousands of patientvitals at once <br>heart rate, blood pressure, temperature computing averages and detecting <br>anomalies across entire wards in milliseconds. What would take a loop hours, <br>NumPy does instantly.</pre><pre>import numpy as np<br><br># Imagine these are daily temperatures recorded by a weather station<br>temperatures = np.array([28.4, 31.2, 29.8, 35.1, 26.7, 33.0, 30.5])<br><br># Instantly compute stats across all 7 days<br>print(temperatures.mean())    # average temperature<br>print(temperatures.max())     # hottest day<br>print(temperatures.min())     # coolest day<br><br># Convert Celsius to Fahrenheit — all 7 values in ONE line<br>fahrenheit = (temperatures * 9/5) + 32<br>print(fahrenheit)<br><br># Find days hotter than 30°C — again, no loop needed<br>hot_days = temperatures[temperatures &gt; 30]<br>print(hot_days)<br></pre><pre>Output<br>30.671428...<br>35.1<br>26.7<br>[83.12 88.16 85.64 95.18 80.06 91.4 86.9 ]<br>[31.2 35.1 33. 30.5]</pre><p>See how you filtered temperatures above 30° in one line? With a regular Python list, you’d need a for loop. NumPy handles it instantly and that speed matters when your dataset has a million rows instead of seven</p><h3>Pandas - Where 80% of Your Real Work Actually Happens</h3><p>If NumPy is the engine, pandas is the cockpit. This is the library you will use every single day. Pandas lets you load, explore, clean, and transform data using a structure called a DataFrame essentially a spreadsheet that lives inside your Python code.</p><p>Here’s something they don’t tell you in tutorials most of a data scientist’s time isn’t spent building flashy models. It’s spent cleaning messy, inconsistent, real world data. Missing values. Typos. Wrong formats. Duplicates. Pandas gives you the tools to handle all of it.</p><pre>● REAL WORLD<br>E-commerce companies like Amazon use pandas-style pipelines to process <br>millions of order records daily cleaning duplicates, handling missing <br>delivery dates, calculating customer lifetime value, and flagging fraudulent <br>transactions before any ML model even sees the data.</pre><pre>import pandas as pd<br><br># Load a real dataset — imagine this is customer order data<br>df = pd.read_csv(&quot;orders.csv&quot;)<br><br># First look at the data<br>print(df.head())           # first 5 rows<br>print(df.shape)           # (rows, columns)<br>print(df.info())           # column types + null counts<br><br># Find and drop missing values<br>print(df.isnull().sum())   # see which columns have nulls<br>df = df.dropna(subset=[&#39;customer_id&#39;, &#39;order_value&#39;])<br><br># Filter only completed orders above $100<br>big_orders = df.query(&quot;status == &#39;completed&#39; and order_value &gt; 100&quot;)<br><br># Total revenue by product category<br>revenue_by_cat = (<br>    df<br>    .groupby(&#39;category&#39;)[&#39;order_value&#39;]<br>    .sum()<br>    .sort_values(ascending=False)<br>)<br>print(revenue_by_cat)<br></pre><pre>Output<br>category<br>Electronics 482300.50<br>Clothing 231500.75<br>Home &amp; Kitchen 189400.20<br>Books 54200.00</pre><p>In five lines of pandas, you went from a raw CSV to a clean revenue breakdown by category. That’s a real business insight. That’s exactly what data analysts do every day and now you can too.</p><h3>Matplotlib &amp; Seaborn - See What Your Data is Telling You</h3><p>Numbers in a table only go so far. The moment you visualize data, patterns become obvious that were completely invisible before. A spike in sales on a specific day. A cluster of customers who all behave the same way. An outlier that breaks your model. You can’t see any of that in a spreadsheet.</p><p>Matplotlib is the foundation it gives you full control over every pixel of your chart. Seaborn sits on top of it and makes beautiful statistical visualizations with just one or two lines. As a beginner, start with Seaborn. Use Matplotlib when you need fine-grained control.</p><pre>● REAL WORLD<br>Public health organizations used Matplotlib and Seaborn to visualize <br>COVID-19 case trends across countries the charts you saw in news articles <br>tracking daily case curves and vaccination rates were built using exactly<br>these libraries. Clear visuals turned raw numbers into policy decisions.</pre><pre>import seaborn as sns<br>import matplotlib.pyplot as plt<br><br># Distribution of order values — spot outliers instantly<br>sns.histplot(df[&#39;order_value&#39;], bins=30, kde=True, color=&#39;steelblue&#39;)<br>plt.title(&quot;Distribution of Order Values&quot;)<br>plt.xlabel(&quot;Order Value ($)&quot;)<br>plt.show()<br><br># Revenue by category — clear bar chart for stakeholders<br>sns.barplot(data=revenue_by_cat.reset_index(),<br>            x=&#39;category&#39;, y=&#39;order_value&#39;, palette=&#39;viridis&#39;)<br>plt.title(&quot;Total Revenue by Category&quot;)<br>plt.xticks(rotation=45)<br>plt.show()<br><br># Correlation heatmap — see which variables relate to each other<br>sns.heatmap(df.corr(numeric_only=True),<br>            annot=True, cmap=&#39;coolwarm&#39;, fmt=&#39;.2f&#39;)<br>plt.title(&quot;Feature Correlation Map&quot;)<br>plt.show()</pre><p>Think of visualization as having a conversation with your dataset. Before you build any model, always visualize first. It saves you from making assumptions the data would immediately prove wrong and it turns your analysis into something non technical stakeholders can actually understand.</p><h3>Scikit learn - Your First Machine Learning Library</h3><p>This is where it gets exciting. Scikit learn is the go to machine learning library for Python. It gives you clean, consistent tools for training models, evaluating them, and making predictions without needing a PhD to use the syntax. Every single algorithm follows the same pattern: import it, fit it on your data, predict with it. That consistency is a gift for beginners.</p><p>The beauty of scikit learn is that it abstracts away the complex mathematics so you can focus on understanding the concept and solving the problem first. You can always dig into the math later but you don’t need it to get started building real things.</p><pre>● REAL WORLD<br>Banks and fintech companies use scikit-learn models to predict loan <br>default risk. When you apply for a credit card and get approved in seconds,<br>a trained classification model — built on libraries exactly like this <br>scored your application against thousands of historical patterns and made<br>that decision automatically.</pre><pre>from sklearn.model_selection import train_test_split<br>from sklearn.linear_model  import LogisticRegression<br>from sklearn.metrics       import accuracy_score, classification_report<br><br># Features: customer age, order count, total spend<br>X = df[[&#39;age&#39;, &#39;order_count&#39;, &#39;total_spend&#39;]]<br>y = df[&#39;will_churn&#39;]   # 1 = customer left, 0 = stayed<br><br># Split into training and testing sets (80/20 split)<br>X_train, X_test, y_train, y_test = train_test_split(<br>    X, y, test_size=0.2, random_state=42<br>)<br><br># Train the model<br>model = LogisticRegression()<br>model.fit(X_train, y_train)<br><br># Predict on unseen data and evaluate<br>predictions = model.predict(X_test)<br>print(&quot;Accuracy:&quot;, accuracy_score(y_test, predictions))<br>print(classification_report(y_test, predictions</pre><pre>Output<br>Accuracy: 0.8742<br><br>precision recall f1-score support<br>0 0.91 0.92 0.91 823<br>1 0.78 0.76 0.77 377<br><br>accuracy 0.87 1200</pre><p>You just trained a customer churn prediction model in 10 lines. An 87% accurate model that a business could actually use to identify at risk customers and intervene before they leave. That’s the power of scikit learn real business problems, solved with beginner friendly code.</p><h4><em>Roadmap</em></h4><p><em>How to Learn These in Order</em></p><p>Don’t try to learn everything at once. Follow this sequence and you’ll build understanding that actually stacks:</p><ol><li>Python Basics - Variables, loops, functions, lists, dictionaries.</li><li>NumPy + Pandas - Load a real CSV dataset. Clean it.</li><li>Matplotlib + Seaborn - Visualize the same dataset. Build a histogram, a bar chart, and a correlation heatmap.</li><li>Scikit-learn - Train your first model on the Titanic or Iris dataset. Evaluate it. Understand the output.</li></ol><h3>Conclusion</h3><p>The only thing really stopping you is getting started.</p><p>Here’s the truth you don’t need to master everything before you begin. Just take the first step. Pick a dataset that genuinely interests you maybe movie ratings, cricket scores, or weather data. Load it using pandas, explore it with seaborn, and try building a simple model with scikit learn.</p><p>That one small project will teach you far more than weeks of just reading tutorials. Every data scientist you look up to whether they work at companies like Google or in industries like healthcare and finance started exactly the same way with a blank notebook and their first line of code.</p><p>So go ahead and write yours. Your journey begins with that single step.</p><p>I’m a data science student sharing what I learn the tools I use, the challenges I face, and the breakthroughs along the way. If that resonates with you, feel free to follow along.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62505bd8ff3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Precision in the Light Path Optimizing Optical Isolators Through Data Science]]></title>
            <link>https://medium.com/@amsha09sarma11/precision-in-the-light-path-c702402c8ad0?source=rss-7c8c4a0c0c08------2</link>
            <guid isPermaLink="false">https://medium.com/p/c702402c8ad0</guid>
            <dc:creator><![CDATA[Amshavarthana Srisivanathasarma]]></dc:creator>
            <pubDate>Fri, 26 Dec 2025 08:34:28 GMT</pubDate>
            <atom:updated>2025-12-26T08:49:02.670Z</atom:updated>
            <content:encoded><![CDATA[<h4>How a data driven Six Sigma approach is securing the future of high-speed fiber optic communication.</h4><p>In the sophisticated infrastructure of modern fiber optic communication, the <strong>optical isolator</strong> serves as an indispensable guardian. Though small, its role is foundational: it acts as a one-way valve for light, permitting signal transmission in one direction while strictly blocking back-reflections.</p><p>Without this “one-way street,” reflections can destabilize laser sources, degrade signal integrity, and trigger expensive system-wide failures. However, manufacturing these components is a high-stakes game of microns. Even the slightest process variation can lead to high <strong>insertion loss</strong> or insufficient isolation.</p><h3>The Research Spotlight</h3><p>A detailed study presented at the <strong>Undergraduate Symposium &amp; Innovation Exhibition</strong> (Paper ID: 25) recently tackled these manufacturing challenges head-on.</p><p>The research, titled <em>“Performance Improvement of Optical Isolators Using Statistical Quality Tools,”</em> was a collaborative effort by N.D.K. Nadeesha and a team of experts from the <strong>University of Kelaniya</strong> and the <strong>University of Peradeniya</strong> in Sri Lanka. Their goal? To move manufacturing away from guesswork and toward mathematical certainty.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gbGUbpMtK0O77T4rydyrRw.jpeg" /></figure><h3>A Systematic Framework: The DMAIC Approach</h3><p>The researchers utilized the <strong>Six Sigma DMAIC</strong> (Define, Measure, Analyze, Improve, and Control) methodology to transform the production process into a proactive, data-driven system.</p><p>Their rigorous approach included:</p><ul><li><strong>Big Data Analysis:</strong> The team scrutinized over 4,000 production records collected over five months.</li><li><strong>System Validation:</strong> To ensure data wasn’t skewed by human error, they conducted a <strong>Gage Repeatability and Reproducibility (Gage R&amp;R)</strong> study.</li><li><strong>Visualizing Performance:</strong> Using Pareto analysis, control charts, and histograms, the team mapped out exactly where the “leaks” in quality were occurring.</li></ul><h3>Key Insights: Pinpointing the Variation</h3><p>The statistical deep-dive provided an “aha” moment for the production line. Rather than finding a general decline in quality across the board, the data revealed that variation was highly localized.</p><p>The analysis showed that instability was concentrated at two specific “bookends”:</p><ol><li><strong>Step 1: Assembling</strong> (The beginning)</li><li><strong>Step 5: Final Inspection</strong> (The end)</li></ol><p>Meanwhile, the intermediate steps remained remarkably stable. This discovery allowed the researchers to bypass broad, ineffective changes and instead focus their <strong>Design of Experiments (DOE)</strong> on the specific stages causing signal instability.</p><blockquote>“In an era of global connectivity, quality in optical systems is not achieved by chance; it is engineered through meticulous measurement.”</blockquote><h3>The Result: Stability and Reliability</h3><p>By addressing the root causes identified in the data, the team implemented new <strong>Standard Operating Procedures (SOPs)</strong> to lock in these improvements.</p><p>For the telecommunications industry, this research translates to:</p><ul><li><strong>Fewer Failures:</strong> Higher durability in the field.</li><li><strong>Lower Costs:</strong> Reduced waste in the manufacturing process.</li><li><strong>Reliable Speed:</strong> More consistent high-speed data for the end-user.</li></ul><p>This study proves that even in the world of high-tech optics, the most powerful tool isn’t just the laser — it’s the data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c702402c8ad0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Simple Operating System from Scratch Using Assembly on Ubuntu]]></title>
            <link>https://medium.com/@amsha09sarma11/creating-a-simple-operating-system-from-scratch-using-assembly-on-ubuntu-cc1fc075c919?source=rss-7c8c4a0c0c08------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc1fc075c919</guid>
            <dc:creator><![CDATA[Amshavarthana Srisivanathasarma]]></dc:creator>
            <pubDate>Tue, 01 Jul 2025 11:44:50 GMT</pubDate>
            <atom:updated>2025-07-01T11:44:50.253Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>I recently took on the exciting challenge of building my own operating system from scratch using <strong>Assembly language</strong> and <strong>Ubuntu Linux</strong>. As a passionate learner of system-level programming, this journey helped me understand how computers boot, how memory works, and how operating systems begin their life after power-on.</p><p>This guide will walk you through how I built a basic “Hello World” Operating System, entirely using open-source tools on Ubuntu — no VirtualBox, no C language, just pure Assembly and a lot of curiosity.</p><h3>Why Assembly?</h3><p>While operating systems can be built using C or Rust, Assembly gives you <strong>complete control over the CPU</strong>, memory, and hardware. It’s perfect for learning how things <em>really</em> work under the hood.</p><h3>Tools Used</h3><ul><li>nasm — Netwide Assembler</li><li>qemu — Emulator to run OS images</li><li>ld &amp; gcc — Compiler and linker for the kernel</li><li>OS: Ubuntu 22.04 LTS</li></ul><pre>sudo apt update<br>sudo apt install nasm qemu gcc build-essential</pre><h3>What You’ll Learn</h3><ul><li>Writing a bootloader that prints directly to screen</li><li>Creating a minimal kernel that writes text to video memory</li><li>Combining everything into a bootable .bin file</li><li>Running it using qemu — no virtual machine needed</li></ul><p><strong>Writing the Bootloader</strong></p><pre>; boot.asm<br>[org 0x7c00]<br>mov ah, 0x0e<br>mov al, &#39;H&#39;<br>int 0x10<br>mov al, &#39;i&#39;<br>int 0x10<br>jmp $<br><br>times 510 - ($ - $$) db 0<br>dw 0xAA55</pre><pre>nasm -f bin boot.asm -o boot.bin</pre><p>Output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*IiEKlZOEeN_GriRJeakHdg.png" /></figure><p><strong>Writing the Kernel in C</strong></p><pre><br>void main() {<br>    char* str = &quot;Hello from Kernel!&quot;;<br>    char* video_memory = (char*) 0xb8000;<br>    for (int i = 0; str[i] != &#39;\0&#39;; i++) {<br>        video_memory[i * 2] = str[i];<br>        video_memory[i * 2 + 1] = 0x07;<br>    }<br>}<br></pre><pre>gcc -ffreestanding -c kernel.c -o kernel.o<br>ld -Ttext 0x100000 -o kernel.bin kernel.o --oformat binary</pre><p>Bootloader → Protected Mode → Kernel (loader.asm)</p><pre>[bits 16]<br>[org 0x7e00]<br>jmp 0x0000:start<br><br>start:<br>    cli<br>    xor ax, ax<br>    mov ds, ax<br>    lgdt [gdt_descriptor]<br>    mov eax, cr0<br>    or eax, 1<br>    mov cr0, eax<br>    jmp 0x08:protected_mode<br><br>[bits 32]<br>protected_mode:<br>    mov ax, 0x10<br>    mov ds, ax<br>    call 0x100000<br>    jmp $<br><br>gdt:<br>    dq 0x0000000000000000<br>    dq 0x00cf9a000000ffff<br>    dq 0x00cf92000000ffff<br><br>gdt_descriptor:<br>    dw gdt_end - gdt - 1<br>    dd gdt<br><br>gdt_end:</pre><p>Assemble:</p><pre>nasm -f bin loader.asm -o loader.bin</pre><p>Combine Everything</p><pre>cat boot.bin loader.bin kernel.bin &gt; os-image.bin</pre><p>Run the OS</p><pre>qemu-system-i386 -fda os-image.bin</pre><p>Expected Output: “<strong>Hello from Kernel!</strong>”</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc1fc075c919" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“Understanding Cache Memory, The Hidden Speed Booster in Your CPU”]]></title>
            <link>https://medium.com/@amsha09sarma11/understanding-cache-memory-the-hidden-speed-booster-in-your-cpu-f028a1079483?source=rss-7c8c4a0c0c08------2</link>
            <guid isPermaLink="false">https://medium.com/p/f028a1079483</guid>
            <dc:creator><![CDATA[Amshavarthana Srisivanathasarma]]></dc:creator>
            <pubDate>Sat, 07 Jun 2025 03:35:52 GMT</pubDate>
            <atom:updated>2025-06-07T03:50:54.062Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q8WdkUEIYGJH8jptXEHjhg.jpeg" /></figure><h3>What Is a Cache?</h3><p>Cache memory is a small, super-fast type of memory that stores frequently accessed data and instructions. It sits between the CPU and the main memory (RAM), acting like a high-speed buffer.</p><p>Whenever the CPU needs data, it first checks the cache:</p><ul><li>If the data is <strong>found in cache</strong> (called a <strong>cache hit</strong>), it can be used instantly.</li><li>If the data is <strong>not found</strong> (called a <strong>cache miss</strong>), it has to fetch it from the slower RAM.</li></ul><h3>Why Is Cache Important?</h3><p>Modern CPUs are incredibly fast, but RAM can’t always keep up. Cache helps by reducing the time the CPU has to wait for data.</p><p><strong>Benefits of Cache Memory:</strong></p><ul><li>Faster data access for the CPU</li><li>Better system performance</li><li>Lower memory latency</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*IHYjFoCtt-LwfxmWt76BMw.jpeg" /></figure><h3>Where Is Cache Memory Located?</h3><p>Cache memory is typically located <strong>inside the CPU chip</strong> or very close to it. There are usually <strong>multiple levels</strong> of cache:</p><ul><li><strong>L1 (Level 1) Cache</strong>: Very fast but small; located directly on the CPU core</li><li><strong>L2 (Level 2) Cache</strong>: Larger than L1, but slightly slower</li><li><strong>L3 (Level 3) Cache</strong>: Shared among cores, larger still, and slower than L2</li></ul><h3>How Cache Memory Works</h3><p>The CPU uses <strong>the principle of locality</strong>:</p><ul><li><strong>Temporal locality</strong>: Recently used data is likely to be used again soon</li><li><strong>Spatial locality</strong>: Data close to recently accessed data will likely be accessed soon too</li></ul><h3>Cache Design- Building an Efficient Memory System</h3><p>Cache memory plays a vital role in bridging the speed gap between the CPU and main memory. Designing a cache system involves several key factors that determine its performance and complexity.</p><h3>Core Components of Cache Design</h3><ol><li><strong>Cache Size</strong>: Total amount of data the cache can store. Larger caches can hold more data but are slower and more expensive.</li><li><strong>Block Size</strong>: The unit of data transferred between cache and memory. Larger blocks exploit spatial locality but may cause more data to be evicted.</li><li><strong>Mapping Function</strong>: Determines how memory blocks are placed in cache.</li><li><strong>Replacement Algorithm</strong>: Decides which block to remove when cache is full.</li><li><strong>Write Policy</strong>: Defines how data is written to memory (write-through or write-back).</li><li><strong>Number of Cache Levels</strong>: Modern CPUs often use multi-level caches (L1, L2, L3).</li></ol><h3>Mapping Function ( Placing Data in Cache)</h3><p>The mapping function controls <strong>where a memory block goes</strong> in the cache. There are three main types:</p><h4>1. Direct Mapping</h4><ul><li>Each block from main memory maps to <strong>exactly one cache line.</strong></li><li>Simple and fast but may cause frequent replacements if many blocks map to the same line.</li></ul><p><strong>Formula</strong>: Cache line = (Block address) MOD (Number of cache lines)</p><h4>2. Fully Associative Mapping</h4><ul><li>A memory block can be placed <strong>anywhere</strong> in the cache.</li><li>Provides flexibility but needs complex hardware to search all cache lines.</li></ul><h4>3. Set-Associative Mapping</h4><ul><li>A compromise between direct and fully associative.</li><li>Cache is divided into sets, and each memory block maps to one set. Within that set, the block can go anywhere.</li><li>Common designs are 2-way, 4-way, or 8-way set-associative.</li></ul><p><strong>(Example</strong>: 4-way set-associative means each set has 4 cache lines)</p><h3>Replacement Algorithms (Choosing What to Remove)</h3><p>When the cache is full and a new block needs to be loaded, the cache must evict one of the existing blocks. The replacement algorithm determines which block to remove.</p><h4>1. Least Recently Used (LRU)</h4><ul><li>Removes the block that hasn’t been used for the longest time.</li><li>Good hit ratio but complex to implement.</li></ul><h4>2. First-In, First-Out (FIFO)</h4><ul><li>Removes the oldest block in the set.</li><li>Simple but not always efficient.</li></ul><h4>3. Random Replacement</h4><ul><li>Removes a random block in the set.</li><li>Very simple, but unpredictable.</li></ul><h3><strong>🔴Final Thoughts</strong></h3><p>Cache memory may be small, but it has a huge impact on system performance. As CPUs become faster, the role of cache becomes even more critical in keeping up with data demands. Whether you’re a student learning computer architecture or a developer curious about system speed, understanding cache design helps you appreciate how your devices stay responsive and efficient.</p><p>A smart cache design can make the difference between a sluggish system and a lightning-fast one. It’s all about balancing size, mapping, and replacement strategy like organizing a tiny room to store everything you need, exactly when you need it.</p><p><strong>Direct Mapping Puzzle→</strong><br> If a cache has <strong>64 lines</strong>, and the <strong>main memory block address</strong> is <strong>145</strong>, which cache line will it map to? {Cache Line Number = (Main Memory Block Address) MOD (Number of Cache Lines)}</p><h3>◌Your Turn!</h3><p>Have questions, thoughts, or experiences with cache memory?<br> Drop a comment below I’d love to hear how caching impacts your tech life or projects!</p><p>And if you found this useful, don’t forget to <strong>clap</strong> and <strong>share</strong> to help others speed up their learning.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f028a1079483" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering the Principles of Software Construction]]></title>
            <link>https://medium.com/@amsha09sarma11/mastering-the-principles-of-software-construction-68a8474c8bec?source=rss-7c8c4a0c0c08------2</link>
            <guid isPermaLink="false">https://medium.com/p/68a8474c8bec</guid>
            <dc:creator><![CDATA[Amshavarthana Srisivanathasarma]]></dc:creator>
            <pubDate>Tue, 03 Jun 2025 04:17:01 GMT</pubDate>
            <atom:updated>2025-06-03T06:55:02.201Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tnNBlm7xjokOogBnePbPXg.png" /></figure><p><strong>Mastering the Principles of Software Construction: A Practical Guide for Students and Developers</strong></p><p>Software construction is more than just writing code. It’s about designing software that is readable, maintainable, scalable, and robust. Whether you’re an aspiring software engineer or a student like those studying “Fundamentals of Software Construction,” mastering these principles can dramatically improve the quality of your software and prepare you for real- world development challenges.</p><h3>What Is Software Construction?</h3><p>At its core, software construction involves transforming a design into working software through coding, testing, debugging, and integration. One of the most important areas of this process is <strong>class design</strong>, which plays a central role in object-oriented programming.</p><h3>Core Principles of Class Design</h3><h3>High-Quality Classes</h3><p>A good class is a <strong>collection of data and methods that share a cohesive, well-defined responsibility</strong>. It should offer a clear, minimal interface and hide internal implementation details through abstraction.</p><h3>Guidelines for Good Class Interfaces</h3><ul><li>Provide services in pairs (e.g., start()/stop())</li><li>Keep unrelated responsibilities in separate classes</li><li>Avoid exposing member data publicly</li><li>Minimize class and member accessibility</li><li>Ensure public methods align with the class’s main responsibility</li></ul><p>By adhering to these practices, you make your code easier to understand, modify, and extend.</p><h3>The SOLID Principles</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nM-PSRR8_ayd9IoCCMTvGA.png" /></figure><h4>1. Single Responsibility Principle (SRP)</h4><p>Every class should have one, and only one, reason to change. Keep your classes focused and cohesive. Avoid mixing responsibilities such as business logic and UI behavior in the same class.</p><h4>2. Open/Closed Principle (OCP)</h4><p>Software entities should be <strong>open for extension but closed for modification</strong>. This means you should be able to add new functionality without touching existing code, reducing the risk of introducing bugs.</p><h4>3. Liskov Substitution Principle (LSP)</h4><p>Subclasses should be replaceable for their parent classes without breaking the program. This principle enables safe polymorphism and enhances flexibility.</p><h4>4. Interface Segregation Principle (ISP)</h4><p>Clients should not be forced to depend on interfaces they do not use. Instead of having one large interface, break it down into smaller, more specific ones. This leads to better system decoupling and more maintainable code.</p><h4>5. Dependency Inversion Principle (DIP)</h4><p>Depend on abstractions, not on concrete implementations. This principle encourages the use of interfaces and abstract classes to reduce coupling between software modules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i8_JU7uS-66I4ljPyIXWFA.png" /></figure><h3><strong>Key Principles of Software Construction</strong></h3><p>Beyond SOLID, there are foundational software construction principles that help keep code simple, maintainable, and scalable:</p><p>1. <strong><em>Modularity</em></strong></p><p>Divide software into independent modules or components with clear responsibilities. This makes your system easier to understand, test, and maintain.</p><p>2.<strong><em>Abstraction</em></strong></p><p>Expose only essential features while hiding implementation details. Simplifies interface design and reduces coupling.</p><p>3. <strong><em>Encapsulation</em></strong></p><p>Keep data and methods that operate on that data within the same unit (class), and restrict outside access. This protects internal state and reduces bugs.</p><p>4. <strong><em>Separation of Concerns</em></strong></p><p>Split software into distinct parts, each handling a specific aspect (e.g., UI, logic, storage). Changes in one part are less likely to impact others.</p><p>5. <strong><em>Don’t Repeat Yourself (DRY)</em></strong></p><p>Avoid duplicating logic. Extract common code into functions, classes, or modules to reduce errors and ease maintenance.</p><p>6.<strong><em>Keep It Simple, Stupid (KISS)</em></strong></p><p>Prefer simple solutions over complex ones. Simplicity leads to fewer bugs and faster onboarding for new developers.</p><p>7. <strong><em>You Aren’t Gonna Need It (YAGNI)</em></strong></p><p>Only build what is needed today. Avoid overengineering or adding features based on speculation about future needs.</p><h3>Unit Testing: Building Confidence in Your Code</h3><p>Unit testing is the practice of testing individual components (like functions or methods) in isolation to ensure they perform as expected.</p><h4>Why Unit Testing Matters:</h4><ul><li><strong>Catches bugs early</strong> during development.</li><li><strong>Facilitates refactoring</strong> without fear of breaking functionality.</li><li><strong>Improves code design</strong>, encouraging modularity and separation of concerns.</li><li><strong>Documents expected behavior</strong> of your code.</li></ul><h4>Good Practices:</h4><ul><li>Follow <strong>TDD (Test-Driven Development)</strong> when possible.</li><li>Use popular frameworks like <strong>JUnit (Java)</strong>, <strong>PyTest (Python)</strong>, <strong>Jest (JavaScript)</strong>.</li><li>Cover <strong>edge cases</strong>, not just the happy path.</li><li>Ensure tests are <strong>fast</strong>, <strong>independent</strong>, and <strong>repeatable</strong>.</li></ul><h3>Naming Conventions: Code Should Speak for Itself</h3><p>Proper naming improves readability, maintainability, and collaboration. Code is read far more than it’s written.</p><h4>Guidelines for Good Naming:</h4><ul><li><strong>Be descriptive</strong>, not cryptic (e.g., calculateTotal() &gt; ct()).</li><li>Use <strong>camelCase</strong> for variables and methods, <strong>PascalCase</strong> for classes.</li><li>Avoid misleading or generic names like temp, data, foo.</li><li>Prefix booleans with verbs: isValid, hasPermission.</li><li>Use domain language: match terms used by stakeholders (e.g., Invoice, Customer, PaymentProcessor).</li></ul><h3>Anti-Patterns to Avoid</h3><p>While applying principles is important, it is equally critical to avoid common anti-patterns that hinder software quality:</p><ul><li><strong>God Classes</strong>: These are classes that try to do everything. They become bloated and difficult to maintain. Break them into smaller, well-focused components.</li><li><strong>Verb-Named Classes</strong>: Classes named after actions (e.g., HandleLogin, InitializeDatabase) often indicate that the logic might be better placed within a method or a more meaningful class.</li><li><strong>Public Data Members</strong>: Exposing class variables publicly violates encapsulation. Always use private members with getters/setters if necessary.</li><li><strong>Tight Coupling</strong>: Classes that heavily depend on each other are hard to test and change. Use interfaces and dependency injection to reduce this coupling</li></ul><h3>Expanding Your Mastery</h3><p>To truly master software construction, integrate the following into your learning:</p><ul><li><strong>Refactor Legacy Code</strong>: Take old code and refactor it using SOLID principles. This improves your ability to recognize and correct poor design.</li><li><strong>Review Open Source Projects</strong>: Analyze GitHub repositories to understand how professional developers structure their classes and systems.</li><li><strong>Write and Run Tests</strong>: Unit testing (e.g., using JUnit or PyTest) ensures that your classes behave as expected. Design for testability.</li><li><strong>Practice Abstraction and Encapsulation</strong>: Design systems where each component reveals only what is necessary and hides internal details.</li><li><strong>Understand and Use Design Patterns</strong>: Patterns like Factory, Strategy, and Observer solve common design problems and reinforce good principles.</li></ul><h3>Final Thoughts</h3><p>Mastering software construction means understanding that writing good code is about <strong>structure, responsibility, and clarity</strong>. By focusing on high-quality classes, applying SOLID principles, and actively avoiding anti-patterns, you build software that is easier to maintain, extend, and scale. These practices not only help in your academic projects but also prepare you for professional software engineering roles.</p><p>Embrace design thinking, seek feedback on your code, and continuously iterate. Software construction is a craft and like any craft, it rewards thoughtful practice.</p><p>Happy coding!</p><p><strong>References:</strong></p><ol><li>Geeks for Geeks: <a href="https://www.geeksforgeeks.org/solid-principle-in-programming-understand-with-real-life-examples/">https://www.geeksforgeeks.org/solid-principle-in-programming-understand-with-real-life-examples/</a></li><li>LearningFuze Software Design Principles Library: <a href="https://learningfuze.framer.website/library/software-design-principles">https://learningfuze.framer.website/library/software-design-principles</a></li><li>Martin, Robert C. <em>Agile Software Development: Principles, Patterns, and Practices</em>. Prentice Hall, 2002.</li><li>Gamma, Erich, et al. <em>Design Patterns: Elements of Reusable Object-Oriented Software</em>. Addison-Wesley, 1994.</li><li>JUnit 5 User Guide (Java):<a href="https://junit.org/junit5/docs/current/user-guide/">https://junit.org/junit5/docs/current/user-guide/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68a8474c8bec" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>