<?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: arindavis</title>
    <description>The latest articles on DEV Community by arindavis (@arindavis).</description>
    <link>https://dev.to/arindavis</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%2F563269%2Fdf40382e-f8e6-4f19-8966-0f80f6f5056a.jpeg</url>
      <title>DEV Community: arindavis</title>
      <link>https://dev.to/arindavis</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/arindavis"/>
    <language>en</language>
    <item>
      <title>5 Keys to Succeeding In Any Coding Bootcamp</title>
      <dc:creator>arindavis</dc:creator>
      <pubDate>Thu, 20 May 2021 20:37:04 +0000</pubDate>
      <link>https://dev.to/arindavis/5-keys-to-succeeding-in-any-coding-bootcamp-3c1e</link>
      <guid>https://dev.to/arindavis/5-keys-to-succeeding-in-any-coding-bootcamp-3c1e</guid>
      <description>&lt;p&gt;Having just completed an intensive coding program, I've found that I've accumulated quite a lot of advice that I wish I could retroactively give to my younger self when she was just starting out. Since the Elon Musks of the world refuse to seriously invest in time travel any time soon, I'm gonna give all that advice to you, the reader, instead.&lt;/p&gt;

&lt;p&gt;So listen close and follow along with the points below. You may have some idea of what you're about to get into, but chances are you probably don't.&lt;br&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gK9oO8Mi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ysy2fjju7agcomiiuwup.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gK9oO8Mi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ysy2fjju7agcomiiuwup.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Utilize your instructor's help (really though)&lt;/strong&gt;&lt;br&gt;
This one helped me so much, and is probably the most important tip you should take away from this blog post. So often we are afraid of asking stupid questions for fear of being seen as inferior, but we need to learn to move passed this instinct if we are to succeed in a high stakes environment. I posit that stupid questions are the most important questions, because they will &lt;em&gt;always&lt;/em&gt; clear the air and foster greater group understanding after having been answered.&lt;/p&gt;

&lt;p&gt;Notice I used the word &lt;em&gt;group&lt;/em&gt; there, because most of the time when you have a stupid question, someone else is probably also wondering something similar (if not the same exact question). One of you needs to be brave enough to ask, and it might as well be you!&lt;/p&gt;

&lt;p&gt;Even if no one else is wondering it, though, and someone does think lesser of you for asking what might be obvious to them, I think it's still worth it to ask. You're paying good money to be here and taking a huge risk by setting a ton of time aside to learn this skill, get your money's worth and ask that question! Temporary embarrassment is worth a skill you'll have for a lifetime.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hq2bmy6P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wylrmk0mbyxlai3vb2d5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hq2bmy6P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wylrmk0mbyxlai3vb2d5.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Find resources outside of your course&lt;/strong&gt;&lt;br&gt;
Whether its technical documentation, youtube videos, or an entire online course, outside resources are going to help you go the extra mile. I know this sounds daunting, because your workload is already going to be insane, but I'd encourage you to basically say goodbye to most other parts of your life and dive head first into working after hours. Obviously you are going to want to stay ahead of your assigned workload(see tip 4), but when you can find the time you need to be practicing even more. &lt;/p&gt;

&lt;p&gt;The idea is that you need to be getting as many hours in coding as humanly possible, as this will make you more competent throughout the program as well as make you a more attractive candidate during your eventual job hunt. &lt;/p&gt;

&lt;p&gt;If you're looking for recommendations, there was a free &lt;a href="https://scrimba.com/learn/learnreact"&gt;React Scrimba&lt;/a&gt; course that my entire cohort swore by. Scrimba is an excellent tool, and probably has a course on something you're studying.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_FIkXybG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ps7tbjeheeig1qxukde.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_FIkXybG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ps7tbjeheeig1qxukde.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Get to know your cohorts&lt;/strong&gt;&lt;br&gt;
This one may seem obvious, but it's still worth mentioning. You're going to run into a problem relatively soon where you feel burnt out, uninspired and like you aren't getting anywhere with your work. When you go to explain this to anyone outside of your cohort, you'll get some support, sure, but more often then not people won't know how to relate to you or what you're going through. &lt;/p&gt;

&lt;p&gt;But you know who does? Literally the rest of the cohort. We are social creatures, and knowing that someone else is struggling in the same way you are can help contextualize your mental state and make you feel less alone. We all struggle with imposter syndrome at one time or another, and the best cure for it is simply talking about it with those who understand. As you progress throughout the program, these strangers will eventually become friends. There's a strange phenomenon that happens when a group of people are all put under the same stress at the same time, a sort of bond that will last well beyond the program itself. &lt;/p&gt;

&lt;p&gt;Even beyond that bond, these peers of yours are the first stepping stone for your professional network. Not only is it merely beneficial to befriend them, it can often be crucial.   &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MoPhdnrb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d93kxin93uuz44e0p1iw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MoPhdnrb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d93kxin93uuz44e0p1iw.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Strive to stay ahead on your workload&lt;/strong&gt;&lt;br&gt;
This may seem like another obvious one, so I'll keep it relatively short. You're going to have a lot of work to do, there's no getting around it, so I encourage you to instead get &lt;em&gt;ahead&lt;/em&gt; of it. Nothing ensures success like having everything turned in 10 minutes early, and no early bird every complained about not getting a worm. &lt;/p&gt;

&lt;p&gt;There's not much else to say on that front, just make sure you hold yourself accountable to this goal. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fuD6vZWy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e3nsb140wqw4jwndgxoa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fuD6vZWy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e3nsb140wqw4jwndgxoa.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Take Care of Yourself, mentally and physically&lt;/strong&gt;&lt;br&gt;
This one is everything. Just because you're going to be sitting down at a computer for most of your time in the program doesn't mean you have to resign yourself to a sedentary lifestyle. Take walks when you can, drink tons of water, go to sleep on time. There is &lt;a href="https://www.theguardian.com/education/2016/jun/18/how-physical-exercise-makes-your-brain-work-better"&gt;scientific evidence&lt;/a&gt; that a better body leads to better learning. &lt;/p&gt;

&lt;p&gt;You will need to take care of yourself mentally, as well. As previously discussed, reach out to your peers, but don't rely on them for your sanity. They have enough on their plate already and probably can't handle whatever you're throwing at them at every single moment. Go outside. Get away from the screen for a bit. Call up a friend for 10 mins and talk about anything other than coding. &lt;/p&gt;

&lt;p&gt;Sometimes taking a break and recognizing your fallibility as a human is exactly what you need, and you'll end up coming back to your problem with a fresh set of eyes, ready to solve whatever road block that was just driving you up a wall. &lt;/p&gt;

&lt;p&gt;Burnout is real, and will be your worst enemy. Get on top of it before it happens by being aware of it as a threat. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QLSONQPT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8kzo9t19e0gyl6flbmbf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QLSONQPT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8kzo9t19e0gyl6flbmbf.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that's the list. I hope it helped someone out there, and if you're currently struggling through a similar program then I'd like to remind you that you got this, and what you're doing isn't impossible. It's just really, really difficult. &lt;/p&gt;

&lt;p&gt;And that makes it worth doing! &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Follow the Data: Interplanetary Edition</title>
      <dc:creator>arindavis</dc:creator>
      <pubDate>Tue, 11 May 2021 03:39:14 +0000</pubDate>
      <link>https://dev.to/arindavis/follow-the-data-interplanetary-edition-han</link>
      <guid>https://dev.to/arindavis/follow-the-data-interplanetary-edition-han</guid>
      <description>&lt;p&gt;Heres one of the best pieces of advice that I could give for any aspiring software developer: follow the data. When in doubt, trace the path of your information through the course of your application and analyze it at every step of the process. If you follow this advice, you will without a doubt begin to see the larger context of your program and eventually gain the understanding you need to move forward. &lt;/p&gt;

&lt;p&gt;That being said, let's have some fun with it.&lt;/p&gt;

&lt;p&gt;I want to "follow the data" on an insane interplanetary scale. At the end of this blog I'm going to post a picture taken by Ingenuity, NASA's newly deployed helicopter drone. Between now and the moment you see that photo we are going to follow it all the way from the surface of the Red Planet straight to your personal device.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--b_QZFbc_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gp2g877tkntsmqamkebm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--b_QZFbc_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gp2g877tkntsmqamkebm.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ingenuity has been equipped with two cameras, each with its own purpose. The primary navigation camera is downward facing, black-and-white and a mere 0.5 megapixels. The secondary camera, sometimes referred to as the "terrain camera", is full color, 13 megapixel and horizon-facing. Thankfully this is the one our picture was taken on.&lt;/p&gt;

