<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mahesh</title>
    <description>The latest articles on DEV Community by Mahesh (@youngmahesh).</description>
    <link>https://dev.to/youngmahesh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F438106%2Fef1ccad5-b54e-4770-a95c-272a5db41398.jpeg</url>
      <title>DEV Community: Mahesh</title>
      <link>https://dev.to/youngmahesh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/youngmahesh"/>
    <language>en</language>
    <item>
      <title>AI won't replace software engineers</title>
      <dc:creator>Mahesh</dc:creator>
      <pubDate>Sun, 13 Apr 2025 16:45:37 +0000</pubDate>
      <link>https://dev.to/youngmahesh/ai-wont-replace-software-engineers-3efb</link>
      <guid>https://dev.to/youngmahesh/ai-wont-replace-software-engineers-3efb</guid>
      <description>&lt;h3&gt;
  
  
  1. The Ambiguity Gap: Translating Human Intent into Precise Code
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Natural languages (like English which &lt;strong&gt;non software-engineers&lt;/strong&gt; use) are inherently less precise than formal logic languages (like Python or mathematics which &lt;strong&gt;software-engineers&lt;/strong&gt; use).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AI's Challenge:&lt;/strong&gt; A single sentence in English can be interpreted in multiple ways, leading to different functional outcomes if directly translated into code. While AI can generate code from natural language prompts, it often struggles with nuance, implicit assumptions, and resolving ambiguities without clarification. It might generate &lt;em&gt;syntactically&lt;/em&gt; correct code that doesn't match the user's &lt;em&gt;actual&lt;/em&gt; intent or misses crucial edge cases hidden within the ambiguity.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Human Edge:&lt;/strong&gt; Experienced software engineers excel at bridging this gap. They ask clarifying questions, understand context, read between the lines of requirements, anticipate potential misunderstandings, and engage in dialogue to ensure the final code precisely matches the intended functionality and business logic. This interpretive and communicative skill is hard for AI to replicate.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Trust, Accountability, and High-Stakes Systems
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Building and deploying software, especially in critical domains (finance, healthcare, infrastructure, security), involves significant risk. When errors occur, they can lead to catastrophic failures, data loss, financial damage, or even harm to individuals. Businesses won't trust AI with critical code like this because AI faces no consequences for errors, unlike humans who risk their reputation and job.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Accountability Void:&lt;/strong&gt; Currently, AI systems lack legal personhood and genuine accountability. If AI generates faulty code causing massive losses, who is responsible? The AI vendor? The company using the AI? The engineer who reviewed (or didn't review) the code? This lack of clear liability makes businesses hesitant to fully entrust mission-critical development solely to AI.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Human Element of Trust:&lt;/strong&gt; Trust in software development isn't just about code correctness; it's about understanding the reasoning behind design decisions, having confidence in the development process, and knowing there's a responsible human or team to fix issues and take ownership. Humans build this trust through demonstrated competence, communication, and accepting responsibility for their work.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>developer tools list</title>
      <dc:creator>Mahesh</dc:creator>
      <pubDate>Fri, 22 Sep 2023 05:08:05 +0000</pubDate>
      <link>https://dev.to/youngmahesh/developer-tools-list-1ino</link>
      <guid>https://dev.to/youngmahesh/developer-tools-list-1ino</guid>
      <description>&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/trehn/termdown"&gt;termdown&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;do not leave work in hand until countdown is running&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/GothenburgBitFactory/taskwarrior"&gt;taskwarrior&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;note down all distractive thoughts in tasks-list during work, review them all after predefined time for work is over&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.google.com/intl/en_in/chrome/"&gt;google chrome&lt;/a&gt; with &lt;a href="https://chrome.google.com/webstore/detail/web-site-blocker/aoabjfoanlljmgnohepbkimcekolejjn"&gt;web site blocker&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;website blocker will help in focusing on work by blocking social media&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://code.visualstudio.com/"&gt;vscode&lt;/a&gt; with &lt;a href="https://marketplace.visualstudio.com/items?itemName=asvetliakov.vscode-neovim"&gt;neovim&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;neovim will increase code writing speed. To think clearly, a developer should be able to write code as fast as he can think&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://obsidian.md/"&gt;obsidian&lt;/a&gt; with &lt;a href="https://excalidraw.com/"&gt;excalidraw&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;excalidraw diagrams are necessary to understand and create notes for complex concepts&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;a href="https://bard.google.com/chat"&gt;google bard&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>tooling</category>
    </item>
    <item>
      <title>Manage vps RAM usage by docker containers</title>
      <dc:creator>Mahesh</dc:creator>
      <pubDate>Fri, 11 Aug 2023 03:44:53 +0000</pubDate>
      <link>https://dev.to/youngmahesh/manage-vps-ram-usage-by-docker-containers-d8k</link>
      <guid>https://dev.to/youngmahesh/manage-vps-ram-usage-by-docker-containers-d8k</guid>
      <description>&lt;p&gt;I recently had an issue where I couldn't connect to my VPS server. I thought it was an internet connection issue, but it turned out to be high RAM usage on my server.&lt;/p&gt;

&lt;p&gt;I tried to find a monitoring tool to help me figure out what was going on, but the information I found was too lengthy and didn't seem relevant to my specific issue.&lt;/p&gt;

&lt;p&gt;In the end, I figured out a quick way to fix the problem myself. Here's what I did:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;get list of docker containers according to their RAM/Memory-Usage using &lt;a href="https://docs.docker.com/engine/reference/commandline/stats"&gt;docker stats&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker stats &lt;span class="nt"&gt;--no-stream&lt;/span&gt; &lt;span class="nt"&gt;--format&lt;/span&gt; &lt;span class="s2"&gt;"table {{.Name}}&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s2"&gt;{{.MemUsage}}"&lt;/span&gt; | &lt;span class="nb"&gt;sort&lt;/span&gt; &lt;span class="nt"&gt;-k&lt;/span&gt; 2 &lt;span class="nt"&gt;-hr&lt;/span&gt;
&lt;span class="c"&gt;# --no-steam: by default docker stats is streams information, which sometimes hangs &lt;/span&gt;
&lt;span class="c"&gt;#    command line --no-stream ask stats one time instead of streaming&lt;/span&gt;
&lt;span class="c"&gt;# sort -k 2: sort list considering 2nd column which is MemUsage here&lt;/span&gt;
&lt;span class="c"&gt;# sort -hr: h represents human-redable number, r represents reverse (descending order)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;shut down or delete unnecessory containers using &lt;a href="https://docs.docker.com/engine/reference/commandline/stop/"&gt;docker stop&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And that's it, you can check again the reduced RAM usage on vps server by running &lt;code&gt;htop&lt;/code&gt;&lt;/p&gt;

