<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Madhawa Awishka</title>
    <description>The latest articles on DEV Community by Madhawa Awishka (@madhawaawishka).</description>
    <link>https://dev.to/madhawaawishka</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1707007%2Fe89bdf79-3757-4bbd-95a3-c1f02ee0d0b8.JPG</url>
      <title>DEV Community: Madhawa Awishka</title>
      <link>https://dev.to/madhawaawishka</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/madhawaawishka"/>
    <language>en</language>
    <item>
      <title>bcrypt Explained: Safeguarding Passwords with Advanced Hashing</title>
      <dc:creator>Madhawa Awishka</dc:creator>
      <pubDate>Tue, 13 Aug 2024 12:44:56 +0000</pubDate>
      <link>https://dev.to/madhawaawishka/bcrypt-explained-safeguarding-passwords-with-advanced-hashing-2acn</link>
      <guid>https://dev.to/madhawaawishka/bcrypt-explained-safeguarding-passwords-with-advanced-hashing-2acn</guid>
      <description>&lt;h2&gt;
  
  
  Introduction to Password Hashing
&lt;/h2&gt;

&lt;p&gt;password hashing means turns your password(or any other piece of data) into a short strings of letters and/or numbers using an encryption algorithm.If a website is hacked, password hashing helps prevent cybercriminals from getting access to your passwords.Strong passwords are of the utmost importance. They protect your electronic accounts and devices from unauthorized access, keeping your sensitive personal information safe.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fio3rufkm7nlsy8tvzqdr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fio3rufkm7nlsy8tvzqdr.png" alt="Image description" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction to bcrypt
&lt;/h2&gt;

&lt;p&gt;Bcrypt is a lauded password-storing solution that uses complicated cryptographic algorithms, significantly reducing the chances of a hacker cracking your password.&lt;/p&gt;

&lt;h2&gt;
  
  
  How bcrypt works
&lt;/h2&gt;

&lt;p&gt;Bcrypt runs a complex hashing process, during which a user’s password is transformed into a fixed-length thread of characters. It uses a one-way hash function, meaning that once the password is hashed, it cannot be reversed to its original form.nstead of simply hashing the given password, bcrypt adds a random piece of data, called salt, to create a unique hash that is almost impossible to break.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;salt generation:when user creates a account or sets a password bcrypt generates a random salt (a random string of characters). The salt is then combined with the password.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hashing:Bcrypt uses a configurable “work factor” sometimes called “rounds” or “cost factor ” to determine the number of iterations the algorithm will run. For example, if the cost factor is 10, the algorithm will iterate ²¹⁰ (1024) times.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Password + salt + hashing: The password and salt are then concatenated, and the combined string is passed through the hash function multiple times(determined by the “cost factor”). Each iteration processes the output of the previous iteration, making the process computationally expensive.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Storage: The hashed password is then stored in the database along with generated salt and “cost factor” that was used. The salt (initial random string of characters)and cost factor must be stored alongside the hashed password for authentication purposes as the process is repeated when the user logs into their account.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  why use bcrypt
&lt;/h2&gt;

&lt;p&gt;The purpose of using a salt in password hashing is to add uniqueness and randomness to each hashed password it makes it very difficult for hackers to reverse-engineer a password that has been hashed. However, not impossible.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6icb9wd2pinsv88y2thu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6icb9wd2pinsv88y2thu.png" alt="Image description" width="640" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Implementing bcrypt in Node.js&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Setup and Installation
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install bcrypt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Hashing a Password&lt;/strong&gt;&lt;br&gt;
Here’s a simple example of how to hash a password using bcrypt in Node.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const bcrypt = require('bcrypt');

const saltRounds = 10; // Number of salt rounds (cost factor)
const plainTextPassword = 'mySecretPassword';

