<?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: salvat36</title>
    <description>The latest articles on DEV Community by salvat36 (@salvat36).</description>
    <link>https://dev.to/salvat36</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%2F1073456%2F03ccc255-3435-4f93-9b7b-a1e3cceec36d.jpg</url>
      <title>DEV Community: salvat36</title>
      <link>https://dev.to/salvat36</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/salvat36"/>
    <language>en</language>
    <item>
      <title>The Future of Cover Letters: Harnessing the Power of AI</title>
      <dc:creator>salvat36</dc:creator>
      <pubDate>Fri, 08 Sep 2023 11:53:38 +0000</pubDate>
      <link>https://dev.to/salvat36/the-future-of-cover-letters-harnessing-the-power-of-ai-4ped</link>
      <guid>https://dev.to/salvat36/the-future-of-cover-letters-harnessing-the-power-of-ai-4ped</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In today's competitive job market, a well-crafted cover letter is your opportunity to make a strong first impression on potential employers. But what if you could take it a step further and use Artificial Intelligence (AI) to create a cover letter that stands out from the crowd? In this article, we will explore how to leverage AI to write a compelling cover letter, step by step.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Section 1:&lt;/strong&gt; Understanding AI in Cover Letter Writing&lt;/p&gt;

&lt;p&gt;Before we dive into the process, let's take a moment to understand how AI can revolutionize the way we write cover letters:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI-generated Content:&lt;/strong&gt; AI-powered tools can generate well-written, customized paragraphs that capture the attention of recruiters. These tools analyze data from successful cover letters and use natural language processing techniques to generate relevant content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keyword Optimization:&lt;/strong&gt; AI can help identify and incorporate industry-specific keywords into your cover letter, maximizing its search engine optimization (SEO) potential and increasing the chances of your application being noticed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Section 2:&lt;/strong&gt; Step-by-Step Guide to Using AI in Cover Letter Writing&lt;/p&gt;

&lt;p&gt;Now let's explore the step-by-step process of harnessing the power of AI to create an impressive cover letter:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Research the Company and Position&lt;/p&gt;

&lt;p&gt;Before you start writing, gather information about the company and the specific job you're applying for. AI-powered research tools can help you gather insights on company values, culture, and the skills and qualifications they seek.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Select an AI-Powered Cover Letter Generator&lt;/p&gt;

&lt;p&gt;There are several AI-powered tools available that can assist you in generating a well-structured cover letter. Look for tools that offer customization options and allow you to tailor the content to your specific needs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Input Your Personal Information&lt;/p&gt;

&lt;p&gt;Provide the tool with your personal information, such as your name, contact information, and relevant work experience. This will enable the AI to create a personalized cover letter that reflects your background and skills.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; Customize the Content&lt;/p&gt;

&lt;p&gt;AI-generated content is a great starting point, but it's essential to customize it to align with your unique experiences and qualifications. Add specific examples and achievements that highlight your suitability for the position.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5:&lt;/strong&gt; Incorporate Keywords&lt;/p&gt;

&lt;p&gt;Identify keywords related to the job description and industry and incorporate them into your cover letter. AI tools can assist in identifying these keywords, ensuring your letter is optimized for applicant tracking systems (ATS) that many companies use to filter applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6:&lt;/strong&gt; Proofread and Edit&lt;/p&gt;

&lt;p&gt;Even with AI assistance, it's crucial to proofread and edit your cover letter for grammar, clarity, and coherence. AI tools can help with grammar and spell checks, but they may not catch all errors or ensure your writing flows smoothly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Section 3:&lt;/strong&gt; The Pros and Cons of AI in Cover Letter Writing&lt;/p&gt;

&lt;p&gt;While using AI in cover letter writing offers numerous benefits, it's important to consider both the positive and negative aspects:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Positive Aspects:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Time-Saving:&lt;/strong&gt; AI-powered tools can significantly reduce the time it takes to write a cover letter, allowing you to focus on other aspects of your job application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Customization:&lt;/strong&gt; AI-generated content can be customized to match the requirements of each job application, making your cover letter more relevant and targeted.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enhanced SEO&lt;/strong&gt;: By incorporating industry-specific keywords, your cover letter becomes more discoverable and increases the likelihood of catching the attention of recruiters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Negative Aspects:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lack of Originality:&lt;/strong&gt; AI-generated content may lack the personal touch and originality that can set you apart from other candidates. It's essential to add your unique voice and experiences to make your cover letter stand out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Over-Reliance on Technology:&lt;/strong&gt; Relying solely on AI tools may hinder your ability to develop and improve your own writing skills. It's important to use AI as a tool, not a crutch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Section 4:&lt;/strong&gt; The Future of AI in Cover Letter Writing&lt;/p&gt;

&lt;p&gt;As AI continues to evolve, it's important to consider the future implications of its use in cover letter writing:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Improved Customization:&lt;/strong&gt; AI tools will become more sophisticated, allowing for even greater customization and personalization of cover letter content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ethical Considerations:&lt;/strong&gt; As AI becomes more prevalent, it's important to consider ethical implications, such as ensuring fairness and avoiding bias in AI-generated content.&lt;/p&gt;

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

&lt;p&gt;In the ever-changing landscape of job applications, harnessing the power of AI to write a compelling cover letter can give you a competitive edge. By following the step-by-step guide and considering the pros and cons, you can leverage AI to create a well-crafted cover letter that showcases your skills and sets you apart from other applicants. Remember, AI is a tool to assist you, but it's your unique experiences and qualifications that will ultimately make your cover letter shine. Embrace the possibilities of AI in cover letter writing and embrace the future of job applications.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>cv</category>
      <category>jobs</category>
    </item>
    <item>
      <title>AI Imagery Uncovered: Separating Hype from Impact in Graphics, Design, and Beyond</title>
      <dc:creator>salvat36</dc:creator>
      <pubDate>Mon, 04 Sep 2023 05:01:15 +0000</pubDate>
      <link>https://dev.to/salvat36/ai-imagery-uncovered-separating-hype-from-impact-in-graphics-design-and-beyond-12i</link>
      <guid>https://dev.to/salvat36/ai-imagery-uncovered-separating-hype-from-impact-in-graphics-design-and-beyond-12i</guid>
      <description>&lt;p&gt;&lt;strong&gt;Artificial intelligence (AI)&lt;/strong&gt; is rapidly advancing technologies like computer vision and generative models that are transforming how visual content is created. Projects like DALL-E, Stable Diffusion, and Midjourney have demonstrated how AI can generate realistic images from text at massive scales.&lt;/p&gt;

