<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Dev Sai's TechBytes]]></title><description><![CDATA[Dev Sai's TechBytes]]></description><link>https://blog.saisiddhish.me</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1736382523469/406ffe31-c1ae-4175-9956-316700d58e88.png</url><title>Dev Sai&apos;s TechBytes</title><link>https://blog.saisiddhish.me</link></image><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Apr 2026 10:01:38 GMT</lastBuildDate><atom:link href="https://blog.saisiddhish.me/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[What is the "Deep" in Deep Learning?]]></title><description><![CDATA[Artificial Intelligence and Machine Learning are filled with buzzwords, and one of the most common terms you’ll encounter is "deep learning." But what does it mean for a model to be "deep," and how does it differ from other models? Let’s explore the ...]]></description><link>https://blog.saisiddhish.me/model-depth-in-ai-ml</link><guid isPermaLink="true">https://blog.saisiddhish.me/model-depth-in-ai-ml</guid><category><![CDATA[AI]]></category><category><![CDATA[Artificial Intelligence]]></category><category><![CDATA[ML]]></category><category><![CDATA[Machine Learning]]></category><category><![CDATA[neural networks]]></category><category><![CDATA[Deep Learning]]></category><category><![CDATA[depth]]></category><dc:creator><![CDATA[Sai Siddhish Chandra Sekaran]]></dc:creator><pubDate>Sun, 19 Jan 2025 20:00:24 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1737318377896/1b750ef0-9181-4c49-93a3-d5fb103374d6.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Artificial Intelligence and Machine Learning are filled with buzzwords, and one of the most common terms you’ll encounter is "deep learning." But what does it mean for a model to be "deep," and how does it differ from other models? Let’s explore the concept of depth in AI/ML.</p>
<h1 id="heading-understanding-depth-in-aiml">Understanding Depth in AI/ML</h1>
<p>In machine learning, a model’s depth refers to the number of layers between its input and output (often called hidden layers). These layers are part of the model’s architecture and play a crucial role in how it processes data and learns patterns.</p>
<h2 id="heading-shallow-models">Shallow Models</h2>
<p>A shallow model typically consists of one or a few layers:</p>
<ol>
<li><p><strong>Linear Regression and Logistic Regression</strong>: These are single-layer models with no hidden layers</p>
</li>
<li><p><strong>Support Vector Machines (SVMs)</strong>: These rely on kernel tricks rather than layered architectures</p>
</li>
<li><p><strong>Single-Layer Neural Networks</strong>: Sometimes called perceptrons, these models have only one hidden layer</p>
</li>
</ol>
<p>Shallow models work well for simpler problems or datasets with a limited number of features but struggle with complex data where intricate patterns must be learned.</p>
<h2 id="heading-deep-models">Deep Models</h2>
<p>Deep models, on the other hand, consist of multiple layers that work together in a series. Each neuron in a layer performs a transformation on the input, and the model learns hierarchical representations of the data.</p>
<ul>
<li><p><strong>Input Layer</strong>: Receives raw data (e.g., pixel values of an image).</p>
</li>
<li><p><strong>Hidden Layers</strong>: Intermediate layers extract increasingly abstract features.</p>
</li>
<li><p><strong>Output Layer</strong>: Produces predictions or classifications.</p>
</li>
</ul>
<p>Here’s a visual representation:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1737252940250/fd8c15bc-8577-4225-b686-636cad292940.png" alt class="image--center mx-auto" /></p>
<p>In the image above, each circle represents a neuron. Each neuron does some mathematical operation/transformation on the data it receives. Each vertical rectangle represents a layer. A singular layer can be composed of any number of neurons. There are also arrows between each neuron as each neuron completes a transformation and passes the data on to the next layer.</p>
<p>A "deep" model might have dozens or even hundreds of hidden layers, enabling it to capture intricate, multi-level features. Examples include deep convolutional networks for image processing and recurrent networks for sequential data like text or time series.</p>
<h1 id="heading-advantages-of-depth">Advantages of Depth</h1>
<p>Depth allows models to:</p>
<ol>
<li><p><strong>Learn Hierarchical Features</strong>:</p>
<ul>
<li>In an image recognition task, the first layer might detect edges, the second layer might identify shapes, and deeper layers might recognize objects.</li>
</ul>
</li>
<li><p><strong>Model Complex Relationships</strong>:</p>
<ul>
<li>Deep architectures can learn highly nonlinear mappings, making them suitable for tasks like natural language processing or speech recognition.</li>
</ul>
</li>
<li><p><strong>Parameter Sharing</strong>:</p>
<ul>
<li>In models like convolutional neural networks (CNNs), parameters (e.g., weights) are shared across layers, reducing redundancy and improving generalization.</li>
</ul>
</li>
<li><p><strong>End-to-End Learning</strong>:</p>
<ul>
<li>Deep models can handle raw data inputs, eliminating the need for extensive feature engineering.</li>
</ul>
</li>
</ol>
<h1 id="heading-challenges-of-depth">Challenges of Depth</h1>
<p>While deep models offer significant advantages, they are not without challenges:</p>
<ol>
<li><p>Computational Costs</p>
<ul>
<li><p>Training deep models requires significant computational resources, often involving GPUs or TPUs.</p>
</li>
<li><p>Deeper models have more parameters, leading to increased memory usage and longer training times.</p>
</li>
</ul>
</li>
</ol>
<ol start="2">
<li><p>Overfitting</p>
<ul>
<li><p>The large capacity of deep models can lead them to memorize training data instead of generalizing from it.</p>
</li>
<li><p>Techniques like dropout, L1/L2 regularization, and early stopping are used to mitigate overfitting.</p>
</li>
</ul>
</li>
<li><p>Vanishing and Exploding Gradients</p>
<ul>
<li><p>In very deep networks, gradients can become extremely small (vanishing) or large (exploding), making training unstable.</p>
</li>
<li><p>Features like ReLU (Rectified Linear Unit) activation functions and batch normalization help alleviate these issues.</p>
</li>
</ul>
</li>
<li><p>Data Requirements</p>
<ul>
<li>Deep models require large volumes of labeled data to learn effectively. Techniques like transfer learning and data augmentation can help in cases where data is limited.</li>
</ul>
</li>
</ol>
<h1 id="heading-key-innovations-driving-depth">Key Innovations Driving Depth</h1>
<p>The rise of deep learning is largely due to several breakthroughs:</p>
<ol>
<li><p><strong>ReLU Activation Function</strong>: Simplified training by addressing vanishing gradients.</p>
</li>
<li><p><strong>Dropout Regularization</strong>: Reduced overfitting by randomly deactivating neurons during training.</p>
</li>
<li><p><strong>Batch Normalization</strong>: Stabilized training and allowed for faster convergence.</p>
</li>
<li><p><strong>Transfer Learning</strong>: Enabled the reuse of pre-trained models, reducing the need for massive datasets.</p>
</li>
<li><p><strong>Advances in Hardware</strong>: GPUs and TPUs have made it feasible to train large, deep networks efficiently.</p>
</li>
</ol>
<h1 id="heading-applications-of-deep-models">Applications of Deep Models</h1>
<p>Deep models have become the foundation for many cutting-edge applications:</p>
<ul>
<li><p><strong>Computer Vision</strong>: Image classification, object detection, and facial recognition.</p>
</li>
<li><p><strong>Natural Language Processing</strong>: Machine translation, sentiment analysis, and chatbots.</p>
</li>
<li><p><strong>Reinforcement Learning</strong>: Autonomous vehicles, and game-playing agents.</p>
</li>
<li><p><strong>Healthcare</strong>: Disease diagnosis from medical imaging, and personalized treatment plans.</p>
</li>
<li><p><strong>Generative Models</strong>: Image and text generation, and deepfake creation.</p>
</li>
</ul>
<h1 id="heading-conclusion">Conclusion</h1>
<p>A "deep" model in AI/ML refers to architectures with multiple layers, enabling them to learn complex patterns from data. While depth provides great processing and capabilities, it also comes with challenges such as computational costs and the need for large datasets. Nevertheless, deep learning continues to be the core of revolutionizing technologies and services.</p>
]]></content:encoded></item><item><title><![CDATA[MACH Architecture: The Future of Scalable and Flexible Systems]]></title><description><![CDATA[MACH architecture, which stands for Microservices, API-first, Cloud-native, and Headless, is revolutionizing the design and implementation of digital experiences. By embracing modularity and flexibility, MACH empowers organizations to adapt to changi...]]></description><link>https://blog.saisiddhish.me/mach-architecture-the-future-of-scalable-and-flexible-systems</link><guid isPermaLink="true">https://blog.saisiddhish.me/mach-architecture-the-future-of-scalable-and-flexible-systems</guid><category><![CDATA[Mach]]></category><category><![CDATA[flexibility]]></category><category><![CDATA[scalability]]></category><category><![CDATA[components]]></category><category><![CDATA[Computer Science]]></category><category><![CDATA[modern]]></category><category><![CDATA[cms]]></category><category><![CDATA[CDN]]></category><category><![CDATA[cdm]]></category><category><![CDATA[Devops]]></category><dc:creator><![CDATA[Sai Siddhish Chandra Sekaran]]></dc:creator><pubDate>Wed, 08 Jan 2025 01:36:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1736300187817/669bf3c4-5be0-48a2-b9d8-f87895aa399a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>MACH architecture, which stands for <strong>M</strong>icroservices, <strong>A</strong>PI-first, <strong>C</strong>loud-native, and <strong>H</strong>eadless, is revolutionizing the design and implementation of digital experiences. By embracing modularity and flexibility, MACH empowers organizations to adapt to changing demands and innovate at scale.</p>
<h1 id="heading-what-is-mach-architecture">What is MACH Architecture?</h1>
<p>MACH is an architectural approach designed for organizations aiming to build flexible, scalable, and efficient digital systems. Unlike monolithic architectures that bundle the frontend and backend functionalities into a single application, MACH promotes modularity and composability, allowing businesses to select and integrate the solutions tailored to their needs.</p>
<h2 id="heading-breaking-down-mach">Breaking Down MACH</h2>
<ol>
<li><p>Microservices</p>
<ul>
<li><p>Independent, modular services that handle smaller, more specific functions.</p>
</li>
<li><p>Each microservice is self-contained and can be updated, scaled, or replaced without affecting other components.</p>
</li>
</ul>
</li>
<li><p>API-first</p>
<ul>
<li><p>APIs allow for seamless and easy communication between the backend and the frontend.</p>
</li>
<li><p>API-first ensures APIs are put at the forefront of development, are robust, and have good and developer-friendly documentation</p>
</li>
</ul>
</li>
<li><p>Cloud-native</p>
<ul>
<li><p>Built to use the cloud from the ground up.</p>
</li>
<li><p>Being entirely on the cloud instead of the singular or few servers common in monolithic architectures allows MACH architectures to automatically scale and handle dynamic workloads in real-time, allowing for much better cost efficiency.</p>
</li>
</ul>
</li>
<li><p>Headless</p>
<ul>
<li><p>Decoupling the frontend from the backend gives more flexibility in designing both sides, especially the frontend.</p>
</li>
<li><p>With a decoupled backend, the frontend can easily be more than just one application and leverage the singular, scaling backend (ex. a website and a mobile app using the same backend services)</p>
</li>
</ul>
</li>
</ol>
<h1 id="heading-core-benefits-of-mach">Core Benefits of MACH</h1>
<ol>
<li><p>Flexibility and Agility</p>
<ul>
<li>Due to being modular and focused on components and microservices, MACH allows for more quick updates to the individual components while maintaining a seamless UI/UX and not disrupting other parts of the backend. This allows for agile changes according to company needs or market demands.</li>
</ul>
</li>
<li><p>Scalability</p>
<ul>
<li>Being centered on the cloud and its emphasis on being cloud-native, microservices and modules used in MACH can be easily managed while also staying separate, allowing for dynamic scaling on an individual basis for each microservice; overall reducing costs and resources.</li>
</ul>
</li>
<li><p>Future-Ready Technology</p>
<ul>
<li>As mentioned previously, MACH encourages a composable/modular approach, allowing for businesses to easily swap out existing microservices to the cutting-edge without having to completely overhaul their infrastructure.</li>
</ul>
</li>
<li><p>Improved Development Speeds</p>
<ul>
<li>The API-first development that comes with MACH accelerates the integration and deployment of the various microservices and components, enabling faster rollouts of new features, fixes, and functionalities.</li>
</ul>
</li>
<li><p>Enhanced UX</p>
<ul>
<li>Due to having the backend and the frontend separated, the culmination of both can be done separately by different, specialized teams that can craft an improved UX across different devices and interfaces.</li>
</ul>
</li>
</ol>
<h2 id="heading-comparison-of-mach-to-traditional-architectures">Comparison of MACH to Traditional Architectures</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Feature</strong></td><td><strong>Monolithic Architecture</strong></td><td><strong>MACH Architecture</strong></td></tr>
</thead>
<tbody>
<tr>
<td>Modularity</td><td>Tight coupling of components</td><td>Loosely coupled microservices</td></tr>
<tr>
<td>Scalability</td><td>Entire system scales together</td><td>Individually-scaling services</td></tr>
<tr>
<td>Flexibility</td><td>Limited to existing infrastructure</td><td>High flexibility</td></tr>
<tr>
<td>Integration</td><td>Challenging &amp; time-consuming</td><td>Seamless via APIs</td></tr>
<tr>
<td>Deployment</td><td>Slow &amp; cumbersome</td><td>Rapid &amp; agile</td></tr>
</tbody>
</table>
</div><h1 id="heading-use-cases-of-mach-architecture">Use Cases of MACH Architecture</h1>
<p>MACH architecture is versatile and has been successfully implemented across industries:</p>
<ul>
<li><p><strong>Retail:</strong> Personalize customer experiences and scale to handle high traffic during sales events.</p>
</li>
<li><p><strong>Finance:</strong> Deliver secure, scalable online banking solutions and technologies.</p>
</li>
<li><p><strong>Healthcare:</strong> Create patient portals and manage sensitive data efficiently and securely.</p>
</li>
<li><p><strong>Media:</strong> Enable rapid content updates and seamless streaming services.</p>
</li>
</ul>
<h1 id="heading-cdm-amp-cms-systems-with-mach">CDM &amp; CMS Systems with MACH</h1>
<p>A key area where MACH architecture excels is in the integration of Content Delivery and Management (CDM) and Content Management Systems (CMS). These systems are central to delivering dynamic, personalized content across various interfaces and devices.</p>
<h3 id="heading-traditional-vs-mach-enabled-cms"><strong>Traditional vs. MACH-Enabled CMS</strong></h3>
<ul>
<li><p><strong>Traditional CMS:</strong> Often combines the frontend and backend in a monolithic system, making updates and scaling cumbersome and inefficient.</p>
</li>
<li><p><strong>MACH-Enabled CMS:</strong> Decouples content management from the delivery, enabling greater flexibility and control.</p>
</li>
</ul>
<h3 id="heading-advantages-of-mach-in-cdm-amp-cms"><strong>Advantages of MACH in CDM &amp; CMS</strong></h3>
<ol>
<li><p><strong>Multifaceted</strong> <strong>Delivery:</strong> Content can be delivered seamlessly across web, mobile, IoT, and other platforms.</p>
</li>
<li><p><strong>Faster Content Updates:</strong> Headless CMS solutions allow updates to be pushed without impacting the frontend.</p>
</li>
<li><p><strong>Personalization at Scale:</strong> APIs can be leveraged to integrate personalization tools, delivering tailored and enhanced UX.</p>
</li>
<li><p><strong>Improved Collaboration:</strong> Teams can work simultaneously on content creation/design and delivery/development without bottlenecks and waiting on one another.</p>
</li>
</ol>
<h3 id="heading-examples-of-mach-ready-cms-tools"><strong>Examples of MACH-Ready CMS Tools</strong></h3>
<ul>
<li><p><strong>Contentful:</strong> A headless CMS designed for API-first integration.</p>
</li>
<li><p><strong>Strapi:</strong> Open-source and customizable for varied use cases.</p>
</li>
<li><p><strong>Sanity:</strong> Provides real-time collaboration and flexible data modeling.</p>
</li>
</ul>
<h1 id="heading-conclusion">Conclusion</h1>
<p>MACH architecture represents a shift in how digital systems are built and maintained. By embracing its principles, businesses can unlock new levels of innovation, scalability, and customer satisfaction. MACH provides the foundation for creating digital experiences that are not only powerful but also future-proof.</p>
]]></content:encoded></item><item><title><![CDATA[The Beginner's Guide to Web Development in 2025]]></title><description><![CDATA[Web development (often shortened to web dev) remains one of the most in-demand and exciting fields in technology. Whether you want to create stunning websites, build interactive applications, or launch your own tech startup, web development is a skil...]]></description><link>https://blog.saisiddhish.me/the-beginners-guide-to-web-development-in-2025</link><guid isPermaLink="true">https://blog.saisiddhish.me/the-beginners-guide-to-web-development-in-2025</guid><category><![CDATA[HTML5]]></category><category><![CDATA[CSS]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[Frontend Development]]></category><category><![CDATA[Backend Development]]></category><category><![CDATA[Visual Studio Code]]></category><dc:creator><![CDATA[Sai Siddhish Chandra Sekaran]]></dc:creator><pubDate>Wed, 01 Jan 2025 14:00:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1735716241449/987b2d40-e6fc-46f2-8f17-e15f703d99b0.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Web development (often shortened to web dev) remains one of the most in-demand and exciting fields in technology. Whether you want to create stunning websites, build interactive applications, or launch your own tech startup, web development is a skill worth mastering. This guide will walk you through everything you need to know to get started with web development in 2025.</p>
<h1 id="heading-why-learn-web-dev">Why Learn Web Dev?</h1>
<p>Hundreds of billions or trillions of resources are accessible on the internet, ones we all use daily — from helpful articles online to entertainment on streaming services. The medium of all this content exchange is websites.</p>
<p>Web developers play a critical role in shaping the online experience by building and maintaining websites and applications that allow nearly anyone to access a variety of resources and information easily and efficiently.</p>
<p>Learning Web Dev, even in the world of AI, allows you to:</p>
<ul>
<li><p>Create your own personal or business websites</p>
</li>
<li><p>Build web applications that solve real-world challenges and crises</p>
</li>
<li><p>Explore high-demand career opportunities in Computer Science and other related fields</p>
</li>
<li><p>Contribute to meaningful or interesting open-source projects</p>
</li>
</ul>
<h1 id="heading-the-basics-a-trio">The Basics: A Trio</h1>
<p>At the core of website development are three technologies: HTML, CSS, and JavaScript. No matter what advanced framework or technology someone or company uses, at some point all that code must be put into HTML, CSS, and JavaScript as those are the fundamental languages that browsers (like Google Chrome, Microsoft Edge, Apple Safari, etc.) know and can interpret.</p>
<p>Let’s dive into the fundamental trio:</p>
<ol>
<li><p><strong>H</strong>yper<strong>T</strong>ext <strong>M</strong>arkup <strong>L</strong>anguage (HTML)</p>
<ul>
<li><p>HTML defines the basic structure (or markup) of a page</p>
</li>
<li><p>Ex. Headers, Footers, Paragraphs, Links, Images, etc.</p>
</li>
</ul>
</li>
<li><p><strong>C</strong>ascading <strong>S</strong>tyle <strong>S</strong>heets (CSS)</p>
<ul>
<li><p>Adds style and design on top of HTML</p>
</li>
<li><p>Ex. Changing colors, fonts, layouts, etc.</p>
</li>
</ul>
</li>
<li><p><strong>J</strong>ava<strong>S</strong>cript (JS)</p>
<ul>
<li><p>Adds interactivity and dynamic behavior to your site</p>
</li>
<li><p>Ex. Form validation, Authentication, Interactive menus, etc.</p>
</li>
</ul>
</li>
</ol>
<h2 id="heading-resources-to-learn">Resources to Learn</h2>
<p>There are many resources (videos, websites, articles, etc.) available online to teach HTML, CSS, and JavaScript in-depth. If you are truly interested in Web Development, learning these three languages is an absolute must, even with the numerous other frameworks and technologies in 2025.</p>
<p>Here are a couple of resources I found/used (I am not endorsed, sponsored, or affiliated with these in any way)</p>
<ol>
<li><p>freeCodeCamp:</p>
<ul>
<li><p>HTML Video: <a target="_blank" href="https://www.youtube.com/watch?v=kUMe1FH4CHE">https://www.youtube.com/watch?v=kUMe1FH4CHE</a></p>
</li>
<li><p>CSS Video: <a target="_blank" href="https://www.youtube.com/watch?v=OXGznpKZ_sA">https://www.youtube.com/watch?v=OXGznpKZ_sA</a></p>
</li>
<li><p>JS Video: <a target="_blank" href="https://www.youtube.com/watch?v=PkZNo7MFNFg">https://www.youtube.com/watch?v=PkZNo7MFNFg</a></p>
</li>
</ul>
</li>
<li><p>W3Schools:</p>
<ul>
<li><p>HTML Website: <a target="_blank" href="https://www.w3schools.com/html/">https://www.w3schools.com/html/</a></p>
</li>
<li><p>CSS Website: <a target="_blank" href="https://www.w3schools.com/css/">https://www.w3schools.com/css/</a></p>
</li>
<li><p>JS Website: <a target="_blank" href="https://www.w3schools.com/js/">https://www.w3schools.com/js/</a></p>
</li>
</ul>
</li>
</ol>
<h1 id="heading-choosing-your-tools">Choosing Your Tools</h1>
<p>When developing in HTML, CSS, and JavaScript, I recommend the following tools: (again, I am not endorsed, sponsored, or affiliated with these in any way)</p>
<ol>
<li><p>Text Editor: Visual Studio Code (VS Code)</p>
<ul>
<li>Website: <a target="_blank" href="https://code.visualstudio.com/">https://code.visualstudio.com/</a></li>
</ul>
</li>
<li><p>In VS Code: The Live Server extension for easily viewing code changes in real time</p>
<ul>
<li>Live Server: <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer">https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer</a></li>
</ul>
</li>
<li><p>Browser: Google Chrome, Microsoft Edge, or Mozilla Firefox for their excellent debugging tools</p>
<ul>
<li><p>Google Chrome: <a target="_blank" href="https://www.google.com/chrome/">https://www.google.com/chrome/</a></p>
</li>
<li><p>Microsoft Edge: <a target="_blank" href="https://www.microsoft.com/en-us/edge">https://www.microsoft.com/en-us/edge</a></p>
</li>
<li><p>Mozilla Firefox: <a target="_blank" href="https://www.mozilla.org/en-US/firefox/new/">https://www.mozilla.org/en-US/firefox/new/</a></p>
</li>
</ul>
</li>
</ol>
<h1 id="heading-frontend-vs-backend-development">Frontend vs. Backend Development</h1>
<p>Before this guide proceeds on about Web Dev, it’s important to understand the basics of frontend vs backend development.</p>
<h2 id="heading-frontend-development">Frontend Development</h2>
<p>Frontend development focuses on the part of a website that users interact with directly. It involves creating the visual elements and ensuring an engaging user experience. Key aspects include:</p>
<ul>
<li><p><strong>User Interface (UI):</strong> Designing layouts, buttons, and navigation</p>
</li>
<li><p><strong>Responsive Design:</strong> Making websites adaptable to various devices</p>
</li>
<li><p><strong>Interactivity:</strong> Using JavaScript to handle events like clicks or form submissions</p>
</li>
</ul>
<h2 id="heading-backend-development">Backend Development</h2>
<p>Backend development involves the server-side logic and functionality that support the frontend. It ensures data is processed, stored, and retrieved correctly. Key aspects include:</p>
<ul>
<li><p><strong>Databases:</strong> Storing and managing data</p>
</li>
<li><p><strong>Server Logic:</strong> Handling requests and sending appropriate responses</p>
</li>
<li><p><strong>Authentication:</strong> Verifying user identities securely</p>
</li>
</ul>
<h2 id="heading-collaboration-between-frontend-and-backend">Collaboration Between Frontend and Backend</h2>
<p>Frontend and backend developers often work closely to build a cohesive application. APIs (Application Programming Interfaces) — a more advanced topic — serve as the bridge between the frontend and backend, enabling smooth communication and data exchange.</p>
<h1 id="heading-modern-frontend-development">Modern Frontend Development</h1>
<p>On top of the existing foundations of HTML, CSS, and JavaScript exist newer and more modern ideas and concepts that exist to further enhance UX (User Experience).</p>
<h2 id="heading-responsive-design">Responsive Design</h2>
<p>As phones and other non-computer devices gain popularity, ensuring your website looks good and has good UX (User Experience) across all screen sizes is essential. The main way to keep or improve UX on varying devices is via CSS. Some useful things to learn are:</p>
<ul>
<li><p><strong>Media Queries:</strong> CSS rules for different screen sizes (<code>@media</code> in CSS)</p>
</li>
<li><p><strong>Container Queries:</strong> Similar to Media Queries, but based on the size of elements instead of the screen size (<code>@container</code> in CSS)</p>
</li>
<li><p><strong>Flex/Flexbox and Grid:</strong> Layout systems for responsive design (<code>display: flex;</code> and <code>display: grid;</code> in CSS)</p>
</li>
</ul>
<h2 id="heading-es6-javascript-enhancements">ES6 JavaScript Enhancements</h2>
<p>Modern JS provides many amazing utilities and functionalities for you to utilize, such as:</p>
<ul>
<li><p><strong>Arrow Functions:</strong> Simplifies the typical function syntax</p>
</li>
<li><p><strong>Promises &amp; Async/Await:</strong> Handle asynchronous tasks better (ex. database fetching or API calls)</p>
</li>
<li><p><strong>Modules:</strong> Organize your code into more reusable chunks</p>
</li>
</ul>
<h2 id="heading-frontend-frameworks">Frontend Frameworks</h2>
<p>There are several web development-related frontend frameworks that can help you streamline the process (these are meant to help you later on, not replace learning HTML, CSS, and JS!). Some of these include:</p>
<ul>
<li><p><strong>React:</strong> A popular library (developed at Meta/Facebook!) for making UIs (User Interfaces)</p>
</li>
<li><p><strong>Vue:</strong> A beginner-friendly library; similar to React</p>
</li>
<li><p><strong>Angular:</strong> A comprehensive framework (developed at Google!) for large applications</p>
</li>
</ul>
<h1 id="heading-basics-of-backend-development">Basics of Backend Development</h1>
<h2 id="heading-what-is-it">What is it?</h2>
<p>The backend manages server-side operations like data storage, user authentication, and business logic. It serves as the unseen powerhouse that ensures websites and applications function smoothly. Key technologies include:</p>
<ul>
<li><p><a target="_blank" href="https://nodejs.org/en/about"><strong>Node.js</strong></a><strong>:</strong> A runtime environment that allows JavaScript to be executed on the server side, making it a versatile tool for full-stack developers</p>
<ul>
<li>Typically, plain JavaScript will be run by the user’s browser, meaning all plain JS will be run client-side. More sensitive operations that shouldn’t be fully exposed to the user yet should still impact the user in some way is where a server comes in.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://expressjs.com/"><strong>Express.js</strong></a><strong>:</strong> A minimal framework for building APIs, simplifying routing and much more</p>
</li>
<li><p><strong>Databases (DBs):</strong> Systems like <a target="_blank" href="https://www.mysql.com/">MySQL</a>, <a target="_blank" href="https://www.postgresql.org/">PostgreSQL</a>, <a target="_blank" href="https://www.mongodb.com/">MongoDB</a>, and other DBs store and manage the data that powers applications</p>
</li>
</ul>
<h2 id="heading-frontend-communication">Frontend Communication</h2>
<p>As mentioned earlier, the frontend is the client-side (what the user sees) and the backend is the server(s). These two systems need to work together to create a cohesive application, yet you may notice they happen on completely different hardware. So how does the backend (server) communicate to the frontend (client)?</p>
<p>Most of the time, the frontend and backend communicate via APIs (usually RESTful APIs).</p>
<p>To learn more about APIs, you can read <a target="_blank" href="https://devsai.hashnode.dev/what-are-apis">my blog about them</a>.</p>
<h1 id="heading-full-stack-development">Full-Stack Development</h1>
<p>Full-stack development is when you manage the frontend and the backend to run one application.</p>
<h2 id="heading-popular-full-stack-dev-tools">Popular Full-Stack Dev Tools:</h2>
<ul>
<li><p><strong>MERN Stack</strong></p>
<ul>
<li>“MERN” stands for <a class="post-section-overview" href="#heading-what-is-it">MongoDB</a>, <a class="post-section-overview" href="#heading-what-is-it">Express</a>, <a class="post-section-overview" href="#heading-frontend-frameworks">React</a>, and <a class="post-section-overview" href="#heading-what-is-it">Node.js</a></li>
</ul>
</li>
<li><p><a target="_blank" href="https://nextjs.org/"><strong>Next.js</strong></a><strong>:</strong> A React-based framework for building server-rendered apps</p>
</li>
<li><p><a target="_blank" href="https://www.djangoproject.com/"><strong>Django</strong></a><strong>:</strong> A Python-based framework for web development</p>
</li>
</ul>
<h1 id="heading-version-control-software-vcs">Version Control Software (VCS)</h1>
<p>Throughout any coding project (be it in web development or not), it is very important to track changes, especially in a collaborative environment. Software and tools that keep track of changes in files are called version control software (VCS). For this, <strong>Git</strong> and <strong>GitHub</strong> are very popular (currently owned by Microsoft!).</p>
<h1 id="heading-deployment">Deployment</h1>
<p>Once your website or project is ready, you can share it with the world via many different routes.</p>
<p>Here are some deployment technologies that let you share your web dev creations!:</p>
<ul>
<li><p><a target="_blank" href="https://pages.github.com/"><strong>GitHub Pages</strong></a><strong>:</strong> A hosting service provided by GitHub that allows you to host a static website from a GitHub repository</p>
<ul>
<li>Static just means that it doesn’t use a backend and is typically written in unchanging files (ex. HTML, CSS, and JS trio).</li>
</ul>
</li>
<li><p><a target="_blank" href="https://www.netlify.com/"><strong>Netlify</strong></a><strong>:</strong> Similar to GitHub Pages and is good with static sites</p>
</li>
<li><p><a target="_blank" href="https://vercel.com/"><strong>Vercel</strong></a><strong>:</strong> A great hosting service, especially for React and Next.js (it can also link to GitHub)</p>
</li>
<li><p><a target="_blank" href="https://render.com/"><strong>Render</strong></a><strong>:</strong> A very flexible platform that can host both frontend, backend, and full-stack applications</p>
</li>
</ul>
<h1 id="heading-tips-for-success">Tips for Success</h1>
<ul>
<li><p><strong>Start Small:</strong> Build simple projects to reinforce your learning</p>
</li>
<li><p><strong>Practice &amp; Code Consistently:</strong> Coding consistently helps solidify concepts</p>
</li>
<li><p><strong>Explore Resources:</strong> Use free and paid tutorials, such as W3Schools, MDN Web Docs, and YouTube channels (other resources shared above!).</p>
</li>
</ul>
<h1 id="heading-conclusion">Conclusion</h1>
<p>Website development is a journey that combines creativity and technical skills. By mastering the basics, exploring modern tools, and deploying your projects, you’ll be well on your way to becoming a web developer in 2025. Remember, the key is to keep learning, experimenting, and building.</p>
<p>Happy coding!</p>
]]></content:encoded></item><item><title><![CDATA[Reinforcement Learning and Q-Learning]]></title><description><![CDATA[Introduction
The majority of people have utilized streaming services like Disney Plus, Netflix, and YouTube. These services use a recommendation system to keep you on their website and amused. This algorithm uses the content you've recently watched t...]]></description><link>https://blog.saisiddhish.me/reinforcement-learning-and-qlearning</link><guid isPermaLink="true">https://blog.saisiddhish.me/reinforcement-learning-and-qlearning</guid><category><![CDATA[AI]]></category><category><![CDATA[Reinforcement Learning]]></category><category><![CDATA[Q-learning]]></category><category><![CDATA[2Articles1Week]]></category><dc:creator><![CDATA[Sai Siddhish Chandra Sekaran]]></dc:creator><pubDate>Wed, 26 Jul 2023 12:30:10 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/4sRFTaQSM8Q/upload/1a73bc9118cb82aad8227ddc7754eed6.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-introduction">Introduction</h1>
<p>The majority of people have utilized streaming services like Disney Plus, Netflix, and YouTube. These services use a recommendation system to keep you on their website and amused. This algorithm uses the content you've recently watched to propose similar content that could be of interest to you. These algorithms for content recommendations are frequently reinforcement learning models.</p>
<h2 id="heading-vocabulary-words">Vocabulary Words</h2>
<p>Before we continue, I think it will benefit us all to learn some essential reinforcement learning vocabulary words.</p>
<ul>
<li><p>Agent: The reinforcement learning model that is making the decisions</p>
</li>
<li><p>Environment: The external system/area that the agent is getting its data from</p>
</li>
<li><p>Reward: The human feedback from the environment</p>
</li>
<li><p>State: The environment at a specific time (kind of like one picture frame of a video).</p>
</li>
<li><p>Action: The response of the agent to a state using its policy</p>
</li>
<li><p>Policy: Maps an observation to an action, basically how the model converts a human action to its response</p>
</li>
<li><p>(Q-Learning term) Q-Table: A table that maps actions to states/observations, this will help the agent determine what the best action to do for a given state.</p>
</li>
</ul>
<h1 id="heading-what-is-reinforcement-learning">What is Reinforcement Learning?</h1>
<p>Reinforcement Learning is a type of machine learning that tries to maximize receiving a reward by leveraging information from its environment. In streaming services, the agent aims to increase customer engagement. When you are asked to rate your experience with something on YouTube, it typically appears in a popup that looks like this:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690316615869/81d2949f-ebee-43d5-931f-016cb7039d34.png" alt class="image--center mx-auto" /></p>
<p>With a popup similar to the one above, you might tell YouTube's recommendation algorithm that you didn't like a video or didn't think it was worth watching. This information would likely be added to your state. Consequently, the recommendation engine would be less likely to suggest items that you would enjoy. Contrarily, giving a movie or experience positive comments would encourage the model to show you more of that kind of content (and result in a better reward for the agent).</p>
<h2 id="heading-an-example-of-reinforcement-learning">An Example of Reinforcement Learning</h2>
<p>Let's say we're trying to build a Reinforcement learning model that aims to recommend videos of interest to users that they will watch for as long as possible (to increase user engagement times).</p>
<p>In this example, the state for each user will consist of the video they may be watching right now, and previous videos to demonstrate their interests (I only added the most recent two videos for convenience). However, the state may be affected by many additional variables in more complicated circumstances, such as location, language, weather, and time of day.</p>
<p>The reward for this could be a variety of things, but in this example, it will be determined by how many minutes of a recommended video a user watches divided by the total number of minutes in the video (minutes watched by the user / total minutes in the video), with a decimal value ranging from 0 to 1. In this case, the reward for watching 100% of the movie would be 1, 0.5 for watching 50% of the video, 0.25 for watching 25% of the film, etc. A chart with various examples of user states and rewards is shown below.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690316658914/aba0ccdf-6996-4d5f-b1a9-2d55824f2440.png" alt /></p>
<p>People who aren't recommended the videos they usually watch are likely to lose interest in the recommended videos quickly. To maintain user interest, it is crucial for these content recommendation bots to suggest to the user what they want. Users 1 and 2 were provided with videos that were obviously unrelated to their interests, as shown in the chart above (humans can easily determine their interests based on their watch history).</p>
<p>There are a few modifications that might be made to this system to make it more sophisticated, one of which is to give rewards weights (weighted rewards). In the given case, this involves rewarding the agent more generously the longer a user views the recommended video. However, if the video is of the user's interest, then the reward should also be increased. In this manner, the agent is more likely to suggest videos that the user will find interesting. Some readers may be wondering how a non-human AI could tell the topic of a video. How a non-human AI could identify the content of a video may be a mystery to some readers. Sentiment Analysis is a tool used in Natural Language Processing (NLP) that can extract thoughts, feelings, and opinions from text, but we won't discuss that in this post because it is a totally different topic. Returning to the topic of weighted rewards, the table shown above allows us to monitor the user's interest (see an example of this table below). We can check to see if the title and description of the video the user is watching are related to their interest(s) before deciding what to reward the agent for the user's watch time. Additionally, it means that the agent will be given additional consequences for suggesting a video that is unrelated to the user's interests.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690316672750/0fc584e6-49cd-4c46-b618-9d03b6b69f01.png" alt /></p>
<h2 id="heading-how-the-agent-maximizes-its-reward">How the Agent Maximizes its Reward</h2>
<p>There is one significant question I have not addressed yet. Which is how does the agent maximize its reward? In our example, the agent would receive some feedback from the user (such as watch time, likes and dislikes, star ratings, or ratings from a popup) and "re-train" itself (correct its decision-making policy) to take into account said feedback in future actions. In doing so, it iteratively gets better and improves its policy. Improvements to an agent's policy would look something like this:</p>
<ul>
<li><p>Iteration 0: Recommend trending videos on the platform (To User X)</p>
</li>
<li><p>Iteration 1: Recommend Minecraft videos (To User X)</p>
</li>
<li><p>Iteration 2: Recommend Minecraft Survival videos (To User X)</p>
</li>
<li><p>Iteration 3: Recommend Minecraft Survival PvP videos (To User X)</p>
</li>
</ul>
<p>It repeats this cycle with a large number of users, and with time the policy begins to get better and better, eventually producing a content recommendation agent that amuses the users fairly effectively.</p>
<h3 id="heading-another-example-of-how-the-agent-maximizes-its-reward">Another Example of How the Agent Maximizes its Reward</h3>
<p>To make it easier to highlight iteratively improving an agent's policy, here's another example:</p>
<p>Consider creating a reinforcement learning model to move through a game without hitting any obstacles. The agent must navigate its way from a starting room to a finishing room. Moving forward, backward, left, and right are the possible actions in each state, which can be thought of as a room. If the agent encounters an obstacle, it receives a reward of -1; and if it beats the level, it receives a reward of 1. Additionally, all other transitions (events) would not be scored or would receive a little negative score, such as -0.01, because the only thing we want this agent to avoid colliding with is obstacles.</p>
<p>The first time the agent plays through the game, it would have a random policy that would cause it to lose with a reward of -1. However, over time, as the agent plays the game as explores its environment and the rewards that result from certain actions in certain states, it will develop a policy that can beat the game pretty well!</p>
<h1 id="heading-q-learning">Q-Learning</h1>
<p>Let's take a look at one of the most popular Reinforcement Learning algorithms called Q-Learning. Policy iteration is how Q-Learning functions. It operates on a table with dimensions equal to the number of potential states (rows) and actions (columns). If we attempted to apply Q-Learning in the example above, we would have a table with the number of rooms (the number of states) x the 4 (the number of actions.</p>
<p>The agent's Q-Table will initially contain just random integers, often 0s, as it has no way of understanding what the best action is in any given state. The agent will then do random actions and log its reward in the Q-Table. Later, when the agent is selecting which action to take, it will look at the Q-Table to see which action produced the best results for the state it is in at the time.</p>
<p>Q-Learning agents typically follow a formula similar to this:</p>
<p>$$Q^{new}(s_t, a_t) ← (1 - α) ⋅ Q(s_t, a_t) + α\left(r_t + γ ⋅ maxQ\left(s_{t+1},a \right) \right)$$</p><p>I will explain the different letters you see in the formula above.</p>
<p>$$Q \text { means the Q-table}$$</p><p>$$_t \text { means at that specific time}$$</p><p>$$s \text { means state}$$</p><p>$$a \text { (the English letter) means action}$$</p><p>$$r \text { means reward}$$</p><p>$$\gamma \text { means the discount factor (how much weight a reward carries)}$$</p><p>$$\alpha \text { (alpha, the Greek letter) means the learning rate}$$</p><h2 id="heading-implementing-q-learning">Implementing Q-Learning!</h2>
<p>I am unable to implement a full content recommendation system because it is a highly complex task. Instead, I'll be creating a very basic Q-Learning agent that can be used with the game "Frozen Lake" through the Python package "Gymnasium" (formerly known as "Gym"). The code will be shared step-by-step in this article, and for those who wish to execute or alter it, the Python (.py) and Jupyter file (.ipynb) downloads will be provided at the end.</p>
<h3 id="heading-importing-the-necessary-libraries">Importing the Necessary Libraries</h3>
<p>For our program to work, it is going to need some Python libraries, which will be imported in the code block below.</p>
<p>The libraries we are going to import are Numpy and Gymnasium (explained below).</p>
<ul>
<li><p>Numpy is a very popular Python library that is used in a lot of situations. It is mainly used for its amazing scientific computational abilities on arrays. In this notebook, it will be used to maintain the Q-Table.</p>
</li>
<li><p>Gymnasium (which will be referred to as "Gym" for the duration of this article) is a Python library made by OpenAI (the company behind ChatGPT) that has many environments for training Reinforcement Learning models (such as this one).</p>
</li>
</ul>
<pre><code class="lang-python"><span class="hljs-comment"># Bash command to install the libraries</span>
!pip install numpy
!pip install gymnasium[toy-text] <span class="hljs-comment"># The Frozen Lake game is classified as a "Toy Text" game in Gym</span>
<span class="hljs-comment"># If you are using the Python file please open your terminal and type in the commands above without the "!"</span>

<span class="hljs-comment"># Python code to import the libraries we will use later</span>
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">import</span> gymnasium <span class="hljs-keyword">as</span> gym
</code></pre>
<h3 id="heading-setting-up-the-gymnasium-environment">Setting Up the Gymnasium Environment</h3>
<p>A reinforcement learning model needs to train itself. In this case, it has to train itself by playing the Frozen Lake game. In the code block below, we will be using OpenAI's Gym Python library to set up and "run" the Frozen Lake game.</p>
<pre><code class="lang-python"><span class="hljs-comment"># Make the environment</span>
env = gym.make(<span class="hljs-string">"FrozenLake-v1"</span>, map_name=<span class="hljs-string">"4x4"</span>, render_mode=<span class="hljs-string">"ansi"</span>, is_slippery=<span class="hljs-literal">False</span>)

<span class="hljs-comment"># Reset the environment to get a observation</span>
observation, info = env.reset()

<span class="hljs-comment"># Printing the state</span>
<span class="hljs-comment"># When the observation is printed, you will see that we recieve the number 0 like mentioned above</span>
print(observation)
</code></pre>
<p>Output: <code>0</code></p>
<p>In this game, there are four actions for our agent to do.</p>
<ol>
<li><p>Move the character up</p>
</li>
<li><p>Move the character down</p>
</li>
<li><p>Move the character left</p>
</li>
<li><p>Move the character right</p>
</li>
</ol>
<p>Every time we do an action in the environment, we will receive five pieces of information from the environment (since every action we take changes the state of the environment, we need to know the current state of the environment).</p>
<ol>
<li><p><code>next_state</code>: An observation from the environment also known as the state (explained more below)</p>
</li>
<li><p><code>reward</code>: The reward the agent should receive from the action</p>
</li>
<li><p><code>terminated</code>: A true/false (boolean) value that shows whether or not the environment has been terminated</p>
</li>
<li><p><code>truncated</code>: A true/false (boolean) value that shows whether or not the game has been truncated (ended early), this usually happens because of a time limit.</p>
</li>
<li><p><code>info</code>: A dictionary (a collection of key-value pairs) that may contain additional information about the environment.<br /> Of these five returned values, the first four will be the most useful to us.</p>
</li>
</ol>
<p>We will receive an observation that consists of a single digit representing the player's position. The observation we get follows this formula: <code>current_row * nrows + current_column</code>. At the start, we will spawn in at row 0, col 0. Meaning our state will be 0 (the rows and cols are 0-indexed).</p>
<p>The reward the agent can be given for any action is 0 (for reaching a frozen lake square or reaching a hole) or 1 (reaching the goal square).</p>
<p>We can also render the game in ANSI, as seen below.</p>
<pre><code class="lang-python">print(env.render())
<span class="hljs-comment"># S is the starting point</span>
<span class="hljs-comment"># G is the goal</span>
<span class="hljs-comment"># H's are holes</span>
<span class="hljs-comment"># F's are the Frozen lake</span>
<span class="hljs-comment"># The letter with a red/pink background is the character's current position</span>
</code></pre>
<p>Output:</p>
<pre><code class="lang-python">SFFF
FHFH
FFFH
HFFG
<span class="hljs-comment"># (in the output above the "S" has a pink background)</span>
</code></pre>
<p>Moving on, we can now select a random action from the pool of possible actions (called the action space) and see what data we get in response:</p>
<pre><code class="lang-python"><span class="hljs-comment"># Now we will take a random action in the environment and see what we get in response</span>

<span class="hljs-comment"># Selecting a random action</span>
action = env.action_space.sample()

<span class="hljs-comment"># Executing that random action in the environment</span>
observation, reward, terminated, truncated, info = env.step(action)

print(<span class="hljs-string">f"Observation: <span class="hljs-subst">{observation}</span>"</span>)
print(<span class="hljs-string">f"Reward: <span class="hljs-subst">{reward}</span>"</span>)
print(<span class="hljs-string">f"Environment Terminated?: <span class="hljs-subst">{terminated}</span>"</span>)
print(<span class="hljs-string">f"Environment Truncated?: <span class="hljs-subst">{truncated}</span>"</span>)

<span class="hljs-comment"># Render the game</span>
print(<span class="hljs-string">"\n"</span> + env.render())

<span class="hljs-comment"># The character moving on it's own is simply random, next we will implement a RL model to make it play better!</span>
</code></pre>
<p>Output:</p>
<pre><code class="lang-python">Observation: <span class="hljs-number">1</span>
Reward: <span class="hljs-number">0.0</span>
Environment Terminated?: <span class="hljs-literal">False</span>
Environment Truncated?: <span class="hljs-literal">False</span>

  (Up)
SFFF
FHFH
FFFH
HFFG
<span class="hljs-comment"># (in the output above the "F" to the right of the "S" has a pink background)</span>
</code></pre>
<p>By the way, here is how the Frozen Lake game is pictured on the Gymnasium website for those of us who learn best visually:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690339568389/df2b86d9-d692-42cb-8ddb-358e2471a60a.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-creating-the-q-learning-agent">Creating the Q-Learning Agent</h3>
<p>Next, we will implement Q-Learning, a popular Reinforcement Learning algorithm, along with the Epsilon Greedy Policy. The Epsilon Greedy Policy is what selects a random action for our agent (you'll see this soon).</p>
<p>Our Q-Table will initially be defined with only 0s; the agent will eventually replace these values.</p>
<pre><code class="lang-python"><span class="hljs-comment"># Initialize our Q-Table to all 0 values (the RL agent bases it's decisions off of this table and updates it in training)</span>
QTable = np.zeros((env.observation_space.n, env.action_space.n))
</code></pre>
<p>Next, we'll declare the Epsilon Greedy Policy function.</p>
<pre><code class="lang-python"><span class="hljs-comment"># Greedy Epsilon Function, this is what determines what action we will take</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">greedyEpsilon</span>(<span class="hljs-params">Qtable, state, epsilon</span>):</span>
  num = np.random.rand()
  <span class="hljs-keyword">if</span> (num &lt; epsilon):
    action = env.action_space.sample()
  <span class="hljs-keyword">else</span>:
    action = np.argmax(Qtable[state])
  <span class="hljs-keyword">return</span> action
</code></pre>
<p>Then, to train our agent, we can declare and invoke another function.</p>
<pre><code class="lang-python"><span class="hljs-comment"># Now we will train our agent (this might take a few minutes)</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">train</span>(<span class="hljs-params">env, QTable, numOfEpisodes, learningRate, discountFactor, startingEpsilon, finalEpsilon, decayRate, maxSteps</span>):</span>
  <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> range(numOfEpisodes):
    <span class="hljs-comment"># Decaying Epsilon so that we get more exploitation than exploration (over time)</span>
    epsilon = startingEpsilon + (finalEpsilon - startingEpsilon) * np.exp(-decayRate * i)

    <span class="hljs-comment"># Reset the environment and get an observation</span>
    currentState = env.reset()
    currentState = currentState[<span class="hljs-number">0</span>]

    <span class="hljs-keyword">for</span> j <span class="hljs-keyword">in</span> range(maxSteps):
      <span class="hljs-comment"># Determine what action to take with the Greedy Epsilon function</span>
      action = greedyEpsilon(QTable, currentState, epsilon)

      <span class="hljs-comment"># Retrieve important info from environment and apply our action in the environment</span>
      newState, reward, terminated, truncated, info = env.step(action)

      <span class="hljs-comment"># Update the Q Table to reflect what the agent has learned</span>
      QTable[currentState][action] = (<span class="hljs-number">1</span> - learningRate) * QTable[currentState][action] + learningRate * (reward + discountFactor * np.max(QTable[newState]))

      <span class="hljs-comment"># If the game is terminated or truncated, finish this session (this "session" is often called an "episode")</span>
      <span class="hljs-keyword">if</span> (terminated <span class="hljs-keyword">or</span> truncated):
        <span class="hljs-keyword">break</span>

      <span class="hljs-comment"># Update the state we were basing everything off of, to the new state</span>
      currentState = newState
  <span class="hljs-keyword">return</span> QTable

train(env, QTable, <span class="hljs-number">10000</span>, <span class="hljs-number">0.5</span>, <span class="hljs-number">0.97</span>, <span class="hljs-number">0.01</span>, <span class="hljs-number">1</span>, <span class="hljs-number">0.0005</span>, <span class="hljs-number">10000</span>)
</code></pre>
<p>As a result of this function, this is how the Q-Table looks.</p>
<pre><code class="lang-python">array([[<span class="hljs-number">0.832972</span>  , <span class="hljs-number">0.85873403</span>, <span class="hljs-number">0.85873403</span>, <span class="hljs-number">0.832972</span>  ],
       [<span class="hljs-number">0.832972</span>  , <span class="hljs-number">0.</span>        , <span class="hljs-number">0.88529281</span>, <span class="hljs-number">0.85873403</span>],
       [<span class="hljs-number">0.85873403</span>, <span class="hljs-number">0.912673</span>  , <span class="hljs-number">0.85873403</span>, <span class="hljs-number">0.88529281</span>],
       [<span class="hljs-number">0.88529281</span>, <span class="hljs-number">0.</span>        , <span class="hljs-number">0.85874801</span>, <span class="hljs-number">0.85873689</span>],
       [<span class="hljs-number">0.85873403</span>, <span class="hljs-number">0.88529281</span>, <span class="hljs-number">0.</span>        , <span class="hljs-number">0.832972</span>  ],
       [<span class="hljs-number">0.</span>        , <span class="hljs-number">0.</span>        , <span class="hljs-number">0.</span>        , <span class="hljs-number">0.</span>        ],
       [<span class="hljs-number">0.</span>        , <span class="hljs-number">0.9409</span>    , <span class="hljs-number">0.</span>        , <span class="hljs-number">0.88529281</span>],
       [<span class="hljs-number">0.</span>        , <span class="hljs-number">0.</span>        , <span class="hljs-number">0.</span>        , <span class="hljs-number">0.</span>        ],
       [<span class="hljs-number">0.88529281</span>, <span class="hljs-number">0.</span>        , <span class="hljs-number">0.912673</span>  , <span class="hljs-number">0.85873403</span>],
       [<span class="hljs-number">0.88529281</span>, <span class="hljs-number">0.9409</span>    , <span class="hljs-number">0.9409</span>    , <span class="hljs-number">0.</span>        ],
       [<span class="hljs-number">0.912673</span>  , <span class="hljs-number">0.97</span>      , <span class="hljs-number">0.</span>        , <span class="hljs-number">0.912673</span>  ],
       [<span class="hljs-number">0.</span>        , <span class="hljs-number">0.</span>        , <span class="hljs-number">0.</span>        , <span class="hljs-number">0.</span>        ],
       [<span class="hljs-number">0.</span>        , <span class="hljs-number">0.</span>        , <span class="hljs-number">0.</span>        , <span class="hljs-number">0.</span>        ],
       [<span class="hljs-number">0.</span>        , <span class="hljs-number">0.9409</span>    , <span class="hljs-number">0.97</span>      , <span class="hljs-number">0.912673</span>  ],
       [<span class="hljs-number">0.9409</span>    , <span class="hljs-number">0.97</span>      , <span class="hljs-number">1.</span>        , <span class="hljs-number">0.9409</span>    ],
       [<span class="hljs-number">0.</span>        , <span class="hljs-number">0.</span>        , <span class="hljs-number">0.</span>        , <span class="hljs-number">0.</span>        ]])
</code></pre>
<p>Now for the moment of truth. Evaluating our agent to see how good it is at playing Frozen Lake.</p>
<pre><code class="lang-python"><span class="hljs-comment"># Lets see how well our agent performs when playing the game</span>

<span class="hljs-comment"># Variables</span>
numOfWins = <span class="hljs-number">0</span>
numOfLosses = <span class="hljs-number">0</span>
<span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> range(<span class="hljs-number">100</span>):
  <span class="hljs-comment"># Get the current state/observation</span>
  state = env.reset()
  state = state[<span class="hljs-number">0</span>]
  <span class="hljs-keyword">for</span> j <span class="hljs-keyword">in</span> range(<span class="hljs-number">1000</span>):
    <span class="hljs-comment"># Get the action from the QTable with the highest reward</span>
    action = np.argmax(QTable[state][:])

    <span class="hljs-comment"># Retrieve important info from environment and apply our action in the environment</span>
    newState, reward, terminated, truncated, info = env.step(action)

    <span class="hljs-comment"># If the reward equals 1 (we got to the goal) add one to the number of wins</span>
    <span class="hljs-comment"># Else add one to the number of losses</span>
    <span class="hljs-keyword">if</span> (reward == <span class="hljs-number">1</span>):
      numOfWins += <span class="hljs-number">1</span>
    <span class="hljs-keyword">else</span>:
      numOfLosses += <span class="hljs-number">1</span>

    <span class="hljs-comment"># If the game is terminated or truncated, finish this session (this "session" is often called an "episode")</span>
    <span class="hljs-keyword">if</span> (terminated <span class="hljs-keyword">or</span> truncated):
        <span class="hljs-keyword">break</span>

    <span class="hljs-comment"># Update the state we were basing everything off of, to the new state</span>
    state = newState

print(<span class="hljs-string">f"Number of wins: <span class="hljs-subst">{numOfWins}</span>"</span>)
print(<span class="hljs-string">f"Number of losses: <span class="hljs-subst">{numOfLosses}</span>"</span>)
</code></pre>
<p>And as a result, we get... *drum roll please***</p>
<pre><code class="lang-python">Number of wins: <span class="hljs-number">100</span>
Number of losses: <span class="hljs-number">500</span>
</code></pre>
<p>Ouch...</p>
<h1 id="heading-conclusion">Conclusion</h1>
<p>As it is evident from the evaluation above (100 wins and 500 losses), our agent is not very effective. That is probably because I just trained it for a short period of time—about two minutes. A reinforcement learning agent gets better with more training because it has more time to play through scenarios and understand the environment. However, Google Colab probably doesn't have resources to let me train a reinforcement agent for a long period of time. I want to thank you for reading this post. I hoped this was interesting and that you learned something new about RLHF (reinforcement learning with human feedback) and Q-Learning!</p>
<h1 id="heading-download">Download</h1>
<p>You can download a Python file (.py) or a Jupyter file (.ipynb) file if you want to run or modify this code. I strongly advise utilizing the Jupyter file because it divides the code into more legible pieces and has less print statements per block, making the output easier to understand.</p>
<p>To download either one please visit: <a target="_blank" href="https://github.com/devsai9/hashnode-downloads/tree/main/rlhf-and-qlearning-7-25-2023">https://github.com/devsai9/hashnode-downloads/tree/main/rlhf-and-qlearning-7-25-2023</a></p>
<p>Jupyter file: <a target="_blank" href="https://github.com/devsai9/hashnode-downloads/blob/main/rlhf-and-qlearning-7-25-2023/blog-rlhf-ipynbfile.ipynb">https://github.com/devsai9/hashnode-downloads/blob/main/rlhf-and-qlearning-7-25-2023/blog-rlhf-ipynbfile.ipynb</a></p>
<p>Python file: <a target="_blank" href="https://github.com/devsai9/hashnode-downloads/blob/main/rlhf-and-qlearning-7-25-2023/blog-rlhf-pyfile.py">https://github.com/devsai9/hashnode-downloads/blob/main/rlhf-and-qlearning-7-25-2023/blog-rlhf-pyfile.py</a></p>
]]></content:encoded></item><item><title><![CDATA[I Tried Firebase]]></title><description><![CDATA[Introduction
I recently attempted to create a simple chat application to explore Firebase's capabilities. The free tier was not what I had anticipated...
What is Firebase?
Google's BaaS (Backend as a Service) product is called Firebase. It contains s...]]></description><link>https://blog.saisiddhish.me/i-tried-firebase</link><guid isPermaLink="true">https://blog.saisiddhish.me/i-tried-firebase</guid><category><![CDATA[Firebase]]></category><category><![CDATA[firebaseAuth]]></category><category><![CDATA[firestore]]></category><category><![CDATA[firebaseFirestore]]></category><category><![CDATA[2Articles1Week]]></category><dc:creator><![CDATA[Sai Siddhish Chandra Sekaran]]></dc:creator><pubDate>Tue, 25 Jul 2023 17:04:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1690231151400/7153e704-8a9a-4210-9a26-d20b339eca4f.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-introduction">Introduction</h1>
<p>I recently attempted to create a simple chat application to explore <a target="_blank" href="https://firebase.google.com/">Firebase</a>'s capabilities. The free tier was not what I had anticipated...</p>
<h2 id="heading-what-is-firebase">What is Firebase?</h2>
<p>Google's BaaS (Backend as a Service) product is called Firebase. It contains several helpful services for which developers frequently need to create a lot of code. For instance, you only need a few lines of JavaScript to implement User Authentication (Sign in with Google, Email/Password, Anonymous, etc.)! It offers a wide variety of additional services, including Firestore &amp; Realtime Database (databases), Storage (user content storage), Hosting, Cloud Functions, Machine Learning, and much more.</p>
<hr />
<h1 id="heading-my-experiences">My Experiences</h1>
<p>Note: Firebase has two plans, a free tier (Spark Plan) and a pay-as-you-go tier (Blaze Plan). I used their free tier, and that is what I am basing this blog on. You can look at the plans <a target="_blank" href="https://firebase.google.com/pricing">here</a>.</p>
<h2 id="heading-limitations">Limitations</h2>
<p>I used Firebase's free tier rather than the Firebase Blaze plan, as was previously noted. It's the most generous plan I've ever come across. You receive 20,000 writes and deletes per day and 50,000 reads per day using the Firebase Firestore Database. With Firebase Authentication, you can choose to use any of the following methods for free, Email/Password, Anonymous, Sign in with Google, Facebook, Google Play Games, Apple, Apple Game Center, GitHub, Microsoft, Twitter, and Yahoo. You are also allowed 50,000 monthly active users! All-in-all I did not consider the free tier to be limiting in any way.</p>
<h2 id="heading-security">Security</h2>
<p>Firebase has a lot of different security features. For instance, if Firebase Authentication is configured, you can use Firebase Firestore Security Rules to verify a User's credentials and the data to which they have access to. Addiontially, only the websites you specify can work with your Firestore database.</p>
<h2 id="heading-firebase-firestore-database">Firebase Firestore Database</h2>
<p>I utilized Firebase Firestore to store all the chat rooms and messages for the simple chat app I created. I found it quite simple to adhere to its daily write cap of 50K reads. Additionally, I appreciated how simple it was to set up, receive, and push data to and from it. I also appreciated how it operated using only plain JavaScript and did not require a backend language. The database queries, on the other hand, were a little challenging for me to use and understand. Writing security rules for my particular needs proved to be fairly difficult for me as well. However, there was a <code>get()</code> method which can retrieve data from Firebase's Firestore database (not any of the other databases), which made my life a little bit easier. The usage of async/await by Firestore was something else I didn't like because it had strange side effects in my code, including arrays being filled with data before the await function even ran.</p>
<h2 id="heading-firebase-authentication">Firebase Authentication</h2>
<p>To authenticate my users and ensure they could only access the chat rooms they were authorized to access, I utilized Firebase Authentication. It was far simpler to set up than Firestore. Although there were many more options for login, I just used Sign in with Google. And since I just shared the chat app link with a small number of individuals, the restriction of 50K monthly active users was really simple to meet. Additionally, I had no trouble integrating Authentication into my chat app. I had a positive experience with authentication; it had no drawbacks in my opinion.</p>
<hr />
<h1 id="heading-conclusion">Conclusion</h1>
<p>Thank you for reading this article on my experiences with Firebase! Let me know your thoughts on Firebase in the comments.</p>
]]></content:encoded></item><item><title><![CDATA[What are APIs?]]></title><description><![CDATA[Introduction
APIs, Application Programming Interfaces, provide a standardized way for an application to allow itself to be integrated with other third-party apps without the need to code for every possible integration.
CRUD and HTTP Methods
So how do...]]></description><link>https://blog.saisiddhish.me/what-are-apis</link><guid isPermaLink="true">https://blog.saisiddhish.me/what-are-apis</guid><category><![CDATA[APIs]]></category><category><![CDATA[api]]></category><category><![CDATA[API basics ]]></category><category><![CDATA[crud]]></category><category><![CDATA[http method]]></category><dc:creator><![CDATA[Sai Siddhish Chandra Sekaran]]></dc:creator><pubDate>Sat, 01 Apr 2023 15:16:45 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1680362115415/65f16fd6-51fb-4b43-afaf-08ea92a8f2f2.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-introduction">Introduction</h1>
<p>APIs, Application Programming Interfaces, provide a standardized way for an application to allow itself to be integrated with other third-party apps without the need to code for every possible integration.</p>
<h1 id="heading-crud-and-http-methods">CRUD and HTTP Methods</h1>
<p>So how do third-party applications use an API? That's where we must first learn about CRUD operations. CRUD stands for Create, Read, Update, and Delete. There are also 5 commonly used HTTP methods. Which are POST, GET, PUT, PATCH, and DELETE.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680299457812/dcd24ca4-456d-447c-b9ad-d2245d94a40c.png" alt="HTTP Methods and what CRUD operation they are (chart)" class="image--center mx-auto" /></p>
<p>The POST Method creates something on your web application. The GET method reads information from the web application. The PUT and PATCH methods update information on the application. The DELETE method, as expected, deletes information on the web application.</p>
<h2 id="heading-difference-between-put-and-patch">Difference between PUT and PATCH</h2>
<p>You may be reading this and wondering what the difference between PUT and PATCH is. Well, PUT and PATCH are almost identical, except that PUT is usually used for larger data updates, whereas PATCH is used for smaller data updates.</p>
<p>Let's say I have this piece of data:</p>
<pre><code class="lang-json">{
    <span class="hljs-attr">"first_name"</span>: <span class="hljs-string">"John"</span>,
    <span class="hljs-attr">"last_name"</span>: <span class="hljs-string">"Smith"</span>,
    <span class="hljs-attr">"age"</span>: <span class="hljs-number">31</span>,
    <span class="hljs-attr">"city"</span>: <span class="hljs-string">"Chicago"</span>,
    <span class="hljs-attr">"job"</span>: <span class="hljs-string">"Software Engineer"</span>,
}
</code></pre>
<p>I want to update the <code>first_name</code>, <code>last_name</code>, <code>age</code>, and <code>city</code> fields. I could use the PUT method. When using the PUT method, it requires you to state all of the data parameters (even ones you don't modify) because PUT updates the entire resource, meaning leaving out any field in a PUT request, will cause you to lose that entire field.</p>
<p>I want to update just the <code>first_name</code> field, I could use the PATCH method. With the PATCH method, I would only have to provide the parameters I'm changing. This is better for smaller updates as if you were updating one out of 20 fields, you wouldn't have to restate all 20 fields.</p>
<h1 id="heading-real-world-example">Real-World Example</h1>
<p>Here's a relatable example. Let's imagine that you have worked hard on building a network of weather stations that report reliable and current weather statistics.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1678847981940/05241fc0-a9c1-4152-8176-b3555da9f796.png" alt class="image--center mx-auto" /></p>
<p>Then let's say a third-party mobile application wants to use your weather data. The third-party can integrate your API into their application. Here's a sample "conversation" between their application and your API.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680301837349/7f175fd3-99e8-4372-b679-c5fa8531b265.png" alt="Sample Mobile App and API conversation" class="image--center mx-auto" /></p>
<p>So as you can see, the third party sent a GET request, which is requesting your weather data. In response, your API sent a JSON response. By the way, most APIs usually return in a standardized format, called JSON.</p>
<p>And a sample API response might look like this:</p>
<pre><code class="lang-json">{
    <span class="hljs-attr">"unit_system"</span>: <span class="hljs-string">"imperial"</span>,
    <span class="hljs-attr">"temperature_unit"</span>: <span class="hljs-string">"Fahrenheit"</span>,
    <span class="hljs-attr">"temperature"</span>: <span class="hljs-number">65</span>,
    <span class="hljs-attr">"temperature_min"</span>: <span class="hljs-number">55</span>,
    <span class="hljs-attr">"temperature_max"</span>: <span class="hljs-number">70</span>,
    <span class="hljs-attr">"feels_like"</span>: <span class="hljs-number">54</span>,
    <span class="hljs-attr">"humidity"</span>: <span class="hljs-number">65</span>,
    <span class="hljs-attr">"precipitation"</span>: <span class="hljs-number">87</span>,
    <span class="hljs-attr">"air_quality"</span>: <span class="hljs-string">"fair"</span>
}
</code></pre>
<p>Now the third-party mobile app can use your weather services and display your data in a nice and pretty manner.</p>
<h1 id="heading-conclusion">Conclusion</h1>
<p>So, a quick summary, APIs are used on top of an existing application to expose certain functionalities of the application for others to use.</p>
<p>Thank you for reading!</p>
]]></content:encoded></item><item><title><![CDATA[Types of Supervised Learning (AI)]]></title><description><![CDATA[Introduction
In the last article, I discussed what AI is, its uses, types, etc. In this article, I will go into the types of Supervised Learning.
Supervised Learning
Supervised learning is one of the main types of AI (the other main types are unsuper...]]></description><link>https://blog.saisiddhish.me/types-of-supervised-learning-ai</link><guid isPermaLink="true">https://blog.saisiddhish.me/types-of-supervised-learning-ai</guid><category><![CDATA[AI]]></category><category><![CDATA[Artificial Intelligence]]></category><category><![CDATA[Supervised learning]]></category><dc:creator><![CDATA[Sai Siddhish Chandra Sekaran]]></dc:creator><pubDate>Sun, 11 Dec 2022 21:45:08 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1670795072861/xXl4KcRdC.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-introduction">Introduction</h1>
<p>In the last article, I discussed what AI is, its uses, types, etc. In this article, I will go into the types of Supervised Learning.</p>
<h1 id="heading-supervised-learning">Supervised Learning</h1>
<p>Supervised learning is one of the main types of AI (the other main types are unsupervised learning and reinforcement learning).</p>
<h2 id="heading-how-it-works">How it works</h2>
<p>Supervised Learning, like any other type of AI, needs lots of good, quality data. What makes it different is that the data needs to be labeled.</p>
<p>For example, if we were making an AI Model to differentiate between an apple and a banana. We need to give the AI Model lots of pictures of apples and label them to make sure the AI knows if the picture we gave it is a Banana or an Apple.</p>
<p>Let me give you a visual:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670791720010/Ukuf6QKMV.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-classification">Classification</h2>
<p>Now the example I just gave you is an example of classification. More specifically <strong>Binary Classification</strong> because there are only two things the model can classify an input as (Banana or Apple).</p>
<p>Let's say we also made the AI Model classify Bananas, Apples, and now Oranges.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670791967550/cYnw4xzc3.png" alt class="image--center mx-auto" /></p>
<p>This would not be Binary Classification as binary classification only classifies between two things, not more or less than two. If we have more than two things to classify then it's just called Classification.</p>
<h2 id="heading-regression">Regression</h2>
<p>Let's look at another type of algorithm called regression. Regression is more focused towards numbers. For example, if you wanted to predict your store's sales for next week based on previous weeks, then that would be regression.</p>
<p>Look at this visual below:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670792763181/2lHGcYqrN.png" alt class="image--center mx-auto" /></p>
<p>This would be regression. This would be <strong>Univariate Regression</strong> because we only have one input feature (input) which is sales. The line of best for this data would be linear.</p>
<p>Take a look at the visual below.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1670793763332/qa4l5bz2r.png" alt class="image--center mx-auto" /></p>
<p>If we added another input feature such as if we had an ongoing sale (in this case this input feature is binary. 0 = No sale, 1 = Sale). Then this would become <strong>Multivariate Regression</strong>.</p>
<h1 id="heading-conclusion">Conclusion</h1>
<p>All in all, Supervised Learning remains one of the most used types of AI algorithms. I hope this knowledge has helped you. Thank you for reading!</p>
]]></content:encoded></item><item><title><![CDATA[What is Artificial Intelligence?]]></title><description><![CDATA[Please note that in this article I will mainly talk about Supervised Learning.
Introduction
Artificial Intelligence is becoming more and more widespread. There are many people wondering what field AI will take over next. It is said that in the next 5...]]></description><link>https://blog.saisiddhish.me/what-is-artificial-intelligence</link><guid isPermaLink="true">https://blog.saisiddhish.me/what-is-artificial-intelligence</guid><category><![CDATA[AI]]></category><category><![CDATA[Artificial Intelligence]]></category><dc:creator><![CDATA[Sai Siddhish Chandra Sekaran]]></dc:creator><pubDate>Tue, 22 Nov 2022 22:26:21 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1669157969740/3R6IJfBVt.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Please note that in this article I will mainly talk about Supervised Learning.</p>
<h1 id="heading-introduction">Introduction</h1>
<p>Artificial Intelligence is becoming more and more widespread. There are many people wondering what field AI will take over next. It is said that in the next 50 years AI will take over most jobs. There is AI being developed for nearly every field in existence. There is AI being developed for healthcare, writing, transportation, and many more! Yet, many people don't know much about this "AI". So let's dive in and see the basics.</p>
<h1 id="heading-what-is-ai">What is AI?</h1>
<p>AI or artificial intelligence is exactly what its name says it is. It is human-made intelligence (for computers). Unlike regular programs that need to be explicitly told what to do in any situation with code, AI will learn from past experiences and training data.</p>
<h1 id="heading-uses-for-ai">Uses for AI</h1>
<p>AI can be used in a lot of places. </p>
<p>For example, there are people training AI to classify if a tumor is malignant or benign.</p>
<blockquote>
<p>Malignant Definition:<br />
(of a tumor) tending to invade normal tissue or to recur after removal; cancerous.
<br />
<br />
Benign Definition:<br />
(of a disease) not harmful in effect.</p>
</blockquote>
<p>As many people know, Tesla is using AI to develop their full self-driving that can respond to other cars, traffic lights, traffic cones, and other driving signals. There are hopes that in the future AI can be used in trucks to make shipping more efficient and quicker.</p>
<p>AI is also used in social media. It tracks your activity and recommends you your feed based on that.</p>
<p>AI is also used in voice assistants like Alexa, Bixby, Google Assistant, and Siri. AI is used to try and interpret what you are saying. For example, Google Assistant needs to give you the weather regardless of if you say <em>"Hey Google, what's the weather?"</em>, <em>"Ok Google, what is the temperature?"</em>, or <em>"Hey Google, is it going to rain today?"</em>. So to interpret your actual intentions behind the sentence is where AI comes in.</p>
<h1 id="heading-how-does-ai-work">How does AI work?</h1>
<p>I won't get into the math or specifics on how AI works, but I'll give you an idea of how it works.</p>
<p>After an AI is built, it needs to be trained. Like humans in a new job, we need to be trained and have the experience to perform well. Same for AI. But unlike humans, AI just needs data and time to train. </p>
<p>For example, let's say you built an AI to determine, from an image of a hand, if the hand was opened or a fist (closed). Well, first you need to build said AI. Then you need to find or make some training data. In this situation, you would need data that has pictures of open and closed hands. Generally, AI needs thousands of examples and hours to train itself. This is why data scientists generally use large datasets already filled with related data.</p>
<p>Data is the fuel for AI. The less data an AI has to train off of, the worse it is. This is why high-quality, accurately labeled data is very important.</p>
<h2 id="heading-biased-data">Biased Data</h2>
<p>This is where a bad problem arises. This problem won't directly make the AI stop functioning, but will cause a bunch of problems.</p>
<p>So let's go back to our open-hand VS closed-hand AI. Let's say we only gave it open-hand and closed-hand images where the inside of the hand is facing the camera. The AI would be amazing at recognizing open and closed hands only if the inside of the hand is facing the camera. Suddenly, if we closed our hand into a fist and turn it around such that the camera sees our knuckles and the outside of our hand. The AI's confidence would plummet.</p>
<blockquote>
<p>Confidence Definition:<br />
(in AI) How sure an AI Model is of its prediction.</p>
</blockquote>
<p>This is why when we give the AI data, we need to be sure we give it images of open and closed hands from all angles to ensure it can detect an open or closed hand from any image.</p>
<h1 id="heading-types-of-ai">Types of AI</h1>
<p>There are many types of AI. We will cover the three main ones today. They are Supervised Learning, Unsupervised Learning, and Reinforcement Learning.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1669154195089/e2ogyWYwK.png" alt="Types of AI" /></p>
<h2 id="heading-supervised-learning">Supervised Learning</h2>
<p>Supervised Learning is what we've been talking about today. It requires pre-labeled data and will train itself by making predictions and seeing if it was right. It takes in new data and uses what it learned from the training data to make predictions.</p>
<h2 id="heading-unsupervised-learning">Unsupervised Learning</h2>
<p>Unsupervised Learning will take in data and will cluster them into groups based on similarity. It will then take in new data and try putting it into existing groups.</p>
<h2 id="heading-reinforcement-learning">Reinforcement Learning</h2>
<p>Reinforcement Learning doesn't need much data and mainly learns based on what actions receive penalties and what actions receive rewards. Think about Reinforcement Learning as learning a new video game without watching YouTube videos beforehand. You may start off with X action, but that caused you to lose a life (penalty). So you do Y action instead and you passed the level (reward).</p>
<h1 id="heading-risks">Risks</h1>
<p>So as you can see AI has a lot of potential to help the world. But it can also be harmful.</p>
<p>We have already seen that AI can be used to improve health care, transportation, entertainment, etc. But it can also harm those same fields.</p>
<p>Let's take self-driving cars. If we use AI in cars, the roads will be a lot safer as the AI cars will follow traffic laws and sense dangers. But let's say a self-driving car crashes into another car, this will injure people. It also arises the question of who is responsible for AI's mistakes. Like if an AI car crashes, is it the AI car's driver's fault, the car company's fault, or the opposing driver's fault?</p>
<p>Let's look at healthcare. What if we have an AI to see if a tumor is malignant or benign and its prediction is a false negative (the tumor is predicted benign while it is actually malignant)? Then the patient's tumor will go untreated and can cause major body problems. All because an AI misclassified a tumor.</p>
<p>These are some of the risks of AI. What if AI misclassifies? Who is responsible?</p>
<h1 id="heading-conclusion">Conclusion</h1>
<p>In the end, AI is a very helpful tool and can save lives. But it also needs to be heavily tested and monitored to make sure it doesn't hurt lives.</p>
<p>Thank you for reading (or listening)!</p>
]]></content:encoded></item><item><title><![CDATA[Published an Extension to Chrome Webstore and Microsoft Edge Add-ons]]></title><description><![CDATA[Publishing Options
There are three main browsers you can publish Chrome extensions to. Chrome (duh), Microsoft Edge, and Opera/Opera GX. So far I've looked into the first two.
Microsoft Edge Add-ons (Microsoft Edge)
This one is the cheapest and easie...]]></description><link>https://blog.saisiddhish.me/published-an-extension-to-chrome-webstore-and-microsoft-edge-add-ons</link><guid isPermaLink="true">https://blog.saisiddhish.me/published-an-extension-to-chrome-webstore-and-microsoft-edge-add-ons</guid><category><![CDATA[chrome extension]]></category><category><![CDATA[microsoft edge]]></category><category><![CDATA[extension]]></category><category><![CDATA[chrome]]></category><category><![CDATA[Google Chrome]]></category><dc:creator><![CDATA[Sai Siddhish Chandra Sekaran]]></dc:creator><pubDate>Fri, 06 May 2022 01:43:07 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1735717107782/a1c81586-8742-4ae3-849a-f2ab148c5d69.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-publishing-options">Publishing Options</h1>
<p>There are three main browsers you can publish Chrome extensions to. Chrome (<em>duh</em>), Microsoft Edge, and Opera/Opera GX. So far I've looked into the first two.</p>
<h3 id="heading-microsoft-edge-add-ons-microsoft-edge">Microsoft Edge Add-ons (Microsoft Edge)</h3>
<p>This one is the cheapest and easiest option. Once you sign up for the Edge Partner Program (100% free), you can immediately start uploading your extension(s) (also 100% free).</p>
<h3 id="heading-chrome-webstore-chrome">Chrome Webstore (Chrome)</h3>
<p>This is the more expensive of the two. You have to pay a $5 Developer Registration fee. Only after that, you can upload extensions (for free) from that account.</p>
<h1 id="heading-comparisons">Comparisons</h1>
<h3 id="heading-extension-forms">Extension Forms</h3>
<p>For Microsoft Addons, you have to fill out your extension's name, description, and other details. You have to make and upload your extension's screenshots, and select the language (en - English, es - Spanish, etc). Chrome Webstore will take the description and other details from your <code>manifest.json</code>. You will still have to make and upload your screenshots.</p>
<h4 id="heading-chrome-webstore-note">Chrome Webstore Note</h4>
<p>Just take note, for the Chrome Webstore you will have to justify why you requested certain permissions. For example, if your <code>manifest.json</code> said:</p>
<pre><code class="lang-json"><span class="hljs-string">"permissions"</span>: [
        <span class="hljs-string">"clipboardWrite"</span>
]
</code></pre>
<p>You would have to justify why you requested the "clipboardWrite" permission. Take a look below:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1651799055021/0vImM38Zm.png" alt="Justifying your Chrome Extension Permissions" /></p>
<h3 id="heading-review-times">Review Times</h3>
<p>I have very limited data on this comparison, but I will give you what I have. Microsoft took 2 days to approve my extension and 3 days to approve an update to it. Google on the other hand took 4 days to approve my extension.</p>
<h1 id="heading-what-i-published">What I published</h1>
<p>If you want the full details and what extension I developed and what my experience was like, please look at my <a target="_blank" href="https://devsai.hashnode.dev/developed-a-chrome-extension-with-html-css-js-and-json">previous blog</a>.</p>
<p>If you would like to download my extension, you may do so down below, any support is appreciated :)<br />Chrome Webstore: <a target="_blank" href="https://chrome.google.com/webstore/detail/spanish-input-tools/dkbgodmmblfcnfledmedmepimmpebnjo">https://chrome.google.com/webstore/detail/spanish-input-tools/dkbgodmmblfcnfledmedmepimmpebnjo</a><br />Microsoft Edge Add-ons: <a target="_blank" href="https://microsoftedge.microsoft.com/addons/detail/spanish-input-tools/aoehggnalolhonphifnooepocfjpghfl?hl=en-US">https://microsoftedge.microsoft.com/addons/detail/spanish-input-tools/aoehggnalolhonphifnooepocfjpghfl?hl=en-US</a></p>
<p>For those who download it, please leave a comment on the extension's page letting me know of any suggestions you may have.</p>
]]></content:encoded></item><item><title><![CDATA[Developed a Chrome Extension with HTML, CSS, JS, and JSON]]></title><description><![CDATA[Inspiration
I had a friend who told me about his chrome extensions and that inspired me to make my own. I wanted to make that I would want to use.
Details
The chrome extension I ended up making was called "Spanish Input Tools". It was made to help ty...]]></description><link>https://blog.saisiddhish.me/developed-a-chrome-extension-with-html-css-js-and-json</link><guid isPermaLink="true">https://blog.saisiddhish.me/developed-a-chrome-extension-with-html-css-js-and-json</guid><category><![CDATA[THW Web Apps]]></category><category><![CDATA[js]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[CSS]]></category><category><![CDATA[HTML]]></category><dc:creator><![CDATA[Sai Siddhish Chandra Sekaran]]></dc:creator><pubDate>Fri, 29 Apr 2022 02:36:19 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1651199680740/6vzzCazg-.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-inspiration">Inspiration</h1>
<p>I had a friend who told me about his chrome extensions and that inspired me to make my own. I wanted to make that I would want to use.</p>
<h1 id="heading-details">Details</h1>
<p>The chrome extension I ended up making was called "Spanish Input Tools". It was made to help type Spanish accented letters and symbols (á, é, í, ñ, ó, ú, ¿, ¡). I use it for typing in Spanish for Spanish Class.</p>
<h1 id="heading-features">Features</h1>
<p>This extension includes a popup that looks like this:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1651199010466/iMPMqeNay.png" alt="Extension popup" /></p>
<p>It also has a full typing page with a text box that looks like this:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1651199133109/7w8UkPGCF.png" alt="Full typing page" /></p>
<h1 id="heading-challenges">Challenges</h1>
<p>I found it really easy to develop as all it used was HTML, CSS, JS, and JSON (all languages I know). One challenge was trying to wrap my head around and use the <code>manifest.json</code> file. Which apparently is a file that contains everything about my extension (permissions, name, version, etc). I also had some trouble with the pop-up because I am used to developing full web pages (with all the viewable space in the world), now I had to develop a popup that shouldn't be as big as a webpage. So I had to intentionally limit myself.</p>
<h1 id="heading-what-was-fun">What was Fun</h1>
<p>It was fun testing the application. It was fun learning new Javascript and <code>manifest.json</code> things to make my extension work. The best part of all was the final product. I was proud I had managed to build my first chrome extension in under one week.</p>
<h1 id="heading-future-plans">Future Plans</h1>
<p>I plan on making it possible to get uppercase accented letters. I also plan on publically publishing the extension (which I will write another blog about later).</p>
<p>Comment down any other ideas you have for me down below!
Thanks for reading!</p>
]]></content:encoded></item><item><title><![CDATA[Developed a Quiz Program using MATLAB]]></title><description><![CDATA[Background
From my experience working on MATLAB, I made a Quiz Program.
How it works
This program quizzes you on Math (6 questions), Science (3 questions), Geography (2 questions), English (2 questions), and Technology (9 questions). For a total of 2...]]></description><link>https://blog.saisiddhish.me/developed-a-quiz-program-using-matlab</link><guid isPermaLink="true">https://blog.saisiddhish.me/developed-a-quiz-program-using-matlab</guid><category><![CDATA[programing]]></category><category><![CDATA[2Articles1Week]]></category><dc:creator><![CDATA[Sai Siddhish Chandra Sekaran]]></dc:creator><pubDate>Mon, 11 Apr 2022 20:48:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1649720398506/zBkHmxT8H.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-background">Background</h1>
<p>From my experience working on MATLAB, I made a Quiz Program.</p>
<h1 id="heading-how-it-works">How it works</h1>
<p>This program quizzes you on Math (6 questions), Science (3 questions), Geography (2 questions), English (2 questions), and Technology (9 questions). For a total of 22 questions. It kept track of your score for each subject and at the end graphs them on a bar graph. Keep in mind, that this program isn't its own app it's a MATLAB program that runs in the MATLAB console.</p>
<h1 id="heading-demo">Demo</h1>
<p>If you would like to see how it works please watch this YouTube video <br /></p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/i_lGN_2qAYg"></iframe>

