<?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: Maniflames</title>
    <description>The latest articles on DEV Community by Maniflames (@maniflames).</description>
    <link>https://dev.to/maniflames</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%2F72293%2F4729f3f5-7e6c-41fe-a776-ae4a76876dd1.jpeg</url>
      <title>DEV Community: Maniflames</title>
      <link>https://dev.to/maniflames</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maniflames"/>
    <language>en</language>
    <item>
      <title>Where do intermediate and/or slightly more advanced devs go? </title>
      <dc:creator>Maniflames</dc:creator>
      <pubDate>Wed, 01 Dec 2021 20:00:18 +0000</pubDate>
      <link>https://dev.to/maniflames/where-do-intermediate-andor-slightly-more-advanced-devs-go-1po1</link>
      <guid>https://dev.to/maniflames/where-do-intermediate-andor-slightly-more-advanced-devs-go-1po1</guid>
      <description>&lt;p&gt;It has been quite a while sincd I've written my kast post here on dev. There isn't a lot I've done with intension or focus. I also don't know if anyone is following me with some sort of intension on purpose. &lt;/p&gt;

&lt;p&gt;I'd love to start writing again especially on the stuff that I'm currently exploring. The problem is most of it isn't purely webdev related and other topics are extensions on what I'm exploring during my masters (think applied evolutionary algorithms, applied deep learning, shaders, etc).&lt;/p&gt;

&lt;p&gt;On the internet I'm not really someone so regardless of what I do, I'll most likely be screaming in the void. My main question is should I still scream in this void? Part of the reason why people like DEV (or Codenewbies which I relate to each other since the acquision) is that it is beginner friendly. Don't get my wrong I love writing about topics in way that they become more approachable but most of what I want to write about assumes the the reader is able to translate a (basic) algorithm into code. &lt;/p&gt;

&lt;p&gt;Should I just jump in and see how it goes or just exclusively write on my own site? &lt;/p&gt;

&lt;p&gt;Additionally I've noticed a lot of folk I follow on twitter because of the DEV community don't seem to be on DEV anymore. Is this platform slowly dying or does that have to do with developer maturity? &lt;/p&gt;

</description>
      <category>discuss</category>
      <category>meta</category>
    </item>
    <item>
      <title>Time for focus</title>
      <dc:creator>Maniflames</dc:creator>
      <pubDate>Fri, 01 May 2020 00:46:57 +0000</pubDate>
      <link>https://dev.to/maniflames/time-for-focus-37da</link>
      <guid>https://dev.to/maniflames/time-for-focus-37da</guid>
      <description>&lt;p&gt;I usually post a heavily though out post on a random topic that interests me at the time. My last post was an exception and this one will be as well. &lt;/p&gt;

&lt;p&gt;Lately I've been feeling as if I'm running out of time. Currently I'm in the last year of my bachelors but decided to do a 2-year masters because the creative dev industry seems on hold. Even though I'm most likely going to graduate this year I feel like I haven't 'achieved' a lot. &lt;/p&gt;

&lt;p&gt;I know mostly web development and have created websites and web apps  at a creative agency as something on the side. After actively looking for other types of development I noticed two interesting domains: embedded systems &amp;amp; computer graphics.&lt;/p&gt;

&lt;p&gt;I've explored both but because of my split attention I haven't really had the chance to dive deep and learn/build in a way that can be shared. Because my interests are based on the low-level development aspect, keeping up a 'once-a-month' upload schedule on dev will be kind of hard to maintain. &lt;/p&gt;

&lt;p&gt;For the past couple of days I've been watching Tae'lur Alexis' live-streams on twitch and asked how she navigates her learning process based on all of the interests that she has. Her answer boiled down to: 'I pick something and stick with it'. Even though it is a really common piece of advice, this was the first time I 'got it'.&lt;/p&gt;

&lt;p&gt;It was really hard to pick between hardware and graphics for the three month dev exploration I want to do to dive deeper. I decided to flip a coin. Heads for graphics, tails for hardware. I got heads. &lt;/p&gt;

&lt;p&gt;There are still a few things I have to figure out but I want to stick to graphics for a while and work from there. It'll be web based at first but I'm pretty sure that'll change too. &lt;/p&gt;

&lt;p&gt;If you are one of the 5k people that follow me here on dev and got this far, thank you. Seriously. I hope my journey will at least be interesting to you in the future.&lt;/p&gt;

</description>
      <category>webgl</category>
      <category>graphics</category>
    </item>
    <item>
      <title>I feel worthless when I'm unproductive</title>
      <dc:creator>Maniflames</dc:creator>
      <pubDate>Tue, 31 Mar 2020 18:02:21 +0000</pubDate>
      <link>https://dev.to/maniflames/i-feel-worthless-when-i-m-unproductive-2a60</link>
      <guid>https://dev.to/maniflames/i-feel-worthless-when-i-m-unproductive-2a60</guid>
      <description>&lt;p&gt;For the past two weeks I have been working from home because of instructions from the government in response to COVID-19. The timing isn't super great, but to be fair the timing probably isn't great for anyone. &lt;/p&gt;

&lt;p&gt;During my time at home my 'work life' and my private life slowly merged into one, even though I came up with a schedule in an attempt to prevent this exact thing from happening. Another rule was to make sure that the weekends would be off limits for anything work related, unlike usual. That didn't happen yet. This conflict is not necessarily new, but now that I'm stuck in my bedroom for most of the time it has become a lot more visible. &lt;/p&gt;

&lt;p&gt;It's just really hard to sit still because there are a lot of things I could do instead. Extending my portfolio, continue my OSSU journey, finally start leetcoding or finally building one of those ideas I had in mind. I don't believe there is anything wrong with doing any of this next to work. However, it does become a problem when you 'have' to do them and can't stop. The very obvious thing to do in a situation like this is slowing down.&lt;/p&gt;

&lt;p&gt;I have tied a very big portion of my identity to working hard and achieving things. Not on purpose but because others seem to value that as well. I 'work hard', 'always try to get the best out of myself' and 'am always doing something and headed somewhere'. And those little dopamine hits feel great but at the same time I feel like I'm approaching either depression or burn-out. No matter what I do it has to be useful in some way or I should not have been thinking about it in the first place.&lt;/p&gt;

&lt;p&gt;If someone asks me where I'm going, I have to at least know where I'm headed. If I join a team, I better put in as many hours as I can. I'm still in school and very junior. There is a lot to learn and there is no alternative to putting in actual work if I want to get better. I don't have a popular open source project yet. I haven't even made a pull request on projects that inspire me. I'm not doing great, I'm lying to myself and believe the statements of people who mindlessly put on their rose colored glasses. There are still a ton of side projects on the shelf. I have potential but that is literally all that I've got. I have to work, I have to work, I have to work.&lt;/p&gt;

&lt;p&gt;If I try to sit still those thoughts become louder and louder until I give in and start working again. Why would I do otherwise? If I don't work, why am I here? Who would care about me? What's the point?&lt;/p&gt;

&lt;p&gt;Last year I reached out to my class' supervisor to explain that I really didn't feel like being here anymore. It wasn't the first time thoughts like these have crossed my mind and I had received help from a kids psychologist back in high school. Of course my supervisor wasn't allowed to deal with these things and about two weeks later I had to sit down with my college's psychologist. Luckily, I don't have to worry about anything because according to him I'm doing great. I have a strong personality, excellent grades and could express myself clearly during the conversation. The best thing I could do was read a book by Carl Gustav Jung and make another appointment if I still felt the need to get rid of myself. That was the first and last time I spoke to him.&lt;/p&gt;

&lt;p&gt;I'm not going to lie, I haven't read a single word of any of Jung's books and maybe I should have. Instead, I spend some time on YouTube watching video's from random people with their take on hustle culture and ambitious minimalists who take it easy.  &lt;/p&gt;

&lt;p&gt;I feel stuck and lonely at times but whenever I read posts by overwhelmed beginners on Reddit or Dev I just wonder how normal this is in developer land. Do you grow out of this as a senior? I'd love to know how to stop looping between 'hustle' and 'trying to slow down'. Until then, I'm probably working on something and headed somewhere.&lt;/p&gt;

</description>
      <category>productivity</category>
    </item>
    <item>
      <title>Ego is the enemy: overcoming your own thoughts</title>
      <dc:creator>Maniflames</dc:creator>
      <pubDate>Sat, 29 Feb 2020 15:14:08 +0000</pubDate>
      <link>https://dev.to/maniflames/the-book-that-will-drag-me-through-final-stage-of-my-bachelor-190b</link>
      <guid>https://dev.to/maniflames/the-book-that-will-drag-me-through-final-stage-of-my-bachelor-190b</guid>
      <description>&lt;p&gt;About a month ago I entered the last five months of my college experience. This last semester consists of an internship that has to result in a Bachelor thesis. Repeating 'this project has to turn out right or I might as well not write a thesis at all' has caused me to overthink everything. The moment I noticed this, I realised I needed something to calm me down. There was one book that I had laying around that has always been interesting to me but I didn't finish until now. I'm glad I picked it up and read it all. &lt;/p&gt;

&lt;p&gt;Ego is the Enemy by Ryan Holiday is a book about dealing with your own thoughts and self-sabotage during different stages of life: Aspiration, Success and Failure. The advice in this book has helped me with shaping my thought process into something that helpful instead of hurtful. There are a lot of 'nuggets' in this book I really recommend reading it. In this post I'd like to share my favourite advice, which happens to be the advice that helped me the most. &lt;/p&gt;

&lt;h1&gt;
  
  
  Aspiration
&lt;/h1&gt;

&lt;p&gt;Most of us have goals and, whether they are big or small, we think about them often. We talk about them with people we respect and love. We visualise them and try to experience a bit of the success we think we'll feel when we achieve them. There is nothing wrong with any of that, but it's easy to take this too far. Instead of doing the work we talk about doing the work and confuse it with actual progress. Even when we are working on our goal, our idea of what success looks like slowly steers us into a different direction. It is suddenly about impressing others instead of reaching goals. Solving a big pile of small JIRA tickets instead of solving a bigger bug that will take more time and effort. Over-engineering something a just little, so we can flex instead of writing something that can easily be understood by everyone.    &lt;/p&gt;

&lt;p&gt;The only way to overcome this is by noticing it yourself. Other people might be indifferent to your actions but you know when you are trying to impress others and slow yourself down. Learning to get out of your own head and step back can help you with actually achieving your goals. If you can redirect your focus from looking for validation to doing the work you need to do, the likelihood of reaching success will be bigger. &lt;/p&gt;

&lt;h1&gt;
  
  
  Success
&lt;/h1&gt;

&lt;p&gt;Achieving a goal you have wanted to achieve for a while feels amazing. You're finally there. You got the job, you're promoted to senior or you finally launched that product. Is this the end? Is this the start of becoming bigger and better than anyone else? When success gets into your head it can trap you in two ways: complacency or endless ambition.&lt;/p&gt;

&lt;p&gt;When you are hired it's done right? You can sit at your desk, type a bit of code and go home afterwards. You have build some CRUD applications before, all you have to do is repeat it. Unfortunately, having done something successfully in the past is not a guarantee you can repeat that success forever. Don't blindly write code without running it because you have written something similar before. It's easier to debug something if you made a small change than when the bug is hidden under 100+ lines of code. &lt;/p&gt;

&lt;p&gt;In that case being hired is just the start right? Keep studying. Read about development before work. Don't leave until the last dev does. Code until the middle of the night as soon as you get home. Don't stop until you're at the top. What is the top exactly? CTO? Do you even want to be CTO? A lot of developers realise they don't when they discover that a CTO barely touches code and focusses more on drawing the architecture. Putting in endless hours to reach the top often leads to burn-out. Make sure you define your next step based on what you want. &lt;/p&gt;

