<?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: Sishaar Rao</title>
    <description>The latest articles on Forem by Sishaar Rao (@sishaarrao).</description>
    <link>https://forem.com/sishaarrao</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%2F7627%2F88eea8b8-75da-48ac-a491-2f04bda1c8b2.png</url>
      <title>Forem: Sishaar Rao</title>
      <link>https://forem.com/sishaarrao</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/sishaarrao"/>
    <language>en</language>
    <item>
      <title>[AskDev] How do You get Started?</title>
      <dc:creator>Sishaar Rao</dc:creator>
      <pubDate>Fri, 25 May 2018 20:08:46 +0000</pubDate>
      <link>https://forem.com/sishaarrao/askdev-how-do-you-get-started-2ge1</link>
      <guid>https://forem.com/sishaarrao/askdev-how-do-you-get-started-2ge1</guid>
      <description>&lt;p&gt;As of today, I'm completing my first week of a summer internship, and I've spent ~90% of my time just getting "set up". This means installing personal and company dev tools, understanding relevant codebases, and most importantly, troubleshooting when setup isn't working.&lt;/p&gt;

&lt;p&gt;It's been pretty difficult, and I'm sure there's ways to improve my experience.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2Ft4Fbq7j.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2Ft4Fbq7j.gif" title="Time to Break out Emacs and modify that perl script!" alt="alt text" width="248" height="159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What are some things you suggest someone do when joining a new company, a new team, or even a new project?&lt;/strong&gt;
&lt;/h3&gt;

</description>
      <category>discuss</category>
      <category>career</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Sleep Sort: Where Theory meets Sobering Reality</title>
      <dc:creator>Sishaar Rao</dc:creator>
      <pubDate>Sat, 28 Oct 2017 18:38:02 +0000</pubDate>
      <link>https://forem.com/sishaarrao/sleep-sort-where-theory-meets-sobering-reality-b3m</link>
      <guid>https://forem.com/sishaarrao/sleep-sort-where-theory-meets-sobering-reality-b3m</guid>
      <description>&lt;p&gt;Circa 6 years ago, an anonymous user posted on 4Chan:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frdyvh2w7dtk3ycyikghs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frdyvh2w7dtk3ycyikghs.png" alt="A screenshot of the original post on 4Chan"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;He outlined this amazing undiscovered sort written in Shell which, sure enough, worked. &lt;a href="https://github.com/SishaarRao/Sleep-Sort" rel="noopener noreferrer"&gt;Check out my repo to download the code and try it yourself!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn5emhhjrxt13jv8w4kz0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn5emhhjrxt13jv8w4kz0.png" alt="A screenshot of me running the code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'll admit, I was bewildered at first. I could envision how this algorithm could be refined and implemented, whether it be cutting the time needed to output the value or scaling datasets accordingly. But then I thought to myself &lt;em&gt;if this sort (which off the top of my heads looks like an O(n) runtime) really works, then why hasn't some genius at IBM/Sun/Oracle implemented this already?&lt;/em&gt; I couldn't be the first one wondering how to implement this. Why did people before me not go ahead with it? Why don't we use this in real life?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Because at the end of the day, computers are still machines. At the end of the day, Theory is Theory, and Reality will always still be Reality&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How/Why does Sleep-Sort Work?
&lt;/h2&gt;

&lt;p&gt;The code for Sleep-Sort is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;

&lt;span class="nb"&gt;sort&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;sleep&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;do
    &lt;/span&gt;&lt;span class="nb"&gt;sort&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &amp;amp;
    &lt;span class="nb"&gt;shift
&lt;/span&gt;&lt;span class="k"&gt;done
&lt;/span&gt;&lt;span class="nb"&gt;wait&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's dissect this part by part. (In case you were wondering, &lt;code&gt;#!/usr/bin/env bash&lt;/code&gt; is called the &lt;a href="https://en.wikipedia.org/wiki/Shebang_(Unix)" rel="noopener noreferrer"&gt;Shebang.&lt;/a&gt;)&lt;/p&gt;

