<?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>Forem: Holden Gerner</title>
    <description>The latest articles on Forem by Holden Gerner (@hgerner19).</description>
    <link>https://forem.com/hgerner19</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%2F1041736%2F5feacce5-67ed-428c-aa8d-17624a9c9d87.png</url>
      <title>Forem: Holden Gerner</title>
      <link>https://forem.com/hgerner19</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/hgerner19"/>
    <language>en</language>
    <item>
      <title>Optical Character Recognition (OCR)</title>
      <dc:creator>Holden Gerner</dc:creator>
      <pubDate>Thu, 25 May 2023 17:59:25 +0000</pubDate>
      <link>https://forem.com/hgerner19/optical-character-recognition-ocr-gn0</link>
      <guid>https://forem.com/hgerner19/optical-character-recognition-ocr-gn0</guid>
      <description>&lt;h2&gt;
  
  
  What is OCR?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Optical Character Recognition is a technology that allows text to be scanned from things like a document or image. An example of this is when you take a picture on your smartphone and you can pull the text straight out. OCR in Python is a helpful tool is pulling text out of an upload document such as a pdf. A commonly used library in Python is Pytesseract. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is Pytesseract?
&lt;/h2&gt;

&lt;p&gt;Pytesseract is an open-source library used for OCR. It is a wrapper for the Tesseract-OCR engine. Lets look at an example of applying Pytesseract. &lt;/p&gt;

&lt;p&gt;First, we need to import the necessary libraries&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from PIL import Image
import pyTesseract
import numpy as np
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will be the example image I will be using:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4ow5TPw---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ec3wzn8s7w30azjueub.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4ow5TPw---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ec3wzn8s7w30azjueub.png" alt="Image description" width="311" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, we will pull the text out of the image:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;file = './images-1.png'

img = Image.open(file)
txt = pytesseract.image_to_string(img)

print(txt)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The results is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bash-3.2$ python3 example.py 

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

&lt;/div&gt;



&lt;p&gt;While this was just a simple example, pytesseract and other libraries used for OCR can make life so much simpler for programmers needing to pull text out of images. &lt;/p&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>Pandas vs SQL</title>
      <dc:creator>Holden Gerner</dc:creator>
      <pubDate>Thu, 20 Apr 2023 15:42:35 +0000</pubDate>
      <link>https://forem.com/hgerner19/pandas-vs-sql-145h</link>
      <guid>https://forem.com/hgerner19/pandas-vs-sql-145h</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;Both Pandas and SQL are two of the most import tools used in data science and machine learning. However, the only thing these two have in common that they both work on data that is represented in the form of tables. &lt;/p&gt;

&lt;h2&gt;
  
  
  What is Pandas?
&lt;/h2&gt;

&lt;p&gt;Pandas is an open source Python Package that is used mostly for data analytics and machine learning. This library provides a huge set of inbuilt functions that allow easy to perform complex operations. Typically, it will be used to read .csv data files. Pandas features include data cleansing, merges and joins, data inspection and statistical analysis. The only downside of pandas is that collecting large amount of data can be tricky.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is SQL?
&lt;/h2&gt;

&lt;p&gt;Unlike Pandas, SQL is a programming language that is used for database creation and manipulation. Typically SQL will read data that is stored in RDBMS files. While Pandas support row and column metadata, SQL only support column metadata. This language is utilize for fast query data processing. Basically, it allows you to collect a lump sum of data without too much issues. Performing complex operations however isn't as easy to do compared to Pandas. &lt;/p&gt;

&lt;h2&gt;
  
  
  Example (Select)
&lt;/h2&gt;

&lt;p&gt;With Pandas, selecting columns can be done simply by passing a list of the column names into your DataFrame. For this example we are going to take a DataFrame called teams and select the wins and loses columns for each row.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd

teams[["wins","loses"]]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Compare this to SQL, selecting columns would be done by using a list separated by commas.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT wins, loses 
FROM teams;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;








&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Output:
     wins    loses
0     23      10
1     19      14
2     20      13