&lt;p&gt;The author was able to summarise all of this in one sentence: "The only way to manage success is to manage yourself." Goals are our way of defining happiness and fulfilment but as soon as we are 'too good' or must 'grind endlessly' success turns into something meaningless. It's difficult to not fall into complacency or endless ambition. That is why it is hard to stay successful. No matter if you fall for one trap or the other without managing yourself you'll end up failing. &lt;/p&gt;

&lt;h1&gt;
  
  
  Failure
&lt;/h1&gt;

&lt;p&gt;A mistake doesn't need to be big to get to us. Getting notified that your pull request is rejected. Shipping the bug into production. Not recalling something that is considered base knowledge. It can happen to anyone. The way we respond to these events is what will determine wether that mistake is a failure. Being defensive, covering things up or wanting to prove someone wrong can easily lead to behaviour that will hold you back. Most people know that it's important to learn from your mistakes. What not a lot of people realise is that fighting mistakes often leads to more of them. &lt;/p&gt;

&lt;p&gt;Wanting to avoid failure often means wanting to make sure other people don't perceive the consequences of our actions as failure. However we can't control the thoughts of others. A lot of times we can't even control the outcome of our work, all we can do is adopt a process optimised for success. Letting go of both external opinions and outcomes we can't control is key to moving on. Take notes, adjust the process where necessary and try again. Being less attached to outcomes often leads to better results because it allows for more focus on the process. &lt;/p&gt;

&lt;p&gt;You don't have to do anything wrong to achieve what others perceive as failure. You might receive less than 100 views on that tutorial you worked on for weeks. Your pull request could be rejected because the team decided to move their project in a different direction. That doesn't mean that your tutorial didn't help anyone or your contribution contained unmaintainable code. Not being rewarded for the effort in the way that you or others expect does not mean you should not have taken that action at all. The only failure in that case is letting those things get to you. &lt;/p&gt;

&lt;p&gt;Most thoughts and instances of self-sabotage are rooted in insecurities of what we think others think about us. Letting go of those thoughts is the key to happiness and, in the long run, success. &lt;/p&gt;

</description>
      <category>career</category>
      <category>beginners</category>
    </item>
    <item>
      <title>From web to embedded: exploring a different sub-field within tech</title>
      <dc:creator>Maniflames</dc:creator>
      <pubDate>Fri, 31 Jan 2020 21:57:19 +0000</pubDate>
      <link>https://dev.to/maniflames/from-web-to-embedded-exploring-a-different-sub-field-within-tech-4g0l</link>
      <guid>https://dev.to/maniflames/from-web-to-embedded-exploring-a-different-sub-field-within-tech-4g0l</guid>
      <description>&lt;p&gt;For the past few years I have had the pleasure of learing software development. Like a lot of others, I initially focused on the web. The large amount of YouTube channels, blogs, podcasts, online courses and communities like DEV make web development very accessible to newcomers. Over time however I realized that, although I love the web, I wanted to build something that wouldn't disappear once you close your laptop.&lt;/p&gt;

&lt;p&gt;Apart from building a few 'Hello World' projects on popular boards like the Arduino and Raspberry Pi, I didn't have any experience or fundamental knowledge about development for hardware. It was hard to figure out where to start to push past the hardware tutorial stage. That is why I decided to minor in embedded systems. Now that I have completed my minor I'd love share an overview of some of the things I have learned. Over time I realised that this read is pretty long and I figured that you might want to skip parts here and there. So I made a table of contents that allows you to do that.&lt;/p&gt;

&lt;h1&gt;
  
  
  Table of Contents
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;What is an Embedded System?&lt;/li&gt;
&lt;li&gt;
Building an embedded system

&lt;ul&gt;
&lt;li&gt;Research and experimentation&lt;/li&gt;
&lt;li&gt;Design&lt;/li&gt;
&lt;li&gt;Implementation&lt;/li&gt;
&lt;li&gt;Testing&lt;/li&gt;
&lt;li&gt;Deployment &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
Software development: web vs embedded

&lt;ul&gt;
&lt;li&gt;Industry languages&lt;/li&gt;
&lt;li&gt;Moving between 'frameworks'&lt;/li&gt;
&lt;li&gt;Math&lt;/li&gt;
&lt;li&gt;Binary&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
Keeping your head up

&lt;ul&gt;
&lt;li&gt;Loneliness&lt;/li&gt;
&lt;li&gt;Imposter syndrome&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
Some cool places and faces in the community

&lt;ul&gt;
&lt;li&gt;News and project sharing&lt;/li&gt;
&lt;li&gt;Influential companies&lt;/li&gt;
&lt;li&gt;Learning communities&lt;/li&gt;
&lt;li&gt;Educational people&lt;/li&gt;
&lt;li&gt;Inspirational people&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  What is an Embedded System? &lt;a&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;A lot of people disagree on the exact definition of an embedded system. My favourite definition, even though the engineer who said it doesn't see it as a complete one, is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;An embedded system is a computerized system that is purpose build for its application.&lt;/p&gt;

&lt;p&gt;-- &lt;cite&gt; Elecia White during 'A Gentle Introduction to Embedded Systems', a presentation for her book 'Making Embedded Systems'.&lt;/cite&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To simplify the language that she uses: An embedded system is a (often tiny) computer that is build to perform one (or a few) specific task(s). Under this definition some examples of embedded systems are smartwatches, microwaves and the engine control unit in a car.&lt;/p&gt;

&lt;h1&gt;
  
  
  Building an embedded system &lt;a&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;Embedded systems that are build from scratch require custom PCBs (Printed Circuit Boards). The goal is to build the smallest computer possible that will still meet  the strict performance requirements. There is also a possibility some functionalities should be build with hardware instead of programmed within the software. The main reason for picking hardware over software is speed. Software on an embedded system is usually written in C or C++ and works with a RTOS (Real Time Operating System), embedded linux or no OS at all. &lt;/p&gt;

&lt;p&gt;The hardware part of the process aligns a lot more with EE (Electrical Engineering) than with CS, software engineering or software development. This is why, at my college, the embedded systems minor is hosted by the EE department. It is also the main reason why it takes some time to switch from web to embedded. Even if you are a developer that puts the focus on the software within an embedded system, you need the know hardware fundamentals in order to properly debug your code. &lt;/p&gt;

&lt;p&gt;The creation of an embedded device has a couple of stages which don't strictly happen one at a time. Each of these stages require different skills, knowledge and tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  Research and experimentation &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;When the goal and the requirements of the project are clear, it's time to look for the hardware you need. This is often a combination of, but not limited to, a microcontroller or microprocessor, sensors, ICs (Integrated Circuits), resistors, capacitors and transistors. &lt;/p&gt;

&lt;p&gt;In this fase it's important to try things out. That is why you'll most likely use a development board for a specific microcontroller and connect it to different sensors with jumper wires on a breadboard. If you have played around with electronics before you probably know the Arduino Uno, a development board that simplifies the development for the ATmega328. There are a lot more development boards and even more microcontrollers that might bring you closer to your goal. In this stage you'll mostly write software to see if you can get everything up and running. &lt;/p&gt;

&lt;p&gt;Datasheets will help you to understand the features, usage and configuration of all the hardware components. These datasheets can range from a single page for simple LEDs to hundreds of pages for a microcontroller.&lt;/p&gt;

&lt;p&gt;There is a possibility that some parts can't be placed on a breadboard or have a high chance of breaking when configured incorrectly. It's a good idea to simulate these parts and see if you can figure out the right configurations based on information in the datasheet. A popular free solution that can be used to do this is LTspice.&lt;/p&gt;

&lt;h3&gt;
  
  
  Design &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;When a development version or small prototype is done, you can start documenting and finalizing the hardware design. A few popular tools for designing hardware are KiCAD, EasyEDA, Eagle and Altium.  &lt;/p&gt;

&lt;p&gt;The first thing that has to be created is a schematic capture. This is a visual representation of all the hardware components you'll need. Depending on the size of this diagram, the connections between the components are specified with lines or labels. &lt;/p&gt;

&lt;p&gt;The next step is the PCB design. This design uses all the components specified by the schematic capture. You can draw a board, place components, draw traces ('wires' on the board), drill holes and place text. When the PCB design is done you can generate gerber files so a factory can produce your PCB. &lt;/p&gt;

&lt;p&gt;Besides designing the hardware it is also imported to write down some UMLs or flow charts of the (most important) software that will be put on the microcontroller. &lt;/p&gt;

&lt;p&gt;The schematic capture and flowcharts end up in a datasheet of the designed hardware. Additionally pin defentions, possible configurations, operating temperatures, operating voltages and sometimes even example circuits are added to the datasheet as well. &lt;/p&gt;

&lt;p&gt;Writing and checking a datasheet can take a lot of time. That is why it might be a good idea to send the gerber files to a factory before starting this process since manufacturing the designed PCB and shipping will take time as well. It's also smart to create a list of all electronics components that need to be put on the PCB, also called a BOM (bill of materials) and order all those components as well.&lt;/p&gt;

&lt;h3&gt;
  
  
  Implementation &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;When the PCB and components are in, it's time to solder. Depending on the size of the electronic components a solder iron, hot air or even a special oven can be used to stick the components to the PCB. In case some components have a small SMD (Surface Mounted Device) packages you may have to use a microscope to make sure pins aren't soldered together. &lt;/p&gt;

&lt;p&gt;Then the circuit can be tested or debugged using various tools like a multimeter, signsal generator, ocilliscope and/or logic analyser. These tools can also be used during the development stage if a development circuit isn't behaving like it should.&lt;/p&gt;

&lt;p&gt;In case there is a problem in the PCB design, that can't be corrected by desoldering some components or soldering some extra wires or resistors to the board the design has to be fixed in the software and the PCB and components have to be re-ordered. &lt;/p&gt;

