<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Harit Himanshu</title>
    <description>The latest articles on Forem by Harit Himanshu (@harittweets).</description>
    <link>https://forem.com/harittweets</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%2F223347%2Fe44c92a7-19ef-4186-9178-c4b1483016a7.jpg</url>
      <title>Forem: Harit Himanshu</title>
      <link>https://forem.com/harittweets</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/harittweets"/>
    <language>en</language>
    <item>
      <title>Working with Scala REPL mode</title>
      <dc:creator>Harit Himanshu</dc:creator>
      <pubDate>Wed, 03 Jun 2020 16:30:25 +0000</pubDate>
      <link>https://forem.com/harittweets/working-with-scala-repl-mode-1ieb</link>
      <guid>https://forem.com/harittweets/working-with-scala-repl-mode-1ieb</guid>
      <description>&lt;p&gt;One of the key benefits of working with Scala is to experiment with ideas using Scala's Read-Eval-Print-Loop (REPL) shell and get faster feedback. This video teaches how to work with the Scala REPL mode.&lt;/p&gt;

&lt;p&gt;This video is part of a FREE course called First Steps in Scala. If you are interested in learning Scala, be sure to check out our FREE course at &lt;a href="http://bit.ly/2MM4QAW"&gt;http://bit.ly/2MM4QAW&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/ZNzBUWdmano"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>scala</category>
    </item>
    <item>
      <title>JWT.io is verifying the token based on empty secret and saying signature is verified</title>
      <dc:creator>Harit Himanshu</dc:creator>
      <pubDate>Fri, 24 Apr 2020 18:50:55 +0000</pubDate>
      <link>https://forem.com/harittweets/jwt-io-is-verifying-the-token-based-on-empty-secret-and-saying-signature-is-verified-4aci</link>
      <guid>https://forem.com/harittweets/jwt-io-is-verifying-the-token-based-on-empty-secret-and-saying-signature-is-verified-4aci</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nfpfhxRD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackoverflow-logo-7a8ef189e4f15e79cc8edc0cd3cff97b77dbaf61e8d5bee3c7507ace7d776b83.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/61415430/jwt-io-is-verifying-the-token-based-on-empty-secret-and-saying-signature-is-veri" rel="noopener noreferrer"&gt;
               JWT.io is verifying the token based on empty secret and saying signature is verified
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Apr 24 '20&lt;/span&gt;
            &lt;span&gt;Comments: 1&lt;/span&gt;
            &lt;span&gt;Answers: 0&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/61415430/jwt-io-is-verifying-the-token-based-on-empty-secret-and-saying-signature-is-veri" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---Gu-KklO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-up-d310ac55a57f00b74b1303a08e0f2e3cdea8fea5989fa5d70f506008aa86428b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          0
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nOzY64sa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-down-fd895e09c6a93e39464cad43d727a293eae44c7228c087e86d478214a271c794.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;I am totally new to this, so please bear with my question if it's utterly stupid.  I am learning how to verify signature using &lt;a href="https://jwt.io" rel="nofollow noreferrer"&gt;https://jwt.io&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The following is what I am doing&lt;/p&gt;

&lt;h2&gt;Generated Public/Private Key Pair&lt;/h2&gt;

&lt;p&gt;Private Key&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;-----BEGIN EC PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,4A6A48288A531DCA

m2glcvku6rdV8z0QBsBc3Hc72vG4NN3wIPnqdC47FTA3y9WiD7Ukh4m3ZpL2mraz
7PSblIe8ob/aaG9TYViIb4QRYZFg8z3jR6WeNEhC2EbC2CwkSSH3ug8ViQ+1i8d1
kMnQDK1i/s0BZvxlhKPuSy2kOIjelWctkDHvJyvU/WQ=
-----END&lt;/code&gt;&lt;/pre&gt;…
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/61415430/jwt-io-is-verifying-the-token-based-on-empty-secret-and-saying-signature-is-veri" rel="noopener noreferrer"&gt;Open Full Question&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>security</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to test Java Classes using JUnit5 and Reflection API</title>
      <dc:creator>Harit Himanshu</dc:creator>
      <pubDate>Sat, 18 Apr 2020 00:59:00 +0000</pubDate>
      <link>https://forem.com/harittweets/how-to-test-java-classes-using-junit5-and-reflection-api-1jkn</link>
      <guid>https://forem.com/harittweets/how-to-test-java-classes-using-junit5-and-reflection-api-1jkn</guid>
      <description>&lt;p&gt;I have created a project which is intended to demonstrate the following using &lt;code&gt;Java&lt;/code&gt;, &lt;code&gt;Maven&lt;/code&gt; and &lt;code&gt;JUnit5&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If the &lt;code&gt;Class&lt;/code&gt; exists in project.
