<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rahil Sarvaiya on Medium]]></title>
        <description><![CDATA[Stories by Rahil Sarvaiya on Medium]]></description>
        <link>https://medium.com/@rahil1304?source=rss-1af626b4d5a9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*06gubL_wXTyzc12s66Gt-w.jpeg</url>
            <title>Stories by Rahil Sarvaiya on Medium</title>
            <link>https://medium.com/@rahil1304?source=rss-1af626b4d5a9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 16:35:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rahil1304/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[10 Simple ways to make your daily JavaScript coding tasks easier]]></title>
            <link>https://levelup.gitconnected.com/10-simple-ways-to-make-your-daily-javascript-coding-tasks-easier-98b2e575a42?source=rss-1af626b4d5a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/98b2e575a42</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Rahil Sarvaiya]]></dc:creator>
            <pubDate>Tue, 01 Jun 2021 13:43:36 GMT</pubDate>
            <atom:updated>2021-06-19T05:45:53.127Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using Underscore.js</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WuYZ7Txa6Xusr1mN" /><figcaption>Photo by <a href="https://unsplash.com/@cgower?utm_source=medium&amp;utm_medium=referral">Christopher Gower</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>What is Underscore.js?</h3><p>Underscore.js is a JavaScript library with certain utility functions for common programming tasks. I have been personally using this for the past year, and it has become one of my favorite JS libraries. Underscore.js provides around 100 different utility functions, but today, we will discuss the top 10 most used functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*ztFlrNlUF9qAGu7pCvdQ2w.png" /><figcaption>Underscore.js — A JavaScript library that provides utility functions for common programming tasks.</figcaption></figure><p>Before we dive into how to use the library, let’s first learn how to install the library. You can import Underscore.js in 3 different ways, using Node.js, using Meteor.js, and using Bower.</p><pre>npm install underscore // Node.js<br>meteor add underscore // Meteor.js <br>bower install underscore // Bower</pre><h3>Utility Functions -</h3><h3>1. Each</h3><p>This function is similar to the default <strong>forEach</strong> function in JavaScript. It is used to iterate an array of elements and perform an operation on each element in that array.</p><p>Example-</p><pre>const _ = require(&#39;underscore&#39;);</pre><pre>let nums = [1, 2, 3, 4, 5];<br>_.each(nums, function(num) {<br>    // perform operation on each num<br>    console.log(num);<br>});</pre><h3>2. Find</h3><p>This function looks through each element in an array and passed the first one that passed a particular truth condition. Once the truth condition is fulfilled and the element is found, the rest of the elements are not iterated.</p><p>Example -</p><pre>const _ = require(&#39;underscore&#39;);</pre><pre>let nums = [1, 2, 3, 4, 5, 6];<br>_.find(nums, function(num) {<br>    return num % 3 == 0;<br>});</pre><pre>// It will return 3</pre><h3>3. Filter</h3><p>This function looks through each element in the array and returns an array of all elements that pass the truth condition. It is similar to the find function, but instead of returning the first element that passes the truth test, it returns all that pass the condition.</p><pre>const _ = require(&#39;underscore&#39;);</pre><pre>let nums = [1, 2, 3, 4, 5, 6];<br>_.filter(nums, function(num) {<br>    return num % 3 == 0;<br>});</pre><pre>// It will return [3,6]</pre><h3>4. Map</h3><p>This function is similar to the each function. It iterates over the entire array and returns a new array by performing an operation on each element in the original list.</p><p>It is mainly meant to manipulate the original array and return a new array.</p><p>Example -</p><pre>const _ = require(&#39;underscore&#39;);</pre><pre>let nums = [1, 2, 3, 4, 5];<br>_.map(nums, function(num) {<br>    return num * 10;<br>});</pre><pre>// it will return [10, 20, 30, 40, 50]</pre><h3>5. Reduce</h3><p>This function is used to “reduce” the entire array into a single element. It’s used to convert the entire array into a single value by performing an operation successively on each element.</p><p>Example -</p><pre>const _ = require(&#39;underscore&#39;);</pre><pre>let nums = [1, 2, 3, 4, 5];<br>_.reduce(nums, function(memo, num) {<br>    return memo + num;<br>}, 0);</pre><pre>// This will return the sum of all elements in the array which is 15</pre><p>Here memo is the initial state of the reduction, and each successive state is returned by the iteratee.</p><h3>6. Every</h3><p>This function returns true if all elements in the array pass a particular truth test. If any element does not pass the truth test, it stops traversing the array.</p><p>Example -</p><pre>const _ = require(&#39;underscore&#39;);</pre><pre>let nums = [1, 2, 3, 4, 5, 6];<br>_.every(nums, function(num) {<br>    return num % 2 == 0;<br>});</pre><pre>// It will return false</pre><h3>7. Some</h3><p>This function returns true if at least one of the values in the original array passes the truth test. If all the values do not pass the truth test, it returns false. It keeps iterating over all the elements in the array till it finds one that passes the truth test.</p><p>Example -</p><pre>const _ = require(&#39;underscore&#39;);</pre><pre>let nums = [1, 2, 3, 4, 5, 6];<br>_.some(nums, function(num) {<br>		return num % 2 == 0;<br>});</pre><pre>// It will return true</pre><h3>8. Pluck</h3><p>This function is used to extract certain properties from an array of objects. It iterates over each object in the array, extracts the required property, and returns a combined array of them.</p><p>Example -</p><pre>const _ = require(&#39;underscore&#39;);</pre><pre>let castOfSiliconValley = [<br>{name: &#39;Richard&#39;, age: 31}, <br>{name: &#39;Gilfoyle&#39;, age: 32}, <br>{name: &#39;Dinesh&#39;, age: 29}<br>];<br>_.pluck(castOfSiliconValley , &#39;name&#39;);</pre><pre>// This return =&gt; [&quot;Richard&quot;, &quot;Gilfoyle&quot;, &quot;Dinesh&quot;]</pre><h3>9. SortBy</h3><p>This function returns a sorted copy of the original array, sorted in ascending order.</p><p>Example -</p><pre>const _ = require(&#39;underscore&#39;);</pre><pre>let nums = [5, 2, 4, 1, 6, 3];<br>_.sortBy(nums, function(num) {<br>    return num;<br>});</pre><pre>// It will return [1, 2, 3, 4, 5, 6]</pre><h3>10. GroupBy</h3><p>This function is to group the original elements in the array based on some common operation. It is usually used when dealing with an array of objects, and grouping based on a particular property is required.</p><p>Example -</p><pre>const _ = require(&#39;underscore&#39;);</pre><pre>let cars = [<br>  {<br>    make: &quot;Ferrari&quot;,<br>    color: &quot;red&quot;<br>  },<br>  {<br>    make: &quot;Porche&quot;,<br>    color: &quot;black&quot;<br>  },<br>  {<br>    make: &quot;mercedes&quot;,<br>    color: &quot;red&quot;<br>  },<br>  {<br>    make: &quot;BMW&quot;,<br>    color: &quot;white&quot;<br>  }<br>];</pre><pre>_.groupBy(cars, &#39;color&#39;);</pre><pre>/*<br>It will return</pre><pre>{<br>  red: [<br>    { make: &#39;Ferrari&#39;, color: &#39;red&#39; },<br>    { make: &#39;mercedes&#39;, color: &#39;red&#39; }<br>  ],<br>  black: [ { make: &#39;Porche&#39;, color: &#39;black&#39; } ],<br>  white: [ { make: &#39;BMW&#39;, color: &#39;white&#39; } ]    <br>}</pre><pre>/*</pre><h3>Conclusion</h3><p>I hope you found this article useful and informative. That are many more utility functions that underscore.js provides. You can view the complete list from their <a href="https://underscorejs.org/">documentation</a>.</p><p>If you liked this article and would like to read similar work, be sure to follow me on <a href="https://twitter.com/RahilSarvaiya">Twitter </a>where I’ll post updates about publishing my latest articles. Please feel free to share your thoughts on this article in the comments section. If you guys have any suggestions regarding this article or on anything related to Underscore.js, I would love to know.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98b2e575a42" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/10-simple-ways-to-make-your-daily-javascript-coding-tasks-easier-98b2e575a42">10 Simple ways to make your daily JavaScript coding tasks easier</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Merge k Sorted Lists]]></title>
            <link>https://blog.devgenius.io/merge-k-sorted-lists-a7462bfd102c?source=rss-1af626b4d5a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7462bfd102c</guid>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Rahil Sarvaiya]]></dc:creator>
            <pubDate>Wed, 19 May 2021 10:53:18 GMT</pubDate>
            <atom:updated>2021-06-19T05:45:11.834Z</atom:updated>
            <content:encoded><![CDATA[<p>How to merge a collection of all nodes in multiple sorted linked lists?</p><blockquote>Leetcode problem 23 (<a href="https://leetcode.com/problems/merge-k-sorted-lists/">https://leetcode.com/problems/merge-k-sorted-lists/</a>)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M91sQU9KEV1qqjExEliLUQ.jpeg" /><figcaption>LeetCode — <a href="https://leetcode.com/">https://leetcode.com/</a></figcaption></figure><p>This article is a part of a new series where I will be solving a few Leetcode problems, and thereafter explaining their solutions in detail. <br>I will follow a four-part strategy in all of these articles —</p><ol><li>The description of the problem</li><li>Hint on how to solve the article</li><li>The actual solution in detail</li><li>Time Complexity and Space Complexity of the Solution</li></ol><p>I highly recommend everyone to read the hints first and then try and solve the problem themselves. Once they have tried solving, they can refer to my solution and see how their approach differs from mine. And finally, you can review the time and space complexity to truly understand the solution in-depth.</p><h3><strong>The Problem</strong></h3><blockquote>You are given an array of <em>k</em> linked-lists <em>lists</em>, each linked-list is sorted in ascending order.</blockquote><blockquote><em>Merge all the linked-lists into one sorted linked-list and return it.</em></blockquote><p><strong>Example 1:</strong></p><pre><strong>Input:</strong> lists = [[1,4,5],[1,3,4],[2,6]]<br><strong>Output:</strong> [1,1,2,3,4,4,5,6]<br><strong>Explanation:</strong> The linked-lists are:<br>[<br>  1-&gt;4-&gt;5,<br>  1-&gt;3-&gt;4,<br>  2-&gt;6<br>]<br>merging them into one sorted list:<br>1-&gt;1-&gt;2-&gt;3-&gt;4-&gt;4-&gt;5-&gt;6</pre><p><strong>Example 2:</strong></p><pre><strong>Input:</strong> lists = []<br><strong>Output:</strong> []</pre><p><strong>Example 3:</strong></p><pre><strong>Input:</strong> lists = [[]]<br><strong>Output:</strong> []</pre><h3><strong>Hint</strong></h3><p><strong>Approach 1: Brute Force</strong></p><p>You can iterate over all the Linked Lists, add each value to an array, and finally return the sorted version of the array as a Linked List.</p><p><strong>Approach 2: Using a Priority Queue</strong></p><p>A priority queue is nothing but a queue where each element has a priority assigned to it. The element with high priority is served before the element with low priority. When elements are popped out of a priority queue then the result obtained is either sorted in an increasing order or in a decreasing order. While, when elements are popped from a simple queue, a FIFO order of data is obtained in the result.</p><h3>Solution</h3><h4><strong>Approach 1: Brute Force</strong></h4><pre># Definition for singly-linked list.<br># class ListNode:<br>#     def __init__(self, val=0, next=None):<br>#         self.val = val<br>#         self.next = next<br>class Solution:<br>    def mergeKLists(self, lists: List[ListNode]) -&gt; ListNode:<br>        <br>        nodes = []<br>        head = point = ListNode(0)<br>        for l in lists:<br>            while l:<br>                nodes.append(l.val)<br>                l = l.next<br>        <br>        for k in sorted(nodes):<br>            point.next = ListNode(k)<br>            point = point.next<br>        return head.next</pre><p>We save the values of every node in each list inside the nodes list. Then we iterate over a sorted list and keep addressing the pointer to point to the next element in the sorted node list. <br>In the end, we return the head.next which is nothing but the start of the final Linked List that has our lists sorted in increasing order.</p><h4>Approach 2: Using a Priority Queue</h4><pre>from heapq import heappush, heappop, heapify</pre><pre>class Solution(object):<br>     def mergeKLists(self, lists):<br>        &quot;&quot;&quot;<br>        :type lists: List[ListNode]<br>        :rtype: ListNode<br>        &quot;&quot;&quot;<br>        <br>        pre = cur = ListNode(0)<br>           <br>        heap = []<br>        for i in range(len(lists)):<br>            if lists[i]: <br>                heapq.heappush(heap, (lists[i].val, i, lists[i]))<br>                <br>        while heap:<br>            idx, node = heapq.heappop(heap)<br>            cur.next = node<br>            cur = cur.next<br>            <br>            if cur.next:<br>                heapq.heappush(heap, (cur.next.val, idx, cur.next))<br><br>        return pre.next</pre><p>We first declare a priority queue using heapq as heap and put all the values inside this queue. Now we iterate over this priority queue and pop the values, the values will get popped from the queue in increasing order and will be saved in idx and node. Next, we simply iterate over the curand update cur to point to the next value.</p><h3>Complexity</h3><h4>Approach 1: Using brute force</h4><p><strong>Time complexity:</strong> <br><em>O(NlogN)</em> where <em>N</em> is the total number of nodes.</p><ul><li>Collecting all the values costs <em>O</em>(<em>N</em>) time.</li><li>A stable sorting algorithm costs <em>O</em>(<em>N</em>log<em>N</em>) time.</li><li>Iterating for creating the linked list costs <em>O</em>(<em>N</em>) time.</li></ul><p><strong>Space complexity :</strong><br><em>O</em>(<em>N</em>)</p><ul><li>Sorting cost <em>O</em>(<em>N</em>) space (depends on the algorithm you choose).</li><li>Creating a new linked list costs <em>O</em>(<em>N</em>) space.</li></ul><h4>Approach 2: Using a Priority Queue</h4><p>The runtime of this will be O(nklog(k)).<br>The while loop will run for as many nodes as there are in lists which is order k * n, where n is the length of the list. Each time during the while loop, heappop and heap replace takes O(log(k)) time since we’ll have at most k elements in our heap. So the runtime of the while loop is O(nklog(k)).</p><p>I hope you found this article interesting and do let me know if you can think of any additional ways to solve this problem. In case you find any improvements to my existing solution, do reach out. I would love to hear your feedback. <br>You can also follow me on <a href="https://twitter.com/RahilSarvaiya">Twitter</a>, where I tweet about my journey in Software Development and also post updates on my latest articles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7462bfd102c" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/merge-k-sorted-lists-a7462bfd102c">Merge k Sorted Lists</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Node.js?]]></title>
            <link>https://javascript.plainenglish.io/what-is-node-js-6d9cc7a5068a?source=rss-1af626b4d5a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d9cc7a5068a</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Rahil Sarvaiya]]></dc:creator>
            <pubDate>Tue, 30 Mar 2021 05:38:04 GMT</pubDate>
            <atom:updated>2021-06-19T05:43:13.732Z</atom:updated>
            <content:encoded><![CDATA[<h4>Node.js is a JavaScript runtime environment built on Chrome’s V8 engine. It was originally created by Ryan Dahl, an American Software Engineer, who also recently developed Deno (an alternate to Node.js).</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qRCzV8yrCj8p2wjuycaD5Q.png" /><figcaption>Official Node.js Logo</figcaption></figure><p>Node.js is a backend JavaScript runtime environment that runs on the V8 engine and executes code outside of a web browser. Node.js interprets and executes a JavaScript-based script on its runtime environment. Node.js is one of the fastest server-side application platforms.</p><p><em>“You can never understand everything. But you should push yourself to understand the system.” — Ryan Dahl, creator of Node.js</em></p><h4><strong>Why is Node.js so popular?</strong></h4><ol><li>Node.js is open-sourced and thus has a vast eco-system of many open-source libraries that can be leveraged using npm.</li><li>Everything in Node.js is asynchronous.</li><li>Node.js is single-threaded but supports concurrency with the help of events and callbacks.</li><li>Node.js is cross-platform. It can be run on Windows, Linux, Unix, Mac OS X, etc.</li><li>Node.js is based on one of the most popular programming languages — JavaScript.</li><li>Node.js provides an easy way to build scalable enterprise applications.</li></ol><p>Now, let&#39;s discuss some important theoretical concepts that will really help you to understand how Node.js works so efficiently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ECVbiGr9q2pL4UM1ifHsxg.png" /><figcaption>The Architecture Workflow of Node.js (Image Source — <a href="https://www.simplilearn.com/">https://www.simplilearn.com/</a>)</figcaption></figure><h4><strong>Node.js is Asynchronous</strong></h4><p>All APIs in Node.js are Asynchronous and Non-Blocking. Non-Blocking is when the execution of additional JavaScript code in the Node.js process does not need to wait until a non-JavaScript operation completes. This essentially means that a Node.js server never waits for an API to return data. After calling the API, it will move on to the next API and use an event queue notification mechanism to keep track of the API request order.</p><p>As an example, let’s consider a case where each request to a web server takes 90ms to complete and 70ms of that 90ms is a database I/O operation that can be performed asynchronously. Since Node.js is asynchronous, it frees up that 70ms per request, to handle other external requests. This difference might seem small, but when added together over thousands of requests for a big application, Node.js &amp; asynchronous programming can really improve efficiency and performance.</p><h4><strong>Node.js is single-threaded</strong></h4><p>Node.js uses a single-threaded model along with event looping for async processing. This improves performance and scalability. More processing, performance, and scalability can be achieved by doing async processing on a single thread under typical web request loads than the typical thread-based implementation.</p><h4><strong>Callback function in Node.js</strong></h4><p>Node.js due to its asynchronous nature doesn&#39;t wait for a particular function call to finish execution. Instead, it uses callback functions. All APIs written in Node.js make use of callbacks.</p><p>If a particular function, takes a large amount of time to execute, it would normally block the execution of the remaining program. However, Node.js uses callbacks and async programming to continue the execution of the remaining part of the program. These callback functions are executed once the original function execution is completed and do not affect the normal flow of the program.</p><p>In simple words, a callback function is a function that says, “once you’re done doing this, do this.”</p><h4><strong>Callback hell</strong></h4><p>Callback hell is a major issue that arises due to the usage of nested callbacks. It arises when each and every callback takes an argument as a result of the previous callback, which makes the code structure difficult to read and maintain. In addition to this, if there is an error in one function, all the corresponding callback functions get affected.</p><p>In order to avoid callback hell, promises are used. A Promise is a result of an asynchronous operation. In simple terms, it is an object or a piece of code that is returned, once a particular part of the code is executed. A promise has three states —pending, resolved, &amp; rejected. Depending on whether there is an error in the code or not, a particular state of the promise is called. Thus, a promise chaining mechanism can be used to avoid callback hell that arises due to multiple nested callback functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*c6UMJ-E_buXvPqZVlwPITw.jpeg" /><figcaption>Callback hell in JS (Source — <a href="https://medium.com/@jaybhoyar1997/avoiding-callback-hell-in-node-js-7c1c16ebd4d3">https://medium.com/@jaybhoyar1997/avoiding-callback-hell-in-node-js-7c1c16ebd4d3</a>)</figcaption></figure><h4><strong>Event loop in Node.js</strong></h4><p>The event loop is what handles asynchronous callbacks. It allows Node.js to perform non-blocking I/O operations — despite the fact that JavaScript is single-threaded — by offloading operations to the system kernel whenever possible. The event loop is an infinite loop that waits for tasks, executes the tasks once received, and then again waits for more tasks. The event loop executes tasks from the event queue only when the call stack is empty i.e. there is no ongoing task. Whenever a task is complete, the event loop fires an event that signals to the event listener function to execute. The event handlers decide what is to be done once a particular event has triggered.</p><p>Events may look similar to callback functions. However, the key difference between the two is that a callback function is executed whenever an asynchronous function call has been completed, and events are more like observers, that are waiting for the particular event to be triggered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*t93hnSa9WyaxPZeMuqXOMw.jpeg" /><figcaption>Source — <a href="https://www.tutorialspoint.com/nodejs/nodejs_event_loop.htm">https://www.tutorialspoint.com/nodejs/nodejs_event_loop.htm</a>l</figcaption></figure><h4><strong>NODE_ENV</strong></h4><p>NODE_ENV is an environment variable. During the execution of code, it can check the value of this environment and execute some additional lines of code. NODE_ENV is most popularly used to check whether the environment is in development or production so that some particular debugging lines of code can be executed or not. It basically acts like a flag that is used to check whether the code is being run in development or production, and based on that flag, the necessary code is executed.</p><h4><strong>Node Package Manager (npm)</strong></h4><p>Npm stands for Node Package manager. It is an online repository for publishing Node.js projects, and also a command-line utility that aids in installing packages that can be used in your Node.js application. An abundance of node packages are published on npm and many more are being added every day. You can search for the various packages <a href="https://www.npmjs.com/">here.</a><br>To summarize, npm is basically a package manager for node, that can be used to download various packages to be used in your application directly from your command line.</p><figure><img alt="Node Package Manager Logo" src="https://cdn-images-1.medium.com/max/1024/1*Qj1OTPHk-djj2C1Nnkn4VQ.png" /><figcaption>Node Package Manager (Source — <a href="https://en.wikipedia.org/wiki/Npm_(software)">https://en.wikipedia.org/wiki/Npm_(software)</a>)</figcaption></figure><h4><strong>Popular Node.js modules</strong></h4><p>Modules are nothing but JavaScript libraries that can be used to import some particular lines of code into a program, or to import a particular coding logic with simpler syntax, which further improves code readability. We can use the require() function with the module&#39;s name inside the parenthesis to import a particular module into your Node.js application.</p><ol><li><em>HTTP</em><br>The HTTP module creates an HTTP server that listens to server ports and gives a response back to the client. <br>Syntax: const http = require(‘http’);</li><li><em>util</em><br>This module provides access to some utility functions that can be quite useful for developers. Syntax: const util = require(‘util’);</li><li><em>fs<br></em>This module includes events, classes, and methods that deal with file I/O operations. Syntax: const fs = require(‘fs’);</li><li><em>url<br></em>This module has utilities for URL parsing and resolution. <br>Syntax: const url = require(‘url’);</li><li><em>lodash<br></em>Lodash is one of the most popular npm packages. It makes working with JavaScript easier by providing formats for working with arrays, numbers, objects &amp; strings. Syntax: const lodash = require(‘lodash’);</li><li><em>underscore<br></em>This is another very popular npm package. It is similar to <em>lodash</em> and provides formats for iterating &amp; manipulating arrays, objects, strings, etc. <br>Syntax: const _ = require(‘underscore’);</li><li><em>express<br></em>Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications. It makes API development using Node.js much easier. Node.js and Express are usually always used together for backend development. <br>Syntax: const express = require(‘express’);</li></ol><h4><strong>Package.json file</strong></h4><p>Every Node.js project contains a package.json file in their root folder that contains metadata about their project. It contains data about the various modules used in the project, their version numbers, the dependencies, dev dependencies, etc. It also contains data about the project such as the project description, the version, the licenses, etc.<br>For example:</p><pre>{<br>  &quot;name&quot; : &quot;underscore&quot;,<br>  &quot;description&quot; : &quot;JavaScript&#39;s functional programming helper library.&quot;,<br>  &quot;homepage&quot; : &quot;http://documentcloud.github.com/underscore/&quot;,<br>  &quot;keywords&quot; : [&quot;util&quot;, &quot;functional&quot;, &quot;server&quot;, &quot;client&quot;, &quot;browser&quot;],<br>  &quot;author&quot; : &quot;Jeremy Ashkenas &lt;jeremy@documentcloud.org&gt;&quot;,<br>  &quot;contributors&quot; : [],<br>  &quot;dependencies&quot; : [],<br>  &quot;repository&quot; : {&quot;type&quot;: &quot;git&quot;, &quot;url&quot;: &quot;git://github.com/documentcloud/underscore.git&quot;},<br>  &quot;main&quot; : &quot;underscore.js&quot;,<br>  &quot;version&quot; : &quot;1.1.6&quot;<br>}</pre><h3><strong>Companies that are using Node.js</strong></h3><ul><li>Amazon, Netflix, LinkedIn, eBay, PayPal, Trello, Uber, and Reddit use Node.js as their backend framework.</li><li>LinkedIn moved the back end of the mobile application from Ruby on Rails to Node. Two key reasons for this switch were efficient performance and scalability.</li><li>PayPal says swapping Java for Node.js on its servers is allowing it to serve web pages more rapidly and simplifying the creation of server-side software. PayPal started using Node.js as a prototyping platform but later moved to use it in production.</li><li>Uber needed a system to be reliable both to passengers and drivers. They named the 3 key reasons for choosing Node.JS - the ability to process big amounts of data quickly and reliably, convenient error analysis and quick code deployment, and ongoing improvement of the technology because of the open-source community.</li><li>Trello is among companies that use Node.js for its server-side and as a prototyping tool to build a single-page web application.</li></ul><h3>How do you create a simple server in Node.js that returns Hello World?</h3><p>Now that you have learned the theory behind the working of Node.js, let’s get our hands dirty and write a simple “Hello World” Node.js program.</p><ul><li>Import the HTTP module</li><li>Use createServer function with a callback function using request and response as parameters.</li><li>Type “hello world.”</li><li>Set the server to listen to port 3000 and assign an IP address</li></ul><pre>const http = require(&#39;http&#39;);<br><br>http.createServer(function (req, res) {<br>  res.writeHead(200, {&#39;Content-Type&#39;: &#39;text/plain&#39;});<br>  res.end(&#39;Hello World!&#39;);<br>}).listen(3000);</pre><p>Congratulations! You just wrote your first Hello World Node.js program!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*M0mowFRKP7BQgeN2zMDC8Q.jpeg" /><figcaption>Node.js Logo (Source — freecodecamp.org)</figcaption></figure><h3>Conclusion</h3><p>I hope you have gained some knowledge on Node.js and now know why it has gained so much popularity. If you liked this article and would like to read similar work, be sure to follow me on <a href="https://twitter.com/RahilSarvaiya">Twitter </a>where I’ll post updates about publishing my latest articles. Please feel free to share your thoughts on this article in the comments section. If you guys have any suggestions regarding this article or on anything related to Node.js, I would love to know.</p><p><em>More content at </em><a href="https://plainenglish.io/"><strong><em>plainenglish.io</em></strong></a></p><p>Additional Resources:</p><p><a href="https://nodejs.org/en/">https://nodejs.org/en/</a><br><a href="https://www.geeksforgeeks.org/node-js-event-loop/">https://www.geeksforgeeks.org/node-js-event-loop/</a><br><a href="https://www.w3schools.com/nodejs/">https://www.w3schools.com/nodejs/</a><br><a href="https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/">https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/</a><a href="https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/"><br></a><a href="https://www.simplilearn.com/tutorials/nodejs-tutorial/nodejs-interview-questions">https://www.simplilearn.com/tutorials/nodejs-tutorial/nodejs-interview-questions</a><br><a href="https://youteam.io/blog/top-companies-that-used-node-js-in-production/#:~:text=Netflix%20is%20the%20world&#39;s%20top,to%20be%20proficient%20with%20languages">https://youteam.io/blog/top-companies-that-used-node-js-in-production/#:~:text=Netflix%20is%20the%20world&#39;s%20top,to%20be%20proficient%20with%20languages</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d9cc7a5068a" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/what-is-node-js-6d9cc7a5068a">What is Node.js?</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is a REST API?]]></title>
            <link>https://codeburst.io/what-is-a-rest-api-9a42940f2155?source=rss-1af626b4d5a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a42940f2155</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Rahil Sarvaiya]]></dc:creator>
            <pubDate>Tue, 15 Dec 2020 23:12:50 GMT</pubDate>
            <atom:updated>2021-06-19T05:42:27.306Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Xat2lyP_29L1N6Ll" /><figcaption>Photo by <a href="https://unsplash.com/@balazsketyi?utm_source=medium&amp;utm_medium=referral">Balázs Kétyi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Have you heard people talk about using REST APIs on the web? Do you know how communication takes place the moment you click something on the internet? Have you wondered how the internet allows you to send and receive data so comfortably? Keep reading to get more information on how communication on the internet works.</p><h4>What is an API?</h4><p>Before we dive into what exactly a REST API is, we need to understand the meaning of an API (which stands for Application Programming Interface) and its role in sending and receiving data. <em>According to </em><a href="https://en.wikipedia.org/wiki/API"><em>Wikipedia</em></a><em>, API or Application Programming Interface is a computing interface that defines interactions between multiple software intermediaries. </em>Let’s break it down into simpler terms. An API is an interface that helps an application connect to another application. It is the medium through which data can be sent and received between applications on the internet. Every time we are browsing a website on our Laptops, or using an application on our mobile phones, we are essentially using an API.</p><p>Let’s try and understand it using a real-life example. Imagine you visit a library and want a particular book. At first glance, you probably won’t be able to find the book, and so you take the help of the librarian asking where this book would be. Now the librarian is left with two options, either he goes to the section of the library, retrieves the book and gives it to you, or directs you to the correct section and makes sure you get the book. He takes your request (of getting Book X) and makes sure you get back a response (get your Book X). This is similar to what an API does, for an online bookstore or book purchasing app (like amazon). When you select a particular book, the API will send the request to the server, the server will check the database if that book is yet available, and then send a response back. The API gets this response and sends it back to you in a legible format that can be interpreted by you. In case of an error, the API will handle this error and send it across in a readable way.</p><p>Moreover, APIs also act as an additional level of security. Your phone is never completely exposed on the server, and the server’s data is never fully exposed to your phone. It is through these APIs that the data is sent and received, thus adding an additional level of security by sharing only the necessary bits. Now that you know what an API is, let dive into REST APIs.</p><h4>REST APIs</h4><blockquote>REST stands for Representational State Transfer, and was introduced in 2000 by Roy Fielding. REST is an architectural style that consists of 6 constraints that must be satisfied for it to be referred to as RESTful. In simpler terms, it is a set of rules that are followed by developers, to make sure the data is sent and received in a specific format. The API defines how the communication takes place, while REST defines how the API should be formatted. The request sent is the URL and the response is the data that is sent back to you.</blockquote><h4>The six constraints that should be satisfied for an API to be RESTful are:</h4><ol><li><strong>Uniform Interface<br></strong>A uniform interface should be used between the client and the server for all the APIs. Once a developer has worked on an API of a class, he should be easily able to work on other APIs of the same class. By applying a uniform interface, the architecture is simplified, and understanding of the APIs is improved. It becomes easier for someone to implement the API, as the standard interface is the same. The four guiding principles of the uniform interface are as follows:<br>- Resource-Based<br>- Manipulation of Resources Through Representations<br>- Self-descriptive Messages<br>- Hypermedia as the Engine of Application State (HATEOAS)</li><li><strong>Client-Server<br></strong>The client and server should be two independent separate entities. The client does not deal with data storage, improving client portability and the server does not deal with the user interface, improving server scalability.</li><li><strong>Stateless</strong><br>Each request from the client to server must contain all the necessary information as part of the URI, query-string parameters, body, or headers, to process that request. The session state should be present entirely on the client and should not leverage any stored context on the server.</li><li><strong>Layered System</strong><br>A layered system improves the architecture and system scalability by enabling load-balancing. Layer systems may also enforce security policies and provide shared caches for better performance.</li><li><strong>Cacheable</strong><br>Clients can cache their responses. Thus, the responses must explicitly be labeled as cacheable or non-cacheable to prevent the clients from reusing unfitting data in response to further requests.</li><li><strong>Code-on-demand (optional)</strong><br>Client functionality can be extended by executing scripts. Servers can extend their functionality to the client allowing it to execute its logic.</li></ol><p>If an API satisfies these above-mentioned constraints, it is called a RESTful API. REST APIs usually take place over HTTP when used for web APIs. Hence REST APIs make a call from the client to the server and return the response as data over an HTTP protocol.</p><h4>Hands-On</h4><p>Now let’s test an API request. For the sake of this example, we will use the Twitter API to get tweets about a specific word we input. <br>Before testing this API, you will need to make a <a href="https://developer.twitter.com/en/apply-for-access">Twitter Developer Account.</a> After entering your use case for this API, and confirming your email, you will be asked to enter your project name. You can select the project name of your choice, provided it is not already taken, and then you will be given Authorization credentials — an API key, an API secret key, and a Bearer Token. You can use these credentials when you make an API request.</p><h4>Testing the Twitter API</h4><p>You can use Postman to test your API. Postman provides tools that make API development easy. <br>1. Open a new tab and select the GET request. Enter the API request as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KuUWReTNExZ1PSE1LcosmQ.png" /></figure><p>2. Click the authorization tab, and enter the Bearer Token as provided for your project while making your Twitter Dev Account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2UgDlAfmcW6kHi_mGd5wkA.jpeg" /></figure><p>3. Make sure you have the following fields in your Headers tab. Your Authorization field with contain your Bearer Token and the Cookie will contain the personalization_id and guest_id which will be unique to you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RPD71FP7ebHnblLd_VauoQ.jpeg" /></figure><p>4. Now click the send button and you will be able to view the response below. The response contains the data that satisfied the query parameter as entered by us (vaccine for this example). Each data item contains an id which is the Tweet ID and the text field which is the Tweet Text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NlC13fpzsuAZ6a7xRBHauA.jpeg" /></figure><p>Congrats! You finally made your first API request. Feel free to play around with this API and you can refer to <a href="https://documenter.getpostman.com/view/9956214/T1LMiT5U#acd41db7-05bc-4359-be63-dd5249dfef32">this</a> for more information on using the Twitter API.</p><h3>Conclusion</h3><p>I hope you have gained some knowledge of REST APIs and now know how it is used for communication on the internet. If you liked this article and would like to read similar work, be sure to follow me on <a href="https://twitter.com/RahilSarvaiya">Twitter </a>where I’ll post updates about publishing my latest articles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a42940f2155" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/what-is-a-rest-api-9a42940f2155">What is a REST API?</a> was originally published in <a href="https://codeburst.io/">codeburst</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is JavaScript, Really?]]></title>
            <link>https://codeburst.io/what-is-javascript-really-f08482289f6f?source=rss-1af626b4d5a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f08482289f6f</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[web]]></category>
            <dc:creator><![CDATA[Rahil Sarvaiya]]></dc:creator>
            <pubDate>Wed, 25 Nov 2020 00:00:23 GMT</pubDate>
            <atom:updated>2021-06-19T05:41:22.547Z</atom:updated>
            <content:encoded><![CDATA[<p>And why is it the most commonly used programming language?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4EwyXwsdOxhIV3Wk" /><figcaption>Photo by <a href="https://unsplash.com/@grakozy?utm_source=medium&amp;utm_medium=referral">Greg Rakozy</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>According to the<a href="https://insights.stackoverflow.com/survey/2020#technology-programming-scripting-and-markup-languages"> Stack Overflow Survey of 2020</a>, JavaScript has been crowned as the most commonly used programming language for the eighth year in a row. So why is it so popular? What makes developers use it consistently? What’s so special about JavaScript that’s allowed the language to retain the top spot for so long?</p><blockquote>JavaScript, often abbreviated as JS, is a dynamic computer programming language. It is the language of the web. It is lightweight and allows you to implement complex features easily on the web. It allows you to create dynamic content on the web, and together with HTML and CSS can be used to make a complete website. JavaScript reduces server interaction, reduces response times, and improves interaction with the user, which makes it an important language for any web application. It is also important to note — programs written in JavaScript are often referred to as “scripts.”</blockquote><p>So now that you know what JavaScript is, let’s discuss why it’s being used almost everywhere. The biggest advantage of a multi-paradigm language like JavaScript is that it can be used on the client-side and on the server-side. It can execute on the browser as well on the servers. As a matter of fact, JavaScript can run on any device that has a JavaScript engine. Different web browsers have JavaScript engines that go by different names; for example, the V8 engine on Google Chrome and SpiderMonkey on Firefox. <br>So how exactly do these engines work? Well, these JavaScript engines that are embedded in a browser read by the JavaScript programs or scripts. They then convert this script into a language that can be understood by the machines called machine language. The machine then executes the code and performs the task.</p><p>Now let’s talk about some major frameworks that have adapted JavaScript and use it for client and server-side working. There are two main terms in web development — Frontend Development and Backend Development. The part of the website that interacts directly with the user and includes all the things that the user experiences directly on the screen is called the “Frontend” or “client-side”. The “Backend” or “server-side” is what we call the ‘behind-the-scenes’ work. It refers to the development that happens on the server-side and that makes sure that the client-side is correctly functioning; sending and receiving responses accurately.</p><h4><strong>Frontend JavaScript</strong></h4><p>React, Angular, and Vue.js are the three most popular JavaScript frontend frameworks.</p><ul><li>React is an open-source JavaScript-based Frontend library that was originally developed by Facebook. React uses a component-based architecture for building user-interfaces.</li><li>Angular (or Angular 2+) is a modified version of AngularJS (Angular 1.x) that became obsolete once React came out. It is maintained by Google. Angular is a complete framework compared to React which is only a library. Angular operates on real-DOM and two-way data binding, compared to React which uses virtual DOM and one-way data binding. In addition to this, React being smaller and more compact can sometimes be faster than Angular for smaller applications.</li><li>Vue.js, the youngest framework, was developed by an ex-Google employee, Evan You. It leverages concepts used in both React and Angular to build creative interfaces.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*MStmxLf35FfrH6Lpp2PEpg.png" /><figcaption>Photo on the Github star history of React vs Angular vs Vue from <a href="https://www.codeinwp.com/blog/angular-vs-vue-vs-react/">codeinwp</a></figcaption></figure><h4><strong>Backend JavaScript</strong></h4><p>Node.js is an open-source and cross-platform runtime environment that is used for running JavaScript code outside of a web browser. Node.js is not a framework or a language. It is a runtime environment that lets developers write command-line tools and server-side scripts outside of a browser. It is used widely by a large number of companies such as Paypal, Uber, Netflix, and many more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qRCzV8yrCj8p2wjuycaD5Q.png" /><figcaption>Node.js — A runtime environment for JavaScript</figcaption></figure><h4><strong>JavaScript for Mobile Application Development</strong></h4><p>JavaScript is not limited to web development. With the help of technologies such as React Native (created by Facebook), we can use JavaScript to build mobile applications as well. React Native is an open-source mobile application framework that is used to create native apps using React on Android and iOS using the same code. React Native works in a very similar manner to React, however, React Native does not manipulate the DOM via the virtual DOM. Instead, it runs directly in a background process on the end-device and communicates with the native platform via an asynchronous bridge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*GBg6Nv-NUhEU-I7YarxxcA.png" /><figcaption>React Native for Mobile App Development from <a href="https://dev.to/jessicabennett/react-native-still-a-profitable-choice-in-2019-5km">dev.to</a></figcaption></figure><p>In this way, JavaScript can be used in both web and application development. Moreover, with advancing frameworks JavaScript can be used as a Frontend and a Backend language. This not only makes JavaScript a popular language but also encourages the newer developer community to learn it as the same language serves all the purposes.</p><h4>Why the name JavaScript?</h4><p>When JavaScript was initially created, it was called “LiveScript”. However, there was another popular language at that time called Java so it was decided that positioning a new language as a “younger brother” of Java would help the evolution of this new language. But as it evolved, JavaScript became a fully independent language with its own specification called <a href="http://en.wikipedia.org/wiki/ECMAScript">ECMAScript</a>, and now it has no relation to Java at all.</p><h3>Conclusion</h3><p>I hope you have gained some knowledge of JavaScript and now know why it is one of the most popular programming languages in 2020. If you liked this article and would like to read similar work, be sure to follow me on <a href="https://twitter.com/RahilSarvaiya">Twitter </a>where I’ll post updates about publishing my latest articles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f08482289f6f" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/what-is-javascript-really-f08482289f6f">What is JavaScript, Really?</a> was originally published in <a href="https://codeburst.io/">codeburst</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microproductivity — The truth exposed.]]></title>
            <link>https://medium.com/@rahil1304/microproductivity-the-truth-exposed-e0054fcf5f1e?source=rss-1af626b4d5a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0054fcf5f1e</guid>
            <dc:creator><![CDATA[Rahil Sarvaiya]]></dc:creator>
            <pubDate>Fri, 29 May 2020 20:49:50 GMT</pubDate>
            <atom:updated>2020-11-18T17:20:58.140Z</atom:updated>
            <content:encoded><![CDATA[<h3>Microproductivity — The truth exposed.</h3><p>Making complex tasks seem more achievable and doable.</p><p>Have you ever got intimidated by the amount of work your colleagues do? Have you ever been surprised at how your friends can study more material than you? Have you been wondering how top CEOs accomplish so much work and yet find time for their hobbies and families?</p><p>If you’ve ever come across any of these questions, I suggest you keep reading to understand the truth behind how smart people work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Vx5TBWtgiXzqfMck" /><figcaption>Photo by <a href="https://unsplash.com/@sctgrhm?utm_source=medium&amp;utm_medium=referral">Scott Graham</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote><strong>Microproductivity is all about getting a lot accomplished in a small amount of time.</strong></blockquote><blockquote><strong>Microproductivity is the process of dividing an intricate and complex task, into small and mini-tasks so that they seem more doable and less intimidating.</strong></blockquote><p>Breaking down complex tasks into smaller tasks, makes them feel more achievable. It also reduces our ability to procrastinate. Thinking about the mammoth task ahead of us, will do nothing but scare us or make us feel like the workload is too much to handle. If we keep thinking about how we have so much left to do, we will only get more worried and stressed. Instead, if we break the same enormous task, into smaller tasks, not only will we be able to finish those tasks faster, but at the completion of these smaller tasks, we will feel more satisfied.</p><h4>How exactly does it work?</h4><p>Breaking down a large project into smaller to-dos helps us identify the steps we need to take next. A simple task seems more approachable and gives us a feeling of mental satisfaction upon completion. Moreover, specificity is really important. The main reason a task appears complex is because we do not know the specifics. If we knew every inch and detail of the project, it would appear easier and more manageable. In the same way, if we divide our tasks into smaller tasks, the specifics of the tasks get known to us. Specific goals force us to pursue them. It makes us think strategically and put in more effort as we have a clear idea of how successful completion will look like.</p><h4>Need an example?</h4><p>For example, let’s say you are <strong>planning on working on your fitness</strong>, and want to achieve those 6-pack abs you have always dreamed of. If you keep thinking about achieving those abs, it will feel like an impossible task to achieve. However, if you break it down into small tiny bits, like doing 100 crunches daily, or 500 daily jump ropes, a proper protein-rich diet, daily exercise routines with sufficient rest days, a calorie deficit every day, then our goal will definitely seem more achievable. In fact, we can further break down these tasks into smaller more achievable ones. We can break the 100 crunches into 4 groups of 25 and perform those while watching a movie, or perhaps while watching our favorite football match.</p><p>Another example, consider <strong>you want to cook a delicious 3-course meal for your family</strong>. Creating so many dishes, with so much delicacy and minute details, might seem like a cumbersome task. However, if we break this, into 3 separate dishes, separate the ingredients of each dish, slowly and steadily work our way up each dish, progressively approaching one at a time, our complete meal will be ready in no time. In addition to this, at the completion of our first dish, we would feel mentally more pleased that we have succeeded in creating a servable dish. This would boost our confidence, and make us work more strategically to save time on the other dishes.</p><p>In this way, by breaking down our big projects into smaller and more achievable tasks, we will be able to accomplish more work. The smaller tasks will feel less intimidating and daunting. If done correctly, it will be the springboard to our success story and our secret to achieving more in less time.</p><p>If you need some more help in breaking down your tasks, or if you are confused about how to approach a complex task, I suggest you read this <a href="https://blog.amazingmarvin.com/break-large-projects-tasks-bite-sized-tasks/">Guide </a>by <a href="https://blog.amazingmarvin.com/author/admin/">Christina Willner</a>, which talks about breaking down large projects into bite-sized tasks.</p><p>If you liked this, and would like to read more such articles, follow me on <a href="https://mobile.twitter.com/SarvaiyaRahil">Twitter</a>, where I’ll post updates about my next article.</p><p>I also suggest visiting the following links, if you want some more detailed information on Microproductivity and the science behind it.</p><ul><li><a href="https://www.lifehack.org/articles/productivity/micro-productivity-accomplishing-major-goals-with-minor-effort.html">Micro-productivity: Accomplishing Major Goals With Minor Effort</a></li><li><a href="https://blog.trello.com/microproductivity-break-tasks-into-smaller-steps">What&#39;s Microproductivity? The Small Habit That Will Lead You To Big Wins</a></li><li><a href="http://www.friendlyanarchist.com/mighty-micro-productivity/">Mighty Micro Productivity</a></li><li><a href="https://www.wired.com/story/microtasks-future-of-white-collar-work/">Microtasks Might Be the Future of White-Collar Work</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0054fcf5f1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How quarantine changed my life?]]></title>
            <link>https://medium.com/@rahil1304/how-quarantine-changed-my-life-b0590ae82432?source=rss-1af626b4d5a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0590ae82432</guid>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[coronavirus]]></category>
            <category><![CDATA[life]]></category>
            <category><![CDATA[happiness]]></category>
            <category><![CDATA[personal-development]]></category>
            <dc:creator><![CDATA[Rahil Sarvaiya]]></dc:creator>
            <pubDate>Sun, 10 May 2020 13:04:21 GMT</pubDate>
            <atom:updated>2020-06-18T18:54:56.719Z</atom:updated>
            <content:encoded><![CDATA[<p>A short story on how quarantine actually helped me.</p><h4>93 days and counting…</h4><p>As of writing this article, it’s been 2 months since the first day of quarantine. In the last few months, almost all of us have experienced some form of social-distancing or quarantine. Who knew that the last time I played football with my friends, would be the last outdoor activity for a long time. Who knew the last time I went to college traveling on the local train whilst listening to my favorite songs would be an experience I would miss. Who knew the last delicious enchilada I ate at my favorite restaurant, would be something I crave every weekend. Perhaps if I knew these experiences were going to be a luxury, I would have cherished them more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tNGnO8va_Y_RSKdC" /><figcaption>Photo by <a href="https://unsplash.com/@noahsilliman?utm_source=medium&amp;utm_medium=referral">Noah Silliman</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>How it all started?</h3><p>The first few days of quarantine, felt like forever. It was just me and my mind trying to process the situation. I could not digest the fact that the world had come to a standstill. I spent hours thinking about how I enjoyed my time outside playing football and how I enjoyed driving to my gym while listening to my favorite songs, singing like I’m about to win a grammy. It took me a while to accept the fact that my life was going to be like this, and even though I was initially anxious and upset, a part of me was looking forward to enjoying time with my family and this newfound “me-time.”</p><p>As days passed, I got a better grip on my life. I realized that contemplating about how the coronavirus has affected our daily schedule will do nothing but disturb my peace of mind. I figured that while most of us wouldn’t prefer this work-from-home lifestyle, we could use this time to set up a new habit, or perhaps learn that new skill which we never had the time for. It was at that moment I decided to use this “me-time” productively and try and build myself some skills that would help me in the future.</p><h3>Daily Routine and Timetable</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_iWoiYAvIp6vMTAn" /><figcaption>Photo by <a href="https://unsplash.com/@martenbjork?utm_source=medium&amp;utm_medium=referral">Marten Bjork</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>One of the biggest strategies that helped me stay productive and organized during quarantine was making a proper timetable of my daily schedule. I used Google Calendars to plan my entire day and used the principle of <a href="https://www.lifehack.org/articles/productivity/micro-productivity-accomplishing-major-goals-with-minor-effort.html">Microproductivity</a> to help me accomplish complex tasks. When walking on a tight rope, it’s way easier to concentrate on putting one foot ahead of the other, than looking around at how high we are or how far the final endpoint is. In the same way, breaking down large tasks into smaller tasks, and concentrating on completing these smaller tasks instead, makes the tasks feel more manageable and less intimidating. After weeks of trying out this technique, I can successfully say that Microproductivity is very helpful in reducing procrastination and helps in making difficult tasks look more doable. In this way, making an organized daily schedule not only helped me complete more work, but also helped me find more free time in the day for my other hobbies.</p><h3>Studying and Daily Learning</h3><p>I started off my lockdown period by practicing data structures and algorithms. Any Computer Science student knows how important this is to crack the coding interview and get that dream job of yours. I decided to practice daily and also registered for the <em>30-day Leetcoding Challenge</em>. After successfully completing the<em> April Leetcoding Challenge</em>, I have now started the <em>May Leetcoding Challenge</em> and hope to keep practicing Competitive Programming in the future. I also completed a course on Web Development, that introduced me to technologies such as MongoDB, Express, React, and Node.js, which further helped me in my college projects.</p><h3>Daily Exercise Routine</h3><blockquote>Just because you don’t have access to heavyweights, doesn’t mean you can’t stay fit at home.</blockquote><p>After solving problems and doing courses during the day, an intense workout in the evening was the perfect antidote for my body. One of the major challenges, we have had to deal with in the past few weeks, is that we do not have access to gyms. This leads to a disrupted exercise schedule for most people. But just because you don’t have access to heavyweights, doesn’t mean you can’t stay fit at home. A small bodyweight workout, or even skipping rope for 20 mins daily helps in loosening up your body and keeping you fit. People have been taking innovative exercise challenges on social media, and this has really helped everyone stay motivated. I personally have been doing the 150 push-ups per day challenge with a few of my friends, which not only keeps us active but also keeps us connected daily. In addition to this, the daily household chores such as washing vessels and cleaning the house was an additional moderate-intensity calorie burner that helped me burn more energy than being sedentary. In this way, a daily workout routine coupled with household chores helped me stay fit and strong which further boosted focus throughout the day.</p><h3>Cooking and Baking</h3><p>This quarantine period has also brought out the little Master Chef in me. I used my quarantine time to practice my cooking and baking skills and learn some new savory recipes. My mother taught me some of her basic 10-minute recipes and also gave me good tips and tricks while cooking. I also explored the baking side and made delicious Walnut Cake, Oreo Cake Crumble, and Pancakes with Hershey’s chocolate syrup. This experience has taught me that with a little effort, we all can learn some appetizing dishes and this period is the perfect time to experiment and bring out your inner Gordon Ramsay.</p><h3>Friends — Your indirect happiness</h3><p>In addition to studying, working out, and cooking, connecting with friends is important as they boost your happiness and reduce your stress. Thanks to the internet, all of us can stay in touch with our friends and the outside world. This quarantine period is the perfect time for us to rekindle that old friendship that has been lost over the past few years. It’s an opportunity for us to talk to our school friends and share some fond memories of happier times. I usually speak to my friends two-three times a week to add fullness to my life. Talking to friends helps me enjoy my time at home, and helps me de-stress after a tiring day.</p><h3>Family Time</h3><p>Another advantage of being quarantined at home is that you get to spend ample time with your family. You can talk to your parents whenever you want, crack jokes with them whenever you want, and can even enjoy dinner at the table together. Earlier, both my parents used to spend their days in the office and would be home only in the evenings. With work-from-home now, all of us can spend more time with each other and can also do some cooking together. My family and I have started having weekly card nights where we play a game or two of Monodeal and also weekly movie nights where we enjoy the latest Netflix movies. In addition to this, we often video call my brother who is currently pursuing his Masters and also my grandparents. This newfound Family Time has taught me to appreciate the little things in life, and find joy in the smallest of things, be it watching comedy movies together or even just sitting quietly in the room and reading the newspaper together.</p><h3>Reading — exercise for you mind</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a_j689cnGY_tuRRuY3NF6w.jpeg" /><figcaption>The book — Ikigai, The Japanese Secret to a Long and Happy Life by Hector Garcia and Francesc Miralles</figcaption></figure><blockquote>“Reading to the mind, is what exercise is to the body.”</blockquote><blockquote>— Joseph Addison</blockquote><p>I usually end my day with reading a book or a few important articles, that I had saved on my reading list. I hear a lot of people say that they wish they had time to read. Staying at home the entire day is a great excuse to finally make time for reading that book you always wanted to. Moreover, it’s an excellent opportunity to create a reading habit that you can continue even after quarantine ends. After completing 3 books in the past few weeks, I can say that reading does help keep the mind active. There is a myriad of benefits of reading daily — increased knowledge, memory improvement, vocabulary expansion, improved focus and concentration, stress reduction, to name a few. It is a healthy habit that according to me, every individual should include in his daily routine. Moreover, research has shown that reading improves brain connectivity and aids in sleep readiness. It’s never too late to take advantage of the various benefits of daily reading.</p><p>In this way, there are a lot of positive changes that this quarantine has brought upon us, and if we actually concentrate on the positives instead of the negatives, we will be grateful for all the little things in our life. All of us can make use of this adversity around us in a positive way to actually improve ourselves. We can use this distress as a catalyst for our daily journey to finding our purpose and making the best of our time. If you truly find that particular driving force in your life that gives you that reason to wake up every day, you too can be productive and make use of this “me-time” to its fullest.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0590ae82432" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>