<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jithmi Kumarasingha on Medium]]></title>
        <description><![CDATA[Stories by Jithmi Kumarasingha on Medium]]></description>
        <link>https://medium.com/@jithmikumarasingha?source=rss-38460529c654------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bEMToABKy2BRaFMQsbsEEw.jpeg</url>
            <title>Stories by Jithmi Kumarasingha on Medium</title>
            <link>https://medium.com/@jithmikumarasingha?source=rss-38460529c654------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 10:46:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jithmikumarasingha/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Think You Know React? Try These 10 Interview Code Questions]]></title>
            <link>https://medium.com/@jithmikumarasingha/think-you-know-react-try-these-10-interview-code-questions-f898ca3b4737?source=rss-38460529c654------2</link>
            <guid isPermaLink="false">https://medium.com/p/f898ca3b4737</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Jithmi Kumarasingha]]></dc:creator>
            <pubDate>Mon, 31 Aug 2026 17:09:48 GMT</pubDate>
            <atom:updated>2026-08-31T17:09:48.012Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vSEkQUEOp18dTlyA.jpeg" /></figure><p>In this Medium blog I’m going to give a basic overview of React coding interview questions. Interviewers don’t always check implementation of full web applications. Most of the time they give 5–10 lines codes and ask,</p><p>● What is wrong with this code?</p><p>● What will happen when the component renders?</p><p>● What is the output of the code?</p><p>● Explain the code line by line.</p><p>Likewise, questions. These questions are designed to get an idea about our understanding about how React works internally.</p><p>In this blog I’m going to discuss the most common React related questions.</p><p><strong>1. State update is not immediately available</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*8A7ygM7MC45A1vdwEyJSJw.png" /></figure><p>When we click the button what can we see in the console?</p><p>Most of us think of it as 1. But it gives 0.</p><p>Because React state changes are not immediately reflected in the current function execution. The state update is scheduled. Then if react re renders the component it updates as 1. After two button clicks it gives as 1.</p><p><strong>2.Multiple state updates</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*5XSj56DreVAuxHYqx_aiuw.png" /></figure><p>What happens?</p><p>Most of us expect 3 as the output. But we get 1 as the output. Because all these three statements use the same count value (0) from the current render.</p><p>If we want to get the output as 3 need to modify the code as below,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*QAI9B8WyokNk2cRP1TEn0g.png" /></figure><p><strong>3.useEffect errors I</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*kpcWpiAKacoVPuXyhuU9yw.png" /></figure><p>If useEffect has no dependency array it means useEffect runs in every render. If we want to run it only in initial render need to modify code like below,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*5WlXNzp_HEPBqxDJ67xrvQ.png" /></figure><p><strong>4.useEffect errors II — infinite loop</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*Cj01LmU7pgPT-eiNIh1lSQ.png" /></figure><p>What happens in this code?</p><p>Effect changes the state. After changes the state component renders. Then useEffect is running again.</p><p>Then state changes again. Repeat the same process. So this leads to an infinite loop.</p><p><strong>5.useEffect errors III</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*HHGNsL94BoUQCFHkWaW0dg.png" /></figure><p>What is the error of this code?</p><p>The effect uses ‘user Id’ but dependency array is empty. It means this update only in initial render. If the user ID changes, the effect doesn’t run again. So, we need to use user Id [userId] to the dependency array. Then the effect runs after changing user Id.</p><p><strong>6.Directly change state</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*uZwOG441Q_RVLdDzmBSA8A.png" /></figure><p>Is this correct in React?</p><p>This is not a recommended way to change objects in React. This is like, there is an object to change it we use directory.</p><p>In React we should create a new object and update the state. It’s a recommended way to update.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*hS7k-rNn1pzK-Bl5GDgCdw.png" /></figure><p><strong>7. Map</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*TXsnDKVnR5Kv7nCiSvXiSA.png" /></figure><p>Missed one important part in above code. What is it?</p><p>It missed the ‘key’. Without the key React shows a warning. Because each list item should have a unique key. So better to write like below,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*QprZYlIGvneze41yHPGFpA.png" /></figure><p>Now React can use keys to identify items quickly.</p><p><strong>8.useMemo</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*XBooXfvVKeI-ePlDRMd6Gw.png" /></figure><p>Assume we have an expensive calculation. Every time the component is rendered, this calculation runs again and again. To do this effectively we can use useMemo. Then react can use calculated value until numbers change. It means useMemo to memorize calculated values like below,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*Iz6GJMoN8ObC0OmINg6x7Q.png" /></figure><p><strong>9.useCallback</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*jtch-VupVMrMUcCWQ2p8EA.png" /></figure><p>Assume we have a function, every time the component renders, this function runs again and again. To handle this effectively we can use useCallback. Then react can call functions until dependency changes. It means using callback to memorize functions like below,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*f1AVjRink_jQjtHMiGSjXQ.png" /></figure><p><strong>10.Event Handling</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*XrhgN50QaUjMQSKJpj02vQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*Gwt2Mept5Gnzaa9YBINRkw.png" /></figure><p>Is there any difference between those two event handlers?</p><p>When we use handeClick, when component renders it sees onClick={handleClick}. React remembers the function and when the user clicks the button function will call and see “Button Clicked”.</p><p>But in the second one, handeClick() means to call the function now. It means when rendering the button, evaluates handeClick(). So, the function runs during rendering, not when the user clicks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f898ca3b4737" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Full Stack Web App Using Cursor AI]]></title>
            <link>https://medium.com/@jithmikumarasingha/build-a-full-stack-web-app-using-cursor-ai-b3ca6f636821?source=rss-38460529c654------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3ca6f636821</guid>
            <dc:creator><![CDATA[Jithmi Kumarasingha]]></dc:creator>
            <pubDate>Fri, 06 Mar 2026 21:52:54 GMT</pubDate>
            <atom:updated>2026-03-08T02:45:00.329Z</atom:updated>
            <content:encoded><![CDATA[<p>Cursor AI is an AI-powered code editor designed to help developers write, understand, and improve code faster. It works similarly to traditional editors like VS Code, but it has built-in artificial intelligence. It helps to generate code, fix errors, explain functions, and suggest improvements while you are coding.</p><p>In this blog, I hope to explain how to build a simple web application using Cursor AI. In this I used,</p><ul><li>React — frontend</li><li>Node.js + Express — backend</li><li>MySQL — database</li></ul><p><strong>Step 1 — Create the Project Folder</strong></p><p>Create a new folder and open the folder in Cursor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IoWg7QP5O9FPhERzWhYAaA.png" /></figure><p>Now open the Cursor chat window, and give prompts to, create Node.js Express server with one route GET / that returns “Server is running”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cUjDWkYccYBC9Aa4dwdw0A.png" /></figure><p>After generating the code, install the required dependencies and run the server. By opening the server URL in a browser and seeing the message displayed, we can confirm that the backend server is working correctly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kgqxqvMXzVBX1Pb763FeeQ.png" /></figure><p><strong>Step 2 — Connect MySQL Database</strong></p><p>Next, Using the Cursor chat window, ask the AI to create a MySQL connection file. Cursor generates the necessary code to connect to the database using environment variables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IB1H7quXXBqiL_x4tcnO2w.png" /></figure><p>(make sure to update the password)</p><p>Step 3 — Create Users Table</p><p>Once the database connection works, create a users table with basic fields such as id, name, and email</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tz16cU70Hzx9oCwvGjYq0g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g4TYKIfLX86BmtWdpB7ujw.png" /></figure><p><strong>Step 4 — Create Users API</strong></p><p>After setting up the database, use Cursor to generate backend APIs.</p><p>We can ask Cursor to create a GET API endpoint that retrieves all users from the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zD-2iUFEHdnt8H9cclayEg.png" /></figure><p>Once the API code is generated, restart the server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pc6D27K0SwFdWYm78PfaCQ.png" /></figure><p>Then test the endpoint through Postman to ensure that the data is returned in JSON format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2xDG-iATMuzmE0FdcLZttA.png" /></figure><p><strong>Step 5 — Create POST API</strong></p><p>Then go to POST API endpoint, that allows us to add new users to the database. Then test this endpoint by sending sample data to verify that the new user record has been inserted successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dl2GixK-5x9nxTDVxKN_Gg.png" /></figure><p><strong>Step 6 — Create React Frontend</strong></p><p>Once the backend APIs are functioning correctly, the we can go to create the frontend using React. First initialize a React project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8OxOwa59DbVibtnio0Cb1g.png" /></figure><p>Change backend port to 5000. (React application usually runs on port 3000. when we start it using npm start. Both servers cannot run at the same time because only one application can use a port at a time.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rhZ4mdOyTWUYbDJDhyBT9Q.png" /></figure><p>Run the frontend to confirm that the frontend environment is working.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mFUdgh810Tbx4x3fKz8SQQ.png" /></figure><p><strong>Step 7 — Generate React Component Using Cursor</strong></p><p>Give prompts to generate React components. Using the Cursor chat window, ask the AI to generate a React component that fetches data from the backend API and displays the list of users on the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*usUWgew4KXVEnvnRU5TL0Q.png" /></figure><p><strong>Step 8 — Add User Form</strong></p><p>Faced CORS errors and fixed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ogvog5xzWWWkdGNrRO6vCg.png" /></figure><p>Then, ask Cursor to create a form component that allows users to enter their name and email and send this information to the backend API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O3nIw7df0L70_J4FpaaC6g.png" /></figure><p>By submitting the form and verifying that the new user appears both in the UI and the database, we can confirm that the full-stack application works successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N1GkiwNMQowja4FV_MLCNg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dvVdCtt1FKZ2QO4VuhxWYA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m84otE9UWyvfjC201OtxQw.png" /></figure><p>By following this approach, we can build an application very easily with Cursor. This allows developers to spend more time building and improving the application instead of writing the same repetitive code again and again.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3ca6f636821" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Simple Data Science Roadmap]]></title>
            <link>https://medium.com/@jithmikumarasingha/a-simple-data-science-roadmap-8bb551a39adf?source=rss-38460529c654------2</link>
            <guid isPermaLink="false">https://medium.com/p/8bb551a39adf</guid>
            <dc:creator><![CDATA[Jithmi Kumarasingha]]></dc:creator>
            <pubDate>Fri, 30 Jan 2026 21:12:10 GMT</pubDate>
            <atom:updated>2026-01-30T21:12:10.676Z</atom:updated>
            <content:encoded><![CDATA[<p>Do you know? Data Science is one of the most popular and trending fields nowadays. If you are confused about where to start and what to learn step by step, this roadmap will guide you clearly and simply. In this I suggest 10 basic and common areas that help beginners to start.</p><p><strong>1. Programming Basics (Python)</strong></p><p>Python is the most widely used language in Data Science because it is simple and powerful.</p><p><strong>What to Learn</strong></p><ul><li>Variables and data types</li><li>Conditions</li><li>Loops</li><li>Functions</li><li>Lists, dictionaries, tuples and data structures</li></ul><p><strong>2. Mathematics for Data Science</strong></p><p>We don’t need very advanced mathematics, but basic understanding is very important for data science. Among all the mathematics parts statistics(mean, median, mode), probability basics, linear algebra (vectors, matrices) are very important concepts for start data science.</p><p><strong>3. Data Analysis with Python</strong></p><p>This is where Data Science becomes practical. Instead of just learning concepts, we start working with real data in this step. Python provides more powerful libraries. They are,</p><ul><li><strong>NumPy</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/0*qlMOlMO52kq0hfqh" /><figcaption>Numpy</figcaption></figure><p>NumPy stands for Numerical Python. It is used for fast mathematical and numerical operations. Works with large numbers and arrays efficiently. Faster than normal Python lists. Used internally by many other libraries (Pandas, ML libraries)</p><ul><li><strong>Pandas</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/0*oQg0cXdFDxNkUrwD" /><figcaption>Pandas</figcaption></figure><p>Pandas is the most important library for handling and analyzing data. It allows us to work with data in table format, like Excel or database tables. Easy to read datasets (CSV, Excel)</p><ul><li><strong>Matplotlib</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*a2p_fd6Ds2Nob_dJ.png" /><figcaption><strong>Matplotlib</strong></figcaption></figure><p>Matplotlib is used to create graphs and charts. It helps you understand patterns and trends in data visually. Helps in decision-making.</p><p><strong>4. Data Visualization</strong></p><p>Data Visualization means showing data in the form of charts and graphs. Numbers alone are hard to understand. But when data is shown visually, patterns and trends become clear. It helps to understand data quickly compare values easily and explain results to others. There are lots of ways to visualize data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-VR7EN-QHOOE3hfK.png" /><figcaption>Line Charts</figcaption></figure><p>Line Charts- shows how data changes over time or in sequence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a5J9LI82k2BEk6Qj.png" /><figcaption>Bar Charts</figcaption></figure><p>Bar Charts- compares values across different categories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/0*OlQ6kBou_QfUO0m0.png" /><figcaption>Pie Charts</figcaption></figure><p>Pie Charts- shows proportions or percentages of a whole.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/264/0*iwBF1wi9l5owjhLr.png" /><figcaption>Histogram</figcaption></figure><p>Histograms- shows how data is distributed over ranges.</p><p><strong>5. Data Cleaning &amp; Preprocessing</strong></p><p>In real life, data is never perfect. It may have missing values, duplicate records, incorrect formats ,values in different scales .Before analysis data must be cleaned. There are lot of preprocessing techniques. In this I have mentioned some basic techniques.</p><p><em>Handling Missing Values</em></p><p>Missing values occur when some data is not available. we can handle it by,</p><ul><li>Remove missing data</li><li>Numerical data → replace with mean or median</li><li>Categorical data → replace with most frequent value</li></ul><p><em>Removing Duplicates</em></p><p>Duplicates are repeated records in a dataset.</p><p><em>Data Normalization</em></p><p>Normalization means scaling data into a common range. These are some common Normalization Techniques.</p><p>1. Min–Max Scaling</p><p>Scales values between 0 and 1.</p><p>2. Standardization (Mean = 0, Std = 1)</p><p><strong>6. Machine Learning Basics</strong></p><p>Machine Learning (ML) allows computers to learn from data and make predictions or decisions. Instead of writing rules manually, we train a model using data, and the model learns patterns from it. For Data Science beginners below concepts are essential.</p><ul><li>Supervised vs Unsupervised learning</li><li>Linear Regression</li><li>Logistic Regression</li><li>Decision Trees</li></ul><p><strong>7. Model Evaluation</strong></p><p>We must know how good our model is. These are the main matrix that use to evaluate the model.</p><ul><li>Accuracy</li><li>Precision</li><li>Recall</li><li>Mean Squared Error</li></ul><p><strong>8. Projects</strong></p><p>Learning concepts is important, but projects prove your real skills.Anyone can say <em>“I know Data Science”</em>, but projects show how you handle real data and how you solve problems. Projects are the most important part of your Data Science journey.</p><p><strong>9. Tools we should know</strong></p><p>Knowing Data Science concepts is important, but tools help you apply them in real life. These tools are commonly used by students, professionals, and companies.</p><p><em>Jupyter Notebook</em></p><p>Jupyter Notebook is an interactive coding environment where we can write Python code and see output immediately. We can add text explanations and create visualizations as well.</p><p><em>Google Colab</em></p><p>Google Colab is a cloud-based Jupyter Notebook provided by Google. We don’t need to install anything. We can run Python code directly in the browser.</p><p><em>Git &amp; GitHub</em></p><p>Git is a version control system. It helps us to track changes in your code. GitHub is a platform to store and share our code online using Git. They are very important to track project history, work on team projects and backup your code.</p><p><em>SQL</em></p><p>SQL (Structured Query Language) is used to work with databases. In Data Science, data is often stored in databases, not files. SQL is more important to fetch large datasets and filter data quickly.</p><p><strong>10. Keep Learning &amp; Practicing</strong></p><p>Data Science is a continuous learning journey. So,</p><ul><li>Practice daily</li><li>Read blogs and documentation</li><li>Build projects</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8bb551a39adf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Start with Handlebars]]></title>
            <link>https://medium.com/@jithmikumarasingha/start-with-handlebars-7e926d1e6c9e?source=rss-38460529c654------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e926d1e6c9e</guid>
            <dc:creator><![CDATA[Jithmi Kumarasingha]]></dc:creator>
            <pubDate>Wed, 02 Oct 2024 19:06:13 GMT</pubDate>
            <atom:updated>2024-10-03T03:20:08.337Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*atmqLzffn2FP1O1tqS379A.png" /></figure><p><strong>What is handlebars?</strong></p><p>Handlebars is a templating<strong> </strong>language that allows users to generate HTML pages dynamically with combining data. It is commonly used in web development. Using handlebars, we can create reusable components and pages by injecting dynamic data into predefined templates. It means we can create pages using handlebars and pass values to the pages, so they are reusable.</p><p>Handlebars allows users to keep logic (handlebars.js) separate from your HTML structure. Then code will clearer and maintain logic and template will easier.</p><p><strong>Setup Handlebars</strong></p><p>To setup handlebars first install it into the project. For Node.js project,</p><pre>npm install handlebars</pre><p><strong>Handlebars Template</strong></p><p>Handlebars templates are written in plain HTML with placeholders for dynamic data. The placeholders are wrapped in {{}} braces. In Handlebars placeholders are called handlebars expressions. Handlebars expression will be replaced in actual values when the page or component rendered.</p><p>Ex:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*rJtXTnrwsVDXidcTFvLvcg.png" /></figure><p>{{title}} {{description}} {{message}} are handlebars expressions, and they will be replaced with actual values when it is rendered.</p><p><strong>Get final HTML out put</strong></p><p>To get final HTML out put we need to create handlebars.js and provide it with the data to populate the placeholders.</p><p>If we consider we have given a name as message-box to the template id. First, we need to get the template from the HTML.</p><pre>const templateSource = document.getElementById(‘message-box’).innerHTML;</pre><p>This can access the content of the template.</p><p>Then we need to compile the template using Handlebars.</p><pre>const template = Handlebars.compile(templateSource);</pre><p>This compiles the template into a function that can be used to render the final HTML by injecting data.</p><p>Then we need to define data. We create a Data object with three properties. Title, description and message. This is the dynamic data that will be replaced into the handlebar’s expression.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ExzYeRzkxDDPwsUrH0GKaA.png" /></figure><p>After that we need to render the compiled template with the data. The compiled template is used as a function. we pass in the Data object. Handlebars replaces the handlebar’s expression with the values from the Data object.</p><pre>const compiledHtml = template(Data);</pre><p>Finally, the rendered HTML is inserted into the DOM, so it gets displayed on the webpage.</p><pre>document.getElementById(‘content’).innerHTML = compiledHtml;</pre><p>Handlebars is a great option when you need a simple, lightweight templating engine that keeps your code clean and separates logic from view rendering. It’s easy to use, flexible, and powerful enough for most templating needs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e926d1e6c9e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Redux-Saga?]]></title>
            <link>https://medium.com/@jithmikumarasingha/what-is-redux-saga-f39f9a980e14?source=rss-38460529c654------2</link>
            <guid isPermaLink="false">https://medium.com/p/f39f9a980e14</guid>
            <category><![CDATA[redux-saga]]></category>
            <dc:creator><![CDATA[Jithmi Kumarasingha]]></dc:creator>
            <pubDate>Wed, 27 Mar 2024 01:24:30 GMT</pubDate>
            <atom:updated>2024-03-28T00:55:20.269Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article I hope to cover basics in redux and redux-saga with an example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*0AbpghrmCvHbMAiipV95Yw.png" /></figure><p><strong>Why Redux?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*16s8NQGdK2r_uYDk2z6j4A.png" /></figure><p>Consider these rectangles are components in react. If I want pass data from outer component to inner one. How to do this?</p><p>I need to pass data from one component to another component until it meets the inner one. In react this is called props drilling. Properties pass component by component until the inner one is met. Is it an easy way?</p><p>No, actually it makes life so difficult. Redux handle this case very easily. Redux is basically a JavaScript state management library. Actually, it is like a simple database that can access any component in the application without passing props one by one. In redux there are five main components.</p><p><em>store</em></p><p><em>reducers</em></p><p><em>actions</em></p><p><em>Dispatcher</em></p><p><em>Selector</em></p><p>Store is a centralized database that can store data and update the states. It can maintain global state. Global state means the state that can be accessed and updated anywhere.</p><p>Reducer -used to update the global state in store. Only the reducer can update the global state. One application can have multiple reducers, but at the end all combined together -(rootReducer). Reducer must return some values and reducer must have some initial values.</p><p>Actions -used to pass data from react to redux. Actions get data from react component and send them to reducers. Action should have a key that is type. Type key must sync with the reducer. Type key is used to identify which reducer will share the data.</p><p>Type key is same in action and reducer.</p><p>Selector -Selector is used to ask information from the store through useSelector hook. Because components cannot get data that are stored in the database directly. For useState hook is responsible to ask data from the store.</p><p>Dispatcher- Dispatcher is used to update the store through useDispatch hook. Obviously, it’s done by reducers, but reducers can’t directly break the flow so dispatches to update the store. The dispatcher says that I want to update very specific reducer then update the store.</p><p><strong>Why Redux-Saga?</strong></p><p>Saga is a middleware. Middleware means it’s like a media. If I want to go from Colombo to Bandarawela. I select the medium as a bus. Middleware is like a medium. Middleware can communicate between two layers. Saga is used to handle side effects in redux. Side effects mean mainly asynchronous operations like API calls, data fetching. If there is an asynchronous operation in the component saga is to take responsibility to do it and other operations will flow as normal. So, there is no need to wait until the asynchronous operation. It reduces time wastage and increases the efficiency of the process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*x6xOVpCrVGqxyJMf46i4Og.png" /></figure><p><strong>Example: (login page)</strong></p><blockquote>dispatch data to an action called postUsers.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fhHhQEeSksqrl9ZlWNxb_g.png" /></figure><blockquote>action gets data from react login component.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tk5dZ_6572UWbJfgHcOERQ.png" /></figure><blockquote>redux saga file used to handle asynchronous event.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UUdXcFU4aIFMUa8FRzaP-g.png" /></figure><blockquote>‘‘rootSaga’’ handles all saga files in the project.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g-3SBZ6pnZYm_mv0SZW05Q.png" /></figure><blockquote>reducer used to update states.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_SoXdKxit27wgOC9EizOCQ.png" /></figure><blockquote>“combineReduces’’ handles all reducers.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8t8X-63BCgB6srSGm-kvVA.png" /></figure><blockquote>create and configure store.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IA0-Vccz78rHR9y1ff__yQ.png" /></figure><p>Redux and Redux-Saga are powerful tools in managing state and handling side effects in React applications. Just like the login example we can use redux-saga to handle side effects that occur in our application. It is a efficient way to handle asynchronous events rather than waiting. By using Redux and Redux-Saga effectively we can build efficient applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f39f9a980e14" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Data Science?]]></title>
            <link>https://medium.com/@jithmikumarasingha/what-is-data-science-9d2a16b96278?source=rss-38460529c654------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d2a16b96278</guid>
            <dc:creator><![CDATA[Jithmi Kumarasingha]]></dc:creator>
            <pubDate>Mon, 26 Jun 2023 15:14:34 GMT</pubDate>
            <atom:updated>2023-06-26T15:14:34.628Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*JBCdzXFjjzOU3B7qHJ20vA.jpeg" /></figure><p>Data science is a multidisciplinary field that combines techniques, tools, and methodologies to extract knowledge and insights from structured and unstructured data. It has rare qualities and high demand. It involves analyzing large volumes of data to uncover patterns, trends, and correlations that can be used to make informed decisions and predictions.</p><p>Data science incorporates various fields including statistics, mathematics, computer science. The process of data science typically involves these steps.</p><p><strong>Problem definition : </strong>process of clearly understanding and articulating the business problem or objective that needs to be addressed through data analysis. It involves defining the specific question or challenge that data science techniques can help solve.</p><p><strong>Data collection: </strong>Data collection is a critical step in the data science process that involves gathering relevant data from various sources to analyze. The quality and comprehensiveness of the collected data directly impact the accuracy and reliability of the subsequent analysis and models. These are some key aspects of data collection;</p><blockquote>Define the Objective</blockquote><blockquote>Identify Data Sources</blockquote><blockquote>Plan the Data Collection Process</blockquote><blockquote>Collect the Data</blockquote><blockquote>Ensure Data Quality</blockquote><blockquote>Organize and Store the Data</blockquote><blockquote>Document the Data Collection Process</blockquote><blockquote>Maintain Data Privacy and Ethics</blockquote><p><strong>Data Cleaning and Preprocessing: </strong>Use to improve the quality and usability of raw data before it can be analyzed or modeled. Data cleaning involves identifying and correcting or removing errors, inconsistencies, missing values, outliers, and irrelevant information from the dataset. Data preprocessing involves transforming and preparing the data in a format suitable for analysis or machine learning algorithms.</p><p><strong>Exploratory Data Analysis: </strong>It involves visually and statistically exploring and summarizing the main characteristics, patterns, and relationships within a dataset. It aims to gain a deeper understanding of the data and generate hypotheses for further analysis. EDA helps to select appropriate modeling techniques.</p><p><strong>Statistical Analysis:</strong> It<strong> </strong>is a branch of data analysis that involves applying statistical methods, techniques, and models to understand, interpret, and draw conclusions from data. Statistical analysis helps in making data-driven decisions and testing hypotheses. There are some techniques used in statistical analysis,</p><blockquote>Descriptive Statistics</blockquote><blockquote>Inferential Statistics</blockquote><blockquote>Hypothesis Testing</blockquote><blockquote>Confidence Intervals</blockquote><blockquote>Regression Analysis</blockquote><blockquote>Analysis of Variance</blockquote><blockquote>Correlation Analysis</blockquote><p><strong>Machine Learning: </strong>Building predictive models and algorithms that can learn from data to make accurate predictions or classifications.</p><p><strong>Data Visualization: </strong>Creating visual representations of data through charts, graphs, and interactive dashboards to effectively communicate findings and insights.</p><p><strong>Feature Engineering:</strong> Selecting, transforming, and creating relevant features from the data to improve the performance of machine learning models.</p><p><strong>Model Evaluation and Deployment:</strong> Assessing the performance of models, fine-tuning them, and deploying them into production environments to make predictions on new data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d2a16b96278" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>