&lt;/li&gt;
&lt;li&gt;If the class contains a &lt;code&gt;method&lt;/code&gt; with a specific name&lt;/li&gt;
&lt;li&gt;If a method is &lt;code&gt;public&lt;/code&gt;, &lt;code&gt;private&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;If a method contains parameters with specific types
&lt;/li&gt;
&lt;li&gt;If a method returns a specific type&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And there could be more additions to such a list.  &lt;/p&gt;

&lt;p&gt;This project makes use of &lt;a href="https://junit.org/junit5/docs/5.0.3/api/org/junit/platform/commons/util/ReflectionUtils.html"&gt;ReflectionUtils&lt;/a&gt; class from &lt;code&gt;Junit5&lt;/code&gt; and &lt;code&gt;Java&lt;/code&gt;'s &lt;a href="https://junit.org/junit5/docs/5.0.3/api/org/junit/platform/commons/util/ReflectionUtils.html"&gt;Reflection API&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;The codebase and tests are available at &lt;a href="https://github.com/hhimanshu/reflection-testing"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>testing</category>
    </item>
    <item>
      <title>How do I test if a private method has a field with a name and a type?</title>
      <dc:creator>Harit Himanshu</dc:creator>
      <pubDate>Sat, 18 Apr 2020 00:20:08 +0000</pubDate>
      <link>https://forem.com/harittweets/how-do-i-test-if-a-private-method-has-a-field-with-a-name-and-a-type-2jjj</link>
      <guid>https://forem.com/harittweets/how-do-i-test-if-a-private-method-has-a-field-with-a-name-and-a-type-2jjj</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nfpfhxRD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackoverflow-logo-7a8ef189e4f15e79cc8edc0cd3cff97b77dbaf61e8d5bee3c7507ace7d776b83.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/61282704/how-do-i-test-if-a-private-method-has-a-field-with-a-name-and-a-type" rel="noopener noreferrer"&gt;
               How do I test if a private method has a field with a name and a type?
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Apr 18 '20&lt;/span&gt;
            &lt;span&gt;Comments: 1&lt;/span&gt;
            &lt;span&gt;Answers: 0&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/61282704/how-do-i-test-if-a-private-method-has-a-field-with-a-name-and-a-type" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---Gu-KklO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-up-d310ac55a57f00b74b1303a08e0f2e3cdea8fea5989fa5d70f506008aa86428b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          0
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nOzY64sa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-down-fd895e09c6a93e39464cad43d727a293eae44c7228c087e86d478214a271c794.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;Here is the &lt;code&gt;private&lt;/code&gt; method I am trying to test&lt;/p&gt;
&lt;pre class="lang-java prettyprint-override"&gt;&lt;code&gt;    private int privateMethod(int[] numbers) {
        var sum = 0;
        for (int number : numbers) {
            sum += number;
        }
        return sum;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I am doing this in &lt;code&gt;Java 11&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And following is my test using &lt;code&gt;Junit5&lt;/code&gt;  &lt;/p&gt;

&lt;pre class="lang-java prettyprint-override"&gt;&lt;code&gt;import org.junit.jupiter.api.Test;
import org.junit.platform.commons.function.Try;&lt;/code&gt;&lt;/pre&gt;…
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/61282704/how-do-i-test-if-a-private-method-has-a-field-with-a-name-and-a-type" rel="noopener noreferrer"&gt;Open Full Question&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>java</category>
      <category>testing</category>
    </item>
    <item>
      <title>Cannot stack multiple push notifications</title>
      <dc:creator>Harit Himanshu</dc:creator>
      <pubDate>Fri, 10 Apr 2020 01:02:40 +0000</pubDate>
      <link>https://forem.com/harittweets/cannot-stack-multiple-push-notifications-16e9</link>
      <guid>https://forem.com/harittweets/cannot-stack-multiple-push-notifications-16e9</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pTF_nE4a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/61132542/cannot-stack-multiple-push-notifications" rel="noopener noreferrer"&gt;
               Cannot stack multiple push notifications
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Apr 10 '20&lt;/span&gt;
            &lt;span&gt;Comments: 1&lt;/span&gt;
            &lt;span&gt;Answers: 1&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/61132542/cannot-stack-multiple-push-notifications" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5MiFESHx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          0
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Rk_a5QFN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;I am working on a code to push notifications to the browser. My code to display notifications look like below&lt;/p&gt;
&lt;pre class="lang-js prettyprint-override"&gt;&lt;code&gt;const imageWithTextNotification = (reg) =&amp;gt; {
            // more options at https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification#Syntax
            const options = {
                icon: "imgs/notification.png",

                // 07 - Notification with a body
                body: "Alert!! This is image notification",&lt;/code&gt;&lt;/pre&gt;…
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/61132542/cannot-stack-multiple-push-notifications" rel="noopener noreferrer"&gt;Open Full Question&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Why useEffect warns for the fields that I do not need to put in the dependencies array?</title>
      <dc:creator>Harit Himanshu</dc:creator>
      <pubDate>Tue, 07 Apr 2020 19:27:56 +0000</pubDate>
      <link>https://forem.com/harittweets/why-useeffect-warns-for-the-fields-that-i-do-not-need-to-put-in-the-dependencies-array-389h</link>
      <guid>https://forem.com/harittweets/why-useeffect-warns-for-the-fields-that-i-do-not-need-to-put-in-the-dependencies-array-389h</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pTF_nE4a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/61087901/why-useeffect-warns-for-the-fields-that-i-do-not-need-to-put-in-the-dependencies" rel="noopener noreferrer"&gt;
               Why useEffect warns for the fields that I do not need to put in the dependencies array?
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Apr  7 '20&lt;/span&gt;
            &lt;span&gt;Comments: 4&lt;/span&gt;
            &lt;span&gt;Answers: 2&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/61087901/why-useeffect-warns-for-the-fields-that-i-do-not-need-to-put-in-the-dependencies" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5MiFESHx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          2
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Rk_a5QFN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;I have gone through the &lt;code&gt;useEffect&lt;/code&gt; documentation and I do not understand why I get warning for every variable and function that I use inside &lt;code&gt;useEffect&lt;/code&gt;, but I have no dependency on them. &lt;/p&gt;
&lt;p&gt;Consider my &lt;code&gt;useEffect&lt;/code&gt; here&lt;/p&gt;

&lt;pre class="lang-js prettyprint-override"&gt;&lt;code&gt;const [updatedComm, setUpdatedComm] = useState&amp;lt;ICommunication&amp;gt;(props.comm)
const [isEditOn, setIsEditOn] = useState&amp;lt;boolean | false&amp;gt;(false)&lt;/code&gt;&lt;/pre&gt;…
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/61087901/why-useeffect-warns-for-the-fields-that-i-do-not-need-to-put-in-the-dependencies" rel="noopener noreferrer"&gt;Open Full Question&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>react</category>
      <category>typescript</category>
    </item>
    <item>
      <title>What does event.waitUntil do in service worker and why is it needed?</title>
      <dc:creator>Harit Himanshu</dc:creator>
      <pubDate>Sun, 05 Apr 2020 17:45:16 +0000</pubDate>
      <link>https://forem.com/harittweets/what-does-event-waituntil-do-in-service-worker-and-why-is-it-needed-321o</link>
      <guid>https://forem.com/harittweets/what-does-event-waituntil-do-in-service-worker-and-why-is-it-needed-321o</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pTF_nE4a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/37902441/what-does-event-waituntil-do-in-service-worker-and-why-is-it-needed" rel="noopener noreferrer"&gt;
               What does event.waitUntil do in service worker and why is it needed?
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Jun 18 '16&lt;/span&gt;
            &lt;span&gt;Comments: 1&lt;/span&gt;
            &lt;span&gt;Answers: 1&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/37902441/what-does-event-waituntil-do-in-service-worker-and-why-is-it-needed" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5MiFESHx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          45
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Rk_a5QFN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;MDN suggests that you do the following to create and populate service worker cache:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;this.addEventListener('install', function(event) {
  event.waitUntil(
    caches.open('v1').then(function(cache) {
      return cache.addAll([
        '/sw-test/',
        '/sw-test/index.html',
        ... etc ...
      ]);
    })
  );
});
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I do not understand that code. The &lt;code&gt;waitUntil&lt;/code&gt; method is documented too, and it seems the code above is…&lt;/p&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/37902441/what-does-event-waituntil-do-in-service-worker-and-why-is-it-needed" rel="noopener noreferrer"&gt;Open Full Question&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>javascript</category>
      <category>help</category>
    </item>
    <item>
      <title>JavaScript String toLowerCase and toUpperCase</title>
      <dc:creator>Harit Himanshu</dc:creator>
      <pubDate>Thu, 19 Mar 2020 16:30:21 +0000</pubDate>
      <link>https://forem.com/harittweets/javascript-string-tolowercase-and-touppercase-21el</link>
      <guid>https://forem.com/harittweets/javascript-string-tolowercase-and-touppercase-21el</guid>
      <description>&lt;p&gt;In this short video, you will learn how to change the JavaScript String to lower and upper cases using methods available on String constructors. We will use &lt;code&gt;.toLowerCase()&lt;/code&gt; and &lt;code&gt;.toUpperCase()&lt;/code&gt; methods.&lt;/p&gt;

&lt;p&gt;The code sample is available at &lt;a href="https://bonsaiilabs.com/javascript-string-lowercase-uppercase/"&gt;https://bonsaiilabs.com/javascript-string-lowercase-uppercase/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/s_9wf2L3Fn0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Subscribe for more videos on JavaScript with Visualization: &lt;a href="https://www.youtube.com/channel/UC0yZBnRsD9JRqLXBkfGym0Q?sub_confirmation=1"&gt;https://www.youtube.com/channel/UC0yZBnRsD9JRqLXBkfGym0Q?sub_confirmation=1&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>node</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Matching Numbers in JavaScript Strings using Regular Expressions</title>
      <dc:creator>Harit Himanshu</dc:creator>
      <pubDate>Tue, 17 Mar 2020 16:00:42 +0000</pubDate>
      <link>https://forem.com/harittweets/matching-numbers-in-javascript-strings-using-regular-expressions-28j5</link>
      <guid>https://forem.com/harittweets/matching-numbers-in-javascript-strings-using-regular-expressions-28j5</guid>
      <description>&lt;p&gt;Learn how to match number patterns such as phone numbers and credit cards in the unstructured text using JavaScript Strings&lt;/p&gt;

&lt;p&gt;This video is a follow-up video for - Search a String by matching against a regex in JavaScript available at &lt;a href="https://bonsaiilabs.com/javascript-regex-match-strings/"&gt;https://bonsaiilabs.com/javascript-regex-match-strings/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this video, we will extract phone numbers and credit card data using regular expression and String.match available in JavaScript&lt;br&gt;
The code sample is available at &lt;a href="https://bonsaiilabs.com/javascript-regex-match-numbers/"&gt;https://bonsaiilabs.com/javascript-regex-match-numbers/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/528hucayQi4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Subscribe for more videos on JavaScript with Visualization: &lt;a href="https://www.youtube.com/channel/UC0yZBnRsD9JRqLXBkfGym0Q?sub_confirmation=1"&gt;https://www.youtube.com/channel/UC0yZBnRsD9JRqLXBkfGym0Q?sub_confirmation=1&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>react</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Search a String by matching against a regex in JavaScript</title>
      <dc:creator>Harit Himanshu</dc:creator>
      <pubDate>Thu, 06 Feb 2020 18:00:12 +0000</pubDate>
      <link>https://forem.com/harittweets/search-a-string-by-matching-against-a-regex-in-javascript-3fi7</link>
      <guid>https://forem.com/harittweets/search-a-string-by-matching-against-a-regex-in-javascript-3fi7</guid>
      <description>&lt;p&gt;Learn to match a String pattern inside another String using Regular Expression in JavaScript.&lt;/p&gt;

&lt;p&gt;This video teaches a use case on where this scenario might be useful and how regular expressions can help solve the problem&lt;br&gt;
We will use the &lt;code&gt;String.match&lt;/code&gt; API in combination with regular expression in this video.&lt;/p&gt;

&lt;p&gt;We will also look at the API documentation available on Mozilla Developer Network (MDN)&lt;/p&gt;

&lt;p&gt;The code sample is available at &lt;a href="https://bonsaiilabs.com/javascript-regex-match-strings/"&gt;https://bonsaiilabs.com/javascript-regex-match-strings/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/bAb32scBwaA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>node</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>How can I test whether a for loop is available in the Class?</title>
      <dc:creator>Harit Himanshu</dc:creator>
      <pubDate>Sun, 26 Jan 2020 00:53:23 +0000</pubDate>
      <link>https://forem.com/harittweets/how-can-i-test-whether-a-for-loop-is-available-in-the-class-2ool</link>
      <guid>https://forem.com/harittweets/how-can-i-test-whether-a-for-loop-is-available-in-the-class-2ool</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pTF_nE4a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/59914713/how-can-i-test-whether-a-for-loop-is-available-in-the-class" rel="noopener noreferrer"&gt;
               How can I test whether a for loop is available in the Class?
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Jan 26 '20&lt;/span&gt;
            &lt;span&gt;Comments: 5&lt;/span&gt;
            &lt;span&gt;Answers: 1&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/59914713/how-can-i-test-whether-a-for-loop-is-available-in-the-class" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5MiFESHx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          0
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Rk_a5QFN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;Let me explain the use case first.  &lt;/p&gt;
&lt;p&gt;The use case is that a learner learning &lt;code&gt;java&lt;/code&gt; is following a set of written instructions and using automated tests (read &lt;code&gt;JUnit&lt;/code&gt;), I want to test whether they have successfully implemented the instruction.&lt;/p&gt;

&lt;p&gt;Things that I need to find out programmatically, for…&lt;/p&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/59914713/how-can-i-test-whether-a-for-loop-is-available-in-the-class" rel="noopener noreferrer"&gt;Open Full Question&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>java</category>
    </item>
    <item>
      <title>Where can I find the complete list of items added to MicroTask Queue?</title>
      <dc:creator>Harit Himanshu</dc:creator>
      <pubDate>Tue, 21 Jan 2020 17:04:17 +0000</pubDate>
      <link>https://forem.com/harittweets/where-can-i-find-the-complete-list-of-items-added-to-microtask-queue-1j8n</link>
      <guid>https://forem.com/harittweets/where-can-i-find-the-complete-list-of-items-added-to-microtask-queue-1j8n</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pTF_nE4a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/59845957/where-can-i-find-the-complete-list-of-items-added-to-microtask-queue" rel="noopener noreferrer"&gt;
               Where can I find the complete list of items added to MicroTask Queue?
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Jan 21 '20&lt;/span&gt;
            &lt;span&gt;Comments: 1&lt;/span&gt;
            &lt;span&gt;Answers: 1&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/59845957/where-can-i-find-the-complete-list-of-items-added-to-microtask-queue" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5MiFESHx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          2
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Rk_a5QFN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;I am following up after reading the post &lt;a href="https://stackoverflow.com/questions/25915634/difference-between-microtask-and-macrotask-within-an-event-loop-context"&gt;Difference between microtask and macrotask within an event loop context&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The examples posted are&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;macrotasks: setTimeout, setInterval, setImmediate, requestAnimationFrame, I/O, UI rendering
microtasks: process.nextTick, Promises, Object.observe, MutationObserver
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I am wondering where can I find the list of tasks added to the &lt;strong&gt;microtask&lt;/strong&gt;…&lt;/p&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/59845957/where-can-i-find-the-complete-list-of-items-added-to-microtask-queue" rel="noopener noreferrer"&gt;Open Full Question&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


</description>
    </item>
  </channel>
</rss>
