<?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 Martin Nordström on Medium]]></title>
        <description><![CDATA[Stories by Martin Nordström on Medium]]></description>
        <link>https://medium.com/@martinnord?source=rss-36723b3116b2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*kNSomu9dm9Pl9sYReW5k4w@2x.jpeg</url>
            <title>Stories by Martin Nordström on Medium</title>
            <link>https://medium.com/@martinnord?source=rss-36723b3116b2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 20:19:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@martinnord/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[Millionaire Habits: Simple Strategies for Building Wealth]]></title>
            <link>https://medium.com/@martinnord/millionaire-habits-simple-strategies-for-building-wealth-42a47e55ccaf?source=rss-36723b3116b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/42a47e55ccaf</guid>
            <category><![CDATA[business]]></category>
            <category><![CDATA[hustle]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[investing]]></category>
            <category><![CDATA[wealth]]></category>
            <dc:creator><![CDATA[Martin Nordström]]></dc:creator>
            <pubDate>Mon, 09 Jan 2023 17:19:52 GMT</pubDate>
            <atom:updated>2023-01-09T17:19:52.259Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a09LOukZxxE5c9VN" /><figcaption>Photo by <a href="https://unsplash.com/@towfiqu999999?utm_source=medium&amp;utm_medium=referral">Towfiqu barbhuiya</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Are you looking to build wealth and join the ranks of the millionaires? It’s not as difficult as you might think — in fact, with the right habits and strategies, anyone can achieve financial success.</p><p>Here are a few simple habits that millionaires have incorporated into their daily lives, which you can use to start building your own wealth:</p><ol><li><strong>They save and invest wisely.</strong> Millionaires know that accumulating wealth is not just about making a lot of money — it’s also about being smart with that money. This means setting aside a portion of their income for saving and investing, rather than spending it all on unnecessary expenses.</li><li><strong>They prioritize their finances.</strong> Building wealth requires a certain level of financial discipline, and millionaires make sure to prioritize their finances by setting clear financial goals, tracking their spending, and creating a budget.</li><li><strong>They are proactive with their career.</strong> Millionaires are always looking for ways to advance in their careers and increase their income. This could mean seeking out new job opportunities, negotiating for a higher salary, or investing in their own education and professional development.</li><li><strong>They network and build connections.</strong> Building a strong network of contacts can be crucial for career advancement and finding new business opportunities. Millionaires make an effort to connect with others in their field and build mutually beneficial relationships.</li><li><strong>They surround themselves with like-minded individuals.</strong> The people you surround yourself with can have a big impact on your mindset and actions. Millionaires know this, and make an effort to surround themselves with other successful, driven individuals who can provide support, encouragement, and valuable advice.</li></ol><p>By incorporating these simple habits into your daily routine, you can start building wealth and achieving financial success. Remember, building wealth is not about getting rich quick — it’s about making smart financial decisions on a consistent basis. So start implementing these millionaire habits today, and watch your wealth grow over time.</p><p>For more information on how to build wealth and adopt millionaire habits, check out our ebook “MILLIONAIRE SECRETS.” It’s full of expert tips and strategies to help you achieve financial success. Get your copy today <a href="https://www.digistore24.com/redir/372576/martinnord/">here</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42a47e55ccaf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why you should understand physics]]></title>
            <link>https://medium.com/@martinnord/why-you-should-understand-physics-c4e3579df9a3?source=rss-36723b3116b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4e3579df9a3</guid>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[physics]]></category>
            <category><![CDATA[concave-mirror]]></category>
            <category><![CDATA[knowledge]]></category>
            <category><![CDATA[law-of-reflection]]></category>
            <dc:creator><![CDATA[Martin Nordström]]></dc:creator>
            <pubDate>Sun, 11 Mar 2018 13:35:13 GMT</pubDate>
            <atom:updated>2018-03-12T07:17:52.000Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jKtFIWR2JBa1a9hXDvf3tA.jpeg" /><figcaption>Picture by Tra Nguyen taken from Unsplash: <a href="https://unsplash.com/photos/TVSRWmnW8Us">https://unsplash.com/photos/TVSRWmnW8Us</a></figcaption></figure><blockquote><em>All of physics is either impossible or trivial. It is impossible until you understand it, and then it becomes trivial</em>.</blockquote><blockquote>- Ernest Rutherford</blockquote><h3>Before we begin</h3><p>I’ve been studying physics for a while now and I’ve actually started to like it. Physics is used to describe your motion, forces and energy of ordinary experience. In actions such as driving a car, walking, running or using a phone, physics is at work. So physics are everywhere in your everyday life and all technologies (such as the GPS)exploit the rules of physics. Since it is in your everyday life, it might feel worth understanding it (at least the fundamentals).</p><p>Also, my physics teacher gave me an assignment on writing about optics in physics and why it’s good to know about optics and physics in general.</p><h3>Why you should understand physics</h3><p>DISCLAIMER: Not every job <em>needs </em>to understand or know physics, but some do! Like architecture.</p><p>When building things there’s always aspects that you have to consider. One quick example is heat. Heat is essential to all life here on earth, which will make it special. Heat is the transfer of energy and there is three ways this energy can flow: <em>convection</em>, <em>conduction</em> and <em>radiation</em>. Architectures have to understand this so the buildings can stay at the right temperature.</p><p>Another example is optics. This is what <em>McGraw-Hill Encyclopedia of Science and Technology</em> (5th ed.) said about optics:</p><blockquote>Optics is the branch of physics which involves the behaviour and properties of light, including its interactions with matter and the construction of instruments that use or detect it.</blockquote><p>A funny, yet educational story about when optics was not included in the picture is about London’s Walkie-Talkie building aka the fryscraper. The building got it’s name due to it’s distinctive shape.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QHFRAkSnDcat9Yu3G3_Zig.jpeg" /></figure><p>The building has the design of a Walkie-Talkie due to it’s curved exterior design full with windows. The <strong>big</strong> problem with that design is that it will acts like a <a href="https://en.wikipedia.org/wiki/Curved_mirror">concave mirror</a> since the sun will shine directly onto the building for up to two hours each day.</p><h4>Concave mirrors</h4><p>A concave mirror is the the converging mirrors, since that when parallel incident rays fall on the surface of the mirror, the ray will reflect and meet at a particular point, the <em>focal point</em>.</p><p>Concave mirrors are used as reflectors in the headlights of cars, searchlights and also by dentists. So one of their use cases are to be used to amplify light.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*-Xn491qEAbKLOuSw3AZp4A.jpeg" /><figcaption>Image of a concave mirror</figcaption></figure><p>The temperature readings at the street-level went up 91°C (196 °F) and it peeked up to 117 °C (243 °F) during the summer of 2013! The reflection became so intense that a report from the newspaper City A.M. was able to fry an egg in a pan set out on the ground.</p><p>Since light always reflects according to the <a href="http://www.physicsclassroom.com/class/refln/Lesson-1/The-Law-of-Reflection">law of reflection</a>, regardless of whether the reflection occurs off a flat surface or a curved surface (like the Walkie-Talkie building). Using reflection laws allows one to determine the image location for an object.</p><h4>Law of reflection? What’s that?</h4><p>Well, when we see ourselves in a mirror, it appears that our image is actually <em>behind </em>the mirror. We will see the light coming from a direction determined by the law of reflection. The angles are such that our image is exactly the same distance behind the mirror as we stand away from the mirror. If the mirror is on the wall of a room, the images in it are all behind the mirror, which can make the room seem bigger. As being shown on the picture below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*TYbPV02rr5kX2_IDqQdLwQ.png" /></figure><p>The same logic is applied to when light rays strike the surface, it will bounce off. When calculating the angle of reflection you have to consider the angle of incidence. Because <em>I = R</em>. As seen below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e4SGWfbaI6lzTNQJEON54w.png" /><figcaption>Source: <a href="https://www.youtube.com/watch?v=vt-SG7Pn8UU">https://www.youtube.com/watch?v=vt-SG7Pn8UU</a></figcaption></figure><p>Now, if the architectures of the Walkie-Talkie building had considered that their windows would act like concave mirrors and reflect the sunlight due to the Law Of Reflection there would be no burning cars, nor <a href="https://www.theguardian.com/uk-news/video/2013/sep/03/london-walkie-talkie-skyscraper-video">fried eggs</a>.</p><p>Therefore I’d like to make the statement that considering physics is something you have to do when doing projects like these since physics is everywhere. I also like to end this article with a quote from Katherine Johnson. A brilliant woman who contributed with space programs with the early application of digital electronic computers at NASA.</p><blockquote>Everything is physics and math.</blockquote><blockquote>– Katherine Johnson</blockquote><h3>Last Remarks</h3><p>This article was an assignment that I got from my physics teacher. I decided to write it here to share some knowledge so I hope you learned something new!</p><p>I usually write articles about programming and will write about how it is to be a junior developer. Follow me on here or on my other platforms for more of those types of content.</p><h3>Goals</h3><p>I have many goals this year. The most important one is to become a better developer in general, but also reach 100 followers on Medium and publish more content here that will help others to learn new things. Knowledge is power!</p><h3>Martin Nordström</h3><p><a href="https://www.instagram.com/martinnordstromcode/">Instagram</a> | <a href="https://twitter.com/martinnrdstrm">Twitter</a> | <a href="https://github.com/Martinnord">Github</a></p><h3>Sources</h3><ul><li><a href="https://books.google.se/books?id=xaYQAgAAQBAJ&amp;pg=SA6-PA4&amp;dq=A+convex+mirror+is+a+curved+mirror+in+which+the+reflective+surface+bulges+toward+the+light+source&amp;hl=en&amp;sa=X&amp;redir_esc=y#v=onepage&amp;q=A%20convex%20mirror%20is%20a%20curved%20mirror%20in%20which%20the%20reflective%20surface%20bulges%20toward%20the%20light%20source&amp;f=false">ENGINEERING PHYSICS</a></li><li><a href="https://books.google.se/books?id=cuzYl4hx-B8C&amp;printsec=frontcover&amp;redir_esc=y#PPA40,M1">Applied Photographic Optics</a></li><li><a href="https://courses.lumenlearning.com/physics/chapter/25-2-the-law-of-reflection/">Physics</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4e3579df9a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript Algorithms Challenges | Part 1]]></title>
            <link>https://medium.com/@martinnord/javascript-algorithms-challanges-part-1-a56ba47ff43f?source=rss-36723b3116b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/a56ba47ff43f</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[teach]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Martin Nordström]]></dc:creator>
            <pubDate>Sat, 10 Mar 2018 00:47:30 GMT</pubDate>
            <atom:updated>2018-03-12T10:23:08.492Z</atom:updated>
            <content:encoded><![CDATA[<p>This is the beginning of a series I will be writting about coding challanges in Javascript and how to solve them (in SOME ways).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pZWMN0lPVfh3XmddXwPWoQ.jpeg" /><figcaption>Photo taken from Unsplash. Credit to <a href="https://unsplash.com/@leecampbell"><strong>Lee Campbell</strong></a></figcaption></figure><h3>Why even bother with reading this?</h3><p>If you are planning on becoming a good programmer I bet some of you have plans on getting a job in the future. And when getting a job you have to go through a process, of which contains interviews and probably coding challenges. Some can be on a whiteboard at the company or on your computer at home. Companies usually do these types of tests because of:</p><ul><li>It shows that you know your programming logic</li><li>It shows that you have critical thinking skills</li><li>It shows how you can work under pressure</li><li>It just shows the company a general picture of how you code</li></ul><p>Therefore it’s good to know and get better at writing algorithms since it’s probably those the company want’s you to write.</p><p>I have therefore decided to start a series, “Javascript Algorithms Challenges”, where I will bring up different challenges and show how to solve them (in some ways) to make you get a better understanding about writing algorithms and understand them.</p><h3>Prerequisites</h3><p>I will be using Node.js to run the Javascript code, so you should install that before continuing.</p><p>I have created a Gist for this article so you can get started quick! Here it is:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7b14cf4ff0d72c76280b9a51f28ab10b/href">https://medium.com/media/7b14cf4ff0d72c76280b9a51f28ab10b/href</a></iframe><p>When you have Node.js installed and the Gist downloaded you are ready to go! :-)</p><h3>Challenge 1 — Reverse a string</h3><p>Since this challenge is pretty simple I will include a couple of ways on how to solve it so you can get an idea that there’s a lot of different ways to accomplish the same results. Here’s what we will start with:</p><pre>function reverseString(str) {}</pre><p>The first thing we could do is create a new variable and we’re going to set that to the string that’s passed in with split(). Since split() turns a string into an array and takes in a parameter of a separator. And because we want each character to be put in its own array value we will just be setting the parameter to &#39;’. It will look like this:</p><pre>function reverseString(str) {<br>  const strArray = str.split(&#39;&#39;);<br>}</pre><p>Then we could use the array prototype method reverse() which will just reverse the array (<em>smart right?</em>). So let’s overwrite the current value.</p><pre>function reverseString(str) {<br>  const strArray = str.split(&#39;&#39;);<br>  strArray.reverse();<br>}</pre><p>To test this we can call the function and pass in a string to see what this gives us. And let’s not forget to put a console.log() at the bottom of the function.</p><pre>function reverseString(str) {<br>  const strArray = str.split(&#39;&#39;);<br>  strArray.reverse();<br>  console.log(strArray);<br>}</pre><pre>reverseString(&#39;Hello Medium&#39;);</pre><pre>// Output:<br>[ &#39;m&#39;, &#39;u&#39;, &#39;i&#39;, &#39;d&#39;, &#39;e&#39;, &#39;M&#39;, &#39; &#39;, &#39;o&#39;, &#39;l&#39;, &#39;l&#39;, &#39;e&#39;, &#39;H&#39; ]</pre><p>Now that we get the array in reversed order we can just turn it back to a regular string. And we can do this with join() which joins the elements of an array into a string and returns the string. We can also specify a separator like we did with split(). So let’s return the new string with the join() method applied. The code will then look like this:</p><pre>function reverseString(str) {<br>  const strArray = str.split(&#39;&#39;);<br>  strArray.reverse();<br>  return strArray.join(&#39;&#39;);<br>}</pre><pre>reverseString(&#39;hello&#39;);</pre><pre>// Output: muideM olleH</pre><p>This works fine, but it is really messy. We honestly don’t even need the strArray variable! What we can do to clean this up is to just chain these methods together, like this:</p><pre>function reverseString(str) {<br>  return str.split(&#39;&#39;).reverse().join(&#39;&#39;);<br>}</pre><pre>reverseString(&#39;Hello Medium&#39;);</pre><pre>// Output: muideM olleH</pre><p>Instead of using these methods we could also use the good old FOR loop! For this example we will be using a <em>decrementing </em>FOR loop.</p><p>The first thing we should do is create a new variable that contains an empty string that will host the new created string.</p><pre>function reverseString(str) {<br>  let revString = &quot;&quot;;  <br>}</pre><p>The second step is to create the actual for loop. We will be using the str length, but like this: str.length — 1 since that it will correspond to the last letter in the string. In our case, “m”. We will also loop as long as i is greater than or equals 0 and decrement i after each iteration. Then add the newString variable to it’s self and to the index value of the array str . We also have to return the revString .</p><pre>function reverseString(str) {<br>  let revString = &quot;&quot;;<br>  <br>  for (let i = str.length - 1; i &gt;= 0; i--) {<br>    revString += str[i];<br>  }<br>  <br>  return revString;<br>  <br>}</pre><pre>reverseString(&#39;Hello Medium&#39;);</pre><pre>// Output: muideM olleH</pre><p>Congrats! You now know two ways to reverse a string in Javascript!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IQhAOkIruj1N39jF8H13CQ.jpeg" /><figcaption>Photo taken from Unsplash. Credit to <a href="https://unsplash.com/@patrickian4"><strong>Patrick Fore</strong></a></figcaption></figure><h3>Challenge 2— Palindrome</h3><p>First, a palindrome is a word or a phrase that’s the same whether it’s forward or backward. Some examples:</p><ul><li>Anna</li><li>A but tuba</li><li>Are we not pure? “No sir!” Panama’s moody Noriega brags. “It is garbage!” Irony dooms a man; a prisoner up to new era</li></ul><p>So what we are going to do is to return true if the word or phrase is a palindrome or return false if it’s not a palindrome. Pretty simple stuff!</p><p>This is our starting block of code</p><pre>function isPalindrome(str) {}</pre><p>The first we could do is reverse the string, set it’s value to a variable and since we already know how to do it this one will be super easy! I will go with our first solution since it’s the most practical (in my opinion).</p><pre>function isPalidrom(str) {<br>  const revString = str.split(&#39;&#39;).reverse().join(&#39;&#39;);<br>}</pre><p>And since a palindrome is the same thing forward as it is backward we can just check if the two different strings are equal!</p><pre>function isPalidrom(str) {<br>  const revString = str.split(&#39;&#39;).reverse().join(&#39;&#39;);<br>  <br>  return revString === str;<br>}</pre><p>We can also tidy up the code a little bit and of course call the function and pass in a string.</p><pre>function isPalidrom(str) {<br>  return str === str.split(&#39;&#39;).reverse().join(&#39;&#39;);<br>}</pre><pre>isPalidrom(&#39;Hello Medium&#39;);</pre><pre>// Output: false</pre><p>As you can see this will return false since “<em>Hello Medium” </em>is <strong>not</strong> a palidrom! But “<em>Are we not pure? “No sir!” Panama’s moody Noriega brags. “It is garbage!” Irony dooms a man; a prisoner up to new era”</em> is!</p><pre>function isPalidrom(str) {<br>  return str === str.split(&#39;&#39;).reverse().join(&#39;&#39;);<br>}</pre><pre>isPalidrom(&#39;Are we not pure? “No sir!” Panama’s moody Noriega brags. “It is garbage!” Irony dooms a man; a prisoner up to new era&#39;);</pre><pre>// Output: true</pre><p>One quick note thought! If we type in rAceCar it will return false since we have a capital C and a capital A. But don’t worry, the fix is super easy!</p><pre>function isPalindrome(str) {<br> str = str.toLowerCase(); <br> return str === str.split(&#39;&#39;).reverse().join(&#39;&#39;);<br>}</pre><pre>isPalidrom(&#39;rAceCar&#39;);</pre><pre>// Output: true</pre><p>Here we are just making the string to be lowercase and then compare them two.</p><p>Congratulations again! You now know how to check after palindromes with Javascript as well!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5izCoteagROfYODvbD39KQ.jpeg" /><figcaption>Photo taken from Unsplash. Credits to <a href="https://unsplash.com/@wilstewart3"><strong>Wil Stewart</strong></a></figcaption></figure><h3>Last Remarks</h3><p>I hope you found this helpful. This is the first part of my “Javascript Algorithms Challanges” series. I will try to find more fun and instructive challanges. So please follow me here or on my other social media platforms to get news about the upcomming articles!</p><h3>Goals</h3><p>I have many goals this year. The most important one is to become a better developer in general, but also reach 100 followers on Medium and publish more content here that will help others to learn new things. Knowledge is power!</p><h3>Martin Nordström</h3><p><a href="https://www.instagram.com/martinnordstromcode/">Instagram</a> | <a href="https://twitter.com/martinnrdstrm">Twitter</a> | <a href="https://github.com/Martinnord">Github</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a56ba47ff43f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Callback Functions in NodeJS]]></title>
            <link>https://medium.com/@martinnord/callback-functions-in-nodejs-bd32fef418f4?source=rss-36723b3116b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd32fef418f4</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Martin Nordström]]></dc:creator>
            <pubDate>Wed, 16 Aug 2017 23:34:38 GMT</pubDate>
            <atom:updated>2017-08-17T00:02:38.979Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*roedigbmFjRYkZobdZWuKg.jpeg" /><figcaption><a href="https://unsplash.com/collections/307675/data-tech?photo=8OyKWQgBsKQ">Image</a></figcaption></figure><p>For the record, this article will be a shot one. But first…</p><h3>What is NodeJS?</h3><p>NodeJS is a runtime for server side “Javascripting”. You probably already know that we have Javascript in thr client side (browser) that pretty much power everything we see online. And there’re a lot of different client side frameworks that runs on Javascript, like React, Angular, Vue etc. But what NodeJS lets us do is to run it on the server side.</p><p>NodeJS is also an asynchronous platform, it doesn’t wait around for things to finish, it’s <a href="https://stackoverflow.com/questions/10570246/what-is-non-blocking-or-asynchronous-i-o-in-node-js">non-blocking</a>. But how does it do that? <strong>Callbacks!</strong></p><p>Callback is a function that is called at the completion of any given task. So if I tell Node to go and to something, once that task is completed we can have a callback function to do something else. It basically allows other code to run in the meantime.</p><p>So I’d like to show what that does and what it looks like.</p><h3>The Code</h3><p>We can start off by brining in the file system package because I want to work with some files on my disk. I’ve pre-written a file named helloWorld.txt in the same directory as my app.js .</p><pre>const fs = require(&#39;fs&#39;)</pre><p>Now we’re going to make an anonymous function:</p><pre>const fs = require(&#39;fs&#39;)</pre><pre>let results = (path) =&gt; {<br>  fs.readFile(path, &#39;utf8&#39;, function(err, contents) {<br>    console.log(contents)<br>  })<br>}</pre><pre>results(&#39;./helloworld.txt&#39;)</pre><p>The first thing we do is passing in the path. Then we want to asynchronously read in a file, so we give it a path, an encoding utf8 and finally we pass in a callback function (I didn’t use an arrow function because it will easier if you see the keyword function). That function will execute once the read file is <strong>completed.</strong></p><p>This is the order once more:</p><ol><li>readFile() will run.</li><li>function(err, contents) will run after readFile() is completed.</li></ol><p>In our callback function, we are passing in an error, not because we’ll get one, but because we follow <a href="https://www.youtube.com/watch?v=dIaivzpsddA">the standard callback pattern</a>. We also pass in the contents that will come back from reading the file.</p><p>So far we’ve created a very standard anonymous function (we haven’t given it a name) that takes a path and we store it in the let <strong>results.</strong></p><p>Finally we can call reader just by calling the function with () and passing in a path.</p><p>Hit CMD + S or Command + S , bring up your console and then type node app.js (or whatever you named your file). Your output should be what’s inside of your text file, like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gTWDXJt9tGR0CUshVbiuCA.png" /></figure><p>And you’re done!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Aa-07sFMbO5A6f_Lnr4esg.png" /></figure><h3>Last Remarks</h3><p>Now, this is a very basic example, but I just wanted to give you a taste on callback functions in Node, and hopefully, you learned something!</p><h3>Goal</h3><p>I have many goals this year. The most important one is to become a better developer in general, but also reach 1000 followers on Instagram (link below).</p><h3>Martin Nordström</h3><p><a href="https://www.instagram.com/martinnordstromcode/">Instagram</a> | <a href="https://twitter.com/martindasofo">Twitter</a> | <a href="https://github.com/Martinnord">Github</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd32fef418f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Landed My First Developer Job After 78 Days.]]></title>
            <link>https://medium.com/@martinnord/how-i-landed-my-first-ios-job-after-78-days-1faf69403fc6?source=rss-36723b3116b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/1faf69403fc6</guid>
            <category><![CDATA[first-job]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[career-advice]]></category>
            <dc:creator><![CDATA[Martin Nordström]]></dc:creator>
            <pubDate>Fri, 28 Apr 2017 22:44:57 GMT</pubDate>
            <atom:updated>2017-08-04T19:11:23.162Z</atom:updated>
            <content:encoded><![CDATA[<h4>“Life is like riding a bicycle. To keep your balance you must keep moving.” — Albert Einstein.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C5GcYm06OtIBEn17B-CW4g.jpeg" /></figure><h3>Background</h3><p>It wasn&#39;t till I got into high school my interest for programming started to develop, before that. I <strong>hated </strong>it. My friend <a href="https://www.oskaryildiz.me/">Oskar </a>introduced me to web development about one year ago and I started to enjoy it. I never became a pro, but I managed to create some websites, i.e. my own. So, I first touched code about one year ago.</p><h3>Related experience</h3><p>Before I got into development I was a web developer, but after some time I got tired of it and wanted a change. So I downloaded Xcode from the App store and booted up the playground. After some time I started to get comfortable with Swift. I believe that you never know when you are ready for something, you just need to take the shot, so I started to apply for internships over the summer, even though I’ve been coding with Swift for about 1,5 months (crazy, I know).</p><h3>I took the shot</h3><p>I applied to a lot of companies, too many for me to remember. My inbox was filled with emails containing: “Sorry, but we can’t take in you right now”, “There’s no space here”, “You need more experience” etc. But I never gave up, I continued to search and apply, till one startup was interested and wanted to meet me. The first thought I got was; “What the f*ck have I done?!”, but I acted cool and went on their meeting.</p><p>They liked me (I think) and decided to send me a test. The test was related to what they’re doing and if I pass the test I will have good prerequisites to get the job. I won’t go into too much detail about the test, but I wanted to rip my hair off because I had no idea what I was doing. But again, I didn’t give up, I continued to work and learn because I wanted the job so bad.</p><blockquote>“You can do anything you set your mind to”, Benjamin Franklin.</blockquote><p>And I passed it and got the job. I got the agreement, signed it and <strong>*poof*</strong>, I was a hired as a developer. I went from watching videos and reading about software development and used my self-taught knowledge to get a job as a developer. I was so proud and the feeling was amazing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F9YJIUNLVzd1QcZcuqXK2Q.jpeg" /></figure><h3>How I did it</h3><h4>Step 1 — Teaching Myself Software Development</h4><p>The first and oblivious part is to teach yourself software development. I actually began with buying a course on <a href="https://www.udemy.com/devslopes-ios10/">Udemy</a>. I followed along on some videos, but I wanted a different kind of learning recourse, so I started to read <a href="https://www.hackingwithswift.com/">Hacking with Swift</a>. A really great book with a lot of small projects which gives you a foundation around software development. But after some time I realized that the most effective way to learn is by doing. Try different things, make small apps and just hack along!</p><h4>Step 2 —Showcasing Myself</h4><p>I began to upload my projects to my <a href="https://github.com/Martinnord?tab=repositories">Github profile</a> so I have somewhere to showcase them and show that I am an active developer. I also started to build up my <a href="https://www.linkedin.com/in/martin-nordstr%C3%B6m-865670116/">LinkedIn profile</a> so I would look more professional.</p><h4>Step 3 —Introducing Myself to the Company</h4><p>When I started to feel comfortable with software development, I started reaching out to companies in my area. At first, everything felt hopeless, no one responded to my email and those who did ditch me. But after a while, one startup responded and wanted to meet me.</p><h4>Step 4— The Interview</h4><p>The final, scariest and most important part in the process. I watched countless of hours how to nail an interview and how to act cool, but nothing helped. This is where you will talk about the apps you’ve built, the skills you have and <strong>why </strong>want to be an software developer. If the interview went well, they will probably send you a test that they want you to pass, and if you pass it, you’re home safe.</p><h3>Last Remarks</h3><p>I hope you got some insights about how to take your coding career to the next level and that you found at least one thing valuable!</p><h3>Goal</h3><p>I have many goals this year. The most important one is to become a better developer in general, but also reach 1000 followers on Instagram (link below). I also want to post a Medium article/ guide every week, so hit the follow button!</p><h3>Martin Nordström</h3><p><a href="https://martinnord.me/">Personal website</a> | <a href="https://www.instagram.com/iwritethingswith_code/">Instagram</a> | <a href="https://twitter.com/martindasofo">Twitter</a> | <a href="https://github.com/Martinnord">Github</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1faf69403fc6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pull to Refresh — iOS10 Tips]]></title>
            <link>https://medium.com/@martinnord/pull-to-refresh-ios10-tips-c151e80345a1?source=rss-36723b3116b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c151e80345a1</guid>
            <category><![CDATA[appdev]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Martin Nordström]]></dc:creator>
            <pubDate>Tue, 14 Mar 2017 20:43:40 GMT</pubDate>
            <atom:updated>2017-03-15T08:57:43.431Z</atom:updated>
            <content:encoded><![CDATA[<h4>Learn how to do the classical spinning wheel</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kKUCtxSjZymMOP3Urv0lKw.jpeg" /></figure><p><strong>NOTE: I will call TableViewController for TVC</strong></p><p>The origin of the pull to refresh was originally created by the people at Twitter. This tiny spinning wheel has become so universal that you almost need to have it in your projects. This article (guide) will show you how to implement that tiny wheel. So follow along!</p><p>The first step is obviously to create a new Xcode project. It needs to contain a storyboard with a UITableViewController.</p><ul><li>In Xcode, navigate to your <strong>Main.storyboard </strong>and delete the current View Controller.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LIvbu9RylMoModltMGZjIQ.jpeg" /></figure><ul><li>In the Object Library start typing this: “Table View Controller” and then drag it over to your storyboard.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h-fYPuWbcxoNQWudLJaq_Q.jpeg" /></figure><ul><li>Then click on the yellow circle on top of the TVC and navigate to the Attribute Inspector and click on the “Is Initial View Controller” checkbox (it should become blue).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ymD7rf83bMd6LyMZAzggJw.jpeg" /></figure><ul><li>Then head up to <strong>File</strong>, <strong>New</strong>, <strong>File… </strong>and then select the <strong>Cocoa Touch Class</strong>. Make sure the subclass is <strong>UITableViewController </strong>and save it with the language <strong>Swift</strong>. Name it whatever you like, but I’ll just call it <em>TableViewController</em>.</li><li>Select you TVC again, but this time click on the <strong>Identity Inspector</strong>. And select the class you just created (the Cocoa Touch Class).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YapJ7Vxmhe3Cw56Q1F4Qlg.jpeg" /></figure><h3>Now you’re all set to start coding!</h3><ul><li>Click on your new Cocoa Touch Class and you’ll see a lot of sh*t. But don’t worry, we will only need four methods here. By the way, you call a func inside a class for a method.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eFFobch04XVjp3w7NTWTpg.jpeg" /></figure><ul><li>Create an array of type int, <strong>but</strong> don’t put anything inside it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*jFWj789S5lszwnPjBLn9xQ.png" /></figure><ul><li>In the <em>numberOfRowsInSection</em> method type your array’s name and <em>.count</em>. And in the other method, <em>cellForRowAt</em>, change the identifier from <em>cell</em>, to the name of you TVC’s identifier. You also need to include this line of code: <em>cell.textLabel?.text = String(myArray[indexPath.row])</em>(See screenshot below).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H6nXbX24BVlaFWzujMWbTA.jpeg" /></figure><ul><li>Before we begin with the reason why you’re reading this we need to make sure everything is working correctly. So, add some values (1, 2, 3) in your array and launch the app.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*S316ElJrEvHxknjpn4aujA.png" /><figcaption>If you have done what I’ve done you should see this. If not, <a href="https://github.com/Martinnord/Pull-To-Refresh"><strong>Github source code.</strong></a></figcaption></figure><h3>Everything works? Great! Let’s get to business!</h3><ul><li>First we need to have something our application needs to process (update). Therefore I created a really simple method:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/297/1*rIQBss44vI0gThbHi-hm1g.png" /></figure><ul><li>After that include this into your program:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*acDpjA57NRJa3SB-R9lEwA.jpeg" /></figure><ul><li>And lastly we need to tell our app when to stop reloading the data:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*8F6cFsosMVts_uDiWEPzXA.png" /></figure><p>If you want to see a screenshot on all of the code, here you go:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NGgjzCE7pGOkgDupTrTUdQ.png" /></figure><h3>You’re done!</h3><p>Congratulations! You’ve just created a pull to refresh in Swift 3! Let’s see if it works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*7YpxawyxrXT279imeT9e5Q.png" /></figure><p>And after we release..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*Lqr7Dsl9aQWo2PsK6aZBSw.png" /></figure><p>Look at that! It updated to the new data! Keep in mind that you can only do this once, because the data doesn’t change like an API can do. But you can still swipe down an see the spinning wheel.</p><h3>Last Remarks</h3><p>Hope you found this guide somewhat useful! This is my first time ever writing a guide, so don’t hate too much!</p><h3>Goal</h3><p>I have many goals this year. The most important one is to become a better developer in general, but also reach 1000 followers on Instagram (link below). I also want to post a Medium article/ guide every week, so hit the follow button!</p><h3>Martin Nordström</h3><p><a href="https://martinnord.me/">Personal website</a> | <a href="https://www.instagram.com/iwritethingswith_code/">Instagram</a> | <a href="https://twitter.com/martindasofo">Twitter</a> | <a href="https://github.com/Martinnord">Github</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c151e80345a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s talk about Core Data]]></title>
            <link>https://medium.com/@martinnord/lets-talk-about-core-data-c33ba722353e?source=rss-36723b3116b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c33ba722353e</guid>
            <category><![CDATA[swift-programming]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[core-data]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Martin Nordström]]></dc:creator>
            <pubDate>Mon, 06 Mar 2017 21:54:55 GMT</pubDate>
            <atom:updated>2017-03-07T10:07:33.022Z</atom:updated>
            <content:encoded><![CDATA[<h4>I know.. It’s weird</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iXKDjRptXyf7GHpYB8IOsw.jpeg" /></figure><h3>Before Core Data</h3><p>The time is 08:17 pm and you’re late for work. The night before was really crazy and you forgot to charge your phone overnight and you barely got up from bed. You get on the subway all stressed out and write this long text to your boss explaining and begging her not to fire you. And just before you press the big green “send” button your phone dies. You start to panic even more, but discover a power-bank in your backpack so you immediately begin to charge your phone. When it boots up and you enter the message app your long and precious message is gone. Instead of writing a new message you run to the office and meet the boss who has already begun packing your stuff. And she says, “A simple text would prevent this”.</p><p>I know, I know, that description is really long and weird, but it was like that before <strong>persistence </strong>data. Don’t get worried about that highlighted word over there, I have an explanation:</p><p>Persistence: “<em>Saving data to a place where it can be re-accessed and retrieved upon restart of the device or app which is necessary for any app that wants to store data long term and keep it available to the user</em>”</p><p>I know what you’re thinking. “Wasn’t this article about Core Data and not about persistence?”</p><p>And you’re right, but Core Data is just another common option of the <strong>data persistence options</strong>. The four most common are <strong>Default System</strong>, <strong>Property List</strong>s, <strong>SQLite</strong> and <strong>Core Data</strong>.</p><p>It just happens that Core Data is dominating every other option right now. But why?</p><h3>Why Core Data?</h3><p>Core Data is basically a framework like UIKit, but a bit more complex. It is used to manage models or data. There are a couple of built-in features that will make a difference:</p><ul><li><strong>1. Filtering</strong></li><li><strong>2. Save on the disk</strong></li><li><strong>3. Undo and redo to data</strong></li><li><strong>4. Partial loading unlike UserDefaults</strong></li><li><strong>5. Change tracking of data</strong></li></ul><p>Okey, that sounds great. But what is Core Data?</p><h3>What is Core Data?</h3><p>Core data is Apples almost proprietary system for persistent data storage. It’s basically a framework that you can find on Github, but a bit more complex.</p><p>Core Data is also not a database. If you’re familiar with MySQL, you might know that relational databases stores data in the form of row, table, and column. So, don’t mix up Core Data with a database. Though <a href="http://www.sqlite.org/">SQLite</a> database is the default persistent store for Core Data on iPhone, Core Data is not a relational database.</p><p>When only using Core Data you can map the objects in your apps to the tables records in the database, without knowing any SQL.</p><h3><strong>How should I learn Core Data?</strong></h3><p>As our own Aristotle once said, “<em>For the things we have to learn before we can do them, we learn by doing them</em>.”</p><p>It’s all about implementing your knowledge in real-life projects and <strong>just do it!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*03zDjjHlO07kCUwNaAd4Yg.jpeg" /><figcaption>Props for you guys that got the Nike reference (Just Do It)</figcaption></figure><p>If you want to learn Core Data I would recommend building a ToDo-List app. It will teach you the foundations about Core Data, such as <strong>Attributes</strong> and <strong>Relationships. </strong>Afterward you can start taking on more complex projects, like a dream lister app (<a href="https://github.com/Martinnord/DreamLister">Github source code here</a>) that will teach you about <strong>Relationships</strong> in Core Data.</p><p><a href="https://www.udacity.com/"><strong>Udacity</strong></a> is one of many websites that has great tutorials about Core Data.</p><h3>Last Remarks</h3><p>I haven’t deep dived into Core Data (yet!), but I hope this could be a starting point for all you developers out there. I also want to point out that this is my first Medium post, so go soft on me!</p><h3>Goal</h3><p>I have many goals this year. The most important one is to become a better developer in general, but also reach 500 followers on Instagram (link below). But after writing this article I want to add one more goal to my list and the goal is about me writing a Medium article per week. So, every Monday I will pop up in your feed if you start following me.</p><h3>Martin Nordström</h3><p><a href="https://martinnord.me/">Personal website</a> | <a href="https://www.instagram.com/iwritethingswith_code/">Instagram</a> | <a href="https://twitter.com/martindasofo">Twitter</a> | <a href="https://github.com/Martinnord">Github</a></p><h3>Sources</h3><p><a href="https://classroom.udacity.com/courses/ud325/lessons/7708131740/concepts/78813219080923#">https://classroom.udacity.com/courses/ud325/lessons/7708131740/concepts/78813219080923</a>#</p><ul><li><a href="https://code.tutsplus.com/tutorials/ios-from-scratch-with-swift-data-persistence-and-sandboxing-on-ios--cms-25505">iOS From Scratch With Swift: Data Persistence and Sandboxing on iOS</a></li><li><a href="https://classroom.udacity.com/courses/ud325/lessons/7708131740/concepts/78813219080923">Udacity</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c33ba722353e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>