bcrypt.hash(plainTextPassword, saltRounds, function(err, hash) {
    if (err) {
        console.error('Error hashing password:', err);
    } else {
        console.log('Hashed password:', hash);
    }
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Verifying a Password&lt;/strong&gt;&lt;br&gt;
To verify a password, use the compare function&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const bcrypt = require('bcrypt');

const plainTextPassword = 'mySecretPassword';
const hashedPassword = '$2b$10$TTA/FRNq9Z.tAIUfu2XgYOBk3L9r4JrN7x1vIrrrXoR4lPu1dPApW'; // Example hash

bcrypt.compare(plainTextPassword, hashedPassword, function(err, result) {
    if (err) {
        console.error('Error comparing passwords:', err);
    } else if (result) {
        console.log('Password matches!');
    } else {
        console.log('Password does not match.');
    }
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Real-world Application
&lt;/h2&gt;

&lt;p&gt;Many websites like e commerce platofrms,social-media platforms use bcrypt to securely store passowrds.content Management systems like WordPress and Drupal can integrate bcrypt through plugins or configurations to enhance the security of user accounts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Further Reading and Resources
&lt;/h2&gt;

&lt;p&gt;Npm bcrypt documentation&lt;/p&gt;

&lt;p&gt;Wikipedia/bcryt&lt;/p&gt;

&lt;h2&gt;
  
  
  Community and Support
&lt;/h2&gt;

&lt;p&gt;Stack Overflow&lt;/p&gt;

&lt;p&gt;Reddits&lt;/p&gt;

&lt;p&gt;Github discussions&lt;/p&gt;

&lt;p&gt;Throughout this blog, we’ve explored the fundamental principles of password hashing and why bcrypt stands out as a reliable and secure option. We’ve seen how its adaptive nature and inclusion of a salt make it a robust choice for safeguarding passwords against modern threats. Given the rising number of data breaches and cyberattacks, securing user data is more important than ever. Implementing bcrypt in your projects can be a significant step toward protecting sensitive information and building trust with your users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Happy Coding!&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Dynamic Document Head Management Using React Helmet</title>
      <dc:creator>Madhawa Awishka</dc:creator>
      <pubDate>Sat, 27 Jul 2024 18:32:48 +0000</pubDate>
      <link>https://dev.to/madhawaawishka/dynamic-document-head-management-using-react-helmet-4i1i</link>
      <guid>https://dev.to/madhawaawishka/dynamic-document-head-management-using-react-helmet-4i1i</guid>
      <description>&lt;p&gt;&lt;strong&gt;React hemlet&lt;/strong&gt; is a reusable react component that will manage all of the changes with the document head. This makes server-side rendering and React Helmet a dynamic duo for creating apps that are SEO and social media-friendly.&lt;br&gt;
When developing a react application we all know managing the document head is going to be crucial especially when considering Search Engine Optimization (SEO) and the overall user experience. This is where &lt;strong&gt;React Helmet&lt;/strong&gt; comes into play. React Helmet makes it easy to manage meta tags, titles, and other head elements vital for SEO and social media sharing. By using it, developers can ensure that their React application presents the correct information in the head, which can significantly affect how the content is ranked and displayed in search results.&lt;/p&gt;
&lt;h2&gt;
  
  
  Understanding the Document Head and the SEO
&lt;/h2&gt;

&lt;p&gt;The document head also referred to as a head section of the HTML document is a pivotal area that holds meta tags, title tags, and links for stylesheets and scripts.These tags are not visible to users of the web pages but these elements are essential for search engines to understand the content of the web page which is directly affecting to the SEO.Installation and Configuration of React Helmet&lt;/p&gt;
&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;p&gt;1.Supports all valid head tags: title, base, meta, link, script, noscript, and style tags.&lt;br&gt;
2.Supports attributes for body, html and title tags.&lt;br&gt;
3.Supports server-side rendering.&lt;br&gt;
4.Nested components override duplicate head changes.&lt;br&gt;
5.Duplicate head changes are preserved when specified in the same&lt;br&gt;
6.component (support for tags like "apple-touch-icon").&lt;br&gt;
7.Callback for tracking DOM changes.&lt;/p&gt;
&lt;h2&gt;
  
  
  Installation and Configuration of React Helmet
&lt;/h2&gt;

&lt;p&gt;To get started with React Helmet, you'll need to install it in your React project. You can do this by running the following terminal command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install --save react-helmet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or if you prefer using yarn,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add react-helmet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once installed, you can import React Helmet into your React components. Here's a basic example of how to configure React Helmet in a component&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import { Helmet } from 'react-helmet';

const HomePage = () =&amp;gt; (
  &amp;lt;div&amp;gt;
    &amp;lt;Helmet&amp;gt;
      &amp;lt;title&amp;gt;Home Page - My React App&amp;lt;/title&amp;gt;
      &amp;lt;meta name="description" content="Welcome to the home page of my React app" /&amp;gt;
      {/* Additional head elements */}
    &amp;lt;/Helmet&amp;gt;
    {/* Content of the home page */}
  &amp;lt;/div&amp;gt;
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above example, the Helmet component is used to set the title and meta description for the home page of the React app. This configuration ensures that when the home page is rendered, the document head will include these elements important for SEO and social media sharing.&lt;/p&gt;

&lt;h2&gt;
  
  
  React Helmet and Server-Side Rendering (SSR)
&lt;/h2&gt;

&lt;p&gt;SSR is a technique designed to improve the performance and SEO of JavaScript-heavy apps, such as those developed using React. SSR generates the complete HTML for a page on the server before sending it to the client, allowing search engines to crawl the content more effectively.&lt;br&gt;
React Helmet plays a vital role in SSR by allowing developers to manage head elements for each rendered page on the server. This ensures that when a search engine or social media crawler requests a page, it receives all the necessary meta tags and title tags that help index the content accurately.&lt;br&gt;
React Helmet can be integrated into SSR workflows to manage the document head effectively. For instance, after rendering the React components on the server, React Helmet can collect all the head changes made by the components and include them in the server-generated HTML output.&lt;/p&gt;

&lt;h2&gt;
  
  
  SEO Friendliness and Limitations of React Helmet
&lt;/h2&gt;

&lt;p&gt;React Helmet is a powerful tool for managing the head section of your React application, and it goes a long way in making your app SEO-friendly. By allowing you to dynamically set meta tags, such as meta name description content and other head elements, React Helmet helps ensure that search engines and social media platforms have the correct information to display your content effectively.&lt;br&gt;
However, while it is excellent for managing the head, it could be a silver bullet for SEO. SEO encompasses many factors, including page performance, mobile-friendliness, backlinks, and high-quality content.&lt;br&gt;
It helps with the on-page SEO aspect, but developers should know that a comprehensive SEO strategy involves much more than managing head tags.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In conclusion, It is an essential library for any React developer looking to improve the SEO and shareability of their applications. Developers can ensure that their applications are well-optimized for search engines and social media platforms.&lt;br&gt;
Whether you're a React beginner familiar with advanced techniques or a senior software engineer, mastering React Helmet is a valuable skill in today's web development landscape.&lt;br&gt;
&lt;strong&gt;Happy Coding!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Documentation:&lt;br&gt;
&lt;a href="https://www.npmjs.com/package/react-helmet#features" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/react-helmet#features&lt;/a&gt;&lt;br&gt;
&lt;a href="https://stackoverflow.com/questions/52690820/what-is-the-purpose-of-react-helmet" rel="noopener noreferrer"&gt;https://stackoverflow.com/questions/52690820/what-is-the-purpose-of-react-helmet&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>react</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Mastering Tailwind CSS: A Comprehensive Guide for Beginners</title>
      <dc:creator>Madhawa Awishka</dc:creator>
      <pubDate>Tue, 23 Jul 2024 10:11:43 +0000</pubDate>
      <link>https://dev.to/madhawaawishka/mastering-tailwind-css-a-comprehensive-guide-for-beginners-43l9</link>
      <guid>https://dev.to/madhawaawishka/mastering-tailwind-css-a-comprehensive-guide-for-beginners-43l9</guid>
      <description>&lt;h2&gt;
  
  
  What is Tailwind CSS?
&lt;/h2&gt;

&lt;p&gt;Tailwind CSS is a highly customizable utility-first CSS framework that provides low-level utility classes to build designs directly in your markup. Tailwind has a really well-maintained, curated, and updated system of “sensible defaults” at its core. It’s really easy to make something look nice with minimal effort. That’s why it has that much popularity among developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benifits of learing Tailwind css
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Efficiency and Productavity&lt;/li&gt;
&lt;li&gt;Flexibility and cutomization&lt;/li&gt;
&lt;li&gt;Responsive Design&lt;/li&gt;
&lt;li&gt;No specific Design Decisions&lt;/li&gt;
&lt;li&gt;Learning modern CSS concepts.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to mastering Tailwind?
&lt;/h2&gt;

&lt;p&gt;Before you going to learn Tailwind you should have a proper idea about CSS styling. you should have a clear idea about CSS fundamentals such as selectors, properties, specificity, and the Box model.&lt;/p&gt;

&lt;p&gt;if you search on the Internet surely you can see tons of videos or courses to learn tailwind css. I think it is not that much necessary. all you have to do is you should master the CSS first. after that, you can use the Search and Apply approach.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Search and Apply Approach&lt;br&gt;
the solution is learning tailwind is just use the tailwind documentaion.it’s sound like bad approach but let me explain.tailwind is just css.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv2a5yxypj10yn1z183gk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv2a5yxypj10yn1z183gk.png" alt="thumbnail image" width="800" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Like i said before if you know css you already know Tailwind css.All you need to do is go to the documentation and add styles as your wish.&lt;/p&gt;

&lt;p&gt;as a example suppose like this.you want to add some left padding to your HTML element.just go to the doucement and search padding&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6hpvr65uj2m4zgypp8j2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6hpvr65uj2m4zgypp8j2.png" alt="tailwind css officail document screenshot" width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As another example if you want to add text color to your element.hust search the text color in the search bar that will give you all the classes you want.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fffuptlcjencnylmuim1a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fffuptlcjencnylmuim1a.png" alt="tailwind css officail document screenshot" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv64t3ilw7zrsg3ut21lh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv64t3ilw7zrsg3ut21lh.png" alt="example image" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Link for the Tailwincs css documenataion:&lt;a href="https://tailwindcss.com/" rel="noopener noreferrer"&gt;https://tailwindcss.com/&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;In conclusion, while Tailwind CSS offers a powerful and efficient way to style web applications using utility classes, it is essential to first master the foundational concepts of CSS. By having a solid understanding of CSS properties, selectors, and layout principles, developers can leverage Tailwind CSS more effectively to streamline their workflow and create consistent, responsive designs. Rather than replacing CSS knowledge, Tailwind CSS complements it, offering a pragmatic approach to the rapid development and maintenance of modern web interfaces. Therefore, invest time in honing your CSS skills — it will undoubtedly enhance your proficiency and creativity when using tools like Tailwind CSS in your projects.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>tailwindcss</category>
      <category>vscode</category>
      <category>coding</category>
    </item>
    <item>
      <title>Debug and find logical errors in the C program using dev c++ IDE</title>
      <dc:creator>Madhawa Awishka</dc:creator>
      <pubDate>Sat, 20 Jul 2024 04:53:14 +0000</pubDate>
      <link>https://dev.to/madhawaawishka/debug-and-find-logical-errors-in-the-c-program-using-dev-c-ide-38hk</link>
      <guid>https://dev.to/madhawaawishka/debug-and-find-logical-errors-in-the-c-program-using-dev-c-ide-38hk</guid>
      <description>&lt;p&gt;&lt;strong&gt;Debugging&lt;/strong&gt; is the process of detecting and removing potential logical errors (bugs) in a computer program&lt;/p&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;

&lt;p&gt;Write a c program to input marks earned for the exam and the marks earned for the homeworks to calculate and display the overall course score.Students can obtain 50% percent from their exam and 50% percent from their homeworks.&lt;br&gt;
score1=exam score*(50/100)&lt;/p&gt;

&lt;p&gt;score2=homework score*(50/100)&lt;/p&gt;

&lt;p&gt;course score=exam score+homework score&lt;/p&gt;

&lt;p&gt;This is the c program source code to the above question&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/*This program calculates the overall score using given the points
 earned for the exam and homework*/

#include &amp;lt;stdio.h&amp;gt;

int main()

{

int examScore, homeworkScore;

float score1, score2, overallScore;

printf("Please enter the points earned for the exam : ");

scanf("%d", &amp;amp;examScore);

printf("Please enter the points earned for homework: ");

scanf("%d", &amp;amp;homeworkScore);

score1 = examScore * 50 / 100.0;

score2 = homeworkScore * 50 / 100.0;

overallScore = (score1 + score2) / 2;

printf( "Overall course score is %.2f", overallScore );

return 0;

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 01:&lt;/p&gt;

&lt;p&gt;open Dev c++ and write the above code&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdmkgrsef3r4a5qierf9o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdmkgrsef3r4a5qierf9o.png" alt="Image description" width="800" height="390"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 02:&lt;/p&gt;

&lt;p&gt;save and compile the program.&lt;/p&gt;

&lt;p&gt;if your program does not have any errors and warnings excute the c program.Run your program with the following data set&lt;/p&gt;

&lt;p&gt;The points earned for the exam:90&lt;/p&gt;

&lt;p&gt;The points earned for the homework:60&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjbqhm0a436z9urkj6ubm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjbqhm0a436z9urkj6ubm.png" alt="Image description" width="800" height="256"&gt;&lt;/a&gt;&lt;br&gt;
if you have calculated your overall course score manually,the score should be 75.Here your expected output and program output is diffrent.it means,there is/are logical error/s in our C program.&lt;/p&gt;

&lt;p&gt;Step 03:&lt;/p&gt;

&lt;p&gt;Now, you can use the debugging option to find logical errors in the program.&lt;/p&gt;

&lt;p&gt;Go To Tools →compiler option&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4y5yvg3k2lqg8nn8y2te.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4y5yvg3k2lqg8nn8y2te.png" alt="Image description" width="665" height="687"&gt;&lt;/a&gt;&lt;br&gt;
Step 04:&lt;/p&gt;

&lt;p&gt;Set breakpoint in C program&lt;br&gt;
A breakpoint is a point in the program where you want the execution to stop temporarily so that you can examine the values of variables.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff19hyawyockg90dvjwuz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff19hyawyockg90dvjwuz.png" alt="Image description" width="800" height="497"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Start debugging&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffvznsfqe0tdtonoiwhwd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffvznsfqe0tdtonoiwhwd.png" alt="Image description" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on Debug button, then your program will be executed up to line no. 8&lt;/p&gt;

&lt;p&gt;Step04:&lt;/p&gt;

&lt;p&gt;Add a watch on a variable&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw16ye5tj280sdzgukdvk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw16ye5tj280sdzgukdvk.png" alt="Image description" width="800" height="627"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then a pop up box will appear.You can give a name of a variable that you are going to add a watch.Let’s give “Examscore” variable as a first add watch.Then click “OK” button.Add watches on other variables and check their values. (homeworkScore,score1, score2, overallScore).&lt;/p&gt;

&lt;p&gt;Step 05:&lt;/p&gt;

&lt;p&gt;input values to the variables&lt;/p&gt;

&lt;p&gt;Currently we are in line number 9.The program is executed up to line no. 8.To excute next C statement in the line number 10,click on the next line button(It is next to add watch button).&lt;/p&gt;

&lt;p&gt;Then line number 10 will be excuted and you can see a output as “Please enter the points for the exam:”To excute the next line press “Next line” button again.Line number 10 will be excuted and now you can input the points for the exam as 90.Then press Enter button on your keyboard.&lt;/p&gt;

&lt;p&gt;Like this you can input value for the homework score as 60.Now, you can see that the variable values of examScore and homeworkScore are changed to 90 and 60.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4scx4n8iapbxjkkuhl90.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4scx4n8iapbxjkkuhl90.png" alt="Image description" width="800" height="320"&gt;&lt;/a&gt;&lt;br&gt;
Step 06:&lt;/p&gt;

&lt;p&gt;Observe outputs&lt;/p&gt;

&lt;p&gt;When you excute line number 15 you can see score 1 as 45.&lt;/p&gt;

&lt;p&gt;It means that this calculation is correct, and it takes 50% of exam marks.&lt;br&gt;
There is no logical error in this calculation.&lt;/p&gt;

&lt;p&gt;To execute next statement in line no. 16, click on Next line button again.&lt;br&gt;
Then, line no. 16 will be executed and score2 value is calculated.&lt;br&gt;
30 is stored inside score2 variable. It means that this calculation is correct, and it takes 50% of exam marks.There is no logical error in this calculation&lt;/p&gt;

&lt;p&gt;To execute next statement in line no. 17, click on Next line button again.&lt;br&gt;
Then, line no. 17 will be executed and overallScore value is calculated.&lt;br&gt;
37.5 is stored in overallScore variable. You can see that this calculation is incorrect, and it doesn’t calculate overall score correctly.&lt;br&gt;
So that, there can be a logical error in this calculation in line no. 17.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdtw0of5yphmeq0y2kokc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdtw0of5yphmeq0y2kokc.png" alt="Image description" width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 07:&lt;/p&gt;

&lt;p&gt;Fix logical errors&lt;/p&gt;

&lt;p&gt;To fix the logical error, debugging process should be stopped using Stop Execution button.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fylyzthavqvpptqnfthnv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fylyzthavqvpptqnfthnv.png" alt="Image description" width="800" height="484"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we observe the statement in line number 17&lt;/p&gt;

&lt;p&gt;Overallscore=(score1+score2) / 2&lt;/p&gt;

&lt;p&gt;Here, we don’t need to divide the addition of two scores by 2 since we need to take overall score out of 100.&lt;br&gt;
That’s the error that we have done. Now, you can modify the statement as bellow.&lt;/p&gt;

&lt;p&gt;Overallscore=(score1+score2)&lt;/p&gt;

&lt;p&gt;Click on the line number of the relevant statement which includes the break point to remove it.&lt;/p&gt;

&lt;p&gt;Compile and run the program and see whether the program works as expected. If you can’t get the expected output, there may be more logical errors.&lt;br&gt;
Then you need to debug your program again to identify those logical errors.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>cpp</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Taliwind CSS VS Boostrap:which one should you choose?</title>
      <dc:creator>Madhawa Awishka</dc:creator>
      <pubDate>Fri, 19 Jul 2024 17:49:26 +0000</pubDate>
      <link>https://dev.to/madhawaawishka/taliwind-css-vs-boostrapwhich-one-should-you-choose-26o1</link>
      <guid>https://dev.to/madhawaawishka/taliwind-css-vs-boostrapwhich-one-should-you-choose-26o1</guid>
      <description>&lt;p&gt;In the ever-evolving world of &lt;strong&gt;front-end development&lt;/strong&gt;, choosing the right CSS framework is crucial. This blog aims to compare Tailwind CSS and Bootstrap, two popular frameworks, to help you decide which one suits your needs better.&lt;/p&gt;

&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;Bootstrap, developed by Twitter, has been around since 2011 and is known for its pre-styled components. Tailwind CSS, introduced in 2017, takes a different approach with its utility-first methodology.&lt;/p&gt;

&lt;h2&gt;
  
  
  Customization and Flexibility
&lt;/h2&gt;

&lt;p&gt;Bootstrap offers a range of pre-made components that help you quickly set up a consistent design. However, customizing these components often requires writing additional CSS, which can be cumbersome. Tailwind CSS, on the other hand, uses a utility-first approach without pre-made components. This makes it easier to build and customize your own components from scratch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance
&lt;/h2&gt;

&lt;p&gt;When it comes to performance, Bootstrap’s large file sizes can impact load times and overall performance. Tailwind CSS, being more modular, allows for a more optimized and efficient approach, as you only include the utilities you need.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Cases and Suitability
&lt;/h2&gt;

&lt;p&gt;Bootstrap is ideal for rapid development and for developers who primarily focus on backend development. It allows you to quickly prototype and see how your backend changes affect the frontend using its pre-styled components. The consistent design across all projects is a significant advantage.&lt;/p&gt;

&lt;p&gt;On the other hand, Tailwind CSS is perfect for customized web design and for those who focus on frontend or full-stack development. It offers the flexibility to change and tweak designs as much as needed, providing a unique look for each project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In summary, if you need a framework that allows for quick development with a consistent design, Bootstrap is the way to go. If you prefer more control over your design and need highly customizable components, Tailwind CSS is the better choice. Both frameworks have their strengths and can significantly enhance your development process, depending on your project requirements and personal preferences.&lt;br&gt;
&lt;strong&gt;Happy Coding!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
