<?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: dommieh97</title>
    <description>The latest articles on Forem by dommieh97 (@dommieh97).</description>
    <link>https://forem.com/dommieh97</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%2F1109680%2F89859682-30b6-4397-a278-05938eac7f5c.png</url>
      <title>Forem: dommieh97</title>
      <link>https://forem.com/dommieh97</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/dommieh97"/>
    <language>en</language>
    <item>
      <title>Keeping Your Mind On Coding, While Life Distracts You</title>
      <dc:creator>dommieh97</dc:creator>
      <pubDate>Mon, 10 Jun 2024 19:09:28 +0000</pubDate>
      <link>https://forem.com/dommieh97/keeping-your-mind-on-coding-while-life-distracts-you-17lb</link>
      <guid>https://forem.com/dommieh97/keeping-your-mind-on-coding-while-life-distracts-you-17lb</guid>
      <description>&lt;p&gt;We've all been there. You stare at the blinking cursor, your favorite IDE (Integrated Development Environment) mocking you with its blank canvas. The coffee's cold, that bug you were wrestling with feels like it has a PhD in hiding, and the siren song of social media beckons from the other tab.  Let's face it, staying focused on coding when life gets busy can feel like scaling a sheer cliff face.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Mental Health Maze
&lt;/h2&gt;

&lt;p&gt;Life throws a lot our way. Work deadlines, family obligations, the ever-present undercurrent of global news – it's enough to make anyone's brain feel like a scrambled egg. When mental health takes a dip, focus becomes the first casualty.  That complex algorithm you were dissecting suddenly resembles a bowl of alphabet soup.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Work-Life Tightrope Walk
&lt;/h2&gt;

&lt;p&gt;Work itself can be a double-edged sword. A demanding job can leave you mentally drained, with little energy left for your personal coding projects. Conversely, the pressure to stay relevant in a competitive market can lead to guilt trips when you take a break to recharge.&lt;/p&gt;

&lt;h2&gt;
  
  
  Taking a Breather: A Coder's Lifeline
&lt;/h2&gt;

&lt;p&gt;Here's the truth: stepping away from the code is not a sign of weakness, it's a sign of self-awareness.  Just like any athlete, coders need rest and recovery to perform at their best. Take a walk, spend time with loved ones, pursue a completely different hobby.  A refreshed mind will return to those coding challenges with renewed vigor.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Job Market Jungle: It's Still Out There
&lt;/h2&gt;

&lt;p&gt;The tech industry can feel like a jungle at times, with a million applicants vying for every open position. But here's the secret most experienced coders know: there are still fantastic opportunities out there.  Taking a break to prioritize your well-being won't make you unemployable. A clear head and a focused approach will land you that dream job much faster than burnout ever could.&lt;/p&gt;

&lt;p&gt;Remember, coding is a marathon, not a sprint. Pace yourself, take care of your mental health, and don't be afraid to hit the pause button when you need it. The coding world will be waiting for you when you come back, ready to tackle those challenges with renewed focus and a clearer mind.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Connecting Jellyfin Backend with a Python Backend</title>
      <dc:creator>dommieh97</dc:creator>
      <pubDate>Wed, 27 Sep 2023 06:10:32 +0000</pubDate>
      <link>https://forem.com/dommieh97/connecting-jellyfin-backend-with-a-python-backend-43dm</link>
      <guid>https://forem.com/dommieh97/connecting-jellyfin-backend-with-a-python-backend-43dm</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;Setting up a connection between these two backend servers was a very tedious process to figure out if you are not familiar with the documentation already so I will breakdown a simple method to set up a connection.&lt;/p&gt;

&lt;h2&gt;
  
  
  Jellyfin Setup
&lt;/h2&gt;

