<?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>Forem: ????</title>
    <description>The latest articles on Forem by ???? (@atordvairn).</description>
    <link>https://forem.com/atordvairn</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%2F787832%2F9d3b900a-d496-472b-9088-c7cf955607ef.jpeg</url>
      <title>Forem: ????</title>
      <link>https://forem.com/atordvairn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/atordvairn"/>
    <language>en</language>
    <item>
      <title>Some secret git tricks that come in handy</title>
      <dc:creator>????</dc:creator>
      <pubDate>Thu, 30 Mar 2023 07:45:30 +0000</pubDate>
      <link>https://forem.com/atordvairn/some-secret-git-tricks-that-come-in-handy-2k8i</link>
      <guid>https://forem.com/atordvairn/some-secret-git-tricks-that-come-in-handy-2k8i</guid>
      <description>&lt;p&gt;here are some secret Git tricks&lt;/p&gt;

&lt;h3&gt;
  
  
  Amending the Last Commit
&lt;/h3&gt;

&lt;p&gt;When you commit changes to a Git repository, you create a new snapshot of your code. Sometimes, you may realize that you forgot to include a file, made a typo in a commit message, or made other small changes that you'd like to include in the last commit. Git allows you to amend the last commit with the --amend flag:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="o"&gt;#&lt;/span&gt; &lt;span class="n"&gt;amend&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="k"&gt;last&lt;/span&gt; &lt;span class="k"&gt;commit&lt;/span&gt; &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;
&lt;span class="n"&gt;git&lt;/span&gt; &lt;span class="k"&gt;commit&lt;/span&gt; &lt;span class="c1"&gt;--amend -m "New message"&lt;/span&gt;

&lt;span class="o"&gt;#&lt;/span&gt; &lt;span class="n"&gt;amend&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="k"&gt;last&lt;/span&gt; &lt;span class="k"&gt;commit&lt;/span&gt; &lt;span class="k"&gt;without&lt;/span&gt; &lt;span class="n"&gt;changing&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;
&lt;span class="n"&gt;git&lt;/span&gt; &lt;span class="k"&gt;commit&lt;/span&gt; &lt;span class="c1"&gt;--amend --no-edit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Reflog
&lt;/h3&gt;

&lt;p&gt;Git keeps track of all the changes you make to your repository, including commits, merges, and other operations. The reflog is a log of all the changes to the Git repository, including all the commits, branch changes, and other operations. You can use the reflog to recover lost commits, reset to a previous state, or undo a rebase.&lt;/p&gt;

&lt;p&gt;To view the reflog, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight perl"&gt;&lt;code&gt;&lt;span class="c1"&gt;# view the reflog&lt;/span&gt;
&lt;span class="nv"&gt;git&lt;/span&gt; &lt;span class="nv"&gt;reflog&lt;/span&gt;

&lt;span class="c1"&gt;# reset to a previous state using the reflog&lt;/span&gt;
&lt;span class="nv"&gt;git&lt;/span&gt; &lt;span class="k"&gt;reset&lt;/span&gt; &lt;span class="nv"&gt;HEAD@&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;N&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Interactive Rebase
&lt;/h3&gt;

&lt;p&gt;Interactive rebase is a powerful tool that allows you to edit, reorder, or delete commits before merging them into the main branch. This is especially useful when you're working on a feature branch and want to clean up the commit history before merging it into the main branch.&lt;/p&gt;

&lt;p&gt;To start an interactive rebase, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="o"&gt;#&lt;/span&gt; &lt;span class="k"&gt;start&lt;/span&gt; &lt;span class="n"&gt;an&lt;/span&gt; &lt;span class="n"&gt;interactive&lt;/span&gt; &lt;span class="n"&gt;rebase&lt;/span&gt;
&lt;span class="n"&gt;git&lt;/span&gt; &lt;span class="n"&gt;rebase&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="n"&gt;HEAD&lt;/span&gt;&lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;

&lt;span class="o"&gt;#&lt;/span&gt; &lt;span class="n"&gt;edit&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="k"&gt;commit&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;rebase&lt;/span&gt;
&lt;span class="n"&gt;pick&lt;/span&gt; &lt;span class="mi"&gt;1234567&lt;/span&gt; &lt;span class="k"&gt;Old&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;
&lt;span class="n"&gt;reword&lt;/span&gt; &lt;span class="mi"&gt;2345678&lt;/span&gt; &lt;span class="k"&gt;New&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;

&lt;span class="o"&gt;#&lt;/span&gt; &lt;span class="n"&gt;reorder&lt;/span&gt; &lt;span class="n"&gt;commits&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;rebase&lt;/span&gt;
&lt;span class="n"&gt;pick&lt;/span&gt; &lt;span class="mi"&gt;1234567&lt;/span&gt; &lt;span class="k"&gt;First&lt;/span&gt; &lt;span class="k"&gt;commit&lt;/span&gt;
&lt;span class="n"&gt;pick&lt;/span&gt; &lt;span class="mi"&gt;2345678&lt;/span&gt; &lt;span class="k"&gt;Second&lt;/span&gt; &lt;span class="k"&gt;commit&lt;/span&gt;
&lt;span class="n"&gt;pick&lt;/span&gt; &lt;span class="mi"&gt;3456789&lt;/span&gt; &lt;span class="n"&gt;Third&lt;/span&gt; &lt;span class="k"&gt;commit&lt;/span&gt;

