<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jeremy</title>
    <description>The latest articles on DEV Community by Jeremy (@montanacoder).</description>
    <link>https://dev.to/montanacoder</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F175247%2F9a046bf6-3867-41c0-9627-7872c5a808a3.png</url>
      <title>DEV Community: Jeremy</title>
      <link>https://dev.to/montanacoder</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/montanacoder"/>
    <language>en</language>
    <item>
      <title>Journey to Become a Better Programmer (Day: 4, Take a break)</title>
      <dc:creator>Jeremy</dc:creator>
      <pubDate>Wed, 14 Aug 2019 01:45:16 +0000</pubDate>
      <link>https://dev.to/montanacoder/journey-to-become-a-better-programmer-day-4-take-a-break-4ccj</link>
      <guid>https://dev.to/montanacoder/journey-to-become-a-better-programmer-day-4-take-a-break-4ccj</guid>
      <description>&lt;p&gt;Taking a break... until recently I didn't take breaks and would sit down/stand and just hammer my work out. I heard of a technique called the &lt;a href="https://francescocirillo.com/pages/pomodoro-technique"&gt;Pomodoro Technique&lt;/a&gt; from some fellow codders, before that, I have never heard of this and became very interested in it, this was about 7ish months ago. I really didn't think it was worth taking all those breaks and lose all that time to focus on my work. I started trying this technique about a week ago, and I must say its AMAZING! I would strongly suggest everyone at least try this. &lt;/p&gt;

&lt;p&gt;What I learned:&lt;br&gt;
If you are like me, I almost felt guilty about taking a break. I had this job that I worked so hard to get and I wanted to make them happy. This was a hard thing for me to get over and after a week of doing Pomodoro my quality of work has improved, I am able to really focus on something and then relax the brain and then hit it again. This leads me to what I found out today, because I wasn't stressing about taking a break, I allowed my brain to think about some home projects we have planned. After the break, I took a second a look at the problem and it was like the answer just came out of the screen and slapped me. I have added this &lt;a href="https://chrome.google.com/webstore/detail/marinara-pomodoro%C2%AE-assist/lojgmehidjdhhbmpjfamhpkpodfcodef?hl=en"&gt;extention&lt;/a&gt; to chrome and it really helps to stay on task/break. Remember to take a break, it's okay.&lt;br&gt;
&lt;a href="https://i.giphy.com/media/9u514UZd57mRhnBCEk/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/9u514UZd57mRhnBCEk/giphy.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>learned</category>
      <category>firstyearincode</category>
      <category>break</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Journey to Become a Better Programmer (Day: 3)</title>
      <dc:creator>Jeremy</dc:creator>
      <pubDate>Sat, 10 Aug 2019 02:50:01 +0000</pubDate>
      <link>https://dev.to/montanacoder/journey-to-become-a-better-programmer-day-3-35lh</link>
      <guid>https://dev.to/montanacoder/journey-to-become-a-better-programmer-day-3-35lh</guid>
      <description>&lt;p&gt;Journey, now that was a word I used because it sounded good. these last few days I understanding of that word. I have been on a journey to understand Binary Trees better. these past days I have been traversing through some trees, to learn how they work and I am comfortable enough to walk through a traversing in order Binary tree.&lt;/p&gt;

&lt;p&gt;the set up&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Node(val) {
    this.value=val
     this.left=null
     this.right=null
}

var tree2 = new Node(5);
tree2.left = new Node(10);
tree2.left.left = new Node(17);
tree2.left.right = new Node(3);
tree2.right = new Node(8);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Goal: have an array in order of the tree. &lt;/p&gt;

&lt;p&gt;How it works &lt;br&gt;
    BT(Binary Trees) will always have a root. The root will be where the tree starts just like a real one 🙂. From that root there will be a node that will have two branches, one left and one right, if we are talking about BTS (binary search tree) then the rules for what goes left and right and different(cover this on a different day).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.statisticshowto.datasciencecentral.com%2Fwp-content%2Fuploads%2F2017%2F12%2Ffull-binary-tree.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.statisticshowto.datasciencecentral.com%2Fwp-content%2Fuploads%2F2017%2F12%2Ffull-binary-tree.png" alt="image-title-here"&gt;&lt;/a&gt;&lt;br&gt;
I wanted to make an image with all the numbers I have listed above however, it seems I can't upload a local image.&lt;/p&gt;

&lt;p&gt;When you look at the set up you can see the tree is built. Before we start coding, We need to understand how to move in a BT. we start at the furthest “left” record that number then up to the node record that number then to the right and yep, you guessed it, record that node too.  &lt;/p&gt;

