<?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: Loveena Saran</title>
    <description>The latest articles on DEV Community by Loveena Saran (@pretty19).</description>
    <link>https://dev.to/pretty19</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%2F616572%2F3fbd60e8-355d-4659-ba83-52b147dde151.jpg</url>
      <title>DEV Community: Loveena Saran</title>
      <link>https://dev.to/pretty19</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pretty19"/>
    <language>en</language>
    <item>
      <title>Pascal’s Triangle</title>
      <dc:creator>Loveena Saran</dc:creator>
      <pubDate>Mon, 31 Jan 2022 13:42:38 +0000</pubDate>
      <link>https://dev.to/pretty19/pascals-triangle-48km</link>
      <guid>https://dev.to/pretty19/pascals-triangle-48km</guid>
      <description>&lt;p&gt;Deduction made from how the Pascal's triangle is constructed:&lt;/p&gt;

&lt;p&gt;The boxes at the start and end of the list are always set to '1'&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ucJh1NX0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rel86za2i9n4lnql3vy5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ucJh1NX0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rel86za2i9n4lnql3vy5.png" alt="Pascal Triangle" width="758" height="536"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Initially the first 2 levels do not have any adding up of elements and the process of adding starts from the 3rd level &lt;/p&gt;

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

&lt;p&gt;Adding up the previous level answer leads to the new numbers at the center of the triangle&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--J4jIavOg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xv6xi8tr8fpdfxkznlkn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--J4jIavOg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xv6xi8tr8fpdfxkznlkn.png" alt="Pascal Triangle" width="852" height="502"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How to approach this problem? &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We can keep a pointer to here 'i' for each level of the 
triangle&lt;/li&gt;
&lt;li&gt;Also if we notice there are center boxes that grow in triangular pattern. 
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tHeds9iC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rya4in9bq2oku2ukjq4m.jpg" alt="Image description" width="880" height="451"&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Notice when level is '1' we have '0' elements to be added from previous levels. &lt;br&gt;
At level 1 --&amp;gt; 0 elements are formed by adding&lt;br&gt;
At level 2 --&amp;gt; 1 elements are formed by adding&lt;br&gt;
At level 3 --&amp;gt; 2 elements are formed by adding&lt;br&gt;
and so on...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;we can have a 'j' variable that we initialize when we are at 1st level of 'i'.&lt;/li&gt;
&lt;li&gt;Here we are initializing 'j' to be 'zero' and less than 'i'. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;'i' and 'j' values Serve multiple purposes in this problem&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;'i' indicates each level and 'j' indicates the elements formed by adding up previous elements.&lt;/li&gt;
&lt;li&gt;'j' runs at a 1 less than 'i' as it starts from '0' and creates boxes at each level.&lt;/li&gt;
&lt;li&gt;As the answer is stored in List i.e (List of Lists). We can to retrieve the previous level data and add this to form the current value.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   for(int i=1; i&amp;lt;=numRows; i++){
            for(int j=0; j&amp;lt;i; j++){
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;For the first and the last box we want to add '1'
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for(int i=1;i&amp;lt;=numRows;i++){      
    for(int j=0; j&amp;lt;i; j++){
      if(j==0 || j==i-1){  // add '1' to first box and last box
          curr.add(1);  // Add to list curr
               }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-For boxes at the center ranging  from (1:i-1)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for(int i=1;i&amp;lt;=numRows;i++){
           List&amp;lt;Integer&amp;gt; curr = new ArrayList&amp;lt;&amp;gt;();       
           for(int j=0;j&amp;lt;i;j++){
               if(j==0 || j==i-1){
                   curr.add(1);
               }
               else{
curr.add(levels.get(i-1).get(j)+ levels.get(i-1).get(j-1)); // to form new elements by  adding values from previous levels
           }
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dry Run:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nse0Fl-Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h7aueemxx3yu59lt6mrs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nse0Fl-Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h7aueemxx3yu59lt6mrs.png" alt="Pascal Triangle" width="880" height="493"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QrI2YIby--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e6amfv1pn8od3tp9hs74.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QrI2YIby--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e6amfv1pn8od3tp9hs74.PNG" alt="Pascal Triangle" width="880" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Xxy-9q5---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1qvzva04qucjjrtdg5mz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Xxy-9q5---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1qvzva04qucjjrtdg5mz.png" alt="Pascal Triangle" width="880" height="646"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Do like if you found this helpful. This would help me learn and create new articles like this.&lt;br&gt;
Thanks!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>100daysofcode</category>
      <category>java</category>
    </item>
    <item>
      <title>Knights Tour using Backtracking</title>
      <dc:creator>Loveena Saran</dc:creator>
      <pubDate>Tue, 25 Jan 2022 16:31:42 +0000</pubDate>
      <link>https://dev.to/pretty19/knights-tour-using-backtracking-27fg</link>
      <guid>https://dev.to/pretty19/knights-tour-using-backtracking-27fg</guid>
      <description>&lt;p&gt;Let's discuss Knight's Tour&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Motive&lt;/strong&gt; of the problem is to print the various paths that the knight can take in a N*N board &lt;strong&gt;covering all the boxes&lt;/strong&gt; given that we place the knight at a specific row and column.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Constraints&lt;/strong&gt; if we look at a chess board that is of 3*3 size it and place the  knight at position (1R-1C) the knight cannot move in the "L" shaped manner in this board .&lt;/p&gt;

&lt;p&gt;So ideally we want the board to be 5*5 that is the minimum we should expect for our problem to work.&lt;br&gt;
(Note: There are other Algorithms which handle N*M size of pattern but we are sticking to N*N for our problem)&lt;/p&gt;

&lt;p&gt;If we place the Knight at the center (2R-2C) we can say the movements will be as follows:&lt;/p&gt;

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

&lt;p&gt;Our basic requirement is to initiate and put '1' from the first row column that user gives us.&lt;br&gt;
which represents the first step taken by the knight and keep incrementing it till covers all the rows*columns.&lt;/p&gt;

&lt;p&gt;Let's create a function to take the row column with our first step by setting 'move' variable to '1'&lt;/p&gt;

&lt;p&gt;Once we place the knight at a given place we have a choice of placing our knight at the 8 open positions that are &lt;em&gt;valid&lt;/em&gt; according to it's movement.&lt;/p&gt;

&lt;p&gt;And this is when Recursion enters !!✨&lt;br&gt;
&lt;em&gt;Why recursion?&lt;/em&gt;&lt;br&gt;
  we want to give the 2nd step the same 8  possible &lt;em&gt;valid&lt;/em&gt; &lt;br&gt;
  options we gave the 1st step to place the next step of &lt;br&gt;
  the knight. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--E7wCofgH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/olx1t8d9ladofkg40jf4.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--E7wCofgH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/olx1t8d9ladofkg40jf4.PNG" alt="knightsTour" width="661" height="354"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public static void knightsTour(int[][] chess, int r, int c, int move) 
{
        chess[r][c]=move;
        knightsTour(chess,r-2,c+1,move+1);
        knightsTour(chess,r-1,c+2,move+1);
        knightsTour(chess,r+1,c+2,move+1);
        knightsTour(chess,r+2,c+1,move+1);
        knightsTour(chess,r+2,c-1,move+1);
        knightsTour(chess,r+1,c-2,move+1);
        knightsTour(chess,r-1,c-2,move+1);
        knightsTour(chess,r-2,c-1,move+1);


    }

knightsTour(chess,row,col,1);  //function call
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In order to keep the moves valid and inside the N*N board&lt;br&gt;&lt;br&gt;
limits also be careful to not overwrite a previous step we add our conditions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public static void knightsTour(int[][] chess, int r, int c, int move) 
{
  if(r&amp;lt;0 || c&amp;lt;0 || r&amp;gt;=chess.length || c &amp;gt;=chess.length || chess[r][c]&amp;gt;0)
        {
         return;   
        }
  ....[code]
 }  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;As the Recursion call proceeds it is sure to hit a case where the border is less than 0 ,equal/greater to chess length or the path is already set in the box. &lt;/p&gt;

&lt;p&gt;Once it does that particular Recursion Stack Path will return to its the Parent Recursion call.&lt;/p&gt;

&lt;p&gt;So Ideally we went down a given path as far as we could but could not cover all the boxes. So we  backtrack to our previous decision (basically time travel 😅) to the last mistake  that we did and erase it . &lt;br&gt;
to do that we Simply remove the previous step that was added in the parent recursion call and go to the parent parent call (bear with me😂) and look for other steps from our 8-1 options and make a new Recursion call to that step...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wwYmHmVb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sgkjkbury06xzn0mfc3j.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wwYmHmVb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sgkjkbury06xzn0mfc3j.gif" alt="morty" width="480" height="266"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public static void knightsTour(int[][] chess, int r, int c, int move) {

 ...[code]
        knightsTour(chess,r-1,c-2,move+1);
        knightsTour(chess,r-2,c-1,move+1);
        chess[r][c]=0;   &amp;lt;-- this erases our mistakes

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

&lt;/div&gt;



&lt;p&gt;Now we are nearing the end... I can see the light👩‍🚀&lt;br&gt;
We just Print the chessboard as soon as the N*N move is set in the board.&lt;br&gt;
But There is one little tiny thing which is still left..&lt;br&gt;
At the end of the Recursion when our move is 25 for the case (5*5) we have reached our limit and there is no need to run a Recursion call for this case as this will return no possible new steps... and not handling this will &lt;br&gt;
reset the value of that given box to '0' as &lt;code&gt;chess[r][c]=0;&lt;/code&gt; runs after RC call.&lt;/p&gt;

&lt;p&gt;Also Be sure to remove the 25th element after printing the chessboard as we want the chessboard to be reset with empty values for the next possible paths...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public static void knightsTour(int[][] chess, int r, int c, int move) {

        if(r&amp;lt;0 || c&amp;lt;0 || r&amp;gt;=chess.length || c &amp;gt;=chess.length || chess[r][c]&amp;gt;0)
        {
         return;   
        }
      else if(move==chess.length*chess.length){      
            chess[r][c]=move;
            displayBoard(chess);   
/*displayBoard can be a function to iterate over the i*j values of chessboard and print them */
            chess[r][c]=0;
            return;
            }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;THe eND!!&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>java</category>
      <category>programming</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Avatar API support in Appwrite</title>
      <dc:creator>Loveena Saran</dc:creator>
      <pubDate>Wed, 13 Oct 2021 06:46:17 +0000</pubDate>
      <link>https://dev.to/pretty19/avatar-api-support-in-appwrite-fc1</link>
      <guid>https://dev.to/pretty19/avatar-api-support-in-appwrite-fc1</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0R1EkN89--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gf1zxl5z6kyzizjfrkji.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0R1EkN89--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gf1zxl5z6kyzizjfrkji.png" alt="60a11c80-fcf1-11e9-959e-565bc6cba590 (1)" width="880" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Appwrite&lt;/strong&gt; &lt;em&gt;provides an AMAZING solution that offers   YOU an  array  of  REST APIs , tools , Management Console UI for YOUR  core backend needs.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you haven't already try it out for yourself &lt;a href="https://appwrite.io/"&gt;AppWrite&lt;/a&gt; &lt;br&gt;
Go Ahead don't be shy...&lt;br&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hpTo6Vrv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lvtlfw8c1rife1npcz60.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hpTo6Vrv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lvtlfw8c1rife1npcz60.gif" alt="tumblr_3a8b75e6b3c5df176c3f7fe5341e5fbf_d34ad33a_500" width="500" height="281"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;em&gt;Are YOU Looking to make your Service Standout?&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---NfwO3p1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ntpooqlx9u6hmkjdvqx0.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---NfwO3p1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ntpooqlx9u6hmkjdvqx0.gif" alt="fist-pump-yeah" width="220" height="297"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;em&gt;Are YOU Tired of importing multiple packages for Icon support?&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_b3_rNa2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wktqw935tevded6xzz0k.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_b3_rNa2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wktqw935tevded6xzz0k.gif" alt="cumsite" width="220" height="164"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;em&gt;Are YOU Hoping to make your Life a little bit easier?&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7HzD4Chc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/thew449wz7mdxip5fjjk.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7HzD4Chc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/thew449wz7mdxip5fjjk.gif" alt="nod-alright" width="498" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enhance your Appwrite App with Images, Icons, and Avatars...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Adding payment methods logos&lt;/strong&gt; , &lt;strong&gt;fetching the desired country flags&lt;/strong&gt; and &lt;strong&gt;Generating QR codes&lt;/strong&gt; is all that you desire.&lt;/p&gt;

&lt;p&gt;Be it Food Delivery Services ,Language Learning App or a Fintech App these small additions that will make it a lot easier.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uC6_kcxv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tdylwnr02rvqzrpj2cpl.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uC6_kcxv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tdylwnr02rvqzrpj2cpl.gif" alt="4187" width="480" height="356"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  How can you use Appwrite's &lt;a href="https://appwrite.io/docs/client/avatars"&gt;Avatar API&lt;/a&gt; ?
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Create a Service Class to fetch the endpoint. In our case &lt;strong&gt;avatars&lt;/strong&gt;  and create a constructor to access it within the method.
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class AppwriteService {
constructor() {   
appwrite.setEndpoint(Server.endpoint).setProject(Server.project);
    this.avatars= appwrite.avatars;
  }    
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;2.Access your desired method &lt;strong&gt;getCreditCard&lt;/strong&gt; present under Avatar API and pass in the mandatory attributes cardname for the method to work.&lt;br&gt;
&lt;em&gt;Optional Attributes Include: width,height,quality&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; createCreditAvatar =(cardname) =&amp;gt;{
    return this.avatars.getCreditCard(cardname);
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.Call the method Created in your file that you desire to add your avatar. Don't forget to pass the value to the attributes that were Set earlier.&lt;br&gt;
&lt;em&gt;Example: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  let creditcard = appwrite.createCreditAvatar('amex');
  console.log(creditcard);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.In the return section of your Project call the component inside the image tag to view the icon&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   return(
    &amp;lt;div &amp;gt;
      &amp;lt;img src={creditcard} /&amp;gt;
    &amp;lt;/div&amp;gt;
   );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5.And Voilà!! You have your icon displayed on your UI&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2oBRO-GK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/62x48a6z2aj9rdr9cuyp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2oBRO-GK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/62x48a6z2aj9rdr9cuyp.png" alt="image" width="563" height="541"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Few Other Examples To get you started:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;createFlagAvatar =(flagname) =&amp;gt;{
    return this.avatars.getFlag(flagname);
  }
  createQrAvatar =(text,size) =&amp;gt;{
    return this.avatars.getQR(text,size);
  }
&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;let flagname = appwrite.createFlagAvatar('IN');
let  qrcode  = appwrite.createQrAvatar('FinTechApp',100);

console.log(flagname);
console.log(qrcode);
   return(
    &amp;lt;div &amp;gt;
      &amp;lt;img src={flagname} /&amp;gt;
      &amp;lt;br/&amp;gt;
      &amp;lt;img src={qrcode} /&amp;gt;
      &amp;lt;br/&amp;gt;
    &amp;lt;/div&amp;gt;
   );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start Appwriting Away!!! &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cDPQzjwF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b9kx4peldg8cu68zs4tq.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cDPQzjwF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b9kx4peldg8cu68zs4tq.gif" alt="evil-laugh-laugh" width="220" height="182"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Read for any Doubts:&lt;br&gt;
&lt;a href="https://dev.to/noviicee/what-is-appwrite-and-how-to-use-it-efficiently-3o1m"&gt;Getting Started with Appwrite &lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.to/daryllukas/authentication-exploring-appwrite-io-with-react-series-1iec"&gt;Appwrite React Series&lt;/a&gt;&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
      <category>opensource</category>
      <category>react</category>
      <category>appwrite</category>
    </item>
  </channel>
</rss>