</description>
      <category>docker</category>
      <category>vps</category>
      <category>ram</category>
    </item>
    <item>
      <title>Web Development Bookmarks</title>
      <dc:creator>Mahesh</dc:creator>
      <pubDate>Sat, 29 Oct 2022 04:08:58 +0000</pubDate>
      <link>https://dev.to/youngmahesh/web-hosting-bookmarks-akn</link>
      <guid>https://dev.to/youngmahesh/web-hosting-bookmarks-akn</guid>
      <description>&lt;h3&gt;
  
  
  Hosting
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Website Hosting

&lt;ul&gt;
&lt;li&gt;Vercel&lt;/li&gt;
&lt;li&gt;contabo (vps-provider) + docker + docker-compose + traefik hub&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Database Hosting

&lt;ul&gt;
&lt;li&gt;Docker Image of MySQL, PostgreSQL, MongoDB, etc on VPS server&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://razorhost.in/"&gt;Razorhost-cpanel&lt;/a&gt; - MySQL&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://railway.app"&gt;Railway.app&lt;/a&gt; - Postgresql, Redis, &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.mongodb.com/"&gt;MongoDB-Atlas&lt;/a&gt; - MongoDB&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Email hosting

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://razorhost.in/"&gt;Razorhost-cpanel&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/maildev/maildev"&gt;MailDev&lt;/a&gt; - for testing&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Code Hosting

&lt;ul&gt;
&lt;li&gt;Github&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;File Hosting

&lt;ul&gt;
&lt;li&gt;minio on vps, rclone to backup or transfer minio-server&lt;/li&gt;
&lt;li&gt;Storj - 150 GB Free, $4/month/TB storage&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.pcloud.com/help/general-help-center/what-is-the-public-folder"&gt;pCloud&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Contabo - $3/month/250GB&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.arweave.org/"&gt;Arweave&lt;/a&gt; - Permanent Hosting&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Domains

&lt;ul&gt;
&lt;li&gt;Hostinger (cheapest for 1st year)&lt;/li&gt;
&lt;li&gt;Google Domains (buy for upto 9 years)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;VS-Code Hosting

&lt;ul&gt;
&lt;li&gt;Gitpod - $25 / month&lt;/li&gt;
&lt;li&gt;CodeSandBox - $12 / month (does not work properly for now)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;VPS / Server Hosting

&lt;ul&gt;
&lt;li&gt;Contabo - good for long-term hosting, due to affordable yearly plans&lt;/li&gt;
&lt;li&gt;Dropbox droplets - good for quick testing due hourly pricing&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Cpanel Hosting 

&lt;ul&gt;
&lt;li&gt;razorhost&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;File Transfer

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://transfer.pcloud.com"&gt;pcloud&lt;/a&gt; - 5GB, password-protected&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;File Backup

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://preline.co/index.html"&gt;contabo_object-storage&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;pCloud - affordable lifetime plans&lt;/li&gt;
&lt;li&gt;notion - unlimited storage at $8/month&lt;/li&gt;
&lt;li&gt;backblaze - unlimited storage at $7/month&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;File Encryption

&lt;ul&gt;
&lt;li&gt;rclone&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Logo Creator

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://app.logo.com/"&gt;Logo.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.shopify.com/tools/logo-maker"&gt;Hatchful&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Frontend Stack
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Framework 

&lt;ul&gt;
&lt;li&gt;Next.js, ReactJS&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Development enviroment

&lt;ul&gt;
&lt;li&gt;docker-devcontainer: use only when needed&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;State Manangment

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/jotai"&gt;Jotai&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Beatification

&lt;ul&gt;
&lt;li&gt;TailwindCSS&lt;/li&gt;
&lt;li&gt;&lt;a href="https://preline.co/index.html"&gt;Preline&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://daisyui.com/"&gt;DaisyUI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/react-toastify"&gt;React-Toastify&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/sweetalert2"&gt;SweetAlert2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/animate.css"&gt;Animate.css&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Avoid
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://next-auth.js.org/"&gt;NextAuth&lt;/a&gt; - documentation is not user friendly, not sufficient options for modification&lt;/li&gt;
&lt;li&gt;Pocketbase - cannot delete columns in database once created&lt;/li&gt;
&lt;li&gt;Appwrite - self-hosting is difficult&lt;/li&gt;
&lt;li&gt;Hetzner - asks for identity verification &lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Git Repository Essentials</title>
      <dc:creator>Mahesh</dc:creator>
      <pubDate>Sun, 16 Oct 2022 19:44:58 +0000</pubDate>
      <link>https://dev.to/youngmahesh/git-repository-essentials-4fae</link>
      <guid>https://dev.to/youngmahesh/git-repository-essentials-4fae</guid>
      <description>&lt;h1&gt;
  
  
  Theory
&lt;/h1&gt;

&lt;p&gt;Git-repository is a collection git-branches&lt;/p&gt;

&lt;h2&gt;
  
  
  Sections / Areas in git-branch
&lt;/h2&gt;

&lt;p&gt;There are primarily 5 sections / drives / spaces in every git-branch&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Working Area: Any file you create or modify included automatically in working area&lt;/li&gt;
&lt;li&gt;Staging / Index Area: Area where you temporarity save your current changes. &lt;/li&gt;
&lt;li&gt;Stash Area: stack of temporary-changes. Storeas changes you want to remove now from file but want to include it later on. You need to use it mostly when two or more developers working on a same branch and you want to include changes from all of them one after another&lt;/li&gt;
&lt;li&gt;Commit Area: contains stack of commits. Each commit is snapshot of code at the time commit is created. Save your changes permanently in git.&lt;/li&gt;
&lt;li&gt;Remote Area: Backup / Sync your Commit Area on a remote server like Github or Bitbucket
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Working Area &amp;lt;-&amp;gt; Staging Area
Working Area Staging Area -&amp;gt; Stash Area -&amp;gt; Working Area
Staging Area &amp;lt;-&amp;gt; Commit Area
Commit Area &amp;lt;-&amp;gt; Remote Area
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Practical
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Notes:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Refere all git commands using &lt;code&gt;git --help&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;You can replace &lt;code&gt;&amp;lt;file_path&amp;gt;&lt;/code&gt; with &lt;code&gt;.&lt;/code&gt; in the following code to apply command on all files&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Create and Delete git-repository
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init &lt;span class="c"&gt;# create first branch (master-branch) in current folder and move all your files in working area&lt;/span&gt;

&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; .git  &lt;span class="c"&gt;# remove all git drive / sections&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Git Configuration
&lt;/h3&gt;