&lt;p&gt;Based on the set up what you do think the sorted array will end up looking like? &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;[5,10,17,3,8]&lt;/li&gt;
&lt;li&gt;[5,17,10,3,8]&lt;/li&gt;
&lt;li&gt;[17,5,3,10,8]&lt;/li&gt;
&lt;li&gt;[17,10,8,5,3]&lt;/li&gt;
&lt;li&gt;[17,10,3,5,8]&lt;/li&gt;
&lt;li&gt;[10,17,5,3,8]&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;let's walk through this, just to make sure we understand what is happening. &lt;/p&gt;

&lt;p&gt;so looking at the image of the BT we have “17” being the furthers left (tree2.left.left) then bounce up to the parent node "10" (tree2.left) lastly visit the right node of “10” which is “3” from there we just repeat the exact same process. We go back to node “10” and since we already recorded it we move to the node above “5” and yes we then get the last number  “8” which is the furthermost number to the right. &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;              What tree2 would look like 
                        5
                       / \
                      10  8
                     / \
                    17  3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;The Code:&lt;/p&gt;

&lt;p&gt;so now that we can do it on paper now let's code it up&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function inOrder (tree) {
    let res= [ ]
    helper(tree, res)
    return res
} 

function helper (tree, res) {
  if (tree){
        if (tree.left){
            helper(tree.left, res) //we do this so we keep calling this function 
                                      (recursive) until the node we land on 
                                       doesn’t have a left child.
        }

        res.push(tree.val) // adds the current node to `res` array.

         if (tree.right){  //once the left is done we move tot he right
           helper(tree.right, res)
        }
    }
} 

 inOrder(tree2)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;now try this tree:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var tree3 = new Node(6);
tree3.left = new Node(3);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var tree1 = new Node(4);
tree1.left = new Node(1);
tree1.right = new Node(3);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and go through the steps and what do you get?&lt;/p&gt;

&lt;p&gt;the key for me to understanding this entire process was to talk to the rubber duck. If you aren’t sure what the heck I am talking about check out &lt;a href="https://dev.to/rachelsoderberg/rubber-ducky-debugging-1jbe"&gt;Rubber Ducky Debugging&lt;/a&gt; by &lt;a class="mentioned-user" href="https://dev.to/rachelsoderberg"&gt;@rachelsoderberg&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;This has been a struggle for me personally, I understood BT on paper and how it worked but was confusing the rules for BTS, or I was WAY overthinking it, and my code would be 30 lines, with a couple of loops and a few if statements. &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Journey to Become a Better Programmer (Day: 2)</title>
      <dc:creator>Jeremy</dc:creator>
      <pubDate>Wed, 07 Aug 2019 00:41:56 +0000</pubDate>
      <link>https://dev.to/montanacoder/journey-to-become-a-better-programmer-day-2-1fjn</link>
      <guid>https://dev.to/montanacoder/journey-to-become-a-better-programmer-day-2-1fjn</guid>
      <description>&lt;p&gt;Warning below is not about code, check back tomorrow on Day 3 to follow some code.&lt;/p&gt;

&lt;p&gt;Today, now today was different, I did some code as I said I would. However nothing really stood out for me so I am not going to be sharing code today I want to talk about people, people that hide behind keyboards. No, this isn't going to be a bash post but an informative one. Today I watch a mentor of mine go outside of his box and get ripped on by some internet trolls (yes I know its the internet). I guess I had in my head (don't know why) that programmers were different at least to one another, other than the side remarks about the "terrible language" they use (you know the one 😉). I want to personly say Thank you to every single programer that I have had the pleasure of dealing with face to face or internet, everyone the I have interacted with has been nothing but high class, this has been going on for more than 4years since I joined my first coding website. Unfortunately I woke up and realized that I am not in this fantasy world, but I am sure going to control what I can and make sure the interactions I have will only be kind... unless warranted.   &lt;/p&gt;

</description>
      <category>rant</category>
      <category>tryrestart</category>
    </item>
    <item>
      <title>Journey to Become a Better Programmer (Day: 1)</title>
      <dc:creator>Jeremy</dc:creator>
      <pubDate>Mon, 05 Aug 2019 23:30:21 +0000</pubDate>
      <link>https://dev.to/montanacoder/journey-to-become-a-better-programer-day-1-leg</link>
      <guid>https://dev.to/montanacoder/journey-to-become-a-better-programer-day-1-leg</guid>
      <description>&lt;p&gt;Today I worked on &lt;a href="https://www.hackerrank.com/challenges/js10-loops/problem"&gt;HackerRank&lt;/a&gt; and completed day 0-1 and did some other ones for practice."&lt;br&gt;
