teleren/devto huggingface dataset:
data science and its relation to python
Published: 2023-02-19 20:47:57

Python is one of the most popular programming languages used in data science due powerful models. Python is also great for visualizing data, creating prediction models, and exploring various machine learning algorithms. Python is useful in various fields that generate data that is should be processed so that the coder and the reader is able to make meaningful information out of the data.
Data that has no meaning is just words and thus the coder/ data scientist should strive to ensure that they are able to use the data generate data that has meaning. Python is a very important tool as it enable to data scientist to change the data size or volume while maintaining the data core meaning and thus making it easy for the data scientist to maintain the integrity of the data.
Python is a powerful and versatile programming language that can be used for a wide range of research projects. Its flexibility, thus making it ideal for analyzing large datasets, manipulating complex data structures and performing statistical operations. Furthermore, Python is great for creating predictive models, building machine learning applications, and visualizing data with various charting libraries. 
In business, python is an invaluable tool because it is a versatile and powerful language that can help to automate tedious tasks, streamline processes, and create innovative solutions. It is ideal for data analysis, building machine learning models, and generating insights from big data. Additionally, Python is great for creating web applications, automating workflows with scripts, and for providing data-driven solutions for business problems. Overall, Python is an important tool in the business world, and its importance only continues to grow.
to its flexibility, readability and the ability to manipulate large amount of data. It offers a range of tools and libraries that make it easy to work with data and create
I made mini Twitter and migrated it from Heroku to Linode ️🐦 ️🐧
Tags: linodehackathon, cloud, python, tutorial
Published: 2023-02-19 20:47:37

## What I built
Byteblog, a byte sized blogging platform.
I migrated it from Heroku to Linode.

### Category Submission:
Smooth Shifters