&lt;h4&gt;
  
  
  The function
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sort&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;sleep&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This function is going to be called repeatedly by the code. It takes its first argument (denoted by &lt;code&gt;"$1"&lt;/code&gt;) and sleeps for that amount of time. &lt;a href="https://en.wikipedia.org/wiki/Sleep_(Unix)" rel="noopener noreferrer"&gt;Sleep&lt;/a&gt; is a command that pauses its current process (or more importantly its thread) for the given amount of seconds. For example, &lt;code&gt;sleep 100&lt;/code&gt; would mean that the process "sleeps" or pauses for 100 seconds. &lt;br&gt;
It then calls &lt;a href="https://en.wikipedia.org/wiki/Echo_(command)" rel="noopener noreferrer"&gt;echo&lt;/a&gt; on the first argument, which prints out the argument. Thus, the code &lt;code&gt;sort 3&lt;/code&gt; would first sleep for &lt;code&gt;3&lt;/code&gt; seconds and then print out &lt;code&gt;3&lt;/code&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  The while-loop
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;do
    &lt;/span&gt;&lt;span class="nb"&gt;sort&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &amp;amp;
    &lt;span class="nb"&gt;shift
&lt;/span&gt;&lt;span class="k"&gt;done
&lt;/span&gt;&lt;span class="nb"&gt;wait&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The while-loop's condition is &lt;code&gt;[ -n "$1" ]&lt;/code&gt; As you can observe, we use the &lt;code&gt;-n&lt;/code&gt; flag with the first argument. This flag returns true if the argument is nonzero. Thus, this loop will iterate until the argument at &lt;code&gt;$1&lt;/code&gt; is null. &lt;/p&gt;

&lt;p&gt;We then call sort on the first argument &lt;code&gt;sort "$1"&lt;/code&gt; The most important part of this, however, &lt;strong&gt;is the ampersand (&amp;amp;) at the end&lt;/strong&gt; What this ampersand at the end does is begin the process described in the line, namely the sort function call, &lt;em&gt;in a different thread.&lt;/em&gt; &lt;a href="https://unix.stackexchange.com/questions/86247/what-does-ampersand-mean-at-the-end-of-a-shell-script-line" rel="noopener noreferrer"&gt;Check this out for more info.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the next line, we call the built-in function shift. Since there are no parameters for the function, the default value to shift is 1. What shift does is it shifts the arguments we have over. The argument in &lt;code&gt;$2&lt;/code&gt; goes to &lt;code&gt;$1&lt;/code&gt;, the argument in &lt;code&gt;$3&lt;/code&gt; goes to &lt;code&gt;$2&lt;/code&gt; and so on. The original first argument is subsequently lost. &lt;/p&gt;

&lt;h4&gt;
  
  
  Running the code
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F21f7c17j9kjfo9g371uh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F21f7c17j9kjfo9g371uh.png" alt="A sample run of the Sleep Sort"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you now from the code above, we take the first argument and instantiate a separate thread that's sleeping for that argument length. Once it awakens, it prints out it's value. The 1 sleeps for 1 second, the 2 sleeps for 2 seconds, the 5 sleeps for 5, etc. Since the lower values sleep less, they print out their values earlier, and thus the list is now sorted. Isn't it amazing?&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Sleep-Sort Fails
&lt;/h2&gt;

&lt;p&gt;Intuition told me that there's some fundamental flaw in this sort, and that for large datasets it breaks down. The success of sleep-sort relies on 3 fundamental assumptions, which often don't hold true as we go beyond a set of 5 or 10 numbers.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. The Processor can instantly determine which sub-process is the "least"
&lt;/h4&gt;

