<?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: CharlesTechy</title>
    <description>The latest articles on DEV Community by CharlesTechy (@charlestechy).</description>
    <link>https://dev.to/charlestechy</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%2F55106%2F92f427fc-a3d3-4c8c-8dd2-5d53eb4f2ad0.jpg</url>
      <title>DEV Community: CharlesTechy</title>
      <link>https://dev.to/charlestechy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/charlestechy"/>
    <language>en</language>
    <item>
      <title>Designing SQL Database for a blog application</title>
      <dc:creator>CharlesTechy</dc:creator>
      <pubDate>Wed, 28 Jun 2023 14:05:32 +0000</pubDate>
      <link>https://dev.to/charlestechy/designing-sql-database-for-a-blog-application-2i4i</link>
      <guid>https://dev.to/charlestechy/designing-sql-database-for-a-blog-application-2i4i</guid>
      <description>&lt;p&gt;With this tutorial we would have an understanding on how create a database schema for a blog application. It defines several tables and their relationships to store information about authors, blog posts, comments, replies, and post likes.&lt;/p&gt;

&lt;p&gt;Here's a breakdown of the script:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating the blog database:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;CREATE DATABASE IF NOT EXISTS Blog;&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating the Author table:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;CREATE TABLE IF NOT EXISTS Author (&lt;br&gt;
       author_id INT AUTO_INCREMENT,&lt;br&gt;
       full_name VARCHAR(255) NOT NULL,&lt;br&gt;
       about TEXT,&lt;br&gt;
       is_admin TINYINT(1),&lt;br&gt;
       status TINYINT(1),&lt;br&gt;
       date_registered DATETIME,&lt;br&gt;
       password VARCHAR(255),&lt;br&gt;
       PRIMARY KEY (author_id)&lt;br&gt;
   );&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This table stores information about authors, including their ID, full name, about section, admin status, status, registration date, and password.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating the Posts table:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;CREATE TABLE IF NOT EXISTS Posts (&lt;br&gt;
       post_id INT AUTO_INCREMENT,&lt;br&gt;
       title VARCHAR(255) NOT NULL,&lt;br&gt;
       description TEXT,&lt;br&gt;
       is_published TINYINT(1),&lt;br&gt;
       date_published DATETIME,&lt;br&gt;
       date_edited DATETIME,&lt;br&gt;
       author_id INT NOT NULL,&lt;br&gt;
       thumbnail VARCHAR(255) DEFAULT('thumbnail.png'),&lt;br&gt;
       PRIMARY KEY (post_id),&lt;br&gt;
       FOREIGN KEY (author_id) REFERENCES Author(author_id)&lt;br&gt;
   );&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This table stores information about blog posts, including their ID, title, description, published status, publication date, last edited date, author ID (foreign key referencing the Author table), and thumbnail image.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating the Comments table:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;CREATE TABLE IF NOT EXISTS Comments (&lt;br&gt;
       c_id INT AUTO_INCREMENT,&lt;br&gt;
       post_id INT NOT NULL,&lt;br&gt;
       comment TEXT,&lt;br&gt;
       is_published TINYINT(1),&lt;br&gt;
       date_published DATETIME,&lt;br&gt;
       date_edited DATETIME,&lt;br&gt;
       author_id INT NOT NULL,&lt;br&gt;
       PRIMARY KEY (c_id),&lt;br&gt;
       FOREIGN KEY (post_id) REFERENCES Posts(post_id)&lt;br&gt;
   );&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This table stores information about comments on blog posts, including their ID, post ID (foreign key referencing the Posts table), comment text, published status, publication date, last edited date, and author ID (foreign key referencing the Author table).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating the Replies table:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;CREATE TABLE IF NOT EXISTS Replies (&lt;br&gt;
       r_id INT AUTO_INCREMENT,&lt;br&gt;
       c_id INT NOT NULL,&lt;br&gt;
       reply TEXT,&lt;br&gt;
       is_published TINYINT(1),&lt;br&gt;
       date_published DATETIME,&lt;br&gt;
       date_edited DATETIME,&lt;br&gt;
       author_id INT NOT NULL,&lt;br&gt;
       PRIMARY KEY (r_id),&lt;br&gt;
       FOREIGN KEY (c_id) REFERENCES Comments(c_id)&lt;br&gt;
   );&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This table stores information about replies to comments, including their ID, comment ID (foreign key referencing the Comments table), reply text, published status, publication date, last edited date, and author ID (foreign key referencing the Author table).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating the PostLikes table:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;CREATE TABLE IF NOT EXISTS PostLikes (&lt;br&gt;
       like_id INT AUTO_INCREMENT,&lt;br&gt;
       post_id INT NOT NULL,&lt;br&gt;
       likes TINYINT(1),&lt;br&gt;
       is_published TINYINT(1) DEFAULT('1'),&lt;br&gt;
       date_published DATETIME,&lt;br&gt;
       date_edited DATETIME,&lt;br&gt;
       author_id INT NOT NULL,&lt;br&gt;
       PRIMARY KEY (like_id),&lt;br&gt;
       FOREIGN KEY (post_id) REFERENCES Posts(post_id)&lt;br&gt;
   );&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This table stores information about post likes, including their ID, post ID (foreign key referencing the Posts table), number of likes, published status, publication date, last edited date, and author ID (foreign key referencing the Author table).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Performing queries on the tables:
