<?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: Adarsh Goyal</title>
    <description>The latest articles on DEV Community by Adarsh Goyal (@adarshgoyal).</description>
    <link>https://dev.to/adarshgoyal</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%2F224191%2Fb383d72e-1782-4b7a-8ae0-64e09d7f5a42.png</url>
      <title>DEV Community: Adarsh Goyal</title>
      <link>https://dev.to/adarshgoyal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adarshgoyal"/>
    <language>en</language>
    <item>
      <title>Unlocking the Power of WebAssembly</title>
      <dc:creator>Adarsh Goyal</dc:creator>
      <pubDate>Sun, 10 Mar 2024 06:59:36 +0000</pubDate>
      <link>https://dev.to/adarshgoyal/unlocking-the-power-of-webassembly-22o</link>
      <guid>https://dev.to/adarshgoyal/unlocking-the-power-of-webassembly-22o</guid>
      <description>&lt;p&gt;WebAssembly, often abbreviated as WASM.&lt;/p&gt;

&lt;p&gt;Let's do a brief introduction into major concepts of WebAssembly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;WebAssembly is a compile-targeted language for running bytecode on the web.&lt;/li&gt;
&lt;li&gt;Relative to Javascript, WebAssembly offers predictable performance. It is not inherently &lt;strong&gt;faster&lt;/strong&gt; than Javascript, but it &lt;strong&gt;can be faster than JavaScript&lt;/strong&gt; in the correct use case. Such as &lt;strong&gt;computationally intensive tasks&lt;/strong&gt;, like nested loops or handling large amounts of data. Therefore, &lt;strong&gt;WebAssembly is a complement to JavaScript, and not a replacement&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;WebAssembly is extremely portable. WebAssembly runs on: all major web browsers, V8 runtimes like &lt;a href="https://nodejs.org/en/" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt;, and independent Wasm runtimes like &lt;a href="https://wasmtime.dev/" rel="noopener noreferrer"&gt;Wasmtime&lt;/a&gt;, &lt;a href="https://github.com/bytecodealliance/lucet" rel="noopener noreferrer"&gt;Lucet&lt;/a&gt;, and &lt;a href="https://github.com/wasmerio/wasmer" rel="noopener noreferrer"&gt;Wasmer&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;WebAssembly has Linear Memory, in other words, one big expandable array. And in the context of Javascript, synchronously accessible by Javascript and Wasm.&lt;/li&gt;
&lt;li&gt;WebAssembly can export functions and constants, And in the context of Javascript, synchronously accessible by Javascript and Wasm.&lt;/li&gt;
&lt;li&gt;WebAssembly, in its current MVP, only handles integers and floats. However, tools and libraries exist to make passing high-level data types convenient.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Introduction to WebAssembly:&lt;/strong&gt;
&lt;/h3&gt;

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

&lt;p&gt;WebAssembly is a binary instruction format that serves as a compilation target for programming languages, enabling them to run in web browsers at near-native speeds. &lt;/p&gt;

&lt;p&gt;Unlike JavaScript, which is traditionally used for web development, WebAssembly provides a low-level, efficient alternative that can unlock new possibilities for web applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Understanding the Difference between WASM and JavaScript:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;While JavaScript is a high-level scripting language, WebAssembly operates at a lower level, allowing for more efficient execution and improved performance. &lt;/p&gt;

&lt;p&gt;This key distinction opens up opportunities for developers to leverage existing codebases written in languages like C++, Rust, and AssemblyScript, among others, and seamlessly integrate them into web applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why WASM?
&lt;/h2&gt;

&lt;p&gt;The answer lies in its efficiency, speed, and safety. &lt;/p&gt;

&lt;p&gt;WASM is designed to be a low-level virtual machine that runs at near-native speed. This means we can now run heavy computational tasks directly in our browsers, opening up a world of possibilities for web-based applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://wasmbyexample.dev/example-redirect?exampleName=hello-world" rel="noopener noreferrer"&gt;Hello World&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wasmbyexample.dev/examples/webassembly-linear-memory/webassembly-linear-memory.assemblyscript.en-us.html" rel="noopener noreferrer"&gt;Linear memory&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wasmbyexample.dev/examples/reading-and-writing-graphics/reading-and-writing-graphics.assemblyscript.en-us.html" rel="noopener noreferrer"&gt;Graphics&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Latest Trends in WASM
&lt;/h2&gt;

&lt;p&gt;In the recent years, WASM has gained significant traction. Let's look at some of the latest trends:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;WASI&lt;/strong&gt;: The WebAssembly System Interface (WASI) is a promising trend. It's a modular system interface for WebAssembly aiming to provide a wide range of system call capabilities, increasing the usefulness of WASM.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;WASM outside the browser&lt;/strong&gt;: While initially designed for web browsers, WASM is now being used outside the browser environment too. It's being utilized in edge computing, serverless computing, and more.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Language support&lt;/strong&gt;: More and more programming languages are adding support for compiling to WASM. This is making it even more accessible and widespread.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  WASM + AI
&lt;/h2&gt;