&lt;p&gt;This is also the moment the full application that has to run on the microcontroller is completed with all the necessary optimisations (if that hasn't been done already). &lt;/p&gt;

&lt;h3&gt;
  
  
  Testing &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;If there is a version of the hardware that can be tested it is time to perform unit, integration and finally acceptance tests. The unit test is a test where controlled inputs and outputs are 'written' and read from the design. If the right signals come back within a specified time-frame in various condition it passes the test. The integration test is done when your hardware has communicate with other pieces of hardware. If that communication goes well it passes the test. &lt;/p&gt;

&lt;p&gt;The acceptance test should only be done with a PCB that contains the final design and didn't need any extra debug hardware fixes. In this test the full system will tested to see if all requirements of the system are met.&lt;/p&gt;

&lt;p&gt;In some cases specific test results and behaviours are put in the datasheet as well. &lt;/p&gt;

&lt;h3&gt;
  
  
  Deployment &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;When all the test pass you hand over the physical product, designs and documentation. It's time to celebrate since this process can take months or even years.  &lt;/p&gt;

&lt;h1&gt;
  
  
  Software development: web vs embedded &lt;a&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;Embedded software development and web development have a few similarities. The most general skills that will help in both types of development are logical/computational  thinking, creating algorithms, debugging, clean code and creating useful comments and documentation. What makes or breaks embedded software development for an individual lies within the differences. &lt;/p&gt;

&lt;h3&gt;
  
  
  Industry languages &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The web is extremely diverse. Although a combination of HTML, CSS and JS on the front-end is the norm, there are quite a lot of front-end frameworks out there. Besides that a lot of different languages can be and are being used on the back-end. You could look for a back-end position right now and encounter: PHP, Python, NodeJS, Ruby, C#, Java and a lot more. &lt;/p&gt;

&lt;p&gt;The embedded systems industry shows a clear preference of C and C++. This is mainly because these languages have the toolchains to compile for nearly any microcontroller. The control over memory also makes the use of these languages ideal. Python seems to grow in popularity as well. This could be because of the release of micropython. I've also seen some anecdotes on reddit of how Raspberry Pi compute modules are used on PCBs. Another interesting language is Assembly which is mainly used for small pieces of software that need to meet strict timing deadlines. &lt;/p&gt;

&lt;p&gt;Other notable languages are VHDL and Verilog which don't produce code that runs on a machine but a hardware design that can be adopted by a FPGA (field-programmable gate array). This is an IC that can change its own circuit. So instead of writing software you are writing hardware. &lt;/p&gt;

&lt;h3&gt;
  
  
  Moving between 'frameworks' &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;If you happen to be a web developer that has switched jobs or works at an agency that has multiple stacks in production right now you'll know what it feels like to switch between frameworks. If you are lucky most concepts stay the same, making it mostly a matter of learning syntax.&lt;/p&gt;

&lt;p&gt;Being able to write efficient software for a specific 'family' of microcontrollers is similar. It means you'll have to learn what features are available and in what ways the microcontroller can be configured. Due to the amount of differences between most families however it could be seen as picking up a new programming language rather than picking up a new framework. Other than that it's very similar. The first one will be hard but moving on to another family afterwords should be relatively easy. The biggest hurdles will probably be some newly introduced concepts tied to specific features and the Assembly language of the specific chip. &lt;/p&gt;

&lt;h3&gt;
  
  
  Math &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The most common web applications don't require math beyond high school level. Besides that you can trust that most of your users have a processor that is powerful enough to handle complex math within a certain amount of time. &lt;/p&gt;

&lt;p&gt;Within embedded software development there are often some processes that require math that ranges from high school level to calculus on microcontrollers that are often not powerful of fast enough. A great example of one of these processes is DSP (Digital Signal Processing). This is used for processes video and audio and requires some calculus. Meeting the requirement or even making sure the application works means you have to pre-calculate coefficients and use mathematical tricks like fixed point numbers. &lt;/p&gt;

&lt;p&gt;Additional hardware can be added to take some of the pain away but that will increase the cost of the device. Some things might have been implemented by someone online but run too slow in your specific application. Don't worry too much about calculating those coefficients though. Tools like matlab and miniDSP can help with that. The most important is that you know how to type of mathematical functions you will need to apply to reach your desired outcome (or at least how to translate them to code after googeling). The same goes for all the other cases math is needed (increasing accuracy of sensors, increasing speed, &lt;/p&gt;

&lt;p&gt;Not all systems don't need heavy math and everything can be learned so don't let that scare you!&lt;/p&gt;

&lt;h3&gt;
  
  
  Binary  &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The use of binary is another thing that isn't really used in web applications. However all input signals from external sensors are ones and zeroes. Depending on which abstraction layer you code you may have to configure a microcontroller by changing bits and figuring out bitmasks. Again don't let this scare you, anything can be practiced. &lt;/p&gt;

&lt;h1&gt;
  
  
  Keeping your head up &lt;a&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;A switch between fields can take its toll on you. Right now this is written from the perspective of taking a minor from a major in a different building. However, I strongly believe that these feelings are really universal and apply to situations beyond college and will occur after any major switch. &lt;/p&gt;

&lt;h3&gt;
  
  
  Loneliness  &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Stepping into a new environment makes most people nervous. No matter how introverted or extraverted you are, as humans we want someone to connect to. In most cases you'll be fine, unfortunately my 'nightmare' manifested itself making the first four weeks of my minor very difficult on an emotional level as well.&lt;/p&gt;

&lt;p&gt;As the only the only on from my major and a non stereotypical electrical engineering look a lot of people gave me the 'don't even bother, you'll drop out anyways vibes'. Don't beat yourself up if classmates joke amongst eachother that they don't want to sit next to you, teachers randomly ask you of they should repeat material in a non-native language or if you sit alone for the first few breaks. Do know that you have to make a decision, is what you want to learn really worth the emotional hit? In my case I determined it was but I also made sure I did the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Text my close friends when possible&lt;/li&gt;
&lt;li&gt;Taking on a hobby that involves being with other people &lt;/li&gt;
&lt;li&gt;Make sure I make time to spend time with family&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Over time people realised I wasn't going to drop out and I have defintely noticed I earned some respect because of it. Besides that the project team I'm on slowely started to bond. So there were people I could say good morning to and to be fair from that moment on a lot of loneliness issues started to fix itself. &lt;/p&gt;

&lt;h3&gt;
  
  
  Imposter syndrome &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The classic imposter syndrome will creep up at some point. Especially if you are surrounded by people with a specific foundation you don't have remind yourself that you are new to all of this. A growth mindset is the most important thing you need to develop to stay on track. Make sure to write down all the things you learn and keep the work you can. Looking at everything you have accomplished up until this point can have a theraputic effect.  &lt;/p&gt;

&lt;h1&gt;
  
  
  Some cool places and faces in the community &lt;a&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;A switch is never just about technical skills, you'll be surrounded by a different community with different interests, values and key players. There are various resources and places to learn more about hardware and embedded systems. This is a list of my favourite go to places and people on the internet. &lt;/p&gt;

&lt;h3&gt;
  
  
  News and project sharing &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Hackaday.com&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://hackaday.com"&gt;Hackaday.com&lt;/a&gt; is a site that shares the latest news for within the electonics and maker community. They also host the 'superconference' and share interesting projects from their community websites.   &lt;/p&gt;

&lt;p&gt;YouTube: &lt;a href="https://www.youtube.com/user/hackaday"&gt;HACKADAY&lt;/a&gt;&lt;br&gt;
Twitter: &lt;a href="https://twitter.com/hackaday"&gt;@hackaday&lt;/a&gt;&lt;br&gt;
Instagram: &lt;a href="https://www.instagram.com/hackaday/"&gt;@hackaday&lt;/a&gt;&lt;br&gt;
Github: &lt;a href="https://github.com/Hack-a-Day"&gt;@Hack-a-Day&lt;/a&gt;&lt;br&gt;
Personal favourite: &lt;a href="https://www.youtube.com/watch?v=A3nuErB94jk"&gt;Teaser: 2019 Hackaday Superconference Badge&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hackaday.io&lt;/strong&gt; &lt;br&gt;
&lt;a href="https://hackaday.io"&gt;Hackaday.io&lt;/a&gt; is a platform that to showcase your hardware/software/embedded projects and interact with other makers. This is the community site of hackaday.com. There are a lot of cool projects that share components and files that allow you to rebuild it yourself.&lt;/p&gt;

&lt;p&gt;Twitter: &lt;a href="https://twitter.com/hackadayio"&gt;@hackadayio&lt;/a&gt;&lt;br&gt;
Personal favourite: &lt;a href="https://hackaday.io/project/167056-fetch-a-ferrofluid-display"&gt;Ferrofluid Display&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hackster.io&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://www.hackster.io/"&gt;Hackster&lt;/a&gt; is another platform which allows you to share projects. Most projects come with a very detailed description of how to build them yourself and are mostly based on development boards and popular platforms like Arduino and Raspberry Pi. &lt;/p&gt;

&lt;p&gt;YouTube: &lt;a href="https://www.youtube.com/channel/UCqQzKnjSPjkJGMcjPg-Wktw"&gt;Hackster.io&lt;/a&gt;&lt;br&gt;
Twitter: &lt;a href="https://twitter.com/Hacksterio"&gt;@Hacksterio&lt;/a&gt;&lt;br&gt;
Instagram: &lt;a href="https://www.instagram.com/hacksterio/"&gt;@hacksterio&lt;/a&gt;&lt;br&gt;
Github: &lt;a href="https://github.com/hacksterio"&gt;@hacksterio&lt;/a&gt;&lt;br&gt;
personal favourite: &lt;a href="https://www.hackster.io/ekaggrat/sequino-ec6d50"&gt;Sequino&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Influential companies &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Adafruit&lt;/strong&gt; &lt;br&gt;
&lt;a href="https://www.adafruit.com/"&gt;Adafruit&lt;/a&gt; is an American company that designs, produces and sells hardware that can be used by from beginners to advanced makers. Besides that the company has made a lot of open source libraries and also teaches about electronics through their &lt;a href="https://learn.adafruit.com/"&gt;learning platform&lt;/a&gt; and &lt;a href="https://blog.adafruit.com/"&gt;blog&lt;/a&gt;. Adafuit's products are also sold by (web)shops that are based outside of the use because of their quality and accessibility. &lt;/p&gt;

&lt;p&gt;YouTube: &lt;a href="https://www.youtube.com/user/adafruit"&gt;Adafruit Industries&lt;/a&gt;&lt;br&gt;
Twitter: &lt;a href="https://twitter.com/adafruit"&gt;@adafruit&lt;/a&gt;&lt;br&gt;
Instagram: &lt;a href="https://www.instagram.com/adafruit/"&gt;@adafruit&lt;/a&gt;&lt;br&gt;
Github: &lt;a href="https://github.com/adafruit"&gt;@adafruit&lt;/a&gt;&lt;br&gt;
Hackster: &lt;a href="https://www.hackster.io/adafruit"&gt;Adafruit Community&lt;/a&gt;&lt;br&gt;
Personal favourite: &lt;a href="https://www.youtube.com/watch?v=D27U3wHN8fs"&gt;Limor Fried, Founder &amp;amp; CEO, Adafruit Industries&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sparkfun&lt;/strong&gt; &lt;br&gt;
&lt;a href="https://www.sparkfun.com/"&gt;Sparkfun&lt;/a&gt; is another American company that designs, produces and sells hardware that can be used by both beginners and advanced users. Their products are also sold by shops based outside of the US because of quality and accessibility. They produce open source libraries and have a &lt;a href="https://learn.sparkfun.com/"&gt;learning platform&lt;/a&gt; and a &lt;a href="https://www.sparkfun.com/news"&gt;blog&lt;/a&gt; as well. What makes Sparkfun so cool is that they share all the design files of their self made products. This means you can not only buy them but see exactly how they are made and maybe even make some adaptations and send it off to the factory yourself. &lt;/p&gt;

&lt;p&gt;YouTube: &lt;a href="https://www.youtube.com/user/sparkfun"&gt;SparkFun Electronics&lt;/a&gt;&lt;br&gt;
Twitter: &lt;a href="https://twitter.com/sparkfun"&gt;@sparkfun&lt;/a&gt;&lt;br&gt;
Instagram: &lt;a href="https://www.instagram.com/sparkfun/"&gt;@sparkfun&lt;/a&gt;&lt;br&gt;
Github: &lt;a href="https://github.com/sparkfun"&gt;@sparfun&lt;/a&gt;&lt;br&gt;
Hackster: &lt;a href="https://www.hackster.io/sparkfun"&gt;Sparkfun Community&lt;/a&gt;&lt;br&gt;
Personal favourite: &lt;a href="https://learn.sparkfun.com/tutorials/pcb-basics/all"&gt;PCB Basics&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Learning communities &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;All about circuits&lt;/strong&gt; &lt;br&gt;
&lt;a href="https://www.allaboutcircuits.com/"&gt;All about circuits&lt;/a&gt; is a platform for electrical engineers that provides an open source textbook, news, tools and a forum. The educational content, especially their textbook, is  extremely useful for hardware beginners. The fundamentals of electronics are explained in a slow pace with analogies and drawings. They also have a youtube channel that they use to introduce new mouser products.&lt;/p&gt;

&lt;p&gt;YouTube: &lt;a href="https://www.youtube.com/channel/UCYTq2bhe5pim45pAEU-gDjw"&gt;All About Circuits&lt;/a&gt;&lt;br&gt;
Twitter: &lt;a href="https://twitter.com/AllAboutCircuit"&gt;@AllAboutCircuit&lt;/a&gt;&lt;br&gt;
Instagram: &lt;a href="https://www.instagram.com/all_about_circuits/"&gt;@all_about_circuits&lt;/a&gt;&lt;br&gt;
Github: &lt;a href="https://github.com/AllAboutCircuits"&gt;@AllAboutCircuits&lt;/a&gt;&lt;br&gt;
Personal favourite: &lt;a href="https://www.allaboutcircuits.com/textbook/"&gt;Electronics Textbook&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Element14&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://www.element14.com/"&gt;Element 14&lt;/a&gt; is another community with a forum (and a shop). They took over the ben heck show on youtube and share both entertaining and educational content based on electronics. I personally love the learning circuit because it teaches theory behind common concepts that are used in popular projects.&lt;/p&gt;

&lt;p&gt;YouTube: &lt;a href="https://www.youtube.com/user/thebenheckshow"&gt;element14 presents&lt;/a&gt;&lt;br&gt;
Twitter: &lt;a href="https://twitter.com/E14Community"&gt;@E14Community&lt;/a&gt;&lt;br&gt;
Github: &lt;a href="https://github.com/element14"&gt;@element14&lt;/a&gt;&lt;br&gt;
Personal favourite: &lt;a href="https://www.youtube.com/playlist?list=PLwO8CTSLTkii9S_vhEOsyJ17RI3jjBZ95"&gt;the learning circuit&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Educational people &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Great Scott&lt;/strong&gt;&lt;br&gt;
For electronics tutorials &amp;amp; fun projects Great Scott is one of the best youtube channels out there. He doesn't just walk you through what he does but also explains why he does certain things. This helps you to build your understanding of electronics in an entertaining way. &lt;/p&gt;

&lt;p&gt;YouTube: &lt;a href="https://www.youtube.com/channel/UC6mIxFTvXkWQVEHPsEdflzQ"&gt;GreatScott!&lt;/a&gt;&lt;br&gt;
Twitter: &lt;a href="https://twitter.com/GreatScottLab"&gt;@GreatScottLab&lt;/a&gt;&lt;br&gt;
Personal favourite: &lt;a href="https://www.youtube.com/watch?v=SIo_Gv7K7Fo"&gt;How to create a simple Touchscreen GUI || Arduino LCD &amp;amp; Touchscreen Tutorial&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Afrotechmods&lt;/strong&gt;&lt;br&gt;
Afrotechmods is another youtube channel that explains a lot about electronics and presents some projects from time to time. Unfortunately the last upload (as of writing this blogpost) was a year ago. However the creator is pretty active on twitter and has a &lt;a href="https://www.udemy.com/course/wireless-power-to-the-people-wireless-charging-101/?couponCode=TESLACOIL/"&gt;Udemy course&lt;/a&gt; on how to build wireless charging circuits with a very good rating. &lt;/p&gt;

&lt;p&gt;YouTube: &lt;a href="https://www.youtube.com/user/Afrotechmods"&gt;Afrotechmods&lt;/a&gt;&lt;br&gt;
Twitter: &lt;a href="https://twitter.com/afrotechmods"&gt;@afrotechmods&lt;/a&gt;&lt;br&gt;
Personal favourite: &lt;a href="https://www.youtube.com/watch?v=4ObzEft2R_g"&gt;How to make an LM386 audio amplifier circuit&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Shawn Hymel&lt;/strong&gt;&lt;br&gt;
Shawn Hymel can be seen as another hardware advocate that has created educational videos and tutorials for Sparkfun, Adafruit. He has his on &lt;a href="https://www.youtube.com/channel/UC7iBdyxIp3uJVIFIl6XTA6w"&gt;youtube channel&lt;/a&gt; on top of that. His tutorial series on KiCAD for Digi-Key is a really good start if you want to make your first PCB. Besides that he also has a tutorial series on Arduino and how to take your Arduino skills to the next level.  &lt;/p&gt;

&lt;p&gt;YouTube: &lt;a href="https://www.youtube.com/channel/UC7iBdyxIp3uJVIFIl6XTA6w"&gt;Shawn Hymel&lt;/a&gt;&lt;br&gt;
Twitter: &lt;a href="https://twitter.com/ShawnHymel"&gt;@ShawnHymel&lt;/a&gt;&lt;br&gt;
Instagram: &lt;a href="https://www.instagram.com/shawn_hymel/"&gt;@shawn_hymel&lt;/a&gt;&lt;br&gt;
Github: &lt;a href="https://github.com/ShawnHymel"&gt;@ShawnHymel&lt;/a&gt;&lt;br&gt;
Hackaday: &lt;a href="https://hackaday.io/ShawnHymel"&gt;@ShawnHymel&lt;/a&gt;&lt;br&gt;
Hackster: &lt;a href="https://www.hackster.io/ShawnHymel"&gt;Shawn hymel&lt;/a&gt;&lt;br&gt;
Personal favourite: &lt;a href="https://www.youtube.com/watch?v=6q1yEb_ukw8"&gt;Level Up Your Arduino Code: Registers&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bitluni&lt;/strong&gt;&lt;br&gt;
Bitluni is another maker with a youtube channel and a blog. He has build some very cool projects with a pretry populair development board called the ESP32. Not to long ago he posted a video on how he build a shield that transformed his ESP into a video game console. &lt;/p&gt;

&lt;p&gt;YouTube: &lt;a href="https://www.youtube.com/channel/UCp_5PO66faM4dBFbFFBdPSQ"&gt;bitluni's lab&lt;/a&gt;&lt;br&gt;
Twitter: &lt;a href="https://twitter.com/bitluni"&gt;@bitluni&lt;/a&gt;&lt;br&gt;
Instagram: &lt;a href="https://www.instagram.com/bitluni/"&gt;@bitluni&lt;/a&gt;&lt;br&gt;
Github: &lt;a href="https://github.com/bitluni"&gt;@bitluni&lt;/a&gt;&lt;br&gt;
Hackaday: &lt;a href="https://hackaday.io/bitluni"&gt;@bitluni&lt;/a&gt;&lt;br&gt;
Personal favourite: &lt;a href="https://www.youtube.com/watch?v=Qpt14gJVpTk"&gt;Arduino Game Controllers&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ben Eater&lt;/strong&gt;&lt;br&gt;
Ben eater has the best youtube channel out there for people who would like to know how a computer works. He has a series in which he builds an 8-bit computer from scratch and explain how every part of it works. If you want to dive in the deep you can even buy the parts he uses and build your own!&lt;/p&gt;

&lt;p&gt;YouTube: &lt;a href="https://www.youtube.com/beneater"&gt;Ben Eater&lt;/a&gt;&lt;br&gt;
Twitter: &lt;a href="https://twitter.com/ben_eater"&gt;@ben_eater&lt;/a&gt;&lt;br&gt;
Github: &lt;a href="https://github.com/beneater"&gt;@beneater&lt;/a&gt;&lt;br&gt;
Personal favourite: &lt;a href="https://www.youtube.com/playlist?list=PLowKtXNTBypGqImE405J2565dvjafglHU"&gt;Building an 8-bit breadboard computer!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;EEV Blog&lt;/strong&gt;&lt;br&gt;
EEV Blog is a Youtube Channel created by Dave Jones that has been around for ten years right now! It is centered around embedded systems and electrical engineering and covers a lot of topics from the use of different tools to the explaination of concepts around hardware. &lt;/p&gt;

&lt;p&gt;YouTube: &lt;a href="https://www.youtube.com/user/EEVblog"&gt;EEVblog&lt;/a&gt;&lt;br&gt;
Twitter: &lt;a href="https://twitter.com/eevblog"&gt;@eevblog&lt;/a&gt;&lt;br&gt;
Instagram: &lt;a href="https://www.instagram.com/eevblog/"&gt;@eevblog&lt;/a&gt;&lt;br&gt;
Github: &lt;a href="https://github.com/EEVblog"&gt;@EEVblog&lt;/a&gt;&lt;br&gt;
Personal favourite: &lt;a href="https://www.youtube.com/watch?v=crs_QLuUTyQ"&gt;EEVblog #1176 - 2 Layer vs 4 Layer PCB EMC TESTED!&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Inspirational people &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Jorvon 'Odd Jay' Moss&lt;/strong&gt; &lt;br&gt;
Jorvon Moss or 'Odd Jay' is the reason why I decided to take this journey. He makes robots that he takes with him by attaching them to his coat. He uses a combination of 3D printers and development boards to make his companion bots and often leaves guides on hackster with a guide describing how to make them yourself.&lt;/p&gt;

&lt;p&gt;Twitter: &lt;a href="https://twitter.com/Odd_Jayy"&gt;@Odd_Jayy&lt;/a&gt;&lt;br&gt;
Instagram: &lt;a href="https://www.instagram.com/odd_jayy/"&gt;@odd_jay&lt;/a&gt;&lt;br&gt;
Hackster: &lt;a href="https://www.hackster.io/Odd_Jayy"&gt;Jorvon Moss&lt;/a&gt;&lt;br&gt;
Personal favourite: &lt;a href="https://www.hackster.io/Odd_Jayy/asi-anansi-robot-companion-dbf92c"&gt;Asi (Anansi) Robot Companion&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Helen Leigh&lt;/strong&gt;&lt;br&gt;
Helen Leigh is a technical writer and maker who creates art by using electronics innovative ways. From stitching electronics on fabric with conductive thread to DIY musical instruments she explores whatever is on her mind and shares it with the world. Through her &lt;a href="https://t.co/K7LcD7t7sQ?amp=1"&gt;book&lt;/a&gt; she learns kids and beginners to mix electronics and crafts. &lt;/p&gt;

&lt;p&gt;YouTube: &lt;a href="https://www.youtube.com/user/helenlsteer"&gt;Helen Leigh&lt;/a&gt;&lt;br&gt;
Twitter: &lt;a href="https://twitter.com/helenleigh"&gt;@helenleigh&lt;/a&gt;&lt;br&gt;
Instagram: &lt;a href="https://www.instagram.com/helenleigh_makes/"&gt;@helenleigh_makes&lt;/a&gt;&lt;br&gt;
Github: &lt;a href="https://github.com/helenleigh"&gt;@helenleigh&lt;/a&gt;&lt;br&gt;
Hackaday: &lt;a href="https://hackaday.io/helenleigh"&gt;@helenleigh&lt;/a&gt;&lt;br&gt;
Personal favourite: &lt;a href="https://twitter.com/helenleigh/status/1215229256214683651"&gt;WIP arduino uno with conductive thread&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TwinkleTwinkie&lt;/strong&gt; &lt;br&gt;
TwinkleTwinkie is a PCB artist that makes and sells a lot of badges that can be worn. He posts a lot of designs on on Hackaday and reveals how he achieves certain effects. He also has a few lectures and demos on his youtube channel for those who want to learn how to build their own. &lt;/p&gt;

&lt;p&gt;YouTube: &lt;a href="https://www.youtube.com/channel/UCf8oXAT1uUzen6A57bwsudg"&gt;Twinkle Twinkie&lt;/a&gt;&lt;br&gt;
Twitter: &lt;a href="https://twitter.com/mrtwinkletwink"&gt;@mrtwinkletwink&lt;/a&gt;&lt;br&gt;
Hackaday: &lt;a href="https://hackaday.io/twinkletwinkie"&gt;@TwinkleTwinkie&lt;/a&gt;&lt;br&gt;
Hackster: &lt;a href="https://www.hackster.io/twinkletwinkie"&gt;TwinkleTwinkie&lt;/a&gt;&lt;br&gt;
Personal favourite: &lt;a href="https://www.youtube.com/watch?v=Sbkvza8cKQE"&gt;Understanding &amp;amp; Making PCB Art&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Jiří Praus&lt;/strong&gt;&lt;br&gt;
Jiří Praus is a maker that builds beautiful freeform PCBs by soldering wires and components to each other. The have a beautiful almost modern steampunk like look.  &lt;/p&gt;

&lt;p&gt;YouTube: &lt;a href="https://www.youtube.com/user/PanZCech"&gt;Jiri Praus&lt;/a&gt;&lt;br&gt;
Twitter: &lt;a href="https://twitter.com/jipraus"&gt;@jipraus&lt;/a&gt;&lt;br&gt;
Instagram: &lt;a href="https://www.instagram.com/jiripraus/"&gt;@jiripraus&lt;/a&gt;&lt;br&gt;
Github: &lt;a href="https://github.com/jpraus"&gt;@jpraus&lt;/a&gt;&lt;br&gt;
Hackaday: &lt;a href="https://hackaday.io/georgus"&gt;@georgus&lt;/a&gt;&lt;br&gt;
Hackster: &lt;a href="https://www.hackster.io/jiripraus"&gt;Jiří Praus&lt;/a&gt;&lt;br&gt;
Personal favourite: &lt;a href="https://www.youtube.com/watch?v=keD2IxvzPSs"&gt;Brass LED heart badge&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Thanks for scrolling
&lt;/h1&gt;

&lt;p&gt;Seriously! Hopefully, this is a preview that made you at least aware of the existence of embedded systems. Embedded development is something I am really interested in right now so don't be surprised if you see more posts about electronics and microcontrollers 😄&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>hardware</category>
      <category>embedded</category>
      <category>electronics</category>
    </item>
    <item>
      <title>Audio visualization with Rust</title>
      <dc:creator>Maniflames</dc:creator>
      <pubDate>Sat, 22 Jun 2019 17:00:40 +0000</pubDate>
      <link>https://dev.to/maniflames/audio-visualization-with-rust-4nhg</link>
      <guid>https://dev.to/maniflames/audio-visualization-with-rust-4nhg</guid>
      <description>&lt;p&gt;Since the start of this year I have been very determined to learn more about rust. I knew I wanted to do something with audio but had no idea where to start. Thankfully Justin Wernick created &lt;a href="https://github.com/JWorthe/rusty_microphone" rel="noopener noreferrer"&gt;Rusty Mic&lt;/a&gt; and wrote a &lt;a href="https://www.worthe-it.co.za/programming/2017/08/14/rusty-microphone.html" rel="noopener noreferrer"&gt;blogpost&lt;/a&gt; about it. I decided to build my own simple 'microphone visualization' with a different graphics library. If you catch something that could be improved let me know, I'd love to learn!&lt;/p&gt;

&lt;p&gt;If you just want to check out the code you can check out the repo I made for this small project:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/maniflames" rel="noopener noreferrer"&gt;
        maniflames
      &lt;/a&gt; / &lt;a href="https://github.com/maniflames/MicViz" rel="noopener noreferrer"&gt;
        MicViz
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A simple real time audio visualisation application build in Rust. 
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;MicViz&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;A simple real time audio visualisation app build in Rust.&lt;br&gt;
This is just a small and simple thing implemented with &lt;a href="https://github.com/RustAudio/rust-portaudio" rel="noopener noreferrer"&gt;(rust) portaudio&lt;/a&gt; and &lt;a href="https://github.com/three-rs/three/issues" rel="noopener noreferrer"&gt;three(-rs)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/maniflames/MicVizassets/mic.gif"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmaniflames%2FMicVizassets%2Fmic.gif" alt="A GIF demonstrating MicViz"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Getting started&lt;/h2&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Environment setup&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;You should be able to compile this project for any OS. For now this docs will focus on how to setup the enviroment on MacOS.&lt;/p&gt;
&lt;p&gt;To setup the environment run the following commands (not everything may apply to you):&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Clone this repository&lt;/span&gt;
git clone https://github.com/maniflames/MicViz.git

&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Install Rust with homebrew&lt;/span&gt;
brew install rust

&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Install portaudio with homebrew&lt;/span&gt;
brew install portaudio

&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Unpack MacOS SDK headers &lt;/span&gt;
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Compile and Run&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;Now that you're all set you can run this:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Navigate to project&lt;/span&gt;
&lt;span class="pl-c1"&gt;cd&lt;/span&gt; MicViz

&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Compile and run with cargo&lt;/span&gt;
cargo run&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Enjoy 😁&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/maniflames/MicViz" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;h1&gt;
  
  
  Dependencies
&lt;/h1&gt;

&lt;p&gt;For this project I'll be using two crates: &lt;a href="https://crates.io/crates/portaudio" rel="noopener noreferrer"&gt;portaudio&lt;/a&gt; for working with audio and &lt;a href="https://crates.io/crates/three" rel="noopener noreferrer"&gt;three&lt;/a&gt;. So go ahead and put the following in your &lt;code&gt;Cargo.toml&lt;/code&gt;:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;

&lt;span class="nn"&gt;[dependencies]&lt;/span&gt;
&lt;span class="py"&gt;portaudio&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.7.0"&lt;/span&gt;
&lt;span class="py"&gt;three&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.4.0"&lt;/span&gt;


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

&lt;/div&gt;

&lt;p&gt;Usually that would be all you'd have to do but in this case things are a little different. The portaudio crate just consists of Rust bindings to an actual installation of portaudio so you'll have to install that yourself. You can &lt;a href="http://www.portaudio.com/download.html" rel="noopener noreferrer"&gt;download&lt;/a&gt; and &lt;a href="http://portaudio.com/docs/v19-doxydocs/tutorial_start.html" rel="noopener noreferrer"&gt;compile&lt;/a&gt; portaudio for Windows, Linux and MacOS. However if you happen to dev on a mac it's probably easier to install it through homebrew with pkg-config.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

brew &lt;span class="nb"&gt;install &lt;/span&gt;pkg-config
brew &lt;span class="nb"&gt;install &lt;/span&gt;portaudio


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

&lt;/div&gt;
&lt;h1&gt;
  
  
  Reading audio input
&lt;/h1&gt;

&lt;p&gt;Let's read input from the default mic of your computer first. To accomplish this with portaudio's non-blocking inputstream. I'll try to be clear as possible by just commenting code line by line. &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;

&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="n"&gt;portaudio&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nn"&gt;std&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;sync&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;mpsc&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="c1"&gt;// Construct a portaudio instance that will connect to a native audio API&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;pa&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;portaudio&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;PortAudio&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Unable to init PortAudio"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
    &lt;span class="c1"&gt;// Collect information about the default microphone&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;mic_index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pa&lt;/span&gt;&lt;span class="nf"&gt;.default_input_device&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Unable to get default device"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;mic&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pa&lt;/span&gt;&lt;span class="nf"&gt;.device_info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mic_index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;.expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"unable to get mic info"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Set parameters for the stream settings.&lt;/span&gt;
    &lt;span class="c1"&gt;// We pass which mic should be used, how many channels are used,&lt;/span&gt;
    &lt;span class="c1"&gt;// whether all the values of all the channels should be passed in a &lt;/span&gt;
    &lt;span class="c1"&gt;// single audiobuffer and the latency that should be considered &lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;input_params&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;portaudio&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;StreamParameters&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;f32&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;mic_index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mic&lt;/span&gt;&lt;span class="py"&gt;.default_low_input_latency&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Settings for an inputstream.&lt;/span&gt;
    &lt;span class="c1"&gt;// Here we pass the stream parameters we set before,&lt;/span&gt;
    &lt;span class="c1"&gt;// the sample rate of the mic and the amount values we want to receive&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;input_settings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;portaudio&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;InputStreamSettings&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input_params&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mic&lt;/span&gt;&lt;span class="py"&gt;.default_sample_rate&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;256&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Creating a channel so we can receive audio values asynchronously&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;receiver&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;channel&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; 

    &lt;span class="c1"&gt;// A callback function that should be as short as possible so we send all the info to a different thread&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;callback&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;move&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="nn"&gt;portaudio&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;InputStreamCallbackArgs&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;..&lt;/span&gt; &lt;span class="p"&gt;}|&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;match&lt;/span&gt; &lt;span class="n"&gt;sender&lt;/span&gt;&lt;span class="nf"&gt;.send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nf"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nn"&gt;portaudio&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Continue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
            &lt;span class="nf"&gt;Err&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nn"&gt;portaudio&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Complete&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;

    &lt;span class="c1"&gt;// Creating &amp;amp; starting the input stream with our settings &amp;amp; callback&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;stream&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pa&lt;/span&gt;&lt;span class="nf"&gt;.open_non_blocking_stream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input_settings&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;.expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Unable to create stream"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
    &lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="nf"&gt;.start&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Unable to start stream"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;//Printing values every time we receive new ones while the stream is active&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="nf"&gt;.is_active&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nf"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;receiver&lt;/span&gt;&lt;span class="nf"&gt;.try_recv&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"{:?}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
       &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;



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

&lt;/div&gt;

&lt;p&gt;Running this should look something like this:&lt;br&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F94dby324lq1nkgz5z41i.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F94dby324lq1nkgz5z41i.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Visualizing the audio
&lt;/h1&gt;

&lt;p&gt;If you look closely you'll notice that all you get back from your microphone is a &lt;code&gt;slice&lt;/code&gt; containing numbers between -1.0 and 1.0. These numbers are a representation of how sound waves have manipulated a moving part within your microphone over time. There are different ways to visualise this change but to keep it simple let's draw a line for every change that occurs in time. We'll animate the lines by simply removing them and drawing new lines when we receive new changes. &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;

&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="n"&gt;portaudio&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nn"&gt;std&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;sync&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;mpsc&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="n"&gt;three&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;//struct for storing the application state&lt;/span&gt;
&lt;span class="nd"&gt;#[derive(Debug)]&lt;/span&gt;
&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;State&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;sound_values&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Vec&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;f32&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;scene_meshes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Vec&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nn"&gt;three&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Mesh&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Receiving audio input &lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;pa&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;portaudio&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;PortAudio&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Unable to init PortAudio"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;mic_index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pa&lt;/span&gt;&lt;span class="nf"&gt;.default_input_device&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Unable to get default device"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;mic&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pa&lt;/span&gt;&lt;span class="nf"&gt;.device_info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mic_index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;.expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"unable to get mic info"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;input_params&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;portaudio&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;StreamParameters&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;f32&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mic_index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mic&lt;/span&gt;&lt;span class="py"&gt;.default_low_input_latency&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;input_settings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;portaudio&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;InputStreamSettings&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input_params&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mic&lt;/span&gt;&lt;span class="py"&gt;.default_sample_rate&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;256&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;receiver&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;channel&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;callback&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;move&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="nn"&gt;portaudio&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;InputStreamCallbackArgs&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;..&lt;/span&gt; &lt;span class="p"&gt;}|&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;match&lt;/span&gt; &lt;span class="n"&gt;sender&lt;/span&gt;&lt;span class="nf"&gt;.send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nf"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nn"&gt;portaudio&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Continue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
            &lt;span class="nf"&gt;Err&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nn"&gt;portaudio&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Complete&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;

    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;stream&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pa&lt;/span&gt;&lt;span class="nf"&gt;.open_non_blocking_stream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input_settings&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;.expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Unable to create stream"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
    &lt;span class="n"&gt;stream&lt;/span&gt;&lt;span class="nf"&gt;.start&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Unable to start stream"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 

    &lt;span class="c1"&gt;// Create a full screen window with a black background&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;three&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;Window&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"My Mic"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
    &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="nf"&gt;.fullscreen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;win&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="nf"&gt;.build&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; 
    &lt;span class="n"&gt;win&lt;/span&gt;&lt;span class="py"&gt;.scene.background&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;three&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;Background&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;Color&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0x000000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Create a variable that will contain the state off the app&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;State&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;sound_values&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nn"&gt;Vec&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
        &lt;span class="n"&gt;scene_meshes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nn"&gt;Vec&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;

    &lt;span class="c1"&gt;// Create a camera that will be put in the scene on location 0.0, 0.0&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;camera&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;win&lt;/span&gt;&lt;span class="py"&gt;.factory&lt;/span&gt;&lt;span class="nf"&gt;.orthographic_camera&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="o"&gt;..&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 

    &lt;span class="c1"&gt;//Animation loop that will run until you press ESC or exit the program&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;win&lt;/span&gt;&lt;span class="nf"&gt;.update&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;win&lt;/span&gt;&lt;span class="py"&gt;.input&lt;/span&gt;&lt;span class="nf"&gt;.hit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nn"&gt;three&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;KEY_ESCAPE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Put new lines in the scene temporarily save them in the state&lt;/span&gt;
        &lt;span class="nf"&gt;update_lines&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;win&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="c1"&gt;// Show the lines&lt;/span&gt;
        &lt;span class="n"&gt;win&lt;/span&gt;&lt;span class="nf"&gt;.render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;camera&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="c1"&gt;// Remove all lines from the scene and the state&lt;/span&gt;
        &lt;span class="nf"&gt;remove_lines&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;win&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;//Update state&lt;/span&gt;
        &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nf"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;receiver&lt;/span&gt;&lt;span class="nf"&gt;.try_recv&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nf"&gt;update_sound_values&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
       &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Pass new samples into the state by overriding the vector&lt;/span&gt;
&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;update_sound_values&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;samples&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;f32&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;State&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="py"&gt;.sound_values&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;samples&lt;/span&gt;&lt;span class="nf"&gt;.to_vec&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; 
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Put new lines in the scene temporarily save them in the state&lt;/span&gt;
&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;update_lines&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;win&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="nn"&gt;three&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;window&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Window&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;State&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y_position&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="py"&gt;.sound_values&lt;/span&gt;&lt;span class="nf"&gt;.iter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.enumerate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

        &lt;span class="c1"&gt;// calculate the x position of the line by calculating a normalized x position between 0.0 and 1.0 (i / num_samples)&lt;/span&gt;
        &lt;span class="c1"&gt;// With the scale variable the size of the visualization can be changed. &lt;/span&gt;
        &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nb"&gt;f32&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
        &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;num_samples&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="py"&gt;.sound_values&lt;/span&gt;&lt;span class="nf"&gt;.len&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nb"&gt;f32&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
        &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;3.0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
        &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;x_position&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num_samples&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// create the geometry for a line with the calculated positions&lt;/span&gt;
        &lt;span class="c1"&gt;// three is a 3D graphics library so we pass the x, y, z values&lt;/span&gt;
        &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;geometry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;three&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;Geometry&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;with_vertices&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;vec!&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x_position&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y_position&lt;/span&gt;&lt;span class="nf"&gt;.clone&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nf"&gt;.into&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x_position&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;y_position&lt;/span&gt;&lt;span class="nf"&gt;.clone&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nf"&gt;.into&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;]);&lt;/span&gt;

        &lt;span class="c1"&gt;// create material so for our line, in this case white line material&lt;/span&gt;
        &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;material&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;three&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;material&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Line&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0xFFFFFF&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;};&lt;/span&gt;

        &lt;span class="c1"&gt;// create a 3D object from the geometry and the material&lt;/span&gt;
        &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;mesh&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;win&lt;/span&gt;&lt;span class="py"&gt;.factory&lt;/span&gt;&lt;span class="nf"&gt;.mesh&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;geometry&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;material&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// Put the line in the scene and store it in the state&lt;/span&gt;
        &lt;span class="n"&gt;win&lt;/span&gt;&lt;span class="py"&gt;.scene&lt;/span&gt;&lt;span class="nf"&gt;.add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;mesh&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
        &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="py"&gt;.scene_meshes&lt;/span&gt;&lt;span class="nf"&gt;.push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mesh&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Remove all lines from the scene and the state&lt;/span&gt;