&lt;p&gt;To generalize, the processor inherently possesses some data structure in which it stores sub-processes. It could be a &lt;a href="https://en.wikipedia.org/wiki/Tree_(data_structure)" rel="noopener noreferrer"&gt;Tree&lt;/a&gt;, a &lt;a href="https://en.wikipedia.org/wiki/Heap_(data_structure)" rel="noopener noreferrer"&gt;Heap&lt;/a&gt;, or some other data structure that allows the Processor to efficiently traverse its elements and find which one has the "least" value. By finding the least value, we mean finding &lt;strong&gt;which process should be executed next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;On the scale of milliseconds, sleep-sort can break down here. If we're given values 3 and 3.00001, the processor may determine the wrong process as the "least" value, simply because it takes the processor time, no matter how small, to find the correct process. &lt;/p&gt;

&lt;h4&gt;
  
  
  2. How Many Threads does the Computer Have?
&lt;/h4&gt;

&lt;p&gt;Sleep-Sort depends on being able to separate each value into a different &lt;a href="https://en.wikipedia.org/wiki/Thread_(computing)" rel="noopener noreferrer"&gt;thread&lt;/a&gt;, and therefore it assumes that &lt;strong&gt;for n elements, you subsequently have n available threads&lt;/strong&gt;. When you go into element sets of higher orders of magnitude, this assumption simply won't hold. Your computer has a finite amount of threads, and if you exceed that, then Sleep-Sort will fail.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. The Processor can rapidly switch between processes
&lt;/h4&gt;

&lt;p&gt;Think of your processor as a miniscule ticker. When it executes multiple tasks in parallel, in reality our metaphorical ticker is rapidly switching back and forth between our tasks. It executes Task A for a millisecond, then Task B for a millisecond, and then back to Task A. It does this switching on such a small scale that, to the human eye, it seems that the two are running in parallel.&lt;/p&gt;

&lt;p&gt;When you have a high number of tasks, this ticker begins to break down. As pointed in Issue #1, it struggles to determine which task to approach next, and it also may get bogged down by the task it is currently at. If it loses its efficiency to switch back and forth between tasks, Sleep-sort begins to break down as the tasks won't be perfectly executed in order.&lt;/p&gt;

&lt;h2&gt;
  
  
  What does Sleep-Sort Teach Us
&lt;/h2&gt;

&lt;p&gt;Scalability is an issue every software engineer has to keep in the back of their mind when they build a system. &lt;a href="https://groups.google.com/forum/#!msg/mi.jobs/poXLCW8udK4/_GHzqB9sG9gJ" rel="noopener noreferrer"&gt;Often, the best products are the ones who consider scalability from the very start.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F26otdks203usxaq90z4g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F26otdks203usxaq90z4g.png" alt="Scalability leads to success"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What Sleep-Sort offered me, and what I hope it gave you, is a sobering reminder that what we believe works in a theoretical world may not work in a physical one. This statement seems obvious, but many create products that assume ideal situations and fail to account for scenarios where certain assumptions don't hold true. &lt;/p&gt;

&lt;p&gt;We need to take a step back and understand to the core how our system works. Furthermore, when we scale our solutions up for larger or different data sets, we need to understand how functionality is affected when we do so. The only way to gain this insight is to acknowledge the limitations of your environment, and the limitations of your machine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;At the end of the day, your machine is still comprised of moving mechanical parts. Design your systems accordingly.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I hope this article was helpful in understanding Sleep-Sort. &lt;a href="https://github.com/SishaarRao/Sleep-Sort/tree/master" rel="noopener noreferrer"&gt;Check out my Sleep-Sort repo if you'd like to try/explore the sort for yourself&lt;/a&gt;! Above all, if you feel like I made any factual errors or if there's anything I can clarify/expand/modify to improve this post, please comment or reach out to me!&lt;/p&gt;