The script includes sample queries to retrieve data from the tables. These queries include selecting all posts, retrieving a single post by its ID,&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>sql</category>
      <category>database</category>
    </item>
    <item>
      <title>A program to calculate the area of a triangle using python</title>
      <dc:creator>CharlesTechy</dc:creator>
      <pubDate>Wed, 02 Sep 2020 22:56:07 +0000</pubDate>
      <link>https://dev.to/charlestechy/a-program-to-calculate-the-area-of-a-triangle-using-python-3ok6</link>
      <guid>https://dev.to/charlestechy/a-program-to-calculate-the-area-of-a-triangle-using-python-3ok6</guid>
      <description>&lt;p&gt;Yo! guys today am dropping a snippet to calculate the area of a triangle using Python Programming..&lt;/p&gt;

&lt;p&gt;Just like other programming languages like; C++, Java, JavaScript and the rest you can do a lot of mathematical stuff with the Python Lang.&lt;/p&gt;

&lt;p&gt;Tho forks may not want to do this but will like to just work with another approach other than this.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; The First thing to do is to print a message on the screen telling the user about your program.&lt;/p&gt;

&lt;p&gt;Using the print statement in Python, we can easily print messages to the user's screen.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;print ("A Program to calculate the Area of a Triangle");&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; The next thing to do is to wait for the user's command, by printing on the screen &lt;strong&gt;press any button to continue&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;input("Press any button to continue...");&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;with python version 2.x we can easily use&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;raw_input("Press any button to continue");&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; Tell the user to enter the base of the angle, which will be stored in a variable called &lt;strong&gt;'angleBase'.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;angleBase = input("Enter Angle Base\n");&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; Request for the height of the angle, which will be stored in a variable called &lt;strong&gt;'angleHeight'.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;angleHeight = input("Enter Angle Height\n");&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.&lt;/strong&gt; I then declared two variables called &lt;strong&gt;'isHeightANumber'&lt;/strong&gt; and &lt;strong&gt;'isBaseANumber'&lt;/strong&gt; and assigned them to the language(Python)'s function called &lt;strong&gt;"isdigit()".&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;isHeightANumber = angleHeight.isdigit();
isBaseANumber = angleBase.isdigit();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What is the work of isdigit()?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"isdigit()" is a python function which checks if a variable value(s) are/is a digit(s).&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The last part of the code is shown below&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before Processing/ Calculating the user data, i tried to verify that the fields are not empty or void by using the&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;if statement and the not equal (!=) operator&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;if  angleBase!="" and angleHeight!="":&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Also i consider checking and validating by making sure what the user entered is a number by using the&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;if statment and isdigit()&lt;br&gt;
   if isBaseANumber and isHeightANumber:&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The last part is all about declaring a variable called areaOfATriangle which will calculate the area of the input entered by the user, if the base and height entered by the user are/is a number, it will print out the area of the triangle, if not it will show the&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;else statement&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;which says "Angle Base and Height must be a number"&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;areaOfATriangle = int(int(angleBase) * int(angleHeight) / int(2));&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;print("Area of a triangle whose base = ", angleBase, " and height = ", angleHeight, " is = ", areaOfATriangle);&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