&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;remove_lines&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;win&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="nn"&gt;three&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nn"&gt;window&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Window&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;State&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;mesh&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="py"&gt;.scene_meshes&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;win&lt;/span&gt;&lt;span class="py"&gt;.scene&lt;/span&gt;&lt;span class="nf"&gt;.remove&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;mesh&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="py"&gt;.scene_meshes&lt;/span&gt;&lt;span class="nf"&gt;.clear&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; 
&lt;span class="p"&gt;}&lt;/span&gt;


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

&lt;/div&gt;

&lt;p&gt;If you run the script it should look something like this: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmmshau44t2j0ei19s751.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmmshau44t2j0ei19s751.gif"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Enjoy your MicViz, if you have some time on your hands show off your version of it 😄👀&lt;/p&gt;

&lt;p&gt;And again, let me know any way to improve presented code if you happen to know a thing or two about Rust! &lt;/p&gt;

</description>
      <category>rust</category>
      <category>audio</category>
    </item>
    <item>
      <title>Pointcloud effect in Three.js</title>
      <dc:creator>Maniflames</dc:creator>
      <pubDate>Sat, 25 May 2019 23:58:49 +0000</pubDate>
      <link>https://dev.to/maniflames/pointcloud-effect-in-three-js-3eic</link>
      <guid>https://dev.to/maniflames/pointcloud-effect-in-three-js-3eic</guid>
      <description>&lt;p&gt;Not too long ago I built a site that served as a submission for a small competition. To spice it up, I decided to add some Three.js. An effect that has been on my mind for a pretty long time was the pointcloud. Austin Mayer has implemented a really cool one with effects on his website and I've been thinking about since I've seen it on his site.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1098662776929693706-0" src="https://platform.twitter.com/embed/Tweet.html?id=1098662776929693706"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1098662776929693706-0');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1098662776929693706&amp;amp;theme=dark"
  }



 &lt;/p&gt;