&lt;p&gt;There are two git configurations - Global (default for new repository) and Local (for current repository)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# use --global flag, to update gobal-configuation file&lt;/span&gt;
git config &lt;span class="nt"&gt;-l&lt;/span&gt;   &lt;span class="c"&gt;# list global and local git config&lt;/span&gt;
git config &lt;span class="nt"&gt;-e&lt;/span&gt;  &lt;span class="c"&gt;# update local git-config file which is present at ".git/config"&lt;/span&gt;
git config user.name &lt;span class="s2"&gt;"John Doe"&lt;/span&gt; &lt;span class="c"&gt;# update User/Author name&lt;/span&gt;
git config user.email johndoe@example.com
git config core.editor &lt;span class="s2"&gt;"code --wait"&lt;/span&gt;    &lt;span class="c"&gt;# set vs-code default editor for git&lt;/span&gt;
git config core.editor &lt;span class="s2"&gt;"nano -w"&lt;/span&gt;       &lt;span class="c"&gt;# set nano as default editor for git&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Working Area
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status &lt;span class="c"&gt;# see which files / changes present in which area # file-names in red color are in working_area&lt;/span&gt;
&lt;span class="c"&gt;# file-names in green color are in staging_area&lt;/span&gt;

git diff &amp;lt;file_path&amp;gt; &lt;span class="c"&gt;# see changes present in working-area&lt;/span&gt;
git restore &amp;lt;file_path&amp;gt;   &lt;span class="c"&gt;# delete file-changes made working area&lt;/span&gt;
git clean &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="c"&gt;# delete all files in working area&lt;/span&gt;
git clean &lt;span class="nt"&gt;-fd&lt;/span&gt;  &lt;span class="c"&gt;# delete all files and directories in working area&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Staging / Index Area
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git diff &lt;span class="nt"&gt;--staged&lt;/span&gt; &lt;span class="c"&gt;# see changes in present in staging_area&lt;/span&gt;
git add &amp;lt;file_path&amp;gt;   &lt;span class="c"&gt;# move changes (newly created files or modification in previous files) to staging area&lt;/span&gt;
git restore &lt;span class="nt"&gt;--staged&lt;/span&gt; &amp;lt;file-path&amp;gt;   &lt;span class="c"&gt;# move changes from staging_area to working_area&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Stash Area
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash &lt;span class="c"&gt;# move all changes from working and staging area to stash_area&lt;/span&gt;
git stash list &lt;span class="c"&gt;# list all blocks of temporariy changes&lt;/span&gt;
git stash pop  &lt;span class="c"&gt;# move most-recent block from stash_area to working_area ( position{0} )&lt;/span&gt;
git stash clear &lt;span class="c"&gt;# delete all blocks in stash&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Commit Area
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;message&amp;gt;'&lt;/span&gt;     &lt;span class="c"&gt;# move changes from staging_area to commit_area&lt;/span&gt;
&lt;span class="c"&gt;# &amp;lt;message&amp;gt; is short text giving information about changes made in the commit&lt;/span&gt;
git commit &lt;span class="nt"&gt;--amend&lt;/span&gt; &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;message&amp;gt;'&lt;/span&gt;  &lt;span class="c"&gt;# move from staging_area to commit_area, but replace last-commit instead of creating new-commit&lt;/span&gt;
git log  &lt;span class="c"&gt;# view all commits in current branch&lt;/span&gt;
git log &lt;span class="nt"&gt;--oneline&lt;/span&gt; &lt;span class="c"&gt;# view all commits without description&lt;/span&gt;
git log &lt;span class="nt"&gt;--oneline&lt;/span&gt; &lt;span class="nt"&gt;--graph&lt;/span&gt; &lt;span class="nt"&gt;--all&lt;/span&gt;  &lt;span class="c"&gt;# view graphical representation of all branches&lt;/span&gt;
git diff &amp;lt;commit_id&amp;gt; &lt;span class="c"&gt;# view changes present in commit_id&lt;/span&gt;

git revert &amp;lt;commit_ID&amp;gt; &lt;span class="c"&gt;# remove all changes in given 'commit_ID'&lt;/span&gt;
git reset HEAD~1  &lt;span class="c"&gt;# delete last commit and move changes from last-commit to working-area&lt;/span&gt;
&lt;span class="c"&gt;# HEAD~2 will delete latest 2 commits, HEAD~3 will delete latest 3-commits and so on..&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Remote Area
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add &amp;lt;remote_area_name&amp;gt; &amp;lt;remote_area_url&amp;gt; &lt;span class="c"&gt;# add connection to the remote_area&lt;/span&gt;
&lt;span class="c"&gt;# you can give any name you want to remote_area_name, devlopers normally use "origin" for their first / default remote_area&lt;/span&gt;
git remote &lt;span class="nt"&gt;-v&lt;/span&gt;  &lt;span class="c"&gt;# list currently set remote_area / servers names and their areas&lt;/span&gt;
git remote remove &amp;lt;remote_area_name&amp;gt;   &lt;span class="c"&gt;# remove connection with remote repository&lt;/span&gt;
git push &amp;lt;remote_area_name&amp;gt; &amp;lt;branch-name&amp;gt; &lt;span class="c"&gt;# copy changes in commit-area to remote_area&lt;/span&gt;
git fetch &amp;lt;remote_area_name&amp;gt; &amp;lt;branch_name&amp;gt; &lt;span class="c"&gt;# copy branch remote_area to commit_area&lt;/span&gt;
git pull &amp;lt;remote_area_name&amp;gt; &amp;lt;branch_name&amp;gt; &lt;span class="c"&gt;# merge remote branch to current branch&lt;/span&gt;
git clone &amp;lt;remote_area_url&amp;gt; &lt;span class="c"&gt;# copy git repository from remote server/area to current folder&lt;/span&gt;

&lt;span class="c"&gt;# for https-url&lt;/span&gt;
git config &lt;span class="nt"&gt;--global&lt;/span&gt; credential.helper cache   &lt;span class="c"&gt;# save github password so you don't have to type it again&lt;/span&gt;
git config &lt;span class="nt"&gt;--global&lt;/span&gt; &lt;span class="nt"&gt;--unset&lt;/span&gt; credential.helper  &lt;span class="c"&gt;# remove cached credentials&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Branch Management
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &amp;lt;branch-name&amp;gt; &lt;span class="c"&gt;# Create a new branch containing all git commits of current git-branch&lt;/span&gt;
git checkout &lt;span class="nt"&gt;--orphan&lt;/span&gt; &amp;lt;name&amp;gt;  &lt;span class="c"&gt;# create a fresh branch without commits from current-branch&lt;/span&gt;
git branch &lt;span class="nt"&gt;-d&lt;/span&gt; &amp;lt;branch-name&amp;gt; &lt;span class="c"&gt;# delete branch&lt;/span&gt;
git branch &lt;span class="nt"&gt;-m&lt;/span&gt; &amp;lt;current-name&amp;gt; &amp;lt;new-name&amp;gt;  &lt;span class="c"&gt;# Change branch name&lt;/span&gt;
git checkout &amp;lt;branch-name&amp;gt; &lt;span class="c"&gt;# move to another branch&lt;/span&gt;
git branch &lt;span class="nt"&gt;--all&lt;/span&gt;  &lt;span class="c"&gt;# list all local and remote branches&lt;/span&gt;

