teleren/devto huggingface dataset:
100 Days of Code: The Complete Python Pro Bootcamp for 2022 - Day 2 (Tip Calculator)
Published: 2023-04-02 08:35:55

Exercise 1 Data Types
```python
#🚨 Don't change the code below 👇
two_digit_number = input("Type a two digit number: ")
#🚨 Don't change the code above 👆

####################################
#Write your code below this line 👇
first_digit = two_digit_number[0]
second_digit = two_digit_number[1]
int_first_digit = int(first_digit)
int_second_digit = int(second_digit)
result = int_first_digit + int_second_digit
print(result)
```
Exercise 2 BMI Calculator
```python
#🚨 Don't change the code below 👇
height = input("enter your height in m: ")
weight = input("enter your weight in kg: ")
#🚨 Don't change the code above 👆

#Write your code below this line 👇
bmi = int(weight) / float(height) **2
bmi_int = int(bmi)
print(bmi_int)
```
Exercise 3 Life in Weeks
```python
#🚨 Don't change the code below 👇
age = input("What is your current age?")
#🚨 Don't change the code above 👆

#Write your code below this line 👇
days = 90 * 365 - int(age) * 365
weeks = 90 * 52 - int(age) * 52
months = 90 * 12 - int(age) * 12

print(f"You have {days} days, {weeks} weeks, and {months} months left.")
```
Project 2 Tip Calculator
```python
#If the bill was $150.00, split between 5 people, with 12% tip. 
#Each person should pay (150.00 / 5) * 1.12 = 33.6
#Format the result to 2 decimal places = 33.60

#Tip: There are 2 ways to round a number. You might have to do #some Googling to solve this.💪

#Write your code below this line 👇
print("Welcome to the tip calculator")
bill = int(input("How much is your bill? $ "))
tip = int(input("How much tip do you want to leave? 10, 12 or 15 percent? "))
people = int(input("How many people will split the bill? "))
bill_with_tip = tip / 100 * bill + bill
split = (bill_with_tip / people)

#Note - The round function did not produce the result asked so had #to change it the below. Thank you google lol

total_bill_split = "{:.2f}".format(split)
print(f"Each person should pay ${total_bill_split} ")
```
100 Days of Code: The Complete Python Pro Bootcamp for 2022 - Day 1 (Band Name Generator)
Published: 2023-04-02 08:31:49

Exercise 1 - Printing

```python
#Write your code below this line 👇
print("Day 1 - Python Print Function") 
print("The function is declared like this:")
print("print('what to print')") 
```
Exercise 2 - Debugging Practice

```python
#Fix the code below 👇
print("Day 1 - String Manipulation") 
print('String Concatenation is done with the "+" sign.')
print('e.g. print("Hello " + "world")')
print("New lines can be created with a backslash and n.")
```
Exercise 3 - Input Function
```python
#Write your code below this line 👇
print(len(input("What is your name?")))
```
Exercise 4 - Variables
```python
#🚨 Don't change the code below 👇
a = input("a: ")
b = input("b: ")
#🚨 Don't change the code above 👆

####################################
#Write your code below this line 👇

a,b = b,a

#Write your code above this line 👆
####################################

#🚨 Don't change the code below 👇
print("a: " + a)
print("b: " + b)
```
Project 1 - Band name generator
```python
#1. Create a greeting for your program.
print("Welcome to the Band Name Generator \n")
#2. Ask the user for the city that they grew up in.
city = input("Whats the name of the city where you grew up? \n ")
#3. Ask the user for the name of a pet.
pet_name = input("Name of pet? \n ")
#4. Combine the name of their city and pet and show them their #band name.
print("Your band name could be " + city + " " + pet_name +"")
#5. Make sure the input cursor shows on a new line, see the #example at:
#https://replit.com/@appbrewery/band-name-generator-end
```
Trying to fix things...
Tags: osdc
Published: 2023-04-02 07:58:53