&lt;span class="o"&gt;#&lt;/span&gt; &lt;span class="k"&gt;delete&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="k"&gt;commit&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;rebase&lt;/span&gt;
&lt;span class="n"&gt;pick&lt;/span&gt; &lt;span class="mi"&gt;1234567&lt;/span&gt; &lt;span class="k"&gt;First&lt;/span&gt; &lt;span class="k"&gt;commit&lt;/span&gt;
&lt;span class="k"&gt;drop&lt;/span&gt; &lt;span class="mi"&gt;2345678&lt;/span&gt; &lt;span class="k"&gt;Second&lt;/span&gt; &lt;span class="k"&gt;commit&lt;/span&gt;
&lt;span class="n"&gt;pick&lt;/span&gt; &lt;span class="mi"&gt;3456789&lt;/span&gt; &lt;span class="n"&gt;Third&lt;/span&gt; &lt;span class="k"&gt;commit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Git Aliases
&lt;/h3&gt;

&lt;p&gt;Git aliases allow you to create custom shortcuts for Git commands. This can save you time and typing, especially for frequently used commands.&lt;/p&gt;

&lt;p&gt;To create a Git alias, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;# create a Git alias for a command&lt;/span&gt;
&lt;span class="n"&gt;git&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="k"&gt;global&lt;/span&gt; &lt;span class="n"&gt;alias&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ci&lt;/span&gt; &lt;span class="n"&gt;commit&lt;/span&gt;

&lt;span class="c1"&gt;# use the alias to commit changes&lt;/span&gt;
&lt;span class="n"&gt;git&lt;/span&gt; &lt;span class="n"&gt;ci&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="s2"&gt;"Commit message"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Git Stash
&lt;/h3&gt;

&lt;p&gt;Git stash allows you to temporarily save changes that you're not ready to commit yet, without creating a new branch or committing the changes.&lt;/p&gt;

&lt;p&gt;To stash changes, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight perl"&gt;&lt;code&gt;&lt;span class="c1"&gt;# stash changes&lt;/span&gt;
&lt;span class="nv"&gt;git&lt;/span&gt; &lt;span class="nv"&gt;stash&lt;/span&gt;

&lt;span class="c1"&gt;# apply the most recent stash&lt;/span&gt;
&lt;span class="nv"&gt;git&lt;/span&gt; &lt;span class="nv"&gt;stash&lt;/span&gt; &lt;span class="nv"&gt;apply&lt;/span&gt;

&lt;span class="c1"&gt;# apply a specific stash&lt;/span&gt;
&lt;span class="nv"&gt;git&lt;/span&gt; &lt;span class="nv"&gt;stash&lt;/span&gt; &lt;span class="nv"&gt;apply&lt;/span&gt; &lt;span class="nv"&gt;stash@&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;N&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# list all stashes&lt;/span&gt;
&lt;span class="nv"&gt;git&lt;/span&gt; &lt;span class="nv"&gt;stash&lt;/span&gt; &lt;span class="nv"&gt;list&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are just a few of the many secret Git tricks that can help streamline your workflow, improve collaboration, and enhance security. With these tips and tricks, you'll be able to take your Git skills to the next level and become a more efficient and effective developer.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>training an image model with tenserflow in nodejs</title>
      <dc:creator>????</dc:creator>
      <pubDate>Thu, 30 Mar 2023 07:32:54 +0000</pubDate>
      <link>https://forem.com/atordvairn/training-an-image-model-with-tenserflow-in-nodejs-18em</link>
      <guid>https://forem.com/atordvairn/training-an-image-model-with-tenserflow-in-nodejs-18em</guid>
      <description>&lt;p&gt;Training an image model with TensorFlow.js in Node.js can be a powerful way to build machine learning applications that can recognize and classify images. In this article, we will walk through the process of training an image model using TensorFlow.js in Node.js.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Install Required Packages
&lt;/h3&gt;

&lt;p&gt;First, we need to install the required packages for our project. We need to install TensorFlow.js, which is the main library we will use to train and run our machine learning models. We will also need the Node.js File System (fs) package to read and write files to our file system.&lt;/p&gt;

&lt;p&gt;To install TensorFlow.js and fs, run the following command in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @tensorflow/tfjs-node fs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Prepare the Training Data
&lt;/h3&gt;

&lt;p&gt;To train a machine learning model to recognize images, we need to provide it with a set of images and their corresponding labels. We can organize our training data into two folders: one for the images and one for the labels.&lt;/p&gt;

&lt;p&gt;In this example, let's assume we have a set of images of cats and dogs, and we want to train a model to recognize whether an input image is of a cat or a dog. We can organize our training data like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;train/
    cats/
        cat1.jpg
        cat2.jpg
        ...
    dogs/
        dog1.jpg
        dog2.jpg
        ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For this example, let's assume that all of our images are the same size and have the same file format (e.g. .jpg). If your images have different sizes or file formats, you may need to preprocess them before training your model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Load the Training Data
&lt;/h3&gt;

&lt;p&gt;Now that we have our training data organized, we need to load it into our Node.js application. We can use the fs package to read the images and labels from our file system.&lt;/p&gt;

&lt;p&gt;Here's an example of how to load the training data into our Node.js application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;tf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@tensorflow/tfjs-node&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;IMAGE_WIDTH&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;224&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;IMAGE_HEIGHT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;224&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;NUM_CLASSES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;catsDir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./train/cats&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dogsDir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./train/dogs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;catsFiles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;readdirSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;catsDir&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dogsFiles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;readdirSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dogsDir&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cats&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;catsFiles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;filePath&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;catsDir&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;buffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;readFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;decodedImage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;decodeImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;resizedImage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resizeBilinear&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;decodedImage&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;IMAGE_WIDTH&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;IMAGE_HEIGHT&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;resizedImage&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dogs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;dogsFiles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;filePath&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;dogsDir&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;buffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;readFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;decodedImage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;decodeImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;resizedImage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resizeBilinear&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;decodedImage&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;IMAGE_WIDTH&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;IMAGE_HEIGHT&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;resizedImage&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;images&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;cats&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;concat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dogs&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;labels&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tensor2d&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;cats&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nx"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;concat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;dogs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nx"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;In this example, we first define some constants for the image width and height, as well as the number of classes (in this case, two: cats and dogs). We then use the fs package to read the image files from our file system, and we use the tf.node.decodeImage() function to decode the images into tensors that TensorFlow.js can use. We resize the images to the specified width and height using tf.image.resizeBilinear().&lt;/p&gt;