&lt;p&gt;Since the site had a little more to it, I decided to implement a super basic version of a pointcloud. Three.js provides a few functions that enable you to create a pointcloud pretty quickly.&lt;/p&gt;
&lt;h1&gt;
  
  
  Points instead of Mesh
&lt;/h1&gt;

&lt;p&gt;A mesh (3d object) in Three.js consists of geometry and material.  But instead of showing an entire mesh you just want to show the vertices. The &lt;a href="https://threejs.org/docs/index.html#api/en/objects/Points" rel="noopener noreferrer"&gt;&lt;code&gt;Points&lt;/code&gt;&lt;/a&gt; class in Three.js can take a geometry and display points instead of the 'full' object. With &lt;a href="https://threejs.org/docs/index.html#api/en/materials/PointsMaterial" rel="noopener noreferrer"&gt;&lt;code&gt;PointsMaterial&lt;/code&gt;&lt;/a&gt; you are able to control the size of your points. The code for a 'pointcloud mesh' looks something like:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;geometry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;TorusGeometry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;material&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;PointsMaterial&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;0xFFFFFF&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.25&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="nx"&gt;mesh&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Points&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;geometry&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;material&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="nx"&gt;scene&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mesh&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


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

&lt;/div&gt;
&lt;p&gt;For the full code, click/press on the example and check out &lt;code&gt;main.js&lt;/code&gt; in the code tab!&lt;br&gt;
&lt;/p&gt;
&lt;div class="glitch-embed-wrap"&gt;
  &lt;iframe src="https://glitch.com/embed/#!/embed/three-pointcloud-1?previewSize=100&amp;amp;path=index.html" alt="three-pointcloud-1 on glitch"&gt;&lt;/iframe&gt;
