<?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: Matthew S.</title>
    <description>The latest articles on DEV Community by Matthew S. (@musique243).</description>
    <link>https://dev.to/musique243</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%2F938759%2Fe467fe12-6eec-4cc6-abd5-b2a314433849.jpeg</url>
      <title>DEV Community: Matthew S.</title>
      <link>https://dev.to/musique243</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/musique243"/>
    <language>en</language>
    <item>
      <title>Vim Basics</title>
      <dc:creator>Matthew S.</dc:creator>
      <pubDate>Mon, 13 Mar 2023 05:00:18 +0000</pubDate>
      <link>https://dev.to/musique243/vim-basics-322</link>
      <guid>https://dev.to/musique243/vim-basics-322</guid>
      <description>&lt;p&gt;If you're like me, you've probably used Vim in the past and didn't even realize it. Today I'm going to go over a basic overview of Vim, why it is used, some basic commands, and show you an easy way to try Vim out for yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Brief Overview
&lt;/h2&gt;

&lt;p&gt;Okay, so let's start off with what Vim is. Vim is a popular text editor that was first released in 1991 as a successor to the Unix editor, vi. Vim is also a modal editor, which means that it has different modes for navigating and editing text. The two most common modes are normal and insert mode. In normal mode, Vim allows you to move around and make edits to your document using a variety of keyboard shortcuts and commands. In insert mode, you have the ability to type text directly into your document. Vim also has other modes for performing tasks like searching and replacing text.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Is Vim Used
&lt;/h2&gt;

&lt;p&gt;One of the main reasons people use Vim is for its efficiency. It has many built-in shortcuts and commands that allow you to navigate and edit text without having to take your hands off the keyboard or move your cursor around the screen. This can save you a lot of time and make you more productive.&lt;/p&gt;

&lt;p&gt;Another great feature of Vim is its extensibility. There are many plugins available that can be used to extend Vim's functionality and make it even more powerful. For example, there are plugins for syntax highlighting, auto-completion, and integration with other tools like Git.&lt;/p&gt;

&lt;p&gt;Vim is also highly customizable. You can customize its appearance, behavior, and keybindings to suit your own preferences.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some Basic Commands
&lt;/h2&gt;

&lt;p&gt;Vim gives you a large library of commands to use, but here I list what I think are probably the best basic commands to get started with.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;esc:q!        Discards changes
esc:wq        Write/quit
x             Delete
dw            Remove word
d$            Delete to end of line
dd            Delete 1 line, can also use 2dd for 2 lines
p             Place deleted line
u             Undo
Ctrl g        Show file you are in
0             Start of line
gg            Start of file
g             Bottom of file
/+'word'      Search by word
n             Move to next word of search
=s/old/new/g  Substitute old word for new one globally
i             Insert mode

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Where You Will See It
&lt;/h2&gt;

&lt;p&gt;As I mentioned above in my opening paragraph, I had used Vim a few times before without even knowing it. Those time included when dealing with merge conflicts in my VS Code and also when having to edit a deployed instances code.&lt;/p&gt;

&lt;p&gt;When it comes to resolving merge conflicts,  you open a file that has merge conflicts in Vim, you can then type in comments in the command-line mode. You can then use Vim's editing commands to resolve the conflicts and save the file.&lt;/p&gt;

&lt;p&gt;Vim can also be used to edit configuration files that are used for deployment, such as YAML files, JSON files, or script files. Vim's syntax highlighting and auto-indentation features can make it easier to edit these files and catch errors before they cause issues during deployment. Also, Vim's plugins can be used to integrate with deployment tools such as Git or other version control systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  How To Try It Out
&lt;/h2&gt;