&lt;p&gt;Finally, we concatenate the cat and dog images into a single array of tensors, and we create a labels tensor using the tf.tensor2d() function. We use Array.from() to create an array of labels for each image, with a 1 for cats and a 0 for dogs. We then concatenate the cat and dog labels into a single tensor.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Define the Model Architecture
&lt;/h3&gt;

&lt;p&gt;Now that we have our training data loaded, we need to define the architecture of our machine learning model. For image classification tasks, it is common to use a convolutional neural network (CNN).&lt;/p&gt;

&lt;p&gt;Here's an example of how to define a simple CNN in TensorFlow.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sequential&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;layers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;conv2d&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;inputShape&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;IMAGE_WIDTH&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;IMAGE_HEIGHT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;filters&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;kernelSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;activation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;relu&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;}));&lt;/span&gt;

&lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;layers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;maxPooling2d&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;poolSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;strides&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="p"&gt;}));&lt;/span&gt;

&lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;layers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;conv2d&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;filters&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;kernelSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;activation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;relu&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;}));&lt;/span&gt;

&lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;layers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;maxPooling2d&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;poolSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;strides&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="p"&gt;}));&lt;/span&gt;

&lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;layers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flatten&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

&lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;layers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dense&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;units&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;activation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;relu&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;}));&lt;/span&gt;

&lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;layers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dense&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;units&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;NUM_CLASSES&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;activation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;softmax&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;}));&lt;/span&gt;

&lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;compile&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;optimizer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;tf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;train&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;adam&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="na"&gt;loss&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;categoricalCrossentropy&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;metrics&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;accuracy&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we first create a new sequential model using tf.sequential(). We then add several layers to the model, including two convolutional layers, two max pooling layers, and two dense layers. We use the ReLU activation function for the convolutional layers and the softmax activation function for the output layer.&lt;/p&gt;

&lt;p&gt;We then compile the model using the Adam optimizer, categorical cross-entropy loss function, and accuracy metric.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Train the Model
&lt;/h3&gt;

&lt;p&gt;Now that we have our training data loaded and our model architecture defined, we can train the model using the fit() method in TensorFlow.js.&lt;/p&gt;

&lt;p&gt;Here's an example of how to train the model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;BATCH_SIZE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;NUM_EPOCHS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;images&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;labels&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;batchSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;BATCH_SIZE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;epochs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;NUM_EPOCHS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;shuffle&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we define some constants for the batch size and number of epochs, and we call the fit() method on our model, passing in our images and labels tensors. We also specify the batch size, number of epochs, and shuffle option.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 6: Save the Model
&lt;/h3&gt;

&lt;p&gt;After training the model, we can save it to our file system for later use. We can use the save() method in TensorFlow.js to save the model as a set of JSON and binary files.&lt;/p&gt;

&lt;p&gt;Here's an example of how to save the model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MODEL_DIR&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./model&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;save&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`file://&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;MODEL_DIR&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we define a constant for the directory where we want to save the model, and we call the save() method on our model, passing in the file path to the directory.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;In this article, we walked through the process of training an image model using TensorFlow.js in Node.js. We learned how to load the training data from our file system, define the architecture of our machine learning model, train the model, and save it to our file system for later use.&lt;/p&gt;

&lt;p&gt;With this knowledge, you can start building your own machine learning applications that can recognize and classify images. Happy coding!&lt;/p&gt;

</description>
      <category>tensorflow</category>
      <category>node</category>
      <category>javascript</category>
      <category>ai</category>
    </item>
    <item>
      <title>it's is gonna change how you code</title>
      <dc:creator>????</dc:creator>
      <pubDate>Thu, 30 Mar 2023 07:11:59 +0000</pubDate>
      <link>https://forem.com/atordvairn/its-is-gonna-change-how-you-code-1j3e</link>
      <guid>https://forem.com/atordvairn/its-is-gonna-change-how-you-code-1j3e</guid>
      <description>&lt;p&gt;AI has been changing the way developers work in recent years. With advancements in machine learning, natural language processing, and other AI technologies, developers are now able to build smarter, more sophisticated applications in less time than ever before. In this article, we’ll take a look at some of the ways AI is changing the way developers work.&lt;/p&gt;

&lt;h3&gt;
  
  
  Automating Repetitive Tasks
&lt;/h3&gt;

&lt;p&gt;One of the biggest benefits of AI for developers is the ability to automate repetitive tasks. This can include everything from generating code snippets to testing and debugging. By automating these tasks, developers can save time and focus on more complex tasks that require human intervention.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enhancing Collaboration
&lt;/h3&gt;

&lt;p&gt;AI tools are also enhancing collaboration between developers. By using machine learning algorithms, developers can work together more effectively by sharing code, collaborating on projects, and even identifying potential issues before they arise. This can lead to faster development times, better code quality, and improved collaboration across teams.&lt;/p&gt;

&lt;h3&gt;
  
  
  Improving Code Quality
&lt;/h3&gt;

