teleren/devto huggingface dataset:
Learning Python- Intermediate course: Day 12, Summary of the week
Tags: learningpython, discuss, codenewbie, programming
Published: 2021-08-21 09:15:22

Today let us revise whatever we have learnt so far in this week.
---
____
### Summary of the week
### [Day 9, Complex numbers part 1](https://dev.to/aatmaj/learning-python-intermediate-course-day-9-complex-numbers-part-1-2pkh) 
In this part we explored the `cmath` module. The `cmath` module in Python s a built in module which contains mathematical functions related to operations of complex numbers. Complex numbers can be created in the following manner `z= complex(x,y)` `z.real` and `z.imaginary` provide us with the real and imaginary parts.

 
 We also saw how easily we can operate complex numbers in Python. We can do operations like addition, product and raising to a power, simply with the use of operators. Unlike other languages, we do not require any other functions for these simple operations.

#### [Day 10, Complex numbers part 2](https://dev.to/aatmaj/learning-python-intermediate-course-day-10-complex-numbers-part-2-48jh)
This part was reserved for `cmath` module functions. We covered functions like `phase()` and `polar()` which are frequently used while operating with complex numbers. After that, we saw how we can use the methods in the `cmath` library for more complicated mathematical operations. Entire list of functions with documentation can be found [here](https://docs.python.org/3/library/cmath.html)

Complex numbers are useful in many branches of programming. We checked out a few in this part. For those who are not comfortable with the use of complex numbers might like [this video series](https://www.youtube.com/watch?feature=player_embedded&v=T647CGsuOVU%3Cbr%3E%0A)

#### [Day 11, Random numbers](https://dev.to/aatmaj/learning-python-intermediate-course-day-11-random-numbers-5cnj)
In this part we focused on the Python `random` module. Just like the math and cmath modules, the 'random' module is built in into Python, so we do not need to take any extra efforts to download or install it. We saw how to cover complex numbers in the range 0-1 by using the `random()` method. The `randint()` method generates a integer between a given range of numbers. We also covered methods to return a list of random numbers.

Thank you ! That was all for this week 👍 Meet you next Tuesday 🤠

____

> For those who have not yet made account in Dev.to, you can have a free easy sign-up using your mail or GitHub accounts. I would suggest the budding developers to create your GitHub free account right away. You would require to register sooner or later anyways

🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
Follow me on GitHub for updates.........
From File location address, get data based on how many file extension are there and their count
Tags: csv, mysql, file, extension
Published: 2021-08-21 08:57:36

Problem: Assume you have million of rows, which has a address field. it contains URL like this:
*/Volumes/ Macintoh Hard Drive/Users/sahil/Desktop/some.pdf
*/Volumes/ Macintoh Hard Drive/Users/sahil/Desktop/abc.pptx
*/Volumes/ Macintoh Hard Drive/Users/sahil/Desktop/xyz.docx
*/Volumes/ Macintoh Hard Drive/Users/sahil/Desktop/some.mp4
*/Volumes/ Macintoh Hard Drive/Users/sahil/Desktop/w.mp3
*/Volumes/ Macintoh Hard Drive/Users/sahil/Desktop/q.png
![table with file location](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kitjhh46f7qhhv1c6c7r.png)
Now I want to know how many 
-pdfs,ppts,mp4,png and so on are present

Below query :
reverse the address, looks for '.' and extracts the string after it and names it extension and counts how many times it encountered the extension

```sql
--volume is the column where file address is saved
select REVERSE(SUBSTRING(REVERSE(volume),1,LOCATE('.',REVERSE(volume),1))) as extension, count(1) as count from loutable2 group by extension
```
query will return a result like this
![table showing numbers of file of each entension](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aqrzr04d4ib6w17yf6pb.png)

Now if you want only pdf data
```sql
SELECT * FROM `loutable2` where REVERSE(SUBSTRING(REVERSE(volume),1,LOCATE('.',REVERSE(volume),1))) =".pdf"
```

now let's say you want this data in excel/csv file
All you do is make a "mysql view"
```CREATE VIEW pdf_details AS SELECT scaned,status,somecolum,volume FROM `loutable2`  where REVERSE(SUBSTRING(REVERSE(volume),1,LOCATE('.',REVERSE(volume),1))) =".pdf"
```
```sql
CREATE VIEW pdf_details AS SELECT scaned,status,somecolum,volume FROM `loutable2`  where REVERSE(SUBSTRING(REVERSE(volume),1,LOCATE('.',REVERSE(volume),1))) =".docx"
```

and then you can use these views and export these in excel or whatever format you want
![export mysql data in csv/excel](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nwi074dpcqppu7shr24i.png)
Battery Notification in Audio using Fish Shell
Tags: fish, battery, laptop, audio
Published: 2021-08-21 08:48:54

Some desktop environments provide battery notification so that every time battery is low or maybe full, the DE will notify us. The notification usually comes as something like tooltip which may not be handy if we are not in front of our monitor or maybe still concentrate on our tasks. Also, sometimes I want to change my DE or window manager - KDE to GNOME, AwesomeWM to Spectrwm, etc. In this situation I usually stuck. [Conky](https://github.com/brndnmtthws/conky) can help but changing WM / DE involves struggling with configuration file(s) and/or more software (panel, for example).

So, that was my problem. I want to have a very simple and can be used to notify my battery status. I decide to use audio to notify myself since it can be used across any DE/WM. All I need to do is just prepare two audio files (you can create that by yourself or download from the Internet) and create this script:

```bash
#!/usr/bin/fish

set bcapacity (cat /sys/class/power_supply/BAT0/capacity)
set bstatus (cat /sys/class/power_supply/BAT0/status)

if [ "$bcapacity" -le 15 -a "$bstatus" = "Discharging" ]
  /usr/bin/mpg123 /home/bpdp/Musik/battlow.mp3
end

if [ "$bcapacity" -gt 90 -a "$bstatus" = "Charging" ]
  /usr/bin/mpg123 /home/bpdp/Musik/battfull.mp3
end
```

Let's say, I put that file in `$HOME/bin/batt.sh`. I install [mpg123](https://www.mpg123.de/) for my player and put those `mp3` files at `/home/bpdp/Musik/battlow.mp3` for battery low audio and `/home/bpdp/Musik/battfull.mp3` for battery full audio.

Put the script into a crontab by `crontab -e` and write then save this:

```bash
*/2 * * * * /home/bpdp/bin/batt.sh
```

so that every 2 minutes,my battery will be checked. Run cron daemon (I use `OpenRC`, might be different if you use `systemd`):

```
sudo rc-service cron start
```

That's all.
Think about the Bus
Tags: productivity, management, startup, todayilearned
Published: 2021-08-21 08:40:40

---
title: Think about the Bus
published: true
description: What would happen if you or one of your team members would be hit by a bus? - A risk assessment
tags: productivity, management, startup, todayilearned
cover_image: https://images.unsplash.com/photo-1573812456956-4a85dfc2ed00?auto=format&fit=crop&w=1502&q=80
---

> „What would happen if you or one of your team members would be hit by a bus?“ 

Have you asked yourself this question before? I know it feels kind of weird to be thinking about stuff like this, but there is more to this morbid question than you would might think. 

This question tries to estimate the [„bus-factor“](https://en.wikipedia.org/wiki/Bus_factor) and is a measurement for risk and assesses the consequences of losing a key technical member of your team. 

Imagine a developer that is the only one of your team that has knowledge of a specific subsystem or someone who is the only one with the credentials to an important server. What would happen if this developer would get hit by a bus (or other scenarios, like illness, taking a new job, parental leave, sabbatical) and is not available anymore suddenly? Things would come to a halt quickly. 

This is a problem if someone on your team (or yourself) is a single point of failure. There are two main aspects that I find most important but there are probably some more aspects that are true for specific situations: 

### Capabilities

Does one person hold the only access rights to specific parts of your system, or is a person the only one having the authentication details for something. You would not want to be locked out of your own system

### Knowledge 

Is one person the sole expert in one area, where other team members do not know how it works. This makes the expert a critical dependency and it is very hard for other people to take over, because the knowledge is too concentrated.

## Ask yourself

> *Can you think of something in your current team and application where you would get problems if someone would get hit by a bus? Especially ask yourself, where would problems arise if I would be gone suddenly?*

## What to do about it? 

You have identified some things where you have critical dependencies. Great, so how can you alleviate them? 

Regarding authentication details, it makes sense to think about your access rights concept so that there is not one overall admin. But of course you would not also want to give everyone full admin rights.

To tackle the problem of knowledge concentration there are three ways to go:

* **Reduce complexity**: so lesser knowledge is required to understand a component
* **Documentation**: To provide an easier knowledge transfer document all processes and things you are working on and more importantly **keep it up to date**
* **Cross training**: do some pair programming to encourage thinking about other areas of your system

Also thinking about the bus factor is not a one time thing, but an ongoing tool to assess risks within your development team, especially if you are working in a small team or startup
Day 8 : Learning JS Fundamentals, Part-2
Tags: javascript, webdev, 100daysofcode, beginners
Published: 2021-08-21 08:39:43

see the below example:-
![Alt Example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jv0jewumo2h8aq7f1ui2.png)

In the function above, we have not declared the variables teacher and topic, still we assigned them values. When we call this function, this changes the value of the "teacher" variable present in the global , while the topic will be declared as a new variable in the global scope, hence the output of the last line will be "React".

----

### Undefined vs Undeclared
clear from the name...


----

### function expressions

[Function expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/function)


[Arrow function Expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions)


just skim through the above two articles starting paragrpahs. 

----

![AimageText](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qu3y7ktlxffjved93tkr.png)


The  first function above is an example of anonymous function expression while the second is a named function expression.

Example for arrow functions:-
![Alt fdText](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hgzzkeaodgkinr0x3t14.png)

-----

### Immediately invoked function expressions

![Als Texfdt](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mf07bg9uqbe222mkaqgs.png)

These are used in places of our code where we need to collect a set of variables and protect them from encroaching upon an outer scope. These are not used nowadays, instead block scoping is used(with let).


### Block scoping 

![Alt Texft](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2519g4e1grj6me56gwhi.png) 


In the below example, the variable `temp` will be available only inside the `if` block. 

`var` are good, when you want to define a variable at a function level. (as the scope of var is global or the function in which it is defined).

![Alt Tefdxt](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x305lvvmlxvqyvojlff4.png)
How To Start Bug Bounty Hunting - Short Intro
Tags: cybersecurity, computerscience, programming, beginners
Published: 2021-08-21 08:34:17

I recommend registering on [@BugCrowd](https://twitter.com/Bugcrowd), [@Hacker0x01](https://twitter.com/Hacker0x01), [@intigriti](https://twitter.com/intigriti)

Searching for bugs in the wild (not on a bug bounty platform) is great, but not for the start.

Bug bounty platforms can give you very interesting private invites over time.

---

Try focusing on programs that have a wide scope, where you can manage users (create roles), docs, images, etc.

And then start with a simple — create two users (one basic user & second admin), open two browsers, and start testing for **BAC** (Broken Access Control) vulnerability.

In short — BAC is the type of vulnerability, where a basic user can perform admin actions.

Some of these vulnerabilities can be found using direct links to sections/endpoints, but others will require you to modify requests that are sent to the browser

---

I recommend using [@Burp_Suite](https://twitter.com/Burp_Suite) for requests capture & modification. You can download Community Edition for Free.

Recommended Addon: Logger++

---

While you are testing the website/app for BAC bugs — you can highlight all GET requests to critical actions. E.g. `/delete_user?id=1`

Requests with critical actions that can be directly sent to a user are treated as a **CSRF** (Cross-Site Request Forgery) vulnerability

POST requests can be used too to perform CSRF attack, but usually has CSRF protection mechanism in place (like `csrf_tokens` or `referrer` check).

CSRF protection can be bypassed sometimes. Try to switch the POST method to GET or remove token value from a key - `csrf_token=`

With referrer protection, you can try to append your own domain to a referrer, like this `http://example.com.yourdomain.com`

---

And the third basic rule while performing bug bounty hunting — is to put a basic payload in all possible inputs: `qwe'"<X</`

And just watch text reflection on a website. If you will see somewhere `qwe'"` (without angle brackets) — this could be a chance of **XSS**

Additionally, search for `qwe` text in the source code of the page. Use Developers Tools in the browser for this task.

Some of the input payloads can be reflected in tag parameters: 
`<a class="qwe'"<x</">`

Or in `<script>` element itself: 
`<script> let a = "qwe'"<x</" <script>`

---
>
That's all for now! Thanks for reading 👍
>
Follow me on Twitter - https://twitter.com/therceman
>
I Tweet & Write about WebDev & InfoSec
Gamify your CSS learning and learn better
Tags: css, webdev, programming, codenewbie
Published: 2021-08-21 07:49:06

CSS Arts is a great way to improve your CSS skills and show your artistic side to the world.

This is what I have been using for the past few weeks and I can already notice considerable amount of improvement in my CSS skills already.

With the help of this website you can gamify your learning experience and make it more interesting.

https://cssbattle.dev

The basic idea is to replicate the drawing displayed to you on the website in the minimum lines of code and then you are given a score on the basis of that. 

You can either play it against someone else in real-time or you can play again yourself.

This is a really fun way to learn and get better at CSS without getting bored.

Thank you for reading :)

You can also check out my other social media handles to connect with me.

Do leave your feedback in the comment section
My goals for the 16 weeks internship at Kodecamp
Published: 2021-08-21 06:51:04

Recently joined the Frontend track at KodeCamp internship because I want to improve my knowledge and skills and here are my goals for the 16 weeks internship...
1. I'd love to achieve the following by the end of this internship;

2. Improve my knowledge by learning the core concepts of javascript and Reactjs.
collaboration and team work.
3. Improve my skills in knowledge of front-end development.
4. Time management and critical thnking.
5. Have a remote job.
Setting Up Tailwind in Angular
Tags: angular, tailwindcss
Published: 2021-08-21 06:50:53


Thanks to Angular team for making it so easy to integrate Tailwind with Angular 12 and above to a point that I really thought if I should write a post for it. Finally convinced myself to document it, since there were not many good references I could find related to this.

Lets first create a new Angular application. When new application is created, make sure you use CSS as the styling option.

```
ng new tailangular && cd tailangular
```

Now we have to add Tailwind as a dependency to our application

```
npm install --save-dev tailwindcss
```

Once you have it installed, its time to create the tailwind config file, so that Angular can pick it up when its building or running the application.

```
npx tailwindcss init
```

This will create the `tailwind.config.js` file with the following content.

```js
module.exports = {
  purge: [],
  darkMode: false, // or 'media' or 'class'
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
  plugins: [],
};
```

Now you can include the tailwind directives to the `src/styles.css` as shown
below

```css
/* src/styles.css */
@tailwind base;
@tailwind components;
@tailwind utilities;
```

That's it, now you can use Tailwind in your components. I don't think other frameworks have such easy integration as Angular. From Angular 12's [release notes](https://blog.angular.io/angular-v12-is-now-available-32ed51fbfd49), it appears this is supported from Angular 11.2 but I tried it only with Angular 12.

Enjoy using Tailwind with Angular's template system!
Flutter - Let's Share one to one Images on our chat app  (Final Part) || ChatApp #34
Tags: flutter, javascript, android
Published: 2021-08-21 05:50:02

Wanted to know how to add a feature of one to one Image sharing in your chat app. Here is the new video on my WhatsApp clone Series using #Flutter #NodeJs #SocketIO.

Link of [Video](https://youtu.be/vqKX9Gu8df8)
Playlist [Link](https://youtube.com/playlist?list=PLtIU0BH0pkKovuEaNsrGE_Xd5Tz3m1zeC)

It will help you understand the image sharing.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j1fojpdspaap6r5cvh4e.png)

Here is the some images of app:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/djwki2ctwws8sqb12m58.jpg)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x866pcyb7qowv83m7747.png)
So, You Want to build your career in cloud (Here is not so obvious way to learn from a senior solution architect in AWS)
Tags: aws, cloud, architecture, career
Published: 2021-08-21 05:25:05

Aspirants who want to build their career in the cloud should know what cloud providers have in offering for various businesses and tech requirements.

Start your cloud journey by learning AWS cloud services by non-other than a senior solution architect in AWS cloud. Open up doors for different cloud-focused careers.

Click the below link for more details and/or share with people who need this.

https://www.mentorif.com/event/73933132064
Git workflow explained with visual boards
Tags: beginners, git
Published: 2021-08-21 05:23:18

---
title: Git workflow explained with visual boards
published: true
date: 
tags: beginners, git
canonical_url: https://eternaldev.com/blog/git-workflow-explained-with-visual-boards
---

## Git Workflow Basics

### Introduction

One of the most important skills as a web developer is learning to communicate and work properly with teams.

Git helps developers work in a more collaborative manner and so it is an essential skill for all devs

### Getting and Creating Projects

Let's start by creating a new project or clone a project from a repository. Cloning the remote repository will mark the beginning of our wonderful journey of making a mess and leaving our mark in the codebase.

[![Getting and Creating Git Projects](https://eternaldev.com/static/e88e7feb401a8a74ed92f9c5b97bbdee/f9218/understandinggit1.jpg "Getting and Creating Git Projects")](/static/e88e7feb401a8a74ed92f9c5b97bbdee/f9218/understandinggit1.jpg)

### Adding Remote Repository

Once we have a local repository created, we need to link it with the remote repository. If you have cloned the repo, you can skip this step

[![Adding Remote Repository](https://eternaldev.com/static/26f6d68b91e84075eeef25ae003a0f76/f9218/understandinggit2.jpg "Adding Remote Repository")](/static/26f6d68b91e84075eeef25ae003a0f76/f9218/understandinggit2.jpg)

### Staging Changes

So you spend all day breaking your head and fixing that one production bug that might show for only 1% of your user base. So what next ?

Staging the files eliminates the risk of committing unnecessary local changes. Stage only the changes which are needed.

[![Staging Changes](https://eternaldev.com/static/bb5e9a4f614b6f0105cb7aeabcac6a7d/f9218/understandinggit3.jpg "Staging Changes")](/static/bb5e9a4f614b6f0105cb7aeabcac6a7d/f9218/understandinggit3.jpg)

### Commit to branch

Now comes an important step to write a beautiful commit message which your team members will understand about the fix for the bug in a short sentence

[![Commit to branch](https://eternaldev.com/static/1ec7613a838b110c2cb72fc78eafcd6e/f9218/understandinggit4.jpg "Commit to branch")](/static/1ec7613a838b110c2cb72fc78eafcd6e/f9218/understandinggit4.jpg)

### Pushing branch to remote

Finally pushing the branch to your remote repository for your team to perform a critical peer review of your code before merging changes. Be open to feedback and update your code based on the team guidelines

[![Pushing branch to remote](https://eternaldev.com/static/1d26aa4cf7bce324465226c6f8e48aab/f9218/understandinggit5.jpg "Pushing branch to remote")](/static/1d26aa4cf7bce324465226c6f8e48aab/f9218/understandinggit5.jpg)

## Summary

If you have any questions or suggestions, feel free to join our discord community

[Discord](https://discord.gg/AUjrcK6eep)
React vs Angular
Tags: programming, react, angular, javascript
Published: 2021-08-21 05:20:36

- many people ask to me which JavaScript framework can i learn first or which framework is easy then other or which framework should i learn.

## What is React? 🤔
So React is a technically a JavaScript library for building user interfaces.
<br>
using react we can make single page web application.
- Developed by Facebook

### requmintent to learning React
you only need to learn React is JavaScript. first you need to master in javascript, es6, arrow function, array method, map and set.

<br>
if know this skill then you are ready to go.

## What is Angular? 😕
Angular is JavaScript Framework and it's help us to make morden web application. you can also make a single page application using Angular.
- Developed by Google.

### Requmintent to learn Angular
Angular is a type-script based Web framework to learn Angular you need to master typeScript. typeScript is super set of javaScript and typescript made by microsoft.
to learn Angular you need to learn type-script must.

### let's compare React vs Angular
if you are a beginner and just learn HTML, CSS, JavaScript. then Answere is simple. REACT - Wait i tell you way.

And if you are a intermediate level Developer or you have some experience of javascript or you learn web developet last 6 months. then try once Angular.

### is Learn React is too Hard 😰
NO, learn React is so easy if you JavaScript Fundaments is clear.
in React You have to understand the fundaments like props, hooks, state etc. then you understand react so easy and use react is fun😁.

### is Learn Angular is too Hard 😭
yes if you are a beginner if you unfamiliar with typescript and you don't know the fundaments of JavaScipt then React and Angular both is hard for you.

## My opition
i talk to many developer and all said that start with React and once you under-stand react then move to angular

### JOB 👨‍💻
when the deviate goes to Jobs section then i say it's depended, search for  which framework most use in your area, then focus on this. i also say that learn both because which framework you next working on no one knows.