</description>
      <category>sleepsort</category>
      <category>sortalgorithms</category>
      <category>beginners</category>
      <category>shell</category>
    </item>
    <item>
      <title>Demystifying the PageRank Algorithm</title>
      <dc:creator>Sishaar Rao</dc:creator>
      <pubDate>Sat, 13 May 2017 19:38:39 +0000</pubDate>
      <link>https://forem.com/sishaarrao/demystifying-the-pagerank-algorithm</link>
      <guid>https://forem.com/sishaarrao/demystifying-the-pagerank-algorithm</guid>
      <description>&lt;p&gt;PageRank is arguably the most widely-utilized and influential algorithm in our modern day - chances are &lt;a href="https://www.google.com/#safe=strict&amp;amp;q=*your+standard+google+search*" rel="noopener noreferrer"&gt;you use it tens of times every single day.&lt;/a&gt; In this article, I hope to explain not only what PageRank is and how it became so influential but also the Matrix/Linear Algebra that powers it. I created &lt;a href="https://github.com/SishaarRao/PageRank" rel="noopener noreferrer"&gt;a simple Python+Shell demo&lt;/a&gt; that you can check out to see PageRank in live action!&lt;/p&gt;

&lt;h2&gt;
  
  
  The Stone Ages of the Internet -- How Search Engines were born
&lt;/h2&gt;

&lt;p&gt;Once upon a time, you had to know the address of a webpage if you wanted to visit it. Could you imagine how frustrating that would be? You could pretty much only find new websites by word of mouth.&lt;br&gt;
&lt;a href="https://i.giphy.com/media/oh22Ttw0dFW8w/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/oh22Ttw0dFW8w/giphy.gif" alt="Probably me during this time"&gt;&lt;/a&gt;&lt;br&gt;
But then &lt;a href="https://en.wikipedia.org/wiki/Archie_search_engine" rel="noopener noreferrer"&gt;Archie&lt;/a&gt; said "Let there be the world's first search engine."&lt;/p&gt;

&lt;p&gt;How did these work? Well the world's first search engines more or less followed the same process:&lt;br&gt;
1) Crawling: Getting a list of domain names/information: &lt;br&gt;
The tool that consolidated all website data to be later searched became known as a &lt;a href="https://www.sciencedaily.com/terms/web_crawler.htm" rel="noopener noreferrer"&gt;webcrawler.&lt;/a&gt; This guy will find every site and then peruse the links on the page to get a complete look at what is really in it. &lt;br&gt;
2) Indexing: Searching through (usually grepping) and finding relevant information:&lt;br&gt;
This process searches through all the pages that the web crawler found and will return to you pages that match the search query. For example, if your query is "cat" the web crawler will get you every single web page, which the indexer will parse through to return pages with the keyword "cat" on it&lt;/p&gt;

&lt;h4&gt;
  
  
  Pros of these early search engines
&lt;/h4&gt;

&lt;p&gt;The internet was a lot more accessible and useful to ordinary people. They could now find new information from websites they'd never known of before. Thus, the growth and usage of the internet exploded. &lt;/p&gt;

&lt;h4&gt;
  
  
  Cons of these early search engines
&lt;/h4&gt;

&lt;p&gt;It sucked at finding what you wanted. The indexer would simply return whatever pages contained the query. The query "cat" could return you the web page for &lt;a href="http://www.caterpillar.com" rel="noopener noreferrer"&gt;Caterpillar&lt;/a&gt;. You'd have to click through multiple links to find what you wanted.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why does Everybody know Google?
&lt;/h2&gt;

&lt;p&gt;In 1996, two Ph.D. students at Stanford named &lt;a href="https://en.wikipedia.org/wiki/Larry_Page" rel="noopener noreferrer"&gt;Larry Page&lt;/a&gt; and &lt;a href="https://en.wikipedia.org/wiki/Sergey_Brin" rel="noopener noreferrer"&gt;Sergey Brin&lt;/a&gt; wanted to create a Search Engine that could provide users with relevant results to queries. They went on to devise the &lt;strong&gt;PageRank algorithm&lt;/strong&gt; which accomplished precisely this. Their search engine, originally dubbed BackRub, took off in popularity because for some reason it would find you exactly what you were searching for. They accomplished this by not only creating a search engine with the web crawler and indexer components but with the PageRank as a third step to sift through results and find the most relevant. &lt;a href="https://www.google.com/#safe=strict&amp;amp;q=google+net+worth" rel="noopener noreferrer"&gt;The rest is history.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  So what is the PageRank algorithm?
&lt;/h2&gt;

