<?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 Sithum wijesinghe on Medium]]></title>
        <description><![CDATA[Stories by Sithum wijesinghe on Medium]]></description>
        <link>https://medium.com/@sithumwijesinghe59?source=rss-f4e5443f027e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*XRpQIfoYRELZppbLRKSM9g.jpeg</url>
            <title>Stories by Sithum wijesinghe on Medium</title>
            <link>https://medium.com/@sithumwijesinghe59?source=rss-f4e5443f027e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 08:03:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sithumwijesinghe59/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[NotebookLM And Future Of Students]]></title>
            <link>https://medium.com/@sithumwijesinghe59/notebooklm-and-future-of-students-71d99b9e0123?source=rss-f4e5443f027e------2</link>
            <guid isPermaLink="false">https://medium.com/p/71d99b9e0123</guid>
            <dc:creator><![CDATA[Sithum wijesinghe]]></dc:creator>
            <pubDate>Sun, 17 Nov 2024 19:09:45 GMT</pubDate>
            <atom:updated>2024-11-17T19:09:45.277Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ex5Z4ImB3O8jkL3Kb9Z3Eg.png" /></figure><h3><strong>What is that ?</strong></h3><p>NotebookLM is an AI-powered tool designed to help you organize and understand information more effectively.</p><p>You may upload a variety of documents, including PDFs, Google Docs, and webpages, and it will utilize artificial intelligence (AI) to compile, examine, and produce insights from the data. For professionals, researchers, and students who need to swiftly understand complex information, this makes it a useful tool.</p><h3>Plus Point</h3><p>NotebookLM’s capacity to design customized learning experiences is what makes it unique. Based on the papers you submit, it may create study guides, flashcards, and even podcasts, customizing the content to meet your unique requirements.</p><p><strong>NotebookLM can answer your questions about the content, provide explanations, and offer different perspectives.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*chbzLFPFM4VgVR3Wfzw-yg.jpeg" /></figure><h3>How NotebookLM Makes Work Easier</h3><p><strong>Knowledge Management:</strong></p><ul><li>Centralized storage and organization of documents, research papers, meeting notes, etc.</li><li>Easy searching and retrieval of information within a vast knowledge base.</li></ul><p><strong>Research and Analysis:</strong></p><ul><li>Summarizing lengthy documents and extracting key points.</li><li>Generating insights and identifying patterns from data.</li><li>Comparing and contrasting different sources of information.</li></ul><p><strong>Content Creation:</strong></p><ul><li>Drafting emails, reports, and presentations.</li><li>Generating creative ideas and writing prompts.</li><li>Editing and improving existing content.</li></ul><p><strong>Collaboration:</strong></p><ul><li>Sharing notebooks and collaborating on projects with team members.</li><li>Real-time editing and feedback.</li></ul><h3>How NotebookLM Helps Students</h3><p><strong>Note-Taking and Organization:</strong></p><ul><li>Automatic transcription of lectures and discussions.</li><li>Summarizing and organizing notes.</li><li>Creating flashcards and study guides.</li></ul><p><strong>Research and Writing</strong></p><ul><li>Finding relevant information and sources.</li><li>Summarizing research papers and articles.</li><li>Drafting essays and reports.</li></ul><p><strong>Learning and Comprehension</strong></p><ul><li>Explaining complex concepts in simpler terms.</li><li>Answering questions and clarifying doubts.</li><li>Providing personalized learning experiences.</li></ul><h3>Conclusion</h3><ul><li>Summarize the key benefits of NotebookLM for work and student use.</li><li>Emphasize its potential to transform how we work and learn.</li><li>Encourage readers to explore NotebookLM and experience its advantages firsthand.</li></ul><p><strong>Additional Tips:</strong></p><ul><li>Use real-world examples and anecdotes to illustrate the benefits of NotebookLM.</li><li>Include screenshots or visuals to make your article more engaging.</li><li>Consider interviewing experts or users of NotebookLM to add credibility to your article.</li><li>Optimize your article for search engines by using relevant keywords and meta descriptions.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71d99b9e0123" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Node.js + MongoDB: User Authentication & Authorization with JWT]]></title>
            <link>https://medium.com/@sithumwijesinghe59/node-js-mongodb-user-authentication-authorization-with-jwt-0f0dce219274?source=rss-f4e5443f027e------2</link>
            <guid isPermaLink="false">https://medium.com/p/0f0dce219274</guid>
            <category><![CDATA[jwt-token]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Sithum wijesinghe]]></dc:creator>
            <pubDate>Sat, 19 Oct 2024 09:15:04 GMT</pubDate>
            <atom:updated>2024-10-19T09:15:04.108Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/413/1*2kNkX1pVFLwHKCLiTuKryQ.jpeg" /></figure><ul><li><strong>Authentication</strong> is verifying a user’s identity.</li><li><strong>Authorization</strong> is ensuring the user has permission to access specific resources.</li></ul><h3>Token Based Authentication</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VIR7fCdL4fPM3_Rq8Lky2A.png" /></figure><p>Comparing with Session-based Authentication that need to store Session on Cookie, the big advantage of Token-based Authentication is that we store the JSON Web Token (JWT) on Client side: Local Storage for Browser</p><p>There are three important parts of a JWT: Header, Payload, Signature. Together they are combined to a standard structure: header.payload.signature.</p><h3>Node.js Express Architecture with Authentication &amp; Authorization</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zEG1CtxP-RzJqvYh5aggog.png" /></figure><p>Via <em>Express</em> routes, <strong>HTTP request</strong> that matches a route will be checked by <strong>CORS Middleware</strong> before coming to <strong>Security</strong> layer.</p><p><strong>Security</strong> layer includes:</p><ul><li>JWT Authentication Middleware: verify SignUp, verify token</li><li>Authorization Middleware: check User’s roles with record in database</li></ul><p>An error message will be sent as HTTP response to Client when the middlewares throw any error, .</p><p><strong>Controllers</strong> interact with MongoDB Database via <em>Mongoose</em> library and send <strong>HTTP response</strong> (token, user information, data based on roles…) to the Client.</p><h3><strong>Let’s see the demo</strong></h3><h3>Setting Up the Project</h3><p>Start with a blank project and install necessary dependencies.</p><pre>mkdir jwt-auth-project<br>cd jwt-auth-project<br>npm init -y<br>npm install express mongoose bcryptjs jsonwebtoken dotenv<br>npm install nodemon --save-dev</pre><p><strong>Project Structure</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*my0bGrK-EfMiuLolT_q3Zw.png" /></figure><p><strong>Connecting to MongoDB</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AIQtUCGLZQhC7UlYRUxrSw.png" /></figure><ul><li>This code connects to your MongoDB database. We use mongoose.connect to establish the connection, and if it works, we log &quot;MongoDB connected.&quot; If it fails, the app will exit.</li><li>dotenv.config() is used to load the database URL (MONGO_URI) from the .env file</li></ul><p><strong>In </strong><strong>.env, define the MongoDB URI:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dlD7RN-7MOLat3s_aaivgA.png" /></figure><p><strong>Creating the User Model</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*29NmevDFv6ed0BUNzTSfcg.png" /></figure><ul><li>The User model defines what a user looks like: they have a name, email, and password.</li><li>Before saving a user to the database, the password is hashed using bcrypt so it&#39;s stored securely and not as plain text.</li><li>UserSchema.pre(&#39;save&#39;) means that before a user is saved, we hash the password automatically.</li></ul><p><strong>Authentication Routes</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*alK0-TLtcjy_p1ZOgBY2RA.png" /></figure><ul><li><strong>Register Route</strong>: When a user sends their name, email, and password to /register, we check if the email is already in use. If not, we create a new user and save it. Then we generate a JWT token to send back to the user.</li><li><strong>Login Route</strong>: When a user tries to log in, we check if the email exists and if the provided password matches the one stored. If both are correct, we generate a JWT token and return it.</li></ul><p><strong>JWT Middleware for Protected Routes</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mFKktnQcT3GtJkNMzmWJSw.png" /></figure><ul><li>This middleware function checks if there’s a valid JWT token in the request header (x-auth-token). If there is, the token is verified using jwt.verify(). If it&#39;s valid, the user&#39;s ID is extracted and saved to req.user so other routes can use it.</li><li>If there’s no token or an invalid token, the request is denied.</li></ul><h4>Create a New Route File for Profile</h4><p>You should add this code in a new file inside the routes folder. For example, you can create a file called profile.js.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9DF-hZ_OtHeeBVsZLdkejw.png" /></figure><ul><li>This route (/profile) is protected, meaning users must be logged in and provide a valid JWT token. The auth middleware is added here, so before the route is run, the token is checked.</li><li>After verifying the token, we get the user’s info from the database (excluding the password) and send it back as a response.</li></ul><h3>Main Entry Point</h3><p>In index.js:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xC9-Br0P7kfsx6YZqxaq-Q.png" /></figure><ul><li>This is the entry point of the application. It sets up an Express server and connects to the database.</li><li>We use express.json() to make sure the server can handle JSON data in requests (like registration and login).</li><li>The /api/auth routes handle user authentication and registration.</li></ul><p>Now you can run the server</p><h3>Summary of the Flow</h3><ol><li><strong>Register</strong>: User sends their details, and a new account is created. A JWT token is returned.</li><li><strong>Login</strong>: User logs in with their email and password, gets a JWT token in response.</li><li><strong>Access Protected Route</strong>: The token is sent in the request header to access secure routes (like /profile).</li></ol><p>In next time check that all with postman</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0f0dce219274" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SSR vs. CSR: Choosing the Right Rendering Strategy for Your Web App]]></title>
            <link>https://medium.com/@sithumwijesinghe59/ssr-vs-csr-choosing-the-right-rendering-strategy-for-your-web-app-66ad212431da?source=rss-f4e5443f027e------2</link>
            <guid isPermaLink="false">https://medium.com/p/66ad212431da</guid>
            <dc:creator><![CDATA[Sithum wijesinghe]]></dc:creator>
            <pubDate>Thu, 17 Oct 2024 06:57:53 GMT</pubDate>
            <atom:updated>2024-10-17T06:57:53.499Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/311/1*3CBh6gXc4PcaMod8QAqSjA.jpeg" /></figure><h3><strong>Introduction</strong></h3><p>Rendering strategies can have a significant impact on the performance, SEO, and user experience of web applications. Server-Side Rendering (SSR) and Client-Side Rendering (CSR) are two popular approaches, each with its own set of benefits and drawbacks. In this article, we will break down the key differences between SSR and CSR, help you understand their use cases, and provide examples using Next.js</p><p><strong>What is Client-Side Rendering (CSR)?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4lD0AfhfmP9WhkhTF0HbUQ.png" /></figure><p>Client-Side Rendering is the process where the browser receives a bare-bones HTML file from the server and JavaScript is responsible for rendering the content dynamically. <strong>The entire rendering process happens in the browser</strong>, which means the <strong>user must wait for JavaScript to load before seeing any meaningful content</strong>.</p><p>How CSR Works:</p><p>The server sends an almost empty HTML file containing a root element (e.g., &lt;div id=&quot;root&quot;&gt;&lt;/div&gt;) and JavaScript bundles.</p><p>The browser downloads and executes JavaScript.</p><p>The content is dynamically rendered based on the JavaScript code.</p><pre>// index.html<br>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>  &lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;title&gt;CSR Example&lt;/title&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>    &lt;div id=&quot;root&quot;&gt;&lt;/div&gt;<br>    &lt;script src=&quot;/bundle.js&quot;&gt;&lt;/script&gt;<br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><p>The content in &lt;div id=&quot;root&quot;&gt;&lt;/div&gt; will only be populated once React is loaded on the client side.</p><h3><strong>Pros of CSR:</strong></h3><p><strong>Rich Interactivity</strong>: Perfect for highly interactive web apps where dynamic updates are frequent.</p><p><strong>Reduced Server Load</strong>: Once the app is loaded, the server does not need to re-render content on each request.</p><h3><strong>Cons of CSR:</strong></h3><p><strong>Slower Initial Load</strong></p><p><strong>SEO Challenges</strong>: Search engines may have difficulty indexing content that requires JavaScript to render, making CSR unsuitable for SEO-critical pages.</p><h3>What is Server-Side Rendering (SSR)?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mNBUPMyXZFRb9rzUlyevsA.png" /></figure><p>In SSR, the HTML content is rendered on the server for each request, and a fully rendered page is sent to the client. The browser displays the content almost instantly, and then JavaScript takes over (also known as hydration) to make the page interactive.</p><h4>How SSR Works:</h4><p><strong>1</strong>.The server generates the HTML content based on the request.</p><p><strong>2</strong>.The fully-rendered HTML is sent to the browser.</p><p><strong>3</strong>.JavaScript “hydrates” the page, making it interactive after the initial content is displayed.</p><h3><strong>Pros of SSR:</strong></h3><p><strong>Improved SEO</strong>: Since content is rendered on the server, search engines can easily crawl and index the content.</p><p><strong>Faster First Paint</strong>: The user sees the content more quickly since the HTML is rendered on the server.</p><h3><strong>Cons of SSR:</strong></h3><p><strong>Increased Server Load</strong></p><p><strong>Slower Time to Interactive (TTI)</strong></p><p>That’s a great topic! You can structure your article in a way that explains the key concepts of Server-Side Rendering (SSR) and Client-Side Rendering (CSR), how they differ, and when to choose one over the other, using real-world examples with frameworks like Next.js.</p><p>Here’s a detailed guide for writing the article:</p><h3>Title: SSR vs. CSR: Choosing the Right Rendering Strategy for Your Web App</h3><h3>Introduction</h3><p>Rendering strategies can have a significant impact on the performance, SEO, and user experience of web applications. Server-Side Rendering (SSR) and Client-Side Rendering (CSR) are two popular approaches, each with its own set of benefits and drawbacks. In this article, we will break down the key differences between SSR and CSR</p><h3>What is Client-Side Rendering (CSR)?</h3><p>Client-Side Rendering is the process where the browser receives a bare-bones HTML file from the server and JavaScript is responsible for rendering the content dynamically. The entire rendering process happens in the browser, which means the user must wait for JavaScript to load before seeing any meaningful content.</p><h4>How CSR Works:</h4><ol><li>The server sends an almost empty HTML file containing a root element (e.g., &lt;div id=&quot;root&quot;&gt;&lt;/div&gt;) and JavaScript bundles.</li><li>The browser downloads and executes JavaScript.</li><li>The content is dynamically rendered based on the JavaScript code.</li></ol><h4>Example in React:</h4><pre>// index.html<br>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>  &lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;title&gt;CSR Example&lt;/title&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>    &lt;div id=&quot;root&quot;&gt;&lt;/div&gt;<br>    &lt;script src=&quot;/bundle.js&quot;&gt;&lt;/script&gt;<br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><p>The content in &lt;div id=&quot;root&quot;&gt;&lt;/div&gt; will only be populated once React is loaded on the client side.</p><h4>Pros of CSR:</h4><ul><li><strong>Rich Interactivity</strong>: Perfect for highly interactive web apps where dynamic updates are frequent.</li><li><strong>Reduced Server Load</strong>: Once the app is loaded, the server does not need to re-render content on each request.</li></ul><h4>Cons of CSR:</h4><ul><li><strong>Slower Initial Load</strong>: Since the browser has to download and execute JavaScript before rendering content, it leads to a slower initial loading experience.</li><li><strong>SEO Challenges</strong>: Search engines may have difficulty indexing content that requires JavaScript to render, making CSR unsuitable for SEO-critical pages.</li></ul><h3>What is Server-Side Rendering (SSR)?</h3><p>In SSR, the HTML content is rendered on the server for each request, and a fully rendered page is sent to the client. The browser displays the content almost instantly, and then JavaScript takes over (also known as hydration) to make the page interactive.</p><h4>How SSR Works:</h4><ol><li>The server generates the HTML content based on the request.</li><li>The fully-rendered HTML is sent to the browser.</li><li>JavaScript “hydrates” the page, making it interactive after the initial content is displayed.</li></ol><h4>Example in Next.js (using SSR):</h4><pre>// pages/index.js (Next.js example)<br>import React from &#39;react&#39;;</pre><pre>export default function Home({ posts }) {<br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;Blog Posts&lt;/h1&gt;<br>      &lt;ul&gt;<br>        {posts.map(post =&gt; (<br>          &lt;li key={post.id}&gt;{post.title}&lt;/li&gt;<br>        ))}<br>      &lt;/ul&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><pre>export async function getServerSideProps() {<br>  const res = await fetch(&#39;https://jsonplaceholder.typicode.com/posts&#39;);<br>  const posts = await res.json();<br>  <br>  return {<br>    props: { posts },<br>  };<br>}</pre><p>In this example, the getServerSideProps function fetches the posts from an API on the server side, and the fully-rendered HTML content is returned to the client.</p><h4>Pros of SSR:</h4><ul><li><strong>Improved SEO</strong>: Since content is rendered on the server, search engines can easily crawl and index the content.</li><li><strong>Faster First Paint</strong>: The user sees the content more quickly since the HTML is rendered on the server.</li></ul><h4>Cons of SSR:</h4><ul><li><strong>Increased Server Load</strong>: The server has to render the content on every request, which can lead to performance bottlenecks under heavy load.</li><li><strong>Slower Time to Interactive (TTI)</strong>: Even though the user sees content faster, interactivity may be delayed as the JavaScript still needs to hydrate the app.</li></ul><h3>Key Differences Between CSR and SSR</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1DqvCssSmniEmClJDC27XA.png" /></figure><h3><strong>Conclusion</strong></h3><p>Choosing between Server-Side Rendering (SSR) and Client-Side Rendering (CSR) is crucial for creating fast, SEO-optimized, and user-friendly web applications. Understanding the differences, benefits, and use cases for each approach will help you make the right decision based on the specific needs of your project.</p><p>Frameworks like Next.js provide the flexibility to use SSR, CSR, and even hybrid models like ISR and SSG, giving you the best of both worlds. Whether your focus is performance, SEO, or dynamic interactivity, there’s a rendering strategy that fits your use case.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66ad212431da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[how to deploy a website on GitHub pages]]></title>
            <link>https://medium.com/@sithumwijesinghe59/how-to-deploy-a-website-on-github-pages-239f6841a0bc?source=rss-f4e5443f027e------2</link>
            <guid isPermaLink="false">https://medium.com/p/239f6841a0bc</guid>
            <category><![CDATA[github-pages]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[how-to-deploy-website]]></category>
            <dc:creator><![CDATA[Sithum wijesinghe]]></dc:creator>
            <pubDate>Sat, 05 Oct 2024 00:54:15 GMT</pubDate>
            <atom:updated>2024-10-05T00:54:15.890Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/297/1*DZSxpF8BnoE59tqGoclqnw.png" /></figure><h3>First , <strong>Ensure Your Repository is Connected to GitHub</strong>:</h3><blockquote>if not connect your repo to GitHub</blockquote><p>If your project includes JSX (JavaScript XML) or other pre-compiled formats, the browser will not understand them by default. We need to build the project into static files that browsers can read (HTML, CSS, and JavaScript).</p><p>Open a terminal in the root directory of your project.</p><p>Run the following command:</p><p><strong>npm run build</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fuWQ-FBAPOhkTvzayy5Gqw.png" /></figure><p>This command creates a <strong>dist</strong> or <strong>build</strong> folder containing all the files your browser can understand. The <strong>dist</strong> folder typically includes optimized JavaScript and HTML files that are production-ready.</p><p><strong>Why do we need this?</strong></p><ul><li>The browser cannot read JSX, but it can read the output of the build step, which converts JSX into JavaScript.</li></ul><h3>Deploy Your Project to GitHub Pages</h3><p><strong>Set Up GitHub Pages</strong>:</p><ul><li>In your GitHub repository, go to the <strong>Settings</strong> tab.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6lzW3nq-hbk2t-zMmftcWw.png" /></figure><ul><li>Scroll down to the <strong>GitHub Pages</strong> section.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*wZOWrXaCu0Q1NzVyJlXHhA.png" /></figure><ul><li>Under <strong>Source</strong>, select the main branch or the gh-pages branch, depending on your setup.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gYHQVIpxY9wPGHpAsJF0-g.png" /></figure><ul><li>You have to select gh-pages to deploy your site. Because that branch contains all transform files after building the dist folder.</li><li>Now you can save the changes.</li><li>After the above steps, your site should be live within a few minutes. You can access it via a URL like:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t4cwkDCRRy3bVSznkhCmWg.png" /></figure><p>After every change run<strong> npm run build </strong>because<strong> </strong>that command converts your all changes to a dist folder .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=239f6841a0bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[data binding in Angular 17]]></title>
            <link>https://medium.com/@sithumwijesinghe59/data-binding-in-angular-17-9477291943e0?source=rss-f4e5443f027e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9477291943e0</guid>
            <dc:creator><![CDATA[Sithum wijesinghe]]></dc:creator>
            <pubDate>Tue, 09 Jul 2024 04:28:56 GMT</pubDate>
            <atom:updated>2024-07-09T04:28:56.196Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is data binding -</h3><p>Data binding is two-way communication between your component’s data and the view presented in the HTML. It allows you to dynamically update the UI based on changes in the data model</p><p><strong>Here’s a breakdown of data binding in Angular 17:</strong></p><ol><li>one way data binding</li><li>Property Binding</li><li>Event Binding</li><li>Two-way Data Binding</li></ol><p><strong>One-way data binding</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*6bU7GXhLZ7RkuivLzb4lzg.png" /></figure><p>This is the most basic form of data binding, represented by double curly braces {{ }}. It allows you to directly embed data from your component&#39;s TypeScript code into the HTML template. Any changes to the data property in your component will automatically reflect in the UI.</p><p>&lt;p&gt;Hello, {{ name }}!&lt;/p&gt;</p><p>In the above example, the name property from your component&#39;s TypeScript is displayed within the paragraph element.</p><p><strong>Property Binding</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*IvCSucT5VC5e3_s7PPeNPQ.png" /></figure><p>This type of binding allows you to set the value of HTML element properties (like src, href, class, etc.) using expressions within double curly braces.</p><p>&lt;img [src]=”imageUrl” alt=”Image”&gt;</p><p>Here, the imageUrl property from your component dynamically sets the src attribute of the image element. Changes in imageUrl will automatically update the image displayed.</p><p><strong>Event Binding</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*2ucTds-Quclp2O02H9okpQ.png" /></figure><p>This binding establishes a connection between user interactions on UI elements and methods defined in your component’s TypeScript code. Event binding uses the (event) syntax, where event represents the specific event you want to listen to (e.g., (click), (keyup), etc.).</p><p>&lt;button (click)=”onClick()”&gt;Click Me&lt;/button&gt;</p><p>In this example, clicking the button triggers the onClick() method defined in your component.</p><p><strong>Two-way Data Binding</strong></p><p>This powerful binding type allows for seamless synchronization between the user’s input in HTML form elements and your component’s data properties. You achieve this using the [(ngModel)] directive</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*5ZopKiQseL6gaa6Or9PSxA.png" /></figure><p>&lt;input type=”text” [(ngModel)]=”userName” placeholder=”Enter your name”&gt;</p><p>Here, the user’s input in the text field is automatically reflected in the userName property of your component. Similarly, any changes to userName in your component will update the displayed value in the input field.</p><p>This two-way data binding use in forms in angular</p><p>Reference</p><p><a href="https://angular.dev/guide/templates/two-way-binding">Data binding</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9477291943e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adapter Pattern]]></title>
            <link>https://medium.com/@sithumwijesinghe59/adapter-pattern-3948a29d2339?source=rss-f4e5443f027e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3948a29d2339</guid>
            <dc:creator><![CDATA[Sithum wijesinghe]]></dc:creator>
            <pubDate>Mon, 17 Jun 2024 06:39:56 GMT</pubDate>
            <atom:updated>2024-06-18T04:15:32.890Z</atom:updated>
            <content:encoded><![CDATA[<p>I think you all know about design patterns. In this article, we will discuss the Adapter pattern, which is a subpart of structural patterns. The Adapter pattern is used to create a bridge between incompatible interfaces. This article is suitable for beginner-level students who want to understand what the Adapter pattern is.</p><p>Let’s start by explaining what incompatible interfaces are. These are two interfaces that are completely different from each other. An interface is like a completely abstract class, meaning it is a class with empty bodies (it has methods and functions, but they are empty).</p><p>Now, let’s move to an example code:|</p><figure><img alt="example code for adapter pattern" src="https://cdn-images-1.medium.com/max/1024/1*_SVZ1V2FXfrf8HOHzUMAWA.png" /></figure><p>Here, you can see that it has two different interfaces. The first one is **<strong>Bird</strong>** and the second one is **<strong>ToyDuck</strong>**. **<strong>Bird</strong>** has methods like a real animal, but **<strong>ToyDuck</strong>** does not. Now, we need to create a bridge between **<strong>Bird</strong>** and **<strong>ToyDuck</strong>**. Therefore, we create the **<strong>BirdAdapter</strong>** class. You can understand this simply from the diagram below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v3YhJ9C1DPb03nteQKsaiA.jpeg" /><figcaption>For better Understand</figcaption></figure><p><strong>Interfaces</strong>: Define the behaviours of birds and toy ducks.</p><p><strong>Sparrow</strong>: A type of bird that can fly and make a sound.</p><p><strong>BirdAdapter</strong>: Makes a bird (like a sparrow) behave like a toy duck by converting the bird’s sound to the toy duck’s squeak.</p><p><strong>Main Program</strong>: Shows how a sparrow can “squeak” like a toy duck using the adapter.</p><p>Here main part of this code is the BirdAdapter class. This acts as a bridge between the <strong>Bird</strong> interface and the <strong>ToyDuck</strong> interface. The adapter takes a <strong>Bird</strong> object and makes it compatible with the <strong>ToyDuck</strong> interface by implementing the <strong>squeak() </strong>method. Inside this method, it calls the bird&#39;s <strong>makeSound()</strong> method, effectively translating a bird&#39;s sound to the toy duck&#39;s squeak.</p><p>finally, when running the main class, A <strong>Sparrow</strong> object is created, and then a <strong>BirdAdapter</strong> is created with the Sparrow passed to it. When <strong>toyDuck.squeak()</strong> is called, it makes the sparrow&#39;s sound through the adapter.</p><p>now discuss Advantages of the Adapter Pattern:</p><p><strong>*It allows two or more previously incompatible objects to interact.</strong></p><p><strong>*It allows reusability of existing functionality.</strong></p><p>why do we need an adapter pattern?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rdn2GAMlDuW_03RuzoFFoA.png" /><figcaption>why need</figcaption></figure><p>references-<a href="https://www.tutorialspoint.com/design_pattern/adapter_pattern.htm">adapter_pattern</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3948a29d2339" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring the Academic Excellence at Sabaragamuwa University of Sri Lanka]]></title>
            <link>https://medium.com/@sithumwijesinghe59/exploring-the-academic-excellence-at-sabaragamuwa-university-of-sri-lanka-e953f6adcfb3?source=rss-f4e5443f027e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e953f6adcfb3</guid>
            <dc:creator><![CDATA[Sithum wijesinghe]]></dc:creator>
            <pubDate>Tue, 04 Jun 2024 12:10:08 GMT</pubDate>
            <atom:updated>2024-06-04T12:10:08.204Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Exploring the Academic Excellence at Sabaragamuwa University of Sri Lanka</strong></p><p>— -</p><p>**Exploring the Academic Excellence at <a href="https://www.sab.ac.lk/">Sabaragamuwa University of Sri Lanka**</a></p><p><a href="https://www.sab.ac.lk/">Sabaragamuwa University of Sri Lanka (SUSL)</a>, established in 1991, stands as a testament to the country’s commitment to providing quality higher education. Located in the picturesque town of Belihuloya, SUSL offers a unique blend of academic rigor and natural beauty, making it an ideal place for students to pursue their academic and personal growth.</p><p>### Diverse Academic Programs</p><p>SUSL offers a comprehensive range of undergraduate and postgraduate programs through its various faculties. The [Faculty of Agricultural Sciences] is dedicated to advancing knowledge in sustainable agriculture, while the [Faculty of Applied Sciences] provides cutting-edge education in fields such as natural sciences and computing. Additionally, the [Faculty of Geomatics] focuses on geospatial sciences, preparing students for careers in surveying, mapping, and related fields.</p><p>The [Faculty of Management Studies]offers programs in business and management, equipping students with the skills needed to thrive in the global marketplace. Meanwhile, the [Faculty of Social Sciences and Languages] and the [Faculty of Technology]provide comprehensive education in humanities, social sciences, and technology, respectively.</p><p>### Research and Innovation</p><p>Research is a cornerstone of SUSL’s mission. The university encourages both faculty and students to engage in innovative research projects that address real-world challenges. SUSL’s [<a href="https://www.sab.ac.lk/research/">research centers</a>]are equipped with state-of-the-art facilities, supporting studies in environmental science, agriculture, technology, and social sciences. This commitment to research fosters a culture of inquiry and discovery, contributing to the development of sustainable solutions for local and global issues.</p><p>### Vibrant Campus Life</p><p>Life at Sabaragamuwa University is vibrant and enriching. The university hosts a range of [<a href="https://www.sab.ac.lk/">extracurricular activities</a>]that cater to diverse interests, ensuring a holistic university experience. Students can join various clubs and societies, participate in sports, and engage in cultural events. These activities not only enhance the university experience but also help students develop leadership skills and a sense of community.</p><p>### Natural Setting</p><p>One of SUSL’s unique features is its stunning natural setting. Surrounded by lush greenery and breathtaking landscapes, the university provides an ideal environment for study and reflection. The <a href="https://www.sab.ac.lk/">campus</a> offers numerous opportunities for outdoor activities and research related to environmental conservation. This proximity to nature enhances the aesthetic appeal of the university and promotes a healthy and balanced lifestyle for students and staff.</p><p>### Global Connections</p><p>Sabaragamuwa University maintains strong connections with international institutions, facilitating student and faculty exchanges, collaborative research, and global networking. These [global partnerships](<a href="https://www.sab.ac.lk/international/">https://www.sab.ac.lk/international/</a>) enrich the educational experience by exposing students to diverse perspectives and best practices from around the world. Such connections also open doors for students and faculty to participate in international conferences, workshops, and other academic events.</p><p>### Join the SUSL Community</p><p>Whether you are a prospective student looking for quality education, a researcher seeking collaborative opportunities, or simply someone interested in learning more about Sri Lanka’s higher education landscape, Sabaragamuwa University of Sri Lanka is worth exploring. The institution’s commitment to academic excellence, innovation, and community service makes it a beacon of knowledge and progress.</p><p>For more information, visit the <a href="https://www.sab.ac.lk/">Sabaragamuwa University of Sri Lanka website</a>.</p><p>— -</p><p>Feel free to share your experiences or ask any questions about SUSL in the comments. Let’s celebrate and support the growth of this exceptional university!</p><p>#SabaragamuwaUniversity #SriLanka #HigherEducation #AcademicExcellence #Research #CampusLife #GlobalEducation</p><p>— -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*qg5_DV8-N9lqR4ANoAidvA.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e953f6adcfb3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>