&lt;p&gt;Now that the picture has been taken we just need to send to Earth, right? Easy peasy. &lt;/p&gt;

&lt;p&gt;Not so much. Ingenuity is equipped only with a short range communications antenna located in the middle of it's solar array, so it actually needs to route the data through a Helicopter Base Station (I'm not making that name up, it's super cool) on Perseverance. Here's a short blurb from the official &lt;a href="https://www.jpl.nasa.gov/news/press_kits/ingenuity/landing/mission/spacecraft/"&gt;NASA press documentation&lt;/a&gt; about Ingenuity and the base station's relationship:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Ingenuity and the base station use a UHF telecom link (900 MHz) to communicate with each other. The system can relay data at up to 250 kilobytes per second over distances of up to 3,300 feet (1,000 meters). During flights, a one-way data stream will be sent in real time from the helicopter to the rover for storage and subsequent retransmission to Earth. After landing, the helicopter will re-transmit the inflight data stream and additional data from the flight.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now the data is on Percy, but where does it go from here? Well, depending on the time of sol (Martian day), Percy will send it to one of the several Mars orbiters waiting just outside the atmosphere. It could be the European Space Agency's &lt;a href="https://exploration.esa.int/web/mars/-/46475-trace-gas-orbiter"&gt;Trace Gas Orbiter&lt;/a&gt;, or perhaps it's NASA's &lt;a href="https://www.planetary.org/space-missions/maven#:~:text=NASA's%20Mars%20Atmosphere%20and%20Volatile,the%20planet%20lost%20its%20water."&gt;MAVEN&lt;/a&gt; orbiter. For the sake of continuing our journey, lets just say Percy happened to catch &lt;a href="https://mars.nasa.gov/mro/"&gt;MRO&lt;/a&gt;, the Mars Reconnaissance Orbiter, which was placed into martian orbit in 2006. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HrMoefKv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8djvr24o9r7regkizhd5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HrMoefKv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8djvr24o9r7regkizhd5.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's important to note what kind of technology is being used for these data transfers. Percy is most likely transmitting from a low gain antenna, which basically means it's a wide and weak signal. What MRO is about to do, transmit from Mars to earth, will be done with a high gain antenna, which is a highly concentrated and narrow signal meant for long distances. Here are the stat's on MRO's transfer rates straight from &lt;a href="https://mars.nasa.gov/mro/mission/communications/commxband/#:~:text=At%20its%20maximum%20distance%20from,making%20higher%20data%20rates%20possible."&gt;NASA&lt;/a&gt;'s own documentation:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The X-band communication system on the orbiter uses a 3-meter-diameter (10-foot) high-gain antenna and a 100-watt X-band radio traveling wave tube amplifier to transmit signals to Earth. Each of these devices is more than twice as powerful as those used by most Mars missions. As a result, Mars Reconnaissance Orbiter is able to send data back to Earth more than 10 times faster than previous missions.&lt;br&gt;
At its maximum distance from Earth of about 250 million miles, the orbiter sends data at a rate of at least 500 kilobits per second. At closer ranges, the signal strength is greater, making higher data rates possible. For several months when Mars Reconnaissance Orbiter is at its closest range of about 60 million miles, the orbiter sends data to Earth at 3 to 4 megabits per second. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Depending on how close Earth is to Mars at the time of the data transfer, it can take anywhere between 3 and 22 minutes to get that signal from one planet to the other.&lt;/p&gt;

&lt;p&gt;So here we are, arriving at Earth. One would assume that our photo is heading straight to NASA HQ, which you probably assume is somewhere in Florida, right? &lt;/p&gt;

&lt;p&gt;You'd be wrong on both counts (NASA's HQ is in Washington DC, duh). Because our signal has traveled anywhere between 33.9 million and 196 million miles to get to us, chances are it's now pretty faint and hard to pick up via ordinary means.&lt;/p&gt;

&lt;p&gt;That's where the &lt;a href="https://www.nasa.gov/directorates/heo/scan/services/networks/deep_space_network/about"&gt;Deep Space Network&lt;/a&gt;(DSN) comes in. The DSN, another awesome name, is a network of three high powered antennas located at roughly equal distance of each-other all across the globe. It has been around since the 50s, and is the first point of contact for nearly all of man's communication to the stars. &lt;/p&gt;

&lt;p&gt;The three antennas are located in California, Spain and Australia. This insures that no matter the time of day or position of Earth along its tilt, a signal from any direction can be intercepted. I don't know which of these three locations our photo really landed at, but let's say it was the one near Madrid, Spain. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ch6elFDH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wonlejj3ifzu8y86cygf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ch6elFDH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wonlejj3ifzu8y86cygf.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our photo only has a couple more stops. First it will most likely travel under the Atlantic via seafloor internet cables, through the heart of the continental US and straight to NASA's Jet Propulsion Laboratory in California. Here it will be processed, and eventually sent out to the public via a mixture NASA's own servers and word of mouth through the press. &lt;/p&gt;

&lt;p&gt;It will sit around for a while before some presumptuous tech blog writer copies and pastes its URL into a middling DEV.to post, for you to now enjoy. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--M_p1bGwl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/82e2qywj3g920pdckll7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--M_p1bGwl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/82e2qywj3g920pdckll7.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's glorious, it's everything I dreamed, it's...&lt;/p&gt;

&lt;p&gt;Some tracks in the dirt. &lt;/p&gt;

&lt;p&gt;Well, &lt;em&gt;I&lt;/em&gt; think it's neat! And now that you know how we got that picture you also know how we send data back to Ingenuity. That's right, if you reverse our steps throughout that entire process, you'd travel the same exact route that that first "deploy" command ran from the type of a keyboard on Earth all the way to our friendly little Helicopter buddy on Mars. &lt;/p&gt;

&lt;p&gt;Follow the data!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>So, You Want to Know A Little More About Video Game Sound?</title>
      <dc:creator>arindavis</dc:creator>
      <pubDate>Tue, 04 May 2021 02:32:49 +0000</pubDate>
      <link>https://dev.to/arindavis/so-you-want-to-know-a-little-more-about-video-game-sound-p07</link>
      <guid>https://dev.to/arindavis/so-you-want-to-know-a-little-more-about-video-game-sound-p07</guid>
      <description>&lt;p&gt;Sound design is one of those creative skills that, when done just right, will go completely unnoticed by the end user. If a sound calls attention to itself outside the realm of immersing you deeper into an experience, then the designer isn't doing their job right. That line between immersion and distraction is even more blurry and tenuous than you, the average game enjoyer, may even realize. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick Disclaimer: Although I have experience in sound design, musical composition for films and general full stack software development, I have not worked in the game industry. This week's blog is meant to be used as a stepping stone for someone who knows next to nothing about sound design in video game development and wants to be pointed in the right direction.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So where should we start with such an all encompassing topic? The history, of course. &lt;/p&gt;

&lt;p&gt;When the first commercial games were being released in the seventies, most video game consoles had less sound rendering capability than a modern dishwasher. Take, for example, &lt;em&gt;Pong&lt;/em&gt;. An all time classic. &lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/fiShX2pTz9A"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;All of the distinct sounds you hear here, the sound of the pong hitting a player's paddle, hitting the wall or even scoring a point, are all the same exact sound, simply stretched or squished to give a desired effect. Even with the strict limitations of the Atari hardware, the developers made it work. This is a great precursor to everything else we are going to talk about. &lt;/p&gt;

&lt;p&gt;As the industry progressed into the 80s and 90s the tech got a lot better, especially with the rise of companies like Nintendo, but the same limitation that plagued Atari kept rearing its ugly head: memory. The average size of a game on the Nintendo Entertainment system (1983), often shortened to NES, was a mere 384kb. As if there wasn't already enough creative restraints, the NES was limited to a handful of audio channels.  &lt;/p&gt;