git merge &amp;lt;branch-name&amp;gt; &lt;span class="c"&gt;# merge branch with  &amp;lt;branch-name&amp;gt; to current branch&lt;/span&gt;
git merge &amp;lt;branch-name&amp;gt; &lt;span class="nt"&gt;--allow-unrelated-histories&lt;/span&gt;  &lt;span class="c"&gt;# merge branch whose git-history does not match with current branch, normally used to merge changes from another repository&lt;/span&gt;
git merge &lt;span class="nt"&gt;--abort&lt;/span&gt;   &lt;span class="c"&gt;# stop current merge process if there are conficts in merge, and you don't want to resolve them now&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Git Tags
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git fetch &lt;span class="nt"&gt;--all&lt;/span&gt; &lt;span class="nt"&gt;--tags&lt;/span&gt;  &lt;span class="c"&gt;# fetch all tags from remote&lt;/span&gt;
git checkout tags/&amp;lt;version&amp;gt; &lt;span class="nt"&gt;-b&lt;/span&gt; &amp;lt;branch-name&amp;gt;  &lt;span class="c"&gt;# switch to a tag and create bracnh for it&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>git</category>
      <category>repository</category>
    </item>
    <item>
      <title>Backup Github</title>
      <dc:creator>Mahesh</dc:creator>
      <pubDate>Fri, 09 Sep 2022 23:13:57 +0000</pubDate>
      <link>https://dev.to/youngmahesh/backup-github-404j</link>
      <guid>https://dev.to/youngmahesh/backup-github-404j</guid>
      <description>&lt;p&gt;Install: &lt;a href="https://github.com/josegonzalez/python-github-backup"&gt;https://github.com/josegonzalez/python-github-backup&lt;/a&gt;&lt;/p&gt;




&lt;ul&gt;
&lt;li&gt;Backup All Repositories in account
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;github-backup &amp;lt;username&amp;gt; &lt;span class="nt"&gt;-t&lt;/span&gt; &amp;lt;personal-access-token&amp;gt; &lt;span class="nt"&gt;-o&lt;/span&gt; &amp;lt;output-directory&amp;gt; &lt;span class="nt"&gt;--repositories&lt;/span&gt; &lt;span class="nt"&gt;--private&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;ul&gt;
&lt;li&gt;Backup All Repositories in organization
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;github-backup &amp;lt;organization-name&amp;gt; -t &amp;lt;personal-access-token&amp;gt; -o &amp;lt;output-directory&amp;gt; --repositories --private --organization
# &amp;lt;organization-name&amp;gt; is case-sensitive
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Check &lt;code&gt;README.md&lt;/code&gt; of repositories for more information about the commands&lt;/p&gt;

&lt;p&gt;Script donwloads all the branches of each repositores, to check them run &lt;code&gt;git branch -a&lt;/code&gt; inside repositories&lt;/p&gt;

</description>
      <category>pythongithubbackup</category>
      <category>githubbackup</category>
    </item>
    <item>
      <title>Download/Upload files on remote server</title>
      <dc:creator>Mahesh</dc:creator>
      <pubDate>Fri, 12 Aug 2022 16:11:46 +0000</pubDate>
      <link>https://dev.to/youngmahesh/downloadupload-files-on-remote-server-4eh4</link>
      <guid>https://dev.to/youngmahesh/downloadupload-files-on-remote-server-4eh4</guid>
      <description>&lt;h3&gt;
  
  
  Upload File On Server
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;scp &lt;span class="nt"&gt;-i&lt;/span&gt; &amp;lt;ssh-private-key-path&amp;gt; &amp;lt;file-local-path&amp;gt;  &amp;lt;file-remote-destination&amp;gt;
scp &lt;span class="nt"&gt;-i&lt;/span&gt; ~/.ssh/work            ./notes2.txt       mahesh@example.com:/home/team1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Download File From Server
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;scp &lt;span class="nt"&gt;-i&lt;/span&gt; &amp;lt;ssh-privae-key-path&amp;gt; &amp;lt;file-on-server-path&amp;gt;                      &amp;lt;file-local-destionation&amp;gt;
scp &lt;span class="nt"&gt;-i&lt;/span&gt; ~/.ssh/work           mahesh@example.com:/home/team1/notes2.txt  ./
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Remote Download on Server
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget &amp;lt;file-url&amp;gt;
wget https://ipfs.io/ipfs/QmNf1UsmdGaMbpatQ6toXSkzDpizaGmC9zfunCyoz1enD5/penguin/17.png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>ssh</category>
      <category>server</category>
      <category>devenv</category>
    </item>
    <item>
      <title>Cloud development environment for Team</title>
      <dc:creator>Mahesh</dc:creator>
      <pubDate>Thu, 11 Aug 2022 11:16:05 +0000</pubDate>
      <link>https://dev.to/youngmahesh/cloud-development-environment-for-team-59p7</link>
      <guid>https://dev.to/youngmahesh/cloud-development-environment-for-team-59p7</guid>
      <description>&lt;h3&gt;
  
  
  Target
&lt;/h3&gt;

&lt;p&gt;Manage/Create dev-environment on cloud linux-server for a team to avoid local-computer errors and collaborate on code with other team-members&lt;/p&gt;

&lt;h3&gt;
  
  
  Requirements
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;VPS (used Ubuntu 20.04 VPS while writing this)&lt;/li&gt;
&lt;li&gt;Root access&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Overview
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;User Creation&lt;/li&gt;
&lt;li&gt;Team-Group Creation&lt;/li&gt;
&lt;li&gt;Team-Folder for team to collaborate&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Steps
&lt;/h2&gt;

&lt;h3&gt;
  
  
  User Creation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# create user accounts for your team member&lt;/span&gt;
useradd &lt;span class="nt"&gt;--create-home&lt;/span&gt; &amp;lt;username&amp;gt;  &lt;span class="c"&gt;# create user with directory for him in `/home` with name equal to &amp;lt;username&amp;gt;&lt;/span&gt;
passwd &amp;lt;username&amp;gt; &lt;span class="c"&gt;# set user password&lt;/span&gt;
&lt;span class="nb"&gt;chmod &lt;/span&gt;o-rwx /home/&amp;lt;username&amp;gt; &lt;span class="c"&gt;# make folder private, so only folder-owner and root-user can view/modify files&lt;/span&gt;
&lt;span class="c"&gt;# "o" == others, &lt;/span&gt;
&lt;span class="c"&gt;# "-" == remove permissions &lt;/span&gt;
&lt;span class="c"&gt;# "r" == read, "w" == write", "x" == execute&lt;/span&gt;