&lt;p&gt;The PageRank algorithm: &lt;em&gt;given a network of sites with links pointing to each other, determine the significance of each site&lt;/em&gt;&lt;br&gt;
What do we mean by a network of sites? Something along the following:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fi.imgur.com%2FTYZgUFX.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fi.imgur.com%2FTYZgUFX.png" alt="An example network of sites"&gt;&lt;/a&gt;&lt;br&gt;
In this example (which is utilized by &lt;a href="https://github.com/SishaarRao/PageRank" rel="noopener noreferrer"&gt;the demo&lt;/a&gt; I created) we can see that Page 1 has links to Page 2 &amp;amp; 4, Page 2 has links to Page 1, 4, &amp;amp; 3, etc.&lt;/p&gt;

&lt;p&gt;The main question however is - &lt;strong&gt;How can we determine "Significance"?&lt;/strong&gt; How do we know which page is relevant to the query? When I first thought of this problem, I came up with a few approaches. Here's why they're wrong:&lt;/p&gt;

&lt;h4&gt;
  
  
  Approach 1: Use Artificial Intelligence to analyze text in the query and Webpage
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Why this can't work&lt;/strong&gt;: While this may be practical for a page or two, it's simply too costly. &lt;a href="http://www.internetlivestats.com/total-number-of-websites/" rel="noopener noreferrer"&gt;With over a billion pages&lt;/a&gt;, it'll take too long to determine the significance of every page given a query.&lt;/p&gt;

&lt;h4&gt;
  
  
  Approach 2: Simply Count the Number of Occurrences of a Keyword
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Why this can't work&lt;/strong&gt;: The most relevant pages aren't always the ones that mention the query the most. Irrelevant sites can easily boost their traffic by pasting the word on their page a million times. When I search "shoes", I want to see Nike, Adidas, and New Balance.&lt;/p&gt;

&lt;h4&gt;
  
  
  The Approach used by PageRank: Count the Number of Links pointing to that Webpage
&lt;/h4&gt;

&lt;p&gt;The more the website is cited by others in the network, the more likely it's important. We can think of this as a "democratic voting" system. The key to this system is that &lt;strong&gt;every page gets one vote that is weighted by its significance&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Technical Details + Linear Algebra Basis
&lt;/h2&gt;

&lt;p&gt;Given a page in the network, we will count how many links to other pages the current page possesses. We will then take the inverse of this number to get the portion of the current page's weighted vote delegated to each of those other pages. Let's take a network of 4 pages with links that look like this: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fi.imgur.com%2FWVi97sS.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fi.imgur.com%2FWVi97sS.png" alt="A network of four pages"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can express the significances of each page with a system of equations where Xn is Page n. Page 1 has links from Page 3 &amp;amp; 4 (aka Page 3 has a link to Page 1, Page 4 also has a link to Page 1). Since Page 3 is pointing to only one page, it's casting its entire vote for Page 1. Since Page 4 is pointing to two pages, it's casting half a vote for Page 1. We proceed with this process for the rest of the pages in the network to create the system of equations: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fi.imgur.com%2F3fVJVUB.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fi.imgur.com%2F3fVJVUB.png" alt="System of equations derived from system of four pages"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We could go ahead and brute-force our way through this SOE but ain't nobody got time fo' that. If we look carefully, we can observe that all the variables in this system are defined in relation to each other: namely, Xn is given some value in relation to different values of n, and those different values of n may be defined in relation to the original value of n. Thus, we can express this system of equations in matrix form &lt;strong&gt;Ax = x&lt;/strong&gt;. The matrix A is going to be populated with our coefficients from the system, and the matrix X is going to be populated with the coefficients X1, X2, X3, X4. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fi.imgur.com%2FQ55KAlV.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fi.imgur.com%2FQ55KAlV.png" alt="The coefficient matrix A"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fi.imgur.com%2FnvcMVjG.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fi.imgur.com%2FnvcMVjG.png" alt="The variable matrix X"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note: All the columns in matrix A add up to 1 because each Page can cast &lt;em&gt;a total of one vote&lt;/em&gt; whereas the rows are the sums of the weighted votes that each Page receives. Also, the "T" superscript indicated transposed, in that the matrix X is a 4x1 rather than a 1x4 matrix. &lt;/p&gt;

