<?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: Graham Fleming</title>
    <description>The latest articles on DEV Community by Graham Fleming (@grahamfleming).</description>
    <link>https://dev.to/grahamfleming</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%2F404474%2F86eb3b3c-3585-4427-97bb-2812bf56ab3f.jpg</url>
      <title>DEV Community: Graham Fleming</title>
      <link>https://dev.to/grahamfleming</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/grahamfleming"/>
    <language>en</language>
    <item>
      <title>PROJECT - Random Color Generator</title>
      <dc:creator>Graham Fleming</dc:creator>
      <pubDate>Sat, 20 Aug 2022 18:29:14 +0000</pubDate>
      <link>https://dev.to/grahamfleming/project-random-color-generator-5hl0</link>
      <guid>https://dev.to/grahamfleming/project-random-color-generator-5hl0</guid>
      <description>&lt;p&gt;Applications that have a client side facing front end can allow developers to create user interfaces that can be used to interact with different parts of your application. The process of taking input data and using this information to dictate parameters in the code.&lt;/p&gt;

&lt;p&gt;We can first start by creating a variable with an array of possible characters, this array will be used to generate a HEX color code to be used in our CSS.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Initialize Random HEX Color Code
const hexColorCode = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "a", "b", "c", "d", "e", "f" ];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In order to manipulate the CSS we need to select the different elements that we want to change, we can use the window object to select the different Elements by passing in each of their IDs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Initialize All Required DOM Elements
const mainSection = document.getElementById("mainSection");
const pickColor = document.getElementById("pickColor");
const pickButton = document.getElementById("pickButton");
// const copyButton = document.getElementById("copyButton");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To construct our HEX value for our color we can use a for loop to cycle through the hexColorCode array randomizing the selections until 6 characters are selected.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Initialize the Random HEX Color Picker
pickButton.addEventListener("click", () =&amp;gt; {
  let hexColorName = "#";
  for (let i = 0; i &amp;lt; 6; i++) {
    hexColorName += hexColorCode[getRandomArray()];
  }
  pickColor.style.color = hexColorName;
  pickColor.textContent = hexColorName;
  mainSection.style.backgroundColor = hexColorName;
});

const getRandomArray = () =&amp;gt; {
  return Math.floor(Math.random() * hexColorCode.length);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pressing the button repeatedly will genereate new HEX color codes from the array, and than applying it to the elements on our page to change the CSS color.&lt;/p&gt;

&lt;p&gt;FULL CODE&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Initialize Random HEX Color Code
const hexColorCode = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "a", "b", "c", "d", "e", "f" ];

// Initialize All Required DOM Elements
const mainSection = document.getElementById("mainSection");
const pickColor = document.getElementById("pickColor");
const pickButton = document.getElementById("pickButton");
// const copyButton = document.getElementById("copyButton");

// Initialize the Random HEX Color Picker
pickButton.addEventListener("click", () =&amp;gt; {
  let hexColorName = "#";
  for (let i = 0; i &amp;lt; 6; i++) {
    hexColorName += hexColorCode[getRandomArray()];
  }
  pickColor.style.color = hexColorName;
  pickColor.textContent = hexColorName;
  mainSection.style.backgroundColor = hexColorName;
});

const getRandomArray = () =&amp;gt; {
  return Math.floor(Math.random() * hexColorCode.length);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to call an API with fetch()</title>
      <dc:creator>Graham Fleming</dc:creator>
      <pubDate>Sat, 20 Aug 2022 18:22:34 +0000</pubDate>
      <link>https://dev.to/grahamfleming/how-to-call-an-api-with-fetch-nk6</link>
      <guid>https://dev.to/grahamfleming/how-to-call-an-api-with-fetch-nk6</guid>
      <description>&lt;p&gt;The Fetch API provides an interface for fetching resources using the Request and Response objects, allowing them to be used anywhere that might require you to generate a response programmatically. For making a request and fetching a resource, use the fetch() method. &lt;/p&gt;

&lt;p&gt;First, we would need to define that we are using the fetch() method and pass in the URL as a parameter.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetch("YOUR_URL")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the URL is passed in, the .then() method will give you the ability to work with the data object that is returned. Use the data response to work with the data that is returned from the call.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    .then(response =&amp;gt; {
        // handle the response
        console.log(data);
    })
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the case of errors, using the .catch() method we are able to see the output in our console, and handle any errors that are incoming during the fetch() call.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    .catch(error =&amp;gt; {
        // handle the error
        console.log(error );
    });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the basics of calling an API and dealing with the data response you can use this information to expand on the different types of data that you can work with, adding more functionality and automation to your applications.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetch("YOUR_URL")
    .then(response =&amp;gt; {
        // handle the response
        console.log(data);
    })
    .catch(error =&amp;gt; {
        // handle the error
        console.log(error );
    });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
      <category>api</category>
    </item>
    <item>
      <title>NVIDIA Unveils Next-Gen Automotive DRIVE Hyperion 9 And A New DRIVE Map Platform</title>
      <dc:creator>Graham Fleming</dc:creator>
      <pubDate>Thu, 14 Apr 2022 19:49:17 +0000</pubDate>
      <link>https://dev.to/grahamfleming/nvidia-unveils-next-gen-automotive-drive-hyperion-9-and-a-new-drive-map-platform-3b86</link>
      <guid>https://dev.to/grahamfleming/nvidia-unveils-next-gen-automotive-drive-hyperion-9-and-a-new-drive-map-platform-3b86</guid>
      <description>&lt;p&gt;At this week's GTC conference, NVIDIA announced the commencement of manufacturing of its NVIDIA DRIVE Orin autonomous car computer, highlighted new automakers using the NVIDIA DRIVE platform, and revealed the next version of its NVIDIA DRIVE Hyperion architecture.&lt;/p&gt;

&lt;p&gt;According to NVIDIA, the DRIVE Orin system-on-a-chip has been used by more than 25 car manufacturers (SoC). They'll start introducing software-defined automobiles this year, based on the centralised AI computing platform.&lt;/p&gt;

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

&lt;p&gt;BYD and Lucid Group revealed at GTC that their next-generation fleets will use NVIDIA DRIVE. Beginning in early 2023, BYD will begin selling next-generation NEVs based on the DRIVE Hyperion software-defined platform. DRIVE Orin will be used by these fleets to provide intelligent driving, parking, and other features.&lt;/p&gt;

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

&lt;p&gt;NVIDIA DRIVE is at the heart of Lucid's DreamDrive Pro sophisticated driver-assistance technology. The NVIDIA centralised computation architecture is incorporated with every Lucid Air sedans' ADAS systems. According to the business, DreamDrive Pro is built to develop in capabilities with over-the-air software upgrades and future-ready technology already installed in the car.&lt;/p&gt;

&lt;p&gt;NEV companies like as NIO, Li Auto, XPeng, SAIC's IM Motors and R Auto Brands, JiDU, Human Horizons, VinFast, WM Motor, and others are creating software-defined fleets on DRIVE, in addition to BYD and Lucid.&lt;/p&gt;

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

&lt;p&gt;Huang also unveiled the next-generation of the DRIVE Hyperion architecture, which will be based on the Atlan computer and will begin shipping in 2026, during his GTC speech. The next-generation platform, according to NVIDIA, will improve sensor data processing performance and expand the operational areas of complete self-driving vehicles. The sensor suite on the DRIVE Hyperion 9 will have 14 cameras, nine radars, three lidars, and 20 ultrasonics.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>robotics</category>
    </item>
  </channel>
</rss>
