<?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 Justin O&#39;Halloran on Medium]]></title>
        <description><![CDATA[Stories by Justin O&#39;Halloran on Medium]]></description>
        <link>https://medium.com/@justinohalloran?source=rss-6062007fd769------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Zy-plLDBLZZ3DYsB.jpg</url>
            <title>Stories by Justin O&amp;#39;Halloran on Medium</title>
            <link>https://medium.com/@justinohalloran?source=rss-6062007fd769------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 23:41:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@justinohalloran/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[Queues]]></title>
            <link>https://medium.com/@justinohalloran/queues-6b1dfe6569e3?source=rss-6062007fd769------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b1dfe6569e3</guid>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[Justin O'Halloran]]></dc:creator>
            <pubDate>Wed, 26 Feb 2020 03:07:42 GMT</pubDate>
            <atom:updated>2020-02-26T03:07:42.166Z</atom:updated>
            <content:encoded><![CDATA[<p>Intro to queues</p><ul><li>FIFO structure, First-person in first out</li><li>It is a line</li><li>a Stack is LIFO</li><li>Video Game to join, there is a queue</li><li>Uploading or downloading, if they are the same size the first thing added will be uploaded first</li><li>Another example is printing, it can only print one thing at a time.</li><li>The custom queue class is lighter than using an array.</li><li>There is more than one way to implement a queue.</li></ul><p><strong>Writing a queue using an array</strong></p><ul><li>unshift + pop</li><li>shift + push</li><li>If we add to the beginning, we have to reindex everything</li><li>Popping from the end is necessary</li><li>Stack you can do push and pop</li><li>Queue you must use shift + push</li><li>First in first out</li></ul><p><strong>Writing a queue from scratch</strong></p><ul><li>In a singly listed list, using pop is slow because you have to go through the entire list</li><li>Add to the end and remove from the tail</li><li>enqueue and dequeue</li><li>This is different than an array because there is not an index . This distinction must be made.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c634dc23f6589890a7bfc3ab6c19035f/href">https://medium.com/media/c634dc23f6589890a7bfc3ab6c19035f/href</a></iframe><p>Big O of queues</p><ul><li>Insertion O(1)</li><li>Removal O(1)</li><li>Searching O(N)</li><li>Access O(N)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b1dfe6569e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Pursuit of Scale]]></title>
            <link>https://medium.com/@justinohalloran/a-pursuit-of-scale-8b5ebf87751?source=rss-6062007fd769------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b5ebf87751</guid>
            <category><![CDATA[scale]]></category>
            <dc:creator><![CDATA[Justin O'Halloran]]></dc:creator>
            <pubDate>Thu, 20 Feb 2020 15:25:20 GMT</pubDate>
            <atom:updated>2020-02-20T15:25:20.504Z</atom:updated>
            <content:encoded><![CDATA[<p>Throughout my career, I have been focused on scale. I never realized it, but this obsession has taken me from a Sports Travel Agent to Front End Developer and everywhere in between. However, no matter the role I am always looking for a way to improve the workflow and continuously push the status quo. I got into web development because I wanted to build an application to facilitate scale in Sports Travel, but once I became a developer I became focused on building applications to facilitate scale in web development. There is some innate desire within me to enhance the capability of the job I work on or the team that I am a part in order to push the team further.</p><p>I feel that no matter where I go with my career, I will find innovative solutions to complex problems that result in enhanced productivity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b5ebf87751" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stacks and Ques in JavaScript]]></title>
            <link>https://medium.com/@justinohalloran/stacks-and-ques-in-javascript-fffa0aaa1d5f?source=rss-6062007fd769------2</link>
            <guid isPermaLink="false">https://medium.com/p/fffa0aaa1d5f</guid>
            <category><![CDATA[queue]]></category>
            <category><![CDATA[stack]]></category>
            <dc:creator><![CDATA[Justin O'Halloran]]></dc:creator>
            <pubDate>Thu, 20 Feb 2020 01:52:45 GMT</pubDate>
            <atom:updated>2020-02-20T01:53:28.945Z</atom:updated>
            <content:encoded><![CDATA[<ul><li>Less Code than a linked List</li><li>What is a stack? What is the use case?</li><li>A stack is an abstract data structure that has a LIFO principle.</li><li>The last element added to a stack is the first to be removed.</li><li>A stack of plates in a sink.</li><li>Remove the last item in a list at all times.</li><li>The Call Stack is an example.</li><li>Undo / Redo in photoshop or a text editor</li><li>Routing is treated as a stack</li><li>A stack is an abstract concept, we can use an array or a custom linked list</li></ul><ol><li>Intro to stacks</li><li>Creating a stack with an array</li><li>Writing our own stack from scratch</li><li>BIG O of Stacks</li><li>Intro to Queues</li><li>Creating Queues Using Arrays</li><li>Writing our own Queue from scratch</li><li>BIG O of Queues</li></ol><p>Intro to stacks</p><p><strong>Creating a stack with an array</strong></p><p>Easiest way to use an array. JavaScript does not come with a Stack as some other languages do.</p><ul><li>Using push and pop in order will produce a stack. You cannot use other methods.</li><li>Adding to the beginning of an array = unShift</li><li>Removing from the beginning of an array = shift</li><li>You can use shift/unshift together. You can use pop/push together.</li><li>The difference between these two is that shift/unshift act on the beginning, which is poor for performance.</li><li>This goes back to one of our general principles: adding items to the beginning of an array is not performant.</li><li>LIFO is great for an array.</li></ul><p><strong>Writing our own stack from scratch</strong></p><ul><li>Last thing added in is the first thing we get back .</li><li>Build our own following the practices of the singly linked list.</li><li>We only care about two methods, push and pop.</li><li>In a stack, push and pop are constant time.</li><li>In a linked list, pop is not constant time. We have to loop over the entire list.</li><li>Therefore, we use shift and unshift from singly linked list.</li></ul><p><strong><em>Push Pseudocode</em></strong></p><ul><li>The function should accept a value</li><li>Create a new node with that value</li><li>If there are no nodes, set the first and last property to be the newly created node</li><li>If there is at least one node, create a variable that stores the current first property on the stack</li><li>Reset the first property to be the newly created node</li><li>Set the next property on the node to be the previously created variable</li><li>Increment the size of the stack by 1</li><li>A stack is constant time. We need to add and remove from the beginning of the list.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2Fn0i5b&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2Fn0i5b&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2Fn0i5b%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/af402b2ad647a527264c7b9fc79885b5/href">https://medium.com/media/af402b2ad647a527264c7b9fc79885b5/href</a></iframe><p><strong>BIG O of Stacks</strong></p><p><strong>Intro to Queues</strong></p><p><strong>Creating Queues Using Arrays</strong></p><p><strong>Writing our own Queue from scratch</strong></p><p><strong>BIG O of Queues</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fffa0aaa1d5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Composition of MUI Components]]></title>
            <link>https://medium.com/@justinohalloran/composition-of-mui-components-ecdac9ed7423?source=rss-6062007fd769------2</link>
            <guid isPermaLink="false">https://medium.com/p/ecdac9ed7423</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[material-ui]]></category>
            <dc:creator><![CDATA[Justin O'Halloran]]></dc:creator>
            <pubDate>Thu, 20 Feb 2020 01:26:39 GMT</pubDate>
            <atom:updated>2020-02-20T01:26:39.040Z</atom:updated>
            <content:encoded><![CDATA[<p>Using Material UI as our base, we attempted to create our own custom components.</p><ul><li>Taking the MUI component and thinking of the most basic form, then building an interface.</li><li>The goal being that we want developers to interact with the external side of the component, following the O in SOLID.</li><li>The major challenge being, “How much flexibility do we offer?”</li></ul><p>Not conducting this work from our original project really impacted our ability to think in this manner. We worked in silos on our own tickets, and got things to work without scale in mind.</p><p>The first step is to take a look at the Material UI documentation, and bring in the component you are looking to use.</p><p>Deconstruct that component until you get the basic version you are looking for.</p><p>Determine how much flexibility you want your developers to have with the component.</p><p>Refactor the component internals, using Hooks and helper functions.</p><p>The MUI documentation is not perfect, and can always be enhanced.</p><p>MUI components may be a great example of composition.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ecdac9ed7423" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a following]]></title>
            <link>https://medium.com/@justinohalloran/building-a-following-ae6c14e3f02c?source=rss-6062007fd769------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae6c14e3f02c</guid>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[twitter]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Justin O'Halloran]]></dc:creator>
            <pubDate>Mon, 17 Feb 2020 18:06:31 GMT</pubDate>
            <atom:updated>2020-02-17T18:06:31.023Z</atom:updated>
            <content:encoded><![CDATA[<p>I have been fascinated by the idea of doing activities that provide a return. This was brought up by a fellow on Twitter, <a href="https://twitter.com/david_perell">David Perell</a> who I have thoroughly enjoyed following. Here is an example:</p><blockquote>Build compounding assets. Start a podcast, make music. write a personal blog, record YouTube videos, share your drawings on Instagram, or your paintings on your website. Do what excites you. Create, create, create. Publish, publish, publish. The Internet is waiting for you.</blockquote><p>I have thought about trying to develop a following for a while, and now that I have the skills to automate the process I am going to jump right in. It is going to be extremely messy, I do not have a proper base set up to provide content but I am going to figure it out as I go.</p><p>The first order of business is to create a Twitter account dedicated to Web Development, build a bot to get followers and analyze that data. If you are reading this from my Twitter link, then my plan has worked.</p><p>Once I have my Twitter account set up, I am going to do some poking around the Vancouver Tech Scene, following different companies, looking for trends in naming conventions. For Example Software Engineer, Developer, React etc….</p><p>I will then proceed to build a bot that will canvass Twitter for me, artificially growing my following count by focusing on these keywords. I will then analyze the results and iterate on this process.</p><p>The internet is a magical place.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae6c14e3f02c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Set in a Doubly Linked List]]></title>
            <link>https://medium.com/@justinohalloran/set-in-a-doubly-linked-list-1c965a96dd91?source=rss-6062007fd769------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c965a96dd91</guid>
            <dc:creator><![CDATA[Justin O'Halloran]]></dc:creator>
            <pubDate>Sat, 08 Feb 2020 23:01:01 GMT</pubDate>
            <atom:updated>2020-02-08T23:01:01.341Z</atom:updated>
            <content:encoded><![CDATA[<p>Goal: Replace the value of a node in a doubly-linked list</p><p>Variables:</p><ul><li>Index: The position of the node in the list that we want to replace</li><li>Head: The first node in the list</li><li>Tail: The last node in the list</li><li>Count: The index of the current node in a loop</li><li>Current: The node in the count position of the loop</li></ul><p>Considerations</p><ul><li>We will need to generate a new node with the value passed into the method</li><li>The new node will need the prev and next values of the current node that it is replacing</li><li>the current node will need to have it’s prev and next values turned to null</li></ul><p>Pseudocode</p><ul><li>Create a variable which is the result of the get method at the index passed to the function<br>- if the get method returns a valid node, set the value of that node to be the value passed to the return function<br>- return true</li><li>Otherwise, return false</li></ul><p>Notes and thoughts:</p><ul><li>This initially was confusing for me, as we were using another method that returns a value and updating the value of that return. To me, it did not make sense to simply update the value of this returned value but as javascript is a pass by reference language this makes sense. We created a variable that references the object in the list and updated its value. I had initially thought that we were creating a new variable and updating the value, then we would need to replace the value in the list. This is wrong.</li><li>Creating these classes and thinking about JavaScript from the ground up is a very important exercise. It allows you to understand some very complicated theories behind the language that is not clear from the beginning. Understanding pass by reference in this context is very important.</li><li>I am going to create a series on JavaScript by teaching how to build custom objects as classes. This will help teach JavaScript</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c965a96dd91" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get in a Doubly Linked List]]></title>
            <link>https://medium.com/@justinohalloran/get-in-a-doubly-linked-list-65edfd798b5e?source=rss-6062007fd769------2</link>
            <guid isPermaLink="false">https://medium.com/p/65edfd798b5e</guid>
            <dc:creator><![CDATA[Justin O'Halloran]]></dc:creator>
            <pubDate>Sat, 08 Feb 2020 22:39:16 GMT</pubDate>
            <atom:updated>2020-02-08T22:39:16.045Z</atom:updated>
            <content:encoded><![CDATA[<p>We can start at the beginning of the list or the end. This is optimized based on the index that is provided. If there are 10 items, and we are looking for the index of 7 this is closer to the end of the list. So we would start our function from the tail.</p><p>PseudoCode</p><p>Goal: Return the node in a list for a given index. If the index is less than 0 or greater than the length of the list, return null.</p><p>Variables:</p><ul><li>Index: The position of the node that we would like to return</li><li>Head: The first node in the list</li><li>Tail: The last node in the list</li><li>Count: represents the position of the loop as the function moves through the list</li><li>Current: the value of the current node in the loop</li><li>Node: The node that will be returned at the end of the function</li></ul><p>Side Effects:</p><ul><li>There will be no side effects from this operation as we are searching for a node and returning its value.</li></ul><ol><li>If the index is less than 0 or greater than the list length, return null</li><li>If the index is less than or equal to half the length of the list<br>- Loop through the list starting from the head and loop towards the middle<br>- return the node once it is found</li><li>If the index is greater than half the length of the list <br>- Loop through the list starting from the tail and loop towards the middle<br>- Return the node once it is found</li></ol><pre>get(index:number){<br>if(index &lt; 0  || index &gt; this.length) return null</pre><pre>var count, current </pre><pre>if( index &lt;= this.length / 2) {<br>count = 0;<br>current = this.head; <br>while(count !== index){<br>current = current.next;<br>count++ }<br>} else {<br>count = this.length - 1; <br>current = this.tail;<br>while(count !== index) {<br>current = current.prev;<br>count --;</pre><pre>}</pre><pre>return current </pre><pre>} </pre><pre><br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65edfd798b5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shift a Doubly Linked List]]></title>
            <link>https://medium.com/@justinohalloran/shift-a-doubly-linked-list-89e05d9ae1cc?source=rss-6062007fd769------2</link>
            <guid isPermaLink="false">https://medium.com/p/89e05d9ae1cc</guid>
            <dc:creator><![CDATA[Justin O'Halloran]]></dc:creator>
            <pubDate>Sat, 08 Feb 2020 22:02:50 GMT</pubDate>
            <atom:updated>2020-02-08T22:02:50.910Z</atom:updated>
            <content:encoded><![CDATA[<p>Methods:</p><ul><li>Shift: Remove a node from the beginning of a List</li><li>Unshift: Add a Node to the beginning of a List</li></ul><p>Unshift</p><p>Pseudocode</p><ol><li>Create the unshift method, which accepts the value to be added to the beginning of the list</li><li>Create a new node with the value passed to the function</li><li>If the length is 0: <br>- set the head to be the new node<br>- Set the Tail to be the new node</li><li>Otherwise<br>- Set the prev property on the head of the list to be the new node<br>- Set the next property on the new node to be the head property<br>- Update the head to be the new node</li><li>Increment the length</li><li>Return the list</li></ol><pre>unshift(value){</pre><pre>const newNode = new Node(value)<br>if(!length) {<br>              this.head = newNode<br>              this.tail = newNode<br>             }<br>this.head.prev = newNode<br>newNode.next = this.head<br>this.head = newNode<br>length ++<br>return this<br>}</pre><p>Considerations</p><ul><li>Always check for the edge case first. If there is nothing in the array, than the new value will become the head and the tail</li><li>Consider the scenarios for the function call<br>- There is an item in the array<br>- There are no values in the array</li><li>We are only dealing with the first value in the array and creating a new value that becomes the head.</li><li>The first thing that we need to do is connect the current head with the new node. At the end of the function, the current head will be the second item, and therefore it’s .prev value will be the new node<br>- this.head.prev = newNode</li><li>The newNode will then be connected to the current head through the .next property<br>- newNode.next = this.head</li><li>Finally, we will declare that the new node is the head</li></ul><p>newHead &amp; oldHead</p><ul><li>Another way that we can view the problem is through the lens of the variables being manipulated. What are their beginning states and what are their end states?</li><li>New Head<br>- Beginning State: this.prev = null, this.next = null<br>- End State: this.prev = null, this.next = (the previous head)</li><li>oldHead<br>- Beginning State: this.prev = null; this.next = next item || null<br>- End State: this.prev = newHead; this.next = next item || null</li></ul><p>The new head will have it’s .next property changed.</p><p>The oldHead will have it’s prev value changed but its next value will stay the same.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89e05d9ae1cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding JavaScript]]></title>
            <link>https://medium.com/@justinohalloran/understanding-javascript-72b4830c6d35?source=rss-6062007fd769------2</link>
            <guid isPermaLink="false">https://medium.com/p/72b4830c6d35</guid>
            <dc:creator><![CDATA[Justin O'Halloran]]></dc:creator>
            <pubDate>Sat, 08 Feb 2020 21:21:58 GMT</pubDate>
            <atom:updated>2020-02-08T21:21:58.374Z</atom:updated>
            <content:encoded><![CDATA[<p>I am currently working my way through a Udemy Course focusing on Data Structures and Algorithms. The course presents a Data Structure and guides you through building it from scratch using classes. This has been immensely helpful for me as I am thinking about how JavaScript works behind the scenes.</p><p>I wonder if anyone has written a JavaScript course that allows you to build the core features of JavaScript from scratch. It would be great to develop a deeper understanding of the language by creating custom classes and building functions from scratch. Imagine building your own Array object as a way to learn about how JavaScript works.</p><p>Do you think that would be helpful?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72b4830c6d35" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Great use of the Modulus Operator]]></title>
            <link>https://medium.com/@justinohalloran/great-use-of-the-modulus-operator-4afa3ad48d6b?source=rss-6062007fd769------2</link>
            <guid isPermaLink="false">https://medium.com/p/4afa3ad48d6b</guid>
            <dc:creator><![CDATA[Justin O'Halloran]]></dc:creator>
            <pubDate>Tue, 04 Feb 2020 05:18:56 GMT</pubDate>
            <atom:updated>2020-02-04T05:18:56.376Z</atom:updated>
            <content:encoded><![CDATA[<p>I was working through some problems on Leetcode tonight and came across an interesting question:</p><p>Given an integer number n, return the difference between the product of its digits and the sum of its digits.</p><p><strong>Example 1:</strong></p><pre><strong>Input:</strong> n = 234<br><strong>Output:</strong> 15 <br><strong>Explanation:</strong> <br>Product of digits = 2 * 3 * 4 = 24 <br>Sum of digits = 2 + 3 + 4 = 9 <br>Result = 24 - 9 = 15</pre><p>Fairly straight forward from my perspective, just run some loops on n to acquire the product and sum. However, when I looked at the best answers on the submission board, I came across this:</p><pre>var subtractProductAndSum = function(n) {<br>    let productOfDigits = 1;<br>    let sumOfDigits = 0;<br>    while(n &gt; 0) {<br>        let pulledDigit = n % 10;<br>        productOfDigits *= pulledDigit;<br>        sumOfDigits += pulledDigit;<br>        n = parseInt(n / 10);<br>    }<br>    return productOfDigits - sumOfDigits;<br>};</pre><p>This solution is very elegant and easy to understand from my perspective. I had never thought to use the modulus operator as a way to remove a digit from an integer.</p><p>If you are not familiar with what is happening:</p><ol><li>The value of n is 234</li><li>234 % 10 = 4 as 4 is the remainder of 234/10</li><li>n = ParseInt( n / 10); change the value of N to be one digit smaller</li></ol><p>This is great. I will definitely use this moving forward.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4afa3ad48d6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>