&lt;p&gt;While it was primarily designed for web applications, it has been increasingly used outside of the browser environment, including in machine learning applications.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;TensorFlow.js:&lt;/strong&gt; TensorFlow.js is a library for training and deploying machine learning models in JavaScript environments, including web browsers. It uses WebAssembly to accelerate computations, especially for operations like matrix multiplications, which are fundamental to many machine learning algorithms.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ONNX.js:&lt;/strong&gt; Open Neural Network Exchange (ONNX) is an open-source format for representing deep learning models. ONNX.js is a JavaScript library that allows developers to run ONNX models in the browser and on Node.js. It leverages WebAssembly to optimize performance, making it suitable for running complex machine learning models in resource-constrained environments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hugging Face Transformers:&lt;/strong&gt; Hugging Face provides a library for natural language processing (NLP) tasks called Transformers. They offer a JavaScript version of the library that runs in the browser using WebAssembly. This allows developers to perform tasks such as text generation, sentiment analysis, and question answering directly in web applications without requiring server-side computation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;WebDNN:&lt;/strong&gt; WebDNN is a deep neural network library that uses WebAssembly and WebGL to accelerate inference on web browsers. It provides a framework for converting trained deep learning models into a format that can be efficiently executed in the browser. This allows for the deployment of complex machine learning models directly in web applications without relying on server-side processing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DeepLearn.js:&lt;/strong&gt; DeepLearn.js is a JavaScript library for deep learning that includes support for training and running neural networks in the browser. It uses WebAssembly to optimize performance, enabling real-time inference for applications such as image recognition, object detection, and more.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Challenges for Adoption
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Limited debugging support.&lt;/li&gt;
&lt;li&gt;Increased complexity in development.&lt;/li&gt;
&lt;li&gt;Lack of direct DOM access.&lt;/li&gt;
&lt;li&gt;Security concerns with untrusted code.&lt;/li&gt;
&lt;li&gt;Increased bundle size affecting load times.&lt;/li&gt;
&lt;li&gt;Potential browser compatibility issues.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Refs&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://wasmbyexample.dev/examples/introduction/introduction.all.en-us.html" rel="noopener noreferrer"&gt;https://wasmbyexample.dev/examples/introduction/introduction.all.en-us.html&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.assemblyscript.org/compiler.html#using-the-compiler" rel="noopener noreferrer"&gt;https://www.assemblyscript.org/compiler.html#using-the-compiler&lt;/a&gt;&lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/WebAssembly" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/WebAssembly&lt;/a&gt;&lt;br&gt;
&lt;a href="https://digest.browsertech.com/archive/browsertech-digest-how-modyfi-is-building-with/https://www.modyfi.com/" rel="noopener noreferrer"&gt;https://digest.browsertech.com/archive/browsertech-digest-how-modyfi-is-building-with/https://www.modyfi.com/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webassembly</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>security</category>
    </item>
    <item>
      <title>🚩 The Rise of Feature Toggle Tools and Open Standards 🔒</title>
      <dc:creator>Adarsh Goyal</dc:creator>
      <pubDate>Sun, 30 Jul 2023 11:37:27 +0000</pubDate>
      <link>https://dev.to/adarshgoyal/the-rise-of-feature-toggle-tools-and-open-standards-1183</link>
      <guid>https://dev.to/adarshgoyal/the-rise-of-feature-toggle-tools-and-open-standards-1183</guid>
      <description>&lt;p&gt;Are you keeping up with the latest trends in software development? If not, you might be missing out on a game-changing practice called "Feature Flagging." 🚀&lt;/p&gt;

&lt;p&gt;Feature flagging, also known as feature toggling, is a development technique that allows developers to turn certain features on or off without deploying new code. This approach brings numerous benefits to both developers and businesses, making it a hot topic in the tech industry. Let's explore the reasons behind the rise of Feature Toggle Tools and Open Standards!&lt;/p&gt;

&lt;p&gt;🔧 Increased Flexibility: Feature flagging allows developers to control feature releases, making it easier to test new functionalities in production. By toggling features, teams can roll out updates incrementally, reducing the risk of bugs affecting all users. This flexibility is a game-changer when it comes to delivering stable and reliable software.&lt;/p&gt;

&lt;p&gt;🔄 Continuous Delivery: Embracing feature flags can streamline the continuous delivery process. Gone are the days of long release cycles and disruptive deployments. With feature flagging, you can push code to production more frequently and then gradually enable it for users at your own pace.&lt;/p&gt;

&lt;p&gt;🛡️ A/B Testing Made Easy: Feature flags are a powerful tool for conducting A/B tests and gathering valuable user feedback. By segmenting your audience and exposing different groups to various features, you can quickly assess what resonates best with users, leading to data-driven decision-making.&lt;/p&gt;

