<?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: Flash1105</title>
    <description>The latest articles on DEV Community by Flash1105 (@flash1105).</description>
    <link>https://dev.to/flash1105</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%2F1082694%2Ffca36479-ce1c-45ae-b1ff-c875b9a0fb93.png</url>
      <title>DEV Community: Flash1105</title>
      <link>https://dev.to/flash1105</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/flash1105"/>
    <language>en</language>
    <item>
      <title>Proxy Puzzle</title>
      <dc:creator>Flash1105</dc:creator>
      <pubDate>Mon, 09 Oct 2023 04:43:39 +0000</pubDate>
      <link>https://dev.to/flash1105/proxy-puzzle-3pbf</link>
      <guid>https://dev.to/flash1105/proxy-puzzle-3pbf</guid>
      <description>&lt;p&gt;Recently, I was creating a program called "EntomoConnect". This platform allowed users to make observations for others to see and eventually discuss. However, I found myself stuck for days due to a Proxy Error between my frontend and backend. While I was successfully making "GET" and "POST" requests through Postman, I struggled to achieve the same through the frontend. Despite both sides seemingly configured correctly, I constantly found myself checking and re-checking, ensuring both were running on communicating ports. My breakthrough came when I stumbled upon setupProxy.js.&lt;/p&gt;

&lt;h4&gt;
  
  
  What even is setupProxy.js?
&lt;/h4&gt;

&lt;p&gt;setupProxy.js is a configuration file utilized during environmental setup, especially with tools like Create React App. It offers a structured method to route requests from your frontend to your backend services, effectively managing proxy details.&lt;/p&gt;

&lt;h4&gt;
  
  
  Why use setupProxy.js?
&lt;/h4&gt;

&lt;p&gt;In my journey, I was able to replicate the production environment by directing frontend requests to my backend, even when they operated on different local ports.&lt;/p&gt;

&lt;p&gt;This tool didn't just bridge that gap. It also streamlined my CORS policies, ensuring seamless communication between frontend and backend, which significantly enhanced the development process.&lt;/p&gt;

&lt;p&gt;Within setupProxy.js, I was able to adjust routes, alter headers, and even mock responses. This flexibility simplified and aided in my testing phase.&lt;/p&gt;

&lt;p&gt;While the proxy error initially appeared as a daunting barrier, setupProxy.js not only helped me navigate around it but also enriched my overall development experience. Such tools sparked my enthusiasm, making me eager about future projects and the innovative answers I might encounter next.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>python</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>A Guide to SQLAlchemy</title>
      <dc:creator>Flash1105</dc:creator>
      <pubDate>Sun, 27 Aug 2023 20:38:49 +0000</pubDate>
      <link>https://dev.to/flash1105/a-guide-to-sqlalchemy-48nn</link>
      <guid>https://dev.to/flash1105/a-guide-to-sqlalchemy-48nn</guid>
      <description>&lt;h2&gt;
  
  
  What is SQLAlchemy?
&lt;/h2&gt;

&lt;p&gt;In the world of Python coding, SQLAlchemy stands as a very powerful and versatile library that acts as a connector between your Python code and the relational databases.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Importance of Object-Relational Mapping (ORM)
&lt;/h2&gt;

&lt;p&gt;Before we dig deeper into SQLAlchemy, we need to understand ORM, the magic behind SQLAlchemy.  Object Relational Mapping is a concept that connects an object-oriented programming model with relational databases.  Basically, it allows you to use Python classes and objects to interact with database tables and records, making the process feel more intuitive and closer to your programming language.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Key Components of SQLAlchemy: SQL Expression Language and ORM
&lt;/h2&gt;

&lt;p&gt;SQLAlchemy has two main components: the SLQ Expression Language and the ORM.  &lt;/p&gt;