&lt;/div&gt;


&lt;h1&gt;
  
  
  Using 3D models
&lt;/h1&gt;

&lt;p&gt;It's possible to load 3D models in Three.js but you have to put in a little extra work. Depending on the format of the 3D model you have to load a loader in addition to the main library. I love to use .obj models myself so I personally need the &lt;code&gt;OBJLoader&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you load the library through an HTML tag you have to add an extra tag that loads a seperate script that comes with the Three.js download. This script can be found in &lt;code&gt;examples/js/loaders/OBJLoader.js&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;If you have included the entire folder loading it will be kind of like: &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;script src="three/examples/js/loaders/OBJLoader.js"&amp;gt;&amp;lt;/script&amp;gt;


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

&lt;/div&gt;
&lt;p&gt;If you use npm, you can import the loader through the jsm folder. Keep using the js folder if you prefer the require syntax though! The import statements look something like this: &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="c1"&gt;//import syntax&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;OBJLoader&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;three/examples/jsm/loaders/OBJLoader.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="c1"&gt;//require syntax, require adds OBJLoader directly to THREE&lt;/span&gt;
&lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;three/examples/js/loaders/OBJLoader.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;



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

&lt;/div&gt;
&lt;p&gt;Loaders work a bit like an extend 'fetch' without promises. You insert a url of the file containing the model, the loader will execute a http request. You provide callbacks for a successful request, a request that is still in progress and an unsuccessful request. &lt;/p&gt;

&lt;p&gt;You can get the geometry of the object you loaded by selecting the first child's geometry of the result.   &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;loader&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;OBJLoader&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nx"&gt;loader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://cdn.glitch.com/fcf3c007-b4eb-4250-ba6b-653fdab94ce3%2Fjapanese_temple.obj?1558792651869&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// the request was successfull&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;material&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;PointsMaterial&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;0xFFFFFF&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.25&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="nx"&gt;mesh&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Points&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;geometry&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;material&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;mesh&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;position&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt; &lt;span class="c1"&gt;//this model is not exactly in the middle by default so I moved it myself&lt;/span&gt;
    &lt;span class="nx"&gt;scene&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mesh&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;xhr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// the request is in progress&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;xhr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// something went wrong&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;loading .obj went wrong, &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;


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

&lt;/div&gt;

&lt;div class="glitch-embed-wrap"&gt;
  &lt;iframe src="https://glitch.com/embed/#!/embed/three-pointcloud-2?previewSize=100&amp;amp;path=index.html" alt="three-pointcloud-2 on glitch"&gt;&lt;/iframe&gt;
&lt;/div&gt;



&lt;p&gt;Small disclaimer: 3D models can be build in 3D modeling software like Autodesk Maya3D and Blender with geometry and 'modifiers'. If a very big part of the model is created with modifiers the points won't show up in a way you can 'see' the object when you apply the pointcloud. That's why it's very important that you always test 3D models you want to use specifically for this purpose. &lt;/p&gt;

&lt;h1&gt;
  
  
  A little control
&lt;/h1&gt;

&lt;p&gt;Interactivity will always make something a lot more fun. Hover and morph effects like on Austin Mayer's site definitely take effort and time to create. But three has functionality you can quickly add to at least give users the ability to move the camera around with &lt;code&gt;OrbitControls&lt;/code&gt;. Like 3D model loaders the controls are an extension you have to load. Orbit controls are located in &lt;code&gt;examples/js/controls/OrbitControls.js&lt;/code&gt; (or &lt;code&gt;examples/jsm/controls/OrbitControls.js&lt;/code&gt; using the import syntax). The code looks a little like this: &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

 &lt;span class="nx"&gt;camera&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;PerspectiveCamera&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;75&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerWidth&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHeight&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nx"&gt;camera&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;position&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;z&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;controls&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;OrbitControls&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;camera&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nx"&gt;controls&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;enableZoom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="c1"&gt;//zoom happens on scroll which can be quite annoying&lt;/span&gt;


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

&lt;/div&gt;

&lt;div class="glitch-embed-wrap"&gt;
  &lt;iframe src="https://glitch.com/embed/#!/embed/three-pointcloud-3?previewSize=100&amp;amp;path=index.html" alt="three-pointcloud-3 on glitch"&gt;&lt;/iframe&gt;
&lt;/div&gt;



&lt;p&gt;I hope this helps as a 'getting started' on creating pointclouds in Three.js!&lt;/p&gt;