&lt;p&gt;🔒 Security and Risk Mitigation: In today's digital landscape, security is paramount. Feature flags can act as a safety net by allowing quick feature rollbacks if a critical bug or vulnerability is discovered. This added layer of protection can save you from potential disasters.&lt;/p&gt;

&lt;p&gt;⚙️ Embracing Open Standards: The growth of feature flagging has led to the development of open standards in this area. Open standards foster collaboration and innovation by enabling different tools to interoperate seamlessly. This creates a vibrant ecosystem where developers can choose the best solutions for their specific needs.&lt;/p&gt;

&lt;p&gt;If you're eager to dive deeper into the world of feature flagging, I recommend checking out this informative website: &lt;a href="http://ff.adarshgoyal.com/" rel="noopener noreferrer"&gt;http://ff.adarshgoyal.com/&lt;/a&gt; 🌐 It's an excellent resource to learn more about feature flags, best practices, and how to implement them effectively.&lt;/p&gt;

&lt;p&gt;Let's stay ahead of the game by embracing #openstandards, #featureflags, and #opensource solutions. Feature flagging is the way of the future, and those who adopt it early will undoubtedly gain a competitive advantage in the ever-evolving tech landscape. Happy coding! 💻🚀&lt;/p&gt;

&lt;h1&gt;
  
  
  softwaredevelopment #techinnovation #agiledevelopment
&lt;/h1&gt;

</description>
      <category>openstandards</category>
      <category>softwareengineering</category>
      <category>development</category>
      <category>featuretoggle</category>
    </item>
    <item>
      <title>CSS Attribute Selectors Cheat Sheet</title>
      <dc:creator>Adarsh Goyal</dc:creator>
      <pubDate>Sun, 23 Oct 2022 11:36:18 +0000</pubDate>
      <link>https://dev.to/adarshgoyal/css-attribute-selectors-cheat-sheet-jh6</link>
      <guid>https://dev.to/adarshgoyal/css-attribute-selectors-cheat-sheet-jh6</guid>
      <description>&lt;h2&gt;
  
  
  CSS [attribute] Selector
&lt;/h2&gt;

&lt;p&gt;Simplest of all the selectors and requires just the attribute name in the parameters. All the elements in the web page that contains this attribute name will be selected to apply the styling.&lt;/p&gt;

&lt;p&gt;The following code performs CSS styling on the “p” elements that have the “lang” attribute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;style&amp;gt;
  p[lang]{
      color: red;
      font-size: 20px;
  }
&amp;lt;/style&amp;gt;
&amp;lt;p lang = “en”&amp;gt;Your Text&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Your Text&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  CSS [Attribute ~= “value”] Selector
&lt;/h2&gt;

&lt;p&gt;CSS [Attribute ~= “value”] can select the element if it includes the word “value” in the attribute specified. For example, the following code looks for the value “shirt” in the attribute “title”.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;style&amp;gt;
    p[title ~= "shirt"]{
      color: red;
      font-size: 20px;
    }
&amp;lt;/style&amp;gt;

&amp;lt;p title="blue shirt"&amp;gt;Your Text&amp;lt;/p&amp;gt;
&amp;lt;p title="red shirt"&amp;gt;Your Text&amp;lt;/p&amp;gt;
&amp;lt;p title="hoodie"&amp;gt;Your Text&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code selects the first two paragraphs since they have a shirt in their title, which is the target attribute.&lt;/p&gt;

&lt;h2&gt;
  
  
  CSS [attribute |= “value”] Selector
&lt;/h2&gt;

&lt;p&gt;CSS[attribute |= “value”] selector selects all those attribute values that start with the word “value”.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; CSS[attribute |= “value”] selector works only when the value is either a single word in the attribute such as only “shirt” or is hyphenated as “shirt-blue”. White space in between will not be selected by the CSS for styling. &lt;/p&gt;

&lt;p&gt;The shortcoming of CSS[attribute |= “value”] is fulfilled by the CSS[attribute ^= “value”] selector.&lt;/p&gt;

&lt;h2&gt;
  
  
  CSS[attribute ^= “value”] Selector
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en" dir="ltr"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset="utf-8"&amp;gt;
    &amp;lt;title&amp;gt;Web Template&amp;lt;/title&amp;gt;
      &amp;lt;style&amp;gt;
      p[title ^= "shirt"]{
        color: red;
        font-size: 20px;
      }
      &amp;lt;/style&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
        &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
    &amp;lt;p title="shirt-blue"&amp;gt;Your Text.&amp;lt;/p&amp;gt;
    &amp;lt;p title = "shirt red"&amp;gt;Your Text.&amp;lt;/p&amp;gt;
    &amp;lt;p title = "hoodie"&amp;gt;Your Text.&amp;lt;/p&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  CSS [attribute *= “value”] Selector
&lt;/h2&gt;

&lt;p&gt;This selector works like the regular expression checker which selects every element with the target attribute having value composed of “value”. The value need not be a whole word. The selector works even if the “value” is a part of the attribute value.&lt;/p&gt;