&lt;p&gt;All of that considered, here's what Koji Kondo, composer for &lt;em&gt;Super Mario Bros&lt;/em&gt;, was able to do with it: &lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/uhscMsBhNhw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;From &lt;a href="https://en.wikipedia.org/wiki/Koji_Kondo"&gt;wikipedia&lt;/a&gt;: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The game's melodies were created with the intention that short segments of music could be endlessly repeated during the same gameplay without causing boredom. Kondo's soundtrack to Super Mario Bros. gained worldwide recognition, and is the most well-known video game score in history. The main theme is iconic in popular culture and has been featured in more than 50 concerts, been a best-selling ringtone, and been remixed or sampled by various musicians.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The lesson we take from these two famously cherry picked examples? The limitations of the hardware can often lead to major creative innovations. &lt;/p&gt;

&lt;p&gt;Fast forward to the turn of the century. The video game industry is growing at exponential rates. Releases like &lt;em&gt;Doom&lt;/em&gt;(1993), &lt;em&gt;Half-Life&lt;/em&gt;(1998) and &lt;em&gt;Halo&lt;/em&gt;(2001) have continually broken financial barriers and video games are becoming mainstream. &lt;/p&gt;

&lt;p&gt;With that rapid rise in popularity comes more standardization across the industry. As the high expectations continue to grow, game studios find themselves turning to already constructed game engines like Unreal &lt;a href="https://en.wikipedia.org/wiki/Unreal_Engine"&gt;Engine&lt;/a&gt;, and audio middle-ware like &lt;a href="https://www.audiokinetic.com/library/edge/?source=Help&amp;amp;id=welcome_to_wwise"&gt;Wwise&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9-nL9zzG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wd3bp1z5ycnagfkjoj9v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9-nL9zzG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wd3bp1z5ycnagfkjoj9v.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Which is still the widespread standard today!&lt;/p&gt;

&lt;p&gt;Wwise acts as a sort of DAW(digital audio work station) for video game sound designers/composers, with a heavy emphasis on the logic and event based timing in the game world. It works with the game engine's event triggering systems to insure the right sound plays when it needs to, how it needs to, and in the correct place in relation to the player.&lt;/p&gt;

&lt;p&gt;This tool is used by sound designers and composers alike, as musical timing can be the key to maintaining our suspension of disbelief when in a game world. One of my all time favorite musical queues in a video game can be found in Naughty Dog's &lt;em&gt;The Last of Us&lt;/em&gt;:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/pMjdl_uYXgE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;And although it might seem like deceptively simple implementation, &lt;em&gt;play the music when the cute animals appear&lt;/em&gt;, there's a lot of work happening behind the scenes to make sure the timing is just right. The player could choose to walk slowly or at a brisk pace, wait around before getting there or even try and speed through it as fast as possible and the music still needs to sound &lt;em&gt;organic&lt;/em&gt;. No matter what.  That means that the music itself, including the build up, execution of the leitmotif and resolution, need to &lt;em&gt;dynamically change&lt;/em&gt; depending on the players input. &lt;/p&gt;

&lt;p&gt;Without the player ever noticing. Seems like a tall order, right?&lt;/p&gt;

&lt;p&gt;And even with all the fancy advancements we have made in the realm of game technology since &lt;em&gt;Pong&lt;/em&gt;, memory is still the primary limiting factor for most developers. Modern AAA games often exceed 100 gigs, which could fit millions of copies of &lt;em&gt;Super Mario Bros.&lt;/em&gt; with absolutely no issue. A big contributor to that bloated size is audio. Especially with open world games like &lt;em&gt;CyberPunk 2077&lt;/em&gt;, &lt;em&gt;Read Dead Redemption II&lt;/em&gt; or &lt;em&gt;GTAV&lt;/em&gt;, where musical cues/sound objects/event systems become exponentially more complex as the game world expands outwards in all directions.  &lt;/p&gt;

&lt;p&gt;Like being a software dev, being a sound engineer/composer in the games industry seems like it can often be a thankless and tiring job with a few gleaming moments of resounding success. At best, the audience won't even notice you did anything, and at worst you will completely take them out of the experience. But when you get it right, like we've just explored, you are able to create a seamless magic act that leaves your player with something long after they put the controller down. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Understanding Hardware Makes You Better at Developing Software</title>
      <dc:creator>arindavis</dc:creator>
      <pubDate>Tue, 27 Apr 2021 01:16:46 +0000</pubDate>
      <link>https://dev.to/arindavis/understanding-hardware-makes-you-better-at-developing-software-2l84</link>
      <guid>https://dev.to/arindavis/understanding-hardware-makes-you-better-at-developing-software-2l84</guid>
      <description>&lt;p&gt;For most of us, a computer is an unknowable black box. We type in our social media statuses, our youtube searches and our recipe ideas and voila! It just works. Almost like magic.&lt;/p&gt;

