<?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[Voice of Code - Medium]]></title>
        <description><![CDATA[Voice of Code is a global technical blogging community that plans to encourage people and makes sure that the voice of bloggers reaches beyond borders. We learn better by sharing our knowledge and experience - Medium]]></description>
        <link>https://medium.com/voice-of-code?source=rss----aa394f020b61---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Voice of Code - Medium</title>
            <link>https://medium.com/voice-of-code?source=rss----aa394f020b61---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 13:12:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/voice-of-code" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to get started: ARFoundation in Unity]]></title>
            <link>https://medium.com/voice-of-code/how-to-get-started-arfoundation-in-unity-f0a050b3585f?source=rss----aa394f020b61---4</link>
            <guid isPermaLink="false">https://medium.com/p/f0a050b3585f</guid>
            <category><![CDATA[unity3d]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[augmented-reality]]></category>
            <category><![CDATA[3d]]></category>
            <dc:creator><![CDATA[Aishani Pachauri]]></dc:creator>
            <pubDate>Sun, 15 Jan 2023 16:00:51 GMT</pubDate>
            <atom:updated>2023-01-15T16:00:51.304Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eEhc4v7Pxl8xKg_r9hlU4g.jpeg" /><figcaption>Handheld AR Application on Unity.</figcaption></figure><p>Prerequisites:</p><ul><li>To have an idea of what Augmented Reality is. (Spoiler Alert: Pokémon Go! is considered the correct answer if you understand the concept)</li><li>Install Unity 2019.4.15f1 or above with Android/iOS build support. Add modules in Unity Hub’s Installs section.</li></ul><h3>Why am I using ARFoundation?</h3><p>When getting started with augmented reality apps in Unity, you can develop two types of AR apps:<strong> marker-based and markerless</strong>.</p><p>Today, we are talking about markerless AR and using ARFoundation. Now for the sake of it, I’ll describe the package using fancy terms:</p><blockquote>AR Foundation is a set of MonoBehaviours and APIs that allow you to work with augmented reality platforms in a multi-platform way within Unity.</blockquote><p>Now that we have that formality out of the way, let’s discuss what the ARFoundation package actually does.</p><p><strong>It is a compilation of various utilities that help you detect plane surfaces, augment models and scan the environment before setting up objects to interact with.</strong></p><p>For building the app for android devices, we use Google’s ARCore SDK; for iOS, we use Apple’s ARKit<a href="https://clevertap.com/blog/what-is-an-sdk/"> SDK</a>.</p><h3>Getting Started</h3><p>Today, we will be building an AR app that will detect plane surfaces to place a 3D object on the detected plane.</p><p>Open Unity Hub and click on New. You will be shown various templates which may vary from version to version.</p><p>Choose 3D and after giving your project a name, click on create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*H-S410ujHZ5Q0jNz" /></figure><h3>Configure platform and player settings</h3><p>Change build settings depending on the type of device you will be building the app for. In this case, we are going for android.</p><ol><li><strong>File-&gt;Build Settings-&gt;Select Android (under platforms)-&gt;Switch Platforms</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-DnJou3cKLL-9zxs" /></figure><p>Next up we need to make some changes in Player Settings.</p><p><strong>2. Player Settings-&gt; Remove Vulkan from Graphics API</strong></p><p><strong>3. Uncheck Multithreaded Rendering</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/0*OwmpgsqczYpOYUDa" /></figure><p><strong>4. Scroll down to the Minimum API level (under Identification) and change it to Android 8.0 (minimum requirement for ARCore).</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ynjA4Yoi6a_JFL9E" /></figure><p>Close Player Settings and Add Open Scenes in Build Settings and close that too.</p><h3>Installing Packages</h3><p>Go to the menu and click on</p><ol><li><strong>Windows-&gt; Package Manager-&gt; Install ARFoundation &amp; ARCore XR Plugin</strong></li></ol><p>Make sure you have selected Unity Registry from the top left corner in the package manager pop-up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gzunn5R9t_4Ec7n-" /></figure><p>Close the pop-up window and come to the hierarchy.</p><p><strong>2. Delete the Main Camera.</strong></p><p><strong>3. Right Click on Hierarchy-&gt;XR-&gt;AR Session Origin.</strong></p><p>Repeat the same and <strong>add AR Session, AR Default Point Cloud and AR Default Plane.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GTRyDTmaqjRrMTUc" /></figure><p>Go to the bottom of your screen.</p><p><strong>4. In Assets, Right Click-&gt; Create-&gt;Folder</strong></p><p>Name it Prefabs and <strong>drag and drop AR Default Point Cloud and AR Default Plane in the folder.</strong></p><p>Delete AR Default Point Cloud and AR Default Plane from hierarchy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2sauIV4xf12HE4Ns" /></figure><p>Click on AR camera under AR Session Origin and set it as the Main Camera.</p><p>5. <strong>Inspector-&gt; Tag-&gt;Main Camera</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zgpglHH_JpqGuYJb" /></figure><p><strong>6. </strong>Click on AR Session Origin in Hierarchy.</p><p><strong>Add Component-&gt; AR Point Cloud Manager</strong></p><p>Drag and drop AR Default Point Cloud to Point Cloud Prefab section under AR Point Cloud Manager (Script).</p><p><strong>Add Component-&gt; AR Plane Manager</strong></p><p>Drag and drop AR Default Plane to Plane Prefab section under AR Plane Manager (Script).</p><p><strong>Add Component-&gt; AR Raycast Manager</strong></p><h3>Adding Script</h3><p>Now drag and drop the PlaneonPlane.cs script in the Prefabs folder which is available in ARFoundation samples. You can download it from here: <a href="https://github.com/Aishanipach/AR_BalloonGame/blob/main/PlaceOnPlane.cs">PlaneonPlane.cs</a> <em>(Link to Github repo)</em></p><ol><li><strong>Add Component-&gt; PlaneonPlane (script)</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ct5m2Ydg-K96ITuh" /></figure><p>Right-click <em>hierarchy</em> and <strong>click 3D object-&gt;Sphere</strong>.</p><p><em>Adjust size and position in Inspector for a better view in AR Camera.</em></p><p><strong>Drag the Sphere</strong> object from Hierarchy and place it in the <strong>Placed Prefab of Plane On Plane (script) component of AR Session Origin</strong>.</p><p>And you are done!</p><p><strong>File-&gt;Build settings-&gt; Build and Run</strong></p><p>Send the .apk file to your device and test out the app!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*JNRrbCzpGaBMh8hbabZ-Lw.jpeg" /><figcaption>Plane detection through the AR app.</figcaption></figure><h3>Resources:</h3><ul><li><a href="https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@1.0/manual/index.html">More on ARFoundation</a></li><li><a href="https://unity3d.com/partners/google/arcore">More on Google ARCore</a></li><li><a href="https://docs.unity3d.com/Packages/com.unity.xr.arkit@4.1/manual/index.html">More on ARKit</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0a050b3585f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/voice-of-code/how-to-get-started-arfoundation-in-unity-f0a050b3585f">How to get started: ARFoundation in Unity</a> was originally published in <a href="https://medium.com/voice-of-code">Voice of Code</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crafting CFPs that strike a chord: Conferences are cool, speaking at them is cooler]]></title>
            <link>https://medium.com/voice-of-code/crafting-cfps-that-strike-a-chord-conferences-are-cool-speaking-at-them-is-cooler-66792c212f52?source=rss----aa394f020b61---4</link>
            <guid isPermaLink="false">https://medium.com/p/66792c212f52</guid>
            <category><![CDATA[speakers]]></category>
            <category><![CDATA[community]]></category>
            <category><![CDATA[conference]]></category>
            <category><![CDATA[proposal-writing]]></category>
            <category><![CDATA[cfp]]></category>
            <dc:creator><![CDATA[Harshita Jain]]></dc:creator>
            <pubDate>Sun, 15 Jan 2023 15:59:30 GMT</pubDate>
            <atom:updated>2023-01-15T15:59:30.374Z</atom:updated>
            <content:encoded><![CDATA[<p>Although I am still not cool enough (better word: <em>experienced</em>) to claim that ‘keynote speaker’ is my middle name, all I can say through the little understanding that I have gathered by speaking at a handful of conferences like Google’s Devfest India or Major League Hacking’s Hackcon is that conferences are really cool, but getting a chance to speak at them is unimaginably cooler. When I say cool, I’m not just speaking about all the speaker drip and the headshots with a mic that soon make it to one’s LinkedIn profiles. From ‘cool’ here, I refer to all the exposure, career opportunities, and networking prospects that come one’s way by sharing their experiences and learnings on reputed global platforms. (<em>and maybe also the cool speaker schwag :D</em>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GSCtkNNK3hHsBn2ah4pX5A.jpeg" /></figure><p><strong><em>The best part is that you neither need to be a subject matter expert nor an orator as influential as Hitler to get your first breakthrough as a spokesperson at a conference. At least I wasn’t any of the two when I began this journey.</em></strong></p><h3><strong>It all starts with a CFP </strong>🗒️</h3><p>Almost any conference you wish to speak at requires you to submit a CFP (Call for Proposals or Call for Papers) within a stipulated window. A CFP demands that you must have a rough idea (usually called <strong><em>abstract</em></strong>) of what you wish to speak about. Usually, the abstract required is no more than a paragraph long as the organizers seek just the gist of your idea. CFP forms are usually accompanied by questions revolving along the lines of why you are the best person to give the particular talk you submitted a proposal for. Other details sought are the applicant’s bio and social media handles (<em>Twitter and LinkedIn FTW; for tech-centric talks, GitHub reigns supreme too</em>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Tkd2xNlhnAzfXmcFKGdMPw.gif" /></figure><p>Having a concrete outline of what you will be speaking about in some conference that lies 2–6 months ahead is neither ideal nor expected. Just having a rough idea suffices provided you craft it amazingly in your proposal and feel capable of doing so in your final talk as well. There is a reason here why the abstract is called <em>‘abstract</em>’ and why giving intricate details about your talk isn’t considered an optimum move because believe it or not, your opinions, thoughts, and ideas regarding a particular topic are bound to evolve in the time span between the proposal submission and the conference day.</p><h3>Storytelling FTW! 🎤</h3><p>Jargon is great but there is a reason people will be attending your talk rather than spending their time reading Wikipedia articles on the topic you are speaking about. To write interesting and unique CFPs, the best approach is to adopt narratives that are derived from personal experiences. This approach not only holds true for the CFP but can also be used while curating your keynote. Here’s an example to understand this better:</p><p>Let’s say you are delivering a beginner-friendly talk revolving along the lines of the ‘best game development engine for amateurs’. Rather than beginning your proposal with a conventional ‘I will be speaking about the best game development engine that can be used by beginners to create their very own games….’, narrate in a line or two, some personal experience related to the domain. Maybe talk about the feeling invoked within you when you solved a bug after a week of brainstorming on the relevant game engine and how it helped you find out that game development was your <em>ikigai</em>, maybe talk about how you realized XYZ game engine is beginner friendly while running mentorship cohorts for the same in your college.</p><blockquote>Example: “I still remember relentlessly making the dinosaur jump over the cacti as an eleven-year-old child whenever there was a network outage. Little did I know that ten years down the line I would be making my own game prototypes in the XYZ game development engine which proved to be an extremely beginner-friendly software.”</blockquote><p><em>This won’t just pique the initial interest of the reviewer/listener in your CFP/talk but might also lead to some point or instance of relatability. Also, since you are adopting storytelling in your proposal or talk, it becomes more inclusive because of the ease of understanding it offers and your target audience becomes bigger.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6s7KR2p4DDDLPOEDfwvbmg.jpeg" /></figure><h3><strong>Not everything is about stories though </strong>📕</h3><p>Note that for conferences that are niche and are extremely focused on a particular tech stack, extremely informal means of storytelling might not be the right way to proceed. Technical jargon in those cases is a requirement. Not everything about ‘Kubernetes’ or ‘Building Web APIs with Flask’ can be turned into a story. If the session is being targeted at an experienced lot of folks who have been in some particular tech domain for decades, there is no problem at all to proceed with technical jargon.</p><h3><strong>Notes to Organizers </strong>🧠</h3><p>Oftentimes, there is a field in the CFP forms asking if you would like to leave a note for the organizers. While leaving this field empty won’t have any dire impact on your proposal application, filling it might lead to an upper hand. Here are a few examples of what can be written as a note to the organizers:</p><ul><li>If you have delivered the same talk before at some conference or spoken on some similar topic elsewhere, it is worth mentioning the same in the “<strong><em>Notes to Organizers”</em></strong> section. If the talk was virtual and you happen to have a link to the recording/live stream, sharing the same would further help. Mentioning a line or two related to how the prior response to the session has been will also accentuate the value of your proposal. 📹</li><li>Similarly, if you have a published blog or paper already on the topic you are submitting the proposal for, adding its link is a bright move.</li><li>If there is a niche of individuals you wish to target through the session, let’s say you aim to target only experienced Docker developers through your talk, mentioning the same in notes won’t just help the organizers better in knowing your background or classifying your session but might also save their time by appointing the right reviewer for the same. In some CFP forms, the domain of your session is additionally asked as a separate field; hence, this step is not required in those cases.</li><li>If the question “<strong><em>Why are you the best person to deliver this talk?</em></strong>” is not asked separately in the application and if you have an answer to the same (a modest one), then mentioning the same in a line or two might prove to be a great add-on provided it embarks upon your professional experience in that particular domain.</li></ul><h3><strong>It’s all about taking the plunge </strong>🏊</h3><p>Common thoughts that might be arising in your mind right now:</p><ul><li>I either see only veterans or that extremely famous tech YouTuber speaking at conferences. What are the chances my proposal would be selected over such big shots?</li><li>I’m just a beginner in this particular tech stack/domain. Why would anyone select my proposal when there are such experienced folks working in this domain for decades?</li><li>Where are these conferences even happening? How am I supposed to keep track of them?</li><li>Networking, huh, I am too good at that. What else do I get out of speaking at a conference or putting in the work to submit proposals?</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R8Oe-AvbUbt-TMcS08hdpQ.jpeg" /></figure><p>As I said before, the aim of these conferences is not to pick the most experienced person in a particular field and hand them the mic to utter the postulated theories or their code snippets. The intent is to find a diverse lot of people and to let them share their first-hand interpretations, experimentation and experiences with a particular tech stack or domain. Conferences and CFPs are neither about exorbitant language usage nor about being an MUNer since childhood nor about the depth of knowledge about a particular topic.</p><blockquote><strong>CFPs are about finding a middle ground between being a subject-matter expert yourself and helping others become one through your talk (having a decent amount of knowledge about your domain/topic of interest makes it easier to establish this common ground in my opinion).</strong></blockquote><p>Long story short, it’s all about taking that plunge. There’s a reason why they say people who are two steps ahead of you can teach you better than people who are miles ahead. You passing the exam by studying just a single night before from your friend and not understanding a word the professor utters during the classes is a classic example of the aforementioned statement. The initial intent before writing this blog was not to mention stuff like “‘ProWritingAid’ is an extremely useful tool when it comes to technical writing or proposal drafting.” I believe such knowledge is always just a single Google search away. The intent was to encourage more student developers, researchers, and developer evangelists to take the plunge and apply to become speakers, volunteers, facilitators, or organizers at conferences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xzawvJvmlDEr2JvLD93mnQ.jpeg" /></figure><p>Coming to the question of keeping track of these conferences, there’s <strong>no one-stop destination</strong> for the same. There are multiple ways to go about this but two prominent ones are:</p><ul><li><em>Following people</em> on Twitter who are active in the developer ecosystem as evangelists or DevRels is one way to keep track of the conferences. Following the conference page itself too will let you know of not only the CFP deadline but the entire conference structure, right from the deadline for ‘call for volunteers’ forms to the deadline for ‘call for sponsors’ forms. When it comes to opportunities, Twitter is the new LinkedIn :)</li><li><em>Talk to people</em>. Simply talking to people (especially students because they have ample time to reply to your queries as compared to working professionals) who are engaged in the conference ecosystem will help you know more about their journey and all that the process of being at a conference as a speaker or a delegate entails.</li></ul><p>It’s a common misconception when I use the word ‘tech-conference’ that they would be extremely niche or tech-centric but that’s not true.</p><blockquote>If you design animations or interfaces, there are global conferences for you. If you are a hackathon organizer, there are conferences for you. You write code, you manage products, you make games, you run communities, you create documentation, you contribute to open-source, for everything that you do, there are abundant global conferences.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5drtArMZX7DbwSVomVR5Lg.jpeg" /></figure><h3>Just dopamine? 🧪</h3><p>Coming to what will you get out of the entire cumbersome process of searching for conferences and submitting proposals for them, I believe there is no objective or quantifiable answer to this. The opportunities that open up are immense, the chance to slowly build a personal brand for yourself that can be leveraged ahead in your career is paramount and the entire process right from submitting a proposal to the joy of getting a selection email to the hassle of booking your travel to the skepticism while making your presentation and then finally speaking at the day of the conference is a bliss. As a student, there will be multiple instances when your keynote day will be just a day before your exam or maybe it will collide with your exams, but that’s the fun part, right — getting to manage a whole lot of college with a conference?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vclKI8YfNpzv7Pyy2HDKwA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*poAhMs2AsRQPn1fznBkkaQ.jpeg" /></figure><blockquote>The gist is that you never know how being at the right place at the right time (<strong>not in a fairy-tale way but in a career-oriented way</strong>) might get you to places which otherwise might have seemed so far-fetched your entire life. So, keep the ball rolling and keep crafting CFPs that strike a chord with the student developer community!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66792c212f52" width="1" height="1" alt=""><hr><p><a href="https://medium.com/voice-of-code/crafting-cfps-that-strike-a-chord-conferences-are-cool-speaking-at-them-is-cooler-66792c212f52">Crafting CFPs that strike a chord: Conferences are cool, speaking at them is cooler</a> was originally published in <a href="https://medium.com/voice-of-code">Voice of Code</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Write for Us ✍]]></title>
            <link>https://medium.com/voice-of-code/write-for-us-abc62a4efda7?source=rss----aa394f020b61---4</link>
            <guid isPermaLink="false">https://medium.com/p/abc62a4efda7</guid>
            <category><![CDATA[write]]></category>
            <category><![CDATA[technical-writing]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Sanya Sinha]]></dc:creator>
            <pubDate>Sun, 20 Mar 2022 15:49:52 GMT</pubDate>
            <atom:updated>2022-04-15T19:06:42.588Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YH7m4ia06de9xIrxdIFYLw.png" /></figure><p><strong>Voice of Code (VoC)</strong> is a non-profit platform managed by <a href="https://studentambassadors.microsoft.com/"><strong><em>Microsoft Learn Student Ambassadors</em></strong></a> seeking to foster technical acumen amongst readers via educational blogging. The Medium publication is a collection of enlightening, lucid content seeking to empower the readership with cutting-edge technical knowledge. It aims to be a one-stop destination for all your technical cravings!</p><p>Being an all-inclusive community, fresh writers from any background are welcomed to contribute to the noble venture. It is the perfect platform to demonstrate your technical zest and eloquence. <strong>VoC gives full credit to the writers and abets them to create personalized writing portfolios they could present professionally.</strong></p><p>To ensure uniformity and quality in the articles contributed, <strong>VoC Editorial </strong>recommends all contributors adhere to the <strong>General Guideline </strong>of the community, which consists of <em>Medium Essentials</em><strong>, </strong><em>Content Guidelines, </em>and <em>Catchy Content Creation Tips</em>.</p><h3>It is important to note that the contributions disregarding the guidelines are liable to rejection. Writers willing to have their content published must agree to comply with ALL the guidelines.</h3><h3>Medium Essentials</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jWc7tnQzNfJdlpCR.png" /></figure><p>Source: VoC Design</p><ol><li>The Medium profile of the writer must be complete with a <strong>name</strong>, a <strong>crisp bio</strong>, and a <strong>formal profile picture</strong>.</li><li>All writers<em> must</em> follow the <a href="https://medium.com/voice-of-code"><strong><em>Voice of Code Official Publication</em></strong></a><strong><em> on Medium</em></strong>.</li><li>The article must comply with<strong> </strong><a href="https://policy.medium.com/medium-rules-30e5502c4eb4"><strong>Medium rules</strong></a><strong>, Medium </strong><a href="https://blog.medium.com/ad-free-medium-aeee8ef5dacf"><strong>Ad-free policy</strong></a><strong>, </strong><a href="https://policy.medium.com/member-content-guidelines-e81e2e345294"><strong>Member Content Guidelines, </strong></a>and <a href="https://help.medium.com/hc/en-us/articles/360006362473-Medium-s-Curation-Guidelines-Everything-Writers-Need-to-Know"><strong>Distribution Standards</strong></a>. Any deviation from the aforementioned guidelines would result in rejection.</li><li>If the writer is already enlisted as an <strong>official writer</strong> of the <a href="https://medium.com/voice-of-code">Medium publication</a>, she/he may simply submit the <strong>draft</strong> article (not yet published) via Add to publication option and wait for review.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*CFGtoiGPNYYTB1ea.png" /></figure><p>Hit the 3 dots on the top-right corner and select ‘Add to Publication’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/0*s-0NAJHU1EZ-7mcy.jpeg" /></figure><p>Choose Voice of Code publication and hit Select and continue.</p><p>5. However, if the writer is <strong>NOT </strong>a member of the publication, she/he <strong>MUST drop a mail </strong>to <strong><em>voiceofcode@gmail.com</em></strong> with the following content:</p><ul><li><strong>Subject</strong>: Application to Join VoC Medium Publication as an Author</li><li><strong>Body</strong>: A short introduction of the writer including<strong> <em>skill-sets, past experiences, the total no. of hours he/she could devote per month to VoC, </em></strong><em>and </em><strong><em>a succinct answer to why is she/he interested to join the publication</em>.</strong></li></ul><p>The application would take typically 5–7 days to be reviewed. If the team finds the applicant a good fit for the role, she/he would be further contacted over email and added to the Publication. <strong>VoC has autonomous rights to select and reject applicants.</strong></p><h3>The article could be submitted only after obtaining the official writer status under the platform.</h3><h3>Disclaimer: Any writer displaying prolonged inactivity from the publication (no new article submission in 4 consecutive months) would be discontinued as a writer for VoC.</h3><h3>Content Guidelines</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yWsGpUSHV0ILFUBk.png" /></figure><p>Source: VoC Design</p><ol><li>The content submitted must be previously <strong>unpublished</strong> and <strong>plagiarism-free</strong>. <a href="https://smallseotools.com/plagiarism-checker/">Plagiarism-checking tools</a> must be used by the writer before submission. Plagiarized articles will NOT be reviewed once identified.</li><li>A royalty-free image should be added as a header image for enhancing the attractiveness of the article. <a href="https://unsplash.com/">Unsplash</a>, <a href="https://pixabay.com/">Pixabay</a>, or <a href="https://www.pexels.com/">Pexels</a> may be used for obtaining images. Alternatively, the author herself/himself can design and create the header image as well, having the dimension of at least <strong>1500px width </strong>and <strong>750px height</strong>. The photographer/creator of the image must be given due credit in the <strong><em>Resource</em></strong> section of the article.</li><li>The articles contributed must be lucid yet illuminating. Writers must maintain the quality of the articles by ensuring <strong>compelling story-telling born out of immense research</strong>.</li><li>The content must be in <strong>English (US)</strong> and should be <strong>free from grammatical errors, misspellings, and typos</strong>. <a href="https://app.grammarly.com/">Grammar-checking tools</a> must be used by the writer before submission.</li><li>Every article must end with a <strong>Resource</strong><em> </em>section which must contain all the references cited in the article.</li><li>Images and graphics enhance the quality of content and improve readability and comprehension. To reduce copyright risks and dependencies, VoC advises writers to create their images/diagrams using tools like <a href="https://www.canva.com/"><strong>Canva</strong></a><strong> </strong>or<strong> </strong><a href="https://app.diagrams.net/"><strong>D</strong></a><strong>iagrams.</strong> However, VoC also accepts royalty-free images from platforms such as <a href="https://unsplash.com/"><strong>Unsplash</strong></a>, <a href="https://pixabay.com/"><strong>Pixabay</strong></a>, and <a href="https://www.pexels.com/"><strong>Pexels</strong></a>, <strong>if the photographers/creators are given due credit in the <em>Resource </em>section of the article. </strong>In<strong> </strong>case the writer doesn’t add a <strong><em>Resource</em></strong> section,<strong> </strong>credits can also be hyperlinked in the Image Captions.</li><li>Any multi-line code snippets to be included in the article should be attached via <strong>GitHub </strong><a href="https://gist.github.com/"><strong>Gist</strong></a><strong>s</strong>. To render the code, the URL of the respective gist must be pasted into the draft. Alternatively, source code image generator tools such as <a href="https://carbon.now.sh/">Carbon</a> can be used to attach beautiful code snippets.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*G4pqP1geVcqx_VOD.jpeg" /></figure><p>Resource Section</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FokLUuxcRXNjdX-b.jpeg" /></figure><p><a href="https://www.pexels.com/photo/person-typing-on-computer-keyboard-2058128/">Pexels.com:Oleg Magni</a></p><p>8. Voice of Code is an educational platform and <strong>does NOT publish fiction/poetry</strong>. All contents <strong>MUST </strong>be educational and related to <strong>STEM (Science, Technology, Engineering, and Mathematics) </strong>fields only.</p><p>9. The content must be suitable for readers of all ages. <strong>Sexually explicit, violent, demeaning, and offensive content will NOT be reviewed and the writer may get banned from the publication for such submissions.</strong></p><p>10. <strong>Promotional content/spam</strong> <strong>will NOT be reviewed</strong>.</p><p>11. Content must be free from all<strong> calls to action (CTA</strong>) prompting the readers to indulge in activities benefitting the writers or 3rd parties such as sign-up forms or service purchases.</p><p>The aforementioned guidelines <strong>MUST </strong>be adhered to while drafting articles.</p><h3>How To Create Catchy Content?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Nqxk8Eeng27M-nY9.png" /></figure><p>Source: VoC Design</p><p>Every writer is unique and has a broad spectrum of unparalleled contributions they could make to enrich the community. Voice of Code seeks to give writers umpteen flexibility to get their creative juices flowing.</p><p><em>Here are a few tips writers could use to make their articles stand out from the crowd:</em></p><ol><li>Start with a catchy title and a coherent subtitle. Titles should reflect what the article is about and should <strong>NOT </strong>be clickbait. A <a href="https://coschedule.com/headline-analyzer"><strong>headline-analyzer </strong></a>may be used to get more traffic. Medium has in-built SEO tools for traffic management as well. Hit the <strong><em>three dots on the top-right corner</em></strong> →<strong><em>More Settings</em></strong> → <strong><em>SEO Settings </em></strong>for optimized suggestions.</li><li>The <strong>header image</strong> needs to be eye-catchy and attractive.</li><li>Start with an interesting introduction to the topic and create a context that would provide readers with background information about the article. The writer’s stance on the topic must be made clear in the introduction itself.</li><li>The article must be <strong>well-formatted </strong>to enhance readability.</li><li>The body should contain <strong>at least 400 words (approx. 5 mins) </strong>to deliver complete information to the readers. <strong>Sub-headings </strong>should be used to properly demarcate the different sections of the article. Transitions between paragraphs must be smooth.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/0*0oJsP0dJGx0YEnDy.jpeg" /></figure><p>Subheadings</p><p>5. All the paragraphs of the body must contain detailed analyses and testified pieces of evidence. Statistics and numbers help in establishing trust amongst the readers. All sources of the data must be cited in the <strong>Resources </strong>section.</p><p>6. To optimize articles for search engine rankings, Voice of Code recommends writers use an <a href="https://www.wordtracker.com/"><strong>SEO tool</strong> </a>to find keywords. However, stuffing keywords haphazardly for the sake of search engine optimization is strongly <strong>DISCOURAGED</strong>. VoC greatly appreciates quality content and would NEVER compromise on quality for optimization.</p><p>7. While concluding, analytical inferences drawn from the body of the article should be stated. The article can be terminated on a high note with a promise of a progressive future.</p><p><strong><em>Voice of Code loves having new contributors and strives for diversity and inclusion in its contribution base. Writers from all around the world, pursuing any career are welcome to contribute to the community. Voice of Code awaits your participation and wishes you the very best!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=abc62a4efda7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/voice-of-code/write-for-us-abc62a4efda7">Write for Us ✍</a> was originally published in <a href="https://medium.com/voice-of-code">Voice of Code</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to ARIMA Model]]></title>
            <link>https://medium.com/voice-of-code/introduction-to-arima-model-20855ba56c0d?source=rss----aa394f020b61---4</link>
            <guid isPermaLink="false">https://medium.com/p/20855ba56c0d</guid>
            <category><![CDATA[regression]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Voice of Code Editorial]]></dc:creator>
            <pubDate>Fri, 01 Oct 2021 16:06:01 GMT</pubDate>
            <atom:updated>2021-10-24T18:07:47.147Z</atom:updated>
            <content:encoded><![CDATA[<h3>A brief introduction followed by implementation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/0*gzAKhhdSmVHXknOm.png" /></figure><p>Source: <a href="https://www.freestockcharts.com/">freestockcharts.com</a></p><p><strong>ARIMA</strong> or <strong>Autoregressive Integrated Moving Average</strong> is a purely regressive model and this model is used for forecasting values of a time series.A time series is essentially a sequence of data points or observations taken at different instances. Time Series are very common to find given how time-dependent most of the worldly schemes and variables are. To better understand this, take a look at the <em>Stock Market</em> or <em>weather reports</em> gathered over a timeline and you’ll observe patterns that are highly time-dependent.In this post, we’ll first cover the theory and then move on to the code.</p><blockquote><strong>Theory</strong></blockquote><p>One of the best ways to be introduced to the model is to understand why we’re using it, especially when other effective regression models like <strong>linear regression</strong> or <strong>multivariate regression</strong> exists. For time-series forecasting, why do we prefer the ARIMA model?Most of the time-series data available online focus on the dependent variable, and how the dependent variable changes with time. For models like linear regression, we need independent variables to map a function from dependent variables to dependent variables for prediction. However, this is not always possible because:-</p><ol><li>Independent Variables are not always available.</li><li>In quite a few scenarios, too many independent variables exist and we may find it difficult to find enough dependent variables to sufficiently explain the behavior of the time series.</li></ol><p><em>On the other hand, ARIMA leverages the correlation between the values of the time-series and time, allowing it to better understand the relationship between independent variables and time. Since the model focuses more on patterns and behavior of the time series instead of finding out which factors affect these dependent variables, the model is able to forecast on the basis of these recognized patterns and behavior.</em></p><p>To better understand this model, let’s break it down into 2 parts and then integrate those 2 parts in the end.</p><blockquote><strong>AR or Autoregressive Model</strong></blockquote><p>The intuition behind this model is that observations at different time-steps are related to the previous value of the variable. For example, on a hot sunny day, you predict that the next day will be hotter because you’ve noticed increasing temperatures. Similarly, the <strong>AR model </strong>finds the correlation between future time-steps and past time-steps to forecast future values.</p><blockquote><em>Yₜ = α + β₁Yₜ − 1 + β₂Yₜ − 2 + ⋯ + βₚYₜ − p + ϵ₁</em></blockquote><p><em>By the above equation, we can see how we can reduce this to a regression problem and statistically find the correlation between future values and earlier time-steps.</em></p><blockquote><strong>Moving Average Model</strong></blockquote><p>The intuition behind this model in nature is of reinforcement, i.e, a moving average model tries to learn from the previous errors it has committed and tries to tweak itself accordingly. To better understand this, take a look at the equation below:</p><blockquote><em>Yₜ = α + ϵₜ + ϕ₁ ϵₜ ₋ ₁ + ϕ₂ ϵₜ ₋ ₂ + ⋯ + ϕᵩ ϵₜ ₋ ᵩ</em></blockquote><p>But, what does ϵ signify? Simply put, it is the error or the difference between the actual value and the predicted value.</p><p><em>Since this model tries to learn from its mistakes, it is better able to account for unpredictable changes in value and is able to correct itself to provide more accurate results and predictions.</em></p><p>Now that you’ve understood the <strong>Autoregressive Model</strong> and the <strong>Moving Averages</strong> model, it’s time to learn about <strong>ARIMA</strong>. When the Autoregressive Terms and the Moving Average terms are combined together with differencing to make the time-series stationary (more on this later), we get the ARIMA Model! Since the equation is regressive in nature, we can find the respective weights of the terms in the equation using regression techniques.</p><blockquote><em>Yₜ = α + β₁Yₜ ₋ ₁ + β₂Yₜ ₋ ₂ + ⋯ + βₚYₜ ₋ ₚ + ϕ₁ ϵₜ ₋ ₁ + ϕ₂ ϵₜ ₋ ₂ + ⋯ + ϕᵩ ϵₜ ₋ ᵩ</em></blockquote><p><em>So far, we’ve understood the basic intuition behind the ARIMA Model. Let’s dig a bit deeper and understand the parameters of an ARIMA model.</em></p><p>Consider a list below, and assume that every successive element of the list is a successive time-step or observation.</p><pre><strong>[ 1 , 3 , 5 , 4 ]</strong></pre><p>Now, when we difference the list, we subtract the nᵗʰ value of the series with the (n-1)ᵗʰ value of the series. For a better understanding:</p><h3>After first differencing:</h3><pre><strong>[ 3 – 1 , 5 – 3 , 4 – 5 ]= [ 2 , 2 , −1 ]</strong></pre><h3>After second differencing:</h3><pre><strong>[ 2 – 2 , −1 – 2 ] = [ 0, −3 ][ 2 – 2 , −1 – 2 ] = [ 0 , −3 ]</strong></pre><p>The reason why we difference the time-series is to make the time-series stationary, i.e, the mean and the variance of the time-series remain constant/stable over time which allows us to reduce components like <em>trend</em> and <em>seasonality</em> (illustrated later). This is important because ARIMA expects the time series to be stationary. Thus, we keep differencing the time series till it becomes stationary.</p><p><em>Now that we have understood all the underlying concepts that we’re going to utilize, let’s learn how to find these parameters and dive right into the code!</em></p><p>To begin with, let’s start with some basic imports.</p><pre>import pandas as pd<br>import numpy as np<br>import matplotlib.pyplot as plt<br>import seaborn as sns<br>import statsmodels.api as smplt.rcParams[&#39;axes.labelsize&#39;] = 14<br>plt.rcParams[&#39;xtick.labelsize&#39;] = 12<br>plt.rcParams[&#39;ytick.labelsize&#39;] = 12<br>plt.rcParams[&#39;text.color&#39;] = &#39;k&#39;from statsmodels.tsa.arima_model import ARIMA<br>from sklearn.metrics import mean_squared_error<br>% matplotlib inline</pre><p>For this post, I’m going to use a time series from the <em>Huge Stock Market Dataset</em>. This is just a sample time series used to further ground the concepts you read about. At the end of this post, you’ll be able to apply these concepts to any other time series you want to.</p><pre>aus1 = pd.read_csv( &quot;a.us.txt&quot; , sep = &#39;,&#39; , index_col = 0, parse_dates = True, squeeze = True )aus1.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*48QUNEgJRs4OCQz4" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*TZV2SkbJQ2-_qy--.png" /></figure><p>Source: Author</p><pre>aus1.describe()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vWx9F9yQiEwe5tsc.png" /></figure><p>Source: Author</p><pre>aus1.indexDatetimeIndex([&#39;1999-11-18&#39;,&#39;1999-11-19&#39;,&#39;1999-11-22&#39;,&#39;1999-11-23&#39;,<br>               &#39;1999-11-24&#39;,&#39;1999-11-26&#39;,&#39;1999-11-29&#39;,&#39;1999-11-30&#39;,<br>               &#39;1999-12-01&#39;,&#39;1999-12-02&#39;,<br>               ...<br>               &#39;2017-10-30&#39;,&#39;2017-10-31&#39;,&#39;2017-11-01&#39;,&#39;2017-11-02&#39;,<br>               &#39;2017-11-03&#39;,&#39;2017-11-06&#39;,&#39;2017-11-07&#39;,&#39;2017-11-08&#39;,<br>               &#39;2017-11-09&#39;,&#39;2017-11-10&#39;], <br>     dtype = &#39;datetime64[ns]&#39;, name=&#39;Date&#39;, length=4521, freq=None )</pre><p><em>Before we use this time-series, we first need to resample it into a time-series wherein each observation differs by a month.</em></p><pre>y1 = aus1[&#39;Open&#39;].resample(&#39;MS&#39;).mean()<br>y2 = aus1[&#39;Close&#39;].resample(&#39;MS&#39;).mean()<br>y1.index<br>DatetimeIndex([&#39;1999-11-01&#39;,&#39;1999-12-01&#39;,&#39;2000-01-01&#39;,&#39;2000-02-01&#39;,<br>               &#39;2000-03-01&#39;,&#39;2000-04-01&#39;,&#39;2000-05-01&#39;,&#39;2000-06-01&#39;,<br>               &#39;2000-07-01&#39;, &#39;2000-08-01&#39;,<br>               ...<br>               &#39;2017-02-01&#39;,&#39;2017-03-01&#39;,&#39;2017-04-01&#39;, &#39;2017-05-01&#39;,<br>               &#39;2017-06-01&#39;,&#39;2017-07-01&#39;,&#39;2017-08-01&#39;,&#39;2017-09-01&#39;,<br>               &#39;2017-10-01&#39;,&#39;2017-11-01&#39;],<br>        dtype=&#39;datetime64[ns]&#39;, name=&#39;Date&#39;, length=217, freq=&#39;MS&#39; )</pre><p><em>So far, so good! Let’s plot the time-series and see what it looks like!</em></p><pre>y1.plot(figsize=(15, 6))<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*IpERKerj9kfaa14q" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*wf5IsjDHm7sy5i6f.png" /></figure><p>Source: Author</p><p><em>Now that we’ve seen what it looks like, let’s try breaking it down into its components. Let’s try extracting the trend, the seasonality and the residual of our time-series.</em></p><pre>from pylab import rcParams<br>rcParams[‘figure.figsize’] = 18, 8<br>decomposition = sm.tsa.seasonal_decompose(y1, model=’additive’)<br>fig = decomposition.plot()<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*5mwf7ZrkLT5ZWQaE" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*pLIwLo9HvMCdU0pD.png" /></figure><p>Source: Author</p><p><em>Our inference from breaking the time series down into components like seasonality and trend is that the given time series is not stationary. Since the trend and seasonality of the time-series affect its values at different time-steps, this time-series is not stationary as its mean and variance keep changing. Thus, we have to difference the time series at least once to make it stationary.</em></p><p>If you remember, we discussed the three parameters of the ARIMA model. In order to determine these 3 parameters and finding the best combination of these 3 parameters in order to yield the best results, we’ll use a combination of statistical tools and iteration (trying out different models to check which achieves the best results).</p><p>Let’s start by determining <strong><em>d</em></strong>. As we mentioned earlier, we’ll keep differencing the time series until it becomes stationary. Let’s try differencing it once and use the Augmented Dickey-Fuller Test to find if it is stationary or not.</p><pre>from statsmodels.tsa.stattools import adfuller<br>from numpy import log<br>y1_d = y1.diff()<br>y1_d = y1_d.dropna()<br>result = adfuller(y1_d)<br>print(&#39;ADF Statistic: %f&#39; % result[0])<br>print(&#39;p-value: %f&#39; % result[1])ADF Statistic: -2.955284<br>p-value: 0.039287</pre><p><em>As we see that the </em><strong><em>p-value </em></strong><em>obtained is less than 0.05, we can reject the null hypothesis and say that the series is stationary. We can also see that the series has become more stationary from the plot above. Thus, obtaining a </em>pp<em>-value of less than 0.05 using </em><strong><em>ADF</em></strong><em> is a good indicator that our time series has become stationary.</em></p><pre>y1_d.plot(figsize=(15, 6))<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*6i4dthSB_5Vlx7i_" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*sT4EtPDnsu-sAYo5.png" /></figure><p>Source: Author</p><p>In order to determine <strong><em>p</em></strong>, we need to first understand what an <strong>ACF </strong>plot is. <em>Autocorrelation Function plot </em>or <strong>ACF </strong>plot shows how correlated the variable is with its previous time-steps. For example, while predicting stock prices, the ACF plot tries to show how correlated the stock prices of March are to the stock prices of February, how likely are the stock prices in March to follow the behavior of stock prices in February. To better understand this, let’s plot it.</p><pre>from statsmodels.graphics.tsaplots import plot_acf,plot_pacfplot_acf(y1_d,lags=10)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*aS5715Etu3T7IHa4" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*wqP82MCHugELv4GA.png" /></figure><p>Source: Author</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*1NavsmNReiScJNic" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*gfWc6fx8RShBUkxm.png" /></figure><p>Source: Author</p><p>We can see that the auto-correlation is strong for the first 2 lags and then it decays and oscillates in the blue region.</p><p><em>Inferring from this, we can see that the first 1–2 lags show high correlation and values keep decreasing in the blue region.</em><br>Thus, we can say that the value of pp will lie in the range spanning from 1 to 2.</p><p>Let’s try determining <strong><em>q</em></strong> now. The process of determining <strong><em>q</em></strong> is very similar to the process of determining <strong><em>p</em></strong>. Instead of using <strong>ACF</strong>, we’ll now use a <strong>PACF</strong>, or a <em>Partial Autocorrelation Function</em>. A <strong>PACF </strong>plot shows how correlated a variable is with itself at a previous time-step, ignoring all linear dependencies it has on time-steps that lie between the time-step against which correlation is to be found and the current time-step. Also called a <em>conditional correlation function</em>, PACF aims to find the correlation between two time-steps independent of all other time-steps in between. Let’s understand this better with a plot.</p><pre>plot_pacf(y1_d,lags=10)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aTurY04YRS0KX926.png" /></figure><p>Source: Author</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gtKCMvyy1clp5y5o.png" /></figure><p>Source: Author</p><p><em>From the plot we can see that the plot cuts off to zero at the second lag so we can estimate that the value of </em><strong><em>q </em></strong><em>will be lesser than 2.</em><br>Thus, we can say that the value <em>q</em> shall lie in the range spanning from 0 to 1.</p><p><em>You’ve finally learnt the necessary building blocks required to create an ARIMA model in order to perform time-series forecasting! Let’s jump right into it!</em></p><p>We divide our time-frame into a training and a testing set so that we can later gauge how well our model is performing. Training data is 70% of the original time-series data and testing data is 30% of the original time-series data.</p><pre>size = int(len(y1) * 0.7)<br>train, test = y1[0:size], y1[size:len(y1)]<br>series = [y1 for y1 in train]<br>predictions = []</pre><p>Alright, now let’s start training the model! Let’s try using values of (p,d,q)equal to (2,1,1) and see how the model performs!</p><pre>for y in range(len(test)):<br>    arima_model = ARIMA(series, order=(2,1,1))<br>    model_fit = arima_model.fit(disp=0)<br>    preds = model_fit.forecast()<br>    pred = preds[0]<br>    predictions.append(pred)<br>    actual_val = test[y]<br>    series.append(actual_val)<br>error = mean_squared_error(test, predictions)<br>print(&#39;Test error is {}&#39;.format(error))<br>plt.plot(predictions,&#39;r&#39;)<br>plt.plot(np.array(test))</pre><p><strong>Code execution:</strong></p><pre>Test error is 3.273019781729989</pre><pre>[&lt;matplotlib.lines.Line2D at 0x1d39598f668&gt;]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*7smpjz_q2mr7Ot9_" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*M5a9zFZySSS4cQeY.png" /></figure><p>Source: Author</p><p><em>We can see that the model has learnt the nature and behavior of the time-series, and is performing pretty well on the test set!</em></p><p><em>Let’s try out new values of </em><em>(p,d,q). Let’s try out </em><em>(1,1,1) this time and see if we obtain better results.</em></p><pre>size = int(len(y1) * 0.7)<br>train, test = y1[0:size], y1[size:len(y1)]<br>series = [y1 for y1 in train]<br>predictions = []for y in range(len(test)):<br>    arima_model = ARIMA(series, order=(1,1,1)) <br>    model_fit = arima_model.fit(disp=0)<br>    preds = model_fit.forecast()<br>    pred = preds[0]<br>    predictions.append(pred)<br>    actual_val = test[y]<br>    series.append(actual_val)<br>error = mean_squared_error(test, predictions)<br>print(&#39;Test error is {}&#39;.format(error))<br>plt.plot(predictions,&#39;r&#39;)<br>plt.plot(np.array(test))</pre><p><strong>Code execution:</strong></p><pre>Test error is 2.355571525013936</pre><pre>[&lt;matplotlib.lines.Line2D at 0x1d3959f32b0&gt;]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*m3MLDEcv_WmYdQn8" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*hxoHBtcxNdYA_UAp.png" /></figure><p><em>Great, we have obtained better results by changing the parameters of the model! By using the statistical methods above and by trying out different values, you can achieve great results on various different time-series.</em></p><p><strong>I hope you’re now acquainted with various concepts of Time-Series Forecasting and the ARIMA Model!</strong></p><p>You can get the<em> jupyter notebook </em>corresponding to this blog <a href="https://coepdsai.github.io/assets/notebooks/2020-05-15-arima-code.ipynb">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/0*74qagFm2TBsJTPQj.png" /></figure><p><a href="https://www.linkedin.com/in/jinit-sanghvi-4329a016b"><strong>Jinit Sanghvi</strong></a> is a zealous and inquisitive individual and he is pursuing Computer Engineering at <em>College of Engineering Pune</em>.</p><p>Having found his interest in domains such as Machine Learning, Data Sciences and Deep Learning early on in his first year, since then he has gone on to complete internships in reputed institutes and companies such as the <em>National University of Singapore</em>, <em>Hewlett Packard Enterprises</em>, <em>AISeon Healthcare Technologies</em> etc. He also has experience as a developer and very recently completed his internship at <em>Goldman Sachs</em>, where he will be joining as a full-time analyst after graduation. Along with this, he is also a proficient Parliamentary Debater and a passionate guitar player.</p><p>Get in touch with him here: <strong><em>jinitsanghvi@gmail.com</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20855ba56c0d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/voice-of-code/introduction-to-arima-model-20855ba56c0d">Introduction to ARIMA Model</a> was originally published in <a href="https://medium.com/voice-of-code">Voice of Code</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Curry And Composition Function in JavaScript]]></title>
            <link>https://medium.com/voice-of-code/curry-and-composition-function-in-javascript-2dfc691bb68f?source=rss----aa394f020b61---4</link>
            <guid isPermaLink="false">https://medium.com/p/2dfc691bb68f</guid>
            <dc:creator><![CDATA[Vivek Anand]]></dc:creator>
            <pubDate>Thu, 29 Apr 2021 23:19:23 GMT</pubDate>
            <atom:updated>2021-04-29T23:19:23.577Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*7VArjCPCmxvgxeduBnn6cw.png" /></figure><p>In this article i will discuss about:</p><ol><li>Higher Order Function</li><li>Curry Function</li><li>Composite Function</li></ol><h3>1) Higher Order Function</h3><p>Higher-order functions are regular functions that do one or both of the following:</p><ol><li>Takes one or many functions as arguments</li></ol><p>2. Returns a function</p><p>Let’s look at simple example.</p><blockquote>const c = b =&gt; b ;</blockquote><blockquote>add(a,b) =&gt; a+b; // here b is a function</blockquote><blockquote>add(3,c(3)) ;</blockquote><h3>2) Function Curry</h3><p>A curried function is a function which takes multiple parameters one at a time, by taking the first argument, and returning a series of functions which each take the next argument until all the parameters have been fixed, and the function application can complete, at which point, the resulting value is returned.</p><blockquote>const add = a =&gt; b =&gt; a + b;</blockquote><blockquote>const result = add(2)(3); // 5</blockquote><h3>3) Composite Function</h3><p>Curried functions are particularly useful in the context of function composition.</p><p>In terms of algebra :</p><blockquote>g: a -&gt; b<br>f: b -&gt; c</blockquote><p>Suppose :</p><blockquote>h: a -&gt; c<br>h = f . g = f(g(x))</blockquote><blockquote>// Algebra definition, borrowing the `.` composition operator</blockquote><p>In JavaScript :</p><blockquote>const g = n =&gt; n + 1;</blockquote><blockquote>const f = n =&gt; n * 2;</blockquote><blockquote>const h = x =&gt; f(g(x));</blockquote><blockquote>h(2); // 6</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2dfc691bb68f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/voice-of-code/curry-and-composition-function-in-javascript-2dfc691bb68f">Curry And Composition Function in JavaScript</a> was originally published in <a href="https://medium.com/voice-of-code">Voice of Code</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 this ?]]></title>
            <link>https://medium.com/voice-of-code/what-is-this-6f24baa8dbe8?source=rss----aa394f020b61---4</link>
            <guid isPermaLink="false">https://medium.com/p/6f24baa8dbe8</guid>
            <dc:creator><![CDATA[Vivek Anand]]></dc:creator>
            <pubDate>Sun, 25 Apr 2021 08:00:00 GMT</pubDate>
            <atom:updated>2021-04-25T08:00:00.399Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*LG4QwQokCa426yNlzci63g.jpeg" /></figure><p>Today I’m writing this article on a concept which is easy to understand but hard to explain to someone .</p><p>Few days ago my lead asked a very easy questions he said “What is this ? in programming” i replied “This refers to instance of current class” he said you are right.</p><p>Then he wrote this in console of chrome and said “can you please tell me the output” yes i said it will return “window” and after that our conversation ends.</p><p>I know i was right but i thought i should dig into “this” keyword because it’s meaning is same but it return very different output because it depends on execution context and instance which we create in a class as you can see in picture above you can get clear idea of how “this” works but still you need someone to explain that , Chill! I’m here.</p><p>JavaScript a language very easy to learn but hard to understand , because of it’s weird behavior or maybe sometimes we are doing things in wrong way so before learning any language learn it’s internals , structure , behavior , core.</p><p>So in this article i will try to explain “this” keyword.</p><ol><li>If you “console.log(this)” and run that code it will return “window” because you are currently in global execution context.</li><li>If you are in “strict mode” (in this mode we restrict JS to do shitty things which it most of the time do) and run “console.log(this)” it will return “undefined” because in this mode you can only call “this” when you create any instance/use dot notation/bind/call/apply “this”.</li><li>If you are using “dot notation” i.e obj.method() then “this” refers to “obj” but if you are in “strict mode” then “this” will be “undefined” you need to call/bind/apply it.</li><li>If you are passing “this” explicitly by using call/bind/apply then it refers to instance of that “this” which you have passed.</li><li>If you create object with new keyword then “this” will refer to instance of that object.</li><li>If you create “arrow function” (unlike normal function it doesn’t have his own “this”) then inside of it “this” will be instance of it surroundings . Sounds difficult here is an example suppose if you are in a class then inside arrow function “this will be instance of that class” if you wrote arrow function in global scope then “this” will be instance of global scope.</li><li>If you create a normal “function” ( I’m taking about function method()) then inside of it “this” will be instance of that function that’s why we bind “this” to normal function to excess global in react.</li></ol><p>I hope you can now picture behavior of “this” or use above picture for visualization.</p><p>Hope you will clap on this article because I wrote this article after being frustrated from “this” but as you all know “this” matters.</p><p>If you like this article please follow me or subscribe me on these plateforms.</p><ul><li><a href="https://medium.com/@vvkofficial">Medium</a></li><li><a href="https://www.facebook.com/vvk.anand.official">Facebook</a></li><li><a href="https://www.youtube.com/channel/UCRfB2PR9Vlf0C1l17qup-Wg">YouTube</a></li><li><a href="https://github.com/viveksharmaui">Github</a></li><li><a href="https://www.linkedin.com/in/vvkofficial">LinkedIn</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f24baa8dbe8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/voice-of-code/what-is-this-6f24baa8dbe8">What is this ?</a> was originally published in <a href="https://medium.com/voice-of-code">Voice of Code</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[9 Things You Should Practice for Logic Building]]></title>
            <link>https://medium.com/voice-of-code/9-things-you-should-practice-for-logic-building-d7b026c99c14?source=rss----aa394f020b61---4</link>
            <guid isPermaLink="false">https://medium.com/p/d7b026c99c14</guid>
            <category><![CDATA[programmers-life]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Vivek Anand]]></dc:creator>
            <pubDate>Sun, 25 Apr 2021 07:59:41 GMT</pubDate>
            <atom:updated>2021-04-25T07:59:41.009Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*FrfvIqxeCnqYoZTnr5w1oA.jpeg" /></figure><p>When I started my journey as a Programmer in 2017 my mind was always stuck on the logic building part and it still does the same sometimes but not that much, But how it possible? It is possible because of practice.</p><p>When I started my first job I was working on a very complicated project which I started from stretch all the backend logics was built by me using Node JS. I learned a lot during that time but learning new technologies will not help you with the logic building but when I was writing code on that project I touch a few things from the list below without knowing it.</p><p>You should try and practice these things as soon as possible to improve problem-solving and logic building skills but first learn a programming language so that you will confident enough to work with all of these things because these things need basic programming knowledge of any language i.e JS, Java Python, etc just learn core for these things no frameworks/libraries are required.</p><ol><li><strong>Data Structures</strong>: A data structure is a data organization, management, and storage format that enables efficient access and modification i.e Linked List, Binary Search Tree, Hash Table, etc.</li><li><strong>Algorithms: </strong>An algorithm is a step by step method of solving a problem i.e FizzBuzz, Fibonacci and there are a lot of algorithms even you can build your own but try to practice toughest algorithms.</li><li><strong>Design Patterns:</strong> They are typical solutions to commonly occurring problems in software design.</li><li><strong>Programming Paradigms:</strong> A programming paradigm is a style, or way, of programming i.e OOP, Functional, etc.</li><li><strong>Competitive Programming:</strong> It is all about solving problems revolving around algorithms and data structures as quickly as possible. If you want to improve this skill then challenge yourself that you can write an algorithm in 1 minute and start your stopwatch and after 1 minute stop. if this is boring then try another way of doing it and the way is participating in any Speed Programming Competitions to improve this skill well, I’m not a competitive programmer but I will try to improve as much as I can.</li><li><strong>Mathematics: </strong>Shit! I know but very compulsory for logic building.</li><li><strong>Recursive Programming: </strong>It<strong> </strong>is a method where problems are solved by repeatedly calling a function on sub-instances of the problem.</li><li><strong>Dynamic Programming: </strong>It<strong> </strong>is mainly an optimization over plain recursion.</li><li><strong>Refactoring: </strong>Wait! what? I know you are thinking that how code refactoring can help you to improve your logic building skills. Now suppose if you wrote a recursive function with O(n²) complexity if you refactor that code and try to apply dynamic programming techniques so definitely you can improve the time complexity of your codebase. So always refactor your code.</li></ol><p>Follow me AKA #slimcoder on <a href="https://medium.com/@vvkofficial">medium</a> and <a href="https://github.com/viveksharmaui">github</a> for more articles ❤</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7b026c99c14" width="1" height="1" alt=""><hr><p><a href="https://medium.com/voice-of-code/9-things-you-should-practice-for-logic-building-d7b026c99c14">9 Things You Should Practice for Logic Building</a> was originally published in <a href="https://medium.com/voice-of-code">Voice of Code</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Software Testing In A Nutshell]]></title>
            <link>https://medium.com/voice-of-code/software-testing-in-a-nutshell-6562aab8df2?source=rss----aa394f020b61---4</link>
            <guid isPermaLink="false">https://medium.com/p/6562aab8df2</guid>
            <category><![CDATA[supertest]]></category>
            <category><![CDATA[jest]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[slimcoder]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Vivek Anand]]></dc:creator>
            <pubDate>Sat, 13 Feb 2021 18:37:41 GMT</pubDate>
            <atom:updated>2021-05-28T11:54:39.909Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-qFXKLsW22odfs91EHKPNg.jpeg" /></figure><p><strong>Software Testing</strong> is a method to check whether the actual software product matches expected requirements and to ensure that the software product is defect-free. This article only focuses on the unit, integration, and API but there are more than 150 types of testing types and still adding. Also, note that not all testing types are applicable to all projects but depend on the nature &amp; scope of the project.</p><h3>Importance</h3><p>When a software developer, developed a new feature or make changes to an old one, It’s compulsory to write a test for that change or feature so that the PR (Pull Request) Reviewer or QA (Quality Assurance) Engineer should know what your code is doing by looking into your test.</p><p><strong>Software Testing</strong> can also help in process of CI/CD and pre-commits hooks if you are maintaining your code using version-controlling platforms i.e GitHub, GitLab, etc. If you decided to write tests from the very beginning of your project, This will also help you in covering edge case when your project codebase increase then tests will help you to know which case was failing because of a new feature or change.</p><h3>Prerequisite</h3><p>Before going deeper into <strong>Software Testing, </strong>You should know that I’m using JavaScript frameworks and libraries to test my code.</p><p>In this article we will cover 3 types of <strong>Software Testing</strong> namely:<br>1) Unit Testing<br>2) Integration Testing<br>3) API Testing</p><p>Here is the list of tools and software&#39;s which I&#39;m using for <strong>Software Testing</strong> namely:<br>1) Node.js <br>2) npm<br>4) Jest<br>5) Supertest<br>6) Expess.js</p><h3>Let’s Start</h3><p>First, install <a href="https://nodejs.org/en/download/">Node.js and NPM</a> for your operating system so that you can run JavaScript code, download and install packages from <a href="https://www.npmjs.com/">Node Package Manager</a>. <br>I’m using <a href="https://code.visualstudio.com/download">Visual Studio Code</a> IDE (Integrated Development Environment) but you can use any IDE for yourself.</p><h4>1) Unit Testing</h4><p>It is the process of testing a single software unit. For example, your team created a new feature that is responsible for adding two integers using JavaScript.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ec404e91b797623f67844995bb4a446a/href">https://medium.com/media/ec404e91b797623f67844995bb4a446a/href</a></iframe><p>Add this file within your project directory and then run <strong>node add.js. </strong>You can see that it prints 3 to the console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lRUKsisP4qCOZmKFjk9QyA.gif" /><figcaption>The addition of two numbers using JavaScript</figcaption></figure><p>I know now you may be wondering how to test this unit right? Relax! I will show you.</p><p>You successfully developed a feature that is responsible for adding two numbers and now can simply test it by installing <a href="https://www.npmjs.com/package/jest-cli">jest cli</a> from npm.</p><p>Install jest-cli globally by using this command:</p><pre>npm install -g jest-cli</pre><p>This command will install jest globally within the system, after installing jest-cli you can use the <strong>jest</strong> command directly from the terminal.</p><p>But still, you need to configure jest so that you can test the add.js file; create a new file <strong>jest.config.json</strong> and add this within the project directory.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d7984bf052455f6d46471b767d72ebde/href">https://medium.com/media/d7984bf052455f6d46471b767d72ebde/href</a></iframe><p>After creating jest.config.json file within the project directory, now you will be able to test your add.js file; So to test this code create a new file as <strong>add.test.js.<br></strong>All test files should have .test before .js extension so that jest should know that.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dc1e658f271827e9cefa1d1cebe56470/href">https://medium.com/media/dc1e658f271827e9cefa1d1cebe56470/href</a></iframe><p>As you can see below this is my <strong>add.test.js</strong> which is testing sum() within the add.js file.</p><p>In this file, I first import sum() from add.js file then created a describe() that is responsible for describing my test, and within its callback, I created it() which is responsible for testing my sum(). Remember that your it() and describe() should have a description so that everyone should know what this unit is doing.</p><p>Now let&#39;s run this test by using this command:</p><pre>jest</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HAavvvziIt4uahBGmVjvjw.gif" /><figcaption>Unit testing of Addition of Two Numbers using Jest</figcaption></figure><p>As you can see above we successfully test our add.js using jest and our test is passed.</p><h4>2) Integration Testing</h4><p>It is the process of testing combined units. For Example, Your team now decided to perform arithmetic operations in a way that it should be able to add and subtract those two numbers. So here we go with the new file arithmetic.js according to requirements.</p><p>But before directly jumping to <strong>arithmetic.js</strong> we need to create a new unit sub.js which will be responsible for subtracting two numbers.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d820f4832be174cf5df2841457d3ac1b/href">https://medium.com/media/d820f4832be174cf5df2841457d3ac1b/href</a></iframe><p>Now we will create a new file <strong>arithmetic.js</strong> which will be responsible for the addition and subtraction of two numbers by combining add.js and sub.js into <strong>arithmetic.js</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/870c285bb6ea8db1b73de6f695e46f24/href">https://medium.com/media/870c285bb6ea8db1b73de6f695e46f24/href</a></iframe><p>Add this file within your project directory and then run <strong>node arithmetic.js. </strong>You can see that it prints “3:1&quot; to the console by adding and subtracting 2 with 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-dBLx6decyBz8Vf7qgYA7A.gif" /><figcaption>Addition and Subtraction of Two Numbers using JavaScript</figcaption></figure><p>It is good practice to write a unit of sub.js, which we previously created so here it is;</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c1fed9d021715cdb6ecaa02755562e68/href">https://medium.com/media/c1fed9d021715cdb6ecaa02755562e68/href</a></iframe><p>Now just run sub.test.js using this command;</p><pre>jest -- sub.test.js</pre><p>This command will only run a single test which is sub.test.js got it?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b_5dspTW2fs6sxefQ2cxuw.gif" /><figcaption>Unit testing of Subtraction of two Numbers using JavaScript</figcaption></figure><p>After testing both units add.js and sub.js, This is the right time to test <strong>arithmetic.js</strong> so here is the integration test of it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/81f49f3355e16903d78af55e49c8e76e/href">https://medium.com/media/81f49f3355e16903d78af55e49c8e76e/href</a></iframe><p>You can run this testing using this command;</p><pre>jest -- arithmetic.test.js</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2WEuyw_n9qeiFViVH3enWg.gif" /><figcaption>Integration testing of two units addition and subtraction as whole</figcaption></figure><h4>3) API Testing</h4><p><strong>API</strong> (Application Programming Interface) <strong>testing</strong> is a type of software <strong>testing</strong> that aims to determine whether the <strong>APIs</strong> that are developed meet expectations when it comes to functionality, performance, reliability, and security for an application.</p><p>So now we will create an API using the De-Facto framework of Node.js known as Express.js.</p><p>First initialize npm within the project directory, so that we can install modules: Express.js, and super test for our use case.</p><p>Initialize npm within project directory this command;</p><pre>npm init</pre><p>Here is package.json from npm init and after installing modules.</p><p>Installs Express.js, Body Parser, and Supertest by this command;</p><pre>npm install express supertest --save</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ed659dc36693662d85c4ea9927a28345/href">https://medium.com/media/ed659dc36693662d85c4ea9927a28345/href</a></iframe><p>After installing these libraries and frameworks you can see node_modules folders created by npm and added as package.json dependencies.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b383e43afd83639878c63558c778cd0a/href">https://medium.com/media/b383e43afd83639878c63558c778cd0a/href</a></iframe><p>Now create a new file server.js which we will responsible for running Express.js server and using arithmetic.js as an <strong>API</strong>.</p><p>Here is the codebase of running the server and using arithmetic as API.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/92bc8fe7fb1d050db52cb8faaa639560/href">https://medium.com/media/92bc8fe7fb1d050db52cb8faaa639560/href</a></iframe><p>Run server.js using this command:</p><pre>node server.js</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rUMkj7JANGtl3Yv0yE-HNA.gif" /><figcaption>Running a server using node.js framework Express.js</figcaption></figure><p>After the server is successfully running you can now see the output of arthematic.js file on <strong>localhost:3000.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qIfv8mfaBYm2OC4bWZFDFw.gif" /><figcaption>Running server on localhost:3000</figcaption></figure><p>Now we set up the server using Express.js and we verify that it is running and sending responses on localhost:3000.</p><p>Now we are on right track to writing an API test of API which we created so here it is;</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cc495bba1273713389a188df50946481/href">https://medium.com/media/cc495bba1273713389a188df50946481/href</a></iframe><p>Now our test is ready we added two assertions one for status from API and the second for response texted;</p><p>Run API test using this command;</p><pre>jest -- server.test.js</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tQzE4TUUZaMiswN8ElBKZg.gif" /><figcaption>Testing server and / API using supertest and jest</figcaption></figure><h3>Conclusion</h3><p>This article was a complete package of testing your code and API using jest and super test. Testing types which we covered were unit, integration, and API. <br>In this article, we learn that how software testing is important for software developers and his team. We also look into practical ways to test code and API but if you are interested to learn more then don’t forget to look into automation testing also, I will cover it in my next article.</p><p>Thank you for reading this article.</p><p>I hope you enjoyed reading this article then don’t forget to follow the author on LinkedIn.</p><p><a href="https://www.linkedin.com/in/slimcoder/">Vivek Anand Sharma (Slim Coder) - Software Engineer - Trukkr | LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6562aab8df2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/voice-of-code/software-testing-in-a-nutshell-6562aab8df2">Software Testing In A Nutshell</a> was originally published in <a href="https://medium.com/voice-of-code">Voice of Code</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to even your forked repo with the source]]></title>
            <link>https://medium.com/voice-of-code/how-to-even-your-forked-repo-with-the-source-51e17b7e464e?source=rss----aa394f020b61---4</link>
            <guid isPermaLink="false">https://medium.com/p/51e17b7e464e</guid>
            <category><![CDATA[repositories]]></category>
            <category><![CDATA[even]]></category>
            <category><![CDATA[updates]]></category>
            <category><![CDATA[fork]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Anush krishna .V]]></dc:creator>
            <pubDate>Wed, 02 Dec 2020 16:04:40 GMT</pubDate>
            <atom:updated>2020-12-02T16:04:40.440Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to even your forked repository with the source in Github</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gtPvdSw2gXyoEbW_iGNumQ.jpeg" /><figcaption>Image Credits: Unsplash</figcaption></figure><p><strong>Step 1</strong>: Commit/Stash any recent changes but don’t push them.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%283%252C29%252C52%252C1%29%26t%3Dmonokai%26wt%3Dnone%26l%3Dapplication%252Fx-sh%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dgit%252520commit%252520-m%252520%252522commit-message-here%252522&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%283%25252C29%25252C52%25252C1%29%26t%3Dmonokai%26wt%3Dnone%26l%3Dapplication%25252Fx-sh%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dgit%25252520commit%25252520-m%25252520%25252522commit-message-here%25252522&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/645885e6f6e011b8f88301a1c9531ca8/href">https://medium.com/media/645885e6f6e011b8f88301a1c9531ca8/href</a></iframe><p><strong>Step 2: </strong>Add the remote (the one you forked ) and name it “upstream”. Copy the Source repository’s URL and paste it like done in the below example.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%283%252C29%252C52%252C1%29%26t%3Dmonokai%26wt%3Dnone%26l%3Dapplication%252Fx-sh%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dgit%252520remote%252520add%252520upstream%252520https%25253A%25252F%25252Fgithub.com%25252FOrg-or-profile%25252FSoruce-repo%25252F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%283%25252C29%25252C52%25252C1%29%26t%3Dmonokai%26wt%3Dnone%26l%3Dapplication%25252Fx-sh%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dgit%25252520remote%25252520add%25252520upstream%25252520https%2525253A%2525252F%2525252Fgithub.com%2525252FOrg-or-profile%2525252FSoruce-repo%2525252F&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/51e10836481176461b35595ad2ddb5f3/href">https://medium.com/media/51e10836481176461b35595ad2ddb5f3/href</a></iframe><p><strong>Step 3: </strong>Use git fetch to fetch all branches of the remote</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%283%252C29%252C52%252C1%29%26t%3Dmonokai%26wt%3Dnone%26l%3Dapplication%252Fx-sh%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dgit%252520fetch%252520upstream&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%283%25252C29%25252C52%25252C1%29%26t%3Dmonokai%26wt%3Dnone%26l%3Dapplication%25252Fx-sh%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dgit%25252520fetch%25252520upstream&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/98aad1607acefc2c2392f2e8e3e3c8ed/href">https://medium.com/media/98aad1607acefc2c2392f2e8e3e3c8ed/href</a></iframe><p><strong>Step 4:</strong> Update/Rewrite your master with the upstream master using the git “rebase” command.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%283%252C29%252C52%252C1%29%26t%3Dmonokai%26wt%3Dnone%26l%3Dapplication%252Fx-sh%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dgit%252520rebase%252520upstream%25252Fmaster&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%283%25252C29%25252C52%25252C1%29%26t%3Dmonokai%26wt%3Dnone%26l%3Dapplication%25252Fx-sh%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dgit%25252520rebase%25252520upstream%2525252Fmaster&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8e883900a17ba4071a42110185e9269a/href">https://medium.com/media/8e883900a17ba4071a42110185e9269a/href</a></iframe><p><strong>Step 5: </strong>Lastly (yep we are almost done ), push your updates if any to your forked repository’s master branch.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%283%252C29%252C52%252C1%29%26t%3Dmonokai%26wt%3Dnone%26l%3Dapplication%252Fx-sh%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dgit%252520push%252520origin%252520master&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%283%25252C29%25252C52%25252C1%29%26t%3Dmonokai%26wt%3Dnone%26l%3Dapplication%25252Fx-sh%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dgit%25252520push%25252520origin%25252520master&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/6a97b16487a16a708ea5ed4c40f15185/href">https://medium.com/media/6a97b16487a16a708ea5ed4c40f15185/href</a></iframe><p><strong>Step 6</strong>:Use <em>--force</em> to force push the changes if required</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%283%252C29%252C52%252C1%29%26t%3Dmonokai%26wt%3Dnone%26l%3Dapplication%252Fx-sh%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dgit%252520push%252520origin%252520master%252520--force&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%283%25252C29%25252C52%25252C1%29%26t%3Dmonokai%26wt%3Dnone%26l%3Dapplication%25252Fx-sh%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dgit%25252520push%25252520origin%25252520master%25252520--force&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/08f5727f6804ec34318a72ba488fc655/href">https://medium.com/media/08f5727f6804ec34318a72ba488fc655/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51e17b7e464e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/voice-of-code/how-to-even-your-forked-repo-with-the-source-51e17b7e464e">How to even your forked repo with the source</a> was originally published in <a href="https://medium.com/voice-of-code">Voice of Code</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sorting: Comparator]]></title>
            <link>https://medium.com/voice-of-code/sorting-comparator-21d98c192bbb?source=rss----aa394f020b61---4</link>
            <guid isPermaLink="false">https://medium.com/p/21d98c192bbb</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[hackerrank]]></category>
            <category><![CDATA[solutions]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Anush krishna .V]]></dc:creator>
            <pubDate>Wed, 02 Dec 2020 16:04:17 GMT</pubDate>
            <atom:updated>2020-12-02T16:04:17.695Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://www.hackerrank.com/challenges/ctci-comparator-sorting">Sorting: Comparator | HackerRank</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*vAFaYdtujq435SYvP2dZjw.jpeg" /></figure><p>Comparators are used to compare two objects. In this challenge, you’ll create a comparator and use it to sort an array. The <em>Player</em> class is provided in the editor below. It has two fields:</p><ol><li>name a string.</li><li>score: an integer.</li></ol><p>Given an array of <em>Player</em> objects, write a comparator that sorts them in order of decreasing score. If or more players have the same score, sort those players alphabetically ascending by name. To do this, you must create a <em>Checker</em> class that implements the <em>Comparator</em> interface, then write an <em>int compare(Player a, Player b)</em> method implementing the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html#compare(T,%20T)">Comparator.compare(T o1, T o2)</a> method. In short, when sorting in ascending order, a comparator function returns -1 if a&lt;b , 0 if a=b , and 1 if a&gt;b .</p><p><strong>Function Description</strong></p><p>Declare a <em>Checker</em> class that implements the <em>comparator</em> method as described. It should sort first descending by score, then ascending by name. The code stub reads the input, creates a list of Player objects, uses your method to sort the data, and prints it out properly.</p><p><strong>Sample Input</strong></p><pre>5<br>amy 100<br>david 100<br>heraldo 50<br>aakansha 75<br>aleksa 150</pre><p><strong>Sample Output</strong></p><pre>aleksa 150<br>amy 100<br>david 100<br>aakansha 75<br>heraldo 50</pre><p>Solution:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c7ba18e9c1a17491194d9a70bef20c06/href">https://medium.com/media/c7ba18e9c1a17491194d9a70bef20c06/href</a></iframe><p>Explanation:</p><p>As you can see, the players are first sorted by decreasing score and then sorted alphabetically by name.</p><p>__repr__() function returns the object representation. It could be any valid <strong>Python</strong> expression such as tuple, dictionary, string, etc.</p><p>Given : In short, when sorting in ascending order, a comparator function returns -1 if a&lt;b , 0 if a=b , and 1 if a&gt;b .</p><p>From the sample output and question statement, it&#39;s clear that we need to sort the name in ascending order and score in descending order. Use the return statement accordingly.</p><p>I would strongly urge you not to use nested if block statements in your solutions unless it&#39;s needed and there is no workaround. You can often place separate IF blocks in a particular order to get your job done as I have done in my solution.</p><p>Hope it helps :)</p><p>Follow me on :</p><ul><li><a href="https://www.linkedin.com/in/anush-krishna-8270941a0/">Anush krishna - PSG College of Arts and Science - Coimbatore, Tamil Nadu, India | LinkedIn</a></li><li><a href="https://thepathtowardsdatascience.wordpress.com/">welcome !Learner !!</a></li><li><a href="https://github.com/anushkrishnav">anushkrishnav - Overview</a></li><li><a href="https://twitter.com/Anush_krishna_v">anush krishna</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21d98c192bbb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/voice-of-code/sorting-comparator-21d98c192bbb">Sorting: Comparator</a> was originally published in <a href="https://medium.com/voice-of-code">Voice of Code</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>