&lt;p&gt;I hope this CSS selectors cheat sheet helps you ahead in your professional career and if there are any suggestions, feel free to comment them down to help us refine the post for good.&lt;/p&gt;

&lt;p&gt;Thank you for reading!💃🏻&lt;/p&gt;

&lt;p&gt;&lt;a href="https://adarshgoyal.com/" rel="noopener noreferrer"&gt;https://adarshgoyal.com/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://twitter.com/_Adarsh_Goyal_" rel="noopener noreferrer"&gt;twitter&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/adarshg1/" rel="noopener noreferrer"&gt;linkedin&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The cover image of this article is generated using DALL-E.&lt;/p&gt;

</description>
      <category>css</category>
      <category>selectors</category>
      <category>webdev</category>
      <category>html</category>
    </item>
    <item>
      <title>Update your Git version now!</title>
      <dc:creator>Adarsh Goyal</dc:creator>
      <pubDate>Sun, 07 Aug 2022 03:54:00 +0000</pubDate>
      <link>https://dev.to/adarshgoyal/update-your-git-version-now-3nie</link>
      <guid>https://dev.to/adarshgoyal/update-your-git-version-now-3nie</guid>
      <description>&lt;p&gt;Git version 2.37 is here!, update yours and get access to all the updated features and fixes listed in the &lt;a href="https://github.com/git/git/blob/v2.37.0/Documentation/RelNotes/2.37.0.txt" rel="noopener noreferrer"&gt;Release note&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update Git on Windows&lt;/strong&gt;&lt;br&gt;
For versions from 2.14.2 to 2.16.1&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For versions &amp;gt; 2.16.1, update Git with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git update-git-for-windows
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Update Git on Linux&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Update Git on Mac&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew upgrade git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Leave a comment if facing any problem.&lt;br&gt;
or reach me at &lt;a href="https://adarshgoyal.com/" rel="noopener noreferrer"&gt;https://adarshgoyal.com/&lt;/a&gt;&lt;br&gt;
Thank You!&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>productivity</category>
      <category>tooling</category>
    </item>
    <item>
      <title>Sending Client-side Emails using EmailJs in ReactJs App</title>
      <dc:creator>Adarsh Goyal</dc:creator>
      <pubDate>Tue, 19 Jul 2022 11:06:41 +0000</pubDate>
      <link>https://dev.to/adarshgoyal/sending-client-side-emails-using-emailjs-in-reactjs-app-58im</link>
      <guid>https://dev.to/adarshgoyal/sending-client-side-emails-using-emailjs-in-reactjs-app-58im</guid>
      <description>&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Go to &lt;a href="https://www.emailjs.com/" rel="noopener noreferrer"&gt;EmailJs&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a free account (you can send only 200 emails per month in this account) want more emails head to &lt;a href="https://www.emailjs.com/pricing/" rel="noopener noreferrer"&gt;pricing&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a email service&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a email template&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can choose the template_id and service_id you want or can genrate one if needed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Setup a react project and install the module using.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install @emailjs/browser --save
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Import and use it in your project.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import emailjs from "@emailjs/browser"