&lt;p&gt;AI can also be used to improve code quality. For example, natural language processing algorithms can be used to analyze code and identify potential issues. This can help developers identify errors and bugs in their code before they become a problem. Additionally, AI-powered code generators can be used to create code that is more efficient and optimized for performance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating Smarter Applications
&lt;/h3&gt;

&lt;p&gt;AI is also changing the way developers create applications. By incorporating machine learning algorithms, developers can build applications that are smarter and more intuitive. For example, AI-powered chatbots can understand natural language and respond to user queries in real time. Similarly, image recognition algorithms can be used to build applications that can identify objects in images and video.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enabling Predictive Analytics
&lt;/h3&gt;

&lt;p&gt;Finally, AI is enabling developers to use predictive analytics to make better decisions. By analyzing large amounts of data using machine learning algorithms, developers can identify patterns and trends that may not be apparent to humans. This can help them make more informed decisions about everything from product development to marketing strategies.&lt;/p&gt;

&lt;h3&gt;
  
  
  Facilitating Faster Development Cycles
&lt;/h3&gt;

&lt;p&gt;Another major benefit of AI for developers is the ability to facilitate faster development cycles. With AI-powered tools, developers can quickly and easily generate code, test applications, and identify potential issues. This can help them develop applications more quickly and get them to market faster.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enabling Personalization
&lt;/h3&gt;

&lt;p&gt;AI is also enabling developers to create more personalized applications. By incorporating machine learning algorithms, developers can build applications that can understand user behavior and preferences. This can help them tailor the user experience to the individual, improving user engagement and satisfaction.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enhancing Security
&lt;/h3&gt;

&lt;p&gt;AI can also be used to enhance application security. For example, machine learning algorithms can be used to identify potential security threats and vulnerabilities. This can help developers create more secure applications and prevent data breaches.&lt;/p&gt;

&lt;h3&gt;
  
  
  Making Development More Accessible
&lt;/h3&gt;

&lt;p&gt;AI-powered tools are also making development more accessible to a wider range of individuals. With low-code and no-code development platforms, individuals with little to no programming experience can create applications quickly and easily. This can help democratize the development process and make it accessible to more people.&lt;/p&gt;

&lt;h3&gt;
  
  
  Driving Innovation
&lt;/h3&gt;

&lt;p&gt;Finally, AI is driving innovation in the development world. With new AI-powered tools and technologies emerging all the time, developers can push the boundaries of what’s possible. This can lead to new and innovative applications that solve complex problems and improve people’s lives.&lt;/p&gt;

&lt;p&gt;In conclusion, AI is transforming the way developers work in a multitude of ways. From automating repetitive tasks to enabling personalization, enhancing security, and driving innovation, AI is changing the development landscape in fundamental ways. As AI technology continues to evolve, we can expect to see even more ways that it will transform the development process and help developers build smarter, more sophisticated applications.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>programming</category>
    </item>
    <item>
      <title>this post was not written on dev.to</title>
      <dc:creator>????</dc:creator>
      <pubDate>Tue, 07 Jun 2022 15:20:48 +0000</pubDate>
      <link>https://forem.com/atordvairn/this-post-was-not-written-on-devto-2e71</link>
      <guid>https://forem.com/atordvairn/this-post-was-not-written-on-devto-2e71</guid>
      <description>&lt;p&gt;rather used the api from &lt;a href="https://dev--to.vercel.app/write"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;:))&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>devto</category>
      <category>api</category>
    </item>
    <item>
      <title>tryna make dev.to, with dev.to</title>
      <dc:creator>????</dc:creator>
      <pubDate>Fri, 03 Jun 2022 12:32:48 +0000</pubDate>
      <link>https://forem.com/atordvairn/tryna-make-devto-with-devto-5cc6</link>
      <guid>https://forem.com/atordvairn/tryna-make-devto-with-devto-5cc6</guid>
      <description>&lt;p&gt;so i came across the dev.to api&lt;/p&gt;

&lt;p&gt;and i thought it might be fun to make dev.to like website which, basically, takes articles from the dev.to api...&lt;/p&gt;

&lt;p&gt;the api: &lt;a href="https://developers.forem.com/api"&gt;https://developers.forem.com/api&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;i used svelte spa(single page application) to achieve the task since its is minimal and takes a ton of load out.&lt;/p&gt;

&lt;p&gt;the application can be used to view posts(ofc), user profiles and user posts, see posts by tags and post comments.&lt;/p&gt;

&lt;p&gt;here's the web app: &lt;a href="https://dev--to.vercel.app/"&gt;https://dev--to.vercel.app/&lt;/a&gt;&lt;br&gt;
here's the repo: &lt;a href="https://github.com/atordvairn/dev--to"&gt;atordvairn/dev--to&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;that's it. have a nice day&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>svelte</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Deploying A Next.js App On Vercel</title>
      <dc:creator>????</dc:creator>
      <pubDate>Wed, 12 Jan 2022 14:25:17 +0000</pubDate>
      <link>https://forem.com/atordvairn/deploying-a-nextjs-app-on-vercel-503f</link>
      <guid>https://forem.com/atordvairn/deploying-a-nextjs-app-on-vercel-503f</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CLL6vP00--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://assets.vercel.com/image/upload/q_auto/front/assets/design/white-nextjs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CLL6vP00--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://assets.vercel.com/image/upload/q_auto/front/assets/design/white-nextjs.png" alt="next.js logo" width="800" height="457"&gt;&lt;/a&gt;&lt;br&gt;
vercel is the best platform to deploy and test your next.js application. Let's see how you can deploy there for free.&lt;/p&gt;

