teleren/devto huggingface dataset:
Day 02 of 100 Days of Code Python Bootcamp by Dr. Angela
Tags: python, programming, beginners, 100daysofcode
Published: 2022-08-02 21:50:51

For the Day 02, I created a Tip calculator that covers data types, mathematical operations and using f string. 



```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

print("Welcome to the tip calculator!")
#Get Total bill
total_bill = float(input("What was the total bill? $"))
#Get how many percentage for the bill
tip = int(input("How much tip would you like to give? 10, 12, or 
15? "))
#Get how many persons to split the bill
bill_split_person = int(input("How many people to split the bill? "))

#Get Percentage of tip for total bill and add the value of tip to 
total bill / each person
calc_bill = round((total_bill * float(tip/100) + total_bill) / 
bill_split_person, 2)
final_bill = "{:.2f}".format(calc_bill)
print(f"Each person should pay: ${final_bill}")

```

Output:


![Day 02 Output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w4murz4v5h3022qw62rg.gif)
Top 7 Featured DEV Posts from the Past Week
Tags: top7
Published: 2022-08-02 21:49:18

---
title: Top 7 Featured DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week
tags: icymi 
cover_image: https://thepracticaldev.s3.amazonaws.com/i/sfwcvweirpf2qka2lg2b.png
---

_Every Tuesday we round up the previous week's top posts based on traffic, engagement, and a hint of editorial curation. The typical week starts on Monday and ends on Sunday, but don't worry, we take into account posts that are published later in the week._ 

## Why Learn Typescript?

@annabaker is learning Typescript and finding it isn’t as hard as one might think. Here is some great inspiration to start learning Typescript yourself.

