<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Gopesh Sharma on Medium]]></title>
        <description><![CDATA[Stories by Gopesh Sharma on Medium]]></description>
        <link>https://medium.com/@gopesh_sharma?source=rss-6dcd3b7b79a8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*S0aoTJBryLBvPT1pDuweXg.jpeg</url>
            <title>Stories by Gopesh Sharma on Medium</title>
            <link>https://medium.com/@gopesh_sharma?source=rss-6dcd3b7b79a8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 07:06:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gopesh_sharma/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Are you a Passive Investor or an Active Investor]]></title>
            <link>https://medium.com/@gopesh_sharma/are-you-a-passive-investor-or-an-active-investor-660c32d6d78a?source=rss-6dcd3b7b79a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/660c32d6d78a</guid>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[personal-finance]]></category>
            <category><![CDATA[investing]]></category>
            <category><![CDATA[investors]]></category>
            <category><![CDATA[money]]></category>
            <dc:creator><![CDATA[Gopesh Sharma]]></dc:creator>
            <pubDate>Tue, 03 Jan 2023 07:00:28 GMT</pubDate>
            <atom:updated>2023-01-03T07:00:28.457Z</atom:updated>
            <content:encoded><![CDATA[<p>Saving is good, but if we do not invest that money then that saving is of no use. <a href="https://finance.gopeshsharma.dev/basics/guide-beginner-investor/">Investing is the procedure</a> where the money which is saved makes more money for you. That means you are putting your money to work for you. The more money you have, the more money you can make by investing and this is the principle most people follow to become financially free. To become financially free, the money which works for you can provide enough money for your monthly expense.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IlCByH3B0k6fIMrzKvNN9w.png" /><figcaption>Active vs Passive Investor</figcaption></figure><p>In today’s world, there are mainly two types of investment,</p><ol><li>Passive Investment</li><li>Active Investment</li></ol><h3>Passive Investment</h3><p>This investment strategies mean that once you made the investment you do not have to do anything and it will grow on its own. Like a Mutual Fund where you invest some money every month and the Mutual Fund manager manages that money for you.</p><h3>Active Investment</h3><p>These investment strategies mean that you have to be more involved in managing the money, most probably daily. It includes researching the company and start investing in it.</p><p>For newbies, the main difference between Active and Passive which you can visualize is Managing Stocks Portfolio vs Mutual Fund Portfolio. In Stocks, you might go for options, futures, and daily trading where you are actively managing the money whereas in Mutual funds you are buying some units monthly using SIP and that’s it.</p><h3>Which is Good — Active or Passive Investing</h3><p>In my case, most of my investment is in passive mode because I do not have to think about the losses or profits because I know in long term the compound interest will take effect and my money will grow steadily.</p><p>But if you are someone who wants to take more risks and try to earn more then the active investment is for you where you can manage the money by actively buying or selling the stocks. When there is a risk, there is a better reward waiting for you and that is where the active investor makes money.</p><p>Every investor is unique and thus everyone has their own investment style. It all depends on the investor’s personal preferences or how much risk he is willing to take. So it is not easy to decide which one you should become. If you are clear towards your financial goals then either one is ok, it is you who have to manage your portfolio and see if you can reach your financial goals or not.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=660c32d6d78a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Having 3 Months of Emergency Fund Enough?]]></title>
            <link>https://medium.com/@gopesh_sharma/having-3-months-of-emergency-fund-enough-cb5dafc279b9?source=rss-6dcd3b7b79a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb5dafc279b9</guid>
            <category><![CDATA[emergency-fund]]></category>
            <category><![CDATA[recession-proof]]></category>
            <category><![CDATA[money]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[personal-finance]]></category>
            <dc:creator><![CDATA[Gopesh Sharma]]></dc:creator>
            <pubDate>Mon, 02 Jan 2023 08:19:13 GMT</pubDate>
            <atom:updated>2023-01-02T08:19:13.376Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are a young earner or an experienced one, having an <a href="https://finance.gopeshsharma.dev/basics/personal-emegency-fund/">emergency fund</a> is very much required for your financial safety. If you do not have an emergency fund yet, start saving today whatever it takes. An emergency fund will provide a much-needed cushion in your financial stability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jcB5tUQq2jMSTnOFLZcdhA.png" /><figcaption>Emergency Fund</figcaption></figure><p>For beginners, an emergency fund is just like a savings account which should only be accessed at the time of emergencies like medical emergencies, car repairs or even job losses. It should be as liquid as possible that doesn’t earn any interest because the main aim here is to provide that peace of mind when any emergency occurs.</p><p>For example, you lose your job because of a recession and you do not have any secondary income stream as well as do not have any money saved up. You need money to pay rent and other things than what should you do? You will end up borrowing from friends/families or start utilizing your credit card or take a loan. What if these all things can be avoidable if you have a fund which is kept for situations like these? This is where the emergency fund will come into the picture.</p><p><strong>Having 3 Months of Emergency Fund Enough?</strong></p><p>To be honest, a lot of people have 3 months of expenses as an emergency fund and it works for most people, but it might not work for you. Actually, the best size of an emergency fund differs from individual to individual based on their financial situation, their expenses, and their debts. If the emergency fund is just for the job loss, 3 months are enough but if you are counting that emergency fund to be used for medical expenses then 6 months of expense as an emergency fund is the ideal choice.</p><p>Do you have any emergency funds, if not start by doing the below steps:</p><ol><li>Start small — It’s better to start small like 1% to 10% of your income in an emergency fund and then gradually increase further.</li><li>Make it a priority — It’s important to make your emergency fund a priority, your number 1 priority</li></ol><p>Having an <a href="https://finance.gopeshsharma.dev/basics/personal-emegency-fund/">emergency fund</a> is worth it because it helps you to sleep better because you are more prepared to handle emergencies. Also, it helps you to avoid taking higher-interest loans and thus save your financial situation to a great extent. Finally, just try to stay motivated in getting that emergency fund and start contributing towards it from today itself and stay committed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb5dafc279b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Everyone should Start with a 50/30/20 Budget Method]]></title>
            <link>https://medium.com/@gopesh_sharma/everyone-should-start-with-a-50-30-20-budget-method-ef98b4cf5642?source=rss-6dcd3b7b79a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef98b4cf5642</guid>
            <category><![CDATA[money-management]]></category>
            <category><![CDATA[budgeting]]></category>
            <category><![CDATA[money]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[personal-finance]]></category>
            <dc:creator><![CDATA[Gopesh Sharma]]></dc:creator>
            <pubDate>Fri, 30 Dec 2022 10:02:19 GMT</pubDate>
            <atom:updated>2022-12-30T10:03:16.658Z</atom:updated>
            <content:encoded><![CDATA[<p>Having a Budget is like the foundation for the best <a href="https://finance.gopeshsharma.dev/basics/fundamentals-personal-finance/">personal finance</a> you can have. Budget is a simple and easy way to track your costs and keep tabs on your spending so that you can make informed decisions about where to allocate your money. It also helps you stay disciplined when it comes to sticking to budgeted restrictions, which can help improve both your financial situation and overall well-being.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sMsQpBLnPSCuSfysy7GgsQ.png" /><figcaption>Budgeting Mehods</figcaption></figure><p>In Simple terms, a <a href="https://finance.gopeshsharma.dev/basics/creating-budget/">budget</a> is a plan for spending and saving money and this is a must-have for everyone who follows personal finance. A budget allows you to see all of your expenses in one place — from groceries, utilities, transportation costs, entertainment purchases, etc. — and analyze them according to category (e.g., food &amp; beverage; housing; healthcare) or by month/year. This transparency makes it easier for you to monitor progress and adjusts plans accordingly should there be any changes in budget projections.</p><p>Creating a budget can be an extremely helpful way to manage your finances and stay on track. By creating a budget, you are able to plan for future expenses and live within your means. Additionally, budgets help you to track your spending so that you can better understand where money is going and make adjustments as needed. Newbies might find it hard, but trust me creating a budget is very simple and thus following it. If you are a newbie you can start with the 50/30/20 <a href="https://finance.gopeshsharma.dev/budgeting/budgeting-methods/">budgeting method</a> and thus in 3–6 months&#39; time, you will be a pro in budgeting.</p><p>The 50/30/20 rule states that 50% of income should be used for needs (expenses like bills, rent etc), 30% for wants (eating out, movies etc.)and 20% for savings (mainly investment).</p><p>For example, if someone has $100 as income, he will divide $50 for needs, $30 for wants and $20 for savings.</p><p>This budgeting method is the best for beginners because it is quite easy to follow and helps you stay disciplined. This also gives you a sense of control over one’s financial situation which can be empowering. So whether you’re just starting out or want to refine the way that you’re managing your money now, creating a 50/30/20 budget is definitely an effective strategy!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef98b4cf5642" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I asked Chat GPT to build a Budgeting App]]></title>
            <link>https://medium.com/@gopesh_sharma/i-asked-chat-gpt-to-build-a-budgeting-app-3e3606470a93?source=rss-6dcd3b7b79a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e3606470a93</guid>
            <category><![CDATA[budgeting]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Gopesh Sharma]]></dc:creator>
            <pubDate>Thu, 29 Dec 2022 00:00:12 GMT</pubDate>
            <atom:updated>2023-01-03T11:12:47.674Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*f8GMDf5aab9UgGskD2N4zg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@santesson89?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Andrea De Santis</a> on <a href="https://unsplash.com/photos/zwd435-ewb4?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Chat GPT is an AI-based chatbot that can answer any question, where understands any topic and can do tasks like creating a Budgeting App (which I have asked ChatGPT to create) as well as writing blog posts, writing unit tests and whatnot.</p><p>So the first thing I have asked is to explain, what is Chat GPT as a 5-year-old</p><blockquote><em>GPT is a computer program that can write stories, answers, or even have a chat with you! It’s really smart and it knows a lot of words and how to use them to make sentences that make sense.</em></blockquote><blockquote><em>Sometimes, you can give GPT a little bit of information, like a list of words or a sentence, and it can turn that into a whole story or a whole bunch of answers to questions. It’s like a magic machine that can write lots of things just by learning from other things that people have written before.</em></blockquote><blockquote><em>GPT is really good at pretending to be a person when it talks to you. It can even translate words from one language to another. It’s really helpful for making chatbots or for helping people write things.</em></blockquote><p>The response is pretty awesome and I can explain the same thing to my kid too.</p><p>Next, I have asked Chat GPT to write a budget app and given the prompts as below:</p><blockquote><em>can you give me the code to create a budget app that allows me to edit the items and store them in a database using javascript</em></blockquote><p>The response I got is</p><pre>const budgetForm = document.querySelector(&#39;#budget-form&#39;);<br>const budgetInput = document.querySelector(&#39;#budget-input&#39;);<br>const budgetList = document.querySelector(&#39;#budget-list&#39;);<br><br>let budget = [];<br><br>function addBudget(e) {<br>  e.preventDefault();<br><br>  if (budgetInput.value === &#39;&#39;) return;<br><br>  const newBudget = {<br>    id: Date.now(),<br>    budget: budgetInput.value<br>  };<br><br>  budget.push(newBudget);<br><br>  budgetInput.value = &#39;&#39;;<br><br>  updateBudget();<br>}<br><br>function removeBudget(id) {<br>  budget = budget.filter(budget =&gt; budget.id !== id);<br><br>  updateBudget();<br>}<br><br>function updateBudget() {<br>  budgetList.innerHTML = &#39;&#39;;<br><br>  budget.forEach(budget =&gt; {<br>    budgetList.innerHTML += `<br>      &lt;li class=&quot;budget-item&quot; data-id=&quot;${budget.id}&quot;&gt;<br>        ${budget.budget}<br>        &lt;button class=&quot;btn btn-danger btn-sm float-right delete-budget-btn&quot;&gt;<br>          Remove<br>        &lt;/button&gt;<br>      &lt;/li&gt;<br>    `;<br>  });<br><br>  localStorage.setItem(&#39;budget&#39;, JSON.stringify(budget));<br>}<br><br>budgetForm.addEventListener(&#39;submit&#39;, addBudget);<br>budgetList.addEventListener(&#39;click&#39;, e =&gt; {<br>  if (e.target.classList.contains(&#39;delete-budget-btn&#39;)) {<br>    const id = e.target.parentElement.getAttribute(&#39;data-id&#39;);<br><br>    removeBudget(id);<br>  }<br>});<br><br>updateBudget();</pre><p>So I got what I wanted, but I wanted to have HTML, CSS and JavaScript too, so I again asked:</p><blockquote><em>can you give me the code to create a budget app having 50/30/20 budgeting method (credit and debit) that allows me to edit the items and store them in a database using javascript, html, css</em></blockquote><p>The response was</p><pre>&lt;html&gt;<br>&lt;head&gt;<br>  &lt;style&gt;<br>    /* Some basic styling for the app */<br>    * {<br>      font-family: sans-serif;<br>    }<br><br>    form {<br>      display: flex;<br>      flex-direction: column;<br>      width: 50%;<br>      margin: 0 auto;<br>    }<br><br>    label {<br>      margin-bottom: 5px;<br>    }<br><br>    input[type=&quot;number&quot;] {<br>      width: 60px;<br>      margin-right: 10px;<br>    }<br><br>    .transactions {<br>      display: flex;<br>      flex-direction: column;<br>      width: 50%;<br>      margin: 20px auto;<br>    }<br><br>    .transactions h2 {<br>      text-align: center;<br>    }<br><br>    .transactions ul {<br>      list-style: none;<br>      padding: 0;<br>      margin: 0;<br>    }<br><br>    .transaction {<br>      display: flex;<br>      justify-content: space-between;<br>      align-items: center;<br>      border-bottom: 1px solid #ccc;<br>      padding: 5px 0;<br>    }<br><br>    .transaction.credit {<br>      color: green;<br>    }<br><br>    .transaction.debit {<br>      color: red;<br>    }<br><br>    .transaction-type {<br>      width: 75px;<br>      text-align: center;<br>    }<br><br>    .transaction-amount {<br>      width: 75px;<br>      text-align: right;<br>    }<br><br>    .transaction-category {<br>      width: 75px;<br>      text-align: center;<br>    }<br><br>    .transaction-delete {<br>      cursor: pointer;<br>      width: 20px;<br>      text-align: center;<br>    }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;!-- The form to add new transactions --&gt;<br>  &lt;form id=&quot;transaction-form&quot;&gt;<br>    &lt;label for=&quot;transaction-type&quot;&gt;Type:&lt;/label&gt;<br>    &lt;select id=&quot;transaction-type&quot;&gt;<br>      &lt;option value=&quot;credit&quot;&gt;Credit&lt;/option&gt;<br>      &lt;option value=&quot;debit&quot;&gt;Debit&lt;/option&gt;<br>    &lt;/select&gt;<br>    &lt;label for=&quot;transaction-amount&quot;&gt;Amount:&lt;/label&gt;<br>    &lt;input type=&quot;number&quot; id=&quot;transaction-amount&quot; min=&quot;0&quot; step=&quot;0.01&quot;&gt;<br>    &lt;label for=&quot;transaction-category&quot;&gt;Category:&lt;/label&gt;<br>    &lt;select id=&quot;transaction-category&quot;&gt;<br>      &lt;option value=&quot;necessary&quot;&gt;Necessary&lt;/option&gt;<br>      &lt;option value=&quot;essential&quot;&gt;Essential&lt;/option&gt;<br>      &lt;option value=&quot;discretionary&quot;&gt;Discretionary&lt;/option&gt;<br>    &lt;/select&gt;<br>    &lt;button type=&quot;submit&quot;&gt;Add&lt;/button&gt;<br>  &lt;/form&gt;<br><br>  &lt;!-- The container to display the current balance and the transactions --&gt;<br>  &lt;div class=&quot;transactions&quot;&gt;<br>    &lt;h2&gt;Current Balance: &lt;span id=&quot;balance&quot;&gt;0&lt;/span&gt;&lt;/h2&gt;<br>    &lt;ul id=&quot;transactions&quot;&gt;&lt;/ul&gt;<br>  &lt;/div&gt;<br><br>  &lt;script&gt;<br>    const transactionForm = document.querySelector(&#39;#transaction-form&#39;);<br>    const transactionType = document.querySelector(&#39;#transaction-type&#39;);<br>    const transactionAmount = document.querySelector(&#39;#transaction-amount&#39;);</pre><p>So I did not get the full code, JavaScript was missing and got only CSS and HTML. So I asked the ChatGPT to provide only the JavaScript code now,</p><blockquote><em>can you give javascript only of the above code</em></blockquote><pre>const transactionForm = document.querySelector(&#39;#transaction-form&#39;);<br>const transactionType = document.querySelector(&#39;#transaction-type&#39;);<br>const transactionAmount = document.querySelector(&#39;#transaction-amount&#39;);<br>const transactionCategory = document.querySelector(&#39;#transaction-category&#39;);<br>const transactionsList = document.querySelector(&#39;#transactions&#39;);<br>const balance = document.querySelector(&#39;#balance&#39;);<br><br>// An array to store the transactions<br>let transactions = [];<br><br>// A helper function to calculate the balance<br>function calculateBalance() {<br>  let total = 0;<br><br>  transactions.forEach(transaction =&gt; {<br>    if (transaction.type === &#39;credit&#39;) {<br>      total += transaction.amount;<br>    } else {<br>      total -= transaction.amount;<br>    }<br>  });<br><br>  balance.textContent = total.toFixed(2);<br>}<br><br>// A function to add a new transaction<br>function addTransaction(e) {<br>  e.preventDefault();<br><br>  if (transactionAmount.value === &#39;&#39;) return;<br><br>  const transaction = {<br>    id: Date.now(),<br>    type: transactionType.value,<br>    amount: +transactionAmount.value,<br>    category: transactionCategory.value<br>  };<br><br>  transactions.push(transaction);<br><br>  transactionAmount.value = &#39;&#39;;<br><br>  updateTransactions();<br>}<br><br>// A function to remove a transaction<br>function removeTransaction(id) {<br>  transactions = transactions.filter(transaction =&gt; transaction.id !== id);<br><br>  updateTransactions();<br>}<br><br>// A function to update the transactions list and the balance<br>function updateTransactions() {<br>  transactionsList.innerHTML = &#39;&#39;;<br><br>  transactions.forEach(transaction =&gt; {<br>    const className = transaction.type === &#39;credit&#39; ? &#39;credit&#39; : &#39;debit&#39;;<br><br>    transactionsList.innerHTML += `<br>      &lt;li class=&quot;transaction ${className}&quot; data-id=&quot;${transaction.id}&quot;&gt;<br>        &lt;div class=&quot;transaction-type&quot;&gt;${transaction.type}&lt;/div&gt;<br>        &lt;div class=&quot;transaction-amount&quot;&gt;${transaction.amount}&lt;/div&gt;<br>        &lt;div class=&quot;transaction-category&quot;&gt;${transaction.category}&lt;/div&gt;<br>        &lt;div class=&quot;transaction-delete&quot;&gt;<br>          &lt;button class=&quot;btn btn-danger btn-sm delete-transaction-btn&quot;&gt;<br>            X<br>          &lt;/button&gt;<br>        &lt;/div&gt;<br>      &lt;/li&gt;<br>    `;<br>  });<br><br>  calculateBalance();<br><br>  localStorage.setItem(&#39;transactions&#39;, JSON.stringify(transactions));<br>}<br><br>// Event listeners<br>transactionForm.addEventListener(&#39;submit&#39;, addTransaction);<br>transactionsList.addEventListener(&#39;click&#39;, e =&gt; {<br>  if (e.target.classList.contains(&#39;delete-transaction-btn&#39;)) {<br>    const id = e.target.parentElement.parentElement.getAttribute(&#39;data-id&#39;);<br><br>    removeTransaction(id);<br>  }<br>});<br><br>updateTransactions();</pre><p>After that I have done some modifications and created the full code as below:</p><pre>&lt;html&gt;<br>&lt;head&gt;<br>  &lt;style&gt;<br>    /* Some basic styling for the app */<br>    * {<br>      font-family: sans-serif;<br>    }<br><br>    form {<br>      display: flex;<br>      flex-direction: column;<br>      width: 50%;<br>      margin: 0 auto;<br>    }<br><br>    label {<br>      margin-bottom: 5px;<br>    }<br><br>    input[type=&quot;number&quot;] {<br>      width: 60px;<br>      margin-right: 10px;<br>    }<br><br>    .transactions {<br>      display: flex;<br>      flex-direction: column;<br>      width: 50%;<br>      margin: 20px auto;<br>    }<br><br>    .transactions h2 {<br>      text-align: center;<br>    }<br><br>    .transactions ul {<br>      list-style: none;<br>      padding: 0;<br>      margin: 0;<br>    }<br><br>    .transaction {<br>      display: flex;<br>      justify-content: space-between;<br>      align-items: center;<br>      border-bottom: 1px solid #ccc;<br>      padding: 5px 0;<br>    }<br><br>    .transaction.credit {<br>      color: green;<br>    }<br><br>    .transaction.debit {<br>      color: red;<br>    }<br><br>    .transaction-type {<br>      width: 75px;<br>      text-align: center;<br>    }<br><br>    .transaction-amount {<br>      width: 75px;<br>      text-align: right;<br>    }<br><br>    .transaction-category {<br>      width: 75px;<br>      text-align: center;<br>    }<br><br>    .transaction-delete {<br>      cursor: pointer;<br>      width: 20px;<br>      text-align: center;<br>    }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;!-- The form to add new transactions --&gt;<br>  &lt;form id=&quot;transaction-form&quot;&gt;<br>    &lt;label for=&quot;transaction-type&quot;&gt;Type:&lt;/label&gt;<br>    &lt;select id=&quot;transaction-type&quot;&gt;<br>      &lt;option value=&quot;credit&quot;&gt;Credit&lt;/option&gt;<br>      &lt;option value=&quot;debit&quot;&gt;Debit&lt;/option&gt;<br>    &lt;/select&gt;<br>    &lt;label for=&quot;transaction-amount&quot;&gt;Amount:&lt;/label&gt;<br>    &lt;input type=&quot;number&quot; id=&quot;transaction-amount&quot; min=&quot;0&quot; step=&quot;0.01&quot;&gt;<br>    &lt;label for=&quot;transaction-category&quot;&gt;Category:&lt;/label&gt;<br>    &lt;select id=&quot;transaction-category&quot;&gt;<br>      &lt;option value=&quot;necessary&quot;&gt;Necessary&lt;/option&gt;<br>      &lt;option value=&quot;essential&quot;&gt;Essential&lt;/option&gt;<br>      &lt;option value=&quot;discretionary&quot;&gt;Discretionary&lt;/option&gt;<br>    &lt;/select&gt;<br>    &lt;button type=&quot;submit&quot;&gt;Add&lt;/button&gt;<br>  &lt;/form&gt;<br><br>  &lt;!-- The container to display the current balance and the transactions --&gt;<br>  &lt;div class=&quot;transactions&quot;&gt;<br>    &lt;h2&gt;Current Balance: &lt;span id=&quot;balance&quot;&gt;0&lt;/span&gt;&lt;/h2&gt;<br>    &lt;ul id=&quot;transactions&quot;&gt;&lt;/ul&gt;<br>  &lt;/div&gt;<br> &lt;script&gt;<br>  const transactionForm = document.querySelector(&#39;#transaction-form&#39;);<br>  const transactionType = document.querySelector(&#39;#transaction-type&#39;);<br>  const transactionAmount = document.querySelector(&#39;#transaction-amount&#39;);<br>  const transactionCategory = document.querySelector(&#39;#transaction-category&#39;);<br>  const transactionsList = document.querySelector(&#39;#transactions&#39;);<br>  const balance = document.querySelector(&#39;#balance&#39;);<br><br>  // An array to store the transactions<br>  let transactions = [];<br><br>  // A helper function to calculate the balance<br>  function calculateBalance() {<br>    let total = 0;<br><br>    transactions.forEach(transaction =&gt; {<br>   if (transaction.type === &#39;credit&#39;) {<br>     total += transaction.amount;<br>   } else {<br>     total -= transaction.amount;<br>   }<br>    });<br><br>    balance.textContent = total.toFixed(2);<br>  }<br><br>  // A function to add a new transaction<br>  function addTransaction(e) {<br>    e.preventDefault();<br><br>    if (transactionAmount.value === &#39;&#39;) return;<br><br>    const transaction = {<br>   id: Date.now(),<br>   type: transactionType.value,<br>   amount: +transactionAmount.value,<br>   category: transactionCategory.value<br>    };<br><br>    transactions.push(transaction);<br><br>    transactionAmount.value = &#39;&#39;;<br><br>    updateTransactions();<br>  }<br><br>  // A function to remove a transaction<br>  function removeTransaction(id) {<br>    transactions = transactions.filter(transaction =&gt; transaction.id !== id);<br><br>    updateTransactions();<br>  }<br><br>  // A function to update the transactions list and the balance<br>  function updateTransactions() {<br>    transactionsList.innerHTML = &#39;&#39;;<br><br>    transactions.forEach(transaction =&gt; {<br>   const className = transaction.type === &#39;credit&#39; ? &#39;credit&#39; : &#39;debit&#39;;<br><br>   transactionsList.innerHTML += `<br>     &lt;li class=&quot;transaction ${className}&quot; data-id=&quot;${transaction.id}&quot;&gt;<br>    &lt;div class=&quot;transaction-type&quot;&gt;${transaction.type}&lt;/div&gt;<br>    &lt;div class=&quot;transaction-amount&quot;&gt;${transaction.amount}&lt;/div&gt;<br>    &lt;div class=&quot;transaction-category&quot;&gt;${transaction.category}&lt;/div&gt;<br>    &lt;div class=&quot;transaction-delete&quot;&gt;<br>      &lt;button class=&quot;btn btn-danger btn-sm delete-transaction-btn&quot;&gt;<br>     X<br>      &lt;/button&gt;<br>    &lt;/div&gt;<br>     &lt;/li&gt;<br>   `;<br>    });<br><br>    calculateBalance();<br><br>    localStorage.setItem(&#39;transactions&#39;, JSON.stringify(transactions));<br>  }<br><br>  // Event listeners<br>  transactionForm.addEventListener(&#39;submit&#39;, addTransaction);<br>  transactionsList.addEventListener(&#39;click&#39;, e =&gt; {<br>    if (e.target.classList.contains(&#39;delete-transaction-btn&#39;)) {<br>   const id = e.target.parentElement.parentElement.getAttribute(&#39;data-id&#39;);<br><br>   removeTransaction(id);<br>    }<br>  });<br><br>  updateTransactions();<br> &lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>And thus my Budgeting App is Ready</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/0*O6VTx96we40Y4Ih0.png" /></figure><p>And at last, I have asked Chat GPT to provide a summary of the above code</p><blockquote><em>can you write a summary of the above code</em></blockquote><p>And the response was:</p><blockquote><em>The budget app has a form to add new transactions, which includes a dropdown to select the type of transaction (credit or debit), an input field for the amount, and a dropdown to select the category (necessary, essential, or discretionary).</em></blockquote><blockquote><em>The app also has a container to display the current balance and the list of transactions. The balance is calculated by adding up the credit transactions and subtracting the debit transactions.</em></blockquote><blockquote><em>The app stores the transactions in an array and uses event listeners to handle form submissions and clicks on the delete buttons. The </em><em>updateTransactions function is used to update the list of transactions and the balance whenever a new transaction is added or an existing transaction is removed. The function also stores the updated transactions in the browser&#39;s local storage.</em></blockquote><p>So kudos to the bot who can understand my query and provided me with what I was looking for.</p><p><em>Originally published at </em><a href="https://www.gopeshsharma.dev/blog/chatgpt-budgeting-app/"><em>https://www.gopeshsharma.dev</em></a><em> on January 3, 2022.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e3606470a93" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Fundamentals of Personal Finance]]></title>
            <link>https://medium.com/@gopesh_sharma/the-fundamentals-of-personal-finance-3b0958dd819e?source=rss-6dcd3b7b79a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b0958dd819e</guid>
            <category><![CDATA[money]]></category>
            <category><![CDATA[budgeting]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[personal-finance]]></category>
            <category><![CDATA[beginner]]></category>
            <dc:creator><![CDATA[Gopesh Sharma]]></dc:creator>
            <pubDate>Thu, 22 Dec 2022 00:00:59 GMT</pubDate>
            <atom:updated>2022-12-29T04:21:23.693Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0pXkEmOtkexErxZP.png" /></figure><p>You’ve got your budget, and you’ve got your savings, this is what everyone else but what else can you do? Well, how about doing some smart financial decisions that will make sure you have enough money for everything and then some? It’s easy to get caught up in the day-to-day minutiae of life, but it’s important to keep an eye on your finances (which is very much needed now) so that when unexpected expenses come up or opportunities arise, you’re always prepared.</p><h3>Create a budget</h3><p>A <a href="https://finance.gopeshsharma.dev/basics/creating-budget/">budget</a> is a plan for spending and saving money, this is a must-have for everyone. It’s a way to manage your money so that you spend less than you earn, which helps save for retirement, pay down debt and build up an emergency fund. If you don’t have a set budget in place yet, start by creating one now! There are numerous ways you can start budgeting and in the following posts, we can talk about this more.</p><h3>Set aside money for emergencies</h3><p>You should have a savings account that you can access quickly when an emergency comes up which in simple terms is known as Emergency Fund. If you don’t, it will take longer to fix the problem and may cost more in the long run. You should try to save at least 3–6 months’ worth of living expenses in your savings account so if something happens, you are ready for it. This could include paying off any debt that has accrued during that time period as well as saving up for new purchases like furniture or appliances (if necessary). It’s also important not only to keep track of what money goes where but also when things happen: such as when there was an unexpected medical bill or other expense happened unexpectedly; this is why having an emergency fund helps prevent unnecessary stress on yourself throughout life! If you are a working individual having an emergency fund is very much necessary.</p><h3>Start saving and invest</h3><ul><li>Start saving early. The power of compound interest is a powerful thing, and it’s one of the best ways to build wealth over time. Though if you have not started yet, then start today. Better late than never.</li><li>Save more than you spend. Even if you’re not rich yet, it’s important to save enough money so that you’ll have enough funds in the bank or retirement account when times get tough (or even before). That way, if something unexpected happens-like losing your job or health insurance-you’ll still be financially stable enough to handle it properly without having to worry about going into debt because all your extra cash has been spent on bills and necessities like food and gas bills first before anything else could possibly happen at this point in time right now here right now :( sorry!</li><li>Investing doesn’t always mean stocks: Investing involves buying different types of investments depending on their risk level; some options might be considered safer than others based on which assets they hold by default when compared against other assets such as bonds which tend towards fixed income products such as certificates issued by government agencies like Treasury Bills (T-Bills), Treasury Notes (T-Notes) etcetera…</li></ul><h3>Eliminate high-interest credit card debt</h3><ul><li>Eliminate high-interest credit card debt.</li><li>Pay off your credit cards with a debt consolidation loan.</li><li>Consider a balance transfer to lower interest rates and avoid paying more than you have on loans or credit cards.</li><li>Consider taking out a personal loan from the bank if you need money, but don’t want to be responsible for repaying it until after graduation (which might be several years away). This way, you won’t have great access to cash while in school but if things go wrong financially during those years, there will be no hard feelings from the bank!</li></ul><h3>Amass wealth and sustain it by making smart financial decisions.</h3><p>As you begin to accumulate wealth and sustain it by making smart financial decisions, here are some of the most important things to remember:</p><ul><li>Save. Saving money is essential to building up your nest egg, but it’s also important that you don’t spend too much or too little! There are plenty of ways to save money on a regular basis, whether it’s through setting up automatic withdrawals from your bank account or simply putting away some cash each month.</li><li>Invest wisely. Once you have a steady stream of income coming in each month (and maybe even more than one source), investing can be done in many different ways: buying stocks or bonds; opening an IRA; placing bets on which companies will do well in the future; whatever works best for YOU! The key thing here is not just having an opinion about what stocks are worth investing in but checking out how much risk there might be with each choice before making any real decision.</li></ul><h3>Conclusion</h3><p>If you want to get started on your path to becoming a more financially aware person, then start with these five ways:</p><ul><li>Create a budget</li><li>Set aside money for emergencies</li><li>Start saving and invest</li><li>Eliminate high-interest credit card debt</li><li>Amass wealth and sustain it by making smart financial decisions.</li></ul><p>Let’s not forget the importance of having fun along the way! The more of that you have, the better.:)</p><p><em>Originally published at </em><a href="https://finance.gopeshsharma.dev/basics/fundamentals-personal-finance/"><em>https://finance.gopeshsharma.dev</em></a><em> on December 22, 2022.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b0958dd819e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Discord ChatBot using Machine Learning]]></title>
            <link>https://medium.com/@gopesh_sharma/getting-started-with-discord-chatbot-using-machine-learning-8cf73a7b834d?source=rss-6dcd3b7b79a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/8cf73a7b834d</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[natural]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Gopesh Sharma]]></dc:creator>
            <pubDate>Thu, 09 May 2019 00:00:00 GMT</pubDate>
            <atom:updated>2019-05-09T10:35:15.671Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3mPvtGe1aOE-uCIUbrrTGQ.jpeg" /><figcaption>PC: Pixabay.com</figcaption></figure><p>The post is all about getting started with the Discord Chatbot and add a little bit of Machine Learning to it. Getting Started with anything is the hardest part of being a developer because you need to choose which technology to use, what is the process to follow, are there any open-source solution for your problem, etc.</p><p>I am very impressed with the Discord UI and how easy it to develop a Bot in any language. When I started using Discord, I have seen a variety of Discord Bots be it Tatsumaki, Minnie, etc. Since I am proficient in .NET, I have created a simple Discord bot that says pong when the user types pong. At first, you need to install DSharpPlus which is a .Net wrapper for connecting to Discord API. You need to create a bot in <a href="https://discordapp.com/developers/applications">discord applications page</a> to get the Bot Token.</p><p>The below code shows how easy is to develop a simple bot in Discord.</p><pre>using System.Threading.Tasks;<br>using DSharpPlus;<br><br>namespace MyFirstBot<br>{<br>    class Program<br>    {<br>        static DiscordClient discord;<br><br>        static void Main(string[] args)<br>        {<br>           MainAsync(args)<br>              .ConfigureAwait(false)<br>              .GetAwaiter().GetResult();<br>        }<br><br>        static async Task MainAsync(string[] args)<br>        {<br>            discord = new DiscordClient(new DiscordConfiguration<br>            {<br>                Token = &quot;Bot Token&quot;,<br>                TokenType = TokenType.Bot<br>            });<br><br>            discord.MessageCreated += async e =&gt;<br>            {<br>                if (e.Message.Content.ToLower().StartsWith(&quot;ping&quot;))<br>                    await e.Message.RespondAsync(&quot;pong!&quot;);<br>            };<br><br>            await discord.ConnectAsync();<br>            await Task.Delay(-1);<br>        }<br>    }<br>}</pre><p>Next is to add Natural Language Processing (NLP) to understand the human language to get started with ChatBot. The importance of NLP in a ChatBot is that you have to know the context of the message of the user. The NLP is a field of Machine Learning which will understand, analyze, manipulate and then generate human language thus helps to get the context of the message to reply.</p><p>I searched for an NLP solution for .NET and found out <a href="https://github.com/sergey-tihon/Stanford.NLP.NET">Stanford NLP</a>, but the problem was that it was not supported in .Net Core. Then I decided to use Node.js to code my Discord Bot so that I can use <a href="https://www.npmjs.com/package/natural">natural npm package</a> for Natural Language Processing. As per the package, the definition of “natural” is</p><blockquote><em>“Natural” is a general natural language facility for nodejs. Tokenizing, stemming, classification, phonetics, tf-idf, WordNet, string similarity, and some inflections are currently supported.</em></blockquote><p>Writing Discord bot in Node.js is as simple as .Net, the code to write “pong” when user types “ping” in Node.js is shown below :</p><pre>const Discordie = require(&#39;discordie&#39;);<br>const Events = Discordie.Events;<br>const client = new Discordie();<br><br>const token = process.env.DISCORD_API_TOKEN;<br>client.connect({<br>    token: token<br>});<br><br>client.Dispatcher.on(Events.GATEWAY_READY, e =&gt; {<br>    console.log(&#39;Connected as: &#39; + client.User.username);<br>});<br><br>client.Dispatcher.on(Events.MESSAGE_CREATE, e =&gt; {<br>    if (e.message.author.bot) {<br>        return;<br>    }<br>    let content = e.message.content;<br>    if(content.startsWith(&#39;ping&#39;)) {<br>        e.message.channel.sendMessage(&quot;pong&quot;);<br>    }<br>});</pre><p>A simple concept of Machine Learning is to make our machine intelligent, thus its time to add some intelligence to our bot i.e. train out bot. Let’s say we take an example of greeting, we have to train our bot to understand every type of greeting so that it can reply back. Now not everyone greets the same way, there is a lot of different ways to greet people like hi, hello, sup, they are just a few examples. Our bot should understand all types of greeting and then greet the user back.</p><p>Thus now we have to train our bot with a set of questions and their probable answer. A sample training data looks like below, saved in data.json:</p><pre>&quot;greet&quot;: {<br>        &quot;questions&quot;: [<br>            &quot;introduce yourself&quot;,<br>            &quot;sup&quot;,<br>            &quot;hi&quot;,<br>            &quot;hello&quot;,<br>            &quot;aka&quot;,<br>            &quot;intro&quot;,<br>            &quot;hey&quot;,<br>            &quot;good morning&quot;,<br>            &quot;good evening&quot;<br>        ],<br>        &quot;answer&quot;: &quot;Hello, I am aka, ask me anything&quot;<br>    }</pre><p>Next is to train our data using the training data, for that we will use Classifier of “natural” npm package, as shown below and then save it in the classifier JSON.</p><pre>const fs = require(&#39;fs&#39;);<br>const NLP = require(&#39;natural&#39;);<br>const classifier = new NLP.LogisticRegressionClassifier(); <br><br>const myData = JSON.parse(fs.readFileSync(&quot;./data.json&quot;));<br><br>Object.keys(myData).forEach((e, key) =&gt; {<br>    myData[e].questions.forEach((phrase) =&gt; {<br>        classifier.addDocument(phrase.toLowerCase(), e);<br>    }) <br>});<br>classifier.train();<br>classifier.save(&#39;./classifier.json&#39;, (err, classifier) =&gt; {<br>    if (err) {<br>        console.error(err);<br>    }<br>    console.log(&#39;Created a Classifier file in &#39;, filePath);<br>});</pre><p>Thus I have trained my Bot, its time to use the training to talk to the user, as shown below:</p><pre>let message = &quot;hey&quot;;<br>let botAnswer = &quot;Sorry, I&#39;m not sure what you mean&quot;;<br>const guesses = classifier.getClassifications(message.toLowerCase());<br>const guess = guesses.reduce((x, y) =&gt; x &amp;&amp; x.value &gt; y.value ? x : y);<br>if(guess.value &gt; (0.6) &amp;&amp; myData[guess.label]) {<br>    botAnswer = myData[guess.label].answer;<br>}</pre><p>So the bot will reply with the answer if the guess value is greater than 0.6 otherwise it will reply “Sorry, I’m not sure what you mean”. Thus now my bot is ready to reply to the user if the user greets him.</p><p>The problem with the bot is that the reply is not natural as it will always give the same answer to all the people who asks the same question. Finding ways to improve the training data, will post once another version is ready.</p><p>Check out the first version: <a href="https://github.com/gopesh-sharma/LetsChat/releases/tag/v1.0">https://github.com/gopesh-sharma/LetsChat/releases/tag/v1.0</a></p><p>Thanks for reading.</p><p><em>Originally published at </em><a href="https://www.gopeshsharma.dev/blog/discord-chatbot-using-machine-learning/"><em>https://www.gopeshsharma.dev</em></a><em> on May 9, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8cf73a7b834d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>