&lt;p&gt;for this, you'll need to have one account:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://vercel.com/"&gt;vercel&lt;/a&gt; (ofc)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;first of all, make a git repository with a next.js project&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-next-app
git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Now install vercel globally:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i &lt;span class="nt"&gt;-g&lt;/span&gt; vercel
&lt;span class="c"&gt;# or&lt;/span&gt;
yarn add &lt;span class="nt"&gt;-g&lt;/span&gt; vercel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  deploy !
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vercel
? Set up and deploy “~/web/my-new-project”? &lt;span class="o"&gt;[&lt;/span&gt;Y/n] y
? Which scope &lt;span class="k"&gt;do &lt;/span&gt;you want to deploy to? My Awesome Team
? Link to existing project? &lt;span class="o"&gt;[&lt;/span&gt;y/N] n
? What’s your project’s name? my-new-project
? In which directory is your code located? my-new-project/
Auto-detected project settings &lt;span class="o"&gt;(&lt;/span&gt;Next.js&lt;span class="o"&gt;)&lt;/span&gt;:
- Build Command: &lt;span class="sb"&gt;`&lt;/span&gt;next build&lt;span class="sb"&gt;`&lt;/span&gt; or &lt;span class="sb"&gt;`&lt;/span&gt;build&lt;span class="sb"&gt;`&lt;/span&gt; from &lt;span class="sb"&gt;`&lt;/span&gt;package.json&lt;span class="sb"&gt;`&lt;/span&gt;
- Output Directory: Next.js default
- Development Command: next dev &lt;span class="nt"&gt;--port&lt;/span&gt; &lt;span class="nv"&gt;$PORT&lt;/span&gt;
? Want to override the settings? &lt;span class="o"&gt;[&lt;/span&gt;y/N]


&lt;span class="c"&gt;# and for production&lt;/span&gt;
vercel &lt;span class="nt"&gt;--prod&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  read more &lt;a href="https://atordvairn.js.cool/deploying-a-next.js-app-on-vercel"&gt;here&lt;/a&gt;
&lt;/h3&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>react</category>
    </item>
    <item>
      <title>Font Awesome- Explained</title>
      <dc:creator>????</dc:creator>
      <pubDate>Fri, 07 Jan 2022 16:03:04 +0000</pubDate>
      <link>https://forem.com/atordvairn/font-awesome-explained-4gff</link>
      <guid>https://forem.com/atordvairn/font-awesome-explained-4gff</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fencrypted-tbn0.gstatic.com%2Fimages%3Fq%3Dtbn%3AANd9GcTg7UNPCpx9qWKcyluwEgSwfMB7uvgXw1Ydaw%26usqp%3DCAU" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fencrypted-tbn0.gstatic.com%2Fimages%3Fq%3Dtbn%3AANd9GcTg7UNPCpx9qWKcyluwEgSwfMB7uvgXw1Ydaw%26usqp%3DCAU" alt="font awesome"&gt;&lt;/a&gt;&lt;br&gt;
user experience is null without icons.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In computing, an icon is a pictogram or ideogram displayed on a computer screen in order to help the user navigate a computer system. The icon itself is a quickly comprehensible symbol of a software tool, function, or a data file, accessible on the system and is more like a traffic sign than a detailed illustration of the actual entity it represents.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Icons are indicators about what the button, command or function or action actually does and helps in faster understanding of the interference. This, it's really important to know the correct icon for the specified place.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://fontawesome.com/" rel="noopener noreferrer"&gt;font awesome&lt;/a&gt; is the amazing javascript Library for importing numerus fonts into your webpage. it's Incredible.&lt;br&gt;
Let's dive right in it:&lt;/p&gt;
&lt;h3&gt;
  
  
  installation
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://kit.fontawesome.com/85b07c1155.js"&lt;/span&gt; &lt;span class="na"&gt;crossorigin=&lt;/span&gt;&lt;span class="s"&gt;"anonymous"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The import might seem something like this if you have seen the link at the site.&lt;/p&gt;
&lt;h3&gt;
  
  
  usage
&lt;/h3&gt;

&lt;p&gt;Here's the interesting part.&lt;br&gt;
&lt;a href="https://fontawesome.com/" rel="noopener noreferrer"&gt;font awesome&lt;/a&gt; has four tones:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;solid&lt;/li&gt;
&lt;li&gt;regular (some are accessible to free users)&lt;/li&gt;
&lt;li&gt;light (pro)&lt;/li&gt;
&lt;li&gt;dual (pro)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fencrypted-tbn0.gstatic.com%2Fimages%3Fq%3Dtbn%3AANd9GcQjO1Ek13SKgWvBgz9qdmniLmuJvmzQBoZtAw%26usqp%3DCAU" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fencrypted-tbn0.gstatic.com%2Fimages%3Fq%3Dtbn%3AANd9GcQjO1Ek13SKgWvBgz9qdmniLmuJvmzQBoZtAw%26usqp%3DCAU" alt="font awesome shades"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;each one has a different class in the html tag (generally &lt;code&gt;&amp;lt;i&amp;gt;&lt;/code&gt; is chosen)&lt;/p&gt;

&lt;p&gt;So it goes like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;i&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"fas fa-rocket"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/i&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- fas = font awesome solid --&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- fa = prefix --&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- rocket = name --&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This one was for the solid one, now see the one with dual tone&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;i&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"fad fa-rocket"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/i&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- fad = font awesome dual --&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- fa = prefix --&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- rocket = name --&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See how only one class changes when you switch tones.&lt;/p&gt;

