<?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: Ivan Arias</title>
    <description>The latest articles on DEV Community by Ivan Arias (@hcoco1).</description>
    <link>https://dev.to/hcoco1</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%2F1041333%2F3f5ac1e1-ae3e-43c9-9413-a9eebde48ba4.jpg</url>
      <title>DEV Community: Ivan Arias</title>
      <link>https://dev.to/hcoco1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hcoco1"/>
    <language>en</language>
    <item>
      <title>My Cloud Computing Journey</title>
      <dc:creator>Ivan Arias</dc:creator>
      <pubDate>Thu, 28 Mar 2024 01:33:59 +0000</pubDate>
      <link>https://dev.to/hcoco1/my-cloud-computing-journey-g0k</link>
      <guid>https://dev.to/hcoco1/my-cloud-computing-journey-g0k</guid>
      <description>&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%2Fsqomf8zz8s16pdljgo82.jpg" 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%2Fsqomf8zz8s16pdljgo82.jpg" alt="cloud computing" width="748" height="745"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;a href="https://hcoco1-website-bucket-12345.s3.amazonaws.com/037be0b6-9d33-47dc-b349-9b5c3c2470ef.mp3"&gt;here&lt;/a&gt; to listen to the Post audio.&lt;/p&gt;

&lt;h4&gt;
  
  
  AWS Career Change for Software Engineers
&lt;/h4&gt;

&lt;p&gt;Hey there! 🚀 It's been a while since my last post, but I'm back with exciting news I can't wait to share. I've been on an incredible journey diving into AWS and am eager to take you along!&lt;/p&gt;

&lt;h4&gt;
  
  
  Transitioning Journey
&lt;/h4&gt;

&lt;p&gt;Many software engineers are considering a shift in their professional career towards cloud computing, with a particular focus on Amazon Web Services (AWS). The allure of AWS as a leading cloud platform has prompted numerous professionals to contemplate transitioning from traditional software engineering roles to the dynamic and innovative world of cloud computing.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Industry Expert: "New data shows digital skills are more needed than ever—AWS has 600+ free cloud courses that can help." (AWS Support Documentation, n.d.)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After graduating with a certification as a Software Engineer, I started exploring other fields like cybersecurity and cloud computing. I am writing this post to share my starting journey through the AWS world with all of you.&lt;/p&gt;

&lt;h4&gt;
  
  
  Exploring AWS
&lt;/h4&gt;

&lt;p&gt;As software engineers venture into cloud computing, obtaining AWS certification is essential. It validates their expertise in utilizing Amazon Web Services to design, deploy, and manage scalable systems on the cloud platform. Preparing for AWS certification exams involves deeply understanding various AWS services, architectural best practices, and hands-on experience with cloud infrastructure.&lt;/p&gt;

&lt;p&gt;Recently, I enrolled in the &lt;a href="https://digitalcloud.training/cloud-mastery-bootcamp/?megamenu"&gt;Cloud Mastery Bootcamp&lt;/a&gt;  to acquire cloud computing skills and earn five cloud certifications:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS Certified Cloud Practitioner&lt;/li&gt;
&lt;li&gt;AWS Certified Solutions Architect Associate&lt;/li&gt;
&lt;li&gt;AWS Certified Developer Associate&lt;/li&gt;
&lt;li&gt;HashiCorp Certified: Terraform Associate&lt;/li&gt;
&lt;li&gt;Certified Kubernetes Administrator (CKA)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Cloud Mastery Bootcamp provides training for a broad set of cloud job roles, including cloud engineer, DevOps engineer, and solutions architect. &lt;em&gt;&lt;small&gt;(Digital Cloud Training, 2024)&lt;/small&gt;&lt;/em&gt;. I expect to advance in my &lt;a href="https://www.hcoco1.com/cv"&gt;professional career&lt;/a&gt;  and get a position as a cloud professional.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cloud Foundations and Linux&lt;/strong&gt; training is the first module of the Bootcamp, and it provides an overview of the following topics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cloud Computing and AWS&lt;/li&gt;
&lt;li&gt;Compute and Storage Services&lt;/li&gt;
&lt;li&gt;Amazon Linux&lt;/li&gt;
&lt;li&gt;Serverless Applications&lt;/li&gt;
&lt;li&gt;Deployment and Management&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Cloud Career
&lt;/h4&gt;

&lt;p&gt;DevOps plays a pivotal role in streamlining software development and operations in cloud computing. It involves integrating development and IT operations to enhance collaboration, automate processes, and improve the quality of software delivery. For software engineers making a professional transition into the Cloud, embracing DevOps practices is crucial for staying competitive in the rapidly evolving technology landscape.&lt;/p&gt;

&lt;p&gt;I am so excited about learning all these AWS applications. The first thing that came to my mind when I learned about AWS applications was to migrate all my web apps and web pages to AWS. So, I plan to start the Developer Associate module to migrate and create websites and web applications using AWS services. One project that's been on my mind is deploying &lt;a href="https://www.hcoco1.com/portfolio/database-tool"&gt;The Database Tool&lt;/a&gt; using Docker containers on AWS.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In short, enrolling in the Cloud Mastery Bootcamp and pursuing five AWS cloud certifications signifies my commitment to advancing in the Cloud Computing field. Through ongoing learning and practical experience, I aim to become a successful cloud professional and make meaningful contributions to the field.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you are a web development nerd (like me 🤓) and want to peek at my portfolio, follow this link:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://www.hcoco1.com/portfolio"&gt;Portfolio Ivan Arias 💾&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;References:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Digital Cloud Training. (2024, February 25). Cloud Mastery Bootcamp: AWS, Linux, Python, Kubernetes, Terraform. &lt;a href="https://digitalcloud.training/cloud-mastery-bootcamp/"&gt;https://digitalcloud.training/cloud-mastery-bootcamp/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AWS Support Documentation. (n.d.). &lt;a href="https://docs.aws.amazon.com/aws-support/"&gt;https://docs.aws.amazon.com/aws-support/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>career</category>
      <category>cloud</category>
      <category>serverless</category>
    </item>
    <item>
      <title>Finally, I did it!! I solved a real-world problem</title>
      <dc:creator>Ivan Arias</dc:creator>
      <pubDate>Wed, 13 Mar 2024 13:34:45 +0000</pubDate>
      <link>https://dev.to/hcoco1/finally-i-did-it-i-solved-a-real-world-problem-4ph7</link>
      <guid>https://dev.to/hcoco1/finally-i-did-it-i-solved-a-real-world-problem-4ph7</guid>
      <description>&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%2F5cs23fbkn2ek0zkhflhx.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%2F5cs23fbkn2ek0zkhflhx.png" alt="tool" width="512" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Introduction to My Coding Journey