&lt;p&gt;To start you should begin by installing the Jellyfin server onto your computer. You can follow the link here to get to the Jellyfin download page. &lt;a href="https://jellyfin.org/downloads/windows"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--W-7U3et6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/var2p8o6xhiic4nhgjxl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W-7U3et6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/var2p8o6xhiic4nhgjxl.png" alt="Jellyfin Download Page" width="800" height="385"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After getting your OS specific version of Jellyfin you will follow the setup &amp;amp; installation steps. After it has completed installation you can run it from the Jellyfin application located in your tray unless you are going directly to your Jellyfin server address. The default endpoint will be &lt;strong&gt;8096&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WQ22sF7s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tda7d6ah0rpwwt2cpw2k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WQ22sF7s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tda7d6ah0rpwwt2cpw2k.png" alt="Jellyfin On Your Windows Tray" width="800" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will be greeted by the signup page. If you already have done the initial signup Jellyfin you will instead be greeted by the Jellyfin signin page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QcvS5qwU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9jbtgt98z1fzyhbosign.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QcvS5qwU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9jbtgt98z1fzyhbosign.png" alt="Jellyfin Sign In" width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up The API
&lt;/h2&gt;

&lt;p&gt;After you have signed into your server you will now be able to use the regular Jellyfin functionality such as adding media files to your server for access on a client. &lt;/p&gt;

&lt;p&gt;To get access to your API you will need to press on the three bars located on the top left of your webpage than from the navigation panel that dropped down, click on "Administrator Dashboard".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CFygu_Sw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z06cebtdjro095gq8eq9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CFygu_Sw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z06cebtdjro095gq8eq9.png" alt="Homepage" width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GaUSElTf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p7g3c9pl0t72mfeau6ls.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GaUSElTf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p7g3c9pl0t72mfeau6ls.png" alt="Homepage plus Nav" width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the Administrator Dashboard navigate the left side of your webpage until you find "API Key" within the "Advanced Settings" section. From there you simply need to press the big plus sign in the top left. You will then be prompted to input an application title so you better organize your keys. After entering the title your API Key will be generated. Copy the API key for later use.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NNf_vINw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/487bnvd2il505d0wgbm8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NNf_vINw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/487bnvd2il505d0wgbm8.png" alt="API Key page" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm going to be going under the assumption that you already have you Python server setup and now just need to connect your API Key&lt;/p&gt;

&lt;h2&gt;
  
  
  Connect to Python
&lt;/h2&gt;

&lt;p&gt;As a good method as always keep your API Keys in a ".env" file within a ".gitignore" folder so you do not give the public access to your API Keys.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TB4GmkjL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4l24lfy1ocwlwmhzng3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TB4GmkjL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4l24lfy1ocwlwmhzng3.png" alt=".env file" width="800" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This next part is very important to follow. &lt;/p&gt;

&lt;p&gt;Set your URL for your fetch request in the following format. (In the example it is for the User endpoint. Look at the following documentation on the Jellyfin API for other endpoints. &lt;a href="https://api.jellyfin.org/"&gt;&lt;/a&gt;)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;any_variable = "http://{server_address}:8096/Users?{api_key}
headers = {
        "Accept": "application/json",
        "Authorization": "MediaBrowser Token={api_key}"

        }
//"MediaBrowser" and "Token=" are mandatory in formatting of Authorization

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

&lt;/div&gt;



&lt;p&gt;Take a look below of this method being utilized in the following GET request.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3skYO1zr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b9mtw2ccui2niz1ynget.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3skYO1zr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b9mtw2ccui2niz1ynget.png" alt="GET request" width="511" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For the flask-restful setup I used in my code I added the following line of code to make my GET request accessible.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;api.add_resource(Users, '/users')&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;There is further setup to use flask-restful, if you want to emulate my method, reference the following documentation &lt;a href="https://readthedocs.org/projects/flask-restful/downloads/pdf/latest/"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As long as you have your Python server and Jellyfin server running you can now access your Jellyfin API in Python. &lt;/p&gt;

&lt;p&gt;I'm going to use Postman to display the API being fetched successfully. &lt;/p&gt;

