<?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 Himanshu Joshi on Medium]]></title>
        <description><![CDATA[Stories by Himanshu Joshi on Medium]]></description>
        <link>https://medium.com/@joshihimanshu747?source=rss-6a17005ed6c3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zbgmal8634b-abdDt84vvw.jpeg</url>
            <title>Stories by Himanshu Joshi on Medium</title>
            <link>https://medium.com/@joshihimanshu747?source=rss-6a17005ed6c3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 07:23:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@joshihimanshu747/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[React Components]]></title>
            <link>https://medium.com/@joshihimanshu747/react-components-7673f5c2d488?source=rss-6a17005ed6c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/7673f5c2d488</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-components]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Himanshu Joshi]]></dc:creator>
            <pubDate>Thu, 13 Feb 2025 17:35:54 GMT</pubDate>
            <atom:updated>2025-02-13T17:35:54.550Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*g7q31nx4w2de5--grpmSyQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rP1BGojR0gMryBp1QjSW7Q.png" /><figcaption><strong>React Components</strong></figcaption></figure><h3><strong>What is Components?</strong></h3><p>A component is a part of the user interface. The component’s code is placed in a JavaScript file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iKN8o_7i0no4YxB7Y8Dg9A.png" /><figcaption><strong>Components File</strong></figcaption></figure><h3><strong>Components Type</strong></h3><ol><li>Stateless Functional Component</li><li>Stateful Class Component</li></ol><h3>1). Stateless Functional Component</h3><p>Stateless Functional Components are Javascript functions.</p><ul><li>They do not have their state (hence “stateless”).</li><li>They receive data as <strong>props</strong> and render UI accordingly.</li><li>They are simpler and easier to test than class components.</li><li>They are widely used with <strong>React Hooks</strong> (like useState and useEffect) to manage state and side effects.</li><li>They improve performance by avoiding unnecessary re-renders.</li><li>It returns HTML which describes the User Interface.</li></ul><pre>function Hello(props){<br>       return &lt;h1&gt;hello {props.name}&lt;/h1&gt;;<br>}</pre><h3>2). Stateful Class Component</h3><p>A class component in React extends the React.Component class. It is a regular ES6 class that inherits from the Component class in the React library.</p><ul><li><strong>It must contain a </strong><strong>render method</strong> that returns JSX (similar to HTML).</li><li>Can <strong>manage state</strong> using this.state.</li><li>Can have <strong>lifecycle methods</strong> like componentDidMount and componentDidUpdate.</li><li>Typically used when a component needs state management or lifecycle methods.</li></ul><pre>class Welcome extends React.Component{<br>    render(){<br>        return &lt;h1&gt;Hello {this.props.name} &lt;/h1&gt;;<br>    }<br>}</pre><h3><strong>Summary</strong></h3><p>Components define a part of the user interface. They are reusable and can be nested inside other components to create a modular and maintainable application structure.</p><ul><li><strong>Reusability:</strong> Components can be used multiple times in different parts of an application.</li><li><strong>Composition:</strong> Components can be combined by nesting them within other components.</li><li><strong>Separation of Concerns:</strong> Each component handles a specific piece of functionality or UI.</li><li><strong>Two Types:</strong> Functional components (stateless) and class components (stateful).</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7673f5c2d488" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is React?]]></title>
            <link>https://medium.com/@joshihimanshu747/what-is-react-5d7aaf386478?source=rss-6a17005ed6c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d7aaf386478</guid>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[frontend-developer]]></category>
            <dc:creator><![CDATA[Himanshu Joshi]]></dc:creator>
            <pubDate>Thu, 06 Feb 2025 11:12:10 GMT</pubDate>
            <atom:updated>2025-02-06T11:22:56.924Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jfn6yVvEIkjYog67rFO8HA.jpeg" /></figure><p>React is a JavaScript library that helps us build websites using components.</p><p><strong>npx</strong></p><p><strong>npx</strong> is the npm package runner that allows us to create a React app without installing React globally. You can use it with the following command:</p><pre>npx create-react-app &lt;project-name&gt;</pre><p><strong>npm</strong></p><p><strong>npm </strong>is the Node Package Manager. By using the below command. We can install React globally.</p><pre>npm create-react-app &lt;project-name&gt; -g</pre><figure><img alt="Difference between npx and npm" src="https://cdn-images-1.medium.com/max/765/1*nSspeBvgRWtZ58FGexJJUw.png" /><figcaption><strong>Difference Between npx vs npm</strong></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d7aaf386478" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solve a Linear Equation (PHP)]]></title>
            <link>https://medium.com/@joshihimanshu747/solve-a-linear-equation-92660da940b2?source=rss-6a17005ed6c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/92660da940b2</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[php-development]]></category>
            <category><![CDATA[php-string]]></category>
            <dc:creator><![CDATA[Himanshu Joshi]]></dc:creator>
            <pubDate>Thu, 06 Feb 2025 07:56:42 GMT</pubDate>
            <atom:updated>2025-02-06T07:58:31.654Z</atom:updated>
            <content:encoded><![CDATA[<p>Create a function that returns the value of x (the “unknown” in the equation). Each equation will be formatted like this:</p><pre>x + 6 = 12</pre><h3>Examples</h3><pre>solve(&quot;x + 43 = 50&quot;) ➞ 7<br>solve(&quot;x - 9 = 10&quot;) ➞ 19<br>solve(&quot;x + 300 = 100&quot;) ➞ -200</pre><h3>Notes</h3><ul><li><strong>“x</strong>” will always be in the same place (you will <em>not</em> find an equation like <strong><em>6 + x = 12</em></strong>).</li><li>Every equation will include either subtraction (<strong>-</strong>) or addition (<strong>+</strong>).</li><li><strong>“x</strong>” may be negative.</li></ul><h3>Solutions</h3><pre>function solve($equtn){<br>      $strngAdd=strpos($equtn,&quot;+&quot;);<br>      $strngSub=strpos($equtn,&quot;-&quot;);<br>      $digit=preg_replace(&quot;/[^0-9 ]/&quot;, &#39;&#39;, $equtn);<br>      $finaldigit=explode(&quot; &quot;,trim($digit));<br>      $finalAns=0;<br>      if($strngAdd!=false){<br>          $finalAns=$finaldigit[2]-$finaldigit[0];<br>      }<br>      if($strngSub!=false){<br>          $finalAns=$finaldigit[2]+$finaldigit[0];<br>      }<br>      return $finalAns;<br>}<br>echo &quot;&lt;br&gt;&quot;.solve(&quot;x - 9 = 10&quot;);<br>echo &quot;&lt;br&gt;&quot;.solve(&quot;x + 43 = 50&quot;);<br>echo &quot;&lt;br&gt;&quot;.solve(&quot;x + 300 = 100&quot;);</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92660da940b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Recursion: Reverse a String (PHP)]]></title>
            <link>https://medium.com/@joshihimanshu747/recursion-reverse-a-string-ecab1ba3d132?source=rss-6a17005ed6c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ecab1ba3d132</guid>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[string]]></category>
            <category><![CDATA[php-string]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Himanshu Joshi]]></dc:creator>
            <pubDate>Thu, 06 Feb 2025 06:50:39 GMT</pubDate>
            <atom:updated>2025-02-06T07:58:51.293Z</atom:updated>
            <content:encoded><![CDATA[<p>Write a function that reverses a string. Make your function recursive.</p><p><strong>Examples</strong><br>reverse(“hello”) ➞ “olleh”</p><p>reverse(“world”) ➞ “dlrow”</p><p>reverse(“a”) ➞ “a”</p><p>reverse(“”) ➞ “”</p><p><strong>Notes</strong><br>For non-base cases, your function must call itself at least once.<br>Check the Resources tab for info on recursion.</p><p><strong>Solutions</strong></p><pre>function reverse($string){<br>    if($string===&quot;&quot; || strlen($string)===1){<br>        return $string;<br>    }<br>    return reverse(substr($string,1)).$string[0];<br>}<br>echo reverse(&quot;hello world&quot;);</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ecab1ba3d132" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DSA Problem #1: Determine If Two Numbers Add up to a Target Value (PHP)]]></title>
            <link>https://medium.com/@joshihimanshu747/determine-if-two-numbers-add-up-to-a-target-value-7ab7b3e51a21?source=rss-6a17005ed6c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ab7b3e51a21</guid>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[dsa-courses]]></category>
            <category><![CDATA[sad]]></category>
            <category><![CDATA[programming-with-dsa]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Himanshu Joshi]]></dc:creator>
            <pubDate>Wed, 05 Feb 2025 06:28:23 GMT</pubDate>
            <atom:updated>2025-02-05T06:52:47.067Z</atom:updated>
            <content:encoded><![CDATA[<p>Given two unique integer arrays $a and $b, and an integer target value $v, create a function to determine whether there is a pair of numbers that add up to the target value $v, where one number comes from one array $a and the other comes from the second array $b. Return true if there is a pair that adds up to the target value; otherwise, return false.</p><p>Examples</p><p>sumOfTwo([1, 2], [4, 5, 6], 5) ➞ true</p><p>sumOfTwo([1, 2], [4, 5, 6], 8) ➞ true</p><p>sumOfTwo([1, 2], [4, 5, 6], 3) ➞ false</p><p>sumOfTwo([1, 2], [4, 5, 6], 9) ➞ false</p><p>Solution is below</p><pre>function sumOfTwo($arr1,$arr2,$element){<br>    $totalCount=0;<br>    $result=&#39;false&#39;;<br>    foreach($arr2 as $val){<br>        $totalCount=(int)($element-$val);<br>        if(in_array($totalCount,$arr1)){<br>            $result=&#39;true&#39;;<br>        }<br>       <br>    }<br> return $result;<br>}<br>echo sumOfTwo([1, 2], [4, 5, 6], 5);<br>echo sumOfTwo([1, 2], [4, 5, 6], 8);<br>echo sumOfTwo([1, 2], [4, 5, 6], 3);<br>echo sumOfTwo([1, 2], [4, 5, 6], 9);</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ab7b3e51a21" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>