&lt;/h3&gt;

&lt;p&gt;Greetings, technology enthusiasts! Today, I am delighted to present a narrative connecting programming and practical problem resolution. This blog post is for everyone interested in technology, especially those just beginning to navigate the expansive web development domain.&lt;/p&gt;

&lt;h3&gt;
  
  
  Coding for Real-World Solutions
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.hcoco1.com/blog/2023-02-01-changing-careers"&gt;Since entering the IT world (one year ago)&lt;/a&gt;, I have read many articles and blog posts about how coding can solve real-world problems. Writing code and building an app that helps others succeed in a role or achieve a goal should be gratifying.&lt;/p&gt;

&lt;p&gt;Some bloggers and influencers on LinkedIn and YouTube recommend using the phrase "I want to solve real-world problems through coding" in your resume or behavioral interviews. They say that using those expressions helps you get attention from recruiters.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Reality of Coding Solutions
&lt;/h3&gt;

&lt;p&gt;After learning &lt;a href="https://flatironschool.com/courses/coding-bootcamp/"&gt;how to build full-stack applications&lt;/a&gt;, I  became obsessed with creating "something" to solve "something else" through coding. Initially, I found myself disheartened. I plunged into the world of coding with dreams of crafting innovative solutions, only to discover that seasoned developers had already tackled many challenges I faced. Also, artificial intelligence supports everybody in creating websites, web apps, images, logos, blog posts, essays, etc. The question that tormented me was, 'What unique contribution could I offer?' This period of introspection led me to the brink of abandoning my quest to create something meaningful through coding.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reevaluating My Goals
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Why was I looking to solve someone else's problems? &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This question remained in my mind, echoing my frustrations. Upon reflection, I realized I was approaching the problem from the wrong angle. My desire to create wasn't just about solving any problem but finding a challenge that resonated with me. It was about using my unique perspective and skills to contribute in a way that only I could.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  From Disappointment to Inspiration: Finding My Project
&lt;/h3&gt;

&lt;p&gt;However, this phase of doubt was not the end but a necessary journey toward a deeper understanding of my goals and capabilities. Time passed, and a circumstance at work pointed to a realization that led to a solution. One day, while walking through the warehouse at my job, I had my laptop, pocket notebook, pen, and several sheets of paper for taking notes. After engaging with and coaching several employees, I needed help remembering where I left my pen, pocket notebook, or other item. It wasn't the first time I had forgotten my belongings in various places, but it was the moment I recognized the need for a solution.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This might seem trivial to some, but for me, it highlighted a gap—a personal inconvenience that I realized could be addressed through the skills I was questioning.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Introducing the Audits Tool: My Solution to a Real-World Problem
&lt;/h3&gt;

&lt;p&gt;The phrase " I want to solve real-world problems through coding" kept appearing in my mind. I thought, "The critical point is to solve a problem or a situation, and it doesn't matter if it is a to-do list." Solving a problem using effortless tools is fascinating and something I am proud of. Thus, I shifted my focus from seeking grandiose projects to identifying and tackling real, tangible issues I encountered.&lt;/p&gt;

&lt;p&gt;After a challenging outline process, the &lt;a href="https://audits.hcoco1.com/"&gt;Audits Tool&lt;/a&gt; was born, a project that, while seemingly modest, represented a significant milestone in my development journey. Audits Tool is a taking notes app that allows users to input audit details such as usernames, process paths, and audit descriptions, which are then saved locally and can be viewed or deleted. Additionally, the app offers a feature to generate and download comprehensive audit reports.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pride and Progress: The Journey of the Audits Tool
&lt;/h3&gt;

&lt;p&gt;I take great pride in this app, not just because I use it daily, but because it stands as a testament to the power of simple solutions to enhance productivity. I am still testing it and will add new features to improve the user experience. Also, I plan to migrate the Audits Tool to the AWS platform and add features like authentication and a database.&lt;/p&gt;

&lt;p&gt;This narrative reminds aspiring developers to consider their everyday experiences as potential opportunities to apply their skills. It underscores the idea that the problems we often overlook could lead to meaningful achievements.&lt;/p&gt;