&lt;p&gt;So now we have transformed the system of equations to a system of matrices. How does help us find the solution (namely the x matrix) for the system? This is where Eigenvalues &amp;amp; Eigenvectors come in. &lt;/p&gt;

&lt;h4&gt;
  
  
  A brief overview of Eigenvalues &amp;amp; Eigenvectors
&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Eigenvectors&lt;/em&gt; are special instances of vectors that, when multiplied by a transformation matrix (in our case the matrix is A), the vector does not change its direction. It can change in scale, however, the factor by which we call the &lt;em&gt;Eigenvalue&lt;/em&gt;. These special-case scenarios can be expressed by the equation &lt;strong&gt;Ax = Î»x&lt;/strong&gt; where &lt;strong&gt;Î»&lt;/strong&gt; is our eigenvalue and &lt;strong&gt;x&lt;/strong&gt; is the eigenvector. Note: Vector, in this case, is another name for the matrix.&lt;/p&gt;

&lt;p&gt;In our system &lt;strong&gt;Ax = x&lt;/strong&gt; we say &lt;em&gt;Hey! The solution matrix X is an eigenvector for the system -- namely, it's the eigenvector when the eigenvalue (Î») is equal to 1!!!&lt;/em&gt;&lt;br&gt;
We can then do the following steps which are characteristic of solving for an eigenvector:&lt;br&gt;
1) Ax = Î»x&lt;br&gt;
2) Ax - Î»x = 0&lt;br&gt;
3) (A - Î»I)x = 0 &amp;lt;-- where I is the Identity matrix&lt;/p&gt;

&lt;p&gt;From here, we can use &lt;a href="https://www.khanacademy.org/math/linear-algebra/vectors-and-spaces/matrices-elimination/v/matrices-reduced-row-echelon-form-1" rel="noopener noreferrer"&gt;row reduction&lt;/a&gt; to solve for our matrix x, when Î» = 1. In this particular instance, we get the following as our solution matrix x:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fi.imgur.com%2FV9Zec3n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fi.imgur.com%2FV9Zec3n.png" alt="Final solution matrix"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we can see, we find that Page 1 is our most relevant ranking. This may seem counterintuitive given that Page 3 has the more links pointing to it, but remember, &lt;em&gt;the votes are based on weighted significance&lt;/em&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  The Genius of Google
&lt;/h2&gt;

&lt;p&gt;Learning how the PageRank algorithm works should leave everyone awestruck. The scale at which they employ PageRank is exponentially larger than the example I provided. Never mind the fact that they handle millions of queries every day in a fraction of a second.&lt;/p&gt;

&lt;p&gt;The Genius behind Google is that they employed Mathematical principles to provide a solution to a problem everybody was facing at the time. Going forward, when I look at the work I'm doing, it helps me to take a step back and think: &lt;strong&gt;What am I trying to solve? What am I trying to accomplish? How does my work provide value to people?&lt;/strong&gt; This algorithm is an ode to that mindset, and I genuinely believe that if you work in this manner, regardless of your field, you'll find success. &lt;/p&gt;

&lt;p&gt;I hope this article was helpful in understanding the PageRank algorithm. &lt;a href="https://github.com/SishaarRao/PageRank" rel="noopener noreferrer"&gt;Check out the Python+Shell demo I created!&lt;/a&gt; Above all, if you feel like I made any factual errors or if there's anything I can clarify/expand/modify to improve this post, please comment or reach out to me!&lt;/p&gt;