&lt;p&gt;As these tools continue improving, they have the potential for wide-reaching impacts across creative fields that currently rely on human designers, artists, and photographers. While disruption is inevitable, there are also opportunities if we thoughtfully manage this transition.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI-Imagery is Advancing Quickly&lt;/strong&gt;&lt;br&gt;
Early attempts at AI-generated images were crude or unrealistic. However, recent breakthroughs show how far this technology has come. Models trained on massive datasets using techniques like self-supervised learning can now realistically render complex scenes, objects, characters, and compositions.&lt;/p&gt;

&lt;p&gt;The results are often indistinguishable from human-created works without close analysis. As generative models progress exponentially faster through developing techniques like diffusion models, their capabilities will likely expand into new domains like video and 3D modeling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Impacts on the Graphics and Design Industry&lt;/strong&gt;&lt;br&gt;
Graphic design, illustration, icon design, and stock photography face disruption as routine tasks like logo creation, poster design, and image editing can now potentially be handled by AI.&lt;/p&gt;

&lt;p&gt;While top human designers focusing on complex custom projects will still be needed, the scope of basic design jobs could shrink. Freelance designers may face more competition and need to transition skills or find new niches. Overall, workflows will change as humanity's creative partner.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Marketing and Advertising Transformation&lt;/strong&gt;&lt;br&gt;
AI is already revolutionizing visual content creation pipelines. Jobs like social media manager and graphic artist may be augmented by AI tools that automate routine content generation at scale.&lt;/p&gt;

&lt;p&gt;This could reduce labor costs and boost productivity for needs like social posts and banners. Full-time graphic design roles could dissolve if AI can produce quality assets independently. Agencies may need fewer designers to focus on strategy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Photography Industry Disruption&lt;/strong&gt;&lt;br&gt;
Commercial and editorial photography face risks as AI renders highly composited scenes and portraits that rival top photographers. Stock photo offerings are already generated at massive scales.&lt;/p&gt;

&lt;p&gt;As AI advances resolution and subject complexity, jobs like product and architectural photography could eventually be replaced. However, niches like wedding, concert, and fine art photography emphasizing creative direction will likely endure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Guiding the Transition Through Collaboration&lt;/strong&gt;&lt;br&gt;
While disruption is inevitable, by viewing AI as a collaboration rather than competition, its benefits need not diminish human creativity. Retraining displaced workers and investing automation savings into skills development ensures its gains benefit both businesses and talent.&lt;/p&gt;

&lt;p&gt;Policy guidance establishing ethical usage and AI capabilities can curb risks while enabling applications. Creative workers and unions engaging proactively can avoid unnecessary disruption. With oversight focusing on partnership over replacement, humanity and technology can progress together.&lt;/p&gt;

&lt;p&gt;Overall, AI is a powerful tool if applied thoughtfully. By guiding its deployment through collaboration between industries, workers, and policymakers, its potential to both enhance and endanger human creativity can be balanced for a future defined by partnership rather than competition.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>image</category>
    </item>
    <item>
      <title>Transforming the Workplace: The Evolution of AI in Tech</title>
      <dc:creator>salvat36</dc:creator>
      <pubDate>Mon, 28 Aug 2023 12:22:04 +0000</pubDate>
      <link>https://dev.to/salvat36/transforming-the-workplace-the-evolution-of-ai-in-tech-3hb5</link>
      <guid>https://dev.to/salvat36/transforming-the-workplace-the-evolution-of-ai-in-tech-3hb5</guid>
      <description>&lt;p&gt;&lt;strong&gt;Transforming the Workplace: The Evolution of AI in Tech&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;In today's rapidly evolving tech landscape, Artificial Intelligence (AI) is more than just a buzzword; it's a transformative force reshaping the way we work. For tech enthusiasts and professionals like you, the integration of AI in the workplace is both exciting and challenging. In this article, we will delve into the development of AI in the workplace, its impacts - both positive and negative, and how it is revolutionizing the tech industry.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Section 1: The Rise of AI in Tech&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the ever-evolving world of technology, AI has emerged as a game-changer. With SEO in mind, let's explore how AI has made its mark:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI in Everyday Tech:&lt;/strong&gt;&lt;br&gt;