&lt;p&gt;SQL Expression Language: This is your toolkit for creating SQL queries using Python syntax.  Instead of dealing with raw SQL statements, you can make queries in a more readable and maintainable way.  This component really shows when you need to perform complex queries, filtering, ordering, or group operations.&lt;br&gt;&lt;br&gt;
ORM: The ORM component allows you to define Python classes that correspond to database tables.  These classes, also known as models, provide an object-oriented interface to your data.  You can create, read, update, and delta records as if you were working with regular Python objects, leaving the SQL grunt work to SQLAlchemy behind the scenes.  &lt;/p&gt;
&lt;h2&gt;
  
  
  SQLAlchemy’s Role in Pythons Ecosystem
&lt;/h2&gt;

&lt;p&gt;SQLAlchemy allows users to work with databases smoothly and efficiently. Here are a few reasons why.&lt;/p&gt;

&lt;p&gt;Database Agnostic: SQLAlchemy supports various database systems, so you can switch between databases without rewriting your code.&lt;br&gt;&lt;br&gt;
Security: By using SQL queries, SQLAlchemy reduces security risks.&lt;br&gt;&lt;br&gt;
Clean Code: SQLAlchemy allows you to focus on your project logic instead of SQL syntax.&lt;br&gt;&lt;br&gt;
Testing Friendly: SQLAlchemy allows users to use in-memory databases or stimulate databases making testing easier and faster.  &lt;/p&gt;
&lt;h2&gt;
  
  
  Installing and Setting Up
&lt;/h2&gt;

&lt;p&gt;Before you can use the power of SQLAlchemy, you'll need to install and set yourself up.  &lt;/p&gt;

&lt;p&gt;Installing SLQAlchemy through pip: It's as easy as running a pip command.  This gets SLQALchemy ready for action in your project.&lt;br&gt;&lt;br&gt;
Connecting to Different Databases: Whether you're using SQLite, MySQL, or something else, SQLAlchemy has you covered.  You can connect various database engines easily.&lt;br&gt;&lt;br&gt;
Creating a Database Session: Sessions are your bridge between Python and your Databases.  You'll need it to properly execute actions like adding, querying, and updating data.  &lt;/p&gt;
&lt;h2&gt;
  
  
  Exploring the SQL Expression Language
&lt;/h2&gt;

&lt;p&gt;SQLAlchemy’s SQL Expression Language lets you communicate with databases using your Python code.  With it, you can easily make SQL queries in a Pythonic style, allowing you to be a bit more familiar with and easily read the database interactions.  Whether you are adding, fetching, updating, or deleting data, it is all done through Python commands.  &lt;/p&gt;
&lt;h2&gt;
  
  
  Mastering SQLAlchemy ORM
&lt;/h2&gt;

&lt;p&gt;Now that we have an understanding of what SQL Expression Language is, let's dive into SQLAlchemy’s ORM.  Object Relational Mapping is a concept that connects an object-oriented programming model with relational databases.  Basically, it allows you to use Python classes and objects to interact with database tables and records, making the process feel more intuitive and closer to your programming language.  &lt;/p&gt;
&lt;h2&gt;
  
  
  Real-Life Example
&lt;/h2&gt;

&lt;p&gt;Let's see how we could use SLQAIchemy in real life.  Imagine you are creating an application that involves user authentication and profile management.  SQLAlchemy’s ORM makes it straight to define a user model and interact with the database.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;sqlalchemy&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;create_engine&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Column&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Integer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;sqlalchemy.orm&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;sessionmaker&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;sqlalchemy.ext.declarative&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;declarative_base&lt;/span&gt;

&lt;span class="c1"&gt;# Creates SQLite database
&lt;/span&gt;&lt;span class="n"&gt;engine&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;create_engine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'sqlite:///user_database.db'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;echo&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;Base&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;declarative_base&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Define user model
&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Base&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;__tablename__&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'users'&lt;/span&gt;
    &lt;span class="nb"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Column&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Integer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;primary_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;username&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Column&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Column&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# Create tables in database