I feel really good about this problem, came up with a solution that I am very happy about.&lt;/p&gt;

&lt;p&gt;The goal: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;First, print each vowel in on a new line. The English vowels are a, e, i, o, and u, and each vowel must be printed in the same order as it appeared in.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Second, print each consonant (i.e., non-vowel) in on a new line in the same order as it appeared in.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;example: &lt;br&gt;
"devto"&lt;/p&gt;

&lt;p&gt;should print like so:&lt;br&gt;
e&lt;br&gt;
o&lt;br&gt;
d&lt;br&gt;
v&lt;br&gt;
t&lt;/p&gt;

&lt;p&gt;The first thing I did was create an array &lt;code&gt;let strArr=s.split('')&lt;/code&gt; out of the string using &lt;code&gt;.split('')&lt;/code&gt; ( &lt;a class="comment-mentioned-user" href="https://dev.to/laurieontech"&gt;@laurieontech&lt;/a&gt;
 had a good topic on the called &lt;a href="https://dev.to/laurieontech/splice-slice-shoot-i-meant-shift-424p"&gt;Splice! Slice! Shoot, I meant Shift!&lt;/a&gt;) then a few more, one for the vowel &lt;code&gt;let v = []&lt;/code&gt; and one for the consonants &lt;code&gt;let c = []&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;next, I created a static array of just vowels&lt;br&gt;&lt;br&gt;
  &lt;code&gt;let vowels = ['a','e','i','o','u']&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;then, I did a &lt;code&gt;forEach()&lt;/code&gt; loop (goes through every item in the array) (set up like this: &lt;code&gt;strArr.forEach(letter=&amp;gt;{})&lt;/code&gt; 'letter' representing each item), in the loop I checked if the vowels (&lt;code&gt;vowels&lt;/code&gt;) array includes the letter that we are on in the loop &lt;code&gt;if(vowels.includes(letter))&lt;/code&gt; if that was true I would push the 'letter' to a new vowel array (&lt;code&gt;v&lt;/code&gt;) and the consonants go into their own&lt;br&gt;&lt;br&gt;
array (&lt;code&gt;c&lt;/code&gt;). Lastly return it all in one array &lt;code&gt;return [...v ...c].join('\n')&lt;/code&gt; then &lt;code&gt;.join('\n')&lt;/code&gt; them all to one string creating a new line at every letter.&lt;/p&gt;

&lt;p&gt;With it put together it looked like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function vowelsAndConsonants(s) {
  let strArr = s.split('');
  let vowels = ['a', 'e', 'i', 'o', 'u'];
  let v = [];
  let c =[];

  strArr.forEach(letter =&amp;gt; {
    if (vowels.includes(letter)) {
      v.push(letter);
    } else {
      c.push(letter);
    }
  })

  return [...v, ...c].join('\n');
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>firstblog</category>
    </item>
    <item>
      <title>Better myself by coding everyday and posting</title>
      <dc:creator>Jeremy</dc:creator>
      <pubDate>Mon, 05 Aug 2019 21:40:26 +0000</pubDate>
      <link>https://dev.to/montanacoder/better-myself-by-coding-everyday-and-posting-5dg</link>
      <guid>https://dev.to/montanacoder/better-myself-by-coding-everyday-and-posting-5dg</guid>
      <description>&lt;p&gt;Hello, DEV! (I am pretty excited/nervous to write my first post) I have been thinking of ways how I can better myself in my new found career. I have tried some things but just loose focus. I want to do some kind of code problem (Daily code challenges) but not just leave it at that. I want to write a post on here, that shows the problem, talk about my pitfalls, and explain my solution. this will hopefully help me in a couple of areas, communication (writing to humans as &lt;a class="comment-mentioned-user" href="https://dev.to/marek"&gt;@marek&lt;/a&gt;
 described in his post, &lt;a href="https://dev.to/marek/three-arguments-for-why-you-should-write-more-1no6?utm_source=additional_box&amp;amp;utm_medium=internal&amp;amp;utm_campaign=regular&amp;amp;booster_org="&gt;Three Arguments for Why You Should Write More&lt;/a&gt;.) and coding. &lt;/p&gt;

&lt;p&gt;Now I would like to dig into coding, I believe this process will help with just not being able to write code but to have a better understanding of it. I love the idea of knowing the information well enough that I can explain the code I wrote (not just the basics). I will be posting ideally every day (making myself accountable). I am very excited to start this process! &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>firstblog</category>
    </item>
  </channel>
</rss>