<p><br /></p>
<h1 id="heading-download">Download</h1>
<p> To download this quiz program, please make sure to have MATLAB installed. Then go to https://www.dropbox.com/s/g6zycypy9ei6aa2/Project.m?dl=0</p>
]]></content:encoded></item><item><title><![CDATA[Domain Name Systems (DNS)]]></title><description><![CDATA[The Problem
Everyone knows and loves at least one website. There is facebook.com, github.com, hashnodenode.com, and a lot more! However, in the background servers can't understand facebook.com they only understand IP addresses. 

And well humans... a...]]></description><link>https://blog.saisiddhish.me/domain-name-systems</link><guid isPermaLink="true">https://blog.saisiddhish.me/domain-name-systems</guid><category><![CDATA[domain]]></category><category><![CDATA[dns]]></category><category><![CDATA[internet]]></category><category><![CDATA[2Articles1Week]]></category><dc:creator><![CDATA[Sai Siddhish Chandra Sekaran]]></dc:creator><pubDate>Mon, 11 Apr 2022 19:21:44 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1649704818809/dRAXKUPBS.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-the-problem">The Problem</h1>
<p>Everyone knows and loves at least one website. There is <code>facebook.com</code>, <code>github.com</code>, <code>hashnodenode.com</code>, and a lot more! However, in the background servers can't understand <code>facebook.com</code> they only understand IP addresses. 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649700846765/KnPmd3yfa.png" alt="Human and server miscommunication" />
And well humans... aren't good at remembering tons of IP addresses. So... we need a translator. Someone (or something) to translate website URLs to IP addresses. This is where the Domain Name System or DNS comes in.</p>
<h1 id="heading-what-it-does">What it does</h1>
<p>DNS takes in a domain name (like <code>facebook.com</code>) and resolves (translates) it into an IP address.</p>
<h1 id="heading-dns-lookup-process">DNS Lookup Process</h1>
<p>So let us say you're on your computer and want to browse Facebook. You type in <code>facebook.com</code> and the first thing your computer does is check its local cache (or records) it'll see if it has <code>facebook.com</code>'s IP address.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649701941292/6qcNV8fqG.png" alt="Step 1" />
If your local cache doesn't have the IP address needed, it will query (ask) a DNS Recursive Resolver, typically provided by your ISP (this can be changed to a different one like Google DNS). The DNS Recursive Resolver will check its cache to see if it has the IP address.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649702596343/WQK1UqEvn.png" alt="Step 2" />
If it doesn't then it will ask a root server. A root server can provide the details for a Top-Level Domain (TLD) server. Examples of Top Level Domain servers are the .com servers, the .net servers, the .org servers, etc. This root server will receive the request and give the needed details for the appropriate TLD server. In the case of the .com servers.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649703052361/TG_jrHYDA.png" alt="Steps 3 &amp; 4" />
Then our DNS Recursive Resolver asks the appropriate TLD server. In this case, the .com TLD server.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649703554341/rLugBbc4m.png" alt="Steps 5 &amp; 6" />
The TLD may still not know the IP address of <code>facebook.com</code> but it can provide the location of the Authoritative Name Server. The Authoritative Name server is the last step in the DNS Lookup.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649703970757/Q5JYeLhZP.png" alt="Steps 7 &amp; 8" />
This server will most likely have the IP we are looking for and it will provide the IP address we are looking for!
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649704382936/mmgs1AsWU.png" alt="Steps 9 &amp; 10" />
After we receive our hard-earned IP address (in a response from our DNS Recursive Resolver, we can now request what we need (the page, data, etc.) from Facebook's servers. </p>
<h1 id="heading-conclusion">Conclusion</h1>
<p>That was a lot of steps (10 steps), but it usually happens extremely quickly. This is why it takes some time for a page to load if you haven't visited that webpage, it needs to go through some or all of the steps to find the IP address of the website you want to visit. So the next time a webpage loads slowly remember your computer's processes in the background.</p>
]]></content:encoded></item><item><title><![CDATA[What are IPv6 Addresses?]]></title><description><![CDATA[Background
In the previous blog I talked about IPv4 Addresses. There are two types of IP addresses. The old IPv4 and the new IPv6. In the previous blog, we talked about IPv4. Now we're going to talk about IPv6.
The Problem with IPv4
When the original...]]></description><link>https://blog.saisiddhish.me/what-are-ipv6-addresses</link><guid isPermaLink="true">https://blog.saisiddhish.me/what-are-ipv6-addresses</guid><category><![CDATA[internet]]></category><dc:creator><![CDATA[Sai Siddhish Chandra Sekaran]]></dc:creator><pubDate>Sun, 10 Apr 2022 03:28:44 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1649561312373/2UPpZINxT.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-background">Background</h1>
<p>In the <a target="_blank" href="https://devsai.hashnode.dev/what-are-ipv4-addresses">previous blog</a> I talked about IPv4 Addresses. There are two types of IP addresses. The old IPv4 and the new IPv6. In the previous blog, we talked about IPv4. Now we're going to talk about IPv6.</p>
<h1 id="heading-the-problem-with-ipv4">The Problem with IPv4</h1>
<p>When the original creators created IPv4, they didn't expect a huge increase in electronic devices accessing the internet. Hence IPv4 could only support 4,294,967,296 (4 billion) IP addresses. That sounds like a lot but considering there are twice as many humans as that and there are about 21.5 billion devices that connect to the internet on Earth. \( 21,500,000,000 &gt; 4,294,967,296 \) . So clearly, something had to be done, more IP addresses were needed. That's where IPv6 comes in.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649547418090/QGcVFhKzL.png" alt="IPv6 Text popping" /></p>
<h1 id="heading-introducing-ipv6">Introducing IPv6</h1>
<p>This new version of IP Addresses gives us... 340,282,366,920,938,463,463,374,607,431,768,211,456 IP addresses or about 340 undecilion IP addresses.</p>
<h3 id="heading-quick-maths-lesson">Quick Maths Lesson</h3>
<p>Everyone knows numbers go ones, tens, hundreds, thousands, millions, billions, and trillions, but there's more...<br />After a trillion we have...<br />Quadrillions (1,000,000,000,000,000)<br />Quintillions (1,000,000,000,000,000,000)<br />Sextillions (1,000,000,000,000,000,000,000)<br />Septillions (1,000,000,000,000,000,000,000,000)<br />Octillion (1,000,000,000,000,000,000,000,000,000)<br />Nonillions (1,000,000,000,000,000,000,000,000,000,000)<br />Decillions (1,000,000,000,000,000,000,000,000,000,000,000)<br />Undecillions (1,000,000,000,000,000,000,000,000,000,000,000,000)</p>
<h3 id="heading-back-to-ipv6">Back to IPv6</h3>
<p>So as you can see, there are ALOT of IPv6 Addresses. But other than more IP addresses, IPv6 also brings some other new features.</p>
<h1 id="heading-ipv4-vs-ipv6">IPv4 VS IPv6</h1>
<p>First, let's look at an IPv4 address compared to an IPv6 address.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649554677512/BF-dSgvPj.png" alt="IPv4 VS IPv6" /></p>
<p>You may look at the IPv6 address and be all stressed out about how long it is. Don't worry, let's break it down.</p>
<h3 id="heading-observations">Observations</h3>
<p>Let's look at some observations you may see. You may see that IPv6 magically has letters!? Or that the IPv6 address is like 10000 times longer than the IPv4 address. The sections of the IPv6 address are split by colons (:) while the IPv4 sections are split by dots or periods (.). So let's address (<em>get it?</em>) these observations shall we?</p>
<h3 id="heading-octets-and-hextets">Octets and Hextets</h3>
<p>In IPv4 each of the "parts" are called octets. In IPv6 the parts are called hextets.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649555049923/K2z-wpLNl.png" alt="Octets and Hextets" /></p>
<p>Each IPv6 character (digits or letters) is 4 bits each and hextets are 16 bits each. In total, an IPv6 address is 128 bits long (an IPv4 address is just 32 bits).</p>
<h3 id="heading-periods-and-colons">Periods and Colons</h3>
<p>Another thing is that IPv4 uses periods to separate octets while IPv6 uses colons to separate hextets.</p>
<h3 id="heading-there-are-letters-now">There are letters now?</h3>
<p>Another thing you may have noticed is that IPv6 has letters. Unlike IPv4 which is in Base 10 (uses only digits 0-9), IPv6 is Hexadecimal meaning it can use the Base 10 numbers of 0 - 9 and letters a - f! We use letters a - f because double-digit numbers aren't possible. Take an IP address for example, "20" will always be interpreted as "2" and "0" not "20". So we use letters a - f for numbers 10 - 15.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649633611156/CIc7cZ-qk.png" alt="Hexadecimal" /></p>
<h1 id="heading-subnet-mask">Subnet Mask</h1>
<p>Just like IPv4, IPv6 has a network and a host section. Unlike IPv4, IPv6 doesn't use a subnet mask that looks similar to 255.255.0.0. All IPv6 addresses have a /## (# representing a digit each) at the end of the IP Address. Confused? I'll provide an image.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649555136972/8ultbXXdv.png" alt="IPv6 Subnet Mask" /></p>
<p>The number at the end of the IPv6 address specifies how many bits are for the network section. Here 64 bits are for the network section. 64 bits are conveniently half of an IPv6's 128-bit long address.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649555345731/mbP4hRgNy.png" alt="Network, Host, and Subnet Mask labeled" /></p>
<p>These types of addresses (/64 addresses) are common among IPv6 addresses. Keep in mind each character (digit or letter) is 4 bits and each hextet is 16 bits.</p>
<h1 id="heading-shortening-the-ipv6-addresses">Shortening the IPv6 Addresses</h1>
<p>I bet everyone reading this thinks IPv6 addresses are VERY long. So there are a few things we can do to shorten it.</p>
<h3 id="heading-double-colons">Double-Colons</h3>
<p>First thing is to remove two adjacent hextets of repeating zeros and like this</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649556922733/DhqC16aeq.png" alt="Example for removing two hextets of repeating zeros" /></p>
<p>There is one catch with this. The double-colon may only be done once in an IPv6 address, as the computer would get confused.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649558154688/7a-HaeY_J.png" alt="IPv6, multiple ::'s, computer get confused" /></p>
<h3 id="heading-leading-zeros">Leading Zeros</h3>
<p>Another way to shorten IPv6 addresses is to remove any leading zeros of any of the hextets.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649558408337/RblTLaxpx.png" alt="Removing the leading zeros of the hextets" /></p>
<p>For the hextet with one zero (1010:ab1::c222:<strong>0</strong>:e444:abcd), that zero can't be removed as it'll become a "::", and we already have a "::" in our IP address. So we can't do that.</p>
<h1 id="heading-ipv6-parts">IPv6 Parts</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649559218864/VurqAlpkL.png" alt="IPv6 Parts labeled" /></p>
<p>There are three main parts to an IPv6 address. Ignoring the "Global Unicast" text at the top (don't worry we'll get to that later), the first part is called the "Global Prefix". It's the part your ISP gives you. It is a minimum of 48 bits long. Next is the Subnet ID it is 16 bits long and allows for 65,000+ subnets. Lastly, this leaves us with a 64-bit Interface ID AKA the host section.</p>
<h1 id="heading-ipv6-address-types">IPv6 Address Types</h1>
<p>Like IPv4, IPv6 addresses have different types; however, IPv6 doesn't have public and private addresses as it has so many IP addresses.</p>
<p>Let's look at some of them.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649559798081/-BN-ntj4Q.png" alt="IPv6 Types" /></p>
<h4 id="heading-global-unicast">Global Unicast</h4>
<p>Like the one we just saw, Global Unicast Addresses can be used publicly over the internet and typically begin with 2000:: or 3000::. The /3 means that the first 3 bits are used to identify the network section. It is like the IPv4 Public Addresses.</p>
<h4 id="heading-unique-local">Unique Local</h4>
<p>The Unique Local Address can only be used within your local network and are like IPv4 Private Addresses. They begin with FC00:: or FD00::. The /7 indicates their first 7 bits are used to identify the network section.</p>
<h4 id="heading-link-local">Link Local</h4>
<p>The Link Local Address is similar to the Unique Local Address in that it's not publicly usable, but it's used only in a specific area of a network. It begins with FE80::. The /10 indicates its first 10 bits are for the network section.</p>
<h4 id="heading-multicast">Multicast</h4>
<p>Multicast Addresses are for a group of devices listening for that Multicast address. It's like the IPv4 broadcast address, but the broadcast addresses were for all devices on a network. Broadcast addresses were scrapped and replaced with Multicast addresses. Multicast addresses start with FF::. The /8 indicates the first 8 bits are for the network section.</p>
<h4 id="heading-anycast">Anycast</h4>
<p>Lastly, an Anycast address is special as this IP address can be <em>publicly</em> assigned to multiple devices on a network, and whenever data is sent to that anycast address, it will be sent to the nearest device with that anycast address. Anycast addresses don't have their own range or beginnings so they are the same as Global Unicast with 2000::/3. Meaning they start with 2000:: with the /3 representing the first three bits are for the network section.</p>
]]></content:encoded></item><item><title><![CDATA[What are IPv4 Addresses?]]></title><description><![CDATA[One thing before we start, there are two types of IP addresses IPv4 (older) and IPv6 (newer). This blog will cover IPv4 Addresses, the next one will cover IPv6 Addresses.
Defining IP Address
IP addresses are essentially long identifiers for every dev...]]></description><link>https://blog.saisiddhish.me/what-are-ipv4-addresses</link><guid isPermaLink="true">https://blog.saisiddhish.me/what-are-ipv4-addresses</guid><category><![CDATA[internet]]></category><dc:creator><![CDATA[Sai Siddhish Chandra Sekaran]]></dc:creator><pubDate>Mon, 04 Apr 2022 18:35:17 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1649097270700/XzhQtSB_i.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>One thing before we start, there are two types of IP addresses IPv4 (older) and IPv6 (newer). This blog will cover IPv4 Addresses, the next one will cover IPv6 Addresses.</p>
<h1 id="heading-defining-ip-address">Defining IP Address</h1>
<p>IP addresses are essentially long identifiers for every device connected to the internet (look at our <a target="_blank" href="https://devsai.hashnode.dev/what-is-the-internet">last blog where we define the internet</a>). Everyone knows that your IP address is based on your location (there are even services that can give you the general location of where an IP address came from). IPv4 Addresses</p>
<p>Consider a situation where there are five different houses, let's say there's also a mailman trying to deliver mail to house one. Each house needs to have a unique address number so that the mailman doesn't deliver the mail to the wrong house.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649089938916/SkbTu3UfC.png" alt="Situation Above" /></p>
<p>Computers also work like that.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649090171021/QqL6qHN6A.png" alt="Computers also work like that" /></p>
<h1 id="heading-parts-of-an-ipv4-address">Parts of an IPv4 Address</h1>
<p>IP addresses aren't just one digit like "1" or "2" (like diagram above portrays it to be), they look more like "###.###.###.###" (the #'s representing one digit each). So the diagram from above would look more like this.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649090552025/OBm8KYtOo.png" alt="Computer Diagram remake" /></p>
<h3 id="heading-octets">Octets</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649091638071/1zTHrvA6U.png" alt="IP address broken up into octets" /></p>
<p>An IP Address has four visible numbers. These are called octets. Each octet can hold a value ranging from 0 - 255. Why 0 - 255 you may ask? Well, an IPv4 Address is a total of 32 bits. 32 bits divided (equally) into 4 numbers is 8 bits per number and 255 is the largest possible number that can be made from 8 bits.</p>
<h3 id="heading-subnet-mask">Subnet Mask</h3>
<p>Now for the parts of an IP Address. Every IPv4 Address has two main parts, the network part and the host part. The way to tell what numbers are for the network and what numbers are for the host is with a subnet mask (each IP address is paired with a subnet mask). A 255 in the subnet mask signals that the particular number of the IP address the 255 corresponds to is for the network section, any 0's are for the host section.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649092264782/cyqVhZeJ_.png" alt="IP Address &amp; Subnet Mask" /></p>
<p>Let's say a subnet mask of "255.255.255.0" is paired with the IP address "192.168.0.1". Since the first number the of the subnet mask ("<strong><em>255</em></strong>.255.255.0") corresponds to the first number of the IP address and is a 255, the first number of the IP address ("<strong><em>192</em></strong>.168.0.1") is for the network section. The same applies for the second and third numbers ("192,<strong><em>168.0</em></strong>.1") of the IP address. But for the fourth number ("192,168.0.<strong><em>1</em></strong>"), it's corresponding subnet mask number is 0, meaning it is for the host section.</p>
<p>To better help you understand the Network and Host sections of a IP Address, let's go back the mailman example.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649093067444/2ltNQcK2k.png" alt="Mail man example V2" /></p>
<p>There can be multiple houses in one street, but it's their individual house numbers that make them unique. Now if we have multiple streets then the house numbers can repeat as their street name can identify them seperately. That's basically what the network and host sections are. The streets are the networks, the houses are the hosts.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649093746611/NtfRiiUgd.png" alt="2 IP networks" /></p>
<p>The above diagram is called a network diagram. Ina network diagram it's common to to leave the host section as a 0 ("192.168.1.<strong><em>0</em></strong>"). And when you label the devices inside the network, you label the with just their host section (and no other parts of the IP Address). So when you want to mention a specific device you say the network like "192.168.1" and then say the device's host number like ".2". So in total you would say "192,168.1.2" to mention the host device 2 on network 192.168.1.</p>
<h1 id="heading-classes">Classes</h1>
<p>When IPv4 was made, it was decided to split the IP Addresses into 5 groups called classes. The main classes were Class A, Class B, and Class C. Class D was for multicasting (don't worry about knowing what that means) and Class E was for experimental purposes.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649094896411/5EgyMl0-U.png" alt="3 main IPv4 Classes" /></p>
<p>Class A has IP addresses ranging from 1.0.0.0 to 126.255.255.255 with a subnet mask of 255.0.0.0. Meaning it has three out of the four numbers for host identification. Class B has IP addresses ranging from 128.0.0.0 to 191.255.255.255 with a subnet mask of 255.255.0.0. Meaning it has two out of the four numbers for host identification. And class C has IP addresses ranging from 192.0.0.0 to 223.255.255.255 with a subnet mask of 255.255.255.0. Meaning it had one out of the four numbers for host identification. Class A could support the most amount of hosts out of the three classes (1,000,000+) while Class C could support the least amount of hosts out of the three classes (254).</p>
<h1 id="heading-public-amp-private-ip-addresses">Public &amp; Private IP Addresses</h1>
<p>But the creators of IPv4 didn't predict for the huge boom in internet and computer usage. So as of now, all IPv4 public addresses are allocated. Wait, as you read that sentence you may have noticed I used the word public IP addresses. Yes, there are public and private IP addresses.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649095518174/tpMMq7MK3.png" alt="Public and Private IP Addresses" /></p>
<p>To preserve IPv4, what they did was allocate some IP addresses from each of the classes to be that class' private IP addresses (private IP addresses still use the same subnet mask for its particular class). The difference is that public IP addresses need to be unique, private addresses can be used in multiple places. Private IP addresses only need to be unique within your network. For example your neighbor could be using the same private IP addresses as you, and that's fine. When you sign up for network services with your ISP (Internet Service Provider) they give you one public IP address, yes only one for your whole network, and they will give your house a private IP address range too. All your devices will connect to the internet through that one public IP address, and each device will have it's own unique private address in your network. One catch is that private IP addresses can NOT connect to the internet (as if they could, there would be duplicating IP addresses).</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649096815080/kpg22nScs.png" alt="Private VS Public IP Addresses" /></p>
<p>You may wondering, if all the devices one network connect to the internet through one public IP address, and private IP addresses can't be publicly distinguished. If I send and email to a friend, will everyone in house get my email? No, of course not. Using something called Network Address Translation, a topic for a different blog, the router can tell who your email is for and send it to the right person.</p>
]]></content:encoded></item><item><title><![CDATA[Developed a Quadratic Math App using C# and WinForms]]></title><description><![CDATA[Background
I learned Quadratics last year (during virtual learning) and it was really fun but also somewhat difficult to grasp. At the time, I got so much homework I couldn't find time to code, but now my homework has been reduced and I get time to c...]]></description><link>https://blog.saisiddhish.me/developed-a-quadratic-math-app-using-cs-and-winforms</link><guid isPermaLink="true">https://blog.saisiddhish.me/developed-a-quadratic-math-app-using-cs-and-winforms</guid><category><![CDATA[C#]]></category><category><![CDATA[Windows]]></category><dc:creator><![CDATA[Sai Siddhish Chandra Sekaran]]></dc:creator><pubDate>Sun, 03 Apr 2022 17:50:31 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1649008016779/qLQ53_ht8.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-background">Background</h1>
<p>I learned Quadratics last year (during virtual learning) and it was really fun but also somewhat difficult to grasp. At the time, I got so much homework I couldn't find time to code, but now my homework has been reduced and I get time to code.</p>
<p>I remembered my struggles from last year and wanted to help others who are struggling with quadratics. So I made <a target="_blank" href="https://github.com/saisiddhish/quadratic-mathapp">this Windows Forms App</a> (yes it's an exe file and Macs can't run it) that can solve quadratic equations in the format of \( ax^2 + bx + c \) and can help you practice them by generating a quadratic equation and allowing you to answer it.</p>
<h1 id="heading-about-the-project">About the project</h1>
<p>This project is called the Quadratics Math App. In this app, you can solve quadratic equations you have and can practice with automatically generated ones.<br />It was fun learning Regex to help with the parts of it that needed pattern checking. It was also fun testing it. One challenge was actually implementing the quadratic-solving function as originally it was partially accurate. For example, if the quadratic had no solutions it still gave random decimals.</p>
<h1 id="heading-how-it-works">How it works</h1>
<p>This is what the app looks like:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649006408123/48t7p51-V.jpg" alt="Quadratic App UI" /></p>
<h2 id="heading-app-left-side">App - Left Side</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649006484284/HkfYanZEZ.jpg" alt="Quadratic App Left Side" /></p>
<p>This side of the app is the Quadratic Solver. You enter your \( a \) , \( b \) , and \( c \) values and it goes through the quadratic formula, \( x = \frac{-b\pm\sqrt{b^2-4ac}}{2a} \) , and returns your (usually) two results.</p>
<p>Did I mention? It live updates the equation you type, like this:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649007023777/hIZ5l2mOY.jpg" alt="Live Update Feature" /></p>
<h2 id="heading-app-right-side">App - Right Side</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649007486076/Q-kpWgfN4.jpg" alt="Quadratic App Right Side" /></p>
<p>On the right side is the Quadratic Practice. You press the "Generate Problem" button</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649007075062/eOFyKJ8Qb.jpg" alt="Generate Problem Button" /></p>
<p>And <em>poof</em> in the "Equation will be here" textbox</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649007136926/xA74wLQNR.jpg" alt="Equation will be here textbox" /></p>
<p>Your randomly generated equation appears.</p>
<p>Then you do the math, and you put in your answers in the "Ans 1" and "Ans 2" textboxes (take your fractions to convert them to decimals, and round to the nearest thousandths place).</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649007335973/4gFBYcZKa.jpg" alt="Ans 1 and Ans 2 textboxes" /></p>
<p>Then press the "Submit All" button.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649007379126/stuXmpWEZ.jpg" alt="Submit All button" /></p>
<p>The code will go through the Quadratic Formula and finds the correct answers then compares them to what you submitted to tell you if you are right or wrong (it also tells you what the right answer is). It also allows one right and one wrong answer (so don't worry one wrong answer won't make the whole thing wrong). Consider this example below:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649007638055/XFm65v46b.jpg" alt="Quadratic Solver example" /></p>
<p>GitHub Source Code: <a target="_blank" href="https://github.com/saisiddhish/quadratic-mathapp">https://github.com/saisiddhish/quadratic-mathapp</a><br /><strong>Note:</strong> This is Windows Forms (WinForms) application, and will only run on Windows OS.</p>
<p>Hope this helps your Quadratic Problems!</p>
]]></content:encoded></item><item><title><![CDATA[What is the Internet?]]></title><description><![CDATA[Defining the Internet
The internet, the engine that powers and governs modern society. Without it, the world would come to a standstill. But what exactly is the internet? Most people just think it's a place with YouTube, Netflix, and Social Media, bu...]]></description><link>https://blog.saisiddhish.me/what-is-the-internet</link><guid isPermaLink="true">https://blog.saisiddhish.me/what-is-the-internet</guid><category><![CDATA[internet]]></category><dc:creator><![CDATA[Sai Siddhish Chandra Sekaran]]></dc:creator><pubDate>Sun, 03 Apr 2022 16:38:52 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1649097418508/SBrtchZNz.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-defining-the-internet">Defining the Internet</h1>
<p>The internet, the engine that powers and governs modern society. Without it, the world would come to a standstill. But what exactly is the internet? Most people just think it's a place with YouTube, Netflix, and Social Media, but how it functions is a lot more technical than that. </p>
<p>First and foremost, let's define the internet. According to the <em>online</em> dictionary:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649000305383/qMN9qTSI_.jpg" alt="A global computer network providing a variety of information and communication facilities, consisting of interconnected networks using standardized communication protocols." />
Basically, what Mr. Overcomplicated Definitions is attempting to convey that the internet is a bunch of interconnected computers that transmit data with some protocols. Protocols are essentially standards/rules for something (such as how to exit a school in a single file line if it's on fire). Consider the effects if computers didn't have standardized methods for transmitting data, there could be major consequences (like a loss of data). Consider the following example of a hospital file:</p>
<pre><code><span class="hljs-attr">Patient Name:</span> <span class="hljs-string">Internet</span>
<span class="hljs-attr">Date of Birth:</span> <span class="hljs-string">MM/DD/1957</span>
<span class="hljs-attr">Problem:</span> <span class="hljs-string">Doesn't</span> <span class="hljs-string">have</span> <span class="hljs-string">a</span> <span class="hljs-string">definition</span>
<span class="hljs-attr">Treatment:</span> <span class="hljs-string">Give</span> <span class="hljs-string">it</span> <span class="hljs-string">a</span> <span class="hljs-string">definition</span>
</code></pre><p>If a hospital computer wanted to send it to Merriam Webster's servers without utilizing a protocol, it could be received as:</p>
<pre><code><span class="hljs-attr">Patient Name:</span> <span class="hljs-string">DD/MM/1957</span>
<span class="hljs-attr">Date of Birth:</span> 
<span class="hljs-attr">Problem:</span> <span class="hljs-string">Does</span> <span class="hljs-string">have</span> <span class="hljs-string">a</span> <span class="hljs-string">definition</span>
</code></pre><p>As you can see some data was sent in the incorrect sequence (the DOB is the name and the problem has changed) and some parts weren't even received (the name and treatment were missing). This is why protocols are crucial and must be followed. 
So we could summarize the Internet as:</p>
<blockquote>
<p>A method of data transfer between electronic devices that adheres to specific protocols.</p>
</blockquote>
<h2 id="heading-definitions">Definitions:</h2>
<h3 id="heading-internet">Internet:</h3>
<p>A global computer network providing a variety of information and communication facilities, consisting of interconnected networks using standardized communication protocols.</p>
<h4 id="heading-our-new-definition">Our New Definition:</h4>
<blockquote>
<p>A method of data transfer between electronic devices that adheres to specific protocols.</p>
</blockquote>
<h3 id="heading-protocol">Protocol:</h3>
<p>The official procedure or system of rules governing affairs of state or diplomatic occasions.</p>
<h4 id="heading-our-new-definition">Our New Definition:</h4>
<blockquote>
<p>Standards/rules for something.</p>
</blockquote>
]]></content:encoded></item></channel></rss>