<?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: technicallyty</title>
    <description>The latest articles on DEV Community by technicallyty (@technicallyty).</description>
    <link>https://dev.to/technicallyty</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%2F455565%2F3cdff05a-273e-4e04-9989-6b124a89e76d.jpeg</url>
      <title>DEV Community: technicallyty</title>
      <link>https://dev.to/technicallyty</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/technicallyty"/>
    <language>en</language>
    <item>
      <title>Why more Computer Science professors need to adopt specifications grading.</title>
      <dc:creator>technicallyty</dc:creator>
      <pubDate>Fri, 09 Oct 2020 00:59:00 +0000</pubDate>
      <link>https://dev.to/technicallyty/how-computer-science-professors-should-conduct-exams-1e4a</link>
      <guid>https://dev.to/technicallyty/how-computer-science-professors-should-conduct-exams-1e4a</guid>
      <description>&lt;h1&gt;
  
  
  Types of Teachers
&lt;/h1&gt;

&lt;p&gt;Throughout college, you may meet some professors you adore, you dislike, and some you just flat out want to never see again and would not mind if they fell off the face of the earth. Most of us hope for the first mentioned. &lt;/p&gt;

&lt;h1&gt;
  
  
  My favorite teacher
&lt;/h1&gt;

&lt;p&gt;Having had many in the category of "dislike" I feel it is important to make this post about one of the best professors I've ever had as a Computer Science student. If anyone would like to reach out to him, let me know and I can ask him if it's okay to share his email with you or something.&lt;/p&gt;

&lt;h1&gt;
  
  
  Course Structure
&lt;/h1&gt;

&lt;p&gt;The professor followed what is called specifications grading. If you're not familiar with how that might work, this post will mostly serve as an overview of how a class with specifications grading might work. His course had 2 aspects - exams and projects. These two things are tightly packed together. For example, the first project may be about multi-threading, and the first exam will be about multi-threading. With that being said, your grade is based on a scale of how much you complete. You don't have to pass every exam, and you don't have to do every project. &lt;/p&gt;

&lt;p&gt;Lets say you have 7 sections total, each with corresponding exam and project. The professor would set a scale such that if you complete 6 sections (project + exam) you get an A, 5 is a B, 4 is a C etc etc. Of course you can weight these differently to fit your class, this is just an example.&lt;/p&gt;

&lt;p&gt;Using the example above, if you passed 6 exams, but only did 5 projects, you get rounded down to the grade of B. It does not round up. Pretty fair in my opinion.&lt;/p&gt;

&lt;h1&gt;
  
  
  Exams
&lt;/h1&gt;

&lt;p&gt;This is by far my favorite part of the way the professor conducted the class. Each exam will include the sections from the previous exam. So if the first is on multi-threading, the second will be on the new topic + multi-threading. The third will be on the third new topic, the second, and multi-threading. The reason he does this is genius. &lt;/p&gt;

&lt;p&gt;If you don't pass it the first time, you have another chance the next time. He of course generates new questions for each exam so you can't just study the same thing over and over, and you really need to know your stuff. It is important to note that the sections in the exam were graded on a binary scale. If it looks like you know your stuff, and you get 95% of the content correct - you pass. If not, no worries! Try again next time.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;This may not work for everyone, but as a student, I really appreciated this way of conducting a course. The way the exams were formatted greatly reduced exam-stress which is something that GREATLY effects students. &lt;/p&gt;

&lt;p&gt;There were times where I had a really important midterm for another class, and needed to mainly focus on that. I knew I could study lightly for the CS class's exam because I'd have another chance to pass it next time. Not only does this allow students to be more flexible in their study plan, it allows us to mentally relax and focus on things as they come at us. &lt;/p&gt;

&lt;p&gt;All in all, I think more professors ought to be adopting this method of teaching, or at least try it for a few semesters. I guarantee you your students will be very receptive and will respond VERY positively.&lt;/p&gt;

&lt;p&gt;Thanks for coming to my Ted-Talk. &amp;lt;3&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Why your JavaScript object might not be copied by assigning it to a new variable.</title>
      <dc:creator>technicallyty</dc:creator>
      <pubDate>Tue, 29 Sep 2020 21:18:36 +0000</pubDate>
      <link>https://dev.to/technicallyty/why-your-javascript-object-might-not-be-copied-by-assigning-it-to-a-new-variable-3gd3</link>
      <guid>https://dev.to/technicallyty/why-your-javascript-object-might-not-be-copied-by-assigning-it-to-a-new-variable-3gd3</guid>
      <description>&lt;p&gt;So you've imported yourself a JS object have you? You've imported it into a react component. Great. You assign it a new variable via the likes of &lt;code&gt;var x = importedJsObj&lt;/code&gt;. You change the some of the values in x and hand off the "pure" importedJsObj to another function. Well you're out of luck. It didn't actually copy it. &lt;/p&gt;

&lt;p&gt;I found this out the hard way when I needed to filter a subset of a js object, and hand off the original to different function. &lt;/p&gt;