&lt;/span&gt;&lt;span class="n"&gt;Base&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;create_all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Create session to interact with database
&lt;/span&gt;&lt;span class="n"&gt;Session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sessionmaker&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bind&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Session&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Add new user
&lt;/span&gt;&lt;span class="n"&gt;new_user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;User&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'john_doe'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'john@example.com'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new_user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;commit&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Query users
&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;User&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;filter_by&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'john_doe'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

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

&lt;/div&gt;



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

&lt;p&gt;In conclusion, SQLAlchemy has emerged as a remarkable friend in the world of Python programming. Easing the interaction between your code and databases.  Through its ORM and SQL Expression language, it propels developers into a realm of seamless communication and efficient management of data.  &lt;/p&gt;

</description>
      <category>python</category>
      <category>sql</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Decoding JSX</title>
      <dc:creator>Flash1105</dc:creator>
      <pubDate>Mon, 03 Jul 2023 01:59:01 +0000</pubDate>
      <link>https://dev.to/flash1105/decoding-jsx-50ch</link>
      <guid>https://dev.to/flash1105/decoding-jsx-50ch</guid>
      <description>&lt;p&gt;In the world of React, an amazing JavaScript library for making user interfaces, there is a thing called JSX that changes how we make UI components.  JSX, which stands for JavaScript XML, makes it extremely easy to combine HTML code with JavaScript.  Let's dig into it and discover how to make React even better.  &lt;/p&gt;

&lt;p&gt;JSX lets users write HTML code directly in their JavaScript files.  This extension allows for the flow of HTML with the power of JavaScript by allowing users to define and render UI components in a familiar HTML way, as well as allowing it to be easily read and maintained.  &lt;/p&gt;

&lt;p&gt;One of the best advantages of JSX is that it has the ability to streamline the creation of React components.  By turning UI elements into reusable and self-contained code blocks, React components make building complex interfaces more manageable.  JSX structure makes defining and composing components as simple as writing html tags, ultimately improving code organization and allowing for reusable code.  &lt;/p&gt;

&lt;p&gt;Although JSX is not default understood by web browsers, it can be changed into a simple JavaScript using tools like Babel.  This change ensures cross-browser compatibility and allows developers to get the full potential of JSX in their projects.  JSX also allows for integrated development environments and code editors, allowing for tools like syntax highlighting and auto-completion.  &lt;/p&gt;

&lt;p&gt;JSX has really come out of the gates swinging in the realm of UI development.  By blending HTML and JavaScript, it's the best of both worlds.  JSX simplifies React component creations, enhances code readability, and enables dynamic interactions.  With the power of JSX, developers can build amazing and interactive user interfaces with ease, making React an extremely powerful tool for making modern web applications.&lt;/p&gt;

&lt;p&gt;But JSX is not all about making development easier, it also allows for all collaborators within the React community to share their works.  In JSX, users can share their code and components much more efficiently.  By making UI elements into reusable JSX components, developers can easily send and reuse them across projects.  This promotes a culture of sharing and open-source collaboration, allowing for developers to see other issues and contribute their own solutions.  With the power of JSX, developers can easily separate from design and functionality, allowing them to focus more on how the page works and then designing it to look well.  &lt;/p&gt;

&lt;p&gt;With the rise of users going to JSX, the flexibility has gone beyond just React.  Other libraries, like Preact and Hyperapp,  have made their own JSX-like syntax.  This means that the skills and knowledge obtained from working with JSX in React can be used to other projects, making it a great tool for software students.  &lt;/p&gt;