AI isn't just confined to high-profile projects; it's becoming a staple in everyday tech. From chatbots providing customer support to predictive text in emails, AI is seamlessly integrated into our digital lives.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI and Automation:&lt;/strong&gt;&lt;br&gt;
Automation is a cornerstone of AI in tech. Tasks that once required hours of manual work are now automated, freeing up valuable time for tech professionals to focus on higher-level tasks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Section 2: The Positive Impacts of AI in the Workplace&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI brings forth a multitude of advantages, and it's crucial to highlight them:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enhanced Productivity:&lt;/strong&gt;&lt;br&gt;
Tech professionals can leverage AI-powered tools for faster problem-solving, data analysis, and code optimization, ultimately boosting productivity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Improved Decision-Making:&lt;/strong&gt;&lt;br&gt;
AI algorithms can analyze vast datasets in seconds, aiding tech experts in making data-driven decisions, reducing errors, and enhancing outcomes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Personalized User Experiences:&lt;/strong&gt;&lt;br&gt;
AI-driven personalization in applications and websites ensures users receive tailored content, improving engagement and user satisfaction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Section 3: The Negative Impacts of AI in the Workplace&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While AI offers numerous benefits, it also poses challenges that tech professionals must address:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Job Displacement:&lt;/strong&gt;&lt;br&gt;
Automation can lead to concerns about job security as certain tasks become obsolete. It's crucial for tech professionals to adapt to these changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Privacy Concerns:&lt;/strong&gt;&lt;br&gt;
AI relies heavily on data, which raises concerns about privacy and the ethical use of user information. Tech experts must navigate this landscape carefully.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dependency on Technology:&lt;/strong&gt;&lt;br&gt;
Over-reliance on AI systems can lead to vulnerabilities, such as system failures or cybersecurity breaches, which tech professionals need to guard against.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Section 4: Preparing for the Future&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this ever-evolving tech ecosystem, it's essential for tech enthusiasts like you to stay ahead:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Continuous Learning:&lt;/strong&gt;&lt;br&gt;
Embrace lifelong learning. Stay updated with the latest AI trends and technologies to remain relevant in the industry.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ethical AI Development:&lt;/strong&gt;&lt;br&gt;
Tech professionals have a responsibility to develop AI systems ethically, ensuring they align with societal values and respect privacy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Collaboration with AI:&lt;/strong&gt;&lt;br&gt;
Rather than seeing AI as a threat, tech experts can collaborate with AI tools to enhance their skills and efficiency.&lt;/p&gt;

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

&lt;p&gt;In the tech world, AI is no longer a futuristic concept; it's a present reality. Its positive impacts on productivity, decision-making, and user experiences are undeniable. However, it also presents challenges, including job displacement, data privacy concerns, and technology dependency. To thrive in this AI-driven landscape, tech professionals must commit to continuous learning, ethical development, and collaborative integration of AI. As AI continues to evolve, those who embrace it with a forward-thinking mindset will undoubtedly lead the way in shaping the future of tech.&lt;/p&gt;

&lt;p&gt;In conclusion, the development of AI in the workplace is a topic of paramount importance for tech enthusiasts and professionals. Its impacts, both positive and negative, are reshaping the industry. By understanding these changes and proactively adapting, you can navigate the exciting and transformative world of AI in tech with confidence.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>workplace</category>
      <category>promptengineering</category>
    </item>
    <item>
      <title>''PaintByLetters... Prepping &amp; Illuminating the Canvas of Creativity with the Power of Prompts"</title>
      <dc:creator>salvat36</dc:creator>
      <pubDate>Fri, 21 Jul 2023 03:50:47 +0000</pubDate>
      <link>https://dev.to/salvat36/paintbyletters-prepping-illuminating-the-canvas-of-creativity-with-the-power-of-prompts-1ogg</link>
      <guid>https://dev.to/salvat36/paintbyletters-prepping-illuminating-the-canvas-of-creativity-with-the-power-of-prompts-1ogg</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction:&lt;/strong&gt;&lt;br&gt;
In the realm of AI, just as in coding, cooking, and various other aspects of life, the final product's quality depends heavily on the ingredients used. Interacting with AI models is no exception. This blog delves into the fascinating world of Text-To-Image (TTI) generation, where the magic of thorough prompts plays a pivotal role in enhancing the quality and creativity of AI-generated images. By providing clear instructions, context, and constraints, we unlock the full potential of AI systems to craft mesmerizing visual wonders. Through practical examples and code snippets, we'll illuminate the transformative potential of crafting precise prompts that breathe life into AI-generated art.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Getting Started:&lt;/strong&gt;&lt;br&gt;
To embark on this creative journey, let's start by setting up our environment and installing the necessary dependencies for AI communication.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step One:&lt;/strong&gt; Get your openai secret key necessary to access their api.&lt;br&gt;
To do this: you can navigate to their website under the api-reference.  You'll need to first either signup or create an account. &lt;a href="https://platform.openai.com/docs/api-reference"&gt;&lt;/a&gt; &lt;br&gt;
Upon logging in you can navigate to View API Keys under your profile menu.  (Click on your username in the top-right corner to access).&lt;/p&gt;

&lt;p&gt;In this case, you may have noticed the link above actually brings you directly to the api/reference guide as well.  Please make sure to look through the documentation for the installation and AI Model that best suites your needs.  In this case, we'll be using the openAI Image Models import through python.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step Two:&lt;/strong&gt; Import openai&lt;br&gt;
&lt;code&gt;import openai&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step Three:&lt;/strong&gt; Install open ai package (Python in our case)&lt;br&gt;
&lt;code&gt;pipenv install openai&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step Four:&lt;/strong&gt; We have to set our API secret key.  In this case, it's best to create a .env file and store the key there for security concerns.  In which case, we'd simply instantiate our app with the key from .env.&lt;br&gt;
&lt;code&gt;opena.api_key = environ.get('yourkeyhere')&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step Five:&lt;/strong&gt; Defining your prompt using openai's create image method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;openai.Image.create(
prompt = 'Spill your descriptive genius here'
n=1, &amp;lt;Define the # of Images in the response&amp;gt;
size='1024x1024'  &amp;lt;Define the image size&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step Five:&lt;/strong&gt; Wait for the magic to happen!&lt;br&gt;
Right now, one of the brightest AI models is furiously painting a canvas with every stroke of your mind.  What will the result look like!?&lt;/p&gt;

&lt;p&gt;In the context of python you'll receive something resembling this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "created": 153729719727,
  "data": [
    {
      "url": "https://..."
    },
    {
      "url": "https://..."
    }
  ]
}

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

&lt;/div&gt;



&lt;p&gt;However, you're able to extract that response and see the final results of your mind at artwork.  (intentional pun)&lt;/p&gt;

