<?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: Developers Today</title>
    <description>The latest articles on DEV Community by Developers Today (@devloperstoday).</description>
    <link>https://dev.to/devloperstoday</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%2F522921%2Fdbcc9e24-a482-4326-889c-dd540b3505f9.jpeg</url>
      <title>DEV Community: Developers Today</title>
      <link>https://dev.to/devloperstoday</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/devloperstoday"/>
    <language>en</language>
    <item>
      <title>PYTHON TURTLE: OVERVIEW</title>
      <dc:creator>Developers Today</dc:creator>
      <pubDate>Tue, 18 Apr 2023 14:27:06 +0000</pubDate>
      <link>https://dev.to/devloperstoday/python-turtle-overview-2ha2</link>
      <guid>https://dev.to/devloperstoday/python-turtle-overview-2ha2</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Python Turtle?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Fjkv0fmN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4yiv51y78meetina5bgk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Fjkv0fmN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4yiv51y78meetina5bgk.png" alt="from Unsplash by Giorgia Doglioni" width="800" height="600"&gt;&lt;/a&gt;                 &lt;/p&gt;

&lt;p&gt;Python Turtle is a library used to create simple graphics in Python. It is a great way to introduce programming to kids and adults alike, as it is easy to use and understand. Python Turtle also allows you to learn the basics of programming without having any prior knowledge or experience with coding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Getting Started with Python Turtle&lt;/strong&gt;&lt;br&gt;
To get started with Python Turtle, you need to download and install Python. Then you can install the Turtle library by following these steps:&lt;/p&gt;

&lt;p&gt;Open a new Python file in your favorite text editor (I use Sublime Text)&lt;br&gt;
Type import turtle at the top of your file.&lt;br&gt;
Create a Turtle object by typing t = Turtle() in your code window, then pressing Enter or Return on your keyboard. This will create an instance of our turtle named “t” that we can use to draw shapes and patterns!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using Turtle Commands&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Turtle Motion Commands:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;forward(distance): moves the turtle forward by a specified distance&lt;/li&gt;
&lt;li&gt;backward(distance) : moves the turtle backward by a specified distance&lt;/li&gt;
&lt;li&gt;right(angle) : turns the turtle clockwise by a specified angle&lt;/li&gt;
&lt;li&gt;left(angle) : turns the turtle counterclockwise by a specified angle&lt;/li&gt;
&lt;li&gt;goto(x, y) : moves the turtle to the specified coordinates (x, y)&lt;/li&gt;
&lt;li&gt;setx(x) : moves the turtle to the specified x-coordinate&lt;/li&gt;
&lt;li&gt;sety(y) : moves the turtle to the specified y-coordinate&lt;/li&gt;
&lt;li&gt;setheading(angle) : sets the turtle's heading to the specified angle&lt;/li&gt;
&lt;li&gt;home() : moves the turtle to the origin (0, 0) and sets the turtle's heading to due east (0 degrees)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Pen Control Commands:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;pendown() : puts the pen down, allowing the turtle to draw&lt;/li&gt;
&lt;li&gt;pinupup() : lifts the pen up, preventing the turtle from drawing&lt;/li&gt;
&lt;li&gt;pensize(width) : sets the width of the pen to the specified value&lt;/li&gt;
&lt;li&gt;pencolor(color) : sets the color of the pen to the specified color&lt;/li&gt;
&lt;li&gt;fillcolor(color) : sets the color used for filling in shapes&lt;/li&gt;
&lt;li&gt;begin_fill() : starts filling in a shape&lt;/li&gt;
&lt;li&gt;end_fill() : stops filling in a shape&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Window Control Commands:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;screensize(width, height) : sets the size of the turtle's screen to the specified values&lt;/li&gt;
&lt;li&gt;title(title) : sets the title of the turtle's window&lt;/li&gt;
&lt;li&gt;bgcolor(color) : sets the background color of the turtle's window&lt;/li&gt;
&lt;li&gt;window_width() : returns the width of the turtle's window&lt;/li&gt;
&lt;li&gt;window_height() : returns the height of the turtle's window&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Other Commands:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;clear() : clears the turtle's screen and resets the turtle to its original state&lt;/li&gt;
&lt;li&gt;reset() : clears the turtle's screen and resets the turtle to its original state, but does not clear the drawing window&lt;/li&gt;
&lt;li&gt;hideturtle() : hides the turtle from view&lt;/li&gt;
&lt;li&gt;showturtle() : makes the turtle visible again&lt;/li&gt;
&lt;li&gt;speed(speed) : sets the speed of the turtle (0 = fastest, 10 = slowest)&lt;/li&gt;
&lt;li&gt;undo() : undoes the last action performed by the turtle&lt;/li&gt;
&lt;li&gt;isdown() : returns True if the pen is down, False otherwise.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import turtle
import random
def draw_star(size, color, x, y):
    turtle.penup()
    turtle.goto(x, y)
    turtle.pendown()
    turtle.color(color)
    turtle.begin_fill()
    for _ in range(5):
        turtle.forward(size)
        turtle.right(144)
    turtle.end_fill()