&lt;p&gt;so you don't need to open &lt;a href="https://fontawesome.com/" rel="noopener noreferrer"&gt;font awesome&lt;/a&gt; site evertime if you know the logic :))&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fc.tenor.com%2FQaGZ50VlEPEAAAAC%2Fthink-about-it-use-your-brain.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fc.tenor.com%2FQaGZ50VlEPEAAAAC%2Fthink-about-it-use-your-brain.gif" alt="think about it"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  wrapping up
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://fontawesome.com/" rel="noopener noreferrer"&gt;font awesome&lt;/a&gt; is really awesome for any site.&lt;/p&gt;

&lt;p&gt;Fonts should be nice to see and you should respect accessibility practices though.&lt;/p&gt;

&lt;h2&gt;
  
  
  originally published &lt;a href="https://atordvairn.netlify.app/font-awesome-explained" rel="noopener noreferrer"&gt;here&lt;/a&gt; at my blog
&lt;/h2&gt;

&lt;p&gt;Make sure you're subscribed to &lt;a href="https://www.getrevue.co/profile/atordvairn" rel="noopener noreferrer"&gt;the high dose javascript newsletter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;of course I can't &lt;em&gt;make&lt;/em&gt; you, but it take me a considerable amount of time to write these..&lt;/p&gt;

&lt;p&gt;tweet this if you like it.&lt;br&gt;
thanks!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Android.js - build android apps from nodejs</title>
      <dc:creator>????</dc:creator>
      <pubDate>Fri, 07 Jan 2022 15:10:02 +0000</pubDate>
      <link>https://forem.com/atordvairn/androidjs-build-android-apps-from-nodejs-1056</link>
      <guid>https://forem.com/atordvairn/androidjs-build-android-apps-from-nodejs-1056</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fencrypted-tbn0.gstatic.com%2Fimages%3Fq%3Dtbn%3AANd9GcR0Hvu9K0WdyyIblGyuYVe0hGtG4fRK9g4lIQ%26usqp%3DCAU" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fencrypted-tbn0.gstatic.com%2Fimages%3Fq%3Dtbn%3AANd9GcR0Hvu9K0WdyyIblGyuYVe0hGtG4fRK9g4lIQ%26usqp%3DCAU" alt="android.js"&gt;&lt;/a&gt;&lt;br&gt;
If You Can Build A Website, You Can Build An Android App!&lt;br&gt;
Android.js simple takes your node.js website and puts it into a WebView.&lt;/p&gt;

&lt;p&gt;Yeah, i know that's a lot of disadvantages there but it also provides different APIs for you to interact with.&lt;/p&gt;

&lt;p&gt;an android.js application isn't only a WebView like a front end of a site, it can also interact with the backend and interact with files and much more!&lt;/p&gt;

&lt;h3&gt;
  
  
  installation
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fc.tenor.com%2F0JFK3s1Xr8IAAAAC%2Floading-downloading.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fc.tenor.com%2F0JFK3s1Xr8IAAAAC%2Floading-downloading.gif" alt="install it"&gt;&lt;/a&gt;&lt;br&gt;
To install &lt;a href="https://android-js.github.io/" rel="noopener noreferrer"&gt;Android JS&lt;/a&gt; binaries, use npm.&lt;/p&gt;

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


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

&lt;/div&gt;

&lt;p&gt;Install &lt;a href="https://android-js.github.io/" rel="noopener noreferrer"&gt;Android JS&lt;/a&gt; project generator and builder&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
 bash
npm install -g androidjs-builder


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

&lt;/div&gt;
&lt;h3&gt;
  
  
  initialize
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
 bash
mkdir AndroidApp
cd AndroidApp
androidjs g
npm install


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

&lt;/div&gt;

&lt;p&gt;it will generate a sample project inside &lt;code&gt;AndroidApp&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;Which will look like:&lt;/p&gt;

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

AndroidApp
    |__ assets
    |       |__ ipc, css, js
    |
    |__ views
    |       |__ index.html
    |
    |__ main.js
    |__ package.json


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

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;main.js&lt;/code&gt; is the main file or we can say it is back process of your app which execute all the code written in node, so you have to write all the node js code inside main.js&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;index.html&lt;/code&gt; is the first view which is render by app initially&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;package.json&lt;/code&gt; to keep track of all your node packages&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;assets&lt;/code&gt; to store all assets of your app&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  time to build
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Farcheyes.com%2Fwp-content%2Fuploads%2F2016%2F04%2F01_egypt_twitter.gif%3Fssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi2.wp.com%2Farcheyes.com%2Fwp-content%2Fuploads%2F2016%2F04%2F01_egypt_twitter.gif%3Fssl%3D1" alt="let's go building"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
 bash
cd AndroidApp
androidjs b


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

&lt;/div&gt;

&lt;p&gt;it will generate apk file inside dist folder&lt;/p&gt;

&lt;p&gt;if this &lt;code&gt;build&lt;/code&gt; command fails or generated any error, try to build with &lt;code&gt;force command&lt;/code&gt;&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&lt;br&gt;
 bash&lt;br&gt;
androidjs b -f

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

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Why &lt;em&gt;not&lt;/em&gt; to use it&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;Android.js isn't better than &lt;a href="https://atordvairn.netlify.app/react-native-javascript-is-everywhere" rel="noopener noreferrer"&gt;react-native&lt;/a&gt;&lt;br&gt;
But, at least you can (somewhat) throw your existing code in it and generate an API to work on a device just like android application.&lt;br&gt;
&lt;a href="https://reactnative.dev/" rel="noopener noreferrer"&gt;React native&lt;/a&gt; stays the best way to make Android applications with react (JavaScript).&lt;/p&gt;