&lt;h1&gt;
  
  
  Credits
&lt;/h1&gt;

&lt;p&gt;I got a lot of moral support from my best friend Sven, who also submitted a website to compete. I had a lot of doubt and wasn't sure wether I should submit anything at all. I'm glad he convinced me, because we are both be in Shanghai this winter 🎉. In case you want to know a little more, he wrote an article a while ago:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/sven" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F132519%2F46fec9f4-413d-47f5-9c0d-a3972b47abf9.jpg" alt="sven"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/sven/why-i-struggled-with-creating-an-account-here-and-why-i-did-it-5ah" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Why I Struggled with Creating an Account Here and Why I Did It&lt;/h2&gt;
      &lt;h3&gt;Sven Hoffmann ・ Feb 7 '19&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#writing&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#career&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#meta&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>javascript</category>
      <category>threejs</category>
      <category>pointcloud</category>
      <category>3d</category>
    </item>
    <item>
      <title>Tricks I learned to improve my communication</title>
      <dc:creator>Maniflames</dc:creator>
      <pubDate>Sun, 03 Feb 2019 21:26:59 +0000</pubDate>
      <link>https://dev.to/maniflames/communication-tricks-i-picked-up-during-my-internship-4kdj</link>
      <guid>https://dev.to/maniflames/communication-tricks-i-picked-up-during-my-internship-4kdj</guid>
      <description>&lt;p&gt;This was my final week as intern at UpReach and I had a blast! Working on the front-end, back-end and even a hardware component of the UpReach photo booth taught me a lot. The most exciting thing however, was that I got to live in Berlin for five months. However working in another country can have its downsides, like language barriers. English was the go to language even though not a single person, including me, was a native speaker. This was specifically because I could read a bit of German but not speak it. On top of that I often had to talk to project management and sales who did not always know the details of the technology behind the product. There are four tricks that improved my communication towards my co-workers and I would really like to share them with you.&lt;/p&gt;

&lt;h1&gt;
  
  
  1. Keep track of the conversation
&lt;/h1&gt;

&lt;p&gt;The photo booth business is fast. From time to time I had to join briefings that discussed special configurations and development for specific clients. A lot of information would be thrown at me in a very short period of time. By writing down important details and keywords during the briefing I was able to keep track of the conversation. This trick sounds like the obvious thing to do, but it will surprise you how easy it is to forget to take notes. Taking notes does not just help you in the moment but also in the long run. Small details that make a big difference will slip your mind at some point, reading notes from the past can really help.&lt;/p&gt;

&lt;h1&gt;
  
  
  2. Delay your opinions
&lt;/h1&gt;

&lt;p&gt;If you have experienced certain patterns over and over it is very easy to jump to conclusions. Before you do so make sure you receive &lt;em&gt;all&lt;/em&gt; of the information that has to be communicated. Something that seems like a minor detail to the project manager can make a big difference to what you have to build. Someone might also come with a proposed solution that doesn't seem to fit the situation. Before you decide to implement something 'better' instead ask why the person proposed it. Nodding your head and doing what you think is right or faster can backfire and cost you a lot more time. Always make sure you understand the full context. Communicate concerns and alternatives when you have an understanding the bigger picture.  &lt;/p&gt;

&lt;h1&gt;
  
  
  3. Explain tech on the right level of complexity
&lt;/h1&gt;

&lt;p&gt;Tailor your explanation to the audience whenever you have to explain the technical side of things. As developer, it is easy forget how many acronyms and abstractions you encounter on a daily basis. If you are talking to someone who is not a developer you will most likely have to tone down the jargon. Make sure the amount of jargon and technical detail suits the person you are talking to. It often takes time to figure out how comfortable someone is with details. Some project managers at UpReach preferred to stay as far away from the jargon as possible. Others knew a lot about tech and could understand me with ease. It will be a lot easier to talk to different departments if you are able to explain yourself with different levels of complexity.&lt;/p&gt;

&lt;h1&gt;
  
  
  4. Make sure everyone is on the same page
&lt;/h1&gt;

&lt;p&gt;Assuming that everyone is on the same page right before a briefing ends is a huge mistake. It is very easy to forget or misinterpret something. Before you collectively end the brief, summarize the important conclusions out loud and ask anything is missing. After everyone agrees, state what each person is going to do from this point on. This saves a lot of time and miscommunication in the long run.&lt;/p&gt;

&lt;p&gt;Clear communication is a really important part of a job in any field. Hopefully, these four tricks will clear up some communication with co-workers. I still have to get 'good' at all of these but just trying can already make a big difference. &lt;/p&gt;

</description>
      <category>internship</category>
      <category>beginners</category>
      <category>career</category>
      <category>communication</category>
    </item>
    <item>
      <title>What are your favourite communities?</title>
      <dc:creator>Maniflames</dc:creator>
      <pubDate>Sun, 27 Jan 2019 17:31:56 +0000</pubDate>
      <link>https://dev.to/maniflames/what-are-your-favourite-communities-5d7f</link>
      <guid>https://dev.to/maniflames/what-are-your-favourite-communities-5d7f</guid>
      <description>&lt;p&gt;By posting and interacting with others on DEV for the past month I have learned a lot. Not just about code or productivity but about how awesome community can be. Everyone on DEV helps others out while staying polite which is really cool. In pretty much every community I'm just a lurker who passes likes every once in a while. This is the first community that made me feel I could post things myself and be part of a conversation. &lt;/p&gt;

&lt;p&gt;I realised a lot of DEVs have a twitter account. In the back of my mind I knew there are some developers on twitter and followed a few. After starting out with devs on here and exploring from there I fell into a rabbit hole of a tons of communities and people that use twitter, email lists, personal blogs and sites like dev to share knowledge. I feel like I've just scratched the surface of interesting people and communities to check out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are your favourite communities and/or devs and why? I'd love to discover even more awesomeness&lt;/strong&gt; 😁&lt;/p&gt;

&lt;p&gt;For anyone who is looking for a nice chat with other beginners: This discuss post resulted in a telegram group 🎉. Join in &lt;a href="//t.me/randomdevs"&gt;t.me/randomdevs&lt;/a&gt; ! &lt;/p&gt;

</description>
      <category>discuss</category>
      <category>community</category>
    </item>
    <item>
      <title>Creating a custom shader in Three.js</title>
      <dc:creator>Maniflames</dc:creator>
      <pubDate>Mon, 21 Jan 2019 00:03:29 +0000</pubDate>
      <link>https://dev.to/maniflames/creating-a-custom-shader-in-threejs-3bhi</link>
      <guid>https://dev.to/maniflames/creating-a-custom-shader-in-threejs-3bhi</guid>
      <description>&lt;p&gt;3D stuff in the browser is awesome. After playing around with threejs for some time and making a &lt;a href="https://dodge.imanidap.nl/"&gt;mini-game&lt;/a&gt; at school I started to like it a lot. A classmate that is really into graphics programming told me a little bit about WebGL and shaders. It seemed really cool and I promised myself I would make my own shader. Of course some other shiny thing caught my attention and I forgot about it but, from today on I can finally say that I have created a shader and used it within threejs. &lt;/p&gt;

&lt;h1&gt;
  
  
  Three JS
&lt;/h1&gt;

&lt;p&gt;Before going all in on shaders it is probably a good idea to explain what &lt;a href="https://threejs.org/"&gt;three js&lt;/a&gt; is. Threejs is a javascript library to ease the process of creating 3D scenes on a canvas. Other popular solutions like &lt;a href="https://aframe.io/"&gt;a-frame&lt;/a&gt; and &lt;a href="https://whs.io/"&gt;whitestorm js&lt;/a&gt; are build on top of it. If you have ever played around with those but want even more control definitely try it out! (If you are a TypeScript lover, three js has &lt;a href="https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three"&gt;type definitions&lt;/a&gt; 😉).   &lt;/p&gt;

&lt;p&gt;The most popular intro to this library is creating a cube and making it spin. There is a written tutorial in the &lt;a href="https://threejs.org/docs/index.html#manual/en/introduction/Creating-a-scene"&gt;threejs documentation&lt;/a&gt; and  a brilliant youtube tutorial by CJ Gammon that is part of his 'diving in: three js' series.&lt;/p&gt;

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

&lt;p&gt;Creating this cube is a basically preparing a film set and placing it inside of that set. You create a scene and a camera and pass these to a renderer to say: "hey this is my movie set". Then you can place mesh, which is basically an object, within the scene. This mesh consists of a geometry (the shape of the object) and a material (the color, behavior towards light and more). Based on the material you have chosen, you might want to add different kinds of lights to the scene. In order to animate the object and actually display everything you create a loop. Within this loop you tell the renderer to show the scene. Your code might look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;load&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;init&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;scene&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;camera&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;renderer&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sceneObjects&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;init&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;scene&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Scene&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

  &lt;span class="nx"&gt;camera&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PerspectiveCamera&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;75&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerWidth&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHeight&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nx"&gt;camera&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;position&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;z&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;

  &lt;span class="nx"&gt;renderer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;WebGLRenderer&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="nx"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setSize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerWidth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHeight&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;domElement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nx"&gt;adjustLighting&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="nx"&gt;addBasicCube&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="nx"&gt;animationLoop&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;adjustLighting&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;pointLight&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PointLight&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0xdddddd&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;pointLight&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;position&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;scene&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pointLight&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;ambientLight&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;AmbientLight&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x505050&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;scene&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ambientLight&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;addBasicCube&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;geometry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;BoxGeometry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;material&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;MeshLambertMaterial&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  

  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;mesh&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Mesh&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;geometry&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;material&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nx"&gt;mesh&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;position&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;
  &lt;span class="nx"&gt;scene&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mesh&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nx"&gt;sceneObjects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mesh&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;animationLoop&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;scene&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;camera&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;object&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;sceneObjects&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rotation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mf"&gt;0.01&lt;/span&gt;
    &lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rotation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mf"&gt;0.03&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;requestAnimationFrame&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;animationLoop&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;h1&gt;
  
  
  Shaders
&lt;/h1&gt;

&lt;p&gt;Shaders are basically functions or small scripts that are executed by the GPU. This is where &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Getting_started_with_WebGL"&gt;WebGL&lt;/a&gt; and &lt;a href="https://developer.mozilla.org/en-US/docs/Games/Techniques/3D_on_the_web/GLSL_Shaders"&gt;GLSL (OpenGL Shading Language)&lt;/a&gt; come into play. WebGL is a browser API that allows javascript to run code on the GPU. This can increase the performance of certain scripts because your GPU is optimized for doing graphics related calculations. WebGL even allows us to write code that will be executed directly by the GPU in the GLSL language. These pieces of GLSL code are our shaders and since threejs has a WebGL renderer we can write shaders to modify our mesh. In threejs you can create custom material by using the 'shader material'. This material accepts two shaders, a vertex shader and a fragment shader. Let's try to make 'gradient material'.&lt;/p&gt;
&lt;h2&gt;
  
  
  Vertex Shader
&lt;/h2&gt;

&lt;p&gt;A vertex shader is a function that is applied on every vertex (point) of a mesh. It is usually used to distort or animate the shape of a mesh. Within our script it looks something like this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;vertexShader&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`
    varying vec3 vUv; 

    void main() {
      vUv = position; 

      vec4 modelViewPosition = modelViewMatrix * vec4(position, 1.0);
      gl_Position = projectionMatrix * modelViewPosition; 
    }
  `&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The first thing that you probably notice is that all our GLSL code is in a string. We do this because WebGL will pass this piece of code to our GPU and we have to pass the code to WebGL within javascript. The second thing you might notice is that we are using variables that we did not create. This is because threejs passes those variables to the GPU for us. &lt;/p&gt;