[3 rows x 2 columns]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;While there are some key differences between both Pandas and SQL, both are extremely vital in the world of data science and machine learning. If you are interested in working with Pandas and SQL, I will provide a links at the bottom where you can learn more about them. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://pandas.pydata.org/docs/getting_started/install.html"&gt;https://pandas.pydata.org/docs/getting_started/install.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.jetbrains.com/datagrip/features/mysql.html"&gt;https://www.jetbrains.com/datagrip/features/mysql.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>datascience</category>
    </item>
    <item>
      <title>React Information Flow</title>
      <dc:creator>Holden Gerner</dc:creator>
      <pubDate>Thu, 30 Mar 2023 18:18:28 +0000</pubDate>
      <link>https://forem.com/hgerner19/react-information-flow-51nd</link>
      <guid>https://forem.com/hgerner19/react-information-flow-51nd</guid>
      <description>&lt;h2&gt;
  
  
  What is Information Flow in React?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Helps with not only sending data from the parent component &lt;em&gt;down&lt;/em&gt; to the child, creating a &lt;strong&gt;unidirectional&lt;/strong&gt; data flow. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;state is passed to the view and child components.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;actions are triggered from the view. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;actions can update the state. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How can we send data from the parent to the child Component?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In order to send data down to the child from the parent component a prop is used. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The child cannot modify the data by themselves, creating a clean data flow is followed. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Benefits:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;This allows less errors to be made and allowing more control over the program.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Easier to debug due to the fact that you know what is coming from which components.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A lot more efficient due to libraries are aware of the limitations or boundaries of each aspect of the system.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A state is always owned by only one component. Any data that is changed by a certain state in a component will only be affected in the component that are below that component (children). &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The state change on one component will never affect the components above it on the component tree (i.e parents,siblings).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

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

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.educative.io/answers/what-is-unidirectional-data-flow-in-react"&gt;https://www.educative.io/answers/what-is-unidirectional-data-flow-in-react&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>webdev</category>
    </item>
    <item>
      <title>JavaScript Scope</title>
      <dc:creator>Holden Gerner</dc:creator>
      <pubDate>Thu, 09 Mar 2023 17:59:37 +0000</pubDate>
      <link>https://forem.com/hgerner19/javascript-scope-317n</link>
      <guid>https://forem.com/hgerner19/javascript-scope-317n</guid>
      <description>&lt;h2&gt;
  
  
  What is Scope?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Scope determines the accessibility of variables&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;JavaScript has 3 different types of scope&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Block &lt;/li&gt;
&lt;li&gt;Function&lt;/li&gt;
&lt;li&gt;Global&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Types of Scopes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Block Scope:&lt;br&gt;
A variable that is defined within a block of code will only be accessible within that block. It can not used outside the block even if the block is inside a function. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Function Scope:&lt;br&gt;
A variable that is defined in a function can only be used within that function. The variable can be used within a block that is inside that function, but cannot be used outside of the function itself. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Global Scope:&lt;br&gt;
A variable that is defined as a global variable is accessible to the entire program. Meaning that a function can access this function as well as the block inside that function. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;h2&gt;
  
  
  Example of Scope
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const name = "Holden"
const age = 22

function checkMyAge(name, age){
   const word = "You are"
   if(age &amp;lt; 21){
     const oldEnough = "old enough."
     console.log(`${name}, ${word}${age} and are ${oldEnough}`)
   }
   else{
     const notOldEnough = "not old enough."   
     console.log(`${name}, ${word} ${age} and are ${notOldEnough}`)
   }
}
checkMyAge(name, age)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see the variables name and age are global scope variables. The variable word is a function scope variable which means it can only be accessed inside the checkMyAge function. The variables oldEnough and notOldEnough are block variables which can only be accessed inside the if and else statements respectfully. Since the age variable is 22, the function's output should be "Holden, you are 22 and are enough."&lt;/p&gt;

&lt;h2&gt;
  
  
  Recap
&lt;/h2&gt;

&lt;p&gt;Scope is an extremely used aspect in JavaScript. It manages the availability of variables within a program. It keeps those variables confined into separate parts of your code. You may use the name of these variables in multiple parts of your code and scope allows you to use them when needed. &lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.w3schools.com/js/js_scope.asp"&gt;https://www.w3schools.com/js/js_scope.asp&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
