<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Nodejs on David Hamp-Gonsalves</title><link>https://davidhampgonsalves.com/tags/nodejs/</link><description>Recent content in Nodejs on David Hamp-Gonsalves</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Tue, 20 Nov 2012 00:00:00 +0000</lastBuildDate><atom:link href="https://davidhampgonsalves.com/tags/nodejs/index.xml" rel="self" type="application/rss+xml"/><item><title>Javascript Damerau Levenshtein Algorithim</title><link>https://davidhampgonsalves.com/javascript-damerau-levenshtein-algorithim/</link><pubDate>Tue, 20 Nov 2012 00:00:00 +0000</pubDate><guid>https://davidhampgonsalves.com/javascript-damerau-levenshtein-algorithim/</guid><description>&lt;p&gt;The &lt;a href="http://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance"&gt;Damerau Levenshtein&lt;/a&gt; algorithim calculates a distance between two words in the same way that basic Levenshtein does but adds transpositions to the set of operations that it uses to calculate distance. This makes it much more reliable at finding similiar or alternate spellings of words.&lt;/p&gt;
&lt;p&gt;I was doing some nodejs work lately and needed such a function to clean up one of my datasets and so I ported this version from C# to Javascript.&lt;/p&gt;</description></item><item><title>Install Node.js / NPM on Fedora Core 17</title><link>https://davidhampgonsalves.com/install-node.js-/-npm-on-fedora-core-17/</link><pubDate>Thu, 18 Oct 2012 00:00:00 +0000</pubDate><guid>https://davidhampgonsalves.com/install-node.js-/-npm-on-fedora-core-17/</guid><description>&lt;p&gt;This is just a short and sweet set of commands to install Nodejs and NPM on Fedora 17.&lt;/p&gt;
&lt;h2 id="versions"&gt;Versions&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Fedora Core 17&lt;/li&gt;
&lt;li&gt;node.js 0.8.9&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="the-gutsgo-bash-go"&gt;The Guts(go bash go!)&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo yum install openssl-devel.i686 gcc gcc-c++
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo ./configure
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo make -j2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo make install
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;su
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cd /tmp
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;git clone https&lt;span style="color:#ae81ff"&gt;\:&lt;/span&gt;//github.com/isaacs/npm.git
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cd npm
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;make install
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;exit
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Most of this was based on an older post I found &lt;a href="http://johnroach.info/2011/11/20/installing-node-js-0-6-2-on-fedora-16/"&gt;here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;</description></item><item><title>Iterative Javascript QuickSelect</title><link>https://davidhampgonsalves.com/iterative-javascript-quickselect/</link><pubDate>Fri, 08 Jun 2012 00:00:00 +0000</pubDate><guid>https://davidhampgonsalves.com/iterative-javascript-quickselect/</guid><description>&lt;p&gt;A couple weeks ago I entered my first AI related contest, hosted by &lt;a href="http://www.scribd.com/jobs/botrace"&gt;scribd&lt;/a&gt;. The contest was great for beginners since it involved a very simple world and control scheme.&lt;/p&gt;
&lt;p&gt;At some point in by bot creation process I needed to determine the n-th highest number in an Array. While for such a simple project I probably should have just thrown some loops together and moved on, but since the project was just I started researching the problem and Hoare&amp;rsquo;s Selection Algorithm. I wasn&amp;rsquo;t able to find a Javascript implementation so I ported a Java version() which in turn had been ported over from the book &lt;em&gt;&amp;ldquo;Numerical Recipes in C: The Art of Scientific Computing&amp;rdquo;&lt;/em&gt;. The best part about this implementation is that unlike most, it isn&amp;rsquo;t recursive. This makes it more verbose but much more interesting and it avoids any stack depth restrictions that browser vendors may impose.&lt;/p&gt;</description></item></channel></rss>