{% embed https://dev.to/annabaker/why-im-learning-typescript-2gjh %}


## Making Use of Your Old Laptop

Instead of adding to the already mounting electronic waste, @alejandro_du takes an old laptop and transforms it into a new database server using Ubuntu Server, Docker, and a MariaDB database.

{% embed https://dev.to/alejandro_du/your-old-laptop-is-your-new-database-server-4fca %}


## The Ultimate Engineering Tool

That diagrams are ubiquitous is not a coincidence. In this post, @wesen shares the beauty of diagrams and how useful they are across and within all disciplines.

{% embed https://dev.to/wesen/diagrams-are-the-ultimate-engineering-tool-2897 %}


## Automating REST API Security Testing

Most APIs are public-facing and seldom go through a proper security testing cycle. Here, @intesar suggests some free and automated solutions for you to get started automating that process for everyone’s benefit.

{% embed https://dev.to/intesar/how-to-automate-rest-api-security-testing-4lh4 %}


## Setting up a new Git Environment

It’s always important to configure tools to your liking for optimal performance. Here are some steps @snaka always takes to ready a new Git environment.

{% embed https://dev.to/snaka/10-things-i-always-setup-in-git-when-i-prepare-a-new-environment-d99 %}


## Firefox Forgotten?

Firefox’s market share dropping to fourth place across browsers comes at a shock to a lot of people.	 @colabottles speculates on the details of browser usage.

{% embed https://dev.to/colabottles/firefox-and-other-browsers-forgotten-3e91 %}


## Importance of Clean Code

Clean Code has become a bit of a buzzword recently, but it is important, both as a developer and as an executive or CTO in a startup. @chainguns shares some perspective on the importance of clean code in a startup environment.

{% embed https://dev.to/chainguns/the-importance-of-clean-code-in-your-startups-success-ooc %}


_That's it for our weekly Top 7 for this Tuesday! Keep an eye on dev.to this week for daily content and discussions...and be sure to keep an eye on this series in the future. You might just be in it!_
Merge party
Tags: merge, git, mergeparty, programming
Published: 2022-07-21 07:01:10

Have you ever fallen into a situation when you're trying to refactor your project and ended up dumping thousand line of codes all together in one merge/pull request? Then it becomes hard to split them up.
On the other hand, as a reviewer, do you feel frustrated with the overwhelming changes and get procrastinated to even start the review? And for the beginner reviewer who has no idea what most of the code is all about, that's very challenging to even try to understand.

What about a situation when reviewers come with different opinions? That's right because everyone is different and everyone has different background and experiences.There's also time when the owner of the MR/PR would like to present new functionalities or fancy programming concepts in which he/she needs to convince the team that it will not break the project.

Until at this point, this is the reasonable time to introduce merge party concept to the table. I, myself, just learned this when I joined the current company I am working for. I am blessed as everyone is very competent and open to sharing their bit of useful information.

Okay, so what is merge party? Basically, it's just a group of programmers, engineers, developers of your own team, or any stakeholder who is familiar with the project, the concept, programming languages or beginner who would like to learn sit together and go through the code (hopefully not line by line). The owner of the MR/PR presents the changes, explains reasoning, and most importantly how it is work. Experienced people in the team can ask questions for clarification and offer feedback/suggestions. Beginners, of course, could also do the same. 
Merge party comes with the assurance that everyone in the team knows what is going on. Everyone comes out of it with consensus on whether to merge the code or to further adjust something. Most important of all is that we as the MR/PR owners will feel even more safe to merge the code as there are many eyes on it before it will land to main branch.
Additionally, as engineers, we get the chance to improve our presentation skill and also understand what we write even better when explaining to people.
Interviewing The Creator of Homebrew! What Should I Ask Him?!
Tags: discuss, career, opensource, watercooler
Published: 2022-08-02 21:06:28

Hey Dev.to Fam! I'm excited to have the chance to interview long-time friend and mentor, Max Howell, the creator of Homebrew! 

**He's an open-source icon, and a great product thinker. I want to make sure I cover some interesting things. What do you think I should ask? 
**

All are welcome to join us! The link for the live interview is here: 
https://lu.ma/a86n488w


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dxq50i9iikta7byp6xc9.jpeg)
Do you want some FREE illustrations or vectors for your hero image?
Published: 2022-08-02 20:54:55

Here's some great FREE sites to get you started...

## Illustrations 👨‍🎨

## 1 [drawkit.com](drawkit.com/)

## 2 [www.opendoodles.com](https://www.opendoodles.com)

## 3 [freeillustrations.xyz](https://freeillustrations.xyz/)

## 4 [undraw.co](https://undraw.co/)

## 5 [iradesign.io](https://iradesign.io/)

## 6 [patternpad.com](https://patternpad.com/)

![Thank you](https://media0.giphy.com/media/ZfK4cXKJTTay1Ava29/giphy.gif?cid=6c09b952661c92250000cae02666156fcdbce317ec16fbe0&rid=giphy.gif&ct=g)

For more great sites to add to your Bookmarks follow:

[My Twitter](https://twitter.com/lukeecart?t=fVuSXMZuoJ55Rf0ylxHBxg&s=09)
Understanding Python Functions
Tags: beginners, programming, tutorial, python
Published: 2022-08-02 20:37:41

As you progress in Python programming, you will undoubtedly want to use some functions to perform specific programming tasks, so understanding what they are is critical.

In this article, we'll look at these functions, learning what they are and when and how to use them.[To read more](https://oyedeletioluwani.hashnode.dev/understanding-python-functions)
Tonfotos is listed among 11 best Photo Managers by Rafal Reyzer
Tags: news
Published: 2022-08-02 19:17:16

Tonfotos, our application for managing personal photo archive, was featured among other 10 applications in the Rafal Reyzer's blog post [11 Best Photo Managers With Face Recognition Feature](https://rafalreyzer.com/photo-managers-with-face-recognition/). That is a honour for us to see our product in such good company that includes Adobe, ACDSee, Movavi and some other reputable companies. This is definitely a milestone in a growing success of our project.

Big thanks to Rafal Reyzer's blog team, and I hope to have more news like that soon, as our product grows very fast, and adds a lot of innovative features, such as [Telegram Connector](https://dev.to/tonfotos/telegram-nodejs-bot-5e5e) for example.
Common misconceptions about Bitcoin
Published: 2022-08-02 18:42:17

There are a lot of misconceptions and incorrect assumptions being made about Bitcoin.    Every year there are new narratives being created which try to explain why Bitcoin will not succeed. 

It is very likely that these concerns are incorrect.  Here are some curated sources for explanations around these narratives.

https://casebitcoin.com/critiques

https://endthefud.org/
Explaining Precision and Recall
Published: 2022-08-02 18:40:19

In pattern recognition, information retrieval, object detection and classification (machine learning), precision and recall are performance metrics that apply to data retrieved from a collection, corpus or sample space.

Predicted Positive Values - Values predicted to be positive
Real Positive Values - Values that are actually positive


Consider a computer program for recognising dogs (the relevant element) in a digital photograph. Upon processing a picture which contains ten cats and twelve dogs, the program identifies eight dogs. Of the eight elements identified as dogs, only five actually are dogs (true positives), while the other three are cats (false positives). Seven dogs were missed (false negatives), and seven cats were correctly excluded (true negatives). The program's precision is then 5/8 (true positives / Predicted Positive values) while its recall is 5/12 (true positives / Real Positive values). 

Precision and recall can also be referred to as positive predicted value(PPV) and sensitivity(TPR). All of these would be properly explained.

Precision can be referred to as the number of real positive value predicted divided by the total "positively" predicted outcome. It explains how many true positive values out of the total values are predicted to be true.

TP/(TP + FP)

Precision explains how well your model has performed in terms of correctly predicting true value outcomes out of the seemingly true outcomes. The model would happened to have predicted some values to be true when it's clearly not.

That explains why it is called POSITIVE PREDICTED VALUE

Recall on the other hand explains how many True Positive values where predicted out of the total True Positive Values. The True positive outcome divided by the total True Positive Values.

TP/(TP + FN)

Recall further reveals how many True positive values were predicted to be false and it substantially measures how well a model has predicted true positive values from a range of Real Positive values.

Recall is therefore referred to as SENSITIVITY(True Positive Rate)
Solidity: Is a Hidden Variable Possible?
Tags: web3, challenge, programming, discuss
Published: 2022-08-02 18:12:00

Here is a question that has come to my mind: **can we hide some variable in a contract storage?**

Formally, can we somehow make a transaction (or series of transactions) such that in the end, there is an arbitrary value stored at some position `p` of some contract, where the probability of this value being stored at some position `q` is `1 / 2^256` for all `q` (or negligibly less than that for some other `q`)?

Note that we don't care if we know what the value is, we just don't want to show where it is stored within. I also prefer no random oracles in play here.

I actually don't know the answer to this problem! In fact, and **I am here to see your comments!** So come on, let us brainstorm together 🧠🌪️

## My Attempt

My initial idea was to have a storage contract with the following runtime code:

```c
PUSH1 0xFF // our arbitrary value
<some position>
SSTORE
```

If I `delegatecall` this guy after somehow assigning a position, I will have the arbitrary value in my storage.

Then, we have to solve how to feed that position value to this contract without making it be noticed in a transaction.

What I have attempted:
- I tried to see if I can somehow use balance as a position, and try to send ether without showing it. `selfdestruct` is the only way to do this implicitly, but it can be seen under internal transactions.
- Even if we somehow get the balance to our contract, we have to get rid of it in the same transaction so that it can't be seen afterwards, and we can't do that. Even if `selfdestruct` were to work, the storage would get cleaned up too.
- Okay then, maybe I can get the balance of some other address and use it as my position? How do we provide that address without showing though.
- ...

Note that this is just **out of curiosity** and for the sake of challenge. At the time of writing this, I am %99 sure this is not possible at all. Nevertheless, what I can't formally prove I can't be sure about; so here we are.

Other points of interest:
- Can I somehow make use of inline assembly to set `.slot` of a variable to hide it?
- _(might add more here as I edit the post)_
Character Counter
Published: 2022-08-02 17:59:14

[Character Counter](https://invisiblecharacter.net/character-counter/) is a 100percent free online calculator of character counts which is easy to use. Some people prefer simplicity over the writing details Word Counter provides, and that's exactly the feature this program provides. It shows characters count and word count which is typically the only data a person must be aware of about their writing. It is also the best way to will receive all the necessary information quickly.

To determine the word count and character number of your writing, just copy-paste your text into the tool, or type straight into the box. Once you're done, the online tool will show both the word and character counts of the text you've added. This is useful in many cases however it is particularly helpful when writing for something with the requirement of a minimum character or limit.

Limits on words and characters are commonplace in the Internet. The one most people are conscious of is the 140-character limit on tweets on Twitter However, the limits on characters don't just apply to Twitter. There are limitations for texts (SMS) as well as review posts on Yelp, facebook postings Pins on Pinterest, Reddit title and comment as well as eBay descriptions and titles and many more. Being aware of these limits and being aware of them as you get closer to them, will allow you to be more creative in your expression within the limits set by law.

There are typically limitations or minimums on homework assignments. Similar is the case when it comes to college applications. Following these guidelines can be a significant factor in the way that this writing is evaluated and evaluated, and will show how well you're capable of following the basic guidelines. Character counters can help ensure that you don't go over the limits or fall short of the minimum requirements which can harm this assignment.

This data can be very useful for writers. Knowing the word count and characters may aid writers in understanding how long they are work, and help them display the writing in a certain manner. If you write for newspapers or magazines in which space is not plentiful and space, knowing these numbers will assist the writer to squeeze maximum information from the space.

For those looking for jobs it is important to know the amount of characters on your resume could be crucial to fit everything you need to convey on one page. You can experiment with various fonts, dimensions and spacing to alter the amount of characters you can fit onto a single page, but you need to be aware of the number you're trying to fit on the page.

Character Counter isn't just for English. It can be useful to those who write in languages other than English where the character count is crucial. This could be the case for languages such as Japanese, Korean, Chinese and many more where characters form the foundation for writing. Even for those not writing in English understanding the characters count of the writing can be helpful to writing.
Django: The topics that you need to master as a beginner
Tags: django, programming, webdev, python
Published: 2022-08-02 17:50:00

## Preface:

As a new Django developer, there are a vast amount of topics that you should master first before, I would suggest going further into more advanced topics, such as creating a rest API and connecting Django to a front-end framework, like Vue.js, Angular or React. 

---

## Topics to master as a new Django developer:

- How to create a virtual environment

- Setup a Django project

- Understanding the concept of Django apps

- Views and URLs

- How to render a template and perform template inheritance 

- How to create a database and perform queries

- Perform the CRUD operations (Create, Read, Update, Delete) 

- Register a new user

- Authenticate a user

- Uploading an image

- Understanding static files 

- Password management 

- Deploy your project to a live server

---
Django models: Creating a simple model with records - [CREATE]
Tags: django, python, webdev, beginners
Published: 2022-08-02 17:45:00

## What are Django models? 
A Django model is a built-in feature that is used to create tables and fields. These tables and fields are used to represent data that can be managed and accessed with Django. Simply put, models define the structure of the data that is stored. 


## Let's get started.
So, let's say that we want to keep track of data that is associated with different kinds of cars. 


_In this case, our model would be Car._

---

## 1) Creating a simple model in Django

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

The code below shows how we would create our model Car and the table structure for it:

```
# - models.py

from django.db import models

class Car(models.Model):
   type = models.CharField(max_length=30)
   colour = models.CharField(max_length=30)

```

First of all, we navigate to our models.py file in Django and import models.


We then create our model, which is also known as a class. Since our model is Car, it would be appropriate to name it that.


We then create our fields, we have two of them, namely type and colour. The id field is generated by default when we create our model.


Next, it's important to decide in what form the data for our fields will be stored. Since we are just simply storing strings we can use CharField and set a max_length of 30 characters. 


Once we have completed our model it is important that we migrate and push our changes. 

_To do so, we perform the following commands:_

```
python manage.py makemigrations
```

```
python manage.py migrate
```

**DONE! - Your model has been migrated and created!**

---

## 2) Creating records for our table

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

The next step involves adding records to our tables by invoking the create() function, which helps us to populate the table from above.

```
Car.objects.create(type='ferrari', colour='red')

Car.objects.create(type='ford', colour='blue')

Car.objects.create(type='nissan', colour='black')

Car.objects.create(type='toyota', colour='white')
```

**DONE! - We have created records for our Model - Car**

---
**A final note…**
For those that are interested in learning Django from scratch, feel free to check out my latest course:

[Python Django: Ultimate Beginners Course - 2022](https://www.udemy.com/course/python-django-ultimate-beginners-course-2022/?referralCode=5061D095C530D13CFA6C)
Documentation links
Tags: beginners, programming
Published: 2022-08-02 17:38:00

## Basics

**bash:** https://www.gnu.org/software/bash/manual/bash.html#index-return
**grub:** https://www.gnu.org/software/grub/grub-documentation.html
**wget:** https://www.gnu.org/software/wget/manual/html_node/
**git:** https://git-scm.com/docs/git
**java 8:** https://docs.oracle.com/javase/8/docs/
**gpg:** https://www.gnupg.org/documentation/manuals/gnupg/
**nano:** https://www.nano-editor.org/dist/v2.0/nano.html
**libstdc++:** https://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.what
**dpkg:** https://manpages.debian.org/bullseye/dpkg/dpkg.1.en.html
**mvn cli:** https://maven.apache.org/ref/3.8.1/maven-embedder/cli.html


## Specs

**`gfm`:** - https://github.github.com/gfm/
**`yaml`:** - https://yaml.org/spec/1.2.2
Configure site specific search on Chrome
Published: 2022-08-02 17:37:49

If we want to search for music directly on spotify without google search.

### Step 1

We would like to search the term nirvana in the search bar. And in the address bar the corresponding address is 


`open.spotify.com/search/`**`nirvana`**

![identify the pattern in the URL](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w29qfpapvqg2dfetrh7u.png)

### Step 2

Right click on the address bar, and select `Edit search engines...`.

![Add search engine](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ph671db5bxbwdvcxufxb.png)

### Step 3

Add configuration as shown

![search engine configuration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c1qj5tn6pl43zfj9bfbk.png)

### Step 4

Enter keyword `spotify` and press `tab` in the address bar.

 ![site specific search](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sffufocxe6xegh2liino.png)
What makes a good engineer?
Published: 2022-08-02 17:37:21

I am not sure, how good I am. But, here are some attributes that made me admire people.

### 1. Basics

Reads "Introduction to ...", and stays with academic rigor. Reads the documentation first, before searching for answer.

### 2. Time it takes

This person knows how much time does it take to write a program, review code. If the task is not well studied, at least try to pay attention to get the stat for how much time other people take.

### 3. Relentless focus

They have a focus with one goal in mind. Complete the task. They do not multitask.

### 4. Common-ness

They tend to have common appeal, generally approachable but not always.

### 5. Hand calculations

They know how to do a simple calculation for a complex program they are writing. So, they are sure of their momentum at any point.

### 6. They say "thank you"

They thank their manager, their direct reports and they are just thankful.

Not an exhaustive list.