</description>
      <category>pagerank</category>
      <category>google</category>
      <category>linearalgebra</category>
      <category>eigenspace</category>
    </item>
    <item>
      <title>The 3 Stages of Beauty in Emacs (from a 17 year old’s perspective)</title>
      <dc:creator>Sishaar Rao</dc:creator>
      <pubDate>Thu, 27 Apr 2017 15:58:41 +0000</pubDate>
      <link>https://forem.com/sishaarrao/the-3-stages-of-beauty-in-emacs-from-a-17-year-olds-perspective</link>
      <guid>https://forem.com/sishaarrao/the-3-stages-of-beauty-in-emacs-from-a-17-year-olds-perspective</guid>
      <description>&lt;p&gt;In a mostly overlooked corner of my school lies an antiquated yet working Apple II, in full glory. I decided one day to login only to find some odd IDE running on the terminal - I soon found out it was an Emacs instance. I’d heard this name before. Where was it? Oh yea! In the Social Network!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fi.imgur.com%2F9mJoLIz.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fi.imgur.com%2F9mJoLIz.gif" title="Time to Break out Emacs and modify that perl script!" alt="alt text" width="400" height="167"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Circa 6 months ago when I was about to make this switch, Atom was my IDE of choice. It was decent and it got the job done, so what else could I want? When I heard about Emacs, I did some research and found that there seemed to be a rivalry between Emacs power-users and the more mainstream Vim-ers. &lt;/p&gt;

&lt;p&gt;In the spirit of teenage rebellion, I cast away Ol’ Reliable Atom and shunned the mainstream Vim in favor for Emacs, my new idol to learn and utilize completely. I used &lt;a href="https://www.masteringemacs.org" rel="noopener noreferrer"&gt;this textbook&lt;/a&gt; to pick up some commands as well as the &lt;a href="https://www.gnu.org/software/emacs/manual/" rel="noopener noreferrer"&gt;official GNU Emacs manual&lt;/a&gt; and the uber-helpful &lt;a href="https://www.emacswiki.org/emacs" rel="noopener noreferrer"&gt;Emacswiki&lt;/a&gt;. And so began my 3-stage journey of learning this command-line based editor completely from scratch. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;em&gt;Stage 1&lt;/em&gt;: This SUCKS. Do people seriously use this?
&lt;/h2&gt;

&lt;p&gt;The absolute first thing I had to learn with Emacs is how to move around. How do you move the cursor Forward? Backward? Up? Down? What the hell.&lt;code&gt;C-x f&lt;/code&gt; for forward? &lt;code&gt;C-x b&lt;/code&gt; for backward? It’s neat that the letters match up with the word, but how could anything possibly be more intuitive than the arrows? Or pointing and clicking?! This can’t disrupt my workflow: I haven’t even been able to start working because of how complicated this is! &lt;/p&gt;

&lt;p&gt;Navigation in Emacs as newbie was probably the steepest part of the Emacs learning curve, so if anyone is out there learning or may have given up — keep practicing, it gets better I promise. &lt;/p&gt;

&lt;p&gt;Just kidding, it gets even harder before it gets any easier. I learned about the all-important key-bindings, often by accidentally clicking some key while trying to navigate. Whoops, accidentally clicked &lt;code&gt;C-s&lt;/code&gt; — oh wait, what’s Iterative-Search? That’s kinda neat. I learned how to open and save files, how to switch buffers, and how to shut down Emacs (believe it or not it took me a while to figure this one out, I would just shut down my Terminal app)&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;em&gt;Stage 2&lt;/em&gt;: God Bless Eshell
&lt;/h2&gt;

&lt;p&gt;I saw an instant jump in productivity when I discovered Eshell. (Check out &lt;a href="https://www.masteringemacs.org/article/complete-guide-mastering-eshell" rel="noopener noreferrer"&gt;this website&lt;/a&gt; for a general overview) Possessing a shell in an alternate buffer meant I could quickly hop around from working and writing code to testing it and modifying file structure. With a fully functional Shell at my side, I bypassed the tedious task of coding in an IDE, switching to my Terminal to run it, and switching back to modify code. When I became comfortable with Eshell, I began to notice that my productivity in Emacs was rising.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;em&gt;Stage 3&lt;/em&gt;: Hey, That’s Kinda Neat!
&lt;/h2&gt;

