<?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 souparno majumder on Medium]]></title>
        <description><![CDATA[Stories by souparno majumder on Medium]]></description>
        <link>https://medium.com/@_souparno?source=rss-32692bb8fb06------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*v8iiRPNXTyno2tUBxgMNUQ.jpeg</url>
            <title>Stories by souparno majumder on Medium</title>
            <link>https://medium.com/@_souparno?source=rss-32692bb8fb06------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 22:13:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@_souparno/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[LOG INTO YOUR VIRTUAL MACHINE WITH SSH]]></title>
            <link>https://medium.com/@_souparno/log-into-your-virtual-machine-with-ssh-a11fdae71410?source=rss-32692bb8fb06------2</link>
            <guid isPermaLink="false">https://medium.com/p/a11fdae71410</guid>
            <category><![CDATA[virtual-machine]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[souparno majumder]]></dc:creator>
            <pubDate>Sat, 09 Nov 2019 06:46:24 GMT</pubDate>
            <atom:updated>2019-11-09T06:46:24.407Z</atom:updated>
            <content:encoded><![CDATA[<p>In order to ssh to a Ubuntu VM running in VirtualBox from your host machine, you need to set up two network adapters for the VM.</p><p>First of all, stop the VM if not yet.</p><p>Then select the VM and click the Settings menu in the VirtualBox toolbar:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/281/1*qD2-t896nf6RIHRcJB8zfg.png" /></figure><h3>Set up Adapter 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*_PJQhdsw7EmZnV1rvrNRlg.png" /></figure><h3>Set up Adapter 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*c0KKkkRR3-ZIXD-QlOaHJw.png" /></figure><p>(Note: you don’t need to set up any port forwarding.)</p><p>That’s it. Once set up, you can start and log into your VM.</p><p>In order to get the ip of the virtual machine, Open the ubuntu terminal in the VM and run the following command:</p><p>$ ip a</p><p>( the network configuration will look like below and you’ll have Internet access too)</p><p>The below image shows the ip address of the VirtualMachine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*uDcH80dS2ep4axyUFuI8lA.png" /></figure><p>you can create an alias for that address in the /etc/hosts file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*RGpHE2UOXuQzg5h3Hx-pGQ.png" /></figure><p>Be sure that the SSH server has been installed and up running in the VM.</p><pre>$ ps aux | grep sshd<br>root 864 0.1 0.5 65512 5392 ? Ss 22:10 0:00 /usr/sbin/sshd -D</pre><p>If not, install it:</p><pre>$ sudo apt-get install openssh-server</pre><p>Now, from the host machine folder $ .ssh/copy the id_rsa.pub key and paste it to the $ .ssh/authorized_keys file in the ubuntu VM.</p><p>(NOTE: if the file authorized_keys is not present in the VM under the folder .ssh then create it)</p><p>Thats it we are done, restart the VM and now from the terminal of the host machine you can log into the VM like so</p><pre>$ ssh &lt;username&gt;@&lt;Vitrual machine name given in the hosts file&gt;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a11fdae71410" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding The Holy Trinity of Neural Network]]></title>
            <link>https://medium.com/@_souparno/understanding-the-holy-trinity-of-neural-network-194ce475bedd?source=rss-32692bb8fb06------2</link>
            <guid isPermaLink="false">https://medium.com/p/194ce475bedd</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[gradient-descent]]></category>
            <category><![CDATA[perceptron]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[backpropagation]]></category>
            <dc:creator><![CDATA[souparno majumder]]></dc:creator>
            <pubDate>Sat, 09 Mar 2019 14:51:23 GMT</pubDate>
            <atom:updated>2019-04-23T13:38:58.203Z</atom:updated>
            <content:encoded><![CDATA[<h3>Understanding The mathematics behind neural network — part 1</h3><h3>(mathematical proof and derivations)</h3><ol><li><strong><em>stochastic gradient descent</em></strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*DHBK463gL2o2FKWiUorOlA.png" /></figure><p><strong><em>2. delta rule</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*JOTSCEaOhvfNu-lbR7EetA.png" /></figure><p>below is a list of activation functions and it’s derivatives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*STYa9D2DYbBwfFSxTuFAwQ.png" /></figure><p><strong><em>3. back propagation</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*qOKfnQ43SiysY40Ms1aGPA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=194ce475bedd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a module loader on top of nodejs]]></title>
            <link>https://medium.com/@_souparno/building-a-module-loader-on-top-of-nodejs-7f9a49f238de?source=rss-32692bb8fb06------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f9a49f238de</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[compilers]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[transpilers]]></category>
            <dc:creator><![CDATA[souparno majumder]]></dc:creator>
            <pubDate>Sat, 09 Feb 2019 18:51:33 GMT</pubDate>
            <atom:updated>2019-02-09T19:34:09.256Z</atom:updated>
            <content:encoded><![CDATA[<p>so, why build a module loader, on top of nodejs when ‘require’ is all ready doing that !! is it not reinventing the wheel !</p><p>my reason to build a module loader, were the following :-</p><ol><li>I needed to bundle nodejs module scripts into a single stand alone script file for easier distribution/deployment of scripts along with their dependencies.</li><li>I needed to override the existing dependency module, (without making any change to the dependency modules) by overriding the module search path in order to make it easier to write module shims.</li></ol><p>but wait, is browserify not covering the point 1 ?</p><ol><li>No, and a big no. browserify does not emulate node module path system, as a result server side scripts cannot be bundled with browserify. For example browserify will fail to run ‘__dirname’ or ‘__filename’. also in my experience browserify failed to load relative path mentions without the filename.</li></ol><p>2. Browserify lacks a proper error messaging system, if it fails to load the module, that is ‘required’ by a particular file, it mentions the directory name from where the call originated to load the module but never shows the filename that initialed the call to load the module, as a result debugging makes it difficult.</p><p>3. i needed something blazing fast.</p><p>ok, so now that it’s established that the wheel is not being re-invented, let’s break down what happens inside node ‘require’</p><pre>1. resolves path requested<br>2. find the possibilities of paths to search for the resolved path<br>3. finds the file and fetches the file source<br>4. wraps the source<br>5. build a module object from the file source containing the meta-data about the file<br>6. caches the module<br>7. executes the module and returns the value</pre><p>The first question is where does nodejs look for file when a require such as (‘./foo’) is initiated?</p><p>assuming that we have the following folder and files</p><pre>abc (directory)<br> -- def (directory)<br> -- -- ghi (directory)<br> -- -- - bar.js (file)<br> -- -- - foo.js (file)</pre><p>and bar.js has the following script</p><pre>require(&#39;./foo&#39;)</pre><h3>a) lets strat off with resolving ./foo from directory abc/def/ghi/</h3><ol><li>concat abc/def/ghi/ with ./foo =&gt; abc/def/ghi/./foo</li><li>replace any ‘//’ ‘/./’ with ‘/’ so, abc/def/ghi/./foo =&gt; abc/def/ghi/foo</li><li>replace any ‘string/../’ with ‘/’</li></ol><p>here’s a simple script to resolve path</p><pre>function resolvePath(path) {<br>   var tempPath = path.replace(/\/+/g, &#39;/&#39;).replace(/\/\.\//g, &#39;/&#39;);<br>   var regex = /(^|\/)(?!\.?\.\/)([^\/]+)\/\.\.\/*/g;</pre><pre>  do {<br>     path = tempPath;<br>     tempPath = tempPath.replace(regex, &#39;$1&#39;)<br>  } while (path != tempPath);</pre><pre>   return path.replace(/\.\//g, &#39;&#39;).replace(/\/$/g, &#39;&#39;);<br>}</pre><pre>resolvePath(&#39;abc/def/ghi/./foo&#39;)  // =&gt; abc/def/ghi/foo<br>resolvePath(&#39;abc/def/ghi/../foo&#39;) // =&gt; abc/def/foo</pre><h3>b) now, that we have resolved the path, lets search for the module foo</h3><ol><li>for require(‘./foo’) from directory ‘abc/def/ghi/’ the resolved path will give us ‘abc/def/ghi/foo’ and since the resolved path is without a file extension, we will will search these two possible paths</li></ol><p>i) abc/def/ghi/foo.js</p><p>ii) abc/def/ghi/foo/index.js</p><p>in short if the require method is called with a module name without mentioning the extension, nodejs will either assume that it is a file by that name such as ‘foo.js’ or the file is ‘index.js’ inside a directory foo, such a foo/index.js</p><p>but, what if bar.js has the following script</p><pre>require(&#39;./foo.js&#39;) // the require is called with file extension</pre><p>resolving the path will give us abc/def/ghi/foo.js and since the path allready has an extension, the module loader will directly get the source from the path abc/def/ghi/foo.js</p><p>ok, so we are sorted with understanding the path lookups for relative mention (such as something starting with ./) , but what about the non-relative mentions ? what if bar.js initiated the call as</p><pre>require(&#39;foo&#39;) // &lt; see, no relative mention not ./foo but foo</pre><p>in this case, nodejs will search inside the node_modules folder</p><p>for</p><ol><li>node_modules/foo.js</li><li>node_modules/foo/index.js</li></ol><p>wow! that was simple.</p><p>putting it all together we have</p><pre>function getExtension(modulePath) {<br>    var moduleSegments = modulePath.split(&#39;.&#39;);<br>    var ext = moduleSegments[moduleSegments.length - 1];</pre><pre>    if (ext == &quot;js&quot; || ext == &quot;json&quot;) {<br>        return ext;<br>    }</pre><pre>    return false;<br>}</pre><pre>function getPossiblePaths (modulePath) {<br>     if (getExtension(modulePath)) {<br>           return [modulePath];<br>     }</pre><pre>     return [<br>        util.concat(util.resolveRelativePath(modulePath), &#39;.js&#39;),<br>        util.buildPath(modulePath, &#39;index.js&#39;),<br>     ];<br>}</pre><pre>function resolvePath(path) {<br>   var tempPath = path.replace(/\/+/g, &#39;/&#39;).replace(/\/\.\//g, &#39;/&#39;);<br>   var regex = /(^|\/)(?!\.?\.\/)([^\/]+)\/\.\.\/*/g;</pre><pre>do {<br>     path = tempPath;<br>     tempPath = tempPath.replace(regex, &#39;$1&#39;)<br>  } while (path != tempPath);</pre><pre>  return path.replace(/\.\//g, &#39;&#39;).replace(/\/$/g, &#39;&#39;);<br>}</pre><pre>getPossiblePaths(resolvePath(&#39;abc/def/ghi/./foo&#39;))  <br>// =&gt; [abc/def/ghi/foo.js, abc/def/ghi/foo/index.js]</pre><pre>getPossiblePaths(resolvePath(&#39;abc/def/ghi/./foo.js&#39;))<br>// =&gt; [abc/def/ghi/foo.js]</pre><pre>getPossiblePaths(resolvePath(&#39;node_modules/foo&#39;))<br>// =&gt; [node_modules/foo.js, node_modules/foo/index.js]</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f9a49f238de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writing a javascript transpiler]]></title>
            <link>https://medium.com/@_souparno/writing-a-javascript-transpiler-602d5f617982?source=rss-32692bb8fb06------2</link>
            <guid isPermaLink="false">https://medium.com/p/602d5f617982</guid>
            <dc:creator><![CDATA[souparno majumder]]></dc:creator>
            <pubDate>Tue, 18 Dec 2018 12:13:20 GMT</pubDate>
            <atom:updated>2018-12-18T12:13:20.836Z</atom:updated>
            <content:encoded><![CDATA[<p>so, I thought about having my own “import” like statement in my javascript,</p><p>not much of a fan of the babel import, i thought of improvising, a java like import syntax for my script like:</p><p>“import something as some”</p><p>so, heres my take to the task, behold the mother of all iceberg : <a href="https://github.com/souparno/jsio.js">jsio.js</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ou7U8kP8Wk-zgeXWfWfVlA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=602d5f617982" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Simple JavaScript Inheritance Framework]]></title>
            <link>https://medium.com/@_souparno/-bcfe111260d5?source=rss-32692bb8fb06------2</link>
            <guid isPermaLink="false">https://medium.com/p/bcfe111260d5</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[souparno majumder]]></dc:creator>
            <pubDate>Sun, 16 Dec 2018 10:09:59 GMT</pubDate>
            <atom:updated>2018-12-16T10:30:46.276Z</atom:updated>
            <content:encoded><![CDATA[<p>I wanted to create JavaScript classical-inheritance-simulating technique, like <a href="http://prototypejs.org/">Prototype</a> did, and wanted to go about extracting this into a simple, re-usable, form that could be easily be understood and didn’t have any dependencies.</p><p>I found this blog <a href="https://johnresig.com/blog/simple-javascript-inheritance/">simple-javascript-inheritance</a> by John Resig, which will let you write inheritance into the code in the following manner :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*UXTt8Ytj0aBviz6CnTbP4Q.png" /></figure><p>However I found that the code, that he used to express the idea, could be made more simpler. I wanted something, which could even get a dummy to exclaim “aha, I see how thats happening”.</p><p>so, here is my final code (<a href="https://github.com/souparno/Class.js">link to github</a> ): -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*8M9Ky_GDyvyQ5kOWZbltgQ.png" /></figure><p>here’s how you can use it:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*nOaIju-crtPMTHIl6AGUGQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bcfe111260d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>