&lt;p&gt;Within this piece of code we calculate where the points of our mesh should be placed. We do this by calculating where the points are in the scene by multiplying the position of the mesh in the scene (modelViewMatrix) and the position of the point. After that we multiply this value with the camera's relation to the scene (projectionMatrix) so the camera settings within threejs are respected by our shader. The gl_Position is the value that the GPU takes to draw our points. &lt;/p&gt;

&lt;p&gt;Right now this vertex shader doesn't change anything about our shape. So why even bother creating this at all? We will need the positions of parts of our mesh to create a nice gradient. By creating a 'varying' variable we can pass the position to another shader.  &lt;/p&gt;
&lt;h2&gt;
  
  
  Fragment shader
&lt;/h2&gt;

&lt;p&gt;A fragment shader is a function that is applied on every fragment of our mesh. A fragment is a result of a process called rasterization which turns the entire mesh into a collection of triangles. For every pixel that is covered by our mesh there will be at least one fragment. The fragment shader is usually used to do color transformations on pixels. Our fragment shader looks like this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`
      uniform vec3 colorA; 
      uniform vec3 colorB; 
      varying vec3 vUv;

      void main() {
        gl_FragColor = vec4(mix(colorA, colorB, vUv.z), 1.0);
      }
  `&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;As you can see we take the value of the position that was passed by the vertex shader. We want to apply a mix of the colors A and B based on the position of the fragment on the z axis of our mesh. But where do the colors A and B come from? These are 'uniform' variables which means they are passed into the shader from the outside. The mix function will calculate the RGB value we want to draw for this fragment. This color and an additional value for the opacity are passed to gl_FragColor. Our GPU will set the color of a fragment to this color.&lt;/p&gt;
&lt;h2&gt;
  
  
  Creating the material
&lt;/h2&gt;

&lt;p&gt;Now that we've created the shaders we can finally build our threejs mesh with a custom material.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;addExperimentalCube&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;uniforms&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;colorB&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;vec3&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Color&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0xACB6E5&lt;/span&gt;&lt;span class="p"&gt;)},&lt;/span&gt;
        &lt;span class="na"&gt;colorA&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;vec3&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Color&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x74ebd5&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;geometry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;BoxGeometry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;material&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ShaderMaterial&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;uniforms&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;uniforms&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;fragmentShader&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;fragmentShader&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="na"&gt;vertexShader&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;vertexShader&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;

  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;mesh&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Mesh&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;geometry&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;material&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nx"&gt;mesh&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;position&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
  &lt;span class="nx"&gt;scene&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mesh&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nx"&gt;sceneObjects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mesh&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This is where everything comes together. Our 'uniforms' colorA and colorB are created and passed along with the vertex shader and fragment shader into the shader material. The material and geometry are used to create a mesh and the mesh is added to the scene.&lt;/p&gt;


&lt;div class="glitch-embed-wrap"&gt;
  &lt;iframe src="https://glitch.com/embed/#!/embed/three-cube-experiment?previewSize=100&amp;amp;path=index.html" alt="three-cube-experiment on glitch"&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
I build this in glitch. A friend recommended it and it is great! Some add blockers block you loading the embed though, so &lt;a href="https://three-cube-experiment.glitch.me/"&gt;here is a direct link&lt;/a&gt; just in case.&lt;/p&gt;

&lt;p&gt;The left cube is a cube using mesh lambert material, the right cube uses our own 'gradient material'. As you can see our material looks pretty sweet but ignores the light settings in the scene. This is because we didn't do the math in our fragment shader to take the light into account. This is hopefully something I figure out soon 😝.&lt;/p&gt;

&lt;h1&gt;
  
  
  Resources
&lt;/h1&gt;

&lt;p&gt;It took some time to figure this out and if you liked this you should really check out the sources I have used to learn and understand this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=uD4GnMsAH1U&amp;amp;index=5&amp;amp;list=PL08jItIqOb2qyMOhtEUoLh100KpccQiRf"&gt;CJ Gammon - Three.js Part 5: Shaders&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://thebookofshaders.com/06/"&gt;The book of shaders - color&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>threejs</category>
      <category>webgl</category>
      <category>javascript</category>
      <category>3d</category>
    </item>
    <item>
      <title>How do you approach knowledge gaps?</title>
      <dc:creator>Maniflames</dc:creator>
      <pubDate>Sun, 13 Jan 2019 23:08:46 +0000</pubDate>
      <link>https://dev.to/maniflames/how-do-you-approach-knowledge-gaps-44n4</link>
      <guid>https://dev.to/maniflames/how-do-you-approach-knowledge-gaps-44n4</guid>
      <description>&lt;p&gt;It's normal to get stuck from time to time when you are trying to build something. However, when I make the same mistake again and again I know it has to do with my lack of knowledge about a topic. &lt;/p&gt;

&lt;p&gt;When it is a framework or library specific to problem the answer is most likely in the docs, on stack-overflow or in a tutorial. However when it has to do with build in language features or theoretical knowledge it can be harder to spot what you don't know. To be fair I bump into the right information when I need it by accident. It's usually hidden in a talk or a well written article or post.  &lt;/p&gt;

&lt;p&gt;Two real life examples of the 'problem' I'm talking about: &lt;/p&gt;

&lt;h4&gt;
  
  
  1. Understanding JS
&lt;/h4&gt;

&lt;p&gt;When I stared using a lot more asynchronous JS the expectation vs reality of what I was trying to write did not always match. Some tinkering or workarounds would usually solve the problem. It wasn't until a very enthusiastic JS dev advised me to watch a talk on the event loop that I realized what a gap in my knowledge was. I had no idea how JS handled async operations under the hood and why some things wouldn't work. &lt;/p&gt;

&lt;p&gt;In case you haven't seen it and you like JS check out "What the heck is the event loop anyway" by Philip Roberts. He talks about a lot more than just async programming, a lot of JS related buzzwords will make sense after hearing this talk. &lt;/p&gt;

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

&lt;h4&gt;
  
  
  2. Understanding Rust
&lt;/h4&gt;

&lt;p&gt;Something I'm struggling with right now is ownership and borrowing in Rust, even though &lt;a href="https://doc.rust-lang.org/book/ch04-00-understanding-ownership.html"&gt;the book&lt;/a&gt; has an entire chapter on it. It basically has to do with the memory used by your code and whether you try to use the real value, a reference or a copy. &lt;/p&gt;

&lt;p&gt;I frequently fight with the borrow checker when I try to do something in Rust. After some practice I started to get a little bit better and can at least understand why I am stuck. I ran into this post and if you happen to struggle with ownership this one will really help. &lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;div class="ltag__link__content"&gt;
    &lt;div class="missing"&gt;
      &lt;h2&gt;Article No Longer Available&lt;/h2&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;To be fair most things related to memory in Rust are a problem to me right now because I don't know that much about it. I guess that is the thing I'll have to understand at least a little bit better to truly understand what I'm doing. &lt;/p&gt;

&lt;p&gt;How do you reveal what the gaps in your knowledge are? Do you have a favorite method for learning something more theoretical and applying it? I'd love to hear from other dev's how they deal with this 😄.&lt;/p&gt;

&lt;p&gt;~ Happy Coding :) &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>javascript</category>
      <category>rust</category>
    </item>
    <item>
      <title>How conventional commits improved my git skills</title>
      <dc:creator>Maniflames</dc:creator>
      <pubDate>Sun, 06 Jan 2019 21:50:58 +0000</pubDate>
      <link>https://dev.to/maniflames/how-conventional-commits-improved-my-git-skills-1jfk</link>
      <guid>https://dev.to/maniflames/how-conventional-commits-improved-my-git-skills-1jfk</guid>
      <description>&lt;p&gt;At the moment of writing this I’m in the final month of my internship. I am slowly realising how much I have learned in the past few months. But of all the things I have learned, a better understanding and usage of git is one of the thing that had the biggest impact. Whenever I pushed my changes before this internship I would do something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add .
git commit -a -m “added a few features” 
git push 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And that’s it. I would usually do this at the end of the day or whenever I didn’t want to lose progress. However in this company I picked up the habit of committing in a standardised structure called &lt;a href="https://www.conventionalcommits.org/"&gt;conventional commits&lt;/a&gt;. &lt;/p&gt;

&lt;h1&gt;
  
  
  How it works
&lt;/h1&gt;

&lt;p&gt;Instead of ‘just’ writing your message you follow a template that looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;type&amp;gt;[optional scope]: &amp;lt;description&amp;gt;

[optional body]

[optional footer]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Every commit has a type that falls into a predefined category, at this company the specific categories are: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;feat&lt;/code&gt;: a feature that is visible for end users.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;fix&lt;/code&gt;: a bugfix that is visible for end users.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;chore&lt;/code&gt;: a change that doesn't impact end users (e.g. chances to CI pipeline)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;docs&lt;/code&gt;: a change in the README or documentation &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;refactor&lt;/code&gt;: a change in production code focused on readability, style and/or performance. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The scope specifies what you have changed, preferably in a single word. &lt;br&gt;
The description is a one liner that specifies what the change is. You can use the body in case there is more information that should be in the commit message. Finally, there is a footer where you tag relevant issues or pull requests. &lt;/p&gt;

&lt;p&gt;An example of a 'conventional commit':&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit -m "feat(ratings): added the ability to add star ratings to posts.

This has been a feature requested by different users. 
Changes in the database structure where necessary to make this happen. 

closes #105"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Using this commit structure has impact on how I use version control on a daily basis and on the 'quality' of my commit messages. &lt;/p&gt;

&lt;h2&gt;
  
  
  1. More descriptive commits
&lt;/h2&gt;

&lt;p&gt;I think the most obvious change is that my commits where a lot more descriptive than before. By providing a type and scope it is often a lot more obvious where changes can be found before even looking at the files that are part of the commit. This also allows the description to focus on what changed since other details are known already. Even though the body and the footer are optional they are extremely useful for the future. For instance a body that describes how a certain bug was fixed and to which issue it referred can be very helpful when it turns out that the fix unintentionally caused a change in behavior of other features later on.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. A change in workflow
&lt;/h2&gt;

&lt;p&gt;When using conventional commits I can't just collect all the changes I have made in a single commit. I have to take my time and think about what I have done in the first place. Based on that I start commit my work. For example, I still edit the docs straight away when I add an important feature or change the CI pipeline. Instead of committing everything in one go I stage certain files and write the appropriate commit message. This feels like a lot of work in the beginning but again when things go wrong or not as expected it is a lot easier find out when the change happened from a version control perspective.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Using more git features
&lt;/h2&gt;

&lt;p&gt;Besides of 'proper' staging there are a lot more git features that I use. To be fair this is also because of other aspects of the git workflow (separation of production and development code in different branches). &lt;a href="https://github.com/k88hudson/git-flight-rules#i-wrote-the-wrong-thing-in-a-commit-message"&gt;Rewriting a commit message&lt;/a&gt; or &lt;a href="https://github.com/k88hudson/git-flight-rules#i-want-to-delete-or-remove-my-last-commit"&gt;deleting my last local commit&lt;/a&gt; are some things I didn't do before. &lt;/p&gt;

&lt;p&gt;There are more benefits of using this commit structure. One of many is that clear changelogs can be generated by tools and the use of certain keywords triggers some cool features in repository hosting solutions like Github and Bitbucket. The best way to get to know git is by using it. I have to admit that I did mess up here and there when trying out new things. I really recommend the &lt;a href="https://github.com/k88hudson/git-flight-rules"&gt;git flight rules&lt;/a&gt; repository in case something goes wrong or you’re not entirely sure of how to do something. &lt;/p&gt;

&lt;p&gt;Hopefully you’re willing to try out conventional commits yourself. &lt;br&gt;
~ Happy coding :) &lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>conventionalcommits</category>
    </item>
  </channel>
</rss>