&lt;p&gt;So, finally, I did it 😏. I created a web application and solved a real-world problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  Expanding Horizons: Stepping Into AWS and Cybersecurity
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;My journey through the development of all my projects refined my technical skills and ignited a curiosity about the landscape of technology. This exploration led me to recognize the importance of security and infrastructure, particularly in the era of &lt;a href="https://digitalcloud.training/cloud-mastery-bootcamp/?megamenu"&gt;cloud computing&lt;/a&gt;. This realization propelled me to expand my expertise in &lt;a href="https://www.hcoco1.com/blog/2024-02-28-cloud-computing"&gt;AWS&lt;/a&gt; and &lt;a href="https://www.hcoco1.com/blog/2024-02-18-cyber-career"&gt;Cybersecurity&lt;/a&gt; to expand my career options and acquire cloud and security skills. As I continue to seek my first IT job, my incursion into these areas is more than just a diversification of skills—it's a strategic step towards becoming a well-rounded tech professional capable of addressing the multifaceted challenges of today's digital world.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you are a web development nerd (like me 🤓) and want to peek at this React app or my portfolio, follow these links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.hcoco1.com/portfolio/audit-tool"&gt;Audits Tool 🦾&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.hcoco1.com/portfolio"&gt;Portfolio Ivan Arias 💾&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>What is RSS?</title>
      <dc:creator>Ivan Arias</dc:creator>
      <pubDate>Tue, 05 Sep 2023 00:00:00 +0000</pubDate>
      <link>https://dev.to/hcoco1/what-is-rss-1ehj</link>
      <guid>https://dev.to/hcoco1/what-is-rss-1ehj</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OjtkgoZN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://wpmayor.com/wp-content/uploads/2016/02/rss-40674_960_720.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OjtkgoZN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://wpmayor.com/wp-content/uploads/2016/02/rss-40674_960_720.png" alt="Image by Rafay Saeed Ansari" width="630" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;“Have you noticed the little RSS icons around the web? Or have you heard about RSS from friends or colleagues, but still, it remains a mystery to you? What does it mean, how does it work, and do I really need it? These are just some of the questions that usually come to people’s minds when they hear about RSS.” (Feeder Help, 2021)&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s RSS?
&lt;/h2&gt;

&lt;p&gt;“RSS stands for “Really Simple Syndication” or “Rich Site Summary.” It’s a web feed format used to distribute frequently updated content – like blog posts, news stories, or podcasts – in a standardized format.” (OpenAI, September 5. 2023)&lt;/p&gt;

&lt;h3&gt;
  
  
  Step-by-Step Guide to use RSS:
&lt;/h3&gt;

&lt;p&gt;1.Find the RSS Link:&lt;/p&gt;

&lt;p&gt;This is usually a small orange icon that looks like radio waves, or it might simply say “RSS”. Click on it. Sometimes you’ll be taken to a page full of code – don’t panic! This is the RSS feed.&lt;/p&gt;

&lt;p&gt;2.Copy the Link:&lt;/p&gt;

&lt;p&gt;Right-click (or tap and hold on mobile) on the page or the RSS icon, and choose ‘Copy link address’ or something similar.&lt;/p&gt;

&lt;p&gt;3.Choose an RSS Reader:&lt;/p&gt;

&lt;p&gt;This tool or app collects and displays content from RSS feeds. Some popular options are Feedly, Inoreader, and The Old Reader.&lt;/p&gt;

&lt;p&gt;4.Add the RSS Link to the Reader:&lt;/p&gt;

&lt;p&gt;Open your chosen RSS reader. Look for an option that says “Add Feed”, “Subscribe”, or something similar. Paste the RSS link you copied into the given field and hit ‘Subscribe’ or ‘Add’.&lt;/p&gt;

&lt;p&gt;5.Voila! You’re Subscribed:&lt;/p&gt;

&lt;p&gt;Now, every time the website you subscribed to posts new content, it’ll show up in your RSS reader. This way, you can keep track of updates from multiple websites without visiting each one individually.&lt;/p&gt;