&lt;h3&gt;
  
  
  other resources
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://android-js.github.io/docs/" rel="noopener noreferrer"&gt;docs&lt;/a&gt; - documentation for android.js&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/android-js/sample-app" rel="noopener noreferrer"&gt;Sample apps&lt;/a&gt; - some sample apps to go with..&lt;/p&gt;

&lt;h3&gt;
  
  
  conclusion
&lt;/h3&gt;

&lt;p&gt;Android.js is an amazing framework if you don't know react&lt;/p&gt;

&lt;p&gt;But if you know react, react native comes in handy at the first place.&lt;/p&gt;

&lt;h2&gt;
  
  
  originally published &lt;a href="https://atordvairn.netlify.app/android-js-making-android-apps-with-pure-javascript" rel="noopener noreferrer"&gt;here&lt;/a&gt; at my blog
&lt;/h2&gt;

&lt;p&gt;Make sure you're subscribed to &lt;a href="https://www.getrevue.co/profile/atordvairn" rel="noopener noreferrer"&gt;the high dose javascript newsletter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;of course I can't &lt;em&gt;make&lt;/em&gt; you, but it take me a considerable amount of time to write these..&lt;/p&gt;

&lt;p&gt;tweet this if you like it.&lt;br&gt;
thanks!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>react native- JavaScript is everywhere</title>
      <dc:creator>????</dc:creator>
      <pubDate>Fri, 07 Jan 2022 15:05:12 +0000</pubDate>
      <link>https://forem.com/atordvairn/react-native-javascript-is-everywhere-15ie</link>
      <guid>https://forem.com/atordvairn/react-native-javascript-is-everywhere-15ie</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fencrypted-tbn0.gstatic.com%2Fimages%3Fq%3Dtbn%3AANd9GcRVFBkWp7_5N74ZmGP0LHudxWhuN-EBCICxMA%26usqp%3DCAU" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fencrypted-tbn0.gstatic.com%2Fimages%3Fq%3Dtbn%3AANd9GcRVFBkWp7_5N74ZmGP0LHudxWhuN-EBCICxMA%26usqp%3DCAU" alt="react native runs on both iOS and Android as well as windows"&gt;&lt;/a&gt;&lt;br&gt;
Welcome &lt;a href="https://reactnative.dev/" rel="noopener noreferrer"&gt;react native&lt;/a&gt;, now JavaScript runs on Android, Windows and iOS like anywhere!&lt;/p&gt;

&lt;p&gt;Being a JavaScript developer, making mobile apps was just a WebView with our site running.&lt;br&gt;
But now, we have &lt;a href="https://reactnative.dev/" rel="noopener noreferrer"&gt;react native&lt;/a&gt; which takes a but different approach and makes the application feel like a truly native application. It's having components to make android and iOS like UI.&lt;/p&gt;

&lt;p&gt;And the code actually resembles the react code.&lt;br&gt;
That means that you can make native apps with a little knowledge of &lt;a href="https://reactnative.dev/" rel="noopener noreferrer"&gt;react native&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  install
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; create-react-native-app
&lt;span class="c"&gt;# OR&lt;/span&gt;
yarn add &lt;span class="nt"&gt;-g&lt;/span&gt; create-react-native-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  initialize
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;create-react-native-app myReactiveApp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This will install and configure react-native in a directory.&lt;/p&gt;
&lt;h3&gt;
  
  
  the cli!
&lt;/h3&gt;

&lt;p&gt;the cli comes pretty handy in react-native. Install it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; react-native-cli
&lt;span class="c"&gt;# OR&lt;/span&gt;
yarn add &lt;span class="nt"&gt;-g&lt;/span&gt; react-native-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  using the cli
&lt;/h4&gt;

&lt;p&gt;use yarn run to see available commands for your project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  basics
&lt;/h3&gt;

&lt;p&gt;React-native is really easy if you know some react&lt;br&gt;
You can quickly &lt;a href="https://reactnative.dev/docs/tutorial" rel="noopener noreferrer"&gt;learn the basics here&lt;/a&gt; if you have a good knowledge of react.&lt;/p&gt;

&lt;h3&gt;
  
  
  why react native ?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fc.tenor.com%2FfjdrDuVtEkAAAAAM%2Fconfused-look.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fc.tenor.com%2FfjdrDuVtEkAAAAAM%2Fconfused-look.gif" alt="it's good :)"&gt;&lt;/a&gt;&lt;br&gt;
React native comes with a lot of advantages for a JavaScript developer&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;open source&lt;/li&gt;
&lt;li&gt;free&lt;/li&gt;
&lt;li&gt;great community&lt;/li&gt;
&lt;li&gt;easy to learn ( if you know react a lill )&lt;/li&gt;
&lt;li&gt;lots of components!&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  any alternative ?
&lt;/h3&gt;

&lt;p&gt;Yes!, See my next article for intro to android.js which ships your nodejs application to and Android app!&lt;/p&gt;

&lt;h3&gt;
  
  
  wrapping up
&lt;/h3&gt;

&lt;p&gt;Always bet on JavaScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  originally published &lt;a href="https://atordvairn.netlify.app/react-native-javascript-is-everywhere/" rel="noopener noreferrer"&gt;here&lt;/a&gt; at my blog
&lt;/h2&gt;

&lt;p&gt;Make sure you're subscribed to &lt;a href="https://www.getrevue.co/profile/atordvairn" rel="noopener noreferrer"&gt;the high dose javascript newsletter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;of course I can't &lt;em&gt;make&lt;/em&gt; you, but it take me a considerable amount of time to write these..&lt;/p&gt;