&lt;p&gt;If you followed the setup correctly you should receive a 200 response code with the following information populate from your GET request.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Hn51TzBf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1j0c4gt8c8jjzjsx1lkq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Hn51TzBf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1j0c4gt8c8jjzjsx1lkq.png" alt="Postman preview" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Using a Python backend with a Jellyfin server is not mandatory, the API can be accessed directly from your frontend client. There are some benefits to using the dual server method. Python allows for easy API modification aswell as simple database management of your Jellyfin server. Actions such as adding media files can be done via your Python server through POST requests, as well as deleting files from your server via DELETE requests. The main benefit comes from the user information access. The jellyfin server allows administrators to see basic user information but the GET request allows you to see more detailed information such as the current password for each user, making a good alternative to having to reset your user's password each time they forget. Utitlizing the Python database allows for specified metadata to be organized and managed. Having the filtered metadata makes translating it to your frontend a breeze. &lt;/p&gt;

&lt;p&gt;TLDR: A Python server is not mandatory to access a Jellyfin server but using the two jointly allows for additional benefits from both servers, and adds simple access to the Jellyfin API  for your frontend.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>pnpm and why it's better</title>
      <dc:creator>dommieh97</dc:creator>
      <pubDate>Thu, 31 Aug 2023 07:17:36 +0000</pubDate>
      <link>https://forem.com/dommieh97/pnpm-and-why-its-better-31cf</link>
      <guid>https://forem.com/dommieh97/pnpm-and-why-its-better-31cf</guid>
      <description>&lt;h2&gt;
  
  
  Introduction:
&lt;/h2&gt;

&lt;p&gt;In the ever-evolving landscape of software development, tools that streamline our workflows are like hidden gems waiting to be discovered. One such gem is PNPM, a package manager that has been gaining traction for its unique approach to managing project dependencies. In this article, we'll explore the benefits of using PNPM over the familiar NPM (Node Package Manager) and delve into how it can enhance your coding experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Efficient Disk Space Utilization:
&lt;/h2&gt;

&lt;p&gt;A common gripe among developers is the disk space consumed by package installations, especially as a project's dependencies grow. Unlike NPM, which duplicates packages across projects, PNPM employs a single global storage for packages. This approach significantly reduces disk usage, as packages are shared across projects, minimizing redundancy and freeing up precious disk space.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Faster Installation Speeds:
&lt;/h2&gt;

&lt;p&gt;Speed is a critical factor in modern development workflows. PNPM's innovative design enables faster package installation compared to NPM. Traditional package managers tend to install packages sequentially, leading to time-consuming processes. PNPM's concurrent installation feature allows packages to be fetched and installed simultaneously, dramatically reducing waiting times and boosting productivity.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Improved Dependency Management:
&lt;/h2&gt;

&lt;p&gt;Managing dependencies can become a headache, particularly when conflicts or version mismatches arise. PNPM's deterministic approach ensures that every time you install a package, the exact same version will be used across your projects. This minimizes the chances of encountering unexpected issues due to varying dependency versions and provides a sense of stability to your projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Reduced Network Bandwidth Usage:
&lt;/h2&gt;

&lt;p&gt;Downloading packages from the internet consumes network bandwidth, which can become a concern in larger projects or with limited connectivity. PNPM tackles this issue by storing packages locally once they are fetched. Subsequent projects that require the same packages can access them directly from the local storage, saving both time and bandwidth.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Enhanced Developer Experience:
&lt;/h2&gt;

&lt;p&gt;Coding is all about efficiency, and PNPM optimizes this aspect in multiple ways. Its automatic hoisting mechanism eliminates duplicate packages, ensuring that your application uses a single instance of each package. This simplifies maintenance and debugging, as there are fewer versions of the same package to manage.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Seamless Migration and Compatibility:
&lt;/h2&gt;

