teleren/devto huggingface dataset:
EncrypC - File Encryption Application using Python
Tags: python, productivity, github, git
Published: 2021-01-17 08:52:36

## What I Built:
EncrypC is an Application made using Tkinter module from Python and here I used PyCryptodomex to Encrypt and Decrypt Files (AES) from the Passkey entered by the User.

<p align="center">
	<img src="https://user-images.githubusercontent.com/72680045/103018817-d0184200-456b-11eb-8fd2-11893c3173cd.PNG" alt="EncrypC Stable">
  <img src="https://user-images.githubusercontent.com/72680045/103018827-d1e20580-456b-11eb-8503-173356c1cde9.PNG" alt="EncrypC Working">
</p>

### Tech Stack Used:
* Python3
* Tkinter for GUI (Inbuilt)
* pycryptodomex for Cryptodome (AES Encryption)

### External Dependencies to be Installed:
* `pycryptodomex` (AES encryption)
```sh
pip install pycryptodomex
```

### Tutorial to Encrypt/Decrypt Files:
1. Open the Application and Click SELECT FILE Button to select your file e.g. "mydoc.pdf" (OR You can add path manually).
2. Enter your Key (This should be alphanumeric letters). Remember this so you can Decrypt the file later. (Else you'll lose your file permanently)
3. Click ENCRYPT Button to encrypt the file. A new encrypted file with ".encr" extention e.g. "mydoc.pdf.encr" will be created in the same directory where the "mydoc.pdf" is.
4. When you want to Decrypt a file you, will select the file with the ".encr" extention and Enter your Key which you chose at the time of Encryption. Click DECRYPT Button to decrypt. The decrypted file will be of the same name as before with the suffix "decrypted" for e.g. "mydoc_decrypted.pdf".
5. Click CLEAR Button to reset the input fields and status bar.

### Important Note:
-	**The Authors will not be responsible for any kind of loss of data so it is essential to have a Backup of Original Data you give as Input to Encrypt/Decrypt in the Software. Under no circumstances shall we be liable or responsible to you or any other person for any damages, loss of any of your useful data by using this Software. Read the [LICENSE](https://github.com/dhhruv/EncrypC/blob/master/LICENSE) for more information.**

**Check it out on [EncrypC Source Code](https://github.com/dhhruv/EncrypC)**
Yuk kenalan sama React.memo!
Published: 2021-01-17 08:40:54

React merilis beberapa fitur baru pada versi 16.6. Salah satunya adalah memo. sebuah Higher Order Component (HOC) yang menyerupai PureComponent / shouldComponentUpdate, namun untuk function component.

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

## Gunanya buat apa?

PureComponent memberikan pengoptimalan terhadap performa React, dimana component hanya akan melakukan render ulang jika props atau state-nya berubah. Namun PureComponent hanya bekerja untuk class component.

Kelebihan function component dibandingkan class component adalah initial render yang sedikit lebih baik dan ukuran yang lebih kecil, yang mana membantu mengurangi bundle size.

Dengan melakukan memoization terhadap function component tentunya akan memberikan performa lebih, tidak hanya saat initial render namun juga saat melakukan pembaruan berpotensi lebih cepat.

##Bener ngaruh ke performa? Yuk kita cek!

Pertama-tama, kita akan membuat parent component, dengan tag <Parent> yang akan melakukan perubahan state setiap detik, yang artinya <Parent> akan render ulang setiap perubahan state. Kalian bisa lihat percobaan ini di codesandbox.

![Alt Text](https://miro.medium.com/max/4800/1*vA9vm8XDSvseqBi13ekX8Q.png)

Percobaan pertama, kita akan buat child component dengan tag <Child> yang ditulis dengan function component tanpa memo, seperti berikut:

![Alt Text](
https://miro.medium.com/max/4800/1*X6T1rRNH18rcq333aszbTg.png)

Kita akan melihat hasilnya bahwa <Child> akan selalu render ulang apabila <Parent> melakukan render ulang, meskipun <Child> tidak mengalami perubahan, dalam case diatas <Child> hanya memiliki props yang ditulis dengan hardcode, yakni nama="Ferguso". Mengapa kita perlu render ulang suatu component ketika props tetap sama dan output-nya sama persis.

> “Oh, tidak! Ferguso!”

![Alt Text](
https://miro.medium.com/max/2000/1*Ib19LNxv7X8nOFkJ1t7ULg.gif
)

Kita sudah melihat hasil dari percobaan pertama, function component tanpa memo. Selanjutnya, kita buat percobaan kedua dengan memakai React.memo pada <Child>, seperti berikut:

![Alt Text](
https://miro.medium.com/max/4800/1*Azj4H-FvhcmtEKFrWNywlw.png
)

Dan… hasilnya…

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/mpdo3d66uq8j8gjzt611.gif)

Kita lihat bahwa <Child> tidak akan render ulang jika <Parent> melakukan render ulang, dikarenakan <Child> tidak mengalami perubahan. Inilah memoization! 👏.
multiple assignment in Python
Tags: python
Published: 2021-01-13 23:51:14

hey people what's going on? hope you're doing well.

i'm going to explain multiple assignment in [python] (https://python.org), so sit back relax and enjoy the article.

multiple assignment allows us to assign multiple variables *at the same time using one line of code*.

here's an example of us using standard assignment. let's say we have a [variable](https://pythonspot.com/python-variables/) name and i will set this to a value of my name.

```python
name = "Tux"
print(name)
```

let's say edge equals 21 and how about a variable called attractive?

```python
name = "Tux"
edge = 21
attractive = True
```

i think i'm gonna set this to true okay, so we have a bunch of variables and then we can print the value of these variables with some print statements.

```python
print(name)
print(edge)
print(attractive)
```

so let's print name age and attractive. so we have name age attractive and as you would expect this prints tux 21 and true.

now another way in which we could write the same code is to use multiple assignment and this allows usto assign multiple variables at the same time using **one line of code**.

![surprised cat](https://dev-to-uploads.s3.amazonaws.com/i/f4lffahr56ec6b1j4zi7.jpg)

so i'm going to turn all of these lines into comments and this time we will only use one line of code.

```python
# name = "Tux"
# edge = 21
# attractive = True
```

But to do this we're going to list all of our variables separated with a comma so that would be name comma edge comma attractive.

We will set them equal to those values but in the same order separated by commas so that would be tux comma 21 comma true and this would do the same thing, only using one line of code.

```python
name, edge, attractive = "Tux", 21, True
```

You can [print](https://python-commandments.org/python-print-function/) the variables on one line too

```python
>>> name,edge,at = "Tux",21,True
>>> print(name, edge, at)
Tux 21 True
>>> 
```
If you have a large program or use loops/if statements keep in mind the variable [scope](https://pythonbasics.org/scope/)
What Javascript features are the most confusing to you?
Tags: codenewbie, discuss, javascript
Published: 2021-01-17 08:33:36

---
title: What Javascript features are the most confusing to you?
published: true
description: In an effort to help out aspiring developers, I’m interested in hearing about what you think the most confusing parts are!
tags: codenewbie,discuss,javascript
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/umtooa6y28u6roty96pl.jpg
---

In an effort to help out aspiring developers, I’m interested in hearing about what you think the most confusing parts of Javascript are.

I’ll try my best to explain a concept and, hopefully, others will chime in 😊.

This is a safe space, which means all questions are good questions!
Disable assistants on my Android headphones
Tags: misc, rant, mobile, software
Published: 2021-04-15 21:15:34

---
title: Disable assistants on my Android headphones
published: true
date: 2021-01-17 08:31:16 UTC
tags: misc,rant,mobile,software
canonical_url: https://siderite.dev/blog/disable-assistants-on-my-android-headphones/
---

Original post (with images) here: https://siderite.dev/blog/disable-assistants-on-my-android-headphones

So I wanted to use the button on my Android headset to control the audio of the application I was currently using: a book reader or a music player or something similar like that. And instead an annoying assistant was blinging annoyingly and impotently in my headphones, while my music was still on. It is not at all obvious what does that and how to stop it. And there are two assistants on my phone: Google Assistant and Bixby. Turns out you only need to care about one.

Here is what I tried and didn't work:

- disable assistants
  - Bixby can't even be disabled
  - Google Assistant can be disabled, but by that it means it doesn't listen to your voice commands anymore, buttons are fair game
- apps to change the action for the headset button
  - they either don't work right or can't work when the screen is locked
  - the "many apps" recommended by some articles are not even in the store anymore
  - they need **full control** permissions on your phone

So, here is what you need to do:

1. have your headphones connected to your phone
2. open Google application  
3. tap the three dot More button  
4. go to Settings  
5. select Google Assistant  
6. go to Devices (it's a section in blue on my phone)  
7. you should see Wired headphones (or maybe something else depending on your headset type) - tap it  
8. uncheck the option Get help from Google  
  

That's it! You don't have to disable the assistant on your headphones, but your headphones in your assistant. And this is regardless of whether the assistant is "off" or "on". Now you can listen to your music and books in peace.

"But, what about Bixby?" you will ask. As far as I can see, Bixby is something that comes over Google Assistant. I did disable some stuff in it, but I doubt it was a problem to begin with.
My Local Hack Day 2021 Experience | Major Hacking League | Guild: Inaxia
Tags: localhackday, mlh
Published: 2021-01-17 08:13:06

It’s a great experience with all the tech enthusiasts, we come together every day and divide some amazing tasks among us and try to finish all of them with our full energy.
I am having a lot of fun attending the live stream with Ryan, Mary, Sashrika, Mara, and some cool people of MLH. I really like how they guide us in every challenge they give as well as entertain us throughout the week of LHD.
Every day I get to know some new skills and technologies and it really helps me build my profile.
This is the first time Inaxia is participating in Local Hack Day and I really love the atmosphere of this community. Really love to work with this amazing team. Not only that, we became good friends in less than a week. We share our stories along with our meals. I was an introvert before this hackathon, but now I think I can talk to different people around the world.

All thanks to Inaxia Community and Local Hack Day for organizing such an amazing event where people connect with each other and become part of a family.
Honestly, I love our Inaxia community a lot and would love to be a part of it for years to come and make it big and impactful.
At last, I hope we can make Inaxia to top 10 this as the top teams are way ahead of us. No issues as this was our first time, but next year we will come with more energy and try to get every single point for our Guild as well as for ourselves.
Setup Vue3 with Element UI
Tags: vue, javascript, typescript, tutorial
Published: 2021-01-17 08:11:56

Element UI is my favorite Vue UI library. A popular top-class component library with more than 50K Github stars. And they already have [a version that works with Vue3](https://dev.to/iamkun/element-ui-for-vue-3-0-is-coming-4o6o) - Element Plus.

I'd like to share how to set up a Vue3 project with [Element Plus](https://github.com/element-plus/element-plus) using Vue CLI.

### Install the latest version of Vue CLI
```
npm install -g @vue/cli
```

### Create a project with Vue CLI
```
vue create my-app
// And then select Vue 3 option.
```

![Vue CLI VUE3](https://dev-to-uploads.s3.amazonaws.com/i/vhyq695ezpvqpg4u0gk0.png)

### Install Element Plus

You can add Element Plus to your project simply via its Vue CLI plugin.

```
cd my-app
vue add element-plus
npm run serve
```
![Element Plus Vue CLI plugin](https://dev-to-uploads.s3.amazonaws.com/i/ujezudjh90xxlopmvbe1.png)

Now you can use Element Plus components in your project like the following.
```
<template>
  <el-button type="primary"> Element UI </el-button>
</template>
```
![Element Plus with Vue 3](https://dev-to-uploads.s3.amazonaws.com/i/vq2uo99zp2djyl1auqht.png)

Check out this repository with this configuration done: 

https://github.com/element-plus/element-plus-starter

That's it!
My Local Hack Day 2021 Experience | Major Hacking League | Guild: Inaxia
Tags: localhackday, mlh
Published: 2021-01-17 07:54:51

It’s a great experience with all the tech enthusiasts, we come together every day and divide some amazing tasks among us and try to finish all of them with our full energy.
I am having a lot of fun attending the live stream with Ryan, Mary, Sashrika, Mara, and some cool people of MLH. I really like how they guide us in every challenge they give as well as entertain us throughout the week of LHD.
Every day I get to know some new skills and technologies and it really helps me build my profile.
This is the first time Inaxia is participating in Local Hack Day and I really love the atmosphere of this community. Really love to work with this amazing team. Not only that, we became good friends in less than a week. We share our stories along with our meals. I was an introvert before this hackathon, but now I think I can talk to different people around the world.

All thanks to Inaxia Community and Local Hack Day for organizing such an amazing event where people connect with each other and become part of a family.
Honestly, I love our Inaxia community a lot and would love to be a part of it for years to come and make it big and impactful.
At last, I hope we can make Inaxia to top 10 this as the top teams are way ahead of us. No issues as this was our first time, but next year we will come with more energy and try to get every single point for our Guild as well as for ourselves.
@MLH Local Hack Day
Tags: majorleaguehacking, localhackday
Published: 2021-01-17 07:36:08

This is a Totally Not Competitive guy, named Prabal Kalia, Pursuing Computer Sciences and Engineering from Indian Institute of Information Technology, Kottayam.

Here is my experience about Local Hack Day in general.
So I'm in 3rd year and basically what I did during whole of my cs degree was competitive programming, I didn't have much projects, and thus was looking for a place where i can hone my skills and make products / projects that are actually useful in the real world. 

So, A friend of mine @Hrishabh Joshi , introduced me to MLH and asked me to join his guild "Wind in our chest hair"

Being a huge fan of weird stuff , I couldn't help but join that guild. 

So, I entered into the event. The first day I didn't know how stuff works and I had never used twitch except for watching gameplays. 

I scored only 5 points that day.

The second day was similar too and i just scored 6 more points moving me up to 13

Then I got the hang of it , and got to 29!! Great progress.
Then The LHD guys brought out their dashboard. 
I saw i was at rank 150 , ( Keep in mind there are 65000+ hackers in MLH ). I was like woah.

And the top 30 are put in the leaderboard on their site.

SO, the grinding started. I got introduced to a lot of unheard technologies, trained myself on it. and finally completed every single daily challenge on day 4.

I went to 56 points and rank 29. I was on the leaderboard!!

Now that I was on the leaderboard, more grinding. took me to 84 on day 5 and 122 on day 6.

As of yesterday I'm at rank 9 and I hope to finish this event on a high.

The weekend is going on , and the event ends soon.

This was an event filled with fun , grind , and a LOT of learning.
Laravel 8 'npm error' when running npm run dev in Windows 7
Tags: node, npm, laravel, errors
Published: 2021-01-17 07:35:45

I am still one of those tech people who are still using Windows 7 as operating system. I know the support for this OS has already stopped and it's not recommendable anymore, however, I am still using it for personal use and I don't have budget yet to upgrade.

So, one of my encountered problems using Windows 7 while installing Laravel 8 is the "npm error" while running the npm run dev in my terminal. I tried all the accepted answers on Stackoverflow and other platforms but, they didn't work in my case. 

What really solved my problem regarding this issue was:

1. Uninstall my node.js

2. Manually delete all npm and node_modules folder in my C:\Program Files (or wherever you might have installed it because 'uninstalling' sometimes won't delete data folders)

3. Made sure I removed the file path C:\Users\ACER\AppData\Roaming\npm on my Environment Variables

4. Downloaded this node version for my Windows 7 https://nodejs.org/download/release/v13.6.0/ then installed it freshly. Important: Don't forget to restart your computer after the installation!

Now when I rechecked my versions, they are now fine and working and won't give errors when typing these on my terminal:

$ npm -v
6.13.4

$ node -v
v13.6.0

$ npx -v
6.13.4

I know there are other answers out there, but I am posting my own steps just in case there are people who have similar problems who tried everything but still didn't work out. 

Hope this helps.

If you think this solves your problem, just let me know. 

UPDATE:
If above technique still doesn't solve the issue, do the following:
1. Run CMD as administrator (you have to run cmd as administrator at least once after the node installation based on my experience)
2. type "npm version" and you should see something like this:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7nnizf0fvajpcpcyz06m.PNG)
3. Then go to your terminal, and run this:

npm config rm proxy

npm config rm https-proxy

See pic:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8c29ufkl5rblflk8itoc.PNG)

After that, run npm install again and it should work fine.
Django development using Docker as host - Part 3: Create Django project
Tags: django, docker, devops, devjournal
Published: 2021-01-17 07:27:31

Till now we have completed with the `Dockerfile` and the required script files. In this step, we will create a Django project inside the container.

## TOC
1. [Build docker image](#p3-docker-image)
2. [Run the image](#p3-run-image)
3. [Create Django project in the container](#p3-django-project)
4. [Install python dependencies](#p3-python-dependencies)

## Let's start

### 1. Build docker image <a name="p3-docker-image"></a>
First, we need to build the image using the `Dockerfile`. Execute the following command to build the image and add a tag `my_app`
```
docker build -t my_app .
```

After the image building has completed, you can see the image by running
```
docker images
```

### 2. Run the image <a name="p3-run-image"></a>
Run the `bash` terminal using the image
```
docker run -it --rm -v "$(pwd)"/src:/app/ app_tut bash 
```
* `-it` will run the image in interactive tty mode
* `--rm` will remove the container when the run is exited
* `-v "$(pwd)/src:/app/` will mount the `./src` directory in current working directory to the `/app` inside the container
* `my_app` is the image name
* `bash` is the command to execute inside the container.

### 3. Create Django project <a name="p3-django-project"></a>
First, verify the `Django` installation inside the container by running the following command inside the container bash session
```
pip list
```
It will give a list of installed dependencies inside the container. Verify the `Django` installation.
```
Package    Version
---------- -------
Django     3.1.5
```

As `Django` is installed, run the below command to create a Django project with name `my_app` in the current directory.
```
django-admin startproject my_app .
```
To confirm the project creation, list the files in the current directory
```
ls -la
```
You will see a directory `my_app` and `manage.py` file
```
-rwxr-xr-x 1 root root  662 Jan 16 17:54 manage.py
drwxr-xr-x 7 root root  224 Jan 16 17:54 my_app
```

**Did you noticed something?**
You can see the `my_app` directory and the `manage.py` in the host `src` directory as well. 
This is because we have mounted the `src` directory with the `/app` directory using `-v` parameter.

This is all for initializing our Django project. In the next step, we will use the `docker-compose` to run the Django application and mounted the volumes.

Type `exit` to exit from the docker image shell.

### 4. Install python dependencies <a name="p3-python-dependencies"></a>
Since we will be using the MySQL database with the Django project, `mysqlclient` python dependency needs to be installed.
Add the following to the `requirements.txt` because its installation will require the `build-essential` library.
```
mysqlclient==2.0.3
```
Django development using Docker as host - Part 2: Create scripts
Tags: django, docker, devops, devjournal
Published: 2021-01-17 07:27:18

In **Part 1**, we created a **Dockerfile** with the required system dependencies.

In this part, we will be creating the required files and scripts.

## TOC
1. [Create `requirements.txt`](#p2-create-scripts)
2. [Create `entrypoint.sh`](#p2-create-entrypoint)
3. [Create `docker_start.sh`](#p2-create-docker-start)
4. [Create `wait_for_it.sh`](#p2-create-wait-for-it)
5. [Make scripts executable](#p2-executable-scripts)

## Let's dive in

### 1. Create `requirements.txt` <a name="p2-create-scripts"></a>
First, we need to define our basic python dependency for the Django project setup. Although it is not required, to omit any error with the `pip install -r requirements.txt` inside the container, let's add our first dependency.
```
Django==3.1.5
```

### 2. Create `entrypoint.sh` <a name="p2-create-entrypoint"></a>
Entrypoint script is executed every time the image is run. I recommend not to run the Django server using this.
Create a file `scripts/docker/entrypoint.sh` with the following content
```
#!/bin/sh

exec "$@"
```

### 3. Create `docker_start.sh` <a name="p2-create-docker-start"></a>
We will use this script to run the Django server.
Create a file `scripts/docker/docker_start.sh` with the following content
```
#!/usr/bin/env bash

echo -e "\e[34m >>> Migrating changes \e[97m"
python manage.py migrate
echo -e "\e[32m >>> migration completed \e[97m"

echo -e "\e[34m >>> Collecting Static files \e[97m"
python manage.py collectstatic --noinput
echo -e "\e[32m >>> Static files collect completed \e[97m"

python manage.py runserver 0.0.0.0:8000
```
It will run the migration, copies the static files and run the server over port `8000`

### 4. Create `wait_for_it.sh` <a name="p2-create-wait-for-it"></a>
This script is needed to wait for the database connection to start before starting the Django server.
Create a file `scripts/docker/wait_for_it.sh` with the content from git repository [vishnubob/wait-for-it](https://github.com/vishnubob/wait-for-it)

### 5. Make scripts executable <a name="p2-executable-scripts"></a>
In order to execute the scripts, it is required to make them executable.
Run the following command in the terminal from the project directory
```
chmod +x scripts/docker/entrypoint.sh
chmod +x scripts/docker/docker_start.sh
chmod +x scripts/docker/wait_for_it.sh
```

That's it for this part. Next, we will create the Django project using the docker image.
What is your preferred medium of learning : Books, Blogs or Videos?
Tags: discuss, watercooler
Published: 2021-01-17 07:23:41

Do you prefer to learn using books when you are learning something new , or prefer blog/written tutorials? Or you would rather watch tutorial videos instead?

For me, I liked reading books, and also prefer them if possible when learning something new. I like when authors given their own perspective or share some experience they had. 

What are your preferred medium for learning, and why, share in the comments :smile:

Thank you!