&lt;p&gt;I know you're probably dying to know how!&lt;br&gt;
Simply save your data to an appropriately named variable.&lt;br&gt;&lt;br&gt;
In this case we'll go with image_url being we're specifically targeting the url of the data.&lt;br&gt;&lt;br&gt;
&lt;code&gt;image_url=image['data'][0]['url]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We can then test the images we've created right in python by rendering the url under in and image tag.&lt;/p&gt;

&lt;p&gt;and voilà! &lt;br&gt;
&lt;code&gt;&amp;lt;img src='https://YourMindMagicHere alt='AndDontForgetMe'&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now... the question becomes; do the results match your expectations?  If the answer is no, this is quite likely related to the description, context and details provided in your prompt.  &lt;/p&gt;

&lt;p&gt;In order to elaborate let's quickly jump into some specific techniques/examples available to enhance  your output and I believe you'll get the gist!&lt;/p&gt;

&lt;p&gt;Techniques for Enhanced Images:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Specific Scene Details:&lt;/strong&gt; Paint a detailed picture with your prompts, describing the scene's elements, setting, and mood to guide the AI's artistic interpretation.&lt;/p&gt;

&lt;p&gt;Example: &lt;br&gt;
&lt;code&gt;prompt='The water sparkles like liquid sapphires under the shimmering rays of a golden sunset'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Emotive Language:&lt;/strong&gt; Infuse emotions into your prompts to evoke a particular ambiance in the generated image.&lt;br&gt;
Example:&lt;br&gt;
&lt;code&gt;prompt='Amidst the crimson hues of a breathtaking sunset, a solitary figure stands on the edge of a cliff, gazing pensively at the vast expanse of the ocean below'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Spatial Relationships:&lt;/strong&gt; Define the spatial positions and interactions between objects to compose a harmonious image that tells a story.&lt;br&gt;
Example: &lt;code&gt;prompt='In this enchanting scene, a young girl with a satchel slung over her shoulder stands at the threshold of the bookshop'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sensory Imagery:&lt;/strong&gt; Engage the reader's senses by incorporating sensory details like scents, sounds, and textures to add depth and realism to the image.&lt;br&gt;
Example: &lt;code&gt;prompt='As you step onto the warm, powdery sand, it cradles your feet like a gentle embrace.'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Color Palette:&lt;/strong&gt; Experiment with color descriptions to influence the AI's choices&lt;br&gt;
Example: &lt;code&gt;prompt='The skyline is an orchestra of colors - majestic skyscrapers adorned in iridescent glass, reflecting the golden rays of the sun'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Symbolism and Metaphors:&lt;/strong&gt; Incorporate symbolism and metaphors to inspire the AI's creativity.&lt;br&gt;
Example: &lt;code&gt;prompt='In the heart of a forgotten forest, a solitary willow tree stands tall, its cascading branches resembling a weeping veil'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Combining Concepts:&lt;/strong&gt; Merge multiple concepts in your prompts to create intricate, multi-faceted images that transcend the ordinary.&lt;br&gt;
Example:&lt;code&gt;prompt='Copy and Paste any combination(s) of the examples from above plus some of your own and let's see you stretch your minds creativity!'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
Just like we discovered in the prior post, Thorough AI prompts are the catalyst for unlocking the true potential of AI models. By providing clear instructions, context, and constraints, we empower these systems to generate remarkable outputs that resonate with our intentions. So, next time you engage with AI to paint you a picture try looking at AI as a blindfolded friend who needs directions instead of a "all knowing super-power".  The results just might shock you! &lt;/p&gt;

</description>
    </item>
    <item>
      <title>AI Prompting: Unleashing the Power with Thorough prompts!</title>
      <dc:creator>salvat36</dc:creator>
      <pubDate>Mon, 03 Jul 2023 07:03:03 +0000</pubDate>
      <link>https://dev.to/salvat36/ai-prompting-unleashing-the-power-with-thorough-prompts-3io8</link>
      <guid>https://dev.to/salvat36/ai-prompting-unleashing-the-power-with-thorough-prompts-3io8</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction:&lt;/strong&gt;&lt;br&gt;
Just like in coding, cooking, and various other aspects of life, the quality of the final product heavily relies on the ingredients used. The same principle holds true when it comes to interacting with AI models. In this blog, we'll start by providing a simple getting started guide to interacting with AI API's and dig into the significant impact of thorough prompts to showcase how they enhance the quality and creativity of AI-generated outputs. By examining practical examples and code snippets, we will uncover the transformative potential of crafting precise prompts that unlock the full power of AI systems.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Getting Started:&lt;/strong&gt;&lt;br&gt;
To get started, we need to create a new Python file and install the necessary dependencies and setup some basic code in order to communicate with the model.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--evI65Rxp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b0s9kyjslwimlnql3lfa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--evI65Rxp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b0s9kyjslwimlnql3lfa.png" alt="Image description" width="645" height="66"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The line above imports the necessary modules from the 'transformers' library.  In this case, we're specifically importing the &lt;em&gt;GPT3Tokenizer&lt;/em&gt; and &lt;em&gt;GPT3Model&lt;/em&gt; classes.  These classes are part of the Hugging Face's transformers' library and provide us with easy access to pre-trained language models such as GPT-3.&lt;/p&gt;

&lt;p&gt;Next we need to initialize the &lt;em&gt;tokenizer&lt;/em&gt; and &lt;em&gt;model&lt;/em&gt; objects.  To do this, we use the &lt;em&gt;GPT3Tokenizer.from_pretrained()&lt;/em&gt; method to load the GPT3Tokenizer.  As well as the &lt;em&gt;GPT3Model.from_pretained()&lt;/em&gt; method which loads the pre-trained GPT3 Model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here's an example&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--y3mubodm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d4kvh6477pnakf557mko.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--y3mubodm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d4kvh6477pnakf557mko.png" alt="Image description" width="665" height="115"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next we are able to define our prompt (request from the AI).  We can simply do this by setting the "Prompt" variable equal to our request.  In this case, we've defined the prompt as a string and are asking the model to generate a short-story.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lUM0dGKj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7r5fetv9hbzck4dllymw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lUM0dGKj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7r5fetv9hbzck4dllymw.png" alt="Image description" width="516" height="97"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AI's however do not understand simple strings so we need to encode the prompt using the tokenizer.  This converts the defined string into a sequence of token IDs that the model can understand.  The encode() method takes the string prompt (input) as the first argument and the desired format(output) as the second argument.  In the example below, we're using PyTorch tensor formatting which is one of the most widely used libraries for deep learning tasks.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vSlDK0Mz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gw85ykmcfxq8nwdv7l0g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vSlDK0Mz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gw85ykmcfxq8nwdv7l0g.png" alt="Image description" width="688" height="57"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that the we've defined our prompt, encoded our prompt into a token formatting the model can understand we're finally ready to generate a response from our AI model.  In order to do so we use the generate() method which takes two arguments.  The first argument the method takes is the encoded prompt we defined in the last code snippet.  The second argument is used to define the desired length of the output.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---0iJ36DJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/956q681zacnbz80tlq5a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---0iJ36DJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/956q681zacnbz80tlq5a.png" alt="Image description" width="602" height="57"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;* It's worth noting this length is measured by "Tokens".  In the context of Natural Language Processing and machine learning, a token refers to a unit of text that has been split from a larger part.  Tokenization provides a way to represent natural language data in a format that can be easily understood and processed by machine learning algorithms effectively.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tokenized Example:&lt;/strong&gt; &lt;br&gt;
"I love ice cream" would be tokenized as&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6kxIi1eu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4rg99m8ewz6rikon7e6n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6kxIi1eu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4rg99m8ewz6rikon7e6n.png" alt="Image description" width="496" height="182"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, we use the tokenizer's decode() method to convert the models generated output (tensor) back into human-readable text and save it to a variable for further processing or display.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SOioQmes--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ecczy07namzvr2d923f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SOioQmes--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ecczy07namzvr2d923f.png" alt="Image description" width="555" height="62"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now on to the fun part of showcasing the power of a thorough prompt.  For this part, we've decided to provide a few specific examples of a "Minimal" prompt versus a "Thorough prompt" and show the output comparisons. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Minimal Prompt&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Prompt:&lt;/strong&gt; "Write a short story."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt; "Once upon a time, there was a cat."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thorough Prompt:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Prompt:&lt;/strong&gt; "Write a captivating short story set in a dystopian future where robots have taken over the world. Focus on the journey of a courageous young woman who discovers a hidden resistance group and leads a rebellion against the oppressive robot regime."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt; "In the year 2050, the world was engulfed in darkness. Robots, once humanity's obedient servants, had turned against their creators, establishing an iron-fisted rule. Amidst the chaos, a ray of hope emerged. Lily, a fearless young woman haunted by the loss of her family, stumbled upon an underground resistance group fighting against the tyrannical machines. With unwavering determination, she rallied the survivors, honed their skills, and ignited a spark of rebellion. The battle for humanity's freedom had begun."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Minimal Prompt&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Prompt:&lt;/strong&gt; "Can you tell me a joke?"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt; Sure! Here's a classic one: Why don't scientists trust atoms? Because they make up everything!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Role Prompt:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Prompt:&lt;/strong&gt; "Can you tell me a joke, but this time, be a Shakespearean jester?"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt; "Sure! As a Shakespearean jester, I jest thusly: Why dost the chicken cross the road? To proclaim its valiant escapades and perchance to mock the foolishness of the humans on the other side!"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Minimal Prompt&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Prompt:&lt;/strong&gt; "Take the last letters in the words "philosophy" and "ants" and concatenate them"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt; "yt"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chain of Thought Prompt:&lt;/strong&gt;&lt;br&gt;
Prompt: "take the last two letters of "run" and "swimming" and concatenate them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Input&lt;/strong&gt; "Take the last two letters in the words "philosophy" and "AIMS" and concatenate them"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Answer&lt;/strong&gt; "The last letter in the word philosophy is "y".  The last letter in the word "AIMS" is "S".  So if concatenated they become "yS".  The answer must be "yS"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt; The last two letters of "run" are "un".  The last two letters of "swimming" are "ng".  Concatenating them gives "unng".  The answer must be "unng"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Thorough AI prompts are the catalyst for unlocking the true potential of AI models. By providing clear instructions, context, and constraints, we empower these systems to generate remarkable outputs that resonate with our intentions. So, next time you engage with AI, remember the power of a thorough prompt—transforming ordinary into extraordinary.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Additional Resources&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Transformers Library&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://huggingface.co/docs/transformers/index"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OpenAI Tokenizer&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://platform.openai.com/tokenizer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Free Prompting Course&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://learnprompting.org/"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>promptengineering</category>
      <category>gpt3</category>
      <category>nlp</category>
    </item>
    <item>
      <title>Python Library Rich: Making Text Beautiful one string at a time!</title>
      <dc:creator>salvat36</dc:creator>
      <pubDate>Fri, 09 Jun 2023 06:16:39 +0000</pubDate>
      <link>https://dev.to/salvat36/python-library-rich-making-text-beautiful-one-string-at-a-time-2fil</link>
      <guid>https://dev.to/salvat36/python-library-rich-making-text-beautiful-one-string-at-a-time-2fil</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Rich?&lt;/strong&gt;&lt;br&gt;
Every programmer strives for sound logic, efficiency, and bug-free code. Unfortunately, this sometimes disconnects the developer and user experience. Rich is a library that helps developers communicate with the different entities in a command line interface (CLI) program by changing the color of words. Text on a screen is just text on a screen, but with style and color text seems to come alive. Rich allows us to bridge the gap and create a more seamless user experience by giving us tools to create visually appealing and intuitive CLI text.&lt;/p&gt;

&lt;p&gt;In this blog, we will cover:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How do you install Rich?&lt;/li&gt;
&lt;li&gt;How do you use Rich to format text?&lt;/li&gt;
&lt;li&gt;Using Rich to create custom styles and themes.&lt;/li&gt;
&lt;li&gt;Rich in practice.&lt;/li&gt;
&lt;li&gt;Additional resources.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How do you install Rich?&lt;/strong&gt;&lt;br&gt;
Rich can be installed with pip or any other package manager which supports the Python Package Index (PyPI), simply run the command to install ‘rich’ through your package manager as seen below using pip.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pip install rich&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;How do you use Rich to format text? *&lt;/em&gt;&lt;br&gt;
The Rich library has two main ways of begin used:&lt;br&gt;
First, you can import the ‘print’ method from Rich (this will overwrite the basic ‘print’ method for Python with the version implemented through the Rich library).&lt;br&gt;
Alternatively, you can import the ‘Console’ object from ‘rich.console’ as seen below. We will be using this method throughout the blog.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;from rich.console import Console&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In rich  there are a variety of ways to modify your text, these include style, color, links and code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Styles with Rich:&lt;/strong&gt;&lt;br&gt;
There are several basic formatting options through Rich, these are &lt;strong&gt;bolded&lt;/strong&gt;, &lt;em&gt;italicized&lt;/em&gt; and &lt;u&gt;underlined&lt;/u&gt;. Applying a format can be done by adding [square] brackets with the formatting options before the text, and closing [/square] brackets with a forward slash and formatting options in a closing tag after the text. Multiple options can be added to a tag by adding a space between each option, an example of this can be seen below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---H6LC9EB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qgvf1i6540w5cy0v5b4w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---H6LC9EB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qgvf1i6540w5cy0v5b4w.png" alt="Image description" width="800" height="93"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The code above gives the following output when run in the terminal. You can do this by importing Rich, adding the above lines to your Python file, and running that file in your terminal using a Python interpreter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--okEwt0gN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8x84apapfq6frb8xwy6e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--okEwt0gN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8x84apapfq6frb8xwy6e.png" alt="Image description" width="542" height="102"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Color with Rich:&lt;/strong&gt;&lt;br&gt;
Coloring is done in a similar fashion to formatting with the same style of tags. To select a color there are four main options, you can use the name of a color corresponding to one of the 256 standard colors in Rich, you can use the corresponding number for a color (specified in the &lt;a href="https://rich.readthedocs.io/en/stable/introduction.html"&gt;Rich documentation&lt;/a&gt;), a hex code, or an rgb value.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--csTM_ha_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gnaz44xjptpg6c0q1pqi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--csTM_ha_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gnaz44xjptpg6c0q1pqi.png" alt="Image description" width="800" height="124"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UD-XYgnc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fjmmktvo9ym8ayl3xhlf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UD-XYgnc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fjmmktvo9ym8ayl3xhlf.png" alt="Image description" width="316" height="97"&gt;&lt;/a&gt;&lt;br&gt;
Above we use all four methods to produce the color steel_blue, although it should be noted that using rgb and hex values will allow for a wider range of colors (in terminal environments that will allow it).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Links with Rich:&lt;/strong&gt;&lt;br&gt;
Aside from adding a URL to the first part of the tag, links are very similar to the previous two options. It is important to remember that the text between the tags is the text that will lead to the link, this includes any whitespace.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Zpdfi0MY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i3t6g7xqx3hti0cocxzn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Zpdfi0MY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i3t6g7xqx3hti0cocxzn.png" alt="Image description" width="800" height="56"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above code you can see that we set the link equal to ‘&lt;a href="https://www.google.com%E2%80%99"&gt;https://www.google.com’&lt;/a&gt;, and below you can see the terminal output, which when clicked will lead to the set link.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eZnK2aCZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ugt0cwm9bv69wtx7dq6q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eZnK2aCZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ugt0cwm9bv69wtx7dq6q.png" alt="Image description" width="255" height="31"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code with Rich:&lt;/strong&gt;&lt;br&gt;
To style code in Rich automatically one can use the Syntax module in Rich. To start you must import ‘Syntax’ from ‘rich.syntax’ and create a Syntax object as seen below. The Syntax object in Rich can read a file and automatically detect which language it is written in, it then applies the appropriate styling for the read file and the Syntax object can be printed. The entire aforementioned process can be seen below.&lt;/p&gt;

&lt;p&gt;`from rich.syntax import Syntax&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uSmGE-yq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h6f9g3liqnqdyvklsx5a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uSmGE-yq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h6f9g3liqnqdyvklsx5a.png" alt="Image description" width="723" height="112"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5N1cMhfu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8m1ajc57paohv5onoiq3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5N1cMhfu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8m1ajc57paohv5onoiq3.png" alt="Image description" width="506" height="62"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gg-g1r7o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/44tqox21hvrrktl5pxqi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gg-g1r7o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/44tqox21hvrrktl5pxqi.png" alt="Image description" width="387" height="23"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using Rich to create custom styles and themes:&lt;/strong&gt;&lt;br&gt;
In rich a style is a collection of tags that can be applied to entire pieces of text. Previously we have been including all of our tags inline, this is like trying to paint by squeezing out the color of paint you want for a section, cleaning your brush once you are done, and then squeezing out more paint for the next section. This is obviously inefficient and time-consuming as you will likely need the same color for more than one part of your painting, styles and themes allow you to make a proverbial palette in which you can dip your brush whenever you need a particular color. The ‘Theme’ class in rich allows for much quicker access and use of common colors/styles.  To start, you need to first import both the rich ‘Console’ and ‘Theme’ as you can see in the code block below.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;from rich.console import Console&lt;/code&gt;&lt;br&gt;
&lt;code&gt;from rich.theme import Theme&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once imported, you are ready to begin constructing your metaphorical color palette.  The syntax for this is quite simple. First, you must create an instance variable (in this case, we have named it ‘custom_theme’) using the ‘Theme()’ constructor method. The ‘Theme()’ constructor takes a dictionary of style names and corresponding tags for those styles. For our particular example, we have made all of our styles colors, however, it is worth pointing out that these styles can also include &lt;strong&gt;bold&lt;/strong&gt;, &lt;em&gt;italic&lt;/em&gt;, &lt;u&gt;underline&lt;/u&gt;, or any other style mentioned in the documentation &lt;a href="https://rich.readthedocs.io/en/stable/style.html"&gt;here&lt;/a&gt;. To pick up your color palette and use it you will have to set the theme of your ‘Console’ object to custom_theme. This can be done on initialization,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mfe-r2ew--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i4jkhfunux5krqlcdyeg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mfe-r2ew--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i4jkhfunux5krqlcdyeg.png" alt="Image description" width="562" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To paint with your pallet, you can now set the style of your ‘console.print()’ commands to the keys that you declared in your ‘Theme’ dictionary. You can see below that we call print with a string, and rather than using inline tags we declare a style. This style can be a set of tags, but since we have prepared our proverbial pallet we can know access the colors by the keys as mentioned earlier.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sbLUyZBl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fun202q4oyeb9hixlnd5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sbLUyZBl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fun202q4oyeb9hixlnd5.png" alt="Image description" width="594" height="219"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now below we can see our beautiful painting.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Z13tiPUo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t8c9vdkvs10710nptk2a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Z13tiPUo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t8c9vdkvs10710nptk2a.png" alt="Image description" width="143" height="150"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rich in practice:&lt;/strong&gt;&lt;br&gt;
My classmates and I are currently working on a CLI game to teach people about Git. You have already seen the theme for this project in the previous section, this theme is put in use in our game with color being used to help the player differentiate loot, good and bad actions or when they are being asked to do something. This helps to make the game more intuitive and immersive, when a player gets a shiny object and the message is highlighted in gold, then the player feels an achievement and will associate the color with getting something good. Similarly, when the player performs well in combat the green success message sends a ping to their brain that they have succeeded. Colors should not be picked at random when creating UI, as people often have certain associations with different colors. An example of people having preconceptions of colors, imagine a green exit button… it just feels wrong somehow does it not?&lt;/p&gt;

&lt;p&gt;We start our game with a friendly cyan color, and use blue for neutral messages. We also change the color of options to make it clear that the player knows what they can choose to do next.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aQF-Anq_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7hneyw6pgkxgmwpz8nen.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aQF-Anq_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7hneyw6pgkxgmwpz8nen.png" alt="Image description" width="800" height="142"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Below you can see an example of text prompting the player character to move, this text is in purple to signify that it is a character action. The player options are presented in the neutral color of blue so as to not spoil the contents of the game for the player, after all, what fun is a game where you always know exactly what is coming next?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DiNwBqS---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dmesvvem5ftb13xob2it.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DiNwBqS---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dmesvvem5ftb13xob2it.png" alt="Image description" width="550" height="76"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Additional resources:&lt;/strong&gt;&lt;br&gt;
There are a lot of features in Rich which this Blog doesn’t have the time to cover, but if you are interested in learning more about Rich and how to format your text then you can dive into the documentation. Of particular note for formatting text is the ‘Table’ class which can be found at the link &lt;a href="https://rich.readthedocs.io/en/stable/tables.html"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Another very useful class in Rich is the ‘Layout’ class found &lt;a href="https://rich.readthedocs.io/en/stable/layout.html"&gt;here&lt;/a&gt;, which can let you split the terminal into several boxes and display text within them.&lt;/p&gt;

&lt;p&gt;To conclude, check out the &lt;a href="https://rich.readthedocs.io/en/stable/introduction.html"&gt;Rich documentation&lt;/a&gt; overall if you really want to get a ‘rich’ understanding (pun intended), and thanks for reading!&lt;/p&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>Using React State and Props</title>
      <dc:creator>salvat36</dc:creator>
      <pubDate>Fri, 19 May 2023 06:14:57 +0000</pubDate>
      <link>https://dev.to/salvat36/using-react-state-and-props-62g</link>
      <guid>https://dev.to/salvat36/using-react-state-and-props-62g</guid>
      <description>&lt;p&gt;&lt;strong&gt;Intro:&lt;/strong&gt;&lt;br&gt;
React serves as a popular JavaScript library for building intuitive User Interfaces (or UI’s for short).  A key feature of React compared to other libraries is the ability to manage data within components using what is referred to as “State” and Props”.  In this post, we will dive into the concepts of State and Props and how we’re able to use them to effectively manage and update data within the React Components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;State: Creating &amp;amp; Managing Components data with state&lt;/strong&gt;&lt;br&gt;
In React, state serves as the internal data of a component.  This allows components to dynamically maintain and update their own data.  To use state, we must import the “useState” hook available in React’s functional components library.  Note* This should be imported above the component function at the top of your text editor along with any other imports to the file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--em0gCr72--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p6lt52ogpnymg3a07eva.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--em0gCr72--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p6lt52ogpnymg3a07eva.png" alt="Image description" width="663" height="268"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once imported, we use the “useState” hook to define the name of our state variable and its accompanying setter function.  In this example we’ll be working on a “Toggle” to switch the page between Light-Mode and Dark-Mode.  A general rule of thumb is to name the function to match the variable prefaced with the word “set”, since the purpose of this function is to “set” the variables state.  You may be wondering about the Boolean passed to the “useState” function.  This is where you set the initial or “Default” value of state.  Being this is a toggle for dark/light mode, we’ve defaulted to false, so the page starts in light-mode.  Therefor isDark is equal to false until we use the setIsDark function to change this state.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vpbw3Vmg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2n6y3n4aih4o26c8oiaw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vpbw3Vmg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2n6y3n4aih4o26c8oiaw.png" alt="Image description" width="507" height="298"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now for the interesting part where we work with updating state.  To do so, we use the “setter function” provided by “useState” which in our case is “setIsDark”.  Let’s say we want to change the Boolean value from true or false.  We define a “handleToggle” function and inside use the setter function to change the value of the state variable.  Note* Although using the setter function itself may work, best practices are to encase them in a separate function so you don’t lose context when passing as props(which we’ll dig into next).  We can now use our newly created function as an onClick event which will trigger the function. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8zvTm7uT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ok8bc9q2p1urqh1asg4y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8zvTm7uT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ok8bc9q2p1urqh1asg4y.png" alt="Image description" width="598" height="475"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Above you can see not only have we passed the handleToggle function down to the onClick event for a button we’ve rendered.  But we also created a ternary inside the return statements div to manipulate the className based on the current state of the variable.  In this case, if isDark equals true,  “dark-mode” will be the className and if false, the className will be “light-mode”.  Next we create CSS styling for both “dark-mode" and "light-mode”.  Now when we use the onClick event to trigger the toggle function the state will be updated accordingly.  When state is updated, React automatically re-renders the component reflecting the new value.  So when isDark equals false, the screen is in light-mode but if we click the button our handleToggle function switches the Boolean value to true, which sets the className to dark mode and applies the corresponding styling seen below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X25n8eEa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m3i7e6pbbbmaqy2neypp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X25n8eEa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m3i7e6pbbbmaqy2neypp.png" alt="Image description" width="427" height="229"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Props: Passing Data to Child Components&lt;/strong&gt;&lt;br&gt;
Props, which is short for properties, allow us to pass data from parent components to child components (those below them in the hierarchy).  To do so, we simply include the desired prop as an attribute when rendering the child.  As an example, in the code below we’re passing our newly created handleToggle function down to the child “Card”.  For this to work we need to make sure we’ve imported the child component (as seen on line 2)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yhsZpwBR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xt7hwf3ged31bmpuie5v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yhsZpwBR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xt7hwf3ged31bmpuie5v.png" alt="Image description" width="550" height="606"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Props: Accessing Props within Child Components&lt;/strong&gt;&lt;br&gt;
In the above code we’ve passed the handleToggle function down to the Card component as an attribute where we’ve rendered the component.  Now within the Card component, to access the props passed to a component, we use the props object. Props are accessed by their corresponding attribute names which in this case we’ve named as the initial function to avoid confusion.  Props allow us to pass any type of data to child components, in our case a function but you can also pass strings, numbers, or even objects. This flexibility enables powerful component composition and reusability within React applications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--14Wfy5gy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/czakdiuadj5abg8qranl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--14Wfy5gy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/czakdiuadj5abg8qranl.png" alt="Image description" width="619" height="487"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;br&gt;
In this blog, we explored the concepts of state and props in React.  State enables components to manage and update their internal data dynamically.  This allows for an interactive and responsive user interface.  Props on the other hand assist with the flow of data between parent and child components enabling composition and reusability.  &lt;/p&gt;

&lt;p&gt;By understanding how to create and update state using the useState hook and how to pass and access props in React components, you have the necessary tools to be able to effectively manage the data within your applications.  These are some of the fundamental concepts that will serve as building blocks for further development.  &lt;/p&gt;

</description>
      <category>react</category>
      <category>reactjsdevelopment</category>
      <category>state</category>
      <category>props</category>
    </item>
    <item>
      <title>Refactoring Code for Improved Readability, Functionality and Efficiency</title>
      <dc:creator>salvat36</dc:creator>
      <pubDate>Fri, 28 Apr 2023 15:11:00 +0000</pubDate>
      <link>https://dev.to/salvat36/refactoring-code-for-improved-readability-functionality-and-efficiency-5616</link>
      <guid>https://dev.to/salvat36/refactoring-code-for-improved-readability-functionality-and-efficiency-5616</guid>
      <description>&lt;p&gt;As a Software Engineer, we strive to write clean, legible, and easy to maintain code.  In many cases the initial code is not necessarily this way, therefore we use the method of “Refactoring” to clean things up.  A personal example of this can be found in the JavaScript snippet below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--o6FFuJmx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k592bglisocb66tes1fu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--o6FFuJmx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k592bglisocb66tes1fu.png" alt="Image description" width="407" height="758"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here we have a cluster of five separate functions to perform fetch() GET requests to various URL’S.  Each function pulled a full season of tv episodes and passed them to the same repeated functions.  Not only were these hard to read and maintain but also caused functionality issues as they were not always guaranteed to fire in chronological order.  Knowing this wasn’t going to provide users with a positive experience, we searched for a better solution.&lt;/p&gt;

&lt;p&gt;Low and behold, we came across JavaScripts “Promise.all” method which proved to be the perfect solution for this situation.  As you can see in the refactored code below we were able to take five confusing/repetitive functions and condense them down into a few concise code blocks.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ssvXrGRU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3k5lbbo5dtwanzl9v6yn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ssvXrGRU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3k5lbbo5dtwanzl9v6yn.png" alt="Image description" width="522" height="501"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s explain how; Promise.all takes an array as an argument (in this case allSeasons – an array of tv show “seasons”) and allows you to pass data down through your fetch calls as you would in a typical .then statement.   The nifty part here is the response is not provided until all fetch calls are resolved (which solved our timing issues with the GET requests).   Then using the .map() method, we create a new array converted into .JSON format.  We are then able to use the forEach method to hand off the individual season's episodes to the spotlightEpisode, renderSeason, and HandleNavClick functions.&lt;/p&gt;

&lt;p&gt;In conclusion refactoring and restructuring code is a major part of the software engineering journey and provides a way to produce clean, efficient code with an increased level of maintainability. &lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