&lt;span class="c"&gt;# Additonal commands&lt;/span&gt;
&lt;span class="nb"&gt;id&lt;/span&gt; &amp;lt;username&amp;gt; &lt;span class="c"&gt;# list user's userid(uid) and primary-group(gid) amd secondary-groups(groups)&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; /etc/passwd &lt;span class="c"&gt;# list all users&lt;/span&gt;
deluser &lt;span class="nt"&gt;--remove-home&lt;/span&gt; &amp;lt;username&amp;gt; &lt;span class="c"&gt;# delete user alongwith his directory&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; /etc/passwd &lt;span class="c"&gt;# list all users&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;User can now connect with his folder with ssh and vs-code  using command: &lt;code&gt;ssh &amp;lt;username&amp;gt;@&amp;lt;ip-address/domain-name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Team-Group creation
&lt;/h3&gt;

&lt;p&gt;There are two types of groups primary-group and secondary group:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Primary group: created at the time of user creation, group-name is same as user-name, listed in - /etc/passwd&lt;/li&gt;
&lt;li&gt;Secondary group: used to grant certain privileges to a set of users, listed in - /etc/group&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We are going to create "Secondary group" here.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;groupadd &amp;lt;group-name&amp;gt; &lt;span class="c"&gt;# create group&lt;/span&gt;
usermod &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nt"&gt;-G&lt;/span&gt; &amp;lt;group-name&amp;gt; &amp;lt;user-name&amp;gt; &lt;span class="c"&gt;# add user to the group, -a == append, -G == group&lt;/span&gt;

&lt;span class="c"&gt;# Additional commands&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; /etc/group  &lt;span class="c"&gt;# list all groups&lt;/span&gt;
getent group &amp;lt;group-name&amp;gt; &lt;span class="c"&gt;# list all users of a group&lt;/span&gt;
groupdel &amp;lt;groupname&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Team-Folder for team to collaborate
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &amp;lt;folder-name&amp;gt; &lt;span class="c"&gt;# create a new folder for team&lt;/span&gt;
&lt;span class="nb"&gt;chgrp&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; &amp;lt;group-name&amp;gt; &amp;lt;folder-name&amp;gt;  &lt;span class="c"&gt;# change group of folder to team-group we created above&lt;/span&gt;
&lt;span class="nb"&gt;chmod &lt;/span&gt;g+rwx &amp;lt;folder-name&amp;gt; &lt;span class="c"&gt;# give access of folder to it's group&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now team-members can work privately in their individual folders and switch to team-folder to collaborate on code with other team-members&lt;/p&gt;

&lt;h3&gt;
  
  
  Reference
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://linuxize.com/"&gt;https://linuxize.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/docs/remote/ssh"&gt;https://code.visualstudio.com/docs/remote/ssh&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>linux</category>
      <category>devenv</category>
    </item>
    <item>
      <title>Learning Rust</title>
      <dc:creator>Mahesh</dc:creator>
      <pubDate>Sat, 23 Apr 2022 16:29:43 +0000</pubDate>
      <link>https://dev.to/youngmahesh/learning-rust-2j03</link>
      <guid>https://dev.to/youngmahesh/learning-rust-2j03</guid>
      <description>&lt;p&gt;Publishing the syntax I learn in rust, so I can keep my thinking as clear as possible.&lt;/p&gt;

&lt;p&gt;I will update the article whenever I learn new syntax&lt;/p&gt;

&lt;p&gt;Rust playground: &lt;a href="https://play.rust-lang.org/"&gt;https://play.rust-lang.org/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Strings
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Rust has 2 types for strings, &lt;code&gt;str&lt;/code&gt; and &lt;code&gt;String&lt;/code&gt;. &lt;code&gt;String&lt;/code&gt; is a growable, heap-allocated data structure. &lt;code&gt;str&lt;/code&gt; is an immutable fixed-length string somewhere in memory.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;word1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"vidya mandir"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;word2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"sahyadri parvat"&lt;/span&gt;&lt;span class="nf"&gt;.to_string&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"{:?} {:?}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;word1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;word2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  print
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;println!("{:?}", variable_name)&lt;/code&gt; prints integers, strings, vectors&lt;/p&gt;

&lt;h3&gt;
  
  
  Array/Vector
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;vector1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nd"&gt;vec!&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;34&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;35&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;  &lt;span class="c1"&gt;// create vector, mut == vector1 is mutable/modifiable&lt;/span&gt;
&lt;span class="n"&gt;vector1&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt; &lt;span class="c1"&gt;// get element at index 3&lt;/span&gt;
&lt;span class="n"&gt;vector1&lt;/span&gt;&lt;span class="nf"&gt;.push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;47&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// push element to vector&lt;/span&gt;
&lt;span class="n"&gt;vector1&lt;/span&gt;&lt;span class="nf"&gt;.pop&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// remove last element of the vector&lt;/span&gt;
&lt;span class="n"&gt;vector1&lt;/span&gt;&lt;span class="nf"&gt;.len&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// get length of vector&lt;/span&gt;
&lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"{:?}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;vector1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// print vector&lt;/span&gt;

&lt;span class="c1"&gt;// array with length 50 and all elements equal to 0&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;vector2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;u16&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Convert
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Number to String
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;num1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;u128&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;34034&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;num1_str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;num1&lt;/span&gt;&lt;span class="nf"&gt;.to_string&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;String to Number
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;num2_str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"40304"&lt;/span&gt;&lt;span class="nf"&gt;.to_string&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;num2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;u128&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;num2_str&lt;/span&gt;&lt;span class="nf"&gt;.parse&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Combine strings
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"a"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nd"&gt;format!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"{} + {}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"b"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"{:?}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// a + b&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;String to number-array
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="c1"&gt;// split string to form a array of vectors&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;numsInStr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"3 4 25 90 233"&lt;/span&gt;&lt;span class="nf"&gt;.to_string&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;numsInVec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Vec&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;u32&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;numsInStr&lt;/span&gt;
      &lt;span class="nf"&gt;.trim&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sc"&gt;' '&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="nf"&gt;.map&lt;/span&gt;&lt;span class="p"&gt;(|&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="nf"&gt;.parse&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
      &lt;span class="nf"&gt;.collect&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"{:?}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;numsInVec&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Loops
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;for loop
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;arr1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nd"&gt;vec!&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;34&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;90&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;110&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="n"&gt;arr1&lt;/span&gt;&lt;span class="nf"&gt;.len&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"{:?}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>rust</category>
    </item>
    <item>
      <title>Deploy and Verify smart contracts using Hardhat</title>
      <dc:creator>Mahesh</dc:creator>
      <pubDate>Mon, 13 Sep 2021 08:17:14 +0000</pubDate>
      <link>https://dev.to/youngmahesh/deploy-and-verify-smart-contracts-using-hardhat-1719</link>
      <guid>https://dev.to/youngmahesh/deploy-and-verify-smart-contracts-using-hardhat-1719</guid>
      <description>&lt;p&gt;For this tutorial we are going to deploy 3 smart contracts: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;basic contract&lt;/li&gt;