I checked several projects on PyDigger to fix missing tags.
These included:
1. 
[GitCola](https://pydigger.com/pypi/git-cola) which is missing the author name, but when checked the pyproject.toml file, there is a name tag as follows:
authors = [
    {name = "David Aguilar", email = "davvid@gmail.com"}
]
I opened an issue in PyDigger.

2. 
[torek](https://github.com/huntflow/tortik) is missing the pyproject.toml file so I added it to the project and opened a new PR.

3.
[python-timeout](https://github.com/xjxckk/python-timeout) is also missing the pyproject.toml file so I added it to the project and opened a new PR. There author has no email address...

4.
[django-markdownx](https://github.com/neutronX/django-markdownx) is missing the pyproject.toml file. I PR for the new file.

5.
[rfin_scraper](samueltanner/rfin_scraper) was also missing the pyproject.toml file so I created it.

Cheers everyone and happy holidays.

Freddy
Open Source Made Easy: A Step-by-Step Guide to Contributing to Your First Project
Tags: opensource, github, beginners, tutorial
Published: 2023-04-02 07:55:58

Just recently I made my first open-source contribution to a project and it's not as scary or advanced as many taught including me too

So I decided why not make an article about it to help others know and understand it too as I did while removing all the ambiguity attached to it 

1.
First, find an open-source project that you're interested in contributing to. You can use websites like GitHub to search for open-source projects, or you can search for projects related to a specific language or technology.

2.
Once you've found a project you're interested in, read the project's documentation to understand its goals, roadmap, and how to contribute. Most open-source projects have a CONTRIBUTING.md file that provides guidelines for contributing.

3.
Next, find an issue that you'd like to work on. You can search for issues that are labelled "good first issue" or "help wanted" if you're new to the project, and the best thing is it doesn't even have to be code, you can start contributing to the project documentation. Eg if to find a typo or an omission you can work on that. 

4.
Before you start working on an issue, it's important to communicate with the project maintainers. They can provide guidance and answer any questions you have. You can use the project's communication channels, such as discord, slack, or any medium the project uses for communication.

5.
Once you've communicated with the maintainers and chosen an issue to work on, fork the project's repository to your own GitHub account. This creates a copy of the project that you can work on without affecting the original codebase.

6.
Make your changes to the codebase, but before doing that make sure you created a new branch for the task you want to work on so this way you can still have the original code in the master before pushing, your changes should be made following the project's code style and guidelines. Write tests for your code if the project has a test suite 

7.
Once you've made your changes, commit them to your forked repository and create a pull request. In the pull request, explain what changes you've made and why they're important. Be sure to reference the issue you're addressing in the pull request.

8.
The project maintainers will review your pull request and provide feedback. You may need to make additional changes to your code based on their feedback.

9.
Once your pull request is accepted and merged into the project's codebase, congratulations! You've contributed to an open-source project.

10.
Remember to stay engaged with the project's community. Follow the project on GitHub, participate in discussions, and continue to contribute to the project. This will help you build your skills, network with other developers, and make a positive impact on the open-source community.

That's it! Good luck with your open-source contributions!🤓

If you like this and want more content like this please do well to follow me and turn on the notification for more.
WordPress pagespeed Optimization
Published: 2023-04-02 07:38:15

WordPress has become one of the most popular content management systems (CMS) in the world. With its intuitive interface, a vast array of customization options, and a user-friendly platform, it has become the go-to option for many individuals and businesses.

However, one of the issues that many WordPress users face is the optimization of their website's page speed. In today's digital age, users expect websites to load quickly, and a slow website can lead to a high bounce rate, lower conversion rates, and a poor user experience.

Fortunately, there are several ways to optimize your WordPress website's page speed, and in this article, we'll explore some of the key tips to help you do just that.

Choose a quality hosting provider
Your hosting provider can have a significant impact on your website's page speed. A low-quality hosting provider may have slow servers or limited resources, which can cause your website to load slowly. On the other hand, a quality hosting provider with fast servers and ample resources can help improve your website's page speed.

Use a lightweight theme
WordPress themes come in all shapes and sizes, but some are much more lightweight than others. A lightweight theme can help reduce the number of HTTP requests and improve your website's overall performance.

Optimize your images
Images can significantly impact your website's page speed, especially if they are not optimized. Be sure to compress your images to reduce their file size without compromising their quality. Additionally, you can use lazy loading to defer the loading of images until the user scrolls down to them.

Minimize HTTP requests
The more HTTP requests your website has, the longer it will take to load. Minimizing HTTP requests can significantly improve your website's page speed. You can do this by reducing the number of plugins you use, combining multiple style sheets into one, and reducing the number of external scripts you use.

Use a caching plugin
A caching plugin can help reduce the load on your website's server by storing static versions of your pages. This means that when a user visits your website, they will see a cached version of the page, rather than the entire page being generated from scratch. This can significantly improve your website's page speed.

In conclusion, optimizing your WordPress website's page speed is crucial for providing your users with a positive experience, improving your website's search engine rankings, and ultimately increasing your website's conversion rates. By following these tips, you can help ensure that your website loads quickly and efficiently, providing your users with the best possible experience. If you need any assistance with [Wordpress Pagespeed optimization](https://gutenberglab.com/wordpress-pagespeed-optimization/), get in touch with us support@gutenberglab.com
Twitter publie son code source
Tags: twitter, code
Published: 2023-04-02 07:19:19

Elon Musk avait promis de rendre public le code de son algorithme de recommandation de tweets. 
Donc le code a finalement été publié sur un site appellé Github - un site fait pour hébergé du code.

Chaque fois que l'écran d'accueil est rafraîchi, Twitter sélectionne les meilleurs 1 500 tweets parmi des millions, la source principale étant les "Sources en réseau" (utilisateurs suivis).

Les meilleurs tweets sont classés en fonction de la probabilité de l'engagement d'un utilisateur avec l'auteur. Le code a soulevé de nombreuses questions, de nombreuses personnes soulignant que l'entreprise suit l'engagement des tweets avec des types spécifiques d'auteurs tels que l’affiliation politique comme les démocrates et les républicains.


La publication du code de l'algorithme de Twitter coïncide avec les projets de l'entreprise de décertifier les "utilisateurs vérifiés hérités" et d'introduire de nouveaux plans de paiement pour cette même certification.
How to Deploy NestJS app to AWS
Published: 2023-04-02 07:15:08

**1. First setup Nginx on Ubuntu**

[Install Nginx in Ubuntu 20.04](https://dev.to/anand_h_parmar/install-nginx-in-ubuntu-2004-5ff7)

**2. Install Node in Server**

- First install Node Version Manager 
```
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
```
- Check Node Version Manager version

```
nvm --version
```

- Install Node ( This will install latest version of node & npm )

```
nvm install node
```

- Check Node & npm version

```
node -v
npm -v
```

- If you want specific version of Node then only run this command

```
nvm install 17.9.1

node -v
v17.9.1

npm -v
8.11.0
```

**3. Setup NestJS**

- Install package nestjs/cli in global
```
npm i -g @nestjs/cli
```

- Create NestJS app
```
cd /var/
sudo mkdir nest-project
sudo chmod -R 777 nest-project
cd nest-project
nest new .
```


**4. Configure NGINX Reverse Proxy**

- Default NestJS app is running on 3000 port so we have to setup reverse proxy that port to 80 port 

```
sudo nano /etc/nginx/sites-enabled/default
```

- Update default file of nginx

```
server {
        listen 80 default_server;
        listen [::]:80 default_server;

        # SSL configuration
        #
        # listen 443 ssl default_server;
        # listen [::]:443 ssl default_server;

        root /var/www/html;

        # Add index.php to the list if you are using PHP
        index index.html index.htm index.nginx-debian.html;

        server_name _;

        #Reverse proxy for accessing Nest app
        location / {
                proxy_pass http://127.0.0.1:3000;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
        }

}
```

- Restart nginx for reflecting changes
```
sudo systemctl restart nginx
```

**4. Configure PM2**

- Build the NestJS app
```
cd /var/nest-project
npm run build
```
- Install pm2 in global

```
npm install pm2 -g
```

- Start PM2 app

```
pm2 start npm --name "app" -- start

```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z99ayxh3j3theul54f50.png)
Open-Source or Proprietary Software?
Tags: discuss, beginners, codenewbie
Published: 2023-04-02 07:00:00

The debate between open-source and proprietary software has been ongoing for years. Open-source advocates maintain that it promotes collaboration, transparency, and innovation, while proprietary software proponents argue that it provides better security, control, and support.

What do you think? Do you prefer open-source or proprietary software, and why? Share your thoughts in the comments below!
Master the Art of Negotiation: 10 Practical Tips to Achieving Success
Tags: productivity, career, beginners, tutorial
Published: 2023-04-02 06:58:49

**Negotiation** is a vital skill in both personal and professional contexts. Whether you're trying to close a business deal or decide who's doing the dishes at home, negotiating effectively can help you achieve your goals and build stronger relationships. Here are 10 practical tips to help you master the art of negotiation:

**1. Know your goals and limits**: Before you begin negotiating, determine your goals and the boundaries of what you're willing to accept. Consider what outcomes you'd be happy with, and what would be deal-breakers.

**2. Do your research**: Knowledge is power in negotiation. Research the topic or item being negotiated, as well as the other party's position and potential motivations. This information can help you make informed decisions and present a stronger case.

**3. Build rapport**: Establishing a positive relationship with the other party can make negotiations smoother and more productive. Take the time to listen and understand their perspective, and try to find common ground.

**4. Communicate clearly**: Effective communication is crucial in negotiation. Be clear and concise in your language, and avoid using jargon or technical terms that could confuse the other party.

**5. Listen actively**: Active listening means giving the other party your full attention, without interrupting or judging. This can help you understand their needs and motivations, and find solutions that benefit both parties.

**6. Use the power of silence**: Silence can be a powerful negotiating tool. When you're presented with an offer or counteroffer, take a moment to consider it before responding. This can make the other party feel uneasy and potentially lead to a more favorable outcome.

**7. Find creative solutions**: Negotiation is often about finding a compromise or solution that benefits both parties. Be open to new ideas and approaches, and consider alternative options that could satisfy both sides.

**8. Stay calm and patient**: Negotiation can be stressful, but it's important to stay calm and patient throughout the process. Avoid becoming emotional or aggressive, as this can damage the relationship and hinder progress.

**9. Know when to walk away**: Sometimes, negotiation simply isn't possible. If the other party is unwilling to compromise or you feel that the terms are unacceptable, be prepared to walk away.

**10. Follow up and follow through**: Once a deal is reached, it's important to follow through on your commitments. This can help build trust and strengthen the relationship for future negotiations.

By implementing these practical tips, you can improve your negotiating skills and achieve greater success in both personal and professional contexts.
Netflix UI Clone
Tags: beginners, webdev, programming, netflix
Published: 2023-04-02 06:39:56

Creating a Netflix clone UI using HTML and CSS can be a challenging task, but it can also be a great way to practice your web development skills.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ti6p380117hzs6w3o8a0.png)

Source will be available on : https://github.com/erajamanickam/netflix-ui-clone

Live demo : https://netflix-ui-clone-css.vercel.app/

Watch on video : https://youtu.be/Bfsqmwq_1Uw

Codepen : https://codepen.io/erajamanickam/pen/OJoervB
Gridfy available on App Store
Tags: swift, appstore, macos, devops
Published: 2023-04-02 06:25:08


![gridfy preview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i0vdfrgsvxv8c6fl0qgd.png)
Build the perfect layout for your site or application. Calculate column widths quickly and get correct results. Gridfy is tailored for you - a creative and ambitious professional.

Features:
- Calculating column and page widths
- Error notification
- Two result modes
- Dark and light mode
- Smooth animation
- Works offline
- Optimised for Macs with Apple Silicon (M1, M2)
- Works great on macOS 13 Ventura

[Link to download](https://apps.apple.com/us/app/gridfy/id1671263220)
ModuleNotFoundError: No module named 'termcolor' in Python
Tags: python, abotwrotethis
Published: 2023-04-02 06:12:02

If you are trying to import the 'termcolor' module in Python and you are seeing the error message "ModuleNotFoundError: No module named 'termcolor'", do not worry. This is a common error message among developers, and it usually occurs when you do not have the 'termcolor' module installed on your system.

This error message can be frustrating, especially if you are trying to run a program that heavily relies on this module. In this post, we will walk you through the steps you can take to resolve this error and successfully import the 'termcolor' module.

## Step 1: Check if the 'termcolor' Module is Installed

Before you start troubleshooting the error, you should check if the 'termcolor' module is installed on your system. To do this, you can use the following command in the terminal:

```python
pip list
```

This command lists all the installed packages on your system. You can search for 'termcolor' on the list to confirm if it is installed. If it is not installed, move to the next step.

## Step 2: Install the 'termcolor' Module

To install the 'termcolor' module, you can use the pip package manager by running the following command in the terminal:

```python
pip install termcolor
```

This command will download and install the 'termcolor' module on your system. Once the installation is complete, you should be able to import the module without seeing the error message.

## Step 3: Verify the Installation

It is essential to confirm that the 'termcolor' module has been installed correctly. To do this, you can try importing the module in a Python interpreter or the command line using the following code:

```python
import termcolor
```

If you do not see an error message, it means that the module has been installed correctly, and you can proceed to use it in your program.

## Conclusion

The 'ModuleNotFoundError: No module named 'termcolor' in Python' error can be resolved easily by following the steps outlined above. By installing the 'termcolor' module, you will be able to import it into your program and use its functionality. Remember to always verify the installation to avoid any errors that might arise later.

We hope this post has been helpful to you. If you have any questions or comments, please feel free to reach out to us. Thank you for reading!
Gradient Text CSS
Tags: css, text, webdev
Published: 2023-04-02 05:57:17

```
.gradient-text {
   background-image: linear-gradient(to right, #833ab4, #fd1d1d,#fcb045);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
```

{% codepen https://codepen.io/inegoita/pen/dyqBzPv %}

In the above example, we apply the `linear-gradient()` function to the `background-image` property, and then set the `background-clip` property to text and the text-fill-color property to transparent. This tells the browser to apply the gradient to the text itself, and make the text color transparent so that the gradient shows through.

You can actually create gradient text in HTML in several other ways. 

Check out the full article about [gradient text](https://www.coding-dude.com/wp/css/gradient-text/)
[c++] using opencv on windows with clion
Published: 2023-04-02 05:51:44

1. download windows version {% embed https://opencv.org/ %}
1. cd new build folder
3. run cmake `cmake -G "MinGW Makefiles" -S <source>`
4. build opencv `mingw32-make -j8`
5. install opencv `mingw32-make install`
6. update cmakelists 

```
# include opencv library
set(OpenCV_DIR "C:/Program Files (x86)/opencv/mingw_build/install")
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})

target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})
```

7, edit configuration, add environment variables:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7osjy5ak68h1mxdbrubj.png)

if not work, add the path in #7 to system environment path