<?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 Jordan Martin on Medium]]></title>
        <description><![CDATA[Stories by Jordan Martin on Medium]]></description>
        <link>https://medium.com/@jordanmmartin?source=rss-3c4ac0c724d3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0633giSx-dAQgKyUdeRXVA.jpeg</url>
            <title>Stories by Jordan Martin on Medium</title>
            <link>https://medium.com/@jordanmmartin?source=rss-3c4ac0c724d3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 12:52:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jordanmmartin/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[What I Learned From My First Hackathon]]></title>
            <link>https://medium.com/@jordanmmartin/what-i-learned-from-my-first-hackathon-47d54673bf53?source=rss-3c4ac0c724d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/47d54673bf53</guid>
            <category><![CDATA[health-technology]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[blockstack]]></category>
            <category><![CDATA[hackathons]]></category>
            <dc:creator><![CDATA[Jordan Martin]]></dc:creator>
            <pubDate>Wed, 17 Apr 2019 03:52:38 GMT</pubDate>
            <atom:updated>2019-04-17T06:05:18.043Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ibnfzRqKjE7XC3iXJ_oaA.jpeg" /><figcaption>Courtesy of Unsplashed</figcaption></figure><p>This past weekend I participated in my first ever Hackathon. It was hosted by the coding boot camp I attended, <a href="https://medium.com/u/973c5cbfb09b">Flatiron School</a>’s <a href="https://www.accesslabs.org/">Access Labs</a>, in partnership with <a href="https://medium.com/u/19349106268a">Blockstack</a> and <a href="https://medium.com/u/eb79e21cfe63">2U</a>. The goals of the hackathon were to introduce developers to the benefits of hackathons in the learning process, learn how to use design thinking and Agile planning under real-life time constraints, and expose developers to new technologies and available industries. This was the first time Flatiron School’s Access Labs was hosting a hackathon, and the experience surpassed my expectations.</p><p>The theme of the hackathon was health and wellness. This covered a wide range of topics such as access to health care, mental health, women’s health, or diet and exercise. There were 10 domain experts from various companies in the med tech field who were there to provide insight into real-world issues people are facing every day so that we could build the most impact websites and apps. A group of Flatiron instructor was also there to serve as technical advisors. It was an all-day event that started at 8:30 AM with presentation and judging ending at around 10:00 PM.</p><p>A major part of the hackathon was to incorporate Blockstack’s technology into whatever we built. <a href="https://blockstack.org/">Blockstack</a> is a full-stack decentralized computing network that allows a new generation of application aimed to increase security and fairness between developers’ and users’ interactions. Their core protocols and developer tools enable a fair and open Internet that returns digital rights to developers and consumers. Developed by experts in distributed systems, Blockstack allows users to own their own data which they can then transfer from app to app in a single ecosystem. User’s Blockstack ID also eliminates the need for password-based logins. All of this adds up to more privacy, security, and freedom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Itt87onuEzhNsAAQ8lLimw.png" /><figcaption>Screenshot of Blockstack ID login prompt</figcaption></figure><p>Days prior to the hackathon, participants were provided resources on how to install Blockstack along with tutorials on how to implement. My team ended up working with a domain expert from <a href="https://medium.com/u/1e992da1f836">WebMD</a>. He introduced us to The <a href="https://www.cdc.gov/diabetes/prevention/index.html">National Diabetes Prevention Program</a>, which was created in 2010 to address the increasing burden of prediabetes and type 2 diabetes in the United States. One of the key features of the National DPP is a research-based program focusing on healthy eating and physical activity. This CDC-recognized lifestyle change program has been shown to reduce the risk of developing type 2 diabetes by 58% (71% for people over 60 years old) for adults with prediabetes who complete the program.</p><p>These 16 week-long programs are instructor-led with a conversational-style aimed at educating enrollees and helping them track and manage their health goals. My team’s goal was to increase accessibility to the program for prediabetic adults by deploying an automated chatbot solution that was scalable. Our chatbot would give individuals who struggled to attend one of these programs in person the flexibility to take the course anytime, anywhere, without the need for human instructors.</p><p>We felt an automated chatbot would be able to deliver all the information needed while still keeping the user engaged. We used Blockstack’s technology to implement a secure, serverless login process as well as a storage system that allowed users to own any health data collected by the app. We also envisioned that users could eventually use Blockstack’s technology to securely share their data with their healthcare providers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*osbCFl3cLEYTXMxx.png" /><figcaption>Screenshot of the chatbot from our web app called Dia.log()</figcaption></figure><p>Over the course of only a few hours, we were able to build a fully function chatbot that reviewed a small portion of the National DPP curriculum and collected a user reported weigh in. Our web app was built using ReactJS, custom CSS, Blockstack, and <a href="https://www.npmjs.com/package/react-simple-chatbot">React Simple Chatbot</a> and the <a href="https://medium.com/u/8df3bf3c40ae">GitHub</a> repo can be found <a href="https://github.com/jordanmmartin/dia.log">here</a>. Our eventual goal for this app would be to add the full DPP curriculum and make user profiles more customizable.</p><p>Our app earned us 1st place in our category along with the highest overall score at the hackathon. Below are 5 things that I learned during the course of the hackathon and that I believe help us win.</p><ol><li>Prepare, prepare, prepare. Make sure you learn any new technologies you may need to use prior to the hackathon. Also, remember to brush up on anything else you might use on your app. Time is very precious during a hackathon and you don’t want to waste any of it.</li><li>Keep your idea focused. I saw many apps that were too broad and tried to solve too many problems (or too big of a problem). Make sure to narrow the problem you are addressing into something that can feasibly be done in the allotted time.</li><li>Make a detailed plan. Plan out exactly how long you expect it will take to build the app. Break down all of the tasks and features and give a conservative amount of time it will take to accomplish them. I found it super helpful to schedule check-ins every hour to assess progress and adjust as needed.</li><li>Divide and conquer. Since time is limited, it is important to delegate responsibilities across the team. This can mean individually or with pair programming. It is very important to communicate with your teammate about your skills and what task you feel comfortable tackling.</li><li>Have Fun! Hackathons can be exhausting and stressful, so maintaining a relaxed and friendly environment is important for team morale. You will have a more enjoyable experience and get more out of the event if you keep a positive attitude. While hackathons can feel very competitive, remember that learning is the ultimate goal.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47d54673bf53" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quick Guide to Debugging in Javascript]]></title>
            <link>https://medium.com/@jordanmmartin/quick-guide-to-debugging-in-javascript-54403ca9117?source=rss-3c4ac0c724d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/54403ca9117</guid>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[debugger]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[repl]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Jordan Martin]]></dc:creator>
            <pubDate>Wed, 27 Mar 2019 03:55:31 GMT</pubDate>
            <atom:updated>2019-03-27T03:55:31.911Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NlqpTTAM8DbGl4paBmjE_g.jpeg" /><figcaption>Courtesy of Unsplash</figcaption></figure><p>I have been working on Stephen Grider’s Javascript Udemy course, <a href="https://www.udemy.com/coding-interview-bootcamp-algorithms-and-data-structure/">The Coding Interview Bootcamp: Algorithms + Data Structures</a>, and there is a helpful part in the course where he talks about the basics of how to debug as you are working on solving the different algorithms in his course. I wanted to create this quick guide breaking down the steps of how to do it here.</p><ol><li>Place the debugger statement in your code where you would like it to be paused.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QlBnp6zwfsk3ORcU5BQ6Xg.png" /></figure><p>2. Make sure if the debugger is in a function to call the function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ZwFVSsejl-qk4w98-RE7A.png" /></figure><p>3. Launch your javascript file in debugger mode by using the terminal to navigate to the directory the file is in and running <em>node inspect your-file-name.js</em>. It will pause its execution on the very first line of the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NVatQ6R8XiAWV_9DVSwbtQ.png" /></figure><p>4. Tell the inspect to continue running the code by typing c (or cont). It will then execute the file line by line and pause once it finds the first debugger statement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kgMjGpj56527HaOE2Mx0Jg.png" /></figure><p>5. Enter the REPL mode to start a Javascript console by typing repl.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cGaFq1plMQ6fXgsHenpKMA.png" /></figure><p>6. Test out your code! You are now in a Javascript console and can check the value of variables or run later written code to make sure you are getting the results you expect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gdPoy-U7bKsn6PWbVYTvgw.png" /></figure><p>7. Exit REPL mode by hitting control + c. If needed, you can move on to the next debugger by entering c (or cont) repeating steps 4–6. If the code runs until the end then you can hit control + c again to exit the debugger mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cT3k-XMPy_JyUNwqJljvQw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54403ca9117" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Don’t Let Your Nerves Hurt Your Techincal Interview]]></title>
            <link>https://medium.com/@jordanmmartin/dont-let-your-nerves-hurt-your-techincal-interview-9766e4be186e?source=rss-3c4ac0c724d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/9766e4be186e</guid>
            <category><![CDATA[job-interview]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[technical-interview]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Jordan Martin]]></dc:creator>
            <pubDate>Wed, 20 Mar 2019 03:53:53 GMT</pubDate>
            <atom:updated>2019-03-20T04:13:03.079Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*9Pd28DcGUSd0RY7r" /><figcaption>Courtesy of Unsplash</figcaption></figure><p>I recently had my first official technical interview while applying for entry-level software engineer positions after graduating from Flatiron School’s immersive full stack web development program. I had previously done coding challenges sent from companies and even did a mock technical interview, which went really well. However, this was my first real (over the phone) technical interview for a job at an industry leading company where I would have had the opportunity to use my javascript, react, and redux skills while also learning a ton.</p><p>But as you may have suspected from the title of this article, the interview did not exactly go as a plan. I had let my nerves get the best of me while trying to solve a simple algorithm question. So I decided to write a blog post reflecting on what went wrong and what I would have done differently. Hopefully, this helps me learn from my mistakes and may even help another developer who is starting the technical interviewing process.</p><p>Let’s go over the format of the interview. I was given a phone number and code in order to call into a conferencing system as well as a unique link to a <a href="https://coderpad.io/">CoderPad</a> live programming environment. I had a single interviewer who joined the phone conference call and logged into the same CoderPad live environment. Although there was a short (~10 min) delay in which the interviewer needed to get login information for CoderPad from the recruiter. But this did not affect the amount of time I had during the interview.</p><p>The phone interview started with the usual introductions and some light question about my coding experience. We then proceeded to CoderPad where I was given an algorithm problem to solve. I had been listening to a bunch of podcasts and reading articles about technical interviews and what the interviewers are hoping to gain from the interview, especially when it came to solving algorithms. My takeaway was that interviewers not only wanted to see your technical abilities, but they also wanted to see how you go about solving problems and what it would be like to work with you.</p><p>My goals going into the interview were to try and be as vocal as possible while solving the algorithms. I also didn’t want to focus too much on trying to solve the algorithm the best, most efficient way possible at first. Instead, I decided I would solve the problem the first way that came to mind then refactor my code later to improve efficiency. This would also give me the chance to discuss big o notation and the time complexity of my initial solution with my interviewer before refactoring my code. I thought this would give me the most opportunity to demonstrate my knowledge and problem-solving skills.</p><p>While I still believe that is a good method for approaching the technical interview, I let my nerves get the best of me during the interview and overestimated the complexity of the given algorithm. Below is an example of a similar algorithm and the more complex, less efficient way I first solved it. (Note: I was doing the interview in Javascript.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LGu1h60BB9v1_BWFr-B2_g.png" /></figure><p>While solving the problem, I used two different for loops. I knew that by adding a second loop my time complexity was increasing from O(n) to 0(n²). This may not seem like a big deal with smaller test inputs but as the input increase in size, the time it takes to run the function would increase exponentially. I know that in order to make my function more efficient I needed to eliminate one of my for loops. After discussing this all with the interviewer, I started to refactor my code. This is when things started to take a turn for the worse.</p><p>While refactoring, I made the problem more complex than it needed to be in my head. My inefficient solution during the interview was even more complex than the above sample solution because I was fixated on the idea that I need to store the count for each of the numbers until the very end. Then I could create a shortened string based on those values. This fixation made things way more complex and my nerves started to paralyze me. I even thought I needed to do recursion at one point.</p><p>The interview was getting close to the allotted time. The interviewer politely said we were running out of time and asked if I had any question. I proceeded to ask several questions about the structure of the engineer teams, his team/specific role, and about other aspects of the company’s culture. But the entire time I kept thinking about solving the algorithm. After he answered my final question, I thanked him for his time and the called end.</p><p>Once the call ended, I immediately realized that the solution was way simpler than I was making it in my head. It finally registered in my head that I did not need to keep track of all the counts until the end. I could just keep track of the count as long as the current letter and the next letter was the same and then reset the counter. This allowed me to get rid of one of the for loops and increase efficiency, as you can see in the below solution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P1O6W9Lz6r8CWQnBx1PXOw.png" /></figure><p>Unfortunately for my first technical interview, I had let my nerves get the best of me, which was only compounded by how much I wanted this specific job. It was made even worse by the fact that I realized the more efficient solution with 5 minutes of getting off the phone with the interviewer. My nerves made me think the solution needed to be more complex than it actually was. Here are a few things I learned:</p><ol><li>When refactoring code for an algorithm, don’t get too caught up in your first solution. You may have made bad assumptions. Sometimes it&#39;s better to comment out your old solution and start fresh.</li><li>When talking out loud as you code, don’t just focus on what you are doing and explaining syntax. The interviewer already knows how for loops, if statements, etc work. Focus on WHY you are choosing to write that specific code.</li><li>Don’t be afraid to ask questions or even ask for a hint to point you in the right direction. Make sure to start off by asking as many clarifying questions as possible. This gives you more time to process the problem and realized exactly what you are being asked to do.</li><li>Lastly, don’t put too much pressure on yourself. There will be more exciting opportunities in the future. Everyone has off days. No matter what happens, it is an excellent learning experience and good practice for your next technical interview.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9766e4be186e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quick Review: Git Usage Basics]]></title>
            <link>https://medium.com/@jordanmmartin/quick-review-git-usage-basics-b651f4a3a6f7?source=rss-3c4ac0c724d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/b651f4a3a6f7</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Jordan Martin]]></dc:creator>
            <pubDate>Wed, 13 Mar 2019 01:50:55 GMT</pubDate>
            <atom:updated>2019-03-19T22:09:03.937Z</atom:updated>
            <content:encoded><![CDATA[<p>Over the past few months, I have been working mostly on data structure and algorithm problem or minor improvements to my own existing projects. I have found that it can be easy to get relaxed about maintaining a proper Git workflow, especially when you are the only person contributing to a project. It is all too easy to forget about correctly following the checking out of branches, adding commits, merging branches, etc. I wanted to create this blog post to help myself review a basic Git workflow procedure and serve as a reference guide for beginner programmers.</p><h3><strong>Local Repository Break Down</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*Oi90AOWEk7gh8m-k.png" /><figcaption>Source: <a href="http://rogerdudler.github.io/git-guide/img/trees.png">http://rogerdudler.github.io/git-guide/img/trees.png</a></figcaption></figure><p>Git maintains three different “trees” on your local repository. There is the Working Directory where the actual files are held. The Index acts as a staging area for new files, and finally the Head which points to the last commit</p><h3><strong>Getting Started</strong></h3><p>git init — use this command in of a local directory to create a new git repository</p><p>git clone username@hotst/path/to /repository— creates a working, local copy of an existing repository on a remote server</p><h3><strong>Making Changes</strong></h3><p>git add &lt;filename&gt; (or * for all files)— this the first step in Git workflow where you can propose changes are added to the Index</p><p>git commit -m ‘Commit message’— following the git add command, this commits the added files to the Head of your local repository, but does not yet add it to the remote repository</p><p>git push origin &lt;branch&gt; — sends your changes in the Head of your local working to the specified branch of your remote repository</p><h3><strong>Maintaining Branches</strong></h3><p>A great way to use branches is for the development of a specific feature so that you can isolate your new code. By default, the repository is set to the master branch. When you are finished developing a feature on a branch, you can merge it back to the master branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*NSi71Va9fTB4DDmJ.png" /><figcaption>source: <a href="http://rogerdudler.github.io/git-guide/img/branches.png">http://rogerdudler.github.io/git-guide/img/branches.png</a></figcaption></figure><p>git checkout -b &lt;branch&gt; — creates a new branch with the specified name and switches to it</p><p>git checkout master — switches back to the master branch</p><p>git branch -d &lt;branch&gt; —deletes the specified branch,</p><h3><strong>Updating and Merging</strong></h3><p>git pull — execute in your working directory to updates your local repository to the latest commit by fetching and merging the remote changes</p><p>git merge &lt;branch&gt; — merges the specified branch into your current branch</p><p>git diff &lt;source_branch&gt; &lt;target_branch&gt; — show a preview of the merge to check for possible conflicts</p><h3><strong>Fixing Mistakes to Local Repository</strong></h3><p>git checkout -- &lt;file_name&gt; — replaces the changes in your working directory tree with the latest content in the Head</p><p>git fetch origin THEN git reset --hard origin/master — drops all local changes and commits then fetches the latest history from the remote server to use for your master branch</p><p>Source: <a href="http://rogerdudler.github.io/git-guide/">http://rogerdudler.github.io/git-guide/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b651f4a3a6f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quickstart Guide to using Cloudinary Upload Widget v2 in React]]></title>
            <link>https://medium.com/@jordanmmartin/quickstart-guide-to-using-cloudinary-upload-widget-v2-in-react-4c4d9041d55e?source=rss-3c4ac0c724d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c4d9041d55e</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[cloudinary]]></category>
            <category><![CDATA[redux]]></category>
            <dc:creator><![CDATA[Jordan Martin]]></dc:creator>
            <pubDate>Thu, 29 Nov 2018 21:14:54 GMT</pubDate>
            <atom:updated>2018-11-29T21:14:54.333Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q5JRNufp8stzkgk_w4lj9w.jpeg" /></figure><p>For my final project at Flatiron School’s immersive web development program, my idea was to build an app very similar to Instagram. I was using a javascript frontend with React and Redux and a Ruby on Rails API backend to build my app. I also used react-create-app to start the project. When deciding what photo storage platform I wanted to use, I decided on Cloudinary after hearing about how easy it is to set up from a friend.</p><p>After doing more research, I found that <a href="https://cloudinary.com/blog/introducing_cloudinary_upload_widget_v2">Cloudinary had just released a new version (v2) </a>of their upload widget the previous month (October 2018). The new version of the widget was made to take advantage of new technologies such as React, ES6, WebPack, and Rollup.js with an updated design and improved mobile support. Since I was using React and tried to build a PWA, I thought using this widget was a great option.</p><p>However, I ran into an obstacle where the <em>cloudinary</em> object was being returned as undefined everywhere in my src directory and there did not seem to be any helpful information online about how to implement the Cloudinary Upload Widget v2 in a react app. <a href="https://cloudinary.com/documentation/upload_widget">Cloudinary’s own widget documentation</a> did not have the answer to why I was having difficulty accessing the <em>cloudinary</em> object, which I needed to create the widget. This is why I decided to write a blog post about it so that other developers wouldn’t waste as much time as I did getting the widget to work. Below is a breakdown of how I set it up in the end.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*TF6EvDoq8gKSadIE-rqyxw.png" /></figure><p>1.Sign up for a free Cloudinary account, then go to Settings, click the Upload tab, and scroll to the bottom to click the button to create a new unsigned upload preset. You will need that upload preset name and your cloud name, which can be found on your Cloudinary dashboard, for later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T46p52ZESuBHATZi0y7nEQ.png" /></figure><p>2. Include the cloudinary widget Javascript file inside the header of your index.html in your public directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*YX02eh36tTJl3ndcZ2o2-A.png" /></figure><p>3. Add the widget into the render of your chosen react component by calling the createUploadWidget method (which you input your cloud name and upload preset name into) on <em>cloudinary</em> object imported from the cloudinary widget Javascript file. Make sure to use the window to get access to the <em>cloudinary</em> object (i.e. window.cloudinary.createUploadWidget(…)).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*C-Pk5ZB7952bvw8HdobOSQ.png" /></figure><p>4. Create a callback function for showing the widget. Adding the widget above creates the object in memory but does not show the widget on the page. You need to call .open on the widget to show it on the screen and .close to remove from the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*8kTw0kM5QbLut9EZVz7oBw.png" /></figure><p>5. Add a function inside the callback function of the .createUploadWidget method that checks the result response give from the widget to get the secure URL for the uploaded image. When an image is uploaded, the result object will have an event key with a “success” value, and the object will also have an info object with a secure_url key whose value is the URL to the uploaded photo.</p><p>Note: there is also a .openUploadWidget method that both creates and opens the widget. However, separating the two methods helps with performance by allowing your widget to load right away in the background.</p><p>For more in-depth information on how to take advantage of all upload widget features <a href="https://cloudinary.com/documentation/upload_widget#how_to_setup_and_integrate_the_upload_widget_into_your_site_or_app">see the Cloudinary documentation</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c4d9041d55e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JS Pass by Value vs Pass by Reference]]></title>
            <link>https://medium.com/@jordanmmartin/js-pass-by-value-vs-pass-by-reference-5a8c9ebf4d14?source=rss-3c4ac0c724d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a8c9ebf4d14</guid>
            <category><![CDATA[pass-by-reference]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[pass-by-value]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[object-oriented]]></category>
            <dc:creator><![CDATA[Jordan Martin]]></dc:creator>
            <pubDate>Tue, 09 Oct 2018 17:47:16 GMT</pubDate>
            <atom:updated>2018-10-09T17:47:16.056Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*Drz5Lwh2WtLcZdrxXg7JTQ.gif" /></figure><p>Being an Object-Oriented programming language, almost all elements, including functions, in JavaScript are Objects. The only components that are not Objects are the Primitive Data Types: string, number, Boolean, null, and undefined. These Primitive Data Types also have the characteristic of being immutable, meaning that they cannot be changed after being created. One of the major differences between Objects and Primitive Data Types is that Objects are Pass by References and Primitive Data Types are Pass by Value.</p><p><strong>What is Pass by Value?</strong></p><p>The easiest way to think about pass by value is that it is making a copy of the original. This means that two of the exact same things are being made. So if you go to change the copy, it does NOT change the original.</p><p>For Primitive Data Types, the =operator functions as Pass by Value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*UuC6Ge_V3oW7bOFpFtNW9A.png" /></figure><p><strong>What is Pass by Reference?</strong></p><p>Pass by Reference is a little more complicated to understand. Instead of making a copy of the original, you are making a reference to the original value. So a change made on the reference is actually changing the original.</p><p>For Objects, the =operator functions as Pass by Reference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*z_SDnhYMC0K39GEBA1_E-Q.png" /></figure><p><strong>What is the Significance?</strong></p><p>The significance here is memory. Every variable is stored in memory and alotted a specific amount of memory. Larger data types, like Objects, require more memory. In Pass by Reference, JavaScript is attempting to save memory space by passing an address in memory (aka a reference) of where your data is instead of allotting additional space in memory to make a separate copy of your data.</p><p>Reference:</p><p><a href="https://hackernoon.com/grasp-by-value-and-by-reference-in-javascript-7ed75efa1293">https://hackernoon.com/grasp-by-value-and-by-reference-in-javascript-7ed75efa1293</a></p><p><a href="https://www.mathwarehouse.com/programming/passing-by-value-vs-by-reference-visual-explanation.php">https://www.mathwarehouse.com/programming/passing-by-value-vs-by-reference-visual-explanation.php</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a8c9ebf4d14" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Module One Final Project & Case Statements]]></title>
            <link>https://medium.com/@jordanmmartin/module-one-final-project-case-statements-c7d47c9da6e7?source=rss-3c4ac0c724d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7d47c9da6e7</guid>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[cli]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Jordan Martin]]></dc:creator>
            <pubDate>Tue, 18 Sep 2018 18:59:20 GMT</pubDate>
            <atom:updated>2018-09-18T19:00:02.468Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*xypeMLfER6q7rnSA6z6I7g.png" /></figure><p>For my final project for Module 1 at Flatiron School’s Immersive Software Engineering Bootcamp, my partner Steven and I created a CLI hangman game based on the character we pulled from the Marvel API. We went about development in four different stages:</p><p>1. API Request</p><p>2. Game Logic</p><p>3. Game Interface</p><p>4. CRUD functionality</p><p>When we first started we had had a lot of issues with the Marvel API. We had previously learned how to interface with API; however, all of the API we dealt with were open APIs that did not require any type of security key. The Marvel API required not just on key but two, both a public and private key. On top of that, you couldn’t just send your keys to the Marvel API to gain access, you had to pass in a hash with your request. This hash was to be generated by passing both of your keys through a MD5 hash function. After figuring this all out, we figured we couldn’t possibly be the first ruby programmers to come across this issue. We ended up finding a ruby gem that made sending requests to the API much easier. Once we were able to make calls to the API, it didn’t take much time for us to figure out the parameter of our request, how to parse through the data we received, and how to format it for gameplay.</p><p>Writing the code for the game logic was probably the most straightforward part of the project. We had both played hangman before and the rules are pretty straightforward. We spent some time creating a helper method to make sure that the user could only make a guess of one single letter at a time. We also had to make sure that our character name string we received from the API was parsed into an array of single characters. We then used some of the array comparisons operates I wrote about in my previous post (link to the previous post). What made this portion of development easier in a way was that we knew exactly what we had to accomplish. We knew the rules; we just need to put them into code.</p><p>Deciding on the game interface was a little trickier. Because it was a CLI app we didn’t’ have to worry too much about layout design, but we had to think about all the different paths a user could take through our game, from logging in to quitting the game. Some paths would involve playing the game and some would just involve jumping around different menus. We had both played video games and new there were different “game states”, but we were struggling with how to implement that in code. We eventually came to the conclusion of using a case statement that would have different when conditionals to represent different “game states” all within a while loop, which would keep the user “in the game”. For each “game state” we could take in user input and change the “game state” by reassigning the case statement variable at the end of the when block. A simplified example of how we structured this can be seen below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SlH3_zJrFaFwRU31sRa5LQ.png" /></figure><p>Our code ended up being much more complex than the code above. Case statements became our best friends, which another case statement nested within each of the when conditionals listed above. We barely spent anytime covering case statements during lecture or labs, so I decided to explore them further. While I knew that case statements were a great alternative to having a ton of if statements, I didn’t realize one key feature of case statements. The use of the “===” not the “==” operator for comparing the case to the when.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2V_xT6dgejUik7sVxn2kOw.png" /></figure><p>Using the “===” operator with different classes allows for some special behaviors. Here are two examples:</p><p>Matching Range</p><p>For a range, the “===” operator acts like the .include? method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7xA09JXsahJ1b-zhy91W7A.png" /></figure><p>Matching Regexes (Regular Expressions)</p><p>For a range, the “===” operator acts like .match method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WJSvtMl8HcvyLq5oZZfIbg.png" /></figure><p>Implementing CRUD functionality into our CLI app was the last thing we did. Our game allowed for you to log in via a username and that saved information for each game you played along with user stats. The user also had the ability to change their name or to completely delete their account. The process of adding our code for CRUD functionality to the app was fairly easy. We used the ActiveRecord gem, which made writing the queries for our database every simple. We had also previously written comments as placeholders for where our code for CRUD functionality needs to go.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7d47c9da6e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Intersection of Two Arrays]]></title>
            <link>https://medium.com/@jordanmmartin/the-intersection-of-two-arrays-69fde0bc236b?source=rss-3c4ac0c724d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/69fde0bc236b</guid>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[array-methods]]></category>
            <category><![CDATA[pair-programming]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Jordan Martin]]></dc:creator>
            <pubDate>Tue, 11 Sep 2018 18:50:58 GMT</pubDate>
            <atom:updated>2018-09-11T19:07:42.611Z</atom:updated>
            <content:encoded><![CDATA[<p>During week two of module one at Flatiron School’s Immersive Software Engineering Bootcamp, we were given an all-day pair-programming project. The goal of the project was to strengthen our understanding of object relationships in Ruby, particularly the has-many-through relationship. In our project, my partner Kat and I were building out a domain model in which a User has a collection of RecipeCards. Each RecipeCard would then contain the information of both the Recipe and User, making a has-many relationship through RecipeCards. A Recipe also has many RecipeIngredients, and Ingredient has many RecipeIngredients. Ingredient also has many Allergens, and User also has many Allergens. These relationships are shown in the diagram below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*33h_nbLkRk6qZagz57b7_g.jpeg" /></figure><p>After building out all of the functionality that ReadMe required and testing to make sure our methods worked as intended, we moved on to the bonus. The bonus wanted us to create an instance method in the User class call #safe_recipes which would return an array of all the Recipe instances that did not contain ingredients the user is allergic to. Luckily we already created another User instance method called #allergens that returned an array or Ingredient instances that the user was allergic to which we could use as a helper method. Our plan was to iterate through all of the Recipes then within that iteration to use our Recipe instance method #ingredients so we could iterate through each individual recipe’s array of ingredients. While iterating through each ingredient, we could then check if any of the recipe’s ingredients matched the ingredients in the array of ingredients the user is allergic to. If there were any matches, then we would need to exclude that recipe from our returned array of “safe” recipes.</p><p>However, it was almost lunchtime and our brains were a little drained from all the other coding we had done before the bonus. After a few failed attempts at doing a nested iteration, we decided to go eat lunch and tackle this problem after we recharged a bit. This was the right decision. After taking a break away from our code, we were able to approach our task with new eyes. We were able to see the basic problem that was complicating our code was a comparison of two arrays in which we wanted to find any common elements. While we still needed to iterate through each recipe, we then only needed to check if there were any ingredients in common between the array of ingredients the user is allergic to and the array of ingredients in each recipe. We figured there must be a way in Ruby to simply find elements in common between two arrays. So we turned to our most trusted friend: Google.</p><p>As is often the case, we found the answer we were looking for on Google. There is a very simple and elegant way to find common elements between two arrays. It is with the use of the AND operator (&amp;). When you use the AND operator (&amp;) between two arrays, it returns an array of the common elements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*XNUZo7H9uFfTll4lb69JrA.png" /></figure><p>In our case, we were less concerned about what elements, i.e. ingredients, the two arrays have in common and more interested in if the in common elements exist. So we didn’t need to know what exactly was in the returned array. We just needed to know if the returned array was empty or not. Everything we were trying to do within our nested iteration we could now do in one simple line of code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*jl8hv7dhWovs5zCUk_AIKA.png" /></figure><p>This pair programming experience taught me couple things. It demonstrated the usefulness of taking a break away from your code whenever you are feeling stuck or mentally drained. It reinforced to me the fact that Google is a coder’s best friend. Last, it taught me that Ruby often has existing methods that allow for you to refactor big chunks of your code that seem overly complex or confusing.</p><p><strong>Below are a few more ways you can manipulate arrays.</strong></p><p><strong>Union</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Ehu4SfDN8mAjzmza2Lxtw.png" /></figure><p>Using the pipe as an operator allows for the combining of the unique elements of two arrays into one array.</p><p><strong>Difference</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5NWDPV5sOiplyblSco5n7A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ybaNcsfE2m6YpTkb22e_Eg.png" /></figure><p>The difference operator allows you to find the elements the first array has that the second array does not have.</p><p><strong>Intersection</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h99NAXuYBqVnocizH6_Bbg.png" /></figure><p>Here again is the operator that streamlined our code. Using the and operator (&amp;) between two arrays returns an array of elements that both arrays have in common.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69fde0bc236b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>