export const sendEmail = (templateParams) =&amp;gt; {
    emailjs
        .send(
            process.env.REACT_APP_EMAILJS_SERVICE_ID,
            process.env.REACT_APP_EMAILJS_TEMPLATE_ID,
            templateParams,
            process.env.REACT_APP_EMAILJS_PUBLIC_KEY
        )
        .then(
            (result) =&amp;gt; {
                console.log(result.text)
            },
            (error) =&amp;gt; {
                console.log(error.text)
            }
        )
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Add REACT_APP_EMAILJS_SERVICE_ID, REACT_APP_EMAILJS_TEMPLATE_ID, REACT_APP_EMAILJS_PUBLIC_KEY to your env file. (do not forgot to restart the server after adding the variables)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;That's it you are done with sending emails.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can see your logs at &lt;a href="https://dashboard.emailjs.com/admin/events" rel="noopener noreferrer"&gt;events&lt;/a&gt; and email history at &lt;a href="https://dashboard.emailjs.com/admin/history" rel="noopener noreferrer"&gt;history&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Also you can add reCAPTCHA v2 and google analytics while sending the email.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;If you have any query you can leave it in the comment.&lt;/p&gt;

&lt;p&gt;Don't forgot to visit my &lt;a href="http://www.adarshgoyal.com/" rel="noopener noreferrer"&gt;webite&lt;/a&gt; and follow me. Thank you.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>react</category>
      <category>emailjs</category>
      <category>frontend</category>
      <category>javascript</category>
    </item>
    <item>
      <title>what do you do when you are on bench?</title>
      <dc:creator>Adarsh Goyal</dc:creator>
      <pubDate>Thu, 02 Jun 2022 11:32:29 +0000</pubDate>
      <link>https://dev.to/adarshgoyal/what-do-you-do-when-you-are-on-bench-1l9</link>
      <guid>https://dev.to/adarshgoyal/what-do-you-do-when-you-are-on-bench-1l9</guid>
      <description>&lt;p&gt;I really wanted to know what people in MNCS's or startups do when they are not assigned to any projects or learning tasks?&lt;/p&gt;

&lt;p&gt;Things I do :-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read blogs about my favorite programming language&lt;/li&gt;
&lt;li&gt;Understanding about different JOB roles&lt;/li&gt;
&lt;li&gt;Create music&lt;/li&gt;
&lt;li&gt;Exercise more&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>discuss</category>
      <category>beginners</category>
      <category>productivity</category>
      <category>motivation</category>
    </item>
    <item>
      <title>rm command removes the file, really?</title>
      <dc:creator>Adarsh Goyal</dc:creator>
      <pubDate>Mon, 23 May 2022 07:43:31 +0000</pubDate>
      <link>https://dev.to/adarshgoyal/rm-command-removes-the-file-really-451c</link>
      <guid>https://dev.to/adarshgoyal/rm-command-removes-the-file-really-451c</guid>
      <description>&lt;p&gt;Do you really think that just doing rm "your file name" will remove the file completely? if &lt;strong&gt;YES&lt;/strong&gt; you need to read this blog till end.&lt;/p&gt;

&lt;p&gt;just do a&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm --help
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and see the information, you will see a note there like this&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fut2gqdnza23tbz6iweqf.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%2Fut2gqdnza23tbz6iweqf.png" alt="rm information" width="800" height="92"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;this note suggests to use the &lt;strong&gt;shred&lt;/strong&gt; command so do I did&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;shred --help
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2F82kf6i2714tr8p0xxozh.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%2F82kf6i2714tr8p0xxozh.png" alt="shred info" width="795" height="55"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This seems like a good note and I was relaxed that my file will be removed completely now or at least will be harder to recover. and made my mind to use &lt;strong&gt;shred&lt;/strong&gt; instead of &lt;strong&gt;rm&lt;/strong&gt; from now but wait got this &lt;strong&gt;CAUTION&lt;/strong&gt; in the end.&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%2Fwwx9bf0jlhv6cnjoh2pj.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%2Fwwx9bf0jlhv6cnjoh2pj.png" alt="shred cautuion" width="800" height="685"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;at last I red a few blogs but could not find a command which does the JOB, can anyone suggest a better command than these two or a way to remove the file as I have some important credentials file which I need to remove completely ? &lt;/p&gt;

&lt;p&gt;Tell me in your answers &lt;a href="https://stackoverflow.com/questions/72344885/which-linux-shell-command-can-completely-remove-a-file-from-the-system-and-make" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>cli</category>
      <category>shell</category>
      <category>shred</category>
    </item>
    <item>
      <title>Website using Canva in 10 mins</title>
      <dc:creator>Adarsh Goyal</dc:creator>
      <pubDate>Sat, 16 Apr 2022 18:57:55 +0000</pubDate>
      <link>https://dev.to/adarshgoyal/website-using-canva-in-10-mins-450o</link>
      <guid>https://dev.to/adarshgoyal/website-using-canva-in-10-mins-450o</guid>
      <description>&lt;p&gt;You can now create websites like &lt;a href="https://adarshgoyal.my.canva.site/" rel="noopener noreferrer"&gt;Demo 1&lt;/a&gt; &lt;a href="https://adarshgoyal.my.canva.site/2" rel="noopener noreferrer"&gt;Demo 2&lt;/a&gt; within 10 mins so go ahead&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create an account on &lt;strong&gt;&lt;a href="https://www.canva.com/" rel="noopener noreferrer"&gt;canva&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Go to &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Templates &amp;gt; Business &amp;gt; Websites&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffsk4cg2tgs2lmer0cw33.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%2Ffsk4cg2tgs2lmer0cw33.png" alt="canva" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose a template that suits your requirement.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fahm1e4y12vgmuqc0r9to.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%2Fahm1e4y12vgmuqc0r9to.png" alt="canva" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on any template you like and then click on &lt;strong&gt;Customize this template&lt;/strong&gt; button.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj9tbcayl05by98esios9.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%2Fj9tbcayl05by98esios9.png" alt="canva" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can edit the template as you want add links and images etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;At last you can click on &lt;strong&gt;Publish as Website&lt;/strong&gt; button to deploy the website.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm2ryyqzfo4dkd2yudsqa.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%2Fm2ryyqzfo4dkd2yudsqa.png" alt="canva" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can either choose the domain provided by canva or can use yours if you have one.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6u0ecn0sszogyo6ity2w.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%2F6u0ecn0sszogyo6ity2w.png" alt="canva" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You have a ready website in just 10 mins! That's great!&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwrhyvn9rkksvgrf2s45c.gif" 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%2Fwrhyvn9rkksvgrf2s45c.gif" alt="gif" width="480" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Follow me &lt;a href="https://linktr.ee/adarshgoyal" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>website</category>
      <category>webdev</category>
      <category>canva</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to upgrade to React 18</title>
      <dc:creator>Adarsh Goyal</dc:creator>
      <pubDate>Sat, 16 Apr 2022 14:59:31 +0000</pubDate>
      <link>https://dev.to/adarshgoyal/how-to-upgrade-to-react-18-3dhi</link>
      <guid>https://dev.to/adarshgoyal/how-to-upgrade-to-react-18-3dhi</guid>
      <description>&lt;p&gt;With new react version things like concurrent rendering, automatic batching, transitions and suspense on the server are introduced you can use this only after upgrading to react 18. so less go!&lt;/p&gt;

&lt;p&gt;Install React 18 and React DOM from npm or yarn, like this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;npm install react react-dom&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Then, you'll want to use &lt;strong&gt;createRoot&lt;/strong&gt; instead of &lt;strong&gt;render&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In your index.js, update &lt;strong&gt;ReactDOM.render&lt;/strong&gt; to &lt;strong&gt;ReactDOM.createRoot&lt;/strong&gt; to create a root, and render your app using root&lt;/p&gt;

&lt;p&gt;Here's what it would look like in React 17:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { render } from 'react-dom';
import App from 'App';

const container = document.getElementById('app');

render(&amp;lt;App /&amp;gt;, container);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And here's what it looks like in React 18:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { createRoot } from 'react-dom/client';
import App from 'App';
const container = document.getElementById('app');

// create a root
const root = createRoot(container);

//render app to root
root.render(&amp;lt;App /&amp;gt;);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you are now upgraded to React 18! enjoy! &lt;br&gt;
Complete update guide is available &lt;a href="https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sources:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://reactjs.org/blog/2022/03/29/react-v18.html" rel="noopener noreferrer"&gt;https://reactjs.org/blog/2022/03/29/react-v18.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www-freecodecamp-org.cdn.ampproject.org/c/s/www.freecodecamp.org/news/react-18-new-features/amp/" rel="noopener noreferrer"&gt;https://www-freecodecamp-org.cdn.ampproject.org/c/s/www.freecodecamp.org/news/react-18-new-features/amp/&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>webdev</category>
      <category>react</category>
    </item>
    <item>
      <title>Wireless Tech used in IoT and Home Automation</title>
      <dc:creator>Adarsh Goyal</dc:creator>
      <pubDate>Tue, 13 Oct 2020 08:01:07 +0000</pubDate>
      <link>https://dev.to/adarshgoyal/wireless-tech-used-in-iot-and-home-automation-2c3p</link>
      <guid>https://dev.to/adarshgoyal/wireless-tech-used-in-iot-and-home-automation-2c3p</guid>
      <description>&lt;p&gt;&lt;strong&gt;Zigbee&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3tuw1gau7yivffdpfnqc.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%2Fi%2F3tuw1gau7yivffdpfnqc.jpg" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
Zigbee is a wireless technology developed as an open global standard to address the unique needs of low-cost, low-power wireless IoT networks. The Zigbee standard operates on the IEEE 802.15.4 physical radio specification and operates in unlicensed bands including 2.4 GHz, 900 MHz, and 868 MHz.&lt;/p&gt;

&lt;p&gt;Zigbee is primarily used for home automation applications such as smart lighting, smart thermostats, and home energy monitoring. It is also commonly used in industrial automation, smart meters, and security systems&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BLE&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F50u98ibaihwocz0cy2hb.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%2Fi%2F50u98ibaihwocz0cy2hb.png" alt="Alt Text" width="512" height="512"&gt;&lt;/a&gt;&lt;br&gt;
The Bluetooth Low Energy (LE) radio is designed for very low power operation. To enable reliable operation in the 2.4 GHz frequency band, it leverages a robust frequency-hopping spread spectrum approach that transmits data over 40 channels. The Bluetooth LE radio provides developers a tremendous amount of flexibility, including multiple PHY options that support data rates from 125 Kb/s to 2 Mb/s, multiple power levels, from 1mW to 100 mW, as well as multiple security options up to government grade.&lt;/p&gt;

&lt;p&gt;Bluetooth LE also supports multiple network topologies, including point-to-point, broadcast, and mesh networking.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Z-wave&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fo5qf8zd4wcy3faj39v22.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%2Fi%2Fo5qf8zd4wcy3faj39v22.png" alt="Alt Text" width="336" height="150"&gt;&lt;/a&gt;&lt;br&gt;
Z-wave is one of the newest kinds of wireless technology that smart devices use to communicate with each other. You can think of it as being in a similar category as Bluetooth or WiFi, but Z-wave possesses a few unique qualities that translate into major advantages for home automation.&lt;/p&gt;

&lt;p&gt;Z-wave technology creates a wireless mesh network, which is a collection of devices that link up and communicate with each other without wires. With Z-wave technology, devices “mesh” together by sending signals over low-energy radio waves on a dedicated frequency. (Z-wave operates on the 908.42 MHz radiofrequency in the U.S. and Canada, but the exact frequency varies by country.) Every Z-wave device has a tiny built-in signal repeater that sends and receives network information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bluetooth&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fxzc5cfospnzp3h6t3gct.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%2Fi%2Fxzc5cfospnzp3h6t3gct.png" alt="Alt Text" width="310" height="163"&gt;&lt;/a&gt;&lt;br&gt;
Bluetooth is another wireless technology standard (not a piece of plastic you stick in your ear for phone calls). Of course, the two are related, but the wireless connection between your phone and the earpiece is called Bluetooth… not the piece itself. As you can imagine, Bluetooth was developed as a way to exchange data over a short-range (like from your pocket to your shoulder) without the need for wires. That’s why Bluetooth is used for wireless headsets, hands-free calling through your car, and wireless file transfers.&lt;/p&gt;

</description>
      <category>iot</category>
      <category>wireless</category>
      <category>homeautomation</category>
      <category>technology</category>
    </item>
    <item>
      <title>Why array indexing in C++ starts from 0, not 1</title>
      <dc:creator>Adarsh Goyal</dc:creator>
      <pubDate>Tue, 11 Aug 2020 09:44:38 +0000</pubDate>
      <link>https://dev.to/adarshgoyal/why-array-index-in-c-starts-from-0-not-1-119h</link>
      <guid>https://dev.to/adarshgoyal/why-array-index-in-c-starts-from-0-not-1-119h</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ljEleD0q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.educative.io/api/edpresso/shot/5968957287694336/image/4900789106507776" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ljEleD0q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.educative.io/api/edpresso/shot/5968957287694336/image/4900789106507776" width="400" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do you know why the C++ array is indexed from zero and not one?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Suppose we have an Array &lt;strong&gt;A&lt;/strong&gt; where the size of data type is &lt;strong&gt;W&lt;/strong&gt; (2 or 4 bytes for int depends on the compiler) then the logical address of element at i&lt;sup&gt;th&lt;/sup&gt; index is calculated as:-&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Logical Address(A[i]) = Base Address(L0) + ( i - 1 ) * W&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;in this formulae, we have to perform 3 arithmetic operations &lt;strong&gt;+, -,&lt;/strong&gt; and &lt;strong&gt;*&lt;/strong&gt; but when we take the &lt;strong&gt;zero&lt;/strong&gt; as the starting index then the formula becomes:-&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Logical Address(A[i]) = Base Address(L0) + ( i ) * W&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;which have only 2 arithmetic operations &lt;strong&gt;+&lt;/strong&gt; and &lt;strong&gt;*&lt;/strong&gt;&lt;br&gt;
so if the size of an array is &lt;strong&gt;n&lt;/strong&gt; then the formula with starting index one will execute slower due to one extra operation overhead. thus, affecting the time taken by the program for larger values of &lt;strong&gt;n&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The above discussion was for the &lt;strong&gt;1-D&lt;/strong&gt; array but when it comes to &lt;strong&gt;2-D&lt;/strong&gt; or multidimensional arrays the case is even worse, suppose i and j are respectively the ith row and jth column in a 2-D matrix then the address when considered 0 as the first index is given as:-&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Logical Address(A[i][j]) = Base Address(L0) + ( i* n +j ) * W&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;having 4 arithmetic operations, but when taken ONE as the starting index we have&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Logical Address(A[i][j]) = Base Address(L0) + ( (i-1)* n +(j-1)) * W&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;this is having 6 arithmetic operations so it keeps on increasing as the dimension of the array increases too.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q9wfiTsF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.educative.io/api/edpresso/shot/5968957287694336/image/5604476548284416" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q9wfiTsF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.educative.io/api/edpresso/shot/5968957287694336/image/5604476548284416" width="400" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And hence, we use &lt;strong&gt;ZERO&lt;/strong&gt; as the Starting index rather than &lt;strong&gt;ONE&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>array</category>
      <category>compiler</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Eyeblink detection using OpenCV, and Python</title>
      <dc:creator>Adarsh Goyal</dc:creator>
      <pubDate>Tue, 04 Aug 2020 19:03:29 +0000</pubDate>
      <link>https://dev.to/adarshgoyal/eyeblink-detection-using-opencv-and-python-2bj</link>
      <guid>https://dev.to/adarshgoyal/eyeblink-detection-using-opencv-and-python-2bj</guid>
      <description>&lt;p&gt;Complete code can also be found &lt;strong&gt;&lt;a href="https://gist.github.com/Adarshg315/8329abf7c25664f701a158e94f29a49d#file-blink-py" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;To test the following on the command line&lt;/p&gt;

&lt;p&gt;(for live video) ~# python3 detect_blinks.py --shape-predictor shape_predictor_68_face_landmarks.dat &lt;/p&gt;

&lt;p&gt;and&lt;/p&gt;

&lt;p&gt;(for demo video) ~# python3 detect_blinks.py --shape-predictor shape_predictor_68_face_landmarks.dat --video “replace this with demo video file path” &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%2Fxzvucik4nonesmnepa1a.gif" 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%2Fxzvucik4nonesmnepa1a.gif" width="480" height="270"&gt;&lt;/a&gt;&lt;br&gt;
breaking up the &lt;a href="https://gist.github.com/Adarshg315/8329abf7c25664f701a158e94f29a49d#file-blink-py" rel="noopener noreferrer"&gt;above&lt;/a&gt; code below&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Import required libraries&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nykJj2Mb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2ASX5nD8xqmu97-eO5" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nykJj2Mb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2ASX5nD8xqmu97-eO5" width="800" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/jrosebr1/imutils" rel="noopener noreferrer"&gt;imutils&lt;/a&gt; library -FileVideoStream, VideoStream&lt;/p&gt;

&lt;p&gt;&lt;a href="http://dlib.net/" rel="noopener noreferrer"&gt;dlib&lt;/a&gt; —contains an implementation of facial landmark detection&lt;/p&gt;

&lt;p&gt;&lt;a href="https://opencv.org/" rel="noopener noreferrer"&gt;cv2&lt;/a&gt;- OpenCV library&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Function to calculate EAR as per the research paper.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3Oh7QH_l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1264/0%2Ap8A16mrPL6ZK6i8Q" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3Oh7QH_l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1264/0%2Ap8A16mrPL6ZK6i8Q" width="632" height="142"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Qw_cPuP_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2AzDaJrK95AOTmJPaR" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Qw_cPuP_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2AzDaJrK95AOTmJPaR" width="800" height="139"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Passing Command Line Arguments&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tmEKO8i_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2AZ0ecR2TcnMsHJ3ra" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tmEKO8i_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2AZ0ecR2TcnMsHJ3ra" width="800" height="135"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;— shape-predictor:&lt;/strong&gt; This is the path to dlib's pre-trained facial landmark detector.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;— video:&lt;/strong&gt; Optional switch controls the path to an input video file residing on disk.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Important variables to tune the implementation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--we9vA7eh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2A8k3jPJEhr-xeXF42" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--we9vA7eh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2A8k3jPJEhr-xeXF42" width="800" height="158"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;EYE_AR_THRESH&lt;/strong&gt; - If the eye aspect ratio falls below a certain threshold and then rises above the threshold, then we’ll register a “blink”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;EYE_AR_CONSEC_FRAME&lt;/strong&gt; - this value is set to 3 to indicate that three successive frames with an eye aspect ratio less than&lt;br&gt;
EYE_AR_THRESH must happen in order for a blink to be registered.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;COUNTER&lt;/strong&gt; — total number of successive frames that have an eye aspect ratio less than EYE_AR_THRESH&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TOTAL&lt;/strong&gt; — number of blinks that have taken place while the script has been running.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Initialize dlib’s face detector and facial landmark detector&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cb6k1Le1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2ACnfImcOBVC61kY14" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cb6k1Le1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2ACnfImcOBVC61kY14" width="800" height="136"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Start the video streaming thread&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2jOjZnFk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2ASnVuivGPrHF8GDzc" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2jOjZnFk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2ASnVuivGPrHF8GDzc" width="800" height="134"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;FileVideoStream for disk videos and VideoStream for video from the webcam&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Main loop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--b5y3XEWd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2Aw6iV8C6cTxiel7eR" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--b5y3XEWd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2Aw6iV8C6cTxiel7eR" width="800" height="205"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We start looping over frames from our video stream. If we are accessing a video file stream and there are no more frames left in the video, we break from the loop.&lt;/p&gt;

&lt;p&gt;Line 61 reads the frame by resizing it and converting it to grayscale (Lines 62 and 63), then detect faces in the grayscale frame on Line 65 via dlib’s built-in face detector.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Loop over each of the faces in the frame and then apply facial landmark detection to each of them&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fZQpdtfe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2AD2Wio0EeVCAlfKsn" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fZQpdtfe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2AD2Wio0EeVCAlfKsn" width="800" height="224"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. Visualizing the facial landmarks for the eye regions themselves:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NAL3wEDO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2ACHpoJTtMCoL4hWRK" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NAL3wEDO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2ACHpoJTtMCoL4hWRK" width="800" height="112"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. Counting Blinks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DVVWsqPj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2ApIkM1w29cPT4Iylx" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DVVWsqPj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2ApIkM1w29cPT4Iylx" width="800" height="197"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11. Drawing Blinks and EAR on the stream&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--16o6x4_E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2AhlWYgtVjCCDgMAHh" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--16o6x4_E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/0%2AhlWYgtVjCCDgMAHh" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;can someone suggest a better solution using SVM put up in the comment please&lt;/p&gt;

</description>
      <category>python</category>
      <category>opencv</category>
      <category>dlib</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