&lt;p&gt;Even we, the up and coming software devs of the world, will often know how &lt;em&gt;our code&lt;/em&gt; works(maybe that's a little generous), but not much beyond that. We will build it, test it for bugs, and hit "run" when it is finished without a second thought, completely oblivious to what the funny little magic box is doing behind the scenes. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Qkofr6Xp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bwamnga8yznipue9idps.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Qkofr6Xp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bwamnga8yznipue9idps.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But it doesn't have to be this way. You don't need a STEM degree to understand the fundamentals of computer hardware, and taking the time to do so can actually make you a &lt;em&gt;better&lt;/em&gt; software dev. With that in mind, let's go over the basic components of any computer, how they work, and a few real world examples that demonstrate how hardware effects the way users interact with our applications. &lt;/p&gt;

&lt;p&gt;There are seven primary parts of any computer: the CPU(central processing unit), which acts like the brain of the machine, the GPU (graphics processing unit), which serves to handle any heavy video rendering, the RAM(random access memory), which provides our applications a place to store things temporarily in memory, a SSD(solid state drive) or hard-drive, which is used to store data in the long term, a network card, which serves to connect our machine to the outside world, the motherboard, which is a place to put everything so it can communicate with each other, and last but not least, a power supply, to make sure it all gets the electricity it needs. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WUZavMqZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gw7583monp1bz68mnpra.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WUZavMqZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gw7583monp1bz68mnpra.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Not all hardware components are made equal, however. &lt;/p&gt;

&lt;p&gt;Not every computer has or even needs a GPU. A gamer playing any modern AAA game will need a pretty substantial GPU to even get past the main menu. But your dad running excel for his small business probably won't need something so dramatic. Most mid-tier laptops and phones comes with a duel CPU/GPU chip, referred to as &lt;em&gt;integrated graphics&lt;/em&gt; in the industry.  &lt;/p&gt;

&lt;p&gt;Like the GPU, the network card, depending on your use case, is optional. If you don't need your machine to be connected to the internet at all (an admittedly rare phenomena these days) then paying for a network card is basically money wasted. Most motherboards come with a network card built in anyways these days, so don't sweat it too much if you're in the market. &lt;/p&gt;

&lt;p&gt;Which leaves us with only the bare essentials: CPU, RAM, motherboard, power supply and storage. These are the basic necessities of any modern computer. I can guarantee with about 99% certainty that whatever you are reading this blog with has at least these five basic parts, phones included.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nLveZdsv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b9onbk3156u58i2pha04.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nLveZdsv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b9onbk3156u58i2pha04.png" alt="image"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Seeing what is necessary to the machine can help us understand what is happening under the hood when users are breaking our programs. For example, if several users have all experienced laggy loading times on your site you can probably safely assume that it's a RAM or CPU issue on their end. &lt;/p&gt;

&lt;p&gt;Maybe they have and ungodly amount of tabs open in chrome, or maybe they only have 2gbs of ram on a PC from ten years ago. No matter what the hardware issue might be, we can mitigate it (but not complete eliminate it) by taking some processes off the front end and moving them to the server side, insuring that all users, good PCs or not, get roughly the same experience and performance.  &lt;/p&gt;

&lt;p&gt;Unless it's a network issue on the user's side, which means it's completely out of our hands. You did everything you can. RIP. &lt;/p&gt;

&lt;p&gt;Even if you aren't a PC user, knowing what kind of hardware your mac users are running can still make a world of difference when you are designing software for them to use, especially with the recent launch of apple's proprietary chip, the M1. &lt;/p&gt;

&lt;p&gt;For a bit of background, apple has historically had partnerships with companies like intel to outsource their CPU's, that is until last fall when they sent shockwaves through the hardware world with apple silicon. Because they design the software and the hardware, apple is able to pack a big punch in a small package with the M1. I won't get too far into it here, because we will be here all night, but essentially they have streamlined the way your cpu, ram and motherboard all interact with each other to make one of the best performing chips of all time. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--C1Wp9Gnk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f113ekzfd4po5dtecqej.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--C1Wp9Gnk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f113ekzfd4po5dtecqej.png" alt="image"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;A brand new 700$ mac mini with a mere 8 gigs of ram can edit 8k video with little to no lag(with propiertary software), switch between multiple processes in a breeze and even render full scenes in blender better than a PC machine worth twice as much. &lt;/p&gt;

&lt;p&gt;But you know what the M1's can't do? Play most modern video games. Or run any application in the adobe suite with reliable speed. In fact, theres a whole &lt;a href="https://9to5mac.com/2020/11/24/check-m1-compatibility-for-mac-apps/"&gt;host&lt;/a&gt; of things the M1 can't do because with lightning fast proprietary hardware comes the limitations of a closed environment. &lt;/p&gt;

&lt;p&gt;Yes, there are things like &lt;a href="https://support.apple.com/en-us/HT211861"&gt;rosetta&lt;/a&gt; that can emulate environments for most non native M1 programs, but with it comes a lot of potential performance left at the door. &lt;/p&gt;

&lt;p&gt;My larger point is simple: the hardware your client is running often determines the performance of the software. By understanding this and a few extra principles, you can better prepare for when they try and break your applications. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Operating Systems in space!</title>
      <dc:creator>arindavis</dc:creator>
      <pubDate>Tue, 20 Apr 2021 04:05:57 +0000</pubDate>
      <link>https://dev.to/arindavis/operating-systems-in-space-bie</link>
      <guid>https://dev.to/arindavis/operating-systems-in-space-bie</guid>
      <description>&lt;p&gt;&lt;a href="https://www.nytimes.com/2021/04/19/science/nasa-mars-helicopter.html#:~:text=At%203%3A34%20a.m.,crater%2C%20into%20the%20Martian%20sky."&gt;NASA&lt;/a&gt; has just deployed &lt;em&gt;Ingenuity&lt;/em&gt;, a lightweight helicopter sent with the payload of the most recent Mars rover, &lt;em&gt;Perseverance&lt;/em&gt;.  At exactly 3:34 AM (ET) Ingenuity successfully executed the first powered flight on another planet. &lt;/p&gt;

&lt;p&gt;That wasn't the only first in space history today, though. As it turns out, it was also the first time a linux process has ever been executed on another planet. Which got me wondering, what other operating systems have we as a species hurled into the cosmic abyss? &lt;/p&gt;

&lt;p&gt;Let's get into it.&lt;/p&gt;

&lt;p&gt;In the early days of spaceflight, when programs like Russia's &lt;a href="https://en.wikipedia.org/wiki/Sputnik_1"&gt;Sputnik&lt;/a&gt; and the U.S's &lt;a href="https://en.wikipedia.org/wiki/Explorer_1"&gt;Explorer&lt;/a&gt; were being rolled out, each new craft came with its own custom built OS. These were often tailored to those craft's specific needs, and extremely basic by modern standards.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--L8wklo_l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/awkr6yronl1ypy6292zf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--L8wklo_l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/awkr6yronl1ypy6292zf.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter stage right: a man by the name of &lt;a href="https://en.wikipedia.org/wiki/J._Halcombe_Laning"&gt;J. Halcombe Laning&lt;/a&gt;. Laning was a pioneer of his time who worked with engineers at MIT to create the first ever real time computer in the early fifties, among many other notable accolades.  By the time the &lt;a href="https://www.nasa.gov/mission_pages/apollo/missions/index.html"&gt;Apollo missions&lt;/a&gt; were being conceived, NASA knew it would need a state of the art guidance system for it's new generation of space-craft, so they turned to Laning to help build out the software for it. Years later, the &lt;a href="https://en.wikipedia.org/wiki/Apollo_Guidance_Computer#cite_note-Hoag-17"&gt;Apollo Guidance Computer&lt;/a&gt; was launched with Apollo I, which included the same basic real time operating system designed by Laning that would dominate most of the rest of the Apollo Program. &lt;/p&gt;

&lt;p&gt;But, as with the early days, there was no real standardization during this period. That didn't come until 1987, when NASA adopted &lt;a href="https://www.windriver.com/products/vxworks"&gt;VXworks&lt;/a&gt; as it's primary OS of choice.&lt;/p&gt;

&lt;p&gt;Here's the crazy part: that standard hasn't changed in over thirty years, since it was originally adopted! Perseverance, the most recent rover that dropped off our little helicopter buddy from earlier, is running on the &lt;a href="https://blogs.windriver.com/wind_river_blog/2018/11/back-to-mars-with-vxworks/"&gt;same OS&lt;/a&gt; that crafts in the late 80's and early 90's were.  &lt;/p&gt;

&lt;p&gt;Which, to be fair, is a bit of an oversimplification. While they haven't changed from VXworks in the last three decades, NASA &lt;em&gt;has&lt;/em&gt; updated their proprietary version of it as time has gone on, so it's not like it is completely outdated. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RJmPNbV5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rleuxdn8x6o9cpn11k4y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RJmPNbV5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rleuxdn8x6o9cpn11k4y.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;VXworks itself was chosen because it was one of the leading OS's at the time, especially among government agencies and the military. According to &lt;a href=""&gt;wikipedia&lt;/a&gt;, VXworks is--- &lt;/p&gt;

&lt;p&gt;&lt;em&gt;"... designed for use in embedded systems requiring real-time, deterministic performance and, in many cases, safety and security certification, for industries, such as aerospace and defense, medical devices, industrial equipment, robotics, energy, transportation, network infrastructure, automotive, and consumer electronics."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Which makes the choice of OS for Ingenuity even more interesting. It's packing a &lt;a href="https://en.wikipedia.org/wiki/Qualcomm_Snapdragon"&gt;Qualcomm Snapdragon 801 Processor&lt;/a&gt;, which is a CPU you'd usually find in a run of the mill laptop. Running the CPU is a relatively standard linux environment that is utilizing an open source framework called &lt;a href="https://www.theverge.com/2021/2/19/22291324/linux-perseverance-mars-curiosity-ingenuity"&gt;"F Prime"&lt;/a&gt;, that was specifically designed for powered flight using Ingenuity. This means that if you wanted to, you could go to &lt;a href="https://trs.jpl.nasa.gov/handle/2014/48425"&gt;NASA's website&lt;/a&gt; and tinker with it yourself! How cool is that???&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Wr96bDtE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4mbq2w8vbu323l0bw50m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Wr96bDtE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4mbq2w8vbu323l0bw50m.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, I understand no conversation about modern space-tech would be complete without a mention of &lt;a href="https://www.spacex.com/"&gt;Space-X&lt;/a&gt;, the renegade hot-shot of the international aerospace community. &lt;/p&gt;

&lt;p&gt;Unsurprisingly, their &lt;a href="https://thenewstack.io/the-hardware-and-software-used-in-space/#:~:text=But%20it's%20not%20necessarily%20a,its%20flightpath%2Ddirecting%20grid%20fins."&gt;engineers chose linux&lt;/a&gt; as their primary OS, which runs everything from their rockets to their onboard nav systems. Like the little mars helicopter who could, they are sporting modern x86 processors to run most of their processes. The interesting part to me, a web developer who is only just getting started in the field, is that they are using languages like Javascript, Python and C++ to execute the complex processes behind the scenes and tools like HTML and CSS to display information to their astronauts in the cockpit. Hell, they are using chromium and javascript for the touchscreen functionality on the main displays!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pNovv2X_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pxuc20di1j31ea24xg5g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pNovv2X_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pxuc20di1j31ea24xg5g.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Which, in a weird way, makes me feel oddly closer to the cosmos at large. Like, one would assume that the kind of tech that helps put people into space is somewhat unknowable, left to only the smartest among us. But here we are, throwing CSS and HTML into the eternal nothing. &lt;/p&gt;

&lt;p&gt;Of course these are all incredibly complex systems built by literally the smartest people in the world, but when it's all laid out into one brief overview you can notice that it's just one generation iterating into another, and is really no more unknowable than the first time you sat down to code javascript. &lt;/p&gt;

&lt;p&gt;So raise a glass to the first linux process on the Red Planet. It will not be the last!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Content Delivery Networks and You</title>
      <dc:creator>arindavis</dc:creator>
      <pubDate>Sun, 14 Mar 2021 20:04:15 +0000</pubDate>
      <link>https://dev.to/arindavis/content-delivery-networks-and-you-1753</link>
      <guid>https://dev.to/arindavis/content-delivery-networks-and-you-1753</guid>
      <description>&lt;p&gt;Imagine for a moment that you are your favorite piece of media. You might be a song, a tv show or even Irving Kershner's 1980 all time classic, &lt;em&gt;Star Wars Episode V: The Empire Strikes Back&lt;/em&gt;. As a popular piece of media existing in the golden age of streaming, you most likely exist on a server somewhere in the midwest United States (Don't @ me, Disney. I don't actually know where you keep your secrets).&lt;/p&gt;

&lt;p&gt;So, what happens when someone wants to watch you in Tokyo, Japan? Do you travel the roughly 5,000 miles through the Pacific via &lt;a href="https://www.nytimes.com/interactive/2019/03/10/technology/internet-cables-oceans.html"&gt;seafloor cables&lt;/a&gt;, accumulating increasing amounts of latency along the way? In today's day and age, most likely not. Instead, your content provider probably has implemented a CDN to get you there a lot faster. &lt;/p&gt;

&lt;p&gt;CDN is short for &lt;a href="https://www.cloudflare.com/learning/cdn/what-is-a-cdn/"&gt;Content Delivery Network&lt;/a&gt;. It's a term used to refer to a global system of redundant servers designed with the purpose of cutting down on the latency between a domestic host and a client on the other side of the world by utilizing a unique form of &lt;a href="https://aws.amazon.com/caching/cdn/"&gt;caching&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Notice that I used the term &lt;em&gt;redundant&lt;/em&gt;, which might set off more than a few negative alarm bells in your primal, efficiency obsessed programmer brain. But in this use case, redundancy is actually the primary advantage. It ensures that if one point of the network goes down, there is immediately another &lt;a href="https://www.cloudflare.com/learning/cdn/glossary/edge-server/"&gt;edge server&lt;/a&gt; to take its place.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ostM82gy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/obssaz09b3fwgbtlbp0p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ostM82gy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/obssaz09b3fwgbtlbp0p.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By increasing redundancy, we are also decreasing the maximum possible load on the original server by avoiding network &lt;a href="https://en.wikipedia.org/wiki/Bottleneck_(software)"&gt;bottlenecks&lt;/a&gt; before they even happen. This will also present an obvious security benefit when configured correctly, as attackers from across the world would only have immediate access to their nearest edge server, and not the root server. &lt;/p&gt;

&lt;p&gt;Another big advantage here is &lt;em&gt;speed&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WBj1svw1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3n9roc16w99hv1fvfi5x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WBj1svw1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3n9roc16w99hv1fvfi5x.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Content will load significantly faster if it's coming from a CDN within your own country, opposed to being laboriously beamed from halfway across the world. This makes a huge difference in combatting streaming &lt;a href="https://www.haivision.com/resources/streaming-video-definitions/video-latency/"&gt;latency&lt;/a&gt; and will always result in more responsive media, whether it's audio, video, or even just loading elements into a simple &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Author_fast-loading_HTML_pages"&gt;html site&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;So how might you, the budding software dev, utilize a service like this? Well, it's actually a lot simpler than you might think. &lt;/p&gt;

&lt;p&gt;For the sake of providing a &lt;a href="https://www.youtube.com/watch?v=NV2eKYmQF6Q"&gt;practical example&lt;/a&gt;, I'll walk you through some of the basic steps of setting up your site with &lt;a href="https://www.cloudflare.com/"&gt;cloudflare&lt;/a&gt;, a CDN service with a pretty robust free option. First, you'll want to sign up for an account, then add your site when prompted. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HDRIo0cg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zu4bekkvdkpc4si4tu98.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HDRIo0cg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zu4bekkvdkpc4si4tu98.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, it'll take you through a series of steps including choosing your membership level, giving you a list of associated &lt;a href="https://www.bluehost.com/help/article/dns-records-explained"&gt;DNS records&lt;/a&gt;, then prompting you to link your account from wherever you &lt;a href="https://www.pcmag.com/news/how-to-register-a-domain-name-for-your-website"&gt;registered your domain&lt;/a&gt;. It may take a day or so for this step to complete, so just be patient. &lt;/p&gt;

&lt;p&gt;Finally, you'll want to dynamically link cloudflare to your site in the &lt;a href="https://www.w3schools.com/tags/att_src.asp"&gt;src script tag&lt;/a&gt; of your HTML file, which will probably end up looking something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ncPZ6yXF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wrhpx9n7z3j0thz1qjwi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ncPZ6yXF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wrhpx9n7z3j0thz1qjwi.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And voila! Your site will now be more secure, faster and more accessible to the world at large, all at no or little cost to you. &lt;/p&gt;

&lt;p&gt;Before we part ways, &lt;a href="https://www.youtube.com/watch?v=Bsq5cKkS33I"&gt;here&lt;/a&gt; are a &lt;a href="https://www.youtube.com/watch?v=pViIP0IF-nY"&gt;few&lt;/a&gt; &lt;a href="https://www.youtube.com/watch?v=YXQpgAAeLM4"&gt;videos&lt;/a&gt; that may help you &lt;a href="https://www.youtube.com/watch?v=CiphZWq3ST4"&gt;understand&lt;/a&gt; CDN's in a broader context, as it is hard to explain everything in one short blog post. Simply put, CDN's are fast, secure and increasingly needed in modern web design. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Big O, The Confusing Stuff</title>
      <dc:creator>arindavis</dc:creator>
      <pubDate>Sat, 06 Mar 2021 22:42:59 +0000</pubDate>
      <link>https://dev.to/arindavis/big-o-the-confusing-bits-2ka9</link>
      <guid>https://dev.to/arindavis/big-o-the-confusing-bits-2ka9</guid>
      <description>&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Time_complexity#Table_of_common_time_complexities"&gt;Time Complexity&lt;/a&gt; is without a doubt one of the most difficult topics to understand when you're first finding your bearings in computer science. I'm here to make the confusing parts a little easier. Specifically, any confusion you may still have regarding exponential, quadratic and logarithmic time complexities. &lt;/p&gt;

&lt;p&gt;But before we jump head first into the deep end, let's make sure we are comfortable with the easy stuff. &lt;/p&gt;

&lt;p&gt;Simply put, time complexity is a tool for analyzing the efficiency of our programs in relation to how they scale. A low time complexity will always result in faster programs, and a higher complexity will always result in slower programs. &lt;/p&gt;

&lt;p&gt;Constant and linear complexities are represented in Big O notation as-&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;O(1) &amp;amp;&amp;amp; O(n)&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;respectfully, and are easy enough to understand on their own. A constant time complexity will take the same amount of time to perform its operations no matter the size of the input, so we denote it as "1". &lt;/p&gt;

&lt;p&gt;The time complexity of linearly scaled programs will always exist in direct relation to the size of the input, represented above as &lt;code&gt;n&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Popping off an array will always be constant because the length of the array doesn't matter.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let arr = ["one", "two", "three"];
arr.pop() ---&amp;gt; "three"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And looping through that same array will always be linear, because the length of our operation is directly tied to the length of the array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for(let i = 0; i &amp;lt; arr.length; i++)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It might help to conceptualize if you replace the 'n' with the length of the array itself. The time complexity of looping through our 'arr' array is technically O(3) before popping off the end, and O(2) after popping off the end. &lt;/p&gt;

&lt;p&gt;But that's the easy stuff, and I'm explicitly here to demystify the confusing parts. So let's get into it. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Exponential&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yzakk7IY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wp4vq6dqanl511phpm0f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yzakk7IY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wp4vq6dqanl511phpm0f.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before we talk about &lt;a href="https://www.theguardian.com/science/life-and-physics/2014/jul/20/the-meaning-of-exponential"&gt;exponential&lt;/a&gt; time complexity, we should first strive to understand what the word itself means. 'Exponential' refers to 'an increase that is becoming more and more rapid'. &lt;/p&gt;

&lt;p&gt;Another way to put that is that it's an increase that is increasingly increasing. We represent exponential time complexity as&lt;/p&gt;

&lt;p&gt;&lt;code&gt;O(2^n)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;where &lt;code&gt;n&lt;/code&gt; is, you guessed it, the size of the input. &lt;/p&gt;

&lt;p&gt;As you can imagine, having your program take an exponential amount of time to complete its operations could be an absolute disaster in most use cases, especially when working with large sets of data. &lt;/p&gt;

&lt;p&gt;For example, if you had a function with an exponential time complexity traversing over an array with a length of &lt;code&gt;20&lt;/code&gt;, you could calculate the potential maximum operations it would need to perform by filling out O(2^n) and analyzing the solution.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   2 ^ 20 = 1,048,576
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That means our exponential function would, in its absolute worst case scenario, have a time complexity of O(1,048,576).&lt;/p&gt;

&lt;p&gt;I've charted out below how the time complexity of our fictional program scales upwards to over a million as the size of the array scales upwards to twenty. This should help visualize what an "increase that is increasingly increasing" actually means. &lt;/p&gt;

&lt;p&gt;Follow the number to the right, and see what you notice.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2 ^ 1 = 2
2 ^ 2 = 4
2 ^ 3 = 8
2 ^ 4 = 16
2 ^ 5 = 32
2 ^ 6 = 64
2 ^ 7 = 128
2 ^ 8 = 256
2 ^ 9 = 512
2 ^ 10 = 1,024
2 ^ 11 = 2,048
2 ^ 12 = 4,096
2 ^ 13 = 8,192
2 ^ 14 = 16,384
2 ^ 15 = 32,768
2 ^ 16 = 65,536
2 ^ 17 = 131,072
2 ^ 18 = 262,144
2 ^ 19 = 524,288
2 ^ 20 = 1,048,576

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As the length increments the time complexity doubles. &lt;/p&gt;

&lt;p&gt;This starts as steady growth at first, taking nine steps to even break a thousand, then five more after that to break ten thousand. But only another four steps from there is an increase by hundreds of thousands, and only two more steps after that we are at a million. There is more of a difference between &lt;code&gt;2^18&lt;/code&gt; and &lt;code&gt;2^20&lt;/code&gt; than there is between all of the previous results combined.&lt;/p&gt;

&lt;p&gt;The most common practical example you'll see for exponential complexity is a function designed to obtain a &lt;a href="https://www.coolmathgames.com/0-2048-fibonacci"&gt;fibonacci&lt;/a&gt; &lt;a href="https://www.investopedia.com/terms/f/fibonaccilines.asp"&gt;number&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let fibonacci = function(number) {
  if (number &amp;lt;= 1) {
    return number;
  }
  return fibonacci(number - 2) + fibonacci(number - 1);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The larger the input, the more and more operations it will take to get our output fibonacci number. Play around with this some and see if you can make a non-recursive version yourself. You know, just for fun.   &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quadratic (polynomial)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_IRiYG_2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/993nr9ugoa9r4ef5evug.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_IRiYG_2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/993nr9ugoa9r4ef5evug.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Again, to first understand how it relates to time complexity, let's lay out what exactly &lt;a href="https://jarednielsen.com/big-o-quadratic-time-complexity/"&gt;quadratic&lt;/a&gt; actually means. In simple terms, it is a fancy word that mathematicians use to denote when something has been squared, which is why we represent it as-&lt;/p&gt;

&lt;p&gt;&lt;code&gt;O(n^2)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Simple enough, right? The maximum number of operations in a quadratic function would be the length of the input times itself. &lt;/p&gt;

&lt;p&gt;Something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let repeatArrayByLength = function(arr){
let newArr = [];
for(let i = 1; i &amp;lt;= arr.length; i++){
  for(let j = 1; j &amp;lt;= arr.length; j++){
    newArr.push(j);
  }
}
return newArr;
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Scales quadratically because as the length of the input grows, the amount of processes our function must complete increases by a factor of the length of the array times itself, &lt;code&gt;n^2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Notice that if we pass in an array with the length of three, like so:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;repeatArrayByLength([1, 2, 3])&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We will get back-&lt;/p&gt;

&lt;p&gt;&lt;code&gt;[1, 2, 3, 1, 2, 3, 1, 2, 3]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Our function carried out 9 pushes into the array, from an input length of &lt;code&gt;3&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;3^2&lt;/code&gt;, or &lt;code&gt;3 * 3&lt;/code&gt;, is &lt;code&gt;9&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;If we were to pass in a similarly structured array with a length of &lt;code&gt;5&lt;/code&gt;, we would get back:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;[1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5]&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Our function pushed into the array &lt;code&gt;25&lt;/code&gt; times.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;5^2&lt;/code&gt;, or &lt;code&gt;5 * 5&lt;/code&gt;, is &lt;code&gt;25&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Logarithmic&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nuFe_A-u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/58dlc5f1b9ayl81z53z2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nuFe_A-u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/58dlc5f1b9ayl81z53z2.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I like to think of &lt;a href="https://jarednielsen.com/big-o-logarithmic-time-complexity/"&gt;logarithmic&lt;/a&gt; time complexity like the lawful good version of exponential complexity, represented in Big O as-&lt;/p&gt;

&lt;p&gt;&lt;code&gt;O(log n)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The number of operations in an exponential function will increasingly &lt;em&gt;increase&lt;/em&gt; as the size of the input &lt;em&gt;increases&lt;/em&gt;, whereas the number of operations in a logarithmic function will increasingly &lt;em&gt;decrease&lt;/em&gt; as size of the input &lt;em&gt;increases&lt;/em&gt;. The larger the set of data, the more efficient your program will run. &lt;/p&gt;

&lt;p&gt;Here's a simple example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let doubleStepper = (number) =&amp;gt; {
  let arr = [];
  for (let i = 1; i &amp;lt; number; i *= 2) {
    arr.push(i);
  }
  return arr;
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we pass in &lt;code&gt;5&lt;/code&gt;, we will get back:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;[1, 2, 4]&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Which is only three operations. Now if we passed in &lt;code&gt;100&lt;/code&gt;, we will get back: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;[1, 2, 4, 8, 16, 32, 64]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Which is only seven operations. Functions with logarithmic complexity will become exponentially more efficient as the input data grows larger. &lt;/p&gt;

&lt;p&gt;Finally, let's go crazy and pass in &lt;code&gt;5000&lt;/code&gt;, getting back: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048,4096]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Which isn't really that much of a jump, only thirteen processes in total. Notice that, like I said before, it becomes increasingly efficient as the size of the input grows. There are more jumps between &lt;code&gt;1&lt;/code&gt; and &lt;code&gt;32&lt;/code&gt; than there are between &lt;code&gt;1024&lt;/code&gt; and &lt;code&gt;4096&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;I wasn't kidding about it being the lawful good version of exponential, here's the proof: &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ALw3Qwv_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k45rkbqepf828dkm867e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ALw3Qwv_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k45rkbqepf828dkm867e.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;They share the same exact curve, just different directions. &lt;/p&gt;

&lt;p&gt;Generally speaking, we should strive to keep our programs below exponential and quadratic complexity, and instead aim for constant, logarithmic, or at the bare minimum linear. &lt;/p&gt;

&lt;p&gt;It's also important to keep in mind that you should only formulate time complexity  based on the &lt;strong&gt;worst case scenario&lt;/strong&gt;, and nothing more. Because even a ridiculous function like this-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dxleNf5b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kpanp9uxiv2n6yxe9heq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dxleNf5b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kpanp9uxiv2n6yxe9heq.png" alt="image"&gt;&lt;/a&gt;&lt;br&gt;
 -known as &lt;a href="https://en.wikipedia.org/wiki/Bogosort"&gt;bogosort&lt;/a&gt; could, in theory, produce a correct result on the very first permutation. That doesn't make it constant though, far from it actually. The above function actually has a &lt;a href="https://jarednielsen.com/big-o-factorial-time-complexity/"&gt;factorial&lt;/a&gt; time complexity, which is a discussion for another time. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Intro to Algorithmic Design</title>
      <dc:creator>arindavis</dc:creator>
      <pubDate>Sun, 28 Feb 2021 23:20:00 +0000</pubDate>
      <link>https://dev.to/arindavis/intro-to-algorithmic-design-mcb</link>
      <guid>https://dev.to/arindavis/intro-to-algorithmic-design-mcb</guid>
      <description>&lt;p&gt;Quick, off the top of your head, and without using a calculator or scratch paper, what is thirteen multiplied by two hundred and thirty eight?&lt;/p&gt;

&lt;p&gt;You could try and solve this problem using mental math, wasting your valuable time and effort, or you could do &lt;a href="https://en.wikipedia.org/wiki/Ancient_Egyptian_multiplication"&gt;what the ancient Egyptians did&lt;/a&gt; and make an algorithm that plots the answer into a simple to read data structure. The solution, according to one of the first recorded algorithms in human history, is three thousand and ninety four. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gDElY7Ss--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m7swf3azrzcivlvxkpl4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gDElY7Ss--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m7swf3azrzcivlvxkpl4.png" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The methodology itself is deceptively simple, but incredibly functional. You start with two columns, the first starting with one and the second starting with thirteen, and for each new row you double the previous number in the column. Then it becomes an easy task of finding two hundred and thirty eight in the first column and matching it with its corresponding answer on the right.  &lt;/p&gt;

&lt;p&gt;Millennia after the ancient Egyptians used these kinds of basic designs to build the pyramids and construct elaborate effigies to their cats, a entrepreneurial  woman by the name of Ada Lovelace would become what many scholars now consider to be the first computer programmer, inventing and reiterating complex mechanical systems that would later allow her to envision a world where &lt;a href="https://en.wikipedia.org/wiki/Analytical_Engine"&gt;machines perform much more&lt;/a&gt; than basic arithmetic for the general public. (check out a modern implementation of her Bernoulli Number Function &lt;a href="https://gist.github.com/terotil/3f83a473f372d31f55d5"&gt;here&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3KP5Dshl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c7jnirs2zlz0ek0uvbb2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3KP5Dshl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c7jnirs2zlz0ek0uvbb2.png" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another hundred years after her, Alan Turing would utilize the same kind of problem solving to crack top-secret Nazi encryption (pro tip, don’t end all of your secret transmissions with “Heil Hitler” if you want them to stay secret) and help end the second World War. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ee0IgGy3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qff6cy0iz7qzrwe525ox.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ee0IgGy3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qff6cy0iz7qzrwe525ox.png" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All three of these examples share a unifying commonality, and that’s a basic adherence to algorithmic design. Or, more simply put: they all approached their problems in the same way. &lt;/p&gt;

&lt;p&gt;When you first go searching for information regarding algorithmic design in reference to computer science, you are more than likely to find an over-abundance of &lt;a href="https://www.tutorialspoint.com/design_and_analysis_of_algorithms/design_and_analysis_of_algorithms_tutorial.pdf"&gt;resources&lt;/a&gt;. &lt;a href="https://www.computersciencedegreehub.com/faq/what-is-algorithm-design/"&gt;Many&lt;/a&gt; well written &lt;a href="https://www.geeksforgeeks.org/algorithms-design-techniques/"&gt;articles&lt;/a&gt; and academic papers reference methods like divide and conquer, backtracking and dynamic programming. Any one of these paradigms is worth exploring in depth and applying to your own process, but I'd rather focus on the similarities you'll find between nearly all of them. In an effort to create a more approachable and generalized overview of practical Algorithmic Design, I've broken these similarities into three linear stages of problem solving:&lt;/p&gt;

&lt;p&gt;Definition, Execution, and Reiteration. &lt;/p&gt;

&lt;p&gt;First, the definition stage, or what I think of as the 'understanding' phase. This is where most people tell you to start, and can often be the place where you spend the most time. It's important at this phase to clearly lay out your IOCE's: Input, Output, Constraints, and Edge Cases. You want to focus clearly on what the problem demands in relation to these pre-determined parameters, and start thinking about what kind of steps it will take to get you to the solution. I lump the process of pseudo-coding into this stage as well, as it's a practical way of getting your understanding of the problem into writing. By adding comments and beginning to plan out the direction of our program, we make the next two stages much easier. &lt;/p&gt;

&lt;p&gt;Which brings us to execution, or where we get to actually start typing out our code and putting our design into practice. Simply put, you want to follow the arc of your design from the definition stage, being sure to test and retest along the way until you have your first working prototype. &lt;/p&gt;

&lt;p&gt;Finally, reiteration. This is where we "redo and review" over and over again until we are sick of it. Reiteration often comes either when basic functionality has been mastered, or your logic from stage one has proven less than sound. That's okay, though! This is perfectly normal and healthy to the process at large, and even encouraged! This is how innovation is cultivated, and where our algorithms become more streamlined. It's the perfect time to start seriously thinking about &lt;a href="https://en.wikipedia.org/wiki/Time_complexity"&gt;time complexity&lt;/a&gt; in relation to &lt;a href="https://www.techopedia.com/definition/22229/space-complexity"&gt;space complexity&lt;/a&gt;, the efficiency your algorithm, and what you'd still like to accomplish before it's "done".&lt;/p&gt;

&lt;p&gt;Let's use a practical example to walk us through the process from beginning to end: Creating a simple factorial algorithm using JavaScript.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Definition:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A &lt;a href="https://en.wikipedia.org/wiki/Factorial"&gt;factorial&lt;/a&gt; is an integer that represents the product of all the numbers below or equal to n, or the original number. The factorial of 5 is 120 because:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 * 2 * 3 * 4 * 5 = 120
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, now that we have a grasp of what the problem is asking, let's define our IOCE's.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//Input: Positive integer

//Output: Factorial of original integer

//Constraint: 

//Edge Case:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For now we will keep constraints and edge cases empty, as none have been imposed on us yet. Next, we need to pseudo-code out a plan. It first occurred to me that if we loop through everything from n, our given number, down to 1, we can multiply each iteration of the loop against the next and eventually get our factorial. So, now I put that plan into words.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//IOCE: Positive integer, Factorial of original integer, n/a, n/a

//declare function

//create a place to store our product

//loop from n down to 1

//on each loop, multiply each number by the next

//return our final number
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Execution:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The fun part! So, let's put our plan into action:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//IOCE: Positive integer, Factorial of original integer, n/a, n/a

//declare function

const factorial = function(n){

//create a place to store our product

let factorial = 1;

//loop from n down to 1

for(let i = n; i &amp;gt; 0; i--){

//on each loop, multiply each number by the next

factorial *= i;

}

//return our final number

return factorial;

}

factorial(5)  ---&amp;gt; 120
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And it works! But why stop now, there is still so much to improve!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reiteration:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So, what could we do better? First, I noticed that stopping at 1 is inefficient because multiplying an integer by 1 will always result in that same integer, so that cuts down at least one loop.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for(let i = n; i &amp;gt; 1; i--){
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's also worth nothing that our time complexity is currently O(n), or linear. Meaning that the higher n is, the longer the loop will take to loop through to the end result. &lt;/p&gt;

&lt;p&gt;Somewhere during this stage you might consider refactoring the entire thing away from a for loop and instead opt for recursion, like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//IOCE: Positive integer, Factorial of original integer, use recursion, n/a

function recursiveFactorial(n){

//if n is strictly equal to zero, stop recursing

if(n === 0){

  return 1;

//otherwise, keep multiplying n by the next call of 

factorial, decrementing n on each call

} else {

  return n * recursiveFactorial(n - 1); 
}

}

recursiveFactorial(5) ---&amp;gt; 120
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice I changed the "C" in our IOCE to reflect the self imposed constraint of using recursion. &lt;/p&gt;

&lt;p&gt;This version initially seems a lot more sleek. It takes up slightly less space on the page than our initial approach, and requires less characters to type. You would think this would translate into having a better time complexity, but it actually doesn't. It's still O(n) because the amount of time is still fully dependent on how large n is initially. Not only that, but there is some evidence to suggest that &lt;a href="https://cs.stackexchange.com/questions/56867/why-are-loops-faster-than-recursion"&gt;loops are faster than recursion&lt;/a&gt; in general, although that's a multi-faceted topic for another time. &lt;/p&gt;

&lt;p&gt;At this point, I feel satisfied in my altered first approach, although if I really wanted to get an absolutely constant, or O(1), time complexity for any factorial from 1 - 9 I could just take a note from the ancient data structure that the Egyptians used to solve their problem, but in a modern context using a Javascript object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let factorialObj = {
  1: 1,
  2: 2,
  3: 6,
  4: 24,
  5: 120,
  6: 720,
  7: 5040,
  8: 40320,
  9: 362800
}

factorialObj[5] ---&amp;gt; 120
console.log("Are you proud of me, ancient Egyptians?")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is, of course, an imperfect solution, but shouldn't necessarily be beyond consideration. I mean, factorialObj[9] is gonna get you back 362,800 a lot faster than either of other approaches we implemented, I guarantee that. &lt;/p&gt;

&lt;p&gt;Here, at the final stage of our implementation, we have crucial choices to make. Choices, mind you, that are provided and informed by all the work we have made up to this point. &lt;/p&gt;

&lt;p&gt;This is what algorithmic design is all about though, discovery through understanding, implementation and reinvention. Lady Lovelace knew that. So did Turing and the builders of the ancient world. This process, when adhered to, is the perfect place to start thinking about the big picture design of whatever problem you're trying to solve.&lt;/p&gt;

&lt;p&gt;By taking time to understand the fundamental steps between the inception and application stages of our algorithmic logic, we can not only improve our own code, but we also get the opportunity to iterate and improve on generations of prior knowledge that came before us. In summary, modern computer science owes a lot to the &lt;a href="https://plato.stanford.edu/entries/turing/"&gt;gays&lt;/a&gt;, &lt;a href="https://www.livescience.com/63154-ada-lovelace-first-algorithm-auction.html"&gt;women&lt;/a&gt;, and &lt;a href="https://en.wikipedia.org/wiki/Cats_in_ancient_Egypt"&gt;cats&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;That’s just history. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>So, Random</title>
      <dc:creator>arindavis</dc:creator>
      <pubDate>Wed, 20 Jan 2021 01:03:34 +0000</pubDate>
      <link>https://dev.to/arindavis/so-random-10bj</link>
      <guid>https://dev.to/arindavis/so-random-10bj</guid>
      <description>&lt;p&gt;Let's go ahead and rip this band-aid off: JavaScript's Math.random() number method isn't &lt;em&gt;actually&lt;/em&gt; random. The number it calculates could, with enough pre-emptive knowledge, be predicted. This isn't a fatal oversight on the behalf of the language's creators, it's actually a problem with how our machines and the software we design for them are taught to think in the first place. &lt;/p&gt;

&lt;p&gt;In order to fully understand how Math.random() works, we are going to have to talk about its basic use cases, what's going on behind the scenes when we call it, and the nature of chaos within a deterministic universe.&lt;/p&gt;

&lt;p&gt;First, let's get to know the method itself before we expose it for the no good liar it is. A simple invocation of the base method, like so--&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let random = Math.random();
console.log(random)  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;--will log a number somewhere between 0-1 to the console. Try it for yourself if you'd like, I got "0.3525815464578914". &lt;/p&gt;

&lt;p&gt;If we add the Math.floor method with a little extra flavor, however, we can make the forces of chaos truly bend to our will.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let controlledChaos = Math.floor(Math.random() * 10 + 1);
console.log(controlledChaos);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I  got 6!&lt;/p&gt;

&lt;p&gt;We are specifying here that our random number should be strictly chosen within the range of one through ten. Math.floor() is doing some of the heavy lifting, as it's primary job is rounding to the lowest whole number. We then multiply our invocation of Math.random() by ten, setting the upper limit of our random call to ten.  Then on to the final part, '+ 1',  which is setting the lower limit to one. If we were to leave those last two off, like so--&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let rando = Math.floor(Math.random());
console.log(rando);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we would get zero. No matter what. &lt;br&gt;
Every. Time. &lt;/p&gt;

&lt;p&gt;This is because as Math.random() generates a random number between zero and one on each invocation, Math.floor() is simultaneously taking that number and rounding it down to zero. You could do the same thing with Math.ceil(), the sibling of .floor(), and you'd get one instead because it rounds up to the nearest whole number. It's like the JavaScript equivalent of a rigged coin toss. &lt;/p&gt;

&lt;p&gt;Using the bones of the controlledChaos variable, we can work to make our JavaScript programs more dynamic by creating random-number generating variables that depend on/refer to other parts of our program.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://repl.it/@ADavis1/StoryGenerator#index.js"&gt;Here&lt;/a&gt;'s an example, it's a link to a rudimentary story generator I made using the above principles. Press run a couple times and see what kind of harrowing tales you get, then check out the code at the bottom that makes it all tick.&lt;/p&gt;

&lt;p&gt;Did you notice that you can add to any of the three story sections because the upper ceiling of the random call is dynamically linked to the length property of the corresponding array? Of course you did, because you're smart.  &lt;/p&gt;

&lt;p&gt;And because I now know how smart you are, I feel comfortable getting into more of the technical side of things. Wanna know what's actually going on behind the scenes with Math.random()? The answer is complicated and would require its own blog to be properly explained, but for the sake of brevity:&lt;/p&gt;

&lt;p&gt;Most browsers(yes, browsers implement this method, not JavaScript) use something called a "Pseudo-Random Number Generator" to simulate randomness in our code. One of the most popular PRNGs regularly implemented with JavaScript is called "xorshift128+", which you can read more about &lt;a href="https://v8.dev/blog/math-random#:~:text=with%20ECMAScript%20internals-,Math.,This%20function%20takes%20no%20arguments."&gt;here&lt;/a&gt; and &lt;a href="https://research.securitum.com/calculation-of-pseudo-random-numbers-generator-state-on-the-example-of-math-random-from-firefox/#:~:text=As%20you%20can%20see%20in,state%20numbers%20to%20each%20other."&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In short, every PRNG needs a place to start, a seed number from which all the following numbers can be subsequently calculated. That's why most PRNG's rely on external means of getting a seed, like from your computer's internal clock, the current heat of your CPU, mouse movements, fan noise, or even the &lt;a href="https://www.sparkfun.com/tutorials/132"&gt;radiation&lt;/a&gt; levels in your immediate area. Alright, that last one was a little extreme. &lt;/p&gt;

&lt;p&gt;I'd encourage you to do some more research on your own time starting with the provided links, because my brief explanations of the inner workings of these PRNGs &lt;a href="https://engineering.mit.edu/engage/ask-an-engineer/can-a-computer-generate-a-truly-random-number/"&gt;only scratch the surface&lt;/a&gt; of what there is to know, and we aren't even touching on other topics related to randomization like &lt;a href="https://en.wikipedia.org/wiki/Hardware_random_number_generator"&gt;HRNGs&lt;/a&gt; or &lt;a href="https://en.wikipedia.org/wiki/Global_Consciousness_Project"&gt;whacky projects like this one&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But here's the run-down on PRNGS: There is nothing actually random about how most of them get their end results, even ones that are used as the standard, because every end value was calculated by a deterministic process. That's where the &lt;strong&gt;pseudo&lt;/strong&gt; part of that really cool name comes from. &lt;/p&gt;

&lt;p&gt;What most of them actually do is &lt;em&gt;simulate&lt;/em&gt; randomness for us by starting with a seed and unloading a predetermined series of processes onto it. If one were to know the exact inner workings of that process and the seed itself, one could, theoretically, predict what the software will return before it returns it. This is immensely impractical and absolutely the most unnecessary flex imaginable, but it's also &lt;em&gt;technically&lt;/em&gt; possible, which is the best kind of possible. It's also why I argue that Math.random() is inherently chaotic and not random. Because, given you have accurate information about the input, you could accurately predict the output no matter the complexity. This is how nearly all man made creations work, as &lt;a href="https://en.wikipedia.org/wiki/Deterministic_system"&gt;deterministic systems&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;But what does "random" even really mean, if not Chaos? &lt;/p&gt;

&lt;p&gt;When you get together with your nerdy DND friends to tell stories and roll funny shaped dice, are the results from those funny shaped dice truly random? The dice's output may seem obviously randomized on the surface, but one could argue that the end value is determined by tangible conditions like density and balance of the dice, how the user consciously and subconsciously decides to throw it, which part of the table it lands on, the balance of the house and so on... &lt;/p&gt;

&lt;p&gt;Which leaves us with no clear answer and one lingering question:&lt;/p&gt;

&lt;p&gt;If it looks random when we see it, feels random when we use it, and acts random when we need it to then does it even matter if Math.random() is factually "random" or not? &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>prng</category>
      <category>randomness</category>
      <category>determinism</category>
    </item>
  </channel>
</rss>