&lt;p&gt;It is pretty easy to get started learning about Vim, due to their tutorial. If you want to check it out, simply type vimtutor in your terminal and the image below will pop up. From there the tutorial will guide you through some of the basic commands to get you started and that's it.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Vim has many features that make it popular due to its efficiency, simplicity, and availability. If you have the time, I do recommend trying out the tutorial and see if you like it. Besides, I'm sure you will eventually see Vim in the future if you are ever working with deployment or possibly merge conflicts like myself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Vim_(text_editor)"&gt;https://en.wikipedia.org/wiki/Vim_(text_editor)&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.vim.org/docs.php"&gt;https://www.vim.org/docs.php&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Basic Introduction to PostgreSQL</title>
      <dc:creator>Matthew S.</dc:creator>
      <pubDate>Mon, 27 Feb 2023 01:39:45 +0000</pubDate>
      <link>https://dev.to/musique243/basic-introduction-to-postgresql-i5g</link>
      <guid>https://dev.to/musique243/basic-introduction-to-postgresql-i5g</guid>
      <description>&lt;p&gt;When speaking of relational databases, I was only familiar with using mySQL, until recently when I learned about PostgreSQL. Today I am going to talk about what PostgreSQL is, how it differs from mySQL, and how to get started with connecting PostgreSQL using Sequelize.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is PostgreSQL
&lt;/h2&gt;

&lt;p&gt;PostgreSQL is a relational database management system or (RDBMS), that is used for data storage, retrieval, and management in many applications. It is best known for its scalability, reliability, and features, which include support for complex data types, advanced indexing, and transaction processing.&lt;/p&gt;

&lt;p&gt;PostgreSQL provides support for SQL (Structured Query Language), which is a standard language for managing relational databases. There are also several ORM libraries available for PostgreSQL, such as SQLAlchemy, Django ORM, and Sequelize, which let developers work with PostgreSQL databases in an object-oriented manner.&lt;/p&gt;

&lt;h2&gt;
  
  
  Main Features
&lt;/h2&gt;

&lt;p&gt;Let's talk about some of the main features of PostgreSQL and what it has to offer.&lt;/p&gt;

&lt;p&gt;ACID Compliance: PostgreSQL is ACID compliant, meaning that it ensures the atomicity, consistency, isolation, and durability of transactions.&lt;/p&gt;

&lt;p&gt;Extensibility: lets users add new data types, operators, functions, and programming languages.&lt;/p&gt;

&lt;p&gt;JSON Support: it has built-in support for JSON data types and provides a set of operators and functions for working with JSON data.&lt;/p&gt;

&lt;p&gt;Concurrency control: uses a multi-version concurrency control (MVCC) system that allows multiple transactions to access the same data simultaneously without locking the database.&lt;/p&gt;

&lt;p&gt;Security: includes a security model with features such as SSL/TLS encryption, role-based access control, and row-level security.&lt;/p&gt;

&lt;p&gt;Indexing: provides a range of indexing options, including B-tree, hash, GiST, SP-GiST, GIN, and BRIN indexes.&lt;/p&gt;

&lt;p&gt;Scalability: PostgreSQL can handle very large databases and support high transaction rates. It can also be used in clustered environments for horizontal scaling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Difference between PostgreSQL &amp;amp; mySQL
&lt;/h2&gt;

&lt;p&gt;MySQL and PostgreSQL are probably the most popular relational database management systems and do have some similarities. Here I take a look and see how they differ from each other. Here are some key differences between the two:&lt;/p&gt;

&lt;p&gt;Data Type Support: PostgreSQL supports a wider range of complex data types such as arrays, and JSON, while MySQL has a more limited set of data types.&lt;/p&gt;

&lt;p&gt;ACID Compliance: Both databases are ACID-compliant, but PostgreSQL is more strict in its adherence to the principles of acid compliance.&lt;/p&gt;

&lt;p&gt;Performance: In general, MySQL is considered faster and more scalable for simple queries, while PostgreSQL is better suited for complex queries and data analysis.&lt;/p&gt;

&lt;p&gt;Community: Both databases have large and active communities, but MySQL has a more widespread adoption in the web development community, while PostgreSQL is often preferred by enterprises and data analysts.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to connect to PostgreSQL using Sequelize
&lt;/h2&gt;