### App Link
[Live on Linode](http://172.105.38.52/)

### Description
Byteblog is a minimalist micro-blogging platform built with Pyhton Flask for anyone seeking a quieter "Social Media".

A user can easily register for Byteblog with their email id and password and then can easily share their bytes (similar to tweets in twitter) and also follow other people to read their thoughts, users can also message other users who follow them.

### Link to Source Code

{% embed https://github.com/2KAbhishek/Byteblog %}

### Permissive License
[LICENCE](https://github.com/2KAbhishek/Byteblog/blob/main/LICENSE)

## Background
I had built Byteblog earlier and had deployed it on Heroku, but there were some platform issues there and after Heroku shut down their free tier I had to shut it down.

I wanted to try out Linode for a long time but never had the opportunity, seeing this opening with Dev hackathon I finally decided to take the plunge and play with Linode.


### How I built it
I assumed that working with Linode will be very complicated, since it gives you all controls to the server, that actually turned out to be one of the pros.

It was so easy to go and edit any configs I wanted and have the changes reflect instantly.

I was able to setup the application within minutes, the web console provided by Linode was also very easy to use.

Some of the pros:
- Setup ssh keys and passwords during login, with a easy to use UI
- Easily accessible controls and settings
- Super fast network connection
- Full visibility on pricing
- Really good docs for all the steps
- Ready to use marketplace apps

There are still things I'd like to explore like the `LISH` and maybe try out more containers with other images.

I also want to setup a remote dev box with Arch and my [Dotfiles](﻿https://github.com/2KAbhishek/Dotfiles).

### Additional Resources/Info
I found this article useful while setting up the migration
- [Deploying a Flask Application on Ubuntu](https://www.linode.com/docs/guides/flask-and-gunicorn-on-ubuntu/)
INTRODUCTION TO PYTHON FOR DATA SCIENCE
Published: 2023-02-19 20:38:32

```
Python has grown to be one of the most famous programming languages for data science, This is because it's easy to use, flexible, and has variety of libraries and tools reachable for it.
In this article, an introduction to Python for Data science, covering the fundamentals of the language, its Data science libraries, and some of the key concepts and techniques used in Data science.
```
**PYTHON BASICS**

Python is a high-level, interpreted programming language. It is a general-purpose language that can be used for a wide variety of tasks, including web development, machine learning, and scientific computing. One of the key advantages of Python is its simplicity and ease of use, making it an ideal language for beginners. 

**BASIC CONCEPTS AND SYNTAX USED IN PYTHON**

_Variables_: In Python, variables are used to store data. Variables can be assigned values using the equals sign (=).

_Data Types_: Python supports a number of data types, including integers, floats, strings, and booleans.

_Operators_: Python supports a variety of operators, including arithmetic operators (+, -, *, /), comparison operators (>, <, ==), and logical operators (and, or, not).

_Control Structures_: Python provides several control structures, including if/else statements, loops, and functions.

**DATA SCIENCE LIBRARIES**

Python's popularity in data science is largely due to its powerful and extensive libraries for data analysis, manipulation, and visualization. Here are some of the most commonly used data science libraries in Python:

_NumPy_: NumPy is a library for working with arrays of data. It provides fast and efficient operations on arrays, as well as linear algebra functions and random number generators.

_Pandas_: Pandas is a library for data manipulation and analysis. It provides data structures such as dataframes and series, and functions for data cleaning, merging, and grouping.

_Matplotlib_: Matplotlib is a library for data visualization. It provides a variety of plot types and customization options for creating publication-quality plots.

_Scikit_-learn: Scikit-learn is a library for machine learning. It provides a variety of algorithms for classification, regression, clustering, and dimensionality reduction.

**KEY CONCEPTS IN DATA SCIENCE**

Data science involves a variety of techniques for working with data, from cleaning and preprocessing to modeling and visualization. Here are some of the key concepts and techniques used in data science:

_Exploratory Data Analysis (EDA)_: EDA is the process of exploring and visualizing data to gain insights and identify patterns.

_Data Preprocessing_: Data preprocessing involves cleaning, transforming, and normalizing data to prepare it for analysis.

_Machine Learning_: Machine learning involves training algorithms to make predictions or classify data based on patterns in the data.

_Data Visualization_: Data visualization is the process of creating visual representations of data to help understand patterns and relationships.
Scroll to top on page change React
Tags: react, webdev, javascript
Published: 2023-02-19 20:16:18

If you are using React Router Dom for navigation and routing in your React app then you will notice that if you have a long content page and then you navigate to another long content page, you will stay scrolled down. This doesn't tell of a good user experience and as such you'll want the new page to be displayed from the top.
This short piece would show you how to complete that would having to add the same piece of code to every component or pages rendered in your react app. To accomplish this, we will make use of the `useEffect` hook and the `useLocation` hooks to achieve this.

**_NB: This article assumes you are already familiar with React-Router and you have already installed it in your react application._**

First, you'll create a new wrapper component that handles the scroll restoration when you open a new page. For my 

```
// src/components/ScrollToTop.jsx
import { useEffect } from "react";
import { useLocation } from "react-router-dom";

const ScrollToTop = (props) => {
    const location = useLocation();
    useEffect(() => {
      window.scrollTo({top: 0, left: 0, behavior: 'smooth' });
    }, [location]);
  
    return <>
        {props.children}
    </>
  };

export default ScrollToTop;
```

Next, import this wrapper component in your `App.js` and add it as a wrapper component within your Router as shown below.

```
//App.js
import {
  BrowserRouter as Router,
  Routes,
  Route
} from 'react-router-dom';

const App = () => {
  return (
    <Router>
      <ScrollToTop>
        <Routes>
          {* All your other imported components *}
        </Routes>
      </ScrollToTop>
    </Router>
  );
};

export default App;
```

Notice that the `ScrollToTop` component wraps the `Routes` component but stays inside the `Router` component. This order is important and must be followed to achieve the desired result.

Thanks for reading and don't forget to drop a like if this article helped you.
6 Tips for Writing Cleaner and More Maintainable JavaScript Code
Tags: tips, javascript, beginners, programming
Published: 2023-02-19 19:46:26

# 6 Tips for Writing Cleaner and More Maintainable JavaScript Code

As JavaScript continues to grow in popularity, it's becoming increasingly important to write clean and maintainable code. Writing clean code not only makes it easier to read and understand but also reduces the risk of introducing bugs and makes it easier to maintain and update code in the future. In this post, we'll cover 6 tips for writing cleaner and more maintainable JavaScript code.

## 1. Use Meaningful Variable Names

Using meaningful variable names is essential to writing clean and maintainable code. It helps to make the code more readable and self-documenting. When choosing variable names, it's important to use names that accurately describe the purpose of the variable.

```
// Bad example
const x = 10;
const y = 20;
const z = x + y;

// Good example
const width = 10;
const height = 20;
const area = width * height;
```

## 2.Use Constants for Values That Don't Change

When a value won't change throughout the life of a program, it's best to use a constant instead of a variable. This helps to make the code more readable and ensures that the value doesn't 
accidentally get changed later in the program.

```
// Bad example
let pi = 3.14159;
pi = 3.14;

// Good example
const PI = 3.14159;
```

## 3. Avoid Magic Numbers

Magic numbers are hard-coded values that have no explanation or context. They make the code difficult to read and understand. Instead of using magic numbers, use constants with descriptive names.

```
// Bad example
function calculateArea(radius) {
  return Math.PI * radius * radius;
}

// Good example
const PI = 3.14159;
function calculateArea(radius) {
  return PI * radius * radius;
}
```

## 4. Use Functions to Reduce Code Duplication

Code duplication can make code harder to maintain and update. Instead of duplicating code, create functions that can be reused throughout the program.

```
// Bad example
const width = 10;
const height = 20;
const area = width * height;
const perimeter = 2 * (width + height);

// Good example

function rectangleArea(width, height) {
  return width * height;
}

function rectanglePerimeter(width, height) {
  return 2 * (width + height);
}

const width = 10;
const height = 20;
const area = rectangleArea(width, height);
const perimeter = rectanglePerimeter(width, height);
```

## 5. Use Arrow Functions for Concise Code

Arrow functions provide a more concise syntax for defining functions. They also help to reduce the amount of code that needs to be written.

```
// Bad example
const add = function(x, y) {
  return x + y;
}

// Good example
const add = (x, y) => x + y;
```

## 6. Use Template Literals for String Concatenation

Template literals provide a more concise and readable way to concatenate strings.

```
// Bad example
const firstName = 'John';
const lastName = 'Doe';
const fullName = firstName + ' ' + lastName;

// Good example
const firstName = 'John';
const lastName = 'Doe';
const fullName = `${firstName} ${lastName}`;
```
How to choose a Coding Language
Tags: career, webdev, programming, beginners
Published: 2023-02-19 19:36:41

Choosing a coding language doesn't have to be difficult - there are so many great options out there! Depending on what you're trying to do, there's likely a language that will fit your needs. To start, take into account your experience level and the type of application you're building, as well as the platforms you're targeting.

If you're just starting out, Python or JavaScript are great beginner languages with lots of features and libraries to help you get going. To create web applications, you'll need HTML (for structuring content), CSS (for styling) and JavaScript (for interactivity). And for mobile applications, you'll want Java (for Android), Swift (for iOS) or JavaScript (for both).

Python is a popular, versatile and easy to learn language. It's used for data science, web development, software engineering and artificial intelligence, and is supported by robust libraries and frameworks. Plus, there's an open-source community of developers who are always willing to offer helpful support and resources.

When picking a language, make sure to consider the libraries and frameworks available - they can make your job a lot easier and save you a lot of time.

At the end of the day, the best language for you is the one that best fits your application and experience level. Explore your options and evaluate carefully before making your decision!

---

**_NOTE:_** If you found this helpful. Like and share. Thanks, Happy Learning!

### Let's connect 💜

You can follow me on [Twitter](https://twitter.com/MrDanishSaleem), [Instagram](https://www.instagram.com/mrdanishsaleem/), [LinkedIn](https://www.linkedin.com/in/mrdanishsaleem/) & [GitHub](https://github.com/mrdanishsaleem/)

### Support Me

If you like this post. Kindly support me by [Buying Me a Coffee](https://www.buymeacoffee.com/mrdanishsaleem)
AWS SES - Core Concepts
Tags: aws, amazonses, email, ses
Published: 2023-02-19 19:32:04

Hello, everyone!

In this blog post, I'm going to give you a rundown of the core concepts you need to know about **Amazon Web Services Simple Email Service (AWS SES)**. **AWS SES** is a cloud-based email service that allows you to send and receive email using your own email addresses and domains. Let's dive into the key concepts.

## Verified Senders

Before you can start sending email with AWS SES, you need to verify your email addresses and domains. This involves proving that you own the email address or domain you want to use. Once you've verified your email address or domain, you'll be able to send email from that address or domain using AWS SES.

## Email Sending Limits

AWS SES has limits on how much email you can send. These limits are in place to ensure the service remains reliable and available for all users. There are two types of limits you need to be aware of:

**Sending Limits**: The maximum number of emails you can send per 24-hour period.
**Sending Rate Limits**: The maximum number of emails you can send per second.
It's important to monitor your usage and stay within these limits to avoid any interruptions in your email service.

## Email Receiving

In addition to sending email, AWS SES also allows you to receive email. When you receive an email, AWS SES can store the email in an Amazon S3 bucket or deliver the email to an Amazon SNS topic. You can also configure AWS Lambda to process incoming emails.

## Bounce and Complaint Handling

When you send email using AWS SES, there's a chance that some of your emails may bounce or be marked as spam by the recipient. AWS SES provides mechanisms for handling these bounces and complaints. You can configure AWS SES to send bounce and complaint notifications to an Amazon SNS topic or an email address of your choice.

## DKIM and SPF Authentication

To ensure your emails aren't marked as spam, it's important to configure DomainKeys Identified Mail (DKIM) and Sender Policy Framework (SPF) authentication. DKIM and SPF help verify that the email is coming from a trusted source and can help improve deliverability.

## Reputation Management

Maintaining a good reputation is critical when it comes to email deliverability. AWS SES provides tools for managing your email reputation, such as the ability to view your sending statistics and feedback loops. You can use this information to identify any issues and improve your email deliverability.

That's a brief overview of the core concepts of AWS SES. I hope this post has been helpful in getting you started with AWS SES. If you have any questions or comments, feel free to leave them below. And as always, happy coding!
Second Next.js website
Tags: nextjs, webdev, react, javascript
Published: 2023-02-19 19:13:29

In the past two days, I have been following the *official next.js tutorial* to build a simple blogging website.

Although Next.js is much harder than Flask, I love how I can do so much with Next.js and React, and how easy it is to deploy projects from GitHub to Vercel, so this is persuading me to create even more projects with Next.js.

Check out the blogging website I created here: https://blogging-website-vert.vercel.app/

You can also check out it's GitHub repo:
{% embed https://github.com/VulcanWM/blogging-website %}

My next project is to create a Guestbook where people can comment (the comments are saved using MongoDB). I also want it to use an API to check if the comment has swearing or not,  and only let the user comment once on one device.
I also want to expand my React knowledge and load 5 comments at once, and when the user scrolls to the bottom, it loads 5 more (infinite load).

---

Thanks for reading!
Follow me and like to support me in my next.js journey.
JavaScript Tutorial Series: Practice 1
Published: 2023-02-19 18:50:39

In this post we're going to use everything we learned  by solving exercises. I will not provide the solution to the exercises simply because they can be found online. Do keep in mind that, copying and pasting will not be in your favor simply because it won't be beneficial to you. 

Try on your own first, and keep trying, do not look the solutions up unless you've spend some time on these exercises. 
If you feel stuck you can use the previous lessons.

## Exercise 1 
Write a function that returns the largest number between three that you will provide when calling it. Print the answer in the console.

## Exercise 2
Write a function that returns the third character in a string. print this character to the console.

## Exercise 3
Without using the console, what is the output of these? 

- let numbers = [3, 5, 8, 9, 12, 67];
let newArr = numbers.slice(1, 4);

```JavaScript
function myFunc() {
  let a = 7;
  console.log(a);
}
console.log(a);

```

- write a function that returns the length of a string you will pass as argument and print it in the console.

- write a program that joins two string in two different ways. 

- Write a function that returns the string with the largest length. and print it to the console.

These exercises are very easy! good luck!
Success story of Nykaa using AWS
Published: 2023-02-19 18:26:58

Nykaa Founded in 2012, Nykaa is a premier online beauty store in India selling fashion products to more than half a million customers across 900 cities. The products are 100 percent genuine and authentic, sourced directly from the brands

Nykaa had an extremely complex setup on AWS running 200+ servers.
The entire infrastructure was managed by different development
team members without having any standard deployment processes
or best practices in place. The prevailing infrastructural assets were provisioned, configured and managed manually leading to a lot of delays and was highly error prone. They were looking for an AWS
expert who could help them standardize deployment & monitoring
processes, setup CI/CD pipeline automation for faster integration and deployment along with 24/7 monitoring support.
Compiling a game using the SDK
Tags: gamedev, beginners, playdate, sdk
Published: 2023-02-19 18:25:31

In the last article, I referenced two resources that I planned to use:
- [This video by SquidGod](https://youtu.be/ZPcfC98JogQ)
- [Playdate's official SDK documentation](https://sdk.play.date/1.13.0/Inside%20Playdate.html#_compiling_a_project)

## SquidGod's video
- I downloaded the SDK
- I downloaded the Github repo

But...all these files and instructions are for a Windows PC.

I'm on a Mac.

## `Inside Playdate` document
Section 3.3 is about compiling a game.

It references a tool called `pdc` that is installed with the SDK.

I figured I would try using it in my Terminal to confirm I had it.

A common action in programs is to check the version number:
```
> pdc --version
```

I saw `1.13.0`!

Success: I have and can use the necessary `Playdate Compiler`!

## Compiling and running the Playdate Template game
Per the documentation:
- I need to use `pdc` to generate a `pdx` folder
- I do that by passing two arguments to `pdc`: 1. the source folder of the game's code, 2. a name for the pdx folder

The formula looks like this:
```
$ pdc MyGameSource MyGame.pdx
```

Inside VSCode, from the Terminal pane, I ran this command:
```
$ pdc ./source game.pdx
```

It successfully created the folder.

I opened it with Playdate Simulator.

I saw this:
![Proof of success](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/byu5m9jpqdp7rtei2q7b.png)

## I did it!
- I used the `pdc` command line tool to generate an executable `pdx` file that opened in the Playdate Simulator!
- I understood the official Inside Playdate documentation enough to accomplish my task!
- I'm well on my way to writing Lua code that I can compile into simple, silly Playdate games!
Dev Cheats - Interactive Cheatsheets For Developers
Tags: opensource, contributorswanted, tutorial, showdev
Published: 2023-02-19 18:23:41

Greetings, fellow developers!

I just started working on a community-driven project called Dev Cheats. It is aimed at providing developers of all skill levels with a convenient reference for various command line tools and their usage examples.

![Dev Cheats GIF Preview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ni0suk4obmjcl6akocgo.gif)

Currently only a few cheats are on the database, but if you think you can provide any documentation I would love to receive pull requests!

Please feel free to check out the demo at [dev-cheats.vercel.app](https://dev-cheats.vercel.app/) where you can search for `git` and see the current implementation for Git commands and usage examples. Additionally, the API directs to the documentation page, making it easy to bookmark pages through an URL like [dev-cheats.vercel.app/git](https://dev-cheats.vercel.app/git)

You can find the repository at [github.com/excalith/dev-cheats](https://github.com/excalith/dev-cheats) and have a look at [contributing guideline](https://github.com/excalith/dev-cheats/blob/main/.github/CONTRIBUTING.md).

Cheers!