&lt;p&gt;If you're concerned about transitioning from NPM to PNPM, fret not. PNPM supports NPM and Yarn projects without requiring any alterations to your existing codebase. It uses the same package.json and node_modules structure, making migration straightforward and hassle-free. This compatibility ensures you can make the switch at your own pace.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Community and Ecosystem Support:
&lt;/h2&gt;

&lt;p&gt;As more developers recognize the benefits of PNPM, its community and ecosystem continue to grow. This means you'll find an increasing number of resources, tutorials, and plugins tailored to PNPM, helping you make the most of this tool. Additionally, PNPM's open-source nature encourages collaboration and innovation, ensuring its continued evolution.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Installation:
&lt;/h2&gt;

&lt;p&gt;If you do not have node.js already installed you can use a standalone script like the following&lt;br&gt;
&lt;code&gt;curl -fsSL https://get.pnpm.io/install.sh | sh -&lt;/code&gt;&lt;br&gt;
to install pnpm into your system&lt;/p&gt;

&lt;p&gt;alternatively if you already have npm installed into your system, simply run the following code&lt;br&gt;
&lt;code&gt;npm install -g pnpm&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;for additional methods of installation view the following documentation &lt;a href="https://dev.tourl"&gt;https://pnpm.io/installation&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;In the realm of software development, the quest for efficiency is unending. PNPM, with its focus on optimizing disk space, installation speed, dependency management, and more, offers a fresh perspective on package management. While NPM has been a stalwart companion for many developers, considering the advantages of PNPM could lead to a smoother and more productive coding journey. By embracing PNPM, you're not just adopting a tool – you're embracing a more streamlined and efficient way of building and maintaining your projects. So, why not give PNPM a try and experience firsthand how it can elevate your coding experience? Your development workflow might just thank you for it.&lt;/p&gt;

&lt;p&gt;If this blog caught your attention and you want to read more of the documentation please visit the github with the following link! &lt;a href="https://dev.tourl"&gt;https://github.com/pnpm/pnpm&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Demystifying SQLAlchemy: A Noob's Guide to Python's ORM</title>
      <dc:creator>dommieh97</dc:creator>
      <pubDate>Wed, 09 Aug 2023 16:41:11 +0000</pubDate>
      <link>https://forem.com/dommieh97/demystifying-sqlalchemy-a-noobs-guide-to-pythons-orm-4n8d</link>
      <guid>https://forem.com/dommieh97/demystifying-sqlalchemy-a-noobs-guide-to-pythons-orm-4n8d</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;If you're just getting started with database interactions in Python, the thought of dealing with SQL queries might seem daunting. Enter SQLAlchemy, a powerful Object-Relational Mapping (ORM) library that abstracts away the complexities of database management. In this noob-friendly guide, we'll take you on a tour of SQLAlchemy, unraveling its key concepts with simple examples. By the end of this 5-minute read, you'll have a solid grasp of how to use SQLAlchemy to interact with databases effortlessly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding SQLAlchemy
&lt;/h2&gt;

&lt;p&gt;At its core, SQLAlchemy serves as a bridge between your Python code and a database. It allows you to work with database records as if they were Python objects, eliminating the need to write raw SQL queries. SQLAlchemy offers two main components: the Core and the ORM. In this guide, we'll focus on the ORM, which provides a higher-level abstraction and is great for noobs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up
&lt;/h2&gt;

&lt;p&gt;Before diving into examples, you'll need to install SQLAlchemy. Use the following command to install it using pip:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install sqlalchemy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Basic CRUD Operations
&lt;/h2&gt;

&lt;p&gt;Let's start with the basics: Create, Read, Update, and Delete operations. We'll use an example of a simple User model.&lt;/p&gt;

&lt;p&gt;Alef. Creating Records:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from sqlalchemy import create_engine, Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker

Base = declarative_base()

class User(Base):
    __tablename__ = 'users'
    id = Column(Integer, primary_key=True)
    name = Column(String)