&lt;li&gt;erc20 contract&lt;/li&gt;
&lt;li&gt;erc721 contract&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Setup project
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Install hardhat
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm init &lt;span class="nt"&gt;-y&lt;/span&gt;     
npm &lt;span class="nb"&gt;install &lt;/span&gt;hardhat   
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  start hardhat project
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Start project with &lt;code&gt;npx hardhat&lt;/code&gt;. &lt;/li&gt;
&lt;li&gt;Choose 'Create a basic sample project' from options&lt;/li&gt;
&lt;li&gt;Download dependencies asked for download, if you missed them, then download them by running &lt;code&gt;npm install @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers ethers&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Add contracts to deploy
&lt;/h2&gt;

&lt;p&gt;Inside &lt;code&gt;contracts&lt;/code&gt; directory put the the contracts you want to deploy.&lt;br&gt;
I am putting 3 contracts as:&lt;/p&gt;
&lt;h3&gt;
  
  
  1. Basic contract  (contracts/Greeter.sol)
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "hardhat/console.sol";

contract Greeter {
    string private greeting;

    constructor(string memory _greeting) {
        console.log("Deploying a Greeter with greeting:", _greeting);
        greeting = _greeting;
    }

    function greet() public view returns (string memory) {
        return greeting;
    }

    function setGreeting(string memory _greeting) public {
        greeting = _greeting;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  2. erc20 contract (contracts/PopatToken.sol)
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract Popat is ERC20, ERC20Burnable, Ownable {
    constructor() ERC20("Popat", "PT") {}

    function mint(address to, uint256 amount) public onlyOwner {
        _mint(to, amount);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;As we are importing openzepplin files in our contract, hence we are going to install the &lt;a href="https://openzeppelin.com/contracts/"&gt;OpenZepplin&lt;/a&gt; npm package in our project as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @openzeppelin/contracts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. erc721 contract (contract/PikachuNFT.sol)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";

contract Pikachu is ERC721, ERC721Burnable, Ownable {
    using Counters for Counters.Counter;

    Counters.Counter private _tokenIdCounter;

    constructor() ERC721("Pikachu", "PK") {}

    function safeMint(address to) public onlyOwner {
        _safeMint(to, _tokenIdCounter.current());
        _tokenIdCounter.increment();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Modify hardhat configuration (&lt;code&gt;hardhat.confi.js&lt;/code&gt;):
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Configure solidity versions
&lt;/h3&gt;

&lt;p&gt;Hardhat supports projects that use different, incompatible versions of solc. You can configure Hardhat to use compiler versions compatible with those files like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;solidity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;compilers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0.8.4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0.6.7&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This setup means that a file with a pragma solidity ^0.8.0, ^0.8.1, ..., ^0.8.4 will be compiled with solc 0.8.4 and a file with a pragma solidity ^0.6.0, ..., ^0.6.7 will be compiled with solc 0.6.7&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Define network configuration
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="na"&gt;defaultNetwork&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;rinkeby&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;rinkeby&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;// NETWORK_ENDPOINT_RINKEBY,&lt;/span&gt;
      &lt;span class="na"&gt;accounts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;// [ACCOUNT_0_PRIVATE_KEY, ACCOUNT_1_PRIVATE_KEY]&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nl"&gt;namedAccounts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;account0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;account1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In each network you define, put node-endpoint-url through which you are going to connect with the network as the value of &lt;code&gt;url&lt;/code&gt; field, the most popular endpoint provider is: &lt;a href="https://infura.io/"&gt;https://infura.io/&lt;/a&gt; &lt;br&gt;
Get the private keys of the accounts from which you want to deploy the contract and put them as array as value of &lt;code&gt;accounts&lt;/code&gt; field&lt;br&gt;
In &lt;code&gt;namedAccounts&lt;/code&gt; field, you have to define name of account, which you will use while writing deploy code. Value of each account-name is the index-of-account's private-key inside &lt;code&gt;&amp;lt;network-name&amp;gt;.accounts: []&lt;/code&gt; array&lt;/p&gt;
&lt;h3&gt;
  
  
  3. Define ethereum-api key
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;solidity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;etherscan&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;// ETHERSCAN_API_KEY&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  4. Import npm packages required in config file
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@nomiclabs/hardhat-waffle&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hardhat-deploy&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The final configuration file on is look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// hardhat.config.js&lt;/span&gt;
&lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@nomiclabs/hardhat-waffle&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hardhat-deploy&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dotenv&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;solidity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;compilers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0.8.4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;defaultNetwork&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;rinkeby&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;rinkeby&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NETWORK_ENDPOINT_RINKEBY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;accounts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ACCOUNT_0_PRIVATE_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ACCOUNT_1_PRIVATE_KEY&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;namedAccounts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;account0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;account1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;etherscan&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ETHERSCAN_API_KEY&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You have to install &lt;a href="https://www.npmjs.com/package/dotenv"&gt;dotenv&lt;/a&gt; package to use environment variables as used in above file, else you can also put values directly if your repository is not public.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploy Contracts
&lt;/h2&gt;

&lt;p&gt;Install &lt;a href="https://github.com/wighawag/hardhat-deploy"&gt;hardhat-deploy&lt;/a&gt; plugin as &lt;code&gt;npm install hardhat-deploy&lt;/code&gt; and import it inside 'hardhat.config.js' file as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hardhat-deploy&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Put all deploy scripts under 'deploy' folder so deploy-plugin can detect and execute them&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Deploy script for Basic contract
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// deploy/0_greeter.js&lt;/span&gt;
&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="nx"&gt;getNamedAccounts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;deployments&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;deploy&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;deployments&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;account0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;account1&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;getNamedAccounts&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;deploy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Greeter&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;account0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;args&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Mahesh is Learning HardHat!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
      &lt;span class="na"&gt;log&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Deploy script for erc20 cotract
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// deploy/1_popatToken.js&lt;/span&gt;
&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="nx"&gt;getNamedAccounts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;deployments&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;deploy&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;deployments&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;account0&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;getNamedAccounts&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;deploy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Popat&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;account0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;args&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
        &lt;span class="na"&gt;log&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Deploy script for erc721 contract
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// deploy/2_pikchuNFT.js&lt;/span&gt;
&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="nx"&gt;deployments&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;getNamedAccounts&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;deploy&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;deployments&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;account0&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;getNamedAccounts&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;deploy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Pikachu&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;account0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;args&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
        &lt;span class="na"&gt;log&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see deploy scripts are same for all type of cotracts, the deploy scripts finds the contract by looking at the name of cotract defined inside &lt;code&gt;.sol&lt;/code&gt; file. &lt;br&gt;
E.g. In Greeter.sol file we defined contract name as &lt;code&gt;contract Greeter {&lt;/code&gt;, hence we are using that same contract name inside deploy script as &lt;code&gt;await deploy('Greeter', {&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now, we are ready for the deployment and verification 👍 &lt;/p&gt;

&lt;p&gt;Deploy contracts&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx hardhat deploy    # deploy contracts to defaulNetwork
# OR
npx hardhat --network rinkeby deploy   # deploy contrats to a specific network
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Vefify Contracts
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx hardhat etherscan-verify
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can see the progress and contract-addresses in the console when you execute above deploy and vefication commands.&lt;/p&gt;

&lt;p&gt;My simple tutorial ends here. Happy Coding ! 😊 &lt;/p&gt;

</description>
      <category>hardhat</category>
      <category>etherscan</category>
      <category>openzeppelin</category>
      <category>verify</category>
    </item>
    <item>
      <title>Why IT Industry is fastest growing Industry in the World</title>
      <dc:creator>Mahesh</dc:creator>
      <pubDate>Sat, 08 Aug 2020 07:19:54 +0000</pubDate>
      <link>https://dev.to/youngmahesh/why-it-industry-is-fastest-growing-industry-in-the-world-1p2d</link>
      <guid>https://dev.to/youngmahesh/why-it-industry-is-fastest-growing-industry-in-the-world-1p2d</guid>
      <description>&lt;h3&gt;
  
  
  1. Easy entry for newcomer
&lt;/h3&gt;

&lt;p&gt;The entry barrier for newcomer in IT industry is lowest compare to any other field. As almost anyone can learn any IT technology just by a computer and internet connection.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Automation
&lt;/h3&gt;

&lt;p&gt;Once code is written for some work the work could be done millions or billions of times without any human need. Hence, unlike other industries, IT professionals can work heavy tasks in a short period.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Money
&lt;/h3&gt;

&lt;p&gt;Automation leads to increased margins of profit for established IT companies. Hence the IT industry has the highest amount of money-flow inside it which leads to evolution of old technologies and invention of new-ones.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. Free services to developers
&lt;/h3&gt;

&lt;p&gt;The amount of free services the IT industry provides to its developers is unparalleled to any other industry.&lt;/p&gt;

&lt;p&gt;Hence, the learning curve of new developers increases rapidly in a short period as there are almost no restrictions due to money on learning new technology.&lt;/p&gt;




&lt;h3&gt;
  
  
  5. Learning curve
&lt;/h3&gt;

&lt;p&gt;As it is just a few clicks away to get any new information or a new skill. The learning curve in programming is way higher than in other industries.&lt;/p&gt;

&lt;p&gt;Hence, the number of experts in technology is larger than in any other industry.&lt;/p&gt;




&lt;h3&gt;
  
  
  6. Millions of programmers &amp;amp; still counting
&lt;/h3&gt;

&lt;p&gt;As it very easy to get in and the rapid learning, the number of programmers around the world increased exponentially and still increasing.&lt;/p&gt;




&lt;h3&gt;
  
  
  7. IT Industry penetration
&lt;/h3&gt;

&lt;p&gt;As the IT industry is mainly based on Automation, precision &amp;amp; inventions, it is penetrating and becoming part of almost every other industry.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Competitive Programming setup in VS-Code</title>
      <dc:creator>Mahesh</dc:creator>
      <pubDate>Wed, 05 Aug 2020 15:16:30 +0000</pubDate>
      <link>https://dev.to/youngmahesh/competitive-programming-setup-in-vs-code-dkn</link>
      <guid>https://dev.to/youngmahesh/competitive-programming-setup-in-vs-code-dkn</guid>
      <description>&lt;h3&gt;
  
  
  Note
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Programming Languages Covered - C++, Java, Python&lt;/li&gt;
&lt;li&gt;Code Editor used - VSCode&lt;/li&gt;
&lt;li&gt;Operating Systems covered - Windows, Linux, MacOS&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Target
&lt;/h3&gt;

&lt;p&gt;Create an environment such that - &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We could write 'input' inside a text-file&lt;/li&gt;
&lt;li&gt;Click on a icon&lt;/li&gt;
&lt;li&gt;And 'output' of the code will be shown in Terminal or will be written in a text-file&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  1. Create Folder
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create a new folder on desktop and open this folder inside VSCode&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create &lt;code&gt;app.cpp&lt;/code&gt;, &lt;code&gt;app.java&lt;/code&gt;, &lt;code&gt;app.py&lt;/code&gt; in the folder&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Also create &lt;code&gt;input.txt&lt;/code&gt; in the folder with following text:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   This is line 1
   This is line 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Download &lt;a href="https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner"&gt;code-runner&lt;/a&gt;  extension for VSCode and restart VSCode&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Go to settings of VSCode with &lt;code&gt;Cntr + ,&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on top-right 'file-icon' (to open settings in JSON)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set &lt;code&gt;"code-runner.saveFileBeforeRun"&lt;/code&gt; as &lt;code&gt;true&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Keep this sfile open for further modification&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  2. C++ Setup
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Download and install &lt;a href="https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe/download"&gt;MinGW-w64 for Windows&lt;/a&gt; - compiler for C++&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Execute &lt;code&gt;g++ --version&lt;/code&gt; inside PowerShell to check if compiler is correctly installed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Paste following code inside &lt;code&gt;app.cpp&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include &amp;lt;bits/stdc++.h&amp;gt;
&lt;/span&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

   &lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;word1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;word2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;             &lt;span class="c1"&gt;// memory-space for words&lt;/span&gt;
   &lt;span class="n"&gt;cin&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;word1&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;word2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;           &lt;span class="c1"&gt;// insert first-word =&amp;gt; word1 &amp;amp;&amp;amp; second-word =&amp;gt; word2&lt;/span&gt;
   &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;word1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;" "&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;word2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// output "&amp;lt;word1&amp;gt; &amp;lt;word2&amp;gt;"&lt;/span&gt;

   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;If yo are using Windows, Open PowerShell using &lt;code&gt;Cntr + ~&lt;/code&gt; (Choose 'PowerShell' as Default shell if not already) and run the following command
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;app.cpp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-o&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Get-Content&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;input.txt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;\app&lt;/span&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="c"&gt;# write output in the powershell-termainal&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="c"&gt;# g++ app.cpp  =&amp;gt; compile 'app.cpp' with g++&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="c"&gt;# -o app       =&amp;gt; defining output file-name as 'app.exe'&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="c"&gt;# ;            =&amp;gt; end of command&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="c"&gt;# Get-Content input.txt | .\app  =&amp;gt; Execute 'app.exe' with content from 'input.txt'&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="c"&gt;# OR&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;app.cpp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-o&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Get-Content&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;input.txt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;\app&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;output.txt&lt;/span&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="c"&gt;# write output inside 'output.txt' file&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;OR&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If your are using Mac or Linux, Open Bash/Terminal using &lt;code&gt;Ctrl + ~&lt;/code&gt; and run the following command
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;g++ app.cpp &lt;span class="nt"&gt;-o&lt;/span&gt; app &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cat &lt;/span&gt;input.txt | ./app &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; output.txt      
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  3. Java Setup
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Download and Install &lt;a href="https://java.com/en/download/"&gt;Java&lt;/a&gt; - for compilation of Java Code&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Execute &lt;code&gt;java --version&lt;/code&gt; inside PowerShell to check if compiler is installed correctly&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Paste following code inside &lt;code&gt;app.java&lt;/code&gt; file&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.*&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.lang.*&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.*&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="cm"&gt;/* IMPORTANT: class-name must be equal to file-name, here file-name is 'app.java', hence class-name is 'class app' */&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;app&lt;/span&gt;
&lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="n"&gt;java&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;lang&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;Exception&lt;/span&gt;
    &lt;span class="o"&gt;{&lt;/span&gt;
      &lt;span class="nc"&gt;File&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;File&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"./input.txt"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// declare input&lt;/span&gt;
        &lt;span class="nc"&gt;Scanner&lt;/span&gt; &lt;span class="n"&gt;scanner1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Scanner&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// declare scanner&lt;/span&gt;

      &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;word1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;scanner1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;next&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;         &lt;span class="c1"&gt;// scan first-word&lt;/span&gt;
      &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;word2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;scanner1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;next&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;         &lt;span class="c1"&gt;// scan second-word&lt;/span&gt;

      &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;word3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;word1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;word2&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
      &lt;span class="c1"&gt;// String line1 = sc1.nextLine();      // in-case if you want to scan complete line&lt;/span&gt;

      &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;print&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;word3&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;         &lt;span class="c1"&gt;// output "&amp;lt;word1&amp;gt; &amp;lt;word2&amp;gt;"&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;For Windows, open PowerShell and run command as -
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;javac&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;app.java&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;java&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c"&gt;# output in the powershell-terminal&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="c"&gt;# OR&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;javac&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;app.java&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;java&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;output.txt&lt;/span&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="c"&gt;# write output inside 'output.txt'&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="c"&gt;# javac app.java   =&amp;gt;  compile '.java' file using javac into bytecode as '.class'&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="c"&gt;# ;                =&amp;gt;  end of previous-command&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="c"&gt;# &amp;gt;                =&amp;gt; transfer output genereated to the a file&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="c"&gt;# java app         =&amp;gt;  execute '.class' file&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;For Linux or MacOS, Open Bash and run command as -
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;javac app.java &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; java app        &lt;span class="c"&gt;# write output in bash-terminal&lt;/span&gt;
&lt;span class="c"&gt;#OR&lt;/span&gt;
javac app.java &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; java app &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; output.txt  &lt;span class="c"&gt;# write output in output.txt file&lt;/span&gt;

&lt;span class="c"&gt;# javac app.java    =&amp;gt; compile app.java to app.class&lt;/span&gt;
&lt;span class="c"&gt;# &amp;amp;&amp;amp;                =&amp;gt; and, bridge between two-separate commands&lt;/span&gt;
&lt;span class="c"&gt;# java app          =&amp;gt; execute '.class' file&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  4. Python Setup
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Download and Install - &lt;a href="https://www.python.org/downloads/"&gt;Python&lt;/a&gt; for compilation of python code&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Execute &lt;code&gt;python --version&lt;/code&gt; inside PowerShell to check if Python is correctly installed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Paste following code into &lt;code&gt;app.py&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;line1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;         &lt;span class="c1"&gt;# get 'first-line' as value of variable 'line1'
&lt;/span&gt;&lt;span class="n"&gt;line2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;         &lt;span class="c1"&gt;# get 'second-line' as value of variable 'line2'
&lt;/span&gt;
&lt;span class="n"&gt;arr1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;line1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;    &lt;span class="c1"&gt;# get array of individual words from 'line1'
&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arr1&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;' '&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;arr1&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;  &lt;span class="c1"&gt;# output =&amp;gt; "&amp;lt;word1&amp;gt; &amp;lt;word2&amp;gt;"
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;For Windows, open PowerShell and run -
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Get-Content&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;\input.txt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;python&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;\app.py&lt;/span&gt;&lt;span class="w"&gt;       &lt;/span&gt;&lt;span class="c"&gt;# output will print inside 'powershell'&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;Get-Content&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;\input.txt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;python&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;\app.py&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;output.txt&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c"&gt;# ouput will be written inside 'output.txt'&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;For Linux or MacOS, open Bash and run -
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat &lt;/span&gt;input.txt | python app.py     &lt;span class="c"&gt;# write output insided terminal&lt;/span&gt;
&lt;span class="nb"&gt;cat &lt;/span&gt;input.txt | python app.py &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; output.txt    &lt;span class="c"&gt;# write output inside file named - output.txt in the same folder&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  5. Execute PowerShell/Bash Commands with One-Click
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Open VSCode settings (inside JSON format) as described in the Step-1&lt;/li&gt;
&lt;li&gt;Comment out code for &lt;code&gt;cpp&lt;/code&gt;, &lt;code&gt;java&lt;/code&gt; and &lt;code&gt;python&lt;/code&gt; inside &lt;code&gt;"code-runner.executorMap": {}&lt;/code&gt; and add the json-code given below:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;For WIndows
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"cpp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"g++ $fileName -o $fileNameWithoutExt; Get-Content input.txt | .&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;$fileNameWithoutExt"&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"java"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"javac $fileName; java $fileNameWithoutExt"&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"python"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Get-Content .&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;input.txt | python .&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;app.py"&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;For Linux or Bash
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"cpp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"g++ $fileName -o $fileNameWithoutExt &amp;amp;&amp;amp; cat input.txt | ./$fileNameWithoutExt"&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"java"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"javac $fileName &amp;amp;&amp;amp; java $fileNameWithoutExt"&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"python"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cat input.txt | python app.py"&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Now come to the file &lt;code&gt;app.cpp&lt;/code&gt; or &lt;code&gt;app.java&lt;/code&gt; or &lt;code&gt;app.py&lt;/code&gt; file&lt;/li&gt;
&lt;li&gt;Click on the 'horizontal-rectangle' icon on 'top-left'  =&amp;gt;  Now you can see the 'output' of your code inside PowerShell/Bash terminal&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this way you can test your code with just 'one-click' (with writing input inside 'input.txt' file) before submitting on 'Competitive Programming Platform'.&lt;/p&gt;

&lt;p&gt;If you find any problems or want to suggest improvements, please let me know in comments and I will modify this article.&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>competitive</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