&lt;p&gt;Alas, we have &lt;code&gt;lodash&lt;/code&gt; - &lt;a href="https://lodash.com/"&gt;https://lodash.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're using react, go ahead and type &lt;code&gt;npm i --save lodash&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then, you need to import what you need to use. To solve my specific problem I did &lt;code&gt;import { deepClone } from 'lodash'&lt;/code&gt; -&lt;a href="https://www.digitalocean.com/community/tutorials/js-deep-cloning-javascript-objects#so-how-can-i-copy-an-object-the-right-way"&gt;https://www.digitalocean.com/community/tutorials/js-deep-cloning-javascript-objects#so-how-can-i-copy-an-object-the-right-way&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then instead of just saying &lt;code&gt;var x = importedJsObj&lt;/code&gt; you say &lt;code&gt;var x = deepClone(importedJsObj)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And there you have it. A properly copied js object that won't mutate the original.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>How to host your react app on firebase.</title>
      <dc:creator>technicallyty</dc:creator>
      <pubDate>Mon, 14 Sep 2020 17:36:00 +0000</pubDate>
      <link>https://dev.to/technicallyty/how-to-host-your-react-app-on-firebase-2p2i</link>
      <guid>https://dev.to/technicallyty/how-to-host-your-react-app-on-firebase-2p2i</guid>
      <description>&lt;p&gt;Hosting on firebase is pretty easy, once you get your configuration set up properly. I feel like a lot of guides leave some things out however. Here's how I was able to get my react app setup with firebase. It'll help if you have a firebase account setup before you start.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation / Setup (i assume you have a react app already.)
&lt;/h2&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g firebase-tools
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;after you've installed, you need to login.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;firebase login
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Initialization (&lt;strong&gt;in your project directory&lt;/strong&gt;)
&lt;/h2&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;firebase init
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Make sure to choose hosting below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;? Which Firebase CLI features do you want to setup for this folder? Press Space to select features, then Enter to confirm your choices.
 ◯ Database: Deploy Firebase Realtime Database Rules
 ◯ Firestore: Deploy rules and create indexes for Firestore
 ◯ Functions: Configure and deploy Cloud Functions
❯◯ Hosting: Configure and deploy Firebase Hosting sites
 ◯ Storage: Deploy Cloud Storage security rules
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Give it your project name. This is the name you will see on your firebase dashboard.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.

? Select a default Firebase project for this directory:
-&amp;gt; give-your-firebase-project-a-name
i  Using project give-your-firebase-project-a-name
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Make sure you answer these questions correctly as shown below. It's important to know, if you don't have a &lt;code&gt;build&lt;/code&gt; directory in your react project folder, you need to build your project. To get that build folder, open up a terminal in your project directory and type &lt;code&gt;npm run-script build&lt;/code&gt; -- this should generate a build folder. If not, check your package.json for a "build" script. if its not there you can always just type &lt;code&gt;npm react-scripts build&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;? What do you want to use as your public directory? build
? Configure as a single-page app (rewrite all urls to /index.html)? Yes
? File public/index.html already exists. Overwrite? No
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Configuration
&lt;/h2&gt;

&lt;p&gt;You're almost done. A lot of tutorials will now jump straight to the &lt;code&gt;firebase deploy&lt;/code&gt; command. This didn't work for me though. If it worked for you, then you don't really need to read on. If you're having trouble, here is how &lt;strong&gt;I&lt;/strong&gt; fixed it. &lt;/p&gt;

&lt;p&gt;Go to your &lt;code&gt;firebase.json&lt;/code&gt; file and make sure it looks similar to this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "hosting": {
    "public": "build",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  },
  "rewrites": {
    "source": "**",
    "destination": "/index.html"
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Once this is setup like the above, try running the following in the project directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;firebase deploy
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Your app should be good to go now. The console will spit out a link for you to check your app. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Treating a JSON object as an array for iterations</title>
      <dc:creator>technicallyty</dc:creator>
      <pubDate>Tue, 08 Sep 2020 21:18:24 +0000</pubDate>
      <link>https://dev.to/technicallyty/treating-a-json-object-as-an-array-for-iterations-3h0m</link>
      <guid>https://dev.to/technicallyty/treating-a-json-object-as-an-array-for-iterations-3h0m</guid>
      <description>&lt;h2&gt;
  
  
  Hello there!
&lt;/h2&gt;

&lt;p&gt;I came across a problem where an API was returning data filtered by date. Each JSON entry had a couple fields (activeUsers: 300, emailsSent: 500.. stuff like that). &lt;/p&gt;

&lt;p&gt;I wanted to create a bar graph that showed the lifetime totals. Since you can't grab a JSON object and just go &lt;code&gt;jsonThing[0]&lt;/code&gt; I had to find a way to index through it properly so I could sum up the values.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;yourJsonObject[Object.keys(yourJsonObject)[index]]&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Thats it! Now you can treat your JSON object as an array. &lt;/p&gt;

&lt;p&gt;I'm mainly making this post so I can collect ideas/problems I've had previously in case they come up again. If you're reading this, I hope you may find some value. Have a nice day!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>json</category>
    </item>
  </channel>
</rss>