&lt;p&gt;6.Keep Adding Feeds: For instance, you’re reading this post on my blog (&lt;a href="https://hcoco1-blog.onrender.com/whats-rss/"&gt;https://hcoco1-blog.onrender.com/whats-rss/&lt;/a&gt;) right now. If you want to keep up with my future posts, you can subscribe to my RSS feed by clicking on the orange icon in the bottom left corner of the page. You can also subscribe to my YouTube channel, Twitter feed, or my LinkedIn account.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Do This?
&lt;/h3&gt;

&lt;p&gt;It’s a great way to stay updated! Instead of bouncing around different websites to see if they’ve posted anything new, you can just check your RSS reader and get all the latest updates in one place.&lt;/p&gt;

&lt;h3&gt;
  
  
  References:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://feeder.co/help/rss/what-is-rss-and-how-can-you-use-it/"&gt;What is RSS, and how can you use it? - Feeder Help. (2021, March 25). Feeder Help.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=6HNUqDL-pI8"&gt;Growth Origin. (2017, March 12). RSS made easy [Video]. YouTube.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=_7LTwnAaQ3k"&gt;The Linux Experiment. (2023, May 9). STOP using SOCIAL MEDIA for News; RSS is MUCH BETTER! [Video]. YouTube.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://chat.openai.com/share/45b9f111-7650-4720-9071-e929e99c0857"&gt;“What is RSS?” prompt. ChatGPT, August 3 version, OpenAI, September 5. 2023, chat.openai.com.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>code</category>
    </item>
    <item>
      <title>Building aggregate functions In SQLAlchemy</title>
      <dc:creator>Ivan Arias</dc:creator>
      <pubDate>Sun, 27 Aug 2023 00:00:00 +0000</pubDate>
      <link>https://dev.to/hcoco1/building-aggregate-functions-in-sqlalchemy-141b</link>
      <guid>https://dev.to/hcoco1/building-aggregate-functions-in-sqlalchemy-141b</guid>
      <description>&lt;p&gt;In this tutorial, I will use SQLAlchemy to perform aggregate operations on a database containing information about states, counties, cities, and government facilities. I will describe briefly the process of building a project to use aggregate functions.&lt;/p&gt;

&lt;p&gt;Let us check some concepts before starting:&lt;/p&gt;

&lt;h2&gt;
  
  
  What is SQLAlchemy?
&lt;/h2&gt;

&lt;p&gt;According to Myers (2016), “The SQLAlchemy ORM is what most people think of when you mention SQLAlchemy. It provides a very effective way to bind database schema and operations to the same data objects used in the application. It offers a way to rapidly build applications and get them into customers’ hands.”&lt;/p&gt;

&lt;p&gt;Also, the documentation on the SQLAlchemy website says, “SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL.”&lt;/p&gt;

&lt;h2&gt;
  
  
  What aggregate functions In SQLAlchemy are?
&lt;/h2&gt;

&lt;p&gt;Aggregate functions are generic function implementations for a set of standard SQL functions that automatically set up the expected return type for each function.&lt;/p&gt;

&lt;p&gt;In SQLAlchemy, an aggregate function is a function where the values of multiple rows are grouped to form a single value of a more significant meaning or measurement. These functions are widely used in database queries to perform calculations on data, such as summing values, calculating averages, or finding the minimum or maximum value in a set.&lt;/p&gt;

&lt;p&gt;As can be seen from Figure 1 (GeeksforGeeks, 2022), Some standard aggregate functions include:&lt;/p&gt;

&lt;p&gt;sum(): Calculates the sum of values, avg(): Computes the average of values, min(): Determines the smallest value, max(): Determines the largest value, and count(): Counts the number of rows.&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%2F6rgug7212hff8g242ahx.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%2F6rgug7212hff8g242ahx.png" alt="Image description" width="800" height="526"&gt;&lt;/a&gt;Figure 1. Common aggregate functions. GeeksforGeeks (2022).&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Alembic?
&lt;/h2&gt;

&lt;p&gt;Alembic documentation shows that ‘Alembic is a lightweight database migration tool for usage with the SQLAlchemy Database Toolkit for Python.’&lt;/p&gt;

&lt;p&gt;According to Myers (2016), ‘Alembic is a tool for handling database changes that leverages SQLAlchemy to perform the migrations. Since SQLAlchemy will only create missing tables when we use the metadata’s create_all method, it does not update the database tables to match any changes we might make to the columns. Nor would it delete tables that we removed from the code. Alembic provides a way to do things like adding/ deleting tables, changing column names, and adding new constraints. Because Alembic uses SQLAlchemy to perform the migrations; they can be used on various backend databases.’&lt;/p&gt;

&lt;h2&gt;
  
  
  Process to build a project to use aggregate functions.
&lt;/h2&gt;

&lt;p&gt;(You must have Python installed in your system.)&lt;/p&gt;

&lt;h3&gt;
  
  
  Overview
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Create your own Git Repo.&lt;/li&gt;
&lt;li&gt;Creating a Migration Environment.&lt;/li&gt;
&lt;li&gt;Configuring a Migration Environment.&lt;/li&gt;
&lt;li&gt;Generating a Base Empty Migration.&lt;/li&gt;
&lt;li&gt;Autogenerating a Migration.&lt;/li&gt;
&lt;li&gt;Test the database.&lt;/li&gt;
&lt;li&gt;Populate the database.&lt;/li&gt;
&lt;li&gt;Test the database.&lt;/li&gt;
&lt;li&gt;Build the aggregate operations.&lt;/li&gt;
&lt;li&gt;Test the aggregate operations.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step by Step
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Create your own Git Repo&lt;/strong&gt; : create your local repo and push it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Creating a Migration Environment&lt;/strong&gt; : To create the migration environment, we will create a folder labeled lib, initialize the environment, install the dependencies, and run the first alembic command. This initialization process creates the migration environment and also creates an alembic.ini file with the configuration options&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Configuring a Migration Environment&lt;/strong&gt; :&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Generating a Base Empty Migration&lt;/strong&gt; : This command will create a migration file in the alembic/versions/ subfolder. “Because we do not have any data classes and have made no changes, our upgrade and downgrade methods are empty. So running this migration will have no effect, but it will provide a great foundation for our migration chain.” (Mayers, 2016)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Autogenerating a Migration&lt;/strong&gt; : With our base in place, we can add our data class to our application. For this tutorial, I will add the final version of models.py, but it is supposed that you should build the models.py file in a few steps and generate different migrations files.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;6.&lt;strong&gt;Test the database!&lt;/strong&gt; : After running this migration, we can take a peek in the database to make sure the changes happened:&lt;/p&gt;

&lt;p&gt;7.&lt;strong&gt;Populate the database&lt;/strong&gt; : You have noticed that we installed click in step number 2; it was not a mistake. We will take advantage of click commands to seed our database. “Click is a Python package for creating beautiful command line interfaces in a composable way with as little code as necessary. It is the “Command Line Interface Creation Kit.” It is highly configurable but comes with sensible defaults out of the box.” (Docs, Click) &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Seed.py&lt;/strong&gt; : Following a specific order populating the database is crucial. We must start seeding states, which generate state_id that will be used for the others tables, then seed counties table, following cities tables, facilities, and finally, seed associations table. Of course, you can seed the database using another order, but you will probably have to modify NULL or NONE values in some tables’ column IDs.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; @click.group()
 def cli():
     """Manage the database records."""
     pass

 @cli.command()
 def seed_states():
     """ Seed states."""
     session.query(State).delete()
     session.commit()
     session.add_all(states_to_add)
     session.commit()
     click.echo("✅ Done seeding states!")


 @cli.command()
 def seed_counties():
     """ Seed counties."""
     session.query(County).delete()
     session.commit()
     session.add_all(counties_to_add)
     session.commit()
     click.echo("✅ Done seeding counties!")

     # more click commands


 ➜ lib git:(master) python seed.py seed-states
 🌱 Seeding DB...
 ✅ Done seeding states!
 ➜ lib git:(master) ✗ python seed.py seed-counties
 🌱 Seeding DB...
 ✅ Done seeding counties!
 ➜ lib git:(master) ✗ python seed.py seed-cities
 🌱 Seeding DB...
 ✅ Done seeding cities!
 ➜ lib git:(master) ✗ python seed.py seed-facilities
 🌱 Seeding DB...
 ✅ Done seeding facilities!
 ➜ lib git:(master) ✗ python seed.py seed-associations
 🌱 Seeding DB...
 ✅ Done seeding associations!
 ➜ lib git:(master) ✗ &amp;gt;....

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

&lt;/div&gt;



&lt;p&gt;8.&lt;strong&gt;Test the database&lt;/strong&gt; : time to check our work! I will use SQLite3 to query the database.&lt;/p&gt;

&lt;p&gt;9.&lt;strong&gt;Build the aggregate operations&lt;/strong&gt; : I will use click commands again to perform aggregate operations. Each command prompts the user for input and then executes a database query based on that input. After querying the database, the command outputs a result.&lt;/p&gt;

&lt;p&gt;10.Test the aggregate operations using sqlite3: finally, I will use sqlite3 to test the aggregate operations.&lt;/p&gt;

&lt;p&gt;Final thoughts:&lt;/p&gt;

&lt;p&gt;This tutorial showed how to use SQLAlchemy to query a database. We walked through setting up a project to use aggregate functions. By the end, you should understand how to handle and use such functions effectively.&lt;/p&gt;

&lt;p&gt;This article was originally posted on: &lt;a href="https://hcoco1-blog.onrender.com/"&gt;https://hcoco1-blog.onrender.com/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  References:
&lt;/h2&gt;

&lt;p&gt;Myers, J. (2016). Essential sqlalchemy. O’Reilly.&lt;/p&gt;

&lt;p&gt;“Documentation.” Alembic, &lt;a href="http://www.alembic.sqlalchemy.org"&gt;www.alembic.sqlalchemy.org&lt;/a&gt;. Accessed 14 Aug. 2023.&lt;/p&gt;

&lt;p&gt;“Documentation.” SQLAlchemy, &lt;a href="http://www.sqlalchemy.org/"&gt;www.sqlalchemy.org/&lt;/a&gt;. Accessed 14 Aug. 2023.&lt;/p&gt;

&lt;p&gt;GeeksforGeeks. (2022). SQLAlchemy Aggregate Functions. GeeksforGeeks. &lt;a href="https://www.geeksforgeeks.org/sqlalchemy-aggregate-functions/"&gt;https://www.geeksforgeeks.org/sqlalchemy-aggregate-functions/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>coding</category>
    </item>
    <item>
      <title>Creating a Dynamic Table in React Using react-table (v7.8.0).</title>
      <dc:creator>Ivan Arias</dc:creator>
      <pubDate>Sun, 02 Jul 2023 16:20:41 +0000</pubDate>
      <link>https://dev.to/hcoco1/creating-a-dynamic-table-in-react-using-react-table-v780-3823</link>
      <guid>https://dev.to/hcoco1/creating-a-dynamic-table-in-react-using-react-table-v780-3823</guid>
      <description>&lt;p&gt;In web development, tables are commonly used to display structured data in a tabular format. React provides various tools and libraries to create interactive and dynamic tables. One such library is react-table, which simplifies developing and managing tables in React.&lt;/p&gt;

&lt;p&gt;In this tutorial, we will learn how to create a table using the &lt;a href="https://react-table-library.com/?path=/story/getting-started-installation--page"&gt;react-table library&lt;/a&gt; in a React application. We'll walk through the steps of fetching data from an API, setting up the table component, and rendering the table with sortable columns.&lt;/p&gt;

&lt;h5&gt;
  
  
  Prerequisites
&lt;/h5&gt;

&lt;p&gt;Before starting, make sure you have the following requirements installed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node.js and npm (Node Package Manager) - to set up and manage the React application.&lt;/li&gt;
&lt;li&gt;Basic knowledge of React - understanding React components and hooks will be helpful.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Step 1: Set Up the Project
&lt;/h4&gt;

&lt;p&gt;To get started, create a new React project by running the following command in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-react-app react-table-demo
cd react-table-demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 2: Install Dependencies
&lt;/h4&gt;

&lt;p&gt;In this step, we'll install the required dependencies for our project. Open a terminal and run the following command inside the project directory:&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 react-table
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 3: Fetch Data
&lt;/h4&gt;

&lt;p&gt;In this step, we'll fetch data from an API and store it in the parent component's state. In this code, we define the App component as the parent component. It fetches data from the API using the fetchData function when the component mounts. The fetched data is stored in the data state variable and passed to the Table component as a prop.&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, { useState, useEffect } from "react";

const App = () =&amp;gt; {
  const [data, setData] = useState([]);

  useEffect(() =&amp;gt; {
    fetchData();
  }, []);

  const fetchData = async () =&amp;gt; {
    try {
      const response = await fetch("https://cities-qd9i.onrender.com/agents");
      const agents = await response.json();
      setData(agents);
    } catch (error) {
      console.error("Error fetching data:", error);
    }
  };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is how looks the  JSON data.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "agents": [
   {
    "id": 1,
    "first_name": "Alysia",
    "last_name": "Ivashechkin",
    "email": "aivashechkin0@example.com",
    "phone": "(424) 8787997",
    "image": "https://picsum.photos/400",
    "state": "California",
    "city": "Los Angeles",
    "address": "2 Vermont Junction"
  },
  {
    "id": 2,
    "first_name": "Alicia",
    "last_name": "Sworder",
    "email": "asworder1@mozilla.com",
    "phone": "(804) 8988278",
    "image": "https://picsum.photos/400",
    "state": "Virginia",
    "city": "Richmond",
    "address": "362 Hoffman Court"
  }
 ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 4: Create the Table Component
&lt;/h4&gt;

&lt;p&gt;In this step, we'll create the Table component that will render the table using the react-table library. &lt;/p&gt;

&lt;p&gt;The useMemo hook is used in this code to memoize the columns configuration so that it is only calculated once and avoids unnecessary recalculations and re-renders.&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, { useMemo } from "react";
import { useTable } from "react-table";
import "./Table.css";

const Table = ({ data }) =&amp;gt; {
  const columns = useMemo(
    () =&amp;gt; [
      { Header: "ID", accessor: "id" },
      { Header: "First Name", accessor: "first_name" },
      { Header: "Last Name", accessor: "last_name" },
      { Header: "Email", accessor: "email" },
      { Header: "Phone", accessor: "phone" },
      { Header: "State", accessor: "state" },
      { Header: "City", accessor: "city" },
      { Header: "Address", accessor: "address" }
    ],
    []
  );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 5: Creating the Table Instance
&lt;/h4&gt;

&lt;p&gt;Using the useTable hook, we create a table instance by passing the columns and data as arguments. The hook returns several properties and methods we can use to render and interact with the table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  const {
    getTableProps,
    getTableBodyProps,
    headerGroups,
    rows,
    prepareRow
  } = useTable({ columns, data });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 6. Rendering the Table
&lt;/h4&gt;

&lt;p&gt;We render the table. We use the spread operator (...) to apply the getTableProps function to the &lt;/p&gt;
&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt; element, which assigns the necessary attributes and event handlers to the table.

&lt;p&gt;Inside the table, we render the table headers &lt;code&gt;&amp;lt;thead&amp;gt;&lt;/code&gt; and table body &lt;code&gt;&amp;lt;tbody&amp;gt;&lt;/code&gt; using the properties provided by the useTable hook. We iterate over the headerGroups array to render the header rows. We iterate over the header array within each row to render individual header cells.&lt;/p&gt;

&lt;p&gt;We iterate over the rows array for the table body to render the data rows. Inside each row, we iterate over the cells array to render the individual cells.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  return (
    &amp;lt;div className="table-container"&amp;gt;
      &amp;lt;table {...getTableProps()}&amp;gt;
        &amp;lt;thead&amp;gt;
          {headerGroups.map((headerGroup) =&amp;gt; (
            &amp;lt;tr {...headerGroup.getHeaderGroupProps()}&amp;gt;
              {headerGroup.headers.map((column) =&amp;gt; (
                &amp;lt;th {...column.getHeaderProps()}&amp;gt;{column.render("Header")}&amp;lt;/th&amp;gt;
              ))}
            &amp;lt;/tr&amp;gt;
          ))}
        &amp;lt;/thead&amp;gt;
        &amp;lt;tbody {...getTableBodyProps()}&amp;gt;
          {rows.map((row) =&amp;gt; {
            prepareRow(row);
            return (
              &amp;lt;tr {...row.getRowProps()}&amp;gt;
                {row.cells.map((cell) =&amp;gt; (
                  &amp;lt;td {...cell.getCellProps()}&amp;gt;{cell.render("Cell")}&amp;lt;/td&amp;gt;
                ))}
              &amp;lt;/tr&amp;gt;
            );
          })}
        &amp;lt;/tbody&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/div&amp;gt;
  );
&lt;/code&gt;&lt;/pre&gt;



&lt;h4&gt;
  
  
  Step 7: Styling the Table
&lt;/h4&gt;

&lt;p&gt;We apply basic styling to the table container by adding a CSS class table-container to the wrapping &lt;/p&gt;.&lt;br&gt;

&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.table-container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;margin-top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;table&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border-collapse&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;collapse&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;th&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;td&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;8px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="n"&gt;ddd&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;left&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;th&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#f2f2f2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;bold&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;
  
  
  Step 8: Run the Application
&lt;/h4&gt;

&lt;p&gt;To run the application, open a terminal, navigate to the project directory, and run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm start
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;&lt;a href="https://codesandbox.io/s/creating-a-dynamic-table-in-react-using-react-table-mm2tpd?file=/src/styles.css"&gt;Try yourself&lt;/a&gt; Basic Table:&lt;br&gt;
&lt;iframe src="https://codesandbox.io/embed/creating-a-dynamic-table-in-react-using-react-table-mm2tpd"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Let's add another functionality: the sortBy hook.&lt;/p&gt;

&lt;p&gt;1.-Import the useSortBy hook:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { useTable, useSortBy } from "react-table";
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;2.- Modify the useTable hook: The useTable hook uses columns, data, and useSortBy as arguments. The useSortBy hook enables the sorting functionality.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  const {
    getTableProps,
    getTableBodyProps,
    headerGroups,
    rows,
    prepareRow
  } = useTable({ columns, data }, useSortBy);
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;3.- Sort indicators in table headers: The table headers are rendered with sorting indicators. A span element is added within each th element to display the sorting indicator based on the sorting state of the column. It shows  "🔽" for descending order and "🔼" for ascending order.&lt;/p&gt;

&lt;p&gt;4.- Sorting toggle attributes: The th elements have the column.getSortByToggleProps() function added to their attributes. This function enables toggling the sorting order when the column header is clicked.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        &amp;lt;thead&amp;gt;
          {headerGroups.map((headerGroup) =&amp;gt; (
            &amp;lt;tr {...headerGroup.getHeaderGroupProps()}&amp;gt;
              {headerGroup.headers.map((column) =&amp;gt; (
                &amp;lt;th {...column.getHeaderProps(column.getSortByToggleProps())}&amp;gt;
                  {column.render("Header")}
                  &amp;lt;span&amp;gt;
                    {column.isSorted ? (column.isSortedDesc ? " 🔽" : " 🔼") : ""}
                  &amp;lt;/span&amp;gt;
                &amp;lt;/th&amp;gt;
              ))}
            &amp;lt;/tr&amp;gt;
          ))}
        &amp;lt;/thead&amp;gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;The updated code enables sorting functionality in the table by making these changes. Clicking on a column header will trigger sorting based on that column, and the sorting indicator will reflect the current sorting state of the column.&lt;/p&gt;

&lt;p&gt;Summary.&lt;/p&gt;

&lt;p&gt;In this tutorial, we built a table using a react-table library and implemented hooks like sortBy. Using React Hooks effectively is essential for optimizing the performance and maintaining a clean and efficient codebase in React applications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codesandbox.io/s/creating-a-dynamic-table-in-react-sort-func-98rc35?file=/src/styles.css:0-339"&gt;Try yourself&lt;/a&gt; Table with Sort functionality:&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/creating-a-dynamic-table-in-react-sort-func-98rc35"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;References:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.w3schools.com/default.asp"&gt;W3Schools Free Online Web Tutorials. (n.d.). https://www.w3schools.com/default.asp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/"&gt;MDN Web Docs. (n.d.). https://developer.mozilla.org/en-US/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/A9oUTEP-Q84?t=2"&gt;React-table tutorial - beginners tutorial (2023) YouTube. Available at: https://www.youtube.com/watch?v=A9oUTEP-Q84&amp;amp;ab_channel=PedroTech.&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;"Give me some ideas to blog about the given code in the last three days" prompt. ChatGPT, July 1th, ChatGPT May 24 Version, OpenAI, chat.openai.com.&lt;/p&gt;


&lt;/table&gt;&lt;/div&gt;

</description>
      <category>react</category>
      <category>table</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>JavaScript Dynamic List: The DOM Manipulation.</title>
      <dc:creator>Ivan Arias</dc:creator>
      <pubDate>Sun, 14 May 2023 15:27:40 +0000</pubDate>
      <link>https://dev.to/hcoco1/javascript-dynamic-list-the-dom-manipulation-10c5</link>
      <guid>https://dev.to/hcoco1/javascript-dynamic-list-the-dom-manipulation-10c5</guid>
      <description>&lt;h3&gt;
  
  
  DOM Manipulation
&lt;/h3&gt;

&lt;p&gt;Since I had difficulty showing a list of items in the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Introduction"&gt;Document Object Model (DOM)&lt;/a&gt; in my final phase-1 Project. I decided to blog about DOM manipulation using Javascript.&lt;br&gt;
I will describe a step-by-step guide on creating and inserting a dynamic list in the DOM. I will focus on javascript and HTML code rather than on CSS code.&lt;/p&gt;

&lt;p&gt;Before starting coding, we need to think about what our goals are. We should make a “mental map” to organize our ideas and define our objectives. Also, we must consider writing clean code: for instance, creating single-purpose functions instead of an extended ones, which are difficult to debug.&lt;/p&gt;

&lt;p&gt;First, we start coding a basic HTML structure with head and body tags. Then add an h1 tag for the main heading, an input (type = “text) tag for the text input box, a button tag for triggering a function, a ul tag for the list's content, and a script tag for writing JavaScript code. Some HTML tags have identifiers (id= identifier), there are necessary to link the HTML with javascript. The HTML structure should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;!&lt;/span&gt;&lt;span class="nx"&gt;DOCTYPE&lt;/span&gt; &lt;span class="nx"&gt;html&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;html&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;head&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Dynamic&lt;/span&gt; &lt;span class="nx"&gt;List&lt;/span&gt; &lt;span class="nx"&gt;BLOG&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/title&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/head&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Dynamic&lt;/span&gt; &lt;span class="nx"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;countryInput&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;placeholder&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Enter a country&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;addCountryButton&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Add&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;Country&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ul&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;list&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ul&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/body&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/html&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the JavaScript code, we must declare and initialize variables. The variable “list” is an empty array that will store the list of countries. The variable addItemButton stores the HTML button with the identifier id='addItemButton'. Then an eventListener is added to the "Add Country" button. When clicked, it triggers the saveItemToList() function, which saves the entered country to the list.&lt;/p&gt;

&lt;p&gt;The following line defines the saveItemToList() function. This function is triggered when clicking the "Add a Country" button. It retrieves the value entered in the input field, trims any leading or trailing whitespace, and checks if it is not an empty string. If it's not empty, the country is added to the list array using the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push"&gt;.push() method&lt;/a&gt;, the input field is cleared, and the displayList() function is called to update the displayed list.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;

  &lt;span class="c1"&gt;//Declare  variable list and initialize.&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;addItemButton&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;addItemButton&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Add event listener to trigger saving of items&lt;/span&gt;
   &lt;span class="nx"&gt;addItemButton&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;saveItemToList&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;


  &lt;span class="c1"&gt;// Function to save items to the list&lt;/span&gt;
  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;saveItemToList&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;itemInput&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;countryInput&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;itemInput&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;list&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="nx"&gt;itemInput&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nf"&gt;displayList&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, now we have a function to save our data, but what if we want to delete one of the countries on the list? We need another single-purpose function to delete countries!&lt;/p&gt;

&lt;p&gt;The deleteItem(index) function takes an index as a parameter and removes the corresponding country from the list array using the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice"&gt;splice() method&lt;/a&gt;. After deleting the item, the displayList() function updates the list in the DOM.&lt;/p&gt;

&lt;p&gt;At this point, we have a function to save countries using the .push() method and  another function to delete countries using the .splice() method. Our main goal is to insert the countries list in the DOM, so we need a function to display the saved countries.&lt;/p&gt;

&lt;p&gt;The displayList() function renders the list in the DOM. It starts by obtaining a reference to the ul element with the id "list." It then clears the existing content of the ul element. Using a for loop, the function iterates over the list array. For each country in the list, it creates a new li element and sets its text content to the country name. It also creates a delete button for each item using the button element. &lt;/p&gt;

&lt;p&gt;The delete button is assigned the text "Delete" and an event listener that triggers the deleteItem() function with the corresponding index when clicked. Also, it is appended as a child of the li element, and the li element is appended as a child of the ul element. This process is repeated for each item in the list array, resulting in a dynamically generated list of countries with corresponding delete buttons.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Function to delete an item from the list&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;deleteItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;list&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;splice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;displayList&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Function to display the list in the DOM&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;displayList&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;listContainer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;list&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;listContainer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;list&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;listItem&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;li&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;listItem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;deleteButton&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;button&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;deleteButton&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Delete&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;deleteButton&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;deleteItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="nx"&gt;listItem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;deleteButton&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;listContainer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;listItem&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The list of countries is fetched from an API using the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/fetch"&gt;fetch() function&lt;/a&gt;. It sends an HTTP GET request to the URL and retrieves the response. The response is converted to JSON format using the response.json() method. &lt;/p&gt;

&lt;p&gt;The resulting data is an array of objects, where each object represents a country. The &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map"&gt;map() method&lt;/a&gt; to extract each object's country names and assign them to the list array. &lt;strong&gt;Finally, the displayList() function is called to render the initial list of countries in the DOM.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So, we can add countries manually and get data from any API if we want. This API “countries” is used as a database on the &lt;a href="https://hcoco1.github.io/Phase1_app/"&gt;World Population Dashboard&lt;/a&gt; App.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Fetch the list of countries from the API&lt;/span&gt;
    &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://world-population-dashboard.onrender.com/countries&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;country&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;country&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;country&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nf"&gt;displayList&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="p"&gt;})&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Error fetching countries:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="c1"&gt;// Display the initial list on page load&lt;/span&gt;
    &lt;span class="nf"&gt;displayList&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/body&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/html&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, the displayList() function is called at the end to ensure that the initial list is displayed when the page loads.&lt;/p&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;The last code showed us the power of javascript to manipulate the DOM, creating, selecting, and iterating over elements and objects.  JavaScript has become integral to web development, allowing developers to manipulate the DOM, recognize events, and communicate with the server. These features provide developers with the tools to create &lt;strong&gt;dynamic, interactive, and responsive web pages&lt;/strong&gt; that meet the needs of modern web users.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codepen.io/ivan-arias-de-lima/pen/zYmayYp?editors=1000"&gt;Try it  Yourself&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/ivan-arias-de-lima/embed/zYmayYp?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;References:&lt;br&gt;
W3Schools Free Online Web Tutorials. (n.d.). &lt;a href="https://www.w3schools.com/default.asp"&gt;https://www.w3schools.com/default.asp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;MDN Web Docs. (n.d.). &lt;a href="https://developer.mozilla.org/en-US/"&gt;https://developer.mozilla.org/en-US/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Traversy Media (n.d.-b). &lt;a href="https://www.youtube.com/@TraversyMedia/videos"&gt;https://www.youtube.com/@TraversyMedia/videos&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Laurence Svekis (n.d.-c). &lt;a href="https://www.youtube.com/@LaurenceSvekisCourses/videos"&gt;https://www.youtube.com/@LaurenceSvekisCourses/videos&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;1BestCsharp blog. (2017, October 28). Javascript - How To Add LI To UL From Input Text Using JS [ with source code ] [Video]. YouTube. &lt;a href="https://www.youtube.com/watch?v=JBdyASuhq1c"&gt;https://www.youtube.com/watch?v=JBdyASuhq1c&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;kootkot. (2022, February 5). ✅ JavaScript Array | How to Display Array Elements? | Real World Coding Example [Video]. YouTube. &lt;a href="https://www.youtube.com/watch?v=MkE2_YWnJbo"&gt;https://www.youtube.com/watch?v=MkE2_YWnJbo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://hcoco1.github.io/hcoco1-site-bootstrap/"&gt;Visit my Site&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>codepen</category>
    </item>
    <item>
      <title>Changing careers</title>
      <dc:creator>Ivan Arias</dc:creator>
      <pubDate>Tue, 02 May 2023 15:17:24 +0000</pubDate>
      <link>https://dev.to/hcoco1/changing-careers-4o4k</link>
      <guid>https://dev.to/hcoco1/changing-careers-4o4k</guid>
      <description>&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%2Fbkn53exbel0um72k2a1a.jpg" 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%2Fbkn53exbel0um72k2a1a.jpg" alt='Photo by &amp;lt;a href="https://unsplash.com/@soymeraki?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&amp;gt;Javier Allegue Barros&amp;lt;/a&amp;gt; on &amp;lt;a href="https://unsplash.com/photos/0nOP5iHVaZ8?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&amp;gt;Unsplash&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;
  ' width="800" height="1200"&gt;&lt;/a&gt;&lt;strong&gt;Changing careers&lt;/strong&gt; is exciting and intimidating, and some people think that starting a new job is challenging and impossible for adults and seniors. I was a geologist long ago, but I am changing my major from geology to software development. There are two reasons why I am changing careers: first, my long-term goals have changed, and second, I realized that dealing with software and data is my passion.&lt;/p&gt;

&lt;p&gt;First, I decided to change careers because my long-term goals have changed. I was born in Venezuela, where I got my degree as a geologist and started a family. However, Venezuela's political and economic crisis is worsening, so I decided to create a new life abroad. I began to work at Amazon in the United States in 2020, and I have enrolled in the Amazon Career Program, which allows employees to work and study part-time careers. Thanks to the Amazon Career Program, I have gotten my GED and language certificate, and next October, I will get my certification as a Full Stack Developer.&lt;/p&gt;

&lt;p&gt;Second, after several years of working with databases and geostatistical modeling software, I realized that my current passion is working with programming languages, software, and websites. As a result, I decided to pursue a software development career.&lt;/p&gt;

&lt;p&gt;In brief, I'm changing careers because my long-term goals have changed, and I realized that my passion is working with programming languages, software, and websites. I have studied at Flatiron School for about a month and learned basic HTML, CSS, and JavaScript concepts and methods. I'll try my best.&lt;/p&gt;

&lt;p&gt;Ivan&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>css</category>
      <category>html</category>
    </item>
  </channel>
</rss>
