<?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 Tracy Ho on Medium]]></title>
        <description><![CDATA[Stories by Tracy Ho on Medium]]></description>
        <link>https://medium.com/@tracyho0867?source=rss-3718f1425964------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*DNtCxcVmRwwbVbZh.jpg</url>
            <title>Stories by Tracy Ho on Medium</title>
            <link>https://medium.com/@tracyho0867?source=rss-3718f1425964------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 16:12:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tracyho0867/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[Notes. Setting up Slate with Shopify]]></title>
            <link>https://medium.com/@tracyho0867/notes-setting-up-slate-with-shopify-b9384bb69591?source=rss-3718f1425964------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9384bb69591</guid>
            <category><![CDATA[meh]]></category>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[slate]]></category>
            <category><![CDATA[shopify]]></category>
            <category><![CDATA[mah]]></category>
            <dc:creator><![CDATA[Tracy Ho]]></dc:creator>
            <pubDate>Thu, 17 Oct 2019 15:12:23 GMT</pubDate>
            <atom:updated>2019-10-17T15:12:23.963Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FdWkk5Pn8S6SEbBzGiC%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Flast-week-tonight-with-john-oliver-real-animals-fake-paws-dWkk5Pn8S6SEbBzGiC&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FdWkk5Pn8S6SEbBzGiC%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/67352eabf4c473ef4d35492eec2b93ad/href">https://medium.com/media/67352eabf4c473ef4d35492eec2b93ad/href</a></iframe><p>Create an $touch .env file in your project folder —</p><pre>SLATE_STORE=shop_domain.myshopify.com</pre><pre>SLATE_PASSWORD=(bunch of numbers)</pre><pre>SLATE_THEME_ID=(bunch of numbers)</pre><pre>SLATE_IGNORE_FILES=config/settings_data.json</pre><p>In terminal, open your bash_profile with vs code —</p><pre>$code . ~/.bash_profile</pre><p>Then copy and paste this code to somewhere close to the bottom —</p><pre>function ssl-check() {</pre><pre> f=~/.localhost_ssl;</pre><pre> ssl_crt=$f/server.crt</pre><pre> ssl_key=$f/server.key</pre><pre> b=$(tput bold)</pre><pre> c=$(tput sgr0)</pre><pre> local_ip=$(ipconfig getifaddr $(route get default | grep interface | awk &#39;{print $2}&#39;))</pre><pre> # local_ip=999.999.999 # (uncomment for testing)</pre><pre> domains=(</pre><pre>  &quot;localhost&quot;</pre><pre>  &quot;$local_ip&quot;</pre><pre> )</pre><pre> if [[ ! -f $ssl_crt ]]; then</pre><pre>  echo -e &quot;\n🛑  ${b}Couldn&#39;t find a Slate SSL certificate:${c}&quot;</pre><pre>  make_key=true</pre><pre> elif [[ ! $(openssl x509 -noout -text -in $ssl_crt | grep $local_ip) ]]; then</pre><pre>  echo -e &quot;\n🛑  ${b}Your IP Address has changed:${c}&quot;</pre><pre>  make_key=true</pre><pre> else</pre><pre>  echo -e &quot;\n✅  ${b}Your IP address is still the same.${c}&quot;</pre><pre> fi</pre><pre> if [[ $make_key == true ]]; then</pre><pre>  echo -e &quot;Generating a new Slate SSL certificate...\n&quot;</pre><pre>  count=$(( ${#domains[@]} - 1))</pre><pre>  mkcert ${domains[@]}</pre><pre> # Create Slate&#39;s default certificate directory, if it doesn&#39;t exist</pre><pre>  test ! -d $f &amp;&amp; mkdir $f</pre><pre> # It appears mkcert bases its filenames off the number of domains passed after the first one.</pre><pre> # This script predicts that filename, so it can copy it to Slate&#39;s default location.</pre><pre> if [[ $count = 0 ]]; then</pre><pre>  mv ./localhost.pem $ssl_crt</pre><pre>  mv ./localhost-key.pem $ssl_key</pre><pre> else</pre><pre>  mv ./localhost+$count.pem $ssl_crt</pre><pre>  mv ./localhost+$count-key.pem $ssl_key</pre><pre>  fi</pre><pre> fi</pre><pre>}</pre><p>Back to terminal run —</p><pre>$ssl-check</pre><p>To update your IP address, you have to do this every time whenever, um, you are at a different IP address.</p><p>Then hopefully this should work.</p><pre>$npm run deploy</pre><p>Might need to do ^ first.</p><pre>$npm run watch</pre><p>If watch is messing you up with browser sync, then try —</p><pre>$npm run start</pre><p>Somehow start is doing a better job. Don’t ask my why please ❤</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9384bb69591" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Algo. Javascript. Pascal’s Triangle.]]></title>
            <link>https://medium.com/@tracyho0867/algo-javascript-pascals-triangle-d1c058813256?source=rss-3718f1425964------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1c058813256</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[algo]]></category>
            <dc:creator><![CDATA[Tracy Ho]]></dc:creator>
            <pubDate>Sun, 01 Sep 2019 23:07:44 GMT</pubDate>
            <atom:updated>2019-09-01T23:07:44.052Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FAXorq76Tg3Vte%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fclassic-film-leslie-caron-AXorq76Tg3Vte&amp;image=https%3A%2F%2Fmedia0.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExaWliY2NicGFlOHl6eTBzaXFwbGdjYXQ4bDd1dWJncTVmZW1xNzE2dyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2FAXorq76Tg3Vte%2Fgiphy_s.gif&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/fee0114b1817ebc35d30e5febd92a54a/href">https://medium.com/media/fee0114b1817ebc35d30e5febd92a54a/href</a></iframe><p>Hello people, how’s your day? Let’s Algo 😂</p><p><strong>Description — </strong><br>Given a non-negative integer <em>numRows</em>, generate the first <em>numRows</em> of Pascal’s triangle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/0*n5XO840V_LcIFCrr.gif" /></figure><p>In Pascal’s triangle, each number is the sum of the two numbers directly above it.</p><pre><strong>Example: </strong><br>Input: 5<br>Output:<br>[<br>     [1],<br>    [1,1],<br>   [1,2,1],<br>  [1,3,3,1],<br> [1,4,6,4,1]<br>]</pre><p>Using nested loops probably could brute force it, and I will not do it. <br>Recently I learned how to use closure in Javascript and found that interesting. Closure is a function declared inside a function that can access the variable that declared in the parent function. But right now I’m just using it as a helper function…</p><pre>var generate = function(numRows) {<br>    // we need the base and it will be able to build up<br>    let arr = [[1], [1, 1]];</pre><pre>    // making a helper function to create the next row<br>    function nextRow(nums) {<br>        // the first number is always 1 <br>        let newArr = [1];<br>        <br>        for (let i = 0; i &lt; nums.length - 1; i++) {<br>            newArr.push(nums[i]+nums[i+1]);<br>        };</pre><pre>        // the last number is always 1 <br>        newArr.push(1);<br>        return newArr;<br>    };</pre><pre>    // now we can build up our Pascal&#39;s Triangle<br>    for (let i = 1; i &lt; numRows - 1; i++) {<br>        arr.push(nextRow(arr[i]));<br>    }<br>    <br>    // we can&#39;t just return arr, <br>    //there are some edge cases that&#39;ll create the errors<br>    // if the inputs are 0 and 1 it would retrun [[1], [1, 1]] <br>    // slicing the arr will solve the edge cases <br>    return arr.slice(0, numRows);<br>};</pre><p>I think it ended with still nesting loops with the helper function😅 <br>But this solution was actually a lot faster than the most of the results.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1c058813256" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Algo. Javascript. First Missing Positive.]]></title>
            <link>https://medium.com/@tracyho0867/algo-javascript-first-missing-positive-6ad8a9457b4d?source=rss-3718f1425964------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ad8a9457b4d</guid>
            <category><![CDATA[algo]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Tracy Ho]]></dc:creator>
            <pubDate>Mon, 26 Aug 2019 02:06:04 GMT</pubDate>
            <atom:updated>2019-08-26T02:06:04.357Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FAXorq76Tg3Vte%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fclassic-film-leslie-caron-AXorq76Tg3Vte&amp;image=https%3A%2F%2Fmedia0.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExaWliY2NicGFlOHl6eTBzaXFwbGdjYXQ4bDd1dWJncTVmZW1xNzE2dyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2FAXorq76Tg3Vte%2Fgiphy_s.gif&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/fee0114b1817ebc35d30e5febd92a54a/href">https://medium.com/media/fee0114b1817ebc35d30e5febd92a54a/href</a></iframe><p>Hello people, how’s your day? Let’s Algo 😂</p><p><strong>Description — </strong><br>Given an unsorted integer array, find the smallest missing positive integer.</p><pre><strong>Example 1: </strong><br>Input: [1,2,0]<br>Output: 3</pre><pre><strong>Example 2: <br></strong>Input: [3,4,-1,1]<br>Output: 2</pre><pre><strong>Example 3:<br></strong>Input: [7,8,9,11,12]<br>Output: 1</pre><p>When I see the given input is an array of numbers and we are looking for the smallest or biggest integer, I’d try to sort the array first. Today we are only looking for positive smallest number, I wouldn’t bother using .sort(). We can use object to sort our positive numbers.</p><pre>var firstMissingPositive = function(nums) {<br>    // if input: [1,2,0]<br>    // eliminate the edge case <br>    if (nums.length &lt; 1) {<br>        return 1;<br>    };<br>    <br>    // we can use hash/obj to sort the numbers array<br>    let myHash = {}; <br>    <br>    // we will take off negative numbers when we create myHash<br>    for (let num of nums) {if (num &gt; 0) myHash[num] = true};<br>    <br>    // myHash = { &#39;0&#39;: true, &#39;1&#39;: true, &#39;2&#39;: true }<br>    <br>    // 1 is first positive integer<br>    let missing = 1; <br>    <br>    <br>    for (missing; missing &lt;= nums.length; missing++) {<br>        <br>     // if the [missing key] doesn&#39;t exit, then we return the number<br>        if (!myHash[missing]) {<br>            return missing;<br>        };<br>        <br>        // else we increment 1 then keep looping<br>    };<br>    <br>    // otherwise return 1 <br>    return missing; <br>};</pre><p>This problem is pretty good to practice with using object sorting the positive numbers and look up stuff.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ad8a9457b4d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Algo. Javascript. Daily Temperatures]]></title>
            <link>https://medium.com/@tracyho0867/algo-javascript-daily-temperatures-19fb6b4c6c3f?source=rss-3718f1425964------2</link>
            <guid isPermaLink="false">https://medium.com/p/19fb6b4c6c3f</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[algo]]></category>
            <dc:creator><![CDATA[Tracy Ho]]></dc:creator>
            <pubDate>Mon, 19 Aug 2019 02:49:58 GMT</pubDate>
            <atom:updated>2019-08-19T03:19:17.914Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FAXorq76Tg3Vte%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fclassic-film-leslie-caron-AXorq76Tg3Vte&amp;image=https%3A%2F%2Fmedia0.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExaWliY2NicGFlOHl6eTBzaXFwbGdjYXQ4bDd1dWJncTVmZW1xNzE2dyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2FAXorq76Tg3Vte%2Fgiphy_s.gif&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/fee0114b1817ebc35d30e5febd92a54a/href">https://medium.com/media/fee0114b1817ebc35d30e5febd92a54a/href</a></iframe><p>Hello people, how’s your day? Let’s Algo 😂</p><p>I am also trying to find that topics aren’t that boring. <br>In what situation you’d want to know how many days from now the weather would be warmer? We don’t know. But let’s still find this out!</p><p><strong>Description — </strong><br>Given a list of daily temperatures T, return a list such that, for each day in the input, tells you how many days you would have to wait until a warmer temperature. If there is no future day for which this is possible, put 0 instead.</p><p><strong>Note:</strong> The length of temperatures will be in the range [1, 30000]. Each temperature will be an integer in the range [30, 100].</p><pre><strong>Example 1: </strong><br>Input = [73, 74, 75, 71, 69, 72, 76, 73]<br>Output = [1, 1, 4, 2, 1, 1, 0, 0]</pre><p>We will always want to solve this problem first even it is brute forcing it:</p><pre>var dailyTemperatures = function(T) {</pre><pre>    // learned this is the faster way to create an array <br>    let arr = new Array(T.length).fill(0)<br>    // nested loops, two-point<br>    for (let i = 0; i &lt; T.length - 1; i++) { <br>        const currentDay = T[i] <br>        for (let j = i+1; j &lt; T.length; j++) {<br>            // we are looking for if the closet element is bigger <br>            // then the currentDay, if so then we break this loop<br>            // otherwise we don&#39;t change<br>        if (currentDay &lt; T[j]) {<br>                arr[i] = j-i<br>                break;<br>            } <br>        }<br>    };</pre><pre>    return arr; <br>};</pre><pre>var dailyTemperatures = function(T) {<br>    let arr = new Array(T.length).fill(0); <br>    let stack = [];</pre><pre>    for (let i = 0; i &lt; T.length; i++) {<br>        <br>        while (stack.length &gt; 0 &amp;&amp; T[i] &gt; T[stack[stack.length-1]]){<br>            let index = stack.pop();<br>            arr[index] = i - index;<br>        }<br>        stack.push(i);<br>    }<br>    return arr;<br>};</pre><pre>// Input = [73, 74, 75, 71, 69, 72, 76, 73]</pre><pre>// first loop: stack = []<br>// stack.length === 0</pre><pre>// second loop: stack = [0], i = 1<br>// stack.length = 1 &amp;&amp; 74 &gt; 73<br>// index = 0<br>// arr[0] = 1 - 0</pre><pre>// third loop: stack = [1], i = 2<br>// stack.length = 1 &amp;&amp; 75 &gt; 74<br>// index = 1<br>// arr[1] = 2 - 1</pre><pre>// fourth loop: stack = [2], i = 3<br>// stack.length = 1 &amp;&amp; 71 &gt; 75 </pre><pre>// fifth loop: stack = [2, 3], i = 4<br>// stack.length = 2 &amp;&amp; 69 &gt; 71</pre><pre>//...keep going</pre><p>This way is a bit complicated but it is a lot faster than the first one!</p><p>Let me know if you have a faster way!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19fb6b4c6c3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Algo. Javascript. Valid Parentheses]]></title>
            <link>https://medium.com/@tracyho0867/algo-javascript-valid-parentheses-7a54e4b1fd3e?source=rss-3718f1425964------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a54e4b1fd3e</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[algo]]></category>
            <dc:creator><![CDATA[Tracy Ho]]></dc:creator>
            <pubDate>Sun, 11 Aug 2019 22:43:04 GMT</pubDate>
            <atom:updated>2019-08-11T22:43:04.881Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FAXorq76Tg3Vte%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FAXorq76Tg3Vte%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia1.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExZnQ0cWJ4NG9vOHA5Z2p6bjAxY29sMjVybWJzaGFwdnBmZ2Jha2hyeSZlcD12MV9naWZzX2dpZklkJmN0PWc%2FAXorq76Tg3Vte%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/eadb1cadc3d6a05b2b6c63dbcf4f0d77/href">https://medium.com/media/eadb1cadc3d6a05b2b6c63dbcf4f0d77/href</a></iframe><p>Hello people, how’s your day? Let’s Algo 😂</p><p><strong>Description — </strong><br>Given a string containing just the characters &#39;(&#39;, &#39;)&#39;, &#39;{&#39;, &#39;}&#39;, &#39;[&#39; and &#39;]&#39;, determine if the input string is valid.</p><p>An input string is valid if:<br>1. Open brackets must be closed by the same type of brackets.<br>2. Open brackets must be closed in the correct order.</p><p>Note that an empty string is also considered valid.</p><pre><strong>Example 1: </strong><br>Input: &quot;()&quot;<br>Output: true</pre><pre><strong>Example 2: <br></strong>Input: &quot;()[]{}&quot;<br>Output: true</pre><pre><strong>Example 3: </strong><br>Input: &quot;(]&quot;<br>Output: false</pre><pre><strong>Example 4: </strong><br>Input: &quot;([)]&quot;<br>Output: false</pre><pre><strong>Example 5: </strong><br>Input: &quot;{[]}&quot;<br>Output: true</pre><p>I’ve thought about using array of parentheses. But let’s use object.</p><pre>var isValid = function(s) {<br>    const chars = {<br>       &quot;)&quot;: &quot;(&quot;,<br>       &quot;}&quot;: &quot;{&quot;, <br>       &quot;]&quot;: &quot;[&quot;<br>    };</pre><pre>    // create a new array to keep track of the parentheses <br>    let arr = [];</pre><pre>    for (let i = 0; i &lt; s.length; i++) {<br>        <br>        const currentBracket = chars[s[i]];<br>        <br>        if (!currentBracket) {<br>            arr.push(s[i]);<br>        } else if (currentBracket !== arr.pop()) {<br>            return false<br>        }<br>    };</pre><pre>    return arr.length === 0;<br>};</pre><pre>// if input = &quot;()[]{}&quot;</pre><pre>// in for a loop<br>// currentBracket = chars[&quot;(&quot;] which is undefined<br>// we push it into arr = [ &quot;(&quot; ]</pre><pre>// next element currentBracket = chars[&quot;)&quot;] which is true <br>// then we arr.pop() to remove the last element. arr = []</pre><pre>// the next two pairs should work the same way </pre><pre>// after the whole loop, if there is nothing in the arr, return should be true </pre><pre><strong>// another example: </strong><br>// if input = &quot;(]&quot;</pre><pre>// first currentBracket = chars[&quot;(&quot;] which is undefined<br>// we push it into arr = [ &quot;(&quot; ]</pre><pre>// next currentBracket = chars[&quot;]&quot;] = &quot;[&quot;<br>// we goes to else if &quot;[&quot; is equal to arr.pop() which is &quot;(&quot;<br>// then we break the loop, return false <br>// this is not a valid parentheses</pre><p>This is the fastest way I can think of! Please let me know if you can optimized it even better.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a54e4b1fd3e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Algo. Javascript. Single Element in a Sorted Array]]></title>
            <link>https://medium.com/@tracyho0867/algo-javascript-single-element-in-a-sorted-array-a3839af060b2?source=rss-3718f1425964------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3839af060b2</guid>
            <category><![CDATA[algo]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Tracy Ho]]></dc:creator>
            <pubDate>Sun, 04 Aug 2019 19:57:43 GMT</pubDate>
            <atom:updated>2019-08-04T19:58:52.975Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FAXorq76Tg3Vte%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FAXorq76Tg3Vte%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia1.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExZnQ0cWJ4NG9vOHA5Z2p6bjAxY29sMjVybWJzaGFwdnBmZ2Jha2hyeSZlcD12MV9naWZzX2dpZklkJmN0PWc%2FAXorq76Tg3Vte%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/eadb1cadc3d6a05b2b6c63dbcf4f0d77/href">https://medium.com/media/eadb1cadc3d6a05b2b6c63dbcf4f0d77/href</a></iframe><p><strong>Description — </strong><br>Given a sorted array consisting of only integers where every element appears exactly twice except for one element which appears exactly once. Find this single element that appears only once.</p><pre><strong>Example 1: </strong><br>Input: [1, 1, 2, 2, 3, 4, 4, 8, 8]<br>Output: 3</pre><pre><strong>Example 2:</strong><br>Input: [0, 0, 3, 3, 5, 5, 9, 9, 10, 12, 12]<br>Output: 10</pre><p>My first approach was trying to use object. Using object could eliminate the case if the array wasn’t sorted.</p><pre>var singleNonDuplicate = function(nums) { <br>    let numsObj = {};</pre><pre>// using a for loop to count how many times each number <br>   // occurs in nums array.<br>   // key is the number, value is the count of the number.<br>   for (let i = 0; i &lt; nums.length; i++) {<br>        numsObj[nums[i]] = numsObj[nums[i]] + 1 || 1;<br>    };</pre><pre>// iterate through numsObj keys to find the count that is 1.<br>    for (let key in numsObj) {<br>        if (numsObj[key] === 1) {<br>            return key; <br>        };<br>    };<br>};</pre><p>This solution has two for loops which costs 2 O(n).</p><p>Since the question already told us that this was a <strong>sorted array</strong> and each number only has maxim one duplicate. With these conditions, we can simply just use one loop.</p><pre>var singleNonDuplicate = function(nums) { <br>    for (let i = 0; i &lt; nums.length; i += 2) {<br>       if (nums[i+1] !== nums[i] &amp;&amp; nums[i-1] !== nums[i]){<br>            return nums[i]<br>       }<br>    }<br>}</pre><pre>// if input = [1, 1, 2, 2, 3, 4, 4, 8, 8]</pre><pre>// i = 0<br>// in nums array, index[0] = 1, index[0+1] = 1<br>// this is not satisfying the condition, we go to the next round<br>// i = i + 2</pre><pre>// i = 2<br>// in nums array, index[2-1] = 1, index[2] = 2, index[2+1] = 2<br>// this is still not pass the condition, i = i + 2</pre><pre>// i = 4<br>// in nums array, index[4-1] = 2, index[4] = 3, index[4+1] = 4<br>// the iteration now breaks, return 3</pre><p>This one is going to be only O(n) which is still faster.</p><p>Comment below if you have any questions!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3839af060b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Day I Had to Experience Sexual Harassment at a Workplace]]></title>
            <link>https://medium.com/@tracyho0867/the-day-i-had-to-experience-sexual-harassment-at-a-workplace-4a9941606ad9?source=rss-3718f1425964------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a9941606ad9</guid>
            <category><![CDATA[feminism]]></category>
            <category><![CDATA[meh]]></category>
            <category><![CDATA[non-technical]]></category>
            <category><![CDATA[mah]]></category>
            <category><![CDATA[sexual-harassment]]></category>
            <dc:creator><![CDATA[Tracy Ho]]></dc:creator>
            <pubDate>Tue, 16 Apr 2019 15:35:06 GMT</pubDate>
            <atom:updated>2019-04-16T16:49:19.120Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FrFYfC7H1CHwGI%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fpresident-united-states-rFYfC7H1CHwGI&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FrFYfC7H1CHwGI%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="243" frameborder="0" scrolling="no"><a href="https://medium.com/media/6465fee78cca5546ade07028b97f65c5/href">https://medium.com/media/6465fee78cca5546ade07028b97f65c5/href</a></iframe><p>My experience with sexual harassment might not have been the worst, and I believed people would think it is not a big deal. At the time I totally agreed!</p><p>Have you ever experienced sexual harassment? What about it is going to change a person? I have and I did not know I was being harassed. All I felt was shock, confusion, helplessness, and sadness.</p><p>It happened at my last full-time job. They hired a guy about one to two months before my last day. I gave him friendly greetings and chatted with him like I would with everyone else in the company. We also used a messaging app to communicate easily.</p><p>At work, he would intentionally stand close to my table or right next to me while talking to customers even there was PLENTY of space. It was very uncomfortable. I would slowly move myself away but I could not go too far because that was my table!!</p><p>Over the weekend, he started to message me privately, asking me personal questions. It was not a big deal, I chose not to answer then. He would ask me if I liked a certain type of food and said we “should” have dinner sometime together. I replied that I had plans already.</p><p>I’d like to mention that it was over the weekend, we were not at work, it was not my responsibility to reply to him ASAP. He started to “complain” that I did not reply to him quick enough and that I didn’t care about him.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3otWpBdYbUqGsefUUE%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fjulesm-funny-dance-3otWpBdYbUqGsefUUE&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3otWpBdYbUqGsefUUE%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/edc5118b51dfd23ee3df582db3e7e914/href">https://medium.com/media/edc5118b51dfd23ee3df582db3e7e914/href</a></iframe><p>To be honest, those conversations started making me feel really really really uncomfortable. I stopped replying. The next day at work, this guy would not even look at me, and gave me attitude. However, since we were at work and these were personal issues, I still treated him like my other colleagues. I tried to professional.</p><p>As he was new to our office, if he did something wrong, I had to let the department know so they could work together. FYI, the manager of his department was new too so I was not sure who did the thing wrong most of the time.</p><p>Him ignoring me went on for about a month or two. It wasn’t that big of a deal, as long as the guy could still work professionally. A couple days before I left the company, I sent him a message to let him know he did something wrong. Suddenly, he started yelling at me, accusing I was picking on him.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FNMufrvxO8fC3C%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fdog-shocked-NMufrvxO8fC3C&amp;image=https%3A%2F%2Fmedia3.giphy.com%2Fmedia%2FNMufrvxO8fC3C%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="413" frameborder="0" scrolling="no"><a href="https://medium.com/media/1418c76aa1ecb823e618916648a70b4d/href">https://medium.com/media/1418c76aa1ecb823e618916648a70b4d/href</a></iframe><p>I was calm and explained to him how to get work done. I let him know that if he did not fix his little mistakes then he would not be working as well as he could be. All the messages I sent to the department were written with correct and polite English (this part I asked many friends who were managers what they would think, and they all agreed nothing wrong with what I said). After this he still kept yelling. I stayed calm and asked him why he was giving me attitude. Was it because I didn’t respond to him about going out to dinner and he felt rejected?</p><p>The yelling continued and was even louder, and he walked toward to me like this guy:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fl0MYwbfqbCrxtFaMg%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Ffistfightmovie-film-comedy-l0MYwbfqbCrxtFaMg&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl0MYwbfqbCrxtFaMg%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/b36e83e392cb23fb13b8e261a7bbe10d/href">https://medium.com/media/b36e83e392cb23fb13b8e261a7bbe10d/href</a></iframe><p>I felt threatened. I thought he was going to hurt me. Where was our manager? He was off to the side watching the whole thing until now. What did he do to help this situation? All he did was bring the guy back to his office, close the door, then proceeded to laugh and chat with the guy like nothing happened. I realized at that moment, I was helpless. No one would help me. I cried and didn’t know what to do, no one else at the company understood that this was sexual harassment. Neither did I.</p><p>Why am I sharing this? I did not get touched, I did not get raped, what was the big deal? What I can say for sure is that it had a big effect on me. Every time I think about what happened, and even though I understand I should not be upset over a shitty person, I cannot help myself but tearing up. What’s wrong with me? How come I could not be a better person and move on? Why?</p><p>I learned. None of this was my fault. It was the guy, and people were indifferent. They didn’t acknowledge that sexual harassment happened. Usually I would appreciate any experiences in my life, but there’s nothing to appreciate from this one. I was traumatized. When I sit alone and think of what happened, I start to tear up. But I don’t want to cry for what a stupid person did.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FVoRnF8sxWuTLO%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fpout-VoRnF8sxWuTLO&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FVoRnF8sxWuTLO%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="290" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3d6074da2ac8c6a0f311d7ee907d930/href">https://medium.com/media/a3d6074da2ac8c6a0f311d7ee907d930/href</a></iframe><p>Please, people out there, if you have been sexually harassed at work, even by a tiny little move or words, fight back! Everything is a big deal. People around victims, please be their allies. Don’t let them feel helpless like I did.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a9941606ad9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with PixiJs]]></title>
            <link>https://medium.com/@tracyho0867/getting-started-with-pixijs-af7e4e5124b8?source=rss-3718f1425964------2</link>
            <guid isPermaLink="false">https://medium.com/p/af7e4e5124b8</guid>
            <category><![CDATA[mah]]></category>
            <category><![CDATA[dontaskeme]]></category>
            <category><![CDATA[pixijs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Tracy Ho]]></dc:creator>
            <pubDate>Mon, 25 Mar 2019 13:29:11 GMT</pubDate>
            <atom:updated>2019-03-25T13:32:15.677Z</atom:updated>
            <content:encoded><![CDATA[<p>Is it hard to start a new thing? Need a hand?</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fo6Hc5c9O387Nm%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fo6Hc5c9O387Nm%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fo6Hc5c9O387Nm%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="304" frameborder="0" scrolling="no"><a href="https://medium.com/media/c6f421ce67a29e3c5f137e6a1895b749/href">https://medium.com/media/c6f421ce67a29e3c5f137e6a1895b749/href</a></iframe><p>When you want to build a web game, there are too many libraries to choose from and do not know where to start. That is me big problem. I’d like to share the process I had been through with <a href="http://www.pixijs.com/"><strong>PixiJS</strong></a>, and will make the steps as easy as possible to follow!</p><p><strong>Step 1</strong>: download pixi.js file from <a href="https://github.com/pixijs/pixi.js">https://github.com/pixijs/pixi.js</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*umi_7q4MxgSjbHxHomhkmQ.png" /><figcaption><strong>Go to releases</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u0zpkr-Bby9fqWb5P-790Q.png" /><figcaption><strong>Scroll down to Assets, I downloaded that one</strong></figcaption></figure><p><strong>Step 2:</strong> Create your game directory then drag pixi.js into it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*NXhg5WDq74uC_pCY5cEN5g.png" /><figcaption>This is my little moving Skeleton “game” directory set up</figcaption></figure><p><strong>Step 3</strong>: Add below code into index.html</p><pre>&lt;body&gt;<br>  &lt;div id=&quot;display&quot;&gt;<br>  &lt;/div&gt;<br>  &lt;script src=&quot;pixi.js&quot;&gt;&lt;/script&gt;<br>  &lt;script type=&quot;text/javascript&quot; src=&quot;app.js&quot;&gt;&lt;/script&gt;<br>&lt;/body&gt;</pre><p>Then type in below code (line1 is find) for making sure PixiJS is running.</p><pre>PIXI.utils.sayHello();</pre><p>Now let’s run the server. If you are using Chrome, which is I am, you will have to set up a local file hosting. Dragging html file to Chrome browser it can’t read the image files, you would just see a black rectangle.</p><p>In terminal type: <br>$ npm install -g http-server <br>Then make sure you are in the right directory of your game in terminal, type: <br>$ http-server <br>Localhost should start running, copy and paste one of the link to your browser then you can start testing your code in web console. You should see this in the console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HKxeuCIwQ5Q_SvGKUoCm_A.png" /></figure><p>Sometimes http-server does not run pixi smoothly, you would need to hard fresh in order to update the There’s another server hosting called <a href="https://www.mamp.info/en/">Mamp</a> you may try. Google it!</p><p>Alright! The environment set up should be good. Let’s move on to the actually coding.</p><p>In <strong>style.css</strong>: <br>You can set up which ever style you want, these just giving you a quick start.</p><pre>body {<br>  height: 90vh;<br>  display: flex;<br>  justify-content: center;<br>  align-items: center;<br>}</pre><pre>#display&gt;* {<br>  border: 1px dashed black;<br>}</pre><p>In <strong>index.html</strong>: <br>Remember the code we typed in Step 3? Here’s full page of it.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;<br>  &lt;head&gt;<br>    &lt;meta charset=&quot;utf-8&quot;&gt;<br>    &lt;title&gt;PixiJs&lt;/title&gt;<br>    &lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot;&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>    &lt;div id=&quot;display&quot;&gt;</pre><pre>    &lt;/div&gt;<br>    &lt;script src=&quot;pixi.js&quot;&gt;&lt;/script&gt;<br>    &lt;script type=&quot;text/javascript&quot; src=&quot;app.js&quot;&gt;&lt;/script&gt;<br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><p>Now let’s start the actual coding in our <strong>app.js </strong>file:</p><pre>PIXI.utils.sayHello(); // the code from Step 3, you can leave it</pre><pre>// create a canvas for all of your game elements</pre><pre>const renderer = PIXI.autoDetectRenderer(512, 512, {<br>  transparent: true,<br>  resolution: 1<br>});<br>const displayDiv = document.querySelector(&#39;#display&#39;)<br>displayDiv.appendChild(renderer.view);</pre><pre>const stage = new PIXI.Container();</pre><p>You should see a canvas area in element page and stage set up for pixi.</p><p>Now we need an image file, spritesheet, for our animated skeleton. I found this one on <a href="https://opengameart.org/">OpenGameArt.org</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*puWtKzqb_S1Tv9zjALygdQ.png" /><figcaption>spritesheet from <a href="https://opengameart.org/content/lpc-medieval-fantasy-character-sprites">https://opengameart.org/content/lpc-medieval-fantasy-character-sprites</a></figcaption></figure><pre>// lets continue our code</pre><pre>// load the spritesheet, first arg could name anything you want<br>// second arg will be the path of the png file<br>PIXI.loader<br>  .add(&quot;spritesheet&quot;, &quot;images/BODY_skeleton.png&quot;)<br>  .load(setup);</pre><pre>var sprite; // given a global variable, we will be using it </pre><pre>function setup() {<br>  stage.interactive = true;</pre><pre>  // set a rectangle frame for skeleton spritesheet <br>  // (x, y, height, width)<br>  const rect = new PIXI.Rectangle(0, 0, 64, 64);</pre><pre>  const texture = PIXI.loader.resources[&quot;spritesheet&quot;].texture;</pre><pre>  texture.frame = rect;</pre><pre>  sprite = new PIXI.Sprite(texture);</pre><pre>  // setInterval to actual animate the sprite<br>  const idle = setInterval(function() {<br>    if (rect.x &gt;= 64 * 4) rect.x = 0;<br>    sprite.texture.frame = rect;<br>    rect.x += 64;<br>  }, 500);</pre><pre>  // highly recommend to use scale to change frame size<br>  sprite.scale.set(2, 2); </pre><pre>  // these two lines are for eventlistener later<br>  sprite.vx = 10;<br>  sprite.vy = 10;</pre><pre>  stage.addChild(sprite); // add sprite to stage area</pre><pre>  animationLoop(); // from below helper function<br>}</pre><pre>// helper function <br>function animationLoop() {</pre><pre>  // a function from Pixi<br>  requestAnimationFrame(animationLoop);</pre><pre>  renderer.render(stage);<br>};</pre><p>HARD REFRESH with command + shift + R the browser then you should see a skeleton animated. Let’s make him “walk” around with arrow keys.</p><pre>window.addEventListener(&#39;keydown&#39;, event =&gt; {<br>  if (event.key === &#39;ArrowRight&#39; &amp;&amp; sprite.x &lt; 650) {<br>    sprite.x += sprite.vx<br>  } else if (event.key === &#39;ArrowLeft&#39; &amp;&amp; sprite.x &gt; 0) {<br>    sprite.x -= sprite.vx<br>  } else if (event.key === &#39;ArrowDown&#39; &amp;&amp; sprite.y &lt; 450) {<br>    sprite.y += sprite.vy<br>  } else if (event.key === &#39;ArrowUp&#39; &amp;&amp; sprite.y &gt; 0) {<br>    sprite.y -= sprite.vy<br>  }<br>})</pre><p>Now you can move it around within the stage with those if statements. Isn’t it fun? It’s actually not fun enough. I wanted to make it face to correct directions when pressing different arrow keys…</p><p>Hope this article can give you an easy start with PixiJS. Please share your thought with me and if the steps you followed didn’t work, let me know! I will update my article!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3ohzdRoOp1FUYbtGDu%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3ohzdRoOp1FUYbtGDu%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F3ohzdRoOp1FUYbtGDu%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/ed3a7c622ff42a4c2e8967687481a840/href">https://medium.com/media/ed3a7c622ff42a4c2e8967687481a840/href</a></iframe><p>Ahhhh I forgot resources:</p><p><a href="https://www.youtube.com/watch?v=zhybw6rE_QU">https://www.youtube.com/watch?v=zhybw6rE_QU</a><br><a href="http://www.pixijs.com/">http://www.pixijs.com/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af7e4e5124b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[About Javascript…]]></title>
            <link>https://medium.com/@tracyho0867/about-javascript-972d7469c264?source=rss-3718f1425964------2</link>
            <guid isPermaLink="false">https://medium.com/p/972d7469c264</guid>
            <category><![CDATA[badathistory]]></category>
            <category><![CDATA[meh]]></category>
            <category><![CDATA[mah]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Tracy Ho]]></dc:creator>
            <pubDate>Tue, 12 Mar 2019 03:12:11 GMT</pubDate>
            <atom:updated>2019-03-12T03:12:11.005Z</atom:updated>
            <content:encoded><![CDATA[<p>A simple history of Javascript from a person who’s terrible at history and trying the best to make this work, please bare with me and welcome to leave comments to correct anything.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F113RhN1oBm1yCc%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F113RhN1oBm1yCc%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F113RhN1oBm1yCc%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="245" frameborder="0" scrolling="no"><a href="https://medium.com/media/14f30147043331c03c8d1912d1b3fabc/href">https://medium.com/media/14f30147043331c03c8d1912d1b3fabc/href</a></iframe><p>Javascript often abbreviated as JS, is a high-level programming language that conforms to the ECMAScript specification(same thing). Javascript is one of the core technologies of World Wide Web. The majority of websites and major web browsers use it such as google chrome.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*DnN9p2voRwOpK7inzGHKcw.jpeg" /></figure><p>In 1993, the NCSA, National Center for Supercomputing Applications released <strong>NCSA Mosaic</strong>. It was the first popular graphical Web browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/0*7xaVGD4ufjV2N0fp.png" /></figure><p>In 1994, Mosaic Communications created <strong>Mosaic Netscape</strong> by many original authors of NSCA Mosaic. Even so, they did not share code with the previous NCSA Mosaic intentionally. In late 1994, Mosaic Netscape 9.0 was released. Within four months, it took over three-quarters of the browser markets, became the main web browser in 1990s. In same year, 1994, they changed the name to <strong>Netscape Navigator</strong>, and renamed the company to Netscape Communications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/0*k43MB5hNB3IJR7q9.jpg" /></figure><p>In 1995, <strong>Netscape Communications</strong> recruited <em>Brendan Eich </em>with the purpose of embedding a programming language in to the browser. <em>Marc Andreessen</em>, the founder of the company, believed that the web needed a small scripting language that could interact with the DOM and could be easy used by Web designers and part-time programmer, to make it more accessible and dynamic to non-programmers. <em>Brendan Eich</em> wrote <strong>Mocha</strong> in ten days in April. It had the functionality of Scheme, the object orientation of Self, and the syntax of Java. Then the language was renamed <strong>LiveScript</strong> when it was officially released of Netscape Navigator 2.0 in September. However, it was renamed <strong>JavaScript</strong> when it was deployed in the Netscape Navigator 2.0 beta 3 in December.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FyidUzsMUAo6S3DyrkY%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FyidUzsMUAo6S3DyrkY%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FyidUzsMUAo6S3DyrkY%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="182" frameborder="0" scrolling="no"><a href="https://medium.com/media/503a2ceb872f8f7144b3d18a9f7b408b/href">https://medium.com/media/503a2ceb872f8f7144b3d18a9f7b408b/href</a></iframe><p>However, JavaScript was untouched until recent years. The first update was in 2005 when Google Maps launched. By using Javascript, the map was much better then old ones. Instead of refreshing the whole page every time dragging the map, it smoothly update, interact with it like a desktop application or a game.</p><blockquote>Since then, they began to improve Javascript and developed tools such as Node.js and JQuery. By 2010, Javascript frameworks were released. Frameworks allow developers to code more easily by encouraging specific practices and including useful libraries. In 2010, Google released the AngularJS framework, and today it is used by 10,000 companies including PayPal and Youtube. In 2013, Facebook released React, which today is used by companies like Netflix, Yahoo!, and Khan Academy. Additional frameworks like React Native allow developers to build professional grade Android and iPhone apps with Javascript.</blockquote><p>(Above was referenced from a school lecture, could not find a better way. )</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FtV0HkQju9zHR6%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FtV0HkQju9zHR6%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FtV0HkQju9zHR6%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="326" frameborder="0" scrolling="no"><a href="https://medium.com/media/14cafdaf431aa29a710a48c6e540be4a/href">https://medium.com/media/14cafdaf431aa29a710a48c6e540be4a/href</a></iframe><blockquote><a href="https://medium.com/@benastontweet/lesson-1a-the-history-of-javascript-8c1ce3bffb17">The huge companies that dominate the technical landscape have repeatedly tried to supplant JavaScript. First Sun, then Microsoft (VBScript), then Adobe, then Microsoft again (Silverlight), then Google, and then, arguably with TypeScript, Microsoft yet again. And yet JavaScript continues to thrive.</a></blockquote><p>What a history and a journey for a programming language. While I was digging into it, there were tons of terms for programming languages that I did not know about, and still do not understand them. But Javascript survived. This already convinced me how important it is. And it is still mostly common used language.</p><p>Little note: Some companies were built before 2015, there was only var to set a variable. Yet it is difficult for them do update the version, they would need to rewrite whole structure.</p><p>I’ve tried my best, hope you guys learn a little today! If not, there’s google!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3ohzdRoOp1FUYbtGDu%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3ohzdRoOp1FUYbtGDu%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F3ohzdRoOp1FUYbtGDu%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/ed3a7c622ff42a4c2e8967687481a840/href">https://medium.com/media/ed3a7c622ff42a4c2e8967687481a840/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=972d7469c264" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Going to the Backend??]]></title>
            <link>https://medium.com/@tracyho0867/going-to-the-backend-1275f1685bd5?source=rss-3718f1425964------2</link>
            <guid isPermaLink="false">https://medium.com/p/1275f1685bd5</guid>
            <category><![CDATA[newbie]]></category>
            <category><![CDATA[programmers-life]]></category>
            <category><![CDATA[mah]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[noob]]></category>
            <dc:creator><![CDATA[Tracy Ho]]></dc:creator>
            <pubDate>Tue, 26 Feb 2019 06:47:08 GMT</pubDate>
            <atom:updated>2019-08-04T20:00:55.301Z</atom:updated>
            <content:encoded><![CDATA[<h3>If You Know Nothing About Coding</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*ychQhPI7bL6Yp-Ii4dnSBQ.gif" /></figure><p>If you don’t know anything about coding but somehow want to learn it, or try it out because the salary growth just so attempting, yes we all need money, and you want to make sure you will be ok with it, here is my personal road to code experiences and some useful stuff you will need for going through this scary and exited journey.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*V5k7BJLMSP6fhpWFitdpVQ.gif" /></figure><p>The first thing is you need to learn is<strong> Command Line Interface </strong>(CLI). CLI is a way of interacting with your computer, and you will be using it all the time. It may look complicated at first, trust me, it really isn’t. Still, there are a lot of commands and I do not remember. Don’t worry about it, google is your best friend. Here are some simple commands you can try out. Oh please simply press ⌘ + Space then search Terminal, then press Enter to launch it. <br>$pwd this will show you the path of your current directory. <br>$ls will list/show all the files in the directory, not include the hidden files.<br>After you see the list, find a directory type in $cd directory_name then it will take you to the folder. And that’s it for now! The rest you can google them up!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*WY7ELhXIVxbGlUwmhA1PSw.jpeg" /></figure><p>Once you have ideas about CLI, here comes <strong>Git</strong>, which you will be performing in Terminal too. Along the way learning code, highly recommend you to get used to GitHub, store all of your code in a repository, good ones and bad ones. Here’s a great article about why you need it:</p><p><a href="https://www.howtogeek.com/180167/htg-explains-what-is-github-and-what-do-geeks-use-it-for/">What Is GitHub, and What Is It Used For?</a></p><p>Create an account on GitHub and look it up how to do all the commands in Terminal. Basically you would do all the commands with starting of $git.<br>And once you know how, remember commit as much as you can.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*vtluS2pH9xQeYIApu8o0Rg.gif" /></figure><p>Which <strong>Programming Language</strong> should I start with? I literally had no idea when I started it. Most of people would suggest javascript which is a great choice. Probably the most popular one. What about Ruby? Python? Honestly, all the languages are connected in some way. If you master one, it will not be difficult for you to learn another one. But but but you really have no clue…… unless you want to self taught all the way, here’s an easy way to figure it out. Go find a bootcamp that you like and checkout their alumni. See what languages they are teaching, start with that! Most of them have great materials for you to study. If you are only comparing Ruby and Javascript, check out Flatiron School for Ruby, Fullstack Academy for Javascript.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*0dQ_d9c8NTdd1bwz-L4NYQ.gif" /></figure><p>Here are some tips when you code. Making it a good habit, always use <strong>camel case</strong> whenever you code and create filenames. If you don’t know what is that, google it! Also know a little about <strong>Style Guide</strong>, base on companies, the style will be different. You don’t need to worry about this too much for now as a beginner. Code as ugly as you can to solve the problem. When you have time remember to come back to make them more readable and pretty, this will help your future team work. Also when you code, explain to yourself why use this code, how this code works here. Not just for school, for job interview there will be scary technical interviews. Oops, spoil too much. Please don’t be sacred. And these are just tiny tiny pieces of the whole picture.</p><p>Once you are on the road, you will be defeated many times. You will stuck there for a while. Don’t look down, look up and take a break. Everyone can become a software engineer, it’s matter of the time and how much effort you put in. It is not easy, it’s the most difficult thing I’ve ever done in my life (except relationship). And I am not done yet…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*5klQp_ZUPaP9_u0EDRfdMA.gif" /></figure><p>However, I love love efficiency. This is one of the reason I started coding. When you make your code linear, it optimize processing which is an amazing. I will try to write a blog about it.</p><p>Here I want to thank my friend, Andrew Huang a software engineer at a cyber security company. He gave me this “lecture” to get me started (his lecture is way better than this blog). There were many times I felt stupid and horrible, he told me that I was definitely not. He is one of the people support me through this endless journey. I’m glad that I never give up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*aSrgeYX772WcEM1v92Jdmg.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1275f1685bd5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>