engine = create_engine('sqlite:///users.db')
Base.metadata.create_all(engine)

Session = sessionmaker(bind=engine)
session = Session()

new_user = User(name='Dommie')
session.add(new_user)
session.commit()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bet. Reading Records&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;all_users = session.query(User).all()
user = session.query(User).filter_by(name='Dommie').first()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Gimel. Updating Records:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user.name = 'Dommie'
session.commit()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dalet. Deleting Records:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;session.delete(user)
session.commit()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Querying with Filters
&lt;/h2&gt;

&lt;p&gt;SQLAlchemy makes querying a breeze. You can use filters to retrieve specific records.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Retrieve users with names starting with 'D'
users_with_a = session.query(User).filter(User.name.like('D%')).all()

# Retrieve users with IDs in a given list
target_ids = [1, 3, 5]
target_users = session.query(User).filter(User.id.in_(target_ids)).all()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Relationships
&lt;/h2&gt;

&lt;p&gt;Databases often involve relationships between tables. SQLAlchemy simplifies this too.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Post(Base):
    __tablename__ = 'posts'
    id = Column(Integer, primary_key=True)
    title = Column(String)
    user_id = Column(Integer, ForeignKey('users.id'))

    author = relationship("User", back_populates="posts")

User.posts = relationship("Post", back_populates="author")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Congratulations! You've taken your first steps into the world of SQLAlchemy. You've learned how to set up the library, perform basic CRUD operations, query records with filters, and establish relationships between tables. With this foundation, you can confidently build applications that interact with databases using Python. As you explore further, remember that SQLAlchemy offers even more advanced features to enhance your database interactions. Happy coding!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>React's MyContext: Simplify your State Management and Global Data Sharing</title>
      <dc:creator>dommieh97</dc:creator>
      <pubDate>Wed, 19 Jul 2023 17:20:41 +0000</pubDate>
      <link>https://forem.com/dommieh97/reacts-mycontext-simplify-your-state-management-and-global-data-sharing-4af2</link>
      <guid>https://forem.com/dommieh97/reacts-mycontext-simplify-your-state-management-and-global-data-sharing-4af2</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;In the world of front-end development, React has become the go-to JavaScript library for building robust and interactive user interfaces. With React's ever-evolving ecosystem, developers are always exploring new features to enhance their applications. One such feature is React's MyContext, a powerful tool that simplifies state management and global data sharing across components. In this blog post, we'll dive into the world of MyContext and discover how it revolutionizes the way we handle data in React applications.&lt;/p&gt;

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

&lt;p&gt;MyContext is a part of React's Context API, used as a way to address the challenges of prop drilling, a common problem when passing data through multiple layers of components. MyContext allows developers to create a global state container, making data accessible to any component within its defined scope. By utilizing this container, developers can avoid the cumbersome process of passing props through intermediary components and directly access shared data, enhancing application performance and readability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up MyContext
&lt;/h2&gt;

&lt;p&gt;To start using MyContext, you must first define a new context using the createContext function provided by React. This function initializes a context object and returns two components: the Provider and the Consumer. The Provider acts as the data source, while the Consumer lets components consume the data stored in the context.&lt;/p&gt;

&lt;p&gt;Here's a basic setup for MyContext&lt;/p&gt;

&lt;p&gt;Step 1 MyContext.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// In a MyContext component (MyContext.js)
import {createContext} from "react";

const MyContext = createContext();