&lt;p&gt;Emacs has some really cool features that boosted my productivity as well, so I’ll give them a special shoutout.&lt;/p&gt;

&lt;h4&gt;
  
  
  Macros
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://www.emacswiki.org/emacs/KeyboardMacros" rel="noopener noreferrer"&gt;Macros&lt;/a&gt; allow you to chain a number of commands into one command. For example, if for a block of code you want to delete the first and last five characters of every other line, you can string together these commands and make it a macro, allowing you to complete such a task within a matter of seconds.&lt;/p&gt;

&lt;h4&gt;
  
  
  Key-Binding Customization
&lt;/h4&gt;

&lt;p&gt;Emacs allows you to bind new commands to characters for the entire system. For example, I found &lt;a href="http://stackoverflow.com/questions/7733668/command-to-clear-shell-while-using-emacs-shell" rel="noopener noreferrer"&gt;this helpful Stackoverflow answer&lt;/a&gt; and followed the second answer to create a key binding that allows me to easily clear my Eshell screen! Key-Bindings are written in Emacs’ native language &lt;a href="https://www.gnu.org/software/emacs/manual/eintr.html" rel="noopener noreferrer"&gt;Lisp, so if you know the language&lt;/a&gt; you can create your own bindings to customize and improve your workflow!&lt;/p&gt;

&lt;h4&gt;
  
  
  Splitting Windows
&lt;/h4&gt;

&lt;p&gt;Believe it or not, this feature took me some time to discover, but Emacs’ ability to split windows cleanly meant I could switch between and work on different files at a much faster pace than ever before. No longer was I stuck in the (now frustrating) process of switching tabs or windows. My workflow now looked something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fi.imgur.com%2Fo3NYwej.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fi.imgur.com%2Fo3NYwej.png" title="A sample workflow with split windows" alt="alt text" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  In Conclusion
&lt;/h2&gt;

&lt;p&gt;I’d still say I’m a novice when it comes to Emacs. There are some power-users out there that use Emacs’ immense capabilities to its fullest extent, and I’m nowhere close to them. That being said, I’ve been using Emacs for about a year now and I hope that my experience outlined here could prove valuable to anybody thinking about switching or learning this environment. I often find myself using Emacs navigation commands in Google Docs and Gmail and all sorts of places (amazingly, they work!) so it’s safe to say that I’m not leaving Emacs anytime soon.&lt;/p&gt;

&lt;p&gt;I may have made some factual errors here and there, so please comment if you spotted something!&lt;br&gt;
Know any other cool features that I didn’t mention? Please comment those too! Thanks!&lt;/p&gt;

</description>
      <category>emacs</category>
      <category>eshell</category>
    </item>
    <item>
      <title>Hey! I'm Sishaar Rao!</title>
      <dc:creator>Sishaar Rao</dc:creator>
      <pubDate>Wed, 29 Mar 2017 00:25:03 +0000</pubDate>
      <link>https://forem.com/sishaarrao/hey-im-sishaar-rao</link>
      <guid>https://forem.com/sishaarrao/hey-im-sishaar-rao</guid>
      <description>&lt;p&gt;I have been coding for 4 years.&lt;/p&gt;

&lt;p&gt;You can find me on Twitter as &lt;a href="https://twitter.com/Sishaar" rel="noopener noreferrer"&gt;@Sishaar&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I live in Ashburn, Virginia.&lt;/p&gt;

&lt;p&gt;I mostly program in these languages: Python, Java, Shell, HTML/Javascript.&lt;/p&gt;

&lt;p&gt;I am currently learning more about Swift.&lt;/p&gt;

&lt;p&gt;Reach out to me by email: &lt;a href="mailto:sishaar@gmail.com"&gt;sishaar@gmail.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>introduction</category>
    </item>
  </channel>
</rss>