else:
       print("Angle Base and Height must be a number");
else:
       print("Height and Base can't be empty.");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>dev</category>
      <category>python</category>
      <category>mathematics</category>
      <category>programming</category>
    </item>
    <item>
      <title>A Letter to young Developers</title>
      <dc:creator>CharlesTechy</dc:creator>
      <pubDate>Tue, 14 Apr 2020 19:58:49 +0000</pubDate>
      <link>https://dev.to/charlestechy/a-letter-to-young-developers-3n2c</link>
      <guid>https://dev.to/charlestechy/a-letter-to-young-developers-3n2c</guid>
      <description>&lt;p&gt;Hey fellow developers, programmers and tech guys in the building. How has be your day and families? I thank GOD for making you see this very day most especially 2020 even though there is the life-threatening pandemic "Codvi-19".&lt;/p&gt;

&lt;p&gt;It is a great pleasure writing you this text this day;my aim of delivering this text to you, is a about an advice titled :&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;How to become a awesome and fabulous programmer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Which deals on the simple errors and corrections you need to adopt in this 2020.&lt;/p&gt;

&lt;p&gt;I will be sharing with you the advice quoted above just with the text below in unordered manner.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Use a very cute and code completion text editor e.g Visual Studio code,latest version of Sublime Text ,Github Atom or any other text editor you know how to use best.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Read other people’s code be it pdf or the programs extensions respectively.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Edit the code and try them out by substituting them with your own values, variables or any other related features you can change.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Never make any attempt of claiming the code&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Share your codes with other developers far better than you.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Always ask questions when you’re freaking out ;don’t assume you know it because a preacher once said&lt;/p&gt;

&lt;p&gt;assumption is not reality.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check out your environment or social media groups and pages mainly concerned on programming, developing, technology and coding stuffs and seek for mentorship.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Don’t /never be proud when you’re good in some aspects because&lt;/p&gt;

&lt;p&gt;pride goes before a fall.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a project with what you have learnt so far.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you think you’re now really,then contribute to open source.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Less i forget read your interested programming language documentations, also CODE &amp;amp;&amp;amp; CODE &amp;amp;&amp;amp; CODE.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Even if you’re a senior developer i hope you will also find piece this helpful&lt;/p&gt;

&lt;p&gt;With this text I really hope you become a great, awesome, fabulous tech dude and word class developer in this 2020.&lt;/p&gt;

&lt;p&gt;Much love&lt;br&gt;
From: Sedenu Aloaye Charles&lt;br&gt;
Founder: charlestechy.com.ng&lt;/p&gt;

</description>
      <category>developers</category>
      <category>programmers</category>
      <category>softwares</category>
    </item>
    <item>
      <title>Delta State University Survey Form By Sedenu Aloaye Charles</title>
      <dc:creator>CharlesTechy</dc:creator>
      <pubDate>Tue, 18 Feb 2020 06:38:32 +0000</pubDate>
      <link>https://dev.to/charlestechy/delta-state-university-survey-form-by-sedenu-aloaye-charles-1ege</link>
      <guid>https://dev.to/charlestechy/delta-state-university-survey-form-by-sedenu-aloaye-charles-1ege</guid>
      <description>&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/Charlessedenu/embed/WNvwKvY?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>codepen</category>
      <category>delta</category>
      <category>delsu</category>
      <category>abraka</category>
    </item>
  </channel>
</rss>