&lt;p&gt;For this example, I will show you how to connect using Sequelize. Once you import the module, you can create a new Sequelize instance and pass in the connection options.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const { Sequelize } = require('sequelize');

const sequelize = new Sequelize({
  dialect: 'postgres',
  host: 'your_host',
  port: 'your_port',
  database: 'your_database',
  username: 'your_username',
  password: 'your_password'
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Test your connection by calling the authenticate() method on the Sequelize instance. Look at the example below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sequelize.authenticate()
  .then(() =&amp;gt; console.log('You connected successfully.'))
  .catch((error) =&amp;gt; console.error('Unable to connect', error));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;PostgreSQL is a popular choice for many types of applications, from small projects to large enterprise systems, due to its flexibility and extensibility. In the end, you should ultimately choose the database that best fits your needs, but if you are looking for a relational database that can handle complex data types, look into PostgreSQL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/PostgreSQL"&gt;https://en.wikipedia.org/wiki/PostgreSQL&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.postgresql.org/"&gt;https://www.postgresql.org/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Most Commonly Used React Hooks</title>
      <dc:creator>Matthew S.</dc:creator>
      <pubDate>Mon, 06 Feb 2023 01:28:21 +0000</pubDate>
      <link>https://dev.to/musique243/most-commonly-used-react-hooks-587j</link>
      <guid>https://dev.to/musique243/most-commonly-used-react-hooks-587j</guid>
      <description>&lt;p&gt;I recently learned about React and the great capabilities it offered when trying to build an application. Through my learning, I was challenged with the task of using React without using class components. I couldn't imagine how I would be able to do that, until I was informed about React hooks. Today I will talk about the three most common React hooks and how they eliminate the need for class components. &lt;/p&gt;

&lt;h2&gt;
  
  
  What are React hooks?
&lt;/h2&gt;

&lt;p&gt;React Hooks are functions in React that let you add state and other React features to functional components. Hooks were introduced in React 16.8 and give another option instead of writing a class-based component in React.&lt;/p&gt;

&lt;p&gt;Hooks make it easier to reuse existing code and manage the state of the application. Hooks also make it easier to understand how the state and other React functions and lifecycle methods are used in your components.&lt;/p&gt;

&lt;h2&gt;
  
  
  Most Used Hooks
&lt;/h2&gt;

&lt;p&gt;While there are numerous React hooks, I am going to focus on what I think are the three most commonly used hooks. They are 'useState', 'useEffect', and 'useContext'.&lt;/p&gt;

&lt;p&gt;These three hooks are pretty essential for building your web application in React. First I will explain them briefly, then go a little in depth with each one. &lt;/p&gt;

&lt;p&gt;The useState hook allows you to add and use state in your components, while the useEffect hook lets you perform side effects. The useContext hook gives you access to context values in your components. Let's take a closer look at useState first.&lt;/p&gt;

&lt;h2&gt;
  
  
  'useState'
&lt;/h2&gt;

&lt;p&gt;The useState hook helps to add and manage state on a functional component. The useState hook returns an array with two elements: the current value of the state, and a function for updating the state. &lt;/p&gt;

&lt;p&gt;Below is an example on how to use the useState hook in React. First import useState, then set the two elements inside an array equal to the function with the option to pass in a default value for state. Here I am using the number zero, since I will be working with numbers in this example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { useState } from 'react';

const Component = () =&amp;gt; {
  const[number, setNumber] = useState(0);
  return (
    &amp;lt;div&amp;gt;
      Pressed button {number} times
      &amp;lt;button onClick={ () =&amp;gt; setNumber(number + 1)}&amp;gt;
        Press&amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The number is a property on the state. I attached the function setNumber to a button, so that when the button is pressed the setNumber function will update the state by adding one to zero.&lt;/p&gt;

&lt;h2&gt;
  
  
  'useEffect'
&lt;/h2&gt;

&lt;p&gt;The useEffect hook lets you run side effects in response to changes in state or props in functional components. The useEffect hook also takes two arguments: a callback function that contains the side effect code or logic, and an array that determines when the side effect should be run. The useEffect hook can be used for running side effects, such as making API calls, setting up event listeners, and updating the DOM.&lt;/p&gt;

&lt;p&gt;In the example below, we import useEffect just like we did with useState. To keep it simple, I put in a console log, which will display the number that is currently on state. Now, notice in the array, I put in the number property from state. This means that the effect will run only if the number changes on state. A really cool alternative would be if I leave the array empty, useEffect would then only run on initial render, very similar to the lifecycle method componentDidMount.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { useState, useEffect } from 'react';

const Component = () =&amp;gt; {
  const [number, setNumber] = useState(0);

  useEffect(() =&amp;gt; {
    console.log(`Number: ${number}`);
  }, [number]);

  return (
    &amp;lt;div&amp;gt;
      You pressed the button {number} times
      &amp;lt;button onClick={ () =&amp;gt; setNumber(number + 1)}&amp;gt;
        Press&amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  'useContext'
&lt;/h2&gt;

&lt;p&gt;The useContext hook lets you get the values of a context in a functional component. It takes a context object as an argument and returns the current value of the context. It also makes things easier by getting access to context without having to pass the data down through multiple levels of components using props.&lt;/p&gt;

&lt;p&gt;For the last example, we create a context using the createContext function and provide an object that is the initial state of the context. Then, use the useContext hook inside Component to subscribe to the context and access the values. Next, you can wrap the component that uses the context with a ThemeContext.Provider component and pass it the current theme value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { createContext, useContext, useState } from 'react';

const ThemeContext = createContext({ theme: 'light' });

const Component = () =&amp;gt; {
  const { theme } = useContext(ThemeContext);

  return (
    &amp;lt;div style={{ background: theme === 'light' ? 'white' : 'black', color: theme === 'light' ? 'black' : 'white' }}&amp;gt;
      &amp;lt;p&amp;gt;The current theme is: {theme}&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

const AnotherComponent = () =&amp;gt; {
  const [theme, setTheme] = useState('light');

  return (
    &amp;lt;ThemeContext.Provider value={{ theme }}&amp;gt;
      &amp;lt;Component /&amp;gt;
    &amp;lt;/ThemeContext.Provider&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  In Closing
&lt;/h2&gt;

&lt;p&gt;So there you have it. These three essential React hooks not only eliminate the need for class components, but also make functional components more useful and give developers more tools to use on their tool belts. I am now looking forward to getting more experience with the other hooks React has to offer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=d-aAs_4SQ7c"&gt;https://www.youtube.com/watch?v=d-aAs_4SQ7c&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=dpw9EHDh2bM&amp;amp;t=1467s"&gt;https://www.youtube.com/watch?v=dpw9EHDh2bM&amp;amp;t=1467s&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Light Gun Tech - Old &amp; New</title>
      <dc:creator>Matthew S.</dc:creator>
      <pubDate>Mon, 19 Dec 2022 12:45:53 +0000</pubDate>
      <link>https://dev.to/musique243/light-gun-tech-old-new-kj3</link>
      <guid>https://dev.to/musique243/light-gun-tech-old-new-kj3</guid>
      <description>&lt;p&gt;I often recall how much fun I had playing video games as a kid. Most of the time I would just be amazed at how these games were working. One accessory for video games that always baffled me was the light gun. I had no idea how when I pointed the gun at the screen, did the game know where I was pointing. Recently, I decided to finally look into how this light gun technology worked.&lt;/p&gt;

&lt;h2&gt;
  
  
  Early Video Game Light Guns
&lt;/h2&gt;

&lt;p&gt;One of the earliest video game light gun was created for the Nintendo Entertainment System and called the Nintendo Zapper. The light gun was mainly made of plastic and had a cord which plugged directly into the game console. Inside the light gun, there are not as many parts as you would think. The device was mostly hollow, with two small weights inside to give the gun balance and a heavier feel. It also had a small circular clear lens at the end of the barrel and a photo sensor near the rear of the barrel.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fgzhfpnr9br9f4wlniwlb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fgzhfpnr9br9f4wlniwlb.png" alt="Image description" width="800" height="518"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How They Work
&lt;/h2&gt;

&lt;p&gt;Before I tell you how they work, I feel it's important to tell you a little bit about another crucial part of using the light gun, the television in which you need to use the gun. In particular, I'm talking about the older CRT televisions. Without going to deep into how these tv's work, I will just say that if you are watching the screen, let's think of how an image is put on the screen. Imagine a small pixel or beam of light being put on the screen from the left side and sent to the right side of the screen. Now it moves so fast that our eyes can't see this process, but it keeps going until the image is rendered.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F9qwelaovk4phcvddv67t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F9qwelaovk4phcvddv67t.png" alt="Image description" width="385" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Zapper light gun had a trigger, that when pressed, tell the game to to make the entire screen to turn black for just one frame. On the very next frame, the spot on the screen where the targets that you would shoot would be represented by a white box, however the rest of the screen would remain black. The photo sensor in the light gun then tries to detect the change in light levels to find the light. If you pointed at the light, the game registers a hit on that target. Keep in mind this happens so fast, it's nearly impossible to catch the process. All you are able to recognize is the the screen flash when you press the trigger.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fqd8neziu4oou1lm221k8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fqd8neziu4oou1lm221k8.png" alt="Image description" width="540" height="192"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fq8hs4q68nq0z9vcxjsl4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fq8hs4q68nq0z9vcxjsl4.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Don't They Work Anymore
&lt;/h2&gt;

&lt;p&gt;The advancement of televisions meant no more CRT televisions. The way that light guns worked, heavily depended on the speed at which the pixels were lit up. Newer televisions worked a little different than CRT's and had a bigger delay which would mess up the timing of using the light gun.&lt;/p&gt;

&lt;h2&gt;
  
  
  New Light Guns
&lt;/h2&gt;

&lt;p&gt;Recently there have been a few companies who have created new light guns that would work differently than the older ones, in order to make them compatible with new televisions. They don't all work the same way, but I will mention two specifically. The first light gun called the Gun4IR, uses four sets of IR LED's which are strategically placed on the center of all four sides of your television or monitor. These IR LED's are used to help locate the positioning of where the light gun is pointed at the screen.&lt;/p&gt;

&lt;p&gt;The second new light gun has a camera built in the gun instead of the normal photo sensor. This light gun was created by a company called Sinden and was introduced into the market not too long ago. This light gun requires a little more work to get the system going. The light gun is plugged into a computer which connects to your television. You must create a border on the television through your settings which let's the gun know where the playing field is located. Now because the light gun uses a camera, the lighting in the room you are playing could cause issues, especially if you are using bright LED lights.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;With the quickly changing advancements in technology for televisions, I am glad that there are companies out there trying to bring great gaming technology up to the forefront.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;p&gt;youtube.com/watch?v=NuHoj4EljU&lt;br&gt;
youtube.com/watch?v=hfo004_4xwU&lt;br&gt;
youtube.com/watch?v=DzlPGpKo3Ag&lt;/p&gt;

</description>
      <category>emptystring</category>
    </item>
    <item>
      <title>Dialogue Systems in Video Games</title>
      <dc:creator>Matthew S.</dc:creator>
      <pubDate>Mon, 12 Dec 2022 04:31:06 +0000</pubDate>
      <link>https://dev.to/musique243/dialogue-systems-in-video-games-1c1e</link>
      <guid>https://dev.to/musique243/dialogue-systems-in-video-games-1c1e</guid>
      <description>&lt;p&gt;While I've always considered myself a casual gamer, I have been endlessly fascinated with how video games are created and what kind of systems are at work to make these games what they are. Today, I am taking a look into the dialogue systems in video games. I will talk about what they are, a little about how they work, and how much they have advanced. &lt;/p&gt;

&lt;h2&gt;
  
  
  Dialogue Systems
&lt;/h2&gt;

&lt;p&gt;Dialogue Systems in video games usually contain what are referred to as conversational or dialogue trees. These trees refer to the interactions that a player has with a non-player character, or "NPC". The basic concept involves the player being given some choices of dialogue to say in the game. Based on that the choice, a new path opens up with a new set of choices and so on until the conversation has ended with that character.&lt;/p&gt;

&lt;h2&gt;
  
  
  History in Games
&lt;/h2&gt;

&lt;p&gt;These conversation trees actually started in books, but made their way into video games in the later 80's and early 90's. A game that is considered to be one of the first to have a dialogue system is "The Secret of Monkey Island". The game was a point and click adventure styled game that included a very basic dialogue system where the player's choices of dialogue could often be repeated. The NPC would also repeat dialogue if approached and prompted to speak again. As technology advanced however, so did the dialogue systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Structures Used
&lt;/h2&gt;

&lt;p&gt;As these dialogue systems became more complex, the use of multiple data structures became a necessity. Not only were data trees being used, but also graph data structures. The structure of the trees worked well with the progression of dialogue flowing in one direction from start to end. The graph structure gives more flexibility in not being one directional and allows for more complex dialogue flow in multiple directions.&lt;/p&gt;

&lt;p&gt;Example of a tree data structure&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dA4pcyw4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1sy1czjstjflvgdw4vou.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dA4pcyw4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1sy1czjstjflvgdw4vou.png" alt="Image description" width="880" height="1002"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example of a graph data structure&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7QBpOMa2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ig9oc7u55ckd572uiks2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7QBpOMa2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ig9oc7u55ckd572uiks2.png" alt="Image description" width="509" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example of dialogue tree&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7SXL4sKF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z9ssmgab11s1yeybzz76.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7SXL4sKF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z9ssmgab11s1yeybzz76.png" alt="Image description" width="399" height="198"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Advancement &amp;amp; Complexity in Dialogue Systems
&lt;/h2&gt;

&lt;p&gt;As mentioned previously, the advancement in technology has given game developers the ability to produce complex dialogue systems like we have never seen before. One example of such a dialogue system comes from a game by the name of "Hades". In this game, when players meet with the NPC's to have a conversation, there are no choices for the individual player to pick. The NPC will have a container programmed with a list of dialogue to start. Imagine a dice is rolled to choose which numbered dialogue to choose and the conversation starts. After that dialogue choice has been used, that choice is removed from the list as to not be repeated.&lt;/p&gt;

&lt;p&gt;Now where this system really becomes interesting is with the addition of locked dialogue and a priority system. The locked dialogue may require the player to obtain an item or gear in order for the dialogue to become unlocked and selected. The system also incorporates a priority system that knows which dialogue selections are associated with pivotal moments in the game's story and thus require that dialogue to be selected before any other. Can you just imagine how complex the programming for all these events and systems that work together are? This matched with a script of over 300,000 words makes for one of the most impressive and advanced dialogue system to date.&lt;/p&gt;

&lt;p&gt;The future of dialogue systems in video games is a bright one, and with constant advances in technology, I can only imagine how more advanced these dialogue systems can get.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Dialogue_tree"&gt;https://en.wikipedia.org/wiki/Dialogue_tree&lt;/a&gt;&lt;br&gt;
&lt;a href="https://techdifferences.com/difference-between-tree-and-graph.html"&gt;https://techdifferences.com/difference-between-tree-and-graph.html&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=bwdYL0KFA_U"&gt;https://www.youtube.com/watch?v=bwdYL0KFA_U&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Facial Recognition Technology - A Brief Introduction</title>
      <dc:creator>Matthew S.</dc:creator>
      <pubDate>Mon, 05 Dec 2022 01:38:49 +0000</pubDate>
      <link>https://dev.to/musique243/facial-recognition-technology-a-brief-introduction-33c9</link>
      <guid>https://dev.to/musique243/facial-recognition-technology-a-brief-introduction-33c9</guid>
      <description>&lt;p&gt;Facial recognition has for the most part, been around for a long time. Many of us have seen it displayed in movies, and some of us use it in everyday situations, like when we use it to unlock our smartphones. Ever wonder what facial recognition is and how it works? I'll go over the basic concepts of what it is, how it works, and how the technology is currently being used today. I will also cover the issues and growing concerns the public has about its use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Facial Recognition
&lt;/h2&gt;

&lt;p&gt;Facial recognition is a way that biometric software scans an individual's facial features and stores it as data. Facial recognition technology uses that biometric software to compare those facial features to a database of videos or pictures. &lt;/p&gt;

&lt;h2&gt;
  
  
  How the Technology Works
&lt;/h2&gt;

&lt;p&gt;You might be wondering how facial recognition technology actually works. We can pretty much breakdown the process into some simple steps without going into too much detail. First off, we need to start with a photograph or picture. The biometric software takes that photograph and breaks it down into many sections or blocks. You can think of it like a square grid. It then runs an algorithm on those blocks or grid to determine if there is a face in the picture. The software compares multiple conditions including if one block is darker or lighter than the other.&lt;/p&gt;

&lt;p&gt;Once a face is confirmed, the software measures the many facial features of that face. I like to think of it as playing a game of connect the dots, but on your face. These measurements could include the distance between the eyes or the distance between the chin and forehead just to name a couple. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F7eg27i1b1wa0816c8dgf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F7eg27i1b1wa0816c8dgf.jpg" alt="Image description" width="348" height="196"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All those measurements are then converted into a mathematical formula which gives the image a sort of unique facial identifier or signature.&lt;/p&gt;

&lt;p&gt;The facial identifier is compared to a database of photographs and videos. The software looks through these images, which are usually collected from the internet or public files, to find a match. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fjwbzedu27yru3k5hk2jw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fjwbzedu27yru3k5hk2jw.png" alt="Image description" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Many Ways It Can Be Used
&lt;/h2&gt;

&lt;p&gt;One of the more popular ways facial recognition is used is for authentication purposes. Phones now have the software that allows users to scan their face while setting up their phones just like you would a password. The users only have to look at their phone's camera in order for the screen to be unlocked. Some phone applications have also adopted the technology as a way to bypass the steps of putting in a username or password.&lt;/p&gt;

&lt;p&gt;Law enforcement has used Facial recognition to assist with their investigations. Specifically, facial recognition has been used to help in the search of missing persons and when law enforcement is looking for suspects of various crimes. &lt;/p&gt;

&lt;p&gt;Facial recognition can be found in some airports where they use it for security and efficiency. The technology could identify criminals or terrorists due to having access to a large database.&lt;/p&gt;

&lt;p&gt;In the retail industry, some companies have used facial recognition to help better serve customers and give them a better experience. One example includes a bar that uses facial recognition to hold information of that customer's favorite drinks and menu items. When the customer arrives at the bar, the staff could immediately inform them of menu recommendations based off of previous orders.&lt;/p&gt;

&lt;h2&gt;
  
  
  Concerns
&lt;/h2&gt;

&lt;p&gt;All the things I mentioned above about the capabilities of the technology sound pretty great, right? Well, as advanced as the software and tech may be, there are some privacy and ethical concerns related to the use of the technology. &lt;/p&gt;

&lt;p&gt;Remember that the software compares a facial signature to a database of videos and pictures. That database is made up of images gathered from the internet and public files. Most of this facial data can be collected without the individual's permission and the lack of regulations on the technology has just added to the public concern.&lt;/p&gt;

&lt;p&gt;The accuracy of the technology also comes in question when related to use by law enforcement. Studies of the technology's use have revealed facial recognition software produces more errors and false positive results when trying to read darker skinned individuals.&lt;/p&gt;

&lt;p&gt;These rising concerns and public pushback have caused some facial recognition software companies to restrict access of who can use their software.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Facial recognition technology has come along way since its origin, and I have no doubt will become more prevalent in years to come. While I know the technology has room for improvement, the possibilities the software can provide could help in numerous industries such as healthcare, security, transportation, and retail. We just need to wait for the laws and regulations to catch up with the technology to keep it safe for all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;p&gt;Forbes&lt;br&gt;
&lt;a href="https://youtu.be/O7nb-8BtMl0" rel="noopener noreferrer"&gt;https://youtu.be/O7nb-8BtMl0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Interesting Engineer&lt;br&gt;
&lt;a href="https://youtu.be/YX8BzK_LU0E" rel="noopener noreferrer"&gt;https://youtu.be/YX8BzK_LU0E&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Computerphile&lt;br&gt;
&lt;a href="https://youtu.be/uEJ71VlUmMQ" rel="noopener noreferrer"&gt;https://youtu.be/uEJ71VlUmMQ&lt;/a&gt;&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>career</category>
    </item>
    <item>
      <title>Brief Intro to the Variable Keywords in Javascript</title>
      <dc:creator>Matthew S.</dc:creator>
      <pubDate>Fri, 07 Oct 2022 14:09:42 +0000</pubDate>
      <link>https://dev.to/musique243/brief-intro-to-the-variable-keywords-in-javascript-1gep</link>
      <guid>https://dev.to/musique243/brief-intro-to-the-variable-keywords-in-javascript-1gep</guid>
      <description>&lt;p&gt;In Javascript, there are three different variable keywords, which include var, let, and const. Each variable keyword acts differently, so it is important to know how they will affect your code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Var
&lt;/h3&gt;

&lt;p&gt;When declaring a variable using the var keyword, it makes a global scoped variable. Global scoped variables can be accessed throughout your code due to hoisting. Var declared variable can also be reassigned new values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var name = 'Jack';

function printName() {
  console.log(name);  // accessing global var name
}

printName(); // 'Jack' will be logged to the console
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we reassign the var name to be a different value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name = 'Gracie';
console.log(name); // 'Gracie' is now logged to the console
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Let
&lt;/h3&gt;

&lt;p&gt;Unlike var, let is a block scoped variable, meaning when you declare a variable using let, that variable cannot be accessed out the block of code where it was created. The only way you could access that variable, is if it was put in the global scope of your code. The let keyword however can be reassigned a new value.&lt;/p&gt;

&lt;p&gt;Variables assigned with let cannot be accessed if put within a block of code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let x = 20
if(x &amp;gt; 10) {
  let message = 'greater than 10';
}
console.log(message); // ref error: message is undefined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;They can be reassigned though:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let y = 30;
y = 5;
console.log(y); // 5 will print to the console
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Const
&lt;/h3&gt;

&lt;p&gt;The const keyword is also considered a block scoped variable, but variables declared with const cannot be reassigned a new value.&lt;/p&gt;

&lt;p&gt;Trying to assign a new value to a const variable will give the following error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const number = 50;
number = 100; // typeError: assignment to constant variable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Know which to use
&lt;/h3&gt;

&lt;p&gt;It is important to understand when to use each of these keywords because they act so differently from one another. It is now more common practice not to use the var keyword, due to it being globally scoped along with the possibility of accidentally reassigning a variable. If you want to be able to reassign a variable, you can use the let keyword, otherwise use const. Even though both of these keywords are block scoped, you can always just put the variables in the global scope of your code to make them globally accessible.&lt;/p&gt;

&lt;p&gt;Even though the concepts and examples shown here are very basic, it is good to get a grasp of the fundamental traits and characteristics of the these three variable keywords and understand when each should be used.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
