<?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: Satyam Lachhwani</title>
    <description>The latest articles on Forem by Satyam Lachhwani (@satyam1203).</description>
    <link>https://forem.com/satyam1203</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%2F432793%2F030ab9ee-8743-47c4-a20b-4c68f677d930.png</url>
      <title>Forem: Satyam Lachhwani</title>
      <link>https://forem.com/satyam1203</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/satyam1203"/>
    <language>en</language>
    <item>
      <title>for_each: Apply a function to a range of elements in C++</title>
      <dc:creator>Satyam Lachhwani</dc:creator>
      <pubDate>Thu, 14 Oct 2021 08:45:17 +0000</pubDate>
      <link>https://forem.com/satyam1203/foreach-apply-a-function-to-a-range-of-elements-in-c-4b1g</link>
      <guid>https://forem.com/satyam1203/foreach-apply-a-function-to-a-range-of-elements-in-c-4b1g</guid>
      <description>&lt;p&gt;There are times when we need to apply a function to a range of elements in the container and C++ provides us with a native way to do it. &lt;/p&gt;

&lt;p&gt;Let's first see it in action before going into details:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;std::vector&amp;lt;int&amp;gt; nums{1, 34, 23, 3, 18};

auto print = [](const int&amp;amp; n) { std::cout &amp;lt;&amp;lt; " " &amp;lt;&amp;lt; n; };

std::for_each(nums.begin(), nums.end(), print);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, we have used lambda expressions in the above example but we can also use function in the same place. Let me show it to you.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
void printFunc(int &amp;amp;n) {
    std::cout&amp;lt;&amp;lt;n&amp;lt;&amp;lt;" ";
}

