<?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 Malinda Lin on Medium]]></title>
        <description><![CDATA[Stories by Malinda Lin on Medium]]></description>
        <link>https://medium.com/@xqmlin?source=rss-d30fe2fd616b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*4CPYWoa1exlF7g4BsSZpuA.jpeg</url>
            <title>Stories by Malinda Lin on Medium</title>
            <link>https://medium.com/@xqmlin?source=rss-d30fe2fd616b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 13:58:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@xqmlin/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[Start Using Socket.io in 4 Minutes]]></title>
            <link>https://medium.com/weekly-webtips/start-using-socket-io-in-4-minutes-4342a03126?source=rss-d30fe2fd616b------2</link>
            <guid isPermaLink="false">https://medium.com/p/4342a03126</guid>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[socketio]]></category>
            <category><![CDATA[websocket]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Malinda Lin]]></dc:creator>
            <pubDate>Tue, 09 Jun 2020 15:52:50 GMT</pubDate>
            <atom:updated>2020-06-10T14:17:59.735Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Quick Tutorial With Sample Code</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DzqBGRfgLtZlEmAKF3dLFA.png" /></figure><p>Socket.io is a JS library that uses WebSockets protocol to allow bi-directional communication between server and client. It is popular because it offers out-of-the-box features that are not available in WebSockets alone. Also, in case WebSockets is not supported, Socket.io has the option to fall back to long polling to keep your connection active across all clients.</p><p>To get started, make sure you npm install socket.io. Also, create three files: the server-side file, the client-side file, and the HTML file being served to the browser. In my examples, I call these files server.js, index.html, and client.js.</p><p><strong>These are the steps to use Socket.io:<br></strong>1. Create a server<br>2. Initiate socket on server-side<br>3. Initiate socket on client-side<br>4. Set up event listeners and emit functions!</p><p>Create a server in the server-side file. In my example, I created an Express server but a simple HTTP server works too.</p><pre><strong>// server.js</strong><br>const express = require(&#39;express&#39;);<br>const app = express();</pre><pre>const clientPath = `${__dirname}`;</pre><pre>app.use(express.static(clientPath));</pre><pre>app.get(&#39;/&#39;, (req, res) =&gt; {<br>  res.sendFile(`${clientPath}/index.html`);<br>});</pre><pre>const PORT = process.env.PORT || 5000;</pre><pre>// server instance<br>const server = app.listen(PORT, () =&gt; {<br>  console.log(`Listening on port: ${PORT}`);<br>});</pre><p>Next, add sockets to both the server-side and client-side because together, they act like a communication bridge. To set up a socket on the server: import the socket.io library using the ‘<em>require</em>’ keyword, pass in your server instance, and set up the connection event listener. When the client-side socket is added, the connection event listener allows any client that connects to have access to the connection event listener’s callback function which holds all socket event listeners (I explain socket event listeners later):</p><pre><strong>// server.js<br></strong>const socketio = require(&#39;socket.io&#39;);</pre><pre>// sets up socket<br>const io = socketio(server);</pre><pre>// connection event listener<br>io.on(&#39;connection&#39;, socket =&gt; {</pre><pre><em>/* add your socket listeners here */</em></pre><pre>});</pre><p>To set up a socket on the client-side: import the ‘<em>socket-client</em>’ library into your HTML file, then import the client-side file. Then, in your client-side file, invoke <em>io </em>to complete the bridge. Now, when a connection is made, the connection event listener in the server file will trigger.</p><pre><strong>&lt;-- index.html --&gt;<br></strong>&lt;script src=&quot;/socket.io/socket.io.js&quot;&gt;&lt;/script&gt;<br>&lt;script src=&quot;client.js&quot;&gt;&lt;/script&gt;<br>____________________________________________________________________</pre><pre><strong>// client.js<br></strong>const socket = io();</pre><pre><em>/* add regular event listeners here */</em></pre><pre><em>/* add sockets event listeners here */</em></pre><p>Then, you will need to create socket listeners for both the client and server. Socket event listeners pick up messages that cross the bridge. Use ‘<em>socket.on(‘insert destination name’, callback)</em>’ to create a socket event listener and assign it a name. The callback function is invoked when the socket event listener is triggered. To trigger a socket event listener, we use emit functions like this <em>‘socket.emit(‘insert destination name’, data, …)’</em>. Emit functions tell your messages where to go, and what to send. In the emit function, make sure you use the name of the socket event listener that you want to trigger. You can pass as many arguments as you want in a single emit function.</p><pre><strong>// server.js</strong><br>io.on(&#39;connection&#39;, socket =&gt; {</pre><pre>socket.on(&#39;give me a name&#39;, (string, int, fn) =&gt; {</pre><pre><em>/* io.emit will trigger all connected client sockets.<br>         Remember, clients can also have socket event listeners */</em></pre><pre>io.emit(&#39;client socket name&#39;, &#39;any data types here&#39;)<br>   })</pre><pre>});<br>____________________________________________________________________</pre><pre><strong>// client.js</strong></pre><pre>// after the name(string), you can pass any data types<br>socket.emit(&#39;give me a name&#39;, &#39;string&#39;, 10, function)</pre><pre>// client socket listener<br>socket.on(&#39;client socket name&#39;, (string) =&gt; {<br>   <em>/* here is where I would use the data received from one connected<br>      client and display it to this client */</em><br>})</pre><figure><img alt="Client Mary’s msg goes to Server and Server sends Client Mary’s message to Client John and Client David" src="https://cdn-images-1.medium.com/max/1024/1*eSE3k7NWdYIhagyhcW7NnA.png" /></figure><p>Let’s imagine a chat application to solidify what we’ve learned. Mary, John, and David are all using the same chat app. Mary types a message and hits the submit button which triggers an event listener that uses ‘<em>socket.emit</em>’. ‘ s<em>ocket.emit</em>’ takes Mary’s message and triggers the socket event listener on the server. The server socket event listener will then trigger connected client sockets using ‘<em>io.emit</em>’. From there, connected clients will run DOM manipulation that displays Mary’s message to David, John, and Mary’s screens.</p><p>These resources help you use different emit functions:<br><a href="https://stackoverflow.com/questions/32674391/io-emit-vs-socket-emit">https://stackoverflow.com/questions/32674391/io-emit-vs-socket-emit</a><br><a href="https://socket.io/docs/emit-cheatsheet/">https://socket.io/docs/emit-cheatsheet/</a></p><p>See below for my full code and explanations. Feel free to clone these files from my <a href="https://github.com/malinda-lin/socket-tutorial">GitHub Repo</a> and try it out. As always, if you have questions reach out to me on <a href="https://www.linkedin.com/in/malinda-lin/">LinkedIn</a>!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7e346cf4cf7ce66dd64532f2d071c803/href">https://medium.com/media/7e346cf4cf7ce66dd64532f2d071c803/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4342a03126" width="1" height="1" alt=""><hr><p><a href="https://medium.com/weekly-webtips/start-using-socket-io-in-4-minutes-4342a03126">Start Using Socket.io in 4 Minutes</a> was originally published in <a href="https://medium.com/weekly-webtips">Webtips</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Experience In Fullstack Academy’s Grace Hopper Program]]></title>
            <link>https://medium.com/@xqmlin/my-experience-in-fullstack-academys-grace-hopper-program-2e3cb41cc10b?source=rss-d30fe2fd616b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e3cb41cc10b</guid>
            <category><![CDATA[bootcamp-experience]]></category>
            <category><![CDATA[nyc]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[fullstack-academy]]></category>
            <category><![CDATA[codingbootcamp]]></category>
            <dc:creator><![CDATA[Malinda Lin]]></dc:creator>
            <pubDate>Sun, 24 May 2020 19:12:26 GMT</pubDate>
            <atom:updated>2020-05-24T19:19:48.869Z</atom:updated>
            <content:encoded><![CDATA[<h4>The Grace Hopper Program at Fullstack Academy of Code is designed with deferred tuition for women and non-binary.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*s1x5_Qf_1RdOj5jU" /><figcaption>Photo by <a href="https://unsplash.com/@wocintechchat?utm_source=medium&amp;utm_medium=referral">Christina @ wocintechchat.com</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I graduated from this program at the end of March this year and it was a great experience. I am writing this article because I wanted to share my thoughts on the program for others who are interested in applying.</p><p>In this article, I will discuss:</p><ul><li>How I chose the Grace Hopper Program</li><li>How I prepared for the application, assessment, and interview</li><li>How I prepared for the program before it started</li><li>What I gained from completing the program</li></ul><p>You don’t need much prior experience to get into a boot camp and start coding. What you do need is an eagerness to learn and curiosity. I started learning Javascript on FreeCodeCamp and Codecademy in September of last year. I explored these two online resources for a month when my friend suggested that I apply to a coding boot camp. Boot camp would allow me to progress faster by providing me with a structured curriculum, mentors, and a network to jump-start my career. After comparing curriculums and costs for several boot camps, I picked Grace Hopper for two reasons. I liked the deferred tuition model that allows students to pay tuition after they found employment and that the tuition cost was comparable or less expensive than other popular boot camps like General Assembly, App Academy, and Flatiron School. In terms of curriculum, they were all about the same. App Academy also teaches you Ruby as well as javascript, but I preferred to spend my time mastering one language instead of dividing my time between two.</p><p>To be accepted into the program, I needed to complete an online assessment and answer some personal questions with my application. These consisted of a series of short coding challenges and questions about why I would be a good candidate for Grace Hopper. After I submitted the non-technical portion of the application, I took the practice assessment to understand how I needed to prepare. At the time I was super nervous about the online assessment but now I can tell you what you need to do to succeed. You must have a basic knowledge of Javascript (40% or more course completion on CodeAcademy) and be able to solve some coding challenges (7 kyu level katas on CodeWars) within a certain amount of time. I don’t remember exactly how many questions and how much time you’re given for the online assessment. I just prepared until I felt confident and bit the bullet. Prior to the application, I spent my days on CodeWars practicing and timing myself to make sure I could ace the assessment. After Grace Hopper reviewed my application and online assessment, they schedule me for an in-person remote interview which included three more live coding questions. I continued to prepare by working on katas and was feeling pretty good because I had made it that far. On the day of the interview, I answered the first two questions easily but then I was asked to solve a question with recursion. Being completely new to programming, I had not heard of recursion up to that point. The interviewer explained it to me but it was so new and sudden. Needless to say, I did not complete that question on my own, but I was still accepted into the program because I was able to answer the first two questions. They replied to me and from there I had two months before the program start date(January).</p><p>The program started in January, but we were given foundational material to study and checkpoints to complete the December before. In order to prepare for the program in the fullest, I recommend reviewing the materials in-depth to deeply understand work-flow basics like command-line interface(CLI), Git(version control), how to debug, and so much more. As a word of advice, the more exposure you have to coding the better your learning experience at Grace Hopper will be. In addition to the foundational materials, I also completed the Javascript course on Codecademy to make sure I was prepared with everything Javascript related. At the time, I was clicking through the lessons on Codecademy and didn’t have a complete understanding of what I was being asked to do for each prompt. During the program we reviewed the same concepts as Codecademy but in-depth (objects, promises, await-async, and more). That’s when it all came together, it was helpful to have the same concepts explained by different sources.</p><p>The first half of the program was called the junior phase which consisted of live lectures and pair-programming exercises to reinforce the material. We learned how to use Javascript libraries like Express to create RESTful API and React to create single-page applications. Junior phase went by fast and we always felt like we needed to go back and review. But, rest assured, the second half of the program, called the senior phase, put the knowledge we gained to practice. Senior phase consisted of individual and group projects, computer science fundamentals, and technical interview prep called REACTO. Unlike prior cohorts, mine took place during a pandemic. We made the transition to remote lectures and working on group projects remotely, so we didn’t have the advantage of whiteboarding together. We had to take advantage of online applications like Figma, Slack, and the GitHub project board to collaborate. I missed my classmates but I like to think that that was in preparation for any remote jobs in the future.</p><p><strong>My biggest takeaways were making new friendships, learning to collaborate in small groups or as pairs, and gaining a superpower. </strong>The program was tough and moved really fast. I wasn’t given time to procrastinate but, I still learned a lot. Everyone’s experience here will vary but I am sure most of my classmates felt the same. Now my job search journey begins and I will surely update you all on that once I land my first position.</p><p>Feel free to reach out to me on <a href="https://www.linkedin.com/in/malinda-lin/">LinkedIn</a> if you have any questions!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e3cb41cc10b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reverse a Linked List II: Part 2]]></title>
            <link>https://medium.com/journey-to-becoming-an-algoat/reverse-a-linked-list-ii-part-2-ed0b0c376761?source=rss-d30fe2fd616b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed0b0c376761</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[recursion]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[linked-lists]]></category>
            <dc:creator><![CDATA[Malinda Lin]]></dc:creator>
            <pubDate>Sun, 10 May 2020 18:33:23 GMT</pubDate>
            <atom:updated>2020-05-11T17:24:38.359Z</atom:updated>
            <content:encoded><![CDATA[<p>This exercise comes from <a href="https://leetcode.com/problems/reverse-linked-list-ii/solution/">LeetCode</a>, feel free to try it out before reading on!</p><p><em>“You are given a singly linked list and positions m and n. Write a function </em><strong><em>reverseBetween</em></strong><em> to reverse the linked list from position m to n.”</em></p><p><strong><em>Note: </em></strong><em>1 ≤ m ≤ n ≤ length of list</em></p><pre>Example:<br>  input = {3, {5, {1, {6, {7, {2, {<em>null</em>}}}}}}}, <em>m</em> = 2, <em>n</em> = 5<br>  output = {3, {7, {6, {1, {5, {2, {<em>null</em>}}}}}}}</pre><pre>Edge Cases:<br><em>// input is null<br>  </em>input = {} <br>  output = <em>null</em></pre><pre><em>// m &amp; n are equal</em><br>  input = {4, {7, {<em>null</em>}}}, <em>m</em> = 1, <em>n</em> = 1,<br>  output = same as input</pre><pre><em>// m is position 1 which means head will need to be reassigned </em><br>  input = {4, {7, {<em>null</em>}}}, <em>m</em> = 1, <em>n</em> = 2<br>  output = {7, {4, {<em>null</em>}}}</pre><p>In this article, we solved this problem recursively. If you want to see the iterative approach, check out <a href="https://medium.com/@hilaryly">Hilary</a>’s article here: <a href="https://medium.com/journey-to-becoming-an-algoat/reverse-a-linked-list-ii-part-1-d4f1683e5525">Reverse a Linked List II: Part 1</a></p><p>This approach consists of two parts: reversing part of the linked list and connecting the ends of the sublists to the original.</p><p>Let’s talk about how to <strong>reverse an entire linked</strong> list first.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2a5869ce90606dfd0329709e192c3a3f/href">https://medium.com/media/2a5869ce90606dfd0329709e192c3a3f/href</a></iframe><p>In the code above, we traversed the linked list by recursively calling the function with the next node until the next node is null, which is the base case. A variable <em>h</em> is assigned to the last node in the list because the last node needs to become the first node. With each call on the call stack, the head pointer references a different node in the list, in the order we traversed the list. As the calls finish executing and leave the stack, you can imagine it is as if the <em>head</em> pointer is traversing backward. To change the direction of just two nodes (<em>head</em> and <em>head.next</em>), we assigned <em>head.next</em>’s <em>.next</em> property to equal <em>head </em>(Line 6). This is how we made <em>head</em> and <em>head.next</em> point to each other.</p><p>However, this created a loop where two nodes were pointing at each other. We dealt with this by reassigning <em>head</em> to point to null (line 7).</p><p>Here’s a visual to help clarify what line 6 &amp; 7 do:</p><figure><img alt="Visual demonstrating line 6 and 7" src="https://cdn-images-1.medium.com/max/1024/1*VXtLeOcx2vlpdX0Qpe90xA.png" /></figure><p>Now that we understand how to reverse a linked list, we will walk through the solution and how to <strong>connect the reversed sublist to the original list.</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5dfd18e405d5a700025fa9bb046a6495/href">https://medium.com/media/5dfd18e405d5a700025fa9bb046a6495/href</a></iframe><p>Instead of recursively calling the function on the next node, we decremented <em>m</em> and <em>n </em>(Line 9) because the base case is <em>n</em> = 1 (Line 4). When <em>n</em> = 1, we finished traversing and started reversing. We also stored a pointer referencing the node after the <em>nth</em> position (Line 5) because we needed to connect it to the node at the <em>mth</em> position (Line 15). When we reversed the sublist, the <em>mth</em> node became the <em>nth</em> node and vice-versa. Similar to reversing the entire linked list, the head of the reversed sublist was continuously returned (Line 17) until we reached the <em>mth</em> position. Then, we connected the node before the <em>mth</em> position to variable <em>r,</em> the head node of the reversed sublist (Line 21). Finally, we returned <em>head </em>which is the first node of our list to complete the exercise.</p><p>Feel free to comment if you have any questions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed0b0c376761" width="1" height="1" alt=""><hr><p><a href="https://medium.com/journey-to-becoming-an-algoat/reverse-a-linked-list-ii-part-2-ed0b0c376761">Reverse a Linked List II: Part 2</a> was originally published in <a href="https://medium.com/journey-to-becoming-an-algoat">Journey to becoming an Algoat</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>