export default MyContext
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 2 Establish values for MyContext&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import MyContext from "./MyContext"
// make sure to properly path your context;
function App()
{
return(
&amp;lt;MyContext.Provider value={{variable1,variable2}} &amp;gt;
  &amp;lt;Component1/&amp;gt;
  &amp;lt;Component2/&amp;gt;
  &amp;lt;Component3/&amp;gt;
&amp;lt;/MyContext.Provider&amp;gt;
}
export default App
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Consuming MyContext Data
&lt;/h2&gt;

&lt;p&gt;Once you have set up the MyContext Provider, any component that needs access to the shared data can consume it using the useContext hook or the Consumer component. The useContext hook is the most modern and preferred way to consume the context in functional components, while the Consumer component is useful for class components or when nesting multiple contexts.&lt;/p&gt;

&lt;p&gt;Using useContext:&lt;br&gt;
&lt;/p&gt;

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

function Container()
{

const {variable1,variable2} = useContext(MyContext);

//Even if this component is not a direct child of App.js it will still be able to use the two variables passed down thanks to MyContext

return(
 &amp;lt;div/&amp;gt;
)
}

export default Container
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Benefits of MyContext
&lt;/h2&gt;

&lt;p&gt;MyContext brings several advantages to React development. Firstly, it significantly reduces prop drilling, leading to cleaner and more maintainable code. Secondly, it simplifies state management by centralizing data, making it easier to manage and update application-wide states. Thirdly, MyContext enhances code scalability, as adding new components that require access to the shared data is a breeze. Lastly, this approach improves application performance, as it optimizes data flow and minimizes unnecessary renders.&lt;/p&gt;

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

&lt;p&gt;React's MyContext is a game-changer when it comes to state management and data sharing in React applications. By providing a straightforward way to share data across components, it streamlines development and enhances application performance. As you continue your journey with React, consider leveraging MyContext to create efficient, scalable, and more manageable applications, enabling you to focus on delivering a seamless user experience.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>react</category>
      <category>jsx</category>
    </item>
    <item>
      <title>Array Manipulation and Time Manipulation: Balancing Life and Coding</title>
      <dc:creator>dommieh97</dc:creator>
      <pubDate>Wed, 28 Jun 2023 06:41:58 +0000</pubDate>
      <link>https://forem.com/dommieh97/array-manipulation-and-time-manipulation-balancing-life-and-coding-e78</link>
      <guid>https://forem.com/dommieh97/array-manipulation-and-time-manipulation-balancing-life-and-coding-e78</guid>
      <description>&lt;p&gt;Arrays are data structures used to store and manipulate collections of elements. Arrays have the ability when used correctly to provide flexibility and efficiency in managing data. In your personal life, utilizing self-care techniques can help you sustain a healthy and balanced life. What you might not be aware of are the similarities between Array Manipulation and your own personal Time Manipulation. Effectively utilizing both can ameliorate daily stressers and help prevent general burnout!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sQ4-jMpq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8lx1dr1rnms7vsaifbbx.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sQ4-jMpq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8lx1dr1rnms7vsaifbbx.jpg" alt="Super Stressed" width="560" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Declaring and Initializing: Setting the Foundation&lt;/strong&gt;&lt;br&gt;
When creating an array the first steps are to declare and initialize your array so it is prepared for data to be plugged in. Similarly, when it comes to your own time management it must start with establishing a foundation. Taking the time to organize your tasks,needs and desires is a good groundwork. Finding the best means to not only tackle your tasks in a timely manner but still incorporating your daily needs(eating, sleeping, and even some kind of movement) and leaving sometime to focus on what you enjoy that is not related to your work. By declaring and initializing your  routine, you create a solid framework to build upon.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7AnnPbOo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ewpqcm3bjtdrzi6dn5us.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7AnnPbOo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ewpqcm3bjtdrzi6dn5us.jpg" alt="Nature is not always scary" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Accessing Elements: Nurturing Different Aspects of Life&lt;/strong&gt;&lt;br&gt;
Being able to access individual elements is a core operation in array manipulation. While all the array is the culmination of all the inner elements each on is still important to identity of the array itself. In the same way while you are a software developer, computer scientist, or someone who just enjoys being in the coding world, there are still more aspects of you that exist and they need to be given their just recognition for good or bad. Finding not only the good elements but also the bad we get an understanding of how we need to implement our array and time manipulations. By accessing and addressing each element of your life, you create a harmonious balance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--a767CkJC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x86d8x4i4864lpk7w0ct.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--a767CkJC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x86d8x4i4864lpk7w0ct.jpg" alt="Time for a nap" width="800" height="584"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Modifying Elements: Adapting and Evolving&lt;/strong&gt;&lt;br&gt;
We have many opportunities to manipulate that data with in arrays. We can  add to, remove from, and update them. Similarly, when it comes to taking care of oneself it requires being willing to adapt and evolve as circumstances change. Allowing yourself room to manipulate your personal elements you bring the opportunity for improvements or in some cases you at least avoid getting worse. Embrace flexibility and don't hesitate to remove or update elements that no longer serve you. Just as arrays can be modified to optimize performance, so can your daily life, even if its only in seemingly minute ways.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ar6MEMNY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e7ldyzslqyygwxs6w4q4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ar6MEMNY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e7ldyzslqyygwxs6w4q4.jpg" alt="It's Fine" width="800" height="564"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Iteration: Consistency and Habit Formation&lt;/strong&gt;&lt;br&gt;
In software engineering, iteration involves repeatedly performing a set of operations. Likewise, consistency and habit formation are important aspects of your daily routine. Taking the time to identify activities that bring you joy and making them a regular part of your routine. Maintaining consistency if it is not a daily activity try for weekly. Through repeated iterations of self-care, you cultivate healthy habits that positively impact your overall well-being.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v0FxJiqX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tpi231w6cgs5ql67k5br.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v0FxJiqX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tpi231w6cgs5ql67k5br.jpg" alt="Casual Hobby" width="640" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sorting and Filtering: Prioritizing and Setting Boundaries&lt;/strong&gt;&lt;br&gt;
Sorting and filtering are powerful techniques in array manipulation, enabling us to prioritize and extract specific elements. These are also important and challenging techniques to implement into your own life . Learning when it is time to shift an element out of your life can be difficult to recognize, but its important to prioritize your own values and well-being. Even when you have begun to filter the important things you might need to still reverse your mentality on how you address the tasks. By effectively finding the best layout of the elements that you need in your life you are able to create space for a new healthy balance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AIK3S6qH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x2edfp81x3jn4lnw7fg2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AIK3S6qH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x2edfp81x3jn4lnw7fg2.jpg" alt="Apply a filter" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Searching and Retrieving: Seeking Support and Reflection&lt;/strong&gt;&lt;br&gt;
Searching and retrieving elements from an array allow us to find specific data when needed. With this we can incorporate the most important elements in the array to the rest of our project. Apply the search functionality into yourself. Find what parts of you need attention and need to be taken out and addressed. Reach out to trusted friends, family, or professionals when you need support. Don't feel like you are in this by yourself, you are one of billions of humans and there will always be someone to reach out to. Finding the right place to put yourself may be hard but you are comprised of by numerous elements each special in their own way. Engage in self-reflection through journaling, meditation, or introspection. Allow yourself to understand yourself and than you can see where in this giant project your data can be utilized. Isolating the elements is always just the first step find the perfect use for it always comes second.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--r2aCYwEW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d7lyonwh7geoy5tr8jfu.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--r2aCYwEW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d7lyonwh7geoy5tr8jfu.jpg" alt="Take A Moment To Think of Just. Flexibility, Love, and Trust" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Array manipulation and time manipulation share a common thread of organization, adaptability, and balance. By applying array manipulation concepts to our daily routines, we can create a structured approach that promotes well-being and fulfillment. Remember to declare and initialize your self-care, access different aspects of your life, modify your routine as needed, iterate for consistency, sort and filter to set boundaries, and search and retrieve support and reflection. Now I know I gave no specifics on changing your personal time manipulation but with these strategies in place, you can achieve a harmonious balance that optimizes both your coding endeavors and your overall quality of life.&lt;/p&gt;

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