def animate_stars():
    turtle.clear()
    for _ in range(25):
        size = random.randint(10, 30)
        x = random.randint(-300, 300)
        y = random.randint(-300, 300)
        color = random.choice(["red", "blue", "green", "yellow", "white", "cyan", "magenta"])
        draw_star(size, color, x, y)
    turtle.ontimer(animate_stars, 1000)
turtle. Speed(0)
turtle.bgcolor("black")
turtle.hideturtle()
turtle.ontimer(animate_stars, 1000)
turtle.mainloop()

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

&lt;/div&gt;



&lt;p&gt;[Youtube]{&lt;a href="https://www.youtube.com/watch?v=7dw-MYvF0"&gt;https://www.youtube.com/watch?v=7dw-MYvF0&lt;/a&gt;}&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Python Turtle is a great way to introduce programming to kids and adults alike. It’s easy to use, understand and a great way to learn the basics of programming.&lt;/p&gt;

&lt;p&gt;Feel free to follow me on &lt;a href="https://twitter.com/dev_today99"&gt;Twitter&lt;/a&gt;, &lt;a href="https://github.com/Developers-today"&gt;GitHub&lt;/a&gt;, and &lt;a href="https://www.youtube.com/@dev_today99"&gt;YouTube&lt;/a&gt;.🙂&lt;/p&gt;

</description>
      <category>python</category>
      <category>turtle</category>
      <category>animation</category>
      <category>programming</category>
    </item>
    <item>
      <title>Connecting the Registration Form To Firebase</title>
      <dc:creator>Developers Today</dc:creator>
      <pubDate>Sun, 24 Jul 2022 14:39:11 +0000</pubDate>
      <link>https://dev.to/devloperstoday/connecting-the-registration-form-to-firebase-6eb</link>
      <guid>https://dev.to/devloperstoday/connecting-the-registration-form-to-firebase-6eb</guid>
      <description>&lt;p&gt;Firebase is a mobile and web development platform that provides programmers with a variety of tools that helps them develop quality applications. In this tutorial, we are going to see how we can use firebase for our registration forms.&lt;/p&gt;

&lt;p&gt;We can divide the whole tutorial into the following outlines:-&lt;br&gt;
Create an Html template for the registration form.&lt;br&gt;
Add CSS for design and responsiveness.&lt;br&gt;
Connect Firebase Realtime Database to Registration Form using Javascript&lt;br&gt;
&lt;strong&gt;1-Create the Html template for the registration form&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;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;

&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
    &amp;lt;title&amp;gt;ContactForm&amp;lt;/title&amp;gt;
    &amp;lt;link rel="stylesheet" href="contact_form.css"&amp;gt;
    &amp;lt;link rel='shortcut icon' type='image/x-icon' href='./favicon.ico' /&amp;gt;
    &amp;lt;script src="https://www.gstatic.com/firebasejs/9.9.1/firebase-app.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src="https://www.gstatic.com/firebasejs/9.9.1/firebase-database.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
    &amp;lt;div class="container"&amp;gt;
        &amp;lt;div class="count"&amp;gt;
            &amp;lt;h3&amp;gt;Contact Form&amp;lt;/h3&amp;gt;
        &amp;lt;/div&amp;gt;

        &amp;lt;form id="form_contact" name="contact_form"&amp;gt;
            &amp;lt;label&amp;gt;First Name&amp;lt;/label&amp;gt;
            &amp;lt;input name="first_name" id="fname" type="text" required placeholder="" /&amp;gt;
            &amp;lt;br&amp;gt;
            &amp;lt;label&amp;gt;Last Name&amp;lt;/label&amp;gt;
            &amp;lt;input name="last_name" id="sname" type="text" required placeholder="" /&amp;gt;
            &amp;lt;br&amp;gt;
            &amp;lt;label&amp;gt;Email&amp;lt;/label&amp;gt;
            &amp;lt;input name="email" id="email" type="email" required placeholder="" /&amp;gt;
            &amp;lt;br&amp;gt;
            &amp;lt;label&amp;gt;Message&amp;lt;/label&amp;gt;&amp;lt;br&amp;gt;
            &amp;lt;textarea name="message" id="message" cols="30" rows="10" placeholder="Enter your message here ..." required&amp;gt; &amp;lt;/textarea&amp;gt;
            &amp;lt;div class="center"&amp;gt;
                &amp;lt;input type="submit" value="Submit"&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/form&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;script src="contact_form.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you can make changes according to your need in the HTML form.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2-Add CSS for design and responsiveness&lt;/strong&gt;&lt;br&gt;
This contact_form.css file is included in the HTML file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@import url("https://fonts.googleapis.com/css?family=Roboto:400");

/* Set font of all elements to 'Roboto' */

* {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
}


/* Remove outline of all elements on focus */

*:focus {
    outline: 0;
}

body {
    background: #0d1316;
    /* Set background color to #263238*/
}

h3 {
    text-align: center;
}


/* Add styles to 'container' class */

.container {
    padding: 12px 24px 24px 24px;
    margin: 48px 12px;
    background: #109bff;
    border-radius: 4px;
}


/* Add styles to 'label' selector */

label {
    font-size: 0.85em;
    margin-left: 12px;
}


/* Add styles to 'input' and 'textarea' selectors */

input[type=text],
input[type=email],
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    margin-top: 6px;
    margin-bottom: 16px;
    resize: vertical;
}