&lt;p&gt;JSX is a total game changer in UI development, joining developers with a powerful and natural syntax for building user interfaces in React.  It simplifies component creation, and promotes code reuse and collaboration.  As a software student learning and attempting to master JSX has opened up a world of possibilities for creating engaging and beautiful user interfaces in modern web application.    &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Bug Spray with programming</title>
      <dc:creator>Flash1105</dc:creator>
      <pubDate>Mon, 15 May 2023 06:58:40 +0000</pubDate>
      <link>https://dev.to/flash1105/bug-spray-with-programming-33gl</link>
      <guid>https://dev.to/flash1105/bug-spray-with-programming-33gl</guid>
      <description>&lt;p&gt;Howdy everyone! Welcome to the mind-boggling world of debugging, where programmers unlock the enigma behind software errors. Luckily for you, I will be diving headfirst into this topic to equip you with the essential tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Get into the mindset&lt;/strong&gt;&lt;br&gt;
When you first encounter an error, the first thing you need to do is get into the role of a detective. You'll need to collect as many clues as you can, analyze all the evidence, and try to find a logical pathway to the error. Unfortunately, no matter how experienced you are, you'll always run into some sort of error. Bug-free programming simply doesn't exist. Instead of being upset that you encountered an error, you should take the time to embrace it. In my research, I came across a quote by Edsger Dijkstra saying, "If debugging is the process of removing bugs, then programming must be the process of putting them in".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recreating the error&lt;/strong&gt;&lt;br&gt;
To truly understand a bug, you almost have to treat it as a science experiment; you must be able to reproduce it. When you first try to recreate the issue, take note of every input that could have triggered it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Narrow your crosshairs&lt;/strong&gt;&lt;br&gt;
When faced with a highly complex codebase, it's important to narrow down your code. You can start by isolating the problematic code and creating a small yet focused test case. By removing the majority of the code and isolating your problem, you're able to find the root of your issue more efficiently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use the full potential of debugging tools&lt;/strong&gt;&lt;br&gt;
When you run into a bug while coding, debugging tools are going to be your best friend. One of the many integrated development environments (IDEs) is Visual Studio Code (VS Code). Not only is it very beginner-friendly, but it also has a vast ecosystem of extensions that can help enhance the functionality of a text editor. It provides a seamless and efficient debugging experience within the same program in which you write your code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rubber duck debugging&lt;/strong&gt;&lt;br&gt;
A great way that people can overcome issues is by talking about them out loud. Unfortunately, not everyone wants to listen to you ramble about code; that's where a rubber duck comes into play. As you express your problem, you may stumble upon a solution or identify alternate approaches. This is one of the tools I catch myself using the most.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Get more insight from others&lt;/strong&gt;&lt;br&gt;
More heads are better than one. Engage in discussions with peers and colleagues about your issue. Collaboration with others can shed new light on stubborn bugs, but when discussing your errors with others, make sure you keep a clear path for yourself and others. It's very easy to get off-topic and try to jump to another issue before fixing your original bug.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SAVE! SAVE! SAVE!&lt;/strong&gt;&lt;br&gt;
When writing code, it's important to keep clear documentation. This will help you find out what went wrong and how to pinpoint it. Well-documented code helps you and future developers understand and edit your code. An in-depth report on your code also helps with long-term maintenance.&lt;/p&gt;

&lt;p&gt;In conclusion, debugging is an art, requiring lots of patience and continuous troubleshooting. Accept the errors and sharpen your skills with them. As you encounter more and more bugs, they will become easier and easier to overcome. With all of these tools in your toolbelt, you'll become a pro in no time!&lt;/p&gt;

&lt;p&gt;Happy bug hunting!&lt;/p&gt;

&lt;p&gt;(n.d.). Software quotes.Com. Softwarequotes.com. &lt;a href="https://softwarequotes.com/quote/if-debugging-is-the-process-of-removing-bugs--then"&gt;https://softwarequotes.com/quote/if-debugging-is-the-process-of-removing-bugs--then&lt;/a&gt;  &lt;/p&gt;

</description>
      <category>bug</category>
      <category>programming</category>
      <category>debugging</category>
    </item>
  </channel>
</rss>