int main()
{
    std::vector&amp;lt;int&amp;gt; nums{1, 34, 23, 3, 18};
    std::for_each(nums.begin(), nums.end(), printFunc);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Makes sense, right? 😁&lt;/p&gt;



&lt;h2&gt;
  
  
  Use:
&lt;/h2&gt;

&lt;p&gt;Include the required header file in order to be able to use for_each function. You can either include bits/stdc++.h or include algorithm on the top of your .cpp file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Syntax:
&lt;/h2&gt;

&lt;p&gt;for_each(startIterator, endInterator, functionExpression);&lt;/p&gt;

&lt;h2&gt;
  
  
  Parameters:
&lt;/h2&gt;

&lt;p&gt;👉 startIterator - Starting address of the container.&lt;/p&gt;

&lt;p&gt;👉 endIterator - Ending address (range up to which the elements would be examined)&lt;/p&gt;

&lt;p&gt;👉 functionExpression - A function that would be applied to the members of the container in given range.&lt;/p&gt;

&lt;p&gt;The signature of the function should be equivalent to the following:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;void fun(const Type &amp;amp;a);&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Another example:
&lt;/h2&gt;

&lt;p&gt;Suppose, we want to get initials of name from a list of names, we can write a function to do it for a string and pass it to the third parameter to for_each. Although this can also be done by iterating through the container and applying the function to each element of container but this is a syntactic sugar on top of it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
void retrieveNameInitials(string &amp;amp;str) {
    istringstream ss(str);
    str = "";
    string word;
    while (ss &amp;gt;&amp;gt; word) 
        str += word[0];
}

int main()
{
    std::vector&amp;lt;string&amp;gt; names{"Rahul Singh", "Rohan Kumar", "Ayush Ratre", "John Doe"};
    std::for_each(names.begin(), names.end(), retrieveNameInitials);

    for(auto i:names) cout&amp;lt;&amp;lt;i&amp;lt;&amp;lt;" ";
}

// outputs: RS RK AR JD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we want to apply the function to not all elements but some in the range, we can pass the addresses accordingly.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;for_each(container.begin() + 1, container.begin() + 5, functionExpression);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The above line will apply the function to elements from position 1 to 4 (end address is not inclusive) in the container, given that second parameter doesn't exceed end of container.&lt;/p&gt;

&lt;p&gt;For full reference and more examples, visit &lt;a href="https://en.cppreference.com/w/cpp/algorithm/for_each"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you find anything wrong or if you know some more exciting functions or other stuff related to C++, please drop a comment below so we learn together.&lt;/p&gt;

&lt;p&gt;My Profile -&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/satyam1203"&gt;Github&lt;/a&gt;&lt;br&gt;
&lt;a href="https://linkedin.com/in/satyam1203"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>computerscience</category>
      <category>programming</category>
    </item>
    <item>
      <title>all_of, any_of, none_of: Examine a range of elements for a particular condition in C++</title>
      <dc:creator>Satyam Lachhwani</dc:creator>
      <pubDate>Sun, 07 Mar 2021 12:24:01 +0000</pubDate>
      <link>https://forem.com/satyam1203/allof-anyof-noneof-examine-a-range-of-elements-for-a-particular-condition-in-c-1cpg</link>
      <guid>https://forem.com/satyam1203/allof-anyof-noneof-examine-a-range-of-elements-for-a-particular-condition-in-c-1cpg</guid>
      <description>&lt;p&gt;C++ has a rich set of utilities that most people are not completely aware of. It also has these useful functions which examine whether or not a range of elements satisfy a particular condition.&lt;/p&gt;

&lt;p&gt;Let's see them in action before going further:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vector&amp;lt;int&amp;gt; arr(10);
iota(arr.begin(), arr.begin() + 10, 1);
// arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

// Checks if all elements are equal to 2 (returns false)
cout&amp;lt;&amp;lt;all_of(arr.begin(), arr.end(), [](int i){return i == 2;});

// Checks if any element is even (returns true)
cout&amp;lt;&amp;lt;any_of(arr.begin(), arr.end(), [](int i){return (i&amp;amp;1) == 0;});

// Checks if no element is divisible by 13 (returns true)
cout&amp;lt;&amp;lt;none_of(arr.begin(), arr.end(), [](int i){return i%13 == 0;});

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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;PS: If you're not familiar with the function syntax, please read &lt;a href="https://dev.to/satyam1203/lambda-functions-in-c-76l"&gt;this&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To achieve the same thing, we can always iterate through all the elements and check but I think these functions are still useful as they make the task even easier. 😉&lt;/p&gt;

&lt;p&gt;Let's now move forward and know more about these functions.&lt;br&gt;
 &lt;/p&gt;

&lt;h2&gt;
  
  
  Use
&lt;/h2&gt;

&lt;p&gt;Include the required header file in order to be able to use &lt;strong&gt;any_of&lt;/strong&gt;, &lt;strong&gt;all_of&lt;/strong&gt;, &lt;strong&gt;none_of&lt;/strong&gt; functions. You can either include &lt;em&gt;bits/stdc++.h&lt;/em&gt; or include &lt;em&gt;algorithm&lt;/em&gt; on the top of your .cpp file.&lt;br&gt;
 &lt;/p&gt;

&lt;h2&gt;
  
  
  Accepted function parameters
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Starting address of the container&lt;/li&gt;
&lt;li&gt;Ending address (range up to which the elements would be examined)&lt;/li&gt;
&lt;li&gt;Unary predicate (basically a function that would return a boolean value)
 &lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Return value
&lt;/h2&gt;

&lt;p&gt;📍 all_of returns true if the unary predicate returns true for all the elements in the given range.&lt;/p&gt;

&lt;p&gt;📍 any_of returns true if the unary predicate returns true for at least one of the elements in the given range.&lt;/p&gt;

&lt;p&gt;📍 none_of returns true if the unary predicate returns true for no element in the given range.&lt;br&gt;
 &lt;/p&gt;

&lt;p&gt;For full reference, visit &lt;a href="https://en.cppreference.com/w/cpp/algorithm/all_any_none_of"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you find anything wrong or if you know some more exciting functions or other stuff related to C++, please drop a comment below so we learn together.&lt;/p&gt;

&lt;p&gt;My Profile -&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/satyam1203"&gt;Github&lt;/a&gt;&lt;br&gt;
&lt;a href="https://linkedin.com/in/satyam1203"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Lambda functions in C++</title>
      <dc:creator>Satyam Lachhwani</dc:creator>
      <pubDate>Wed, 03 Mar 2021 16:15:03 +0000</pubDate>
      <link>https://forem.com/satyam1203/lambda-functions-in-c-76l</link>
      <guid>https://forem.com/satyam1203/lambda-functions-in-c-76l</guid>
      <description>&lt;p&gt;Hi people,&lt;/p&gt;

&lt;p&gt;Similar to other languages, C++ also has lambda expressions. The official documentation defines it as:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Lambda expression constructs a closure: an unnamed function object capable of capturing variables in scope.&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;Let's first see it in action before going into details:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int a = 4;
auto isEven = [](int a) { return a%2 == 0; };
cout&amp;lt;&amp;lt;isEven(a);
// prints 1 - means the number is even
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cool. Isn't it? 😉&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;In C++, the lambda function has its own complexities. Lambda expressions are useful when a one-liner function is required to be passed to some other function. E.g, transform, copy, remove, etc. I'll try to cover them in upcoming articles. &lt;br&gt;
 &lt;/p&gt;

&lt;h2&gt;
  
  
  Structure of a lambda function:
&lt;/h2&gt;

&lt;p&gt;👉 &lt;strong&gt;[ ]&lt;/strong&gt; contains the variables that the lambda function captures from the current scope. (By default, Lambda function can't use variables from the current scope, for each variable that is used inside the lambda function body we add it inside [ ] separating them by comma. There are some exceptions to it which you can see by referring to the official documentation) &lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;( )&lt;/strong&gt; contains the function parameters with their type that the lambda function accepts.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;{ }&lt;/strong&gt; contains function body. In most cases, it only has a return statement.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Another example:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int num1 = 5;
auto add_with_param = [num1] (int num2) {return num1 + num2;};
cout&amp;lt;&amp;lt;add_with_param(12);
// returns 17
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;h2&gt;
  
  
  Lambda Capture ways:
&lt;/h2&gt;

&lt;p&gt;📍 [&amp;amp;] : Captures all variables from outer scope by reference.&lt;/p&gt;

&lt;p&gt;📍 [=] : Captures all variables from outer scope by value.&lt;/p&gt;

&lt;p&gt;📍 [&amp;amp;var] : Capture a particular variable var by reference.&lt;/p&gt;

&lt;p&gt;📍 [var] : Capture a particular variable var by value.&lt;/p&gt;

&lt;p&gt;📍 [var1, &amp;amp;var2] : Mixed Capture of different variables in different ways.&lt;br&gt;
 &lt;/p&gt;

&lt;h2&gt;
  
  
  Other important points:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;If the Lambda function doesn't accept any parameter, ( ) section may be skipped.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int b = 5;
auto isEven = [b] {return b % 2 == 0;};
cout&amp;lt;&amp;lt;isEven();
// returns 0 - means the number is not even
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Any variable or object captured by the Lambda function(by value) can not be mutated inside the Lambda function.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After ( ) section in the structure of the Lambda function, its return type may be specified (Optional). If omitted, the return type is implied by the function return statement or void if it doesn't return anything.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lambda functions can work only on C++ 11 and above.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For full reference and more examples, visit &lt;a href="https://en.cppreference.com/w/cpp/language/lambda"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you find anything wrong or if you know some more exciting functions or other stuff related to C++, please drop a comment below so we learn together.&lt;/p&gt;

&lt;p&gt;My Profile -&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/satyam1203"&gt;Github&lt;/a&gt;&lt;br&gt;
&lt;a href="https://linkedin.com/in/satyam1203"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Factor Operations: gcd and lcm functions in C++</title>
      <dc:creator>Satyam Lachhwani</dc:creator>
      <pubDate>Wed, 17 Feb 2021 05:57:56 +0000</pubDate>
      <link>https://forem.com/satyam1203/factor-operations-gcd-and-lcm-functions-in-c-7af</link>
      <guid>https://forem.com/satyam1203/factor-operations-gcd-and-lcm-functions-in-c-7af</guid>
      <description>&lt;p&gt;Oftentimes, we need to find GCD (Greatest Common Divisor) and LCM (Lowest Common Multiple) of two numbers and we tend to implement our own functions in C++ for this purpose.&lt;/p&gt;

&lt;p&gt;If you don't know yet, you'll be glad to hear that there are native functions provided by C++ to find GCD and LCM of two integers. It is as simple as that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int a = 150, b = 225;
int gcd_num = gcd(a, b); // returns 75
int lcm_num = lcm(a, b); // returns 450
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's now move forward and know more about this function.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use
&lt;/h2&gt;

&lt;p&gt;Include the required header file in order to be able to use the &lt;strong&gt;gcd&lt;/strong&gt; or &lt;strong&gt;lcm&lt;/strong&gt; function. You can either include &lt;em&gt;bits/stdc++.h&lt;/em&gt; or include &lt;em&gt;numeric&lt;/em&gt; on the top of your .cpp file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Accepted function parameters
&lt;/h2&gt;

&lt;p&gt;These two functions accept two positive integers as parameters and may throw an error that differs from compiler to compiler or give unexpected results in case unexpected parameters are passed. &lt;/p&gt;

&lt;h2&gt;
  
  
  Things to keep in mind
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;If both numbers are zero, gcd() returns zero.&lt;/li&gt;
&lt;li&gt;If any of the numbers is zero, lcm() returns zero.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is an interesting relation between the numbers and their respective gcd and lcm. If two numbers are represented as m and n, then&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;m * n = gcd * lcm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you already knew this, it is great. If you didn't then now you know. If you know any other interesting things related to it, please write them in the comments.&lt;/p&gt;

&lt;p&gt;For full reference, visit &lt;a href="https://en.cppreference.com/w/cpp/numeric/gcd"&gt;gcd&lt;/a&gt; and &lt;a href="https://en.cppreference.com/w/cpp/numeric/lcm"&gt;lcm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you find anything wrong or if you know some more exciting functions or other stuff related to C++, please drop a comment below so we learn together.&lt;/p&gt;

&lt;p&gt;My Profile -&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/satyam1203"&gt;Github&lt;/a&gt;&lt;br&gt;
&lt;a href="https://linkedin.com/in/satyam1203"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>iota: Initialize a C++ container with increasing values</title>
      <dc:creator>Satyam Lachhwani</dc:creator>
      <pubDate>Mon, 15 Feb 2021 19:36:42 +0000</pubDate>
      <link>https://forem.com/satyam1203/iota-initialize-a-c-container-with-increasing-values-4l2p</link>
      <guid>https://forem.com/satyam1203/iota-initialize-a-c-container-with-increasing-values-4l2p</guid>
      <description>&lt;p&gt;In C++, when we want to initialize a container(say vector) with increasing values, we tend to use for loop to insert values like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vector&amp;lt;int&amp;gt; array;
for(int i = 0; i &amp;lt; 10; i++) {
    array.push_back(i);
}
// array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To achieve the same thing, we can use a function defined in the C++ Algorithm library, let's first see it in action before going into details:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vector&amp;lt;int&amp;gt; array(10);
iota(array.begin(), array.begin() + 10, 0);
// array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See, how easy it becomes to initialize a container with sequential values starting from any integer. Let's now move forward and know more about this function.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use
&lt;/h2&gt;

&lt;p&gt;Include the required header file in order to be able to use the &lt;strong&gt;iota&lt;/strong&gt; function. You can either include &lt;em&gt;bits/stdc++.h&lt;/em&gt; or include &lt;em&gt;algorithm&lt;/em&gt; and &lt;em&gt;numeric&lt;/em&gt; on the top of your .cpp file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Accepted function parameters
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Starting address of the container&lt;/li&gt;
&lt;li&gt;Address up to which the container needs to be filled with sequential values&lt;/li&gt;
&lt;li&gt;Initial value to be assigned (after which it is auto-incremented and assigned)&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: This function doesn't return anything.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Things to keep in mind
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The array must be initialized with some size before using this function.&lt;/li&gt;
&lt;li&gt;The second parameter (last address up to which values are filled) should not exceed the ending address of the container. &lt;/li&gt;
&lt;li&gt;We can use &lt;code&gt;array.end()&lt;/code&gt; as the second parameter for filling the whole container&lt;/li&gt;
&lt;li&gt;We can pass either an integer variable or a constant (as done in the above snippet)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For full reference, visit &lt;a href="https://en.cppreference.com/w/cpp/algorithm/iota"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you find anything wrong or if you know some more exciting functions or other stuff related to C++, please drop a comment below so we learn together.&lt;/p&gt;

&lt;p&gt;My Profile -&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/satyam1203"&gt;Github&lt;/a&gt;&lt;br&gt;
&lt;a href="https://linkedin.com/in/satyam1203"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Github Resume Generator</title>
      <dc:creator>Satyam Lachhwani</dc:creator>
      <pubDate>Tue, 25 Aug 2020 11:17:27 +0000</pubDate>
      <link>https://forem.com/satyam1203/github-resume-generator-32i4</link>
      <guid>https://forem.com/satyam1203/github-resume-generator-32i4</guid>
      <description>&lt;p&gt;Hello Geeks,&lt;/p&gt;

&lt;p&gt;I built a resume generator that takes your Github username and generates a resume in a format including Introduction, statistics, Top repositories, contributions, and links to your profile using the Github GraphQL API v4. &lt;/p&gt;

&lt;h2&gt;
  
  
  Content
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt; - The first section is a basic introduction which includes your Github name, username, bio, location, GitHub avatar, and the year since you're on Github.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Stats&lt;/strong&gt; - The second section is a statistics section containing the number of total contributions, followers, following, PRs, issues, etc. It may also contain details depending upon whether you're a Bounty Hunter, Developer Program Member, Campus Expert, Hireable, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Top Repositories&lt;/strong&gt; - The third section contains top repositories containing your pinned repositories. The purpose is to provide ways to select particular repositories. Pin the repositories you want to appear on the top repositories section on your resume. More options on it will be added soon.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Contributions&lt;/strong&gt; - The fourth section contains your pull request contributions (most recent at the top), it also mentions how many commits are made in those pull requests. If you haven't contributed earlier, this section will not appear on your resume.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Footer&lt;/strong&gt; - Your Username, Github Link, Website Link(if any).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🌟 Star this repository, if you find it useful.&lt;/p&gt;

&lt;p&gt;Visit it here - &lt;a href="https://resume-github.vercel.app/"&gt;https://resume-github.vercel.app/&lt;/a&gt;&lt;br&gt;
Github Repository - &lt;a href="https://github.com/satyam1203/resume-github"&gt;https://github.com/satyam1203/resume-github&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My Profile -&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/satyam1203"&gt;Github&lt;/a&gt;&lt;br&gt;
&lt;a href="https://linkedin.com/in/satyam1203"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>graphql</category>
      <category>javascript</category>
    </item>
    <item>
      <title>GOC Experience</title>
      <dc:creator>Satyam Lachhwani</dc:creator>
      <pubDate>Thu, 20 Aug 2020 13:51:59 +0000</pubDate>
      <link>https://forem.com/satyam1203/goc-experience-1hnn</link>
      <guid>https://forem.com/satyam1203/goc-experience-1hnn</guid>
      <description>&lt;h1&gt;
  
  
  GOC
&lt;/h1&gt;

&lt;p&gt;I had applied to the Google SDE Internship 2021 a few days ago and I then received a mail from Google for participating in Google Online Challenge - Coding (Intern). &lt;/p&gt;

&lt;p&gt;This is an invitation based contest, there are 2 coding questions to attempt with a 60-minute time limit for completion. It took place on August 16, 2020, and there were questions of average difficulty level of 30 pts. each, a total of 60 pts. &lt;/p&gt;

&lt;h2&gt;
  
  
  Problems
&lt;/h2&gt;

&lt;p&gt;The problems were of average level and it was quite easy to clear partial tasks but I had to optimize my approach in order to clear hidden test cases. In 60 minutes of time, I was able to solve the problems partially and I tried to optimize them but was not able to do so.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  Note
&lt;/h4&gt;

&lt;p&gt;The intention of this post is not to brag about myself but just to give everyone a sense of how it works and what exactly is GOC.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you're willing to get into any of FAANGs, you should know about this.&lt;/p&gt;

&lt;p&gt;Get connected to me at:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Github: &lt;a href="https://github.com/satyam1203"&gt;https://github.com/satyam1203&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;LinkedIn: &lt;a href="https://linkedin.com/in/satyam1203"&gt;https://linkedin.com/in/satyam1203&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>career</category>
      <category>challenge</category>
      <category>motivation</category>
    </item>
  </channel>
</rss>