/* Add styles to show 'focus' of selector */

input[type=text]:focus,
input[type=email]:focus,
textarea:focus {
    border: 1px solid green;
}


/* Add styles to the submit button */

input[type=submit] {
    background: #02060a;
    margin: 0 auto;
    outline: 0;
    color: white;
    border: 0;
    padding: 12px 24px;
    border-radius: 4px;
    transition: all ease-in-out 0.1s;
    position: relative;
    display: inline-block;
    text-align: center;
}


/* Add styles for 'focus' property */

input[type=submit]:focus {
    background: #A5D6A7;
    color: whitesmoke;
}


/* Style 'hover' property */

input[type=submit]:hover {
    background: #b13efd;
}


/* Align items to center of the 'div' with the class 'center' */

.center {
    text-align: center;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3-Connect Firebase Realtime Database to Registration Form using Javascript&lt;/strong&gt;&lt;br&gt;
For connecting to the firebase, we need to visit the &lt;a href="https://console.firebase.google.com/u/0/" rel="noopener noreferrer"&gt;following&lt;/a&gt; website. Then click on Add project, provide a name to the project and continue. Now it will create a project for you. (You can refer to &lt;a href="https://firebase.google.com/docs/web/setup?authuser=0" rel="noopener noreferrer"&gt;this&lt;/a&gt;.)&lt;/p&gt;

&lt;p&gt;You will get the option of selecting between the Realtime Database and the Cloud Firestore. In this tutorial, we will make use of the Real-time database. Click on the build from the left menu and chose Realtime database and set up the database.&lt;/p&gt;

&lt;p&gt;Chose Project overview from the left menu and chose web app, create one, and copy the firebaseConfig value and paste that into the js file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var firebaseConfig = {
    apiKey: "AIzaSyBZS2UBi3VNk8uLZ9mdJfE6KRiZjcmxZiQ",
    authDomain: "contact-form-2475b.firebaseapp.com",
    databaseURL: "https://contact-form-2475b-default-rtdb.firebaseio.com",
    projectId: "contact-form-2475b",
    storageBucket: "contact-form-2475b.appspot.com",
    messagingSenderId: "9283608547",
    appId: "1:9283608547:web:51d2956027f8b49bdd4ad6",
    measurementId: "G-5C2FQ0LQ74",
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
//Reference messages collection
let messagesRef = firebase.database().ref("messages");

//function to get form values
function getInputVal(id) {
    return document.getElementById(id).value;
}

//save message to firebase
function saveMessage(fname, sname, email, message) {
    let newMessageRef = messagesRef.push();
    newMessageRef.set({
        fname: fname,
        sname: sname,
        email: email,
        message: message,
    });
}


function submitForm(e) {
    e.preventDefault();

    // get Values
    let fname = getInputVal("fname");
    let sname = getInputVal("sname");
    let email = getInputVal("email");
    //   let phone = getInputVal("phone");
    let message = getInputVal("message");

    //save message

    saveMessage(fname, sname, email, message);
    window.alert("You have successfully sent your message")
        //clear form
    document.getElementById("form_contact").reset();

}

//listen to form
document.getElementById("form_contact").addEventListener("submit", submitForm);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Be careful that all files are in the same folder, or You can change the path of the files.&lt;br&gt;
&lt;a href="https://media.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%2Fz4xzagupkdzl59dxyff3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fz4xzagupkdzl59dxyff3.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note: If you discover your data is not sent to your database, check your console. If you see any error saying permission denied, then you have to go back to your settings in firebase. Click on the database section in your sidebar, in there you will see Rules. Once you click on Rules, set the read and write to true:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "rules": {
    ".read": true,
    ".write": true
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also visit my &lt;a href="https://github.com/spm999" rel="noopener noreferrer"&gt;github&lt;/a&gt; profile.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>firebase</category>
      <category>tutorial</category>
      <category>html</category>
    </item>
  </channel>
</rss>