&lt;p&gt;tweet this if you like it.&lt;br&gt;
thanks!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>reactnative</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Next.JS - the production ready react on steroids framework</title>
      <dc:creator>????</dc:creator>
      <pubDate>Fri, 07 Jan 2022 14:56:10 +0000</pubDate>
      <link>https://forem.com/atordvairn/nextjs-the-production-ready-react-on-steroids-framework-3mkj</link>
      <guid>https://forem.com/atordvairn/nextjs-the-production-ready-react-on-steroids-framework-3mkj</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fencrypted-tbn0.gstatic.com%2Fimages%3Fq%3Dtbn%3AANd9GcTkdAR-wWzQyu7bNf4GmKqyOwGb5-HqEXuwmg%26usqp%3DCAU" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fencrypted-tbn0.gstatic.com%2Fimages%3Fq%3Dtbn%3AANd9GcTkdAR-wWzQyu7bNf4GmKqyOwGb5-HqEXuwmg%26usqp%3DCAU" alt="nextjs is a react based framework"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="//nextjs.org"&gt;Next JS&lt;/a&gt; is an amazing JavaScript framework made on the existing react framework made by &lt;a href="https://facebook.com/" rel="noopener noreferrer"&gt;Facebook&lt;/a&gt;. Factors that make it amazing or the SEO features. Also &lt;a href="//nextjs.org"&gt;Next JS&lt;/a&gt; as an inbuilt support for API structures which make it even more amazing when working with APIs.&lt;/p&gt;

&lt;p&gt;It has a ton of inbuilt modules which makes development even more amazing text to image module as an instance. It automatically optimises the images as per the weight and height and other factors. The &lt;code&gt;link&lt;/code&gt; module enables no refresh routing which fetches the JavaScript code and renders that instead of redirecting you to another page.&lt;/p&gt;

&lt;p&gt;It's called react on steroids because of all these inbuilt module sentence of features which come along with next.&lt;br&gt;
Other frameworks like &lt;a href="https://blitzjs.com/" rel="noopener noreferrer"&gt;blitz.js&lt;/a&gt; are made on top of next.js, adding more functionalities to the framework. &lt;a href="//nextjs.org"&gt;Next JS&lt;/a&gt; has a support for &lt;a href="https://www.freecodecamp.org/news/what-exactly-is-client-side-rendering-and-hows-it-different-from-server-side-rendering-bd5c786b340d/" rel="noopener noreferrer"&gt;server side rendering&lt;/a&gt; which makes it incredibly faster than react and the content is available to web crawlers too.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://nextjs.org/blog/next-12" rel="noopener noreferrer"&gt;Next v12 is now using rust compiler&lt;/a&gt; and is having 5x faster builds than before!&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fc.tenor.com%2FEnZGimQ0SQ8AAAAC%2Fspeed.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fc.tenor.com%2FEnZGimQ0SQ8AAAAC%2Fspeed.gif" alt="next.ja is fast!"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  installation
&lt;/h3&gt;

&lt;p&gt;To initialise a next.js application, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-next-app@latest
&lt;span class="c"&gt;# or&lt;/span&gt;
yarn create next-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can create a TypeScript project with the --ts, --typescript flag:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-next-app@latest &lt;span class="nt"&gt;--ts&lt;/span&gt;
&lt;span class="c"&gt;# or&lt;/span&gt;
yarn create next-app &lt;span class="nt"&gt;--typescript&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  file systems in next
&lt;/h3&gt;

&lt;p&gt;now see the file structure carefully&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fencrypted-tbn0.gstatic.com%2Fimages%3Fq%3Dtbn%3AANd9GcSN9M_CsJYpZ2OPTbgh14yF7qD63Dt48orTlA%26usqp%3DCAU" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fencrypted-tbn0.gstatic.com%2Fimages%3Fq%3Dtbn%3AANd9GcSN9M_CsJYpZ2OPTbgh14yF7qD63Dt48orTlA%26usqp%3DCAU" alt="file system"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;pages&lt;/code&gt; directory is the entry point of the application as well as the URL structure of your website.&lt;br&gt;
That is, &lt;code&gt;pages/about.js&lt;/code&gt; will be available at &lt;code&gt;[url]/about&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;public&lt;/code&gt; directory will contain your assets and other images for files which are not controlled by next.&lt;br&gt;
You can create as many folders and can also access them.&lt;/p&gt;

&lt;p&gt;Like, making component folder which will contain usable components which you can reuse in different pages without writing same code every time.&lt;/p&gt;

&lt;h3&gt;
  
  
  wrapping up
&lt;/h3&gt;

&lt;p&gt;Next js is an amazing framework for creating beautiful applications with react which perform amazingly in search results and performant on the user's side.&lt;br&gt;
It's evolving into other framework too like &lt;a href="https://blitzjs.com/" rel="noopener noreferrer"&gt;blitz.js&lt;/a&gt; which are having a bit of ruby like approach.&lt;br&gt;
Anyways, next is a must try if you're a react developer!&lt;/p&gt;

&lt;h2&gt;
  
  
  originally published &lt;a href="https://atordvairn.netlify.app/next-js-the-production-ready-javascript-framework" rel="noopener noreferrer"&gt;here&lt;/a&gt; at my blog
&lt;/h2&gt;

&lt;p&gt;Make sure you're subscribed to &lt;a href="https://www.getrevue.co/profile/atordvairn" rel="noopener noreferrer"&gt;the high dose javascript newsletter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;of course I can't &lt;em&gt;make&lt;/em&gt; you, but it take me a considerable amount of time to write these..&lt;/p&gt;

&lt;p&gt;tweet this if you like it.&lt;br&gt;
thanks!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>nextjs</category>
      <category>react</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
