teleren/devto huggingface dataset:
Up-to-date Docker Images
Tags: actionshackathon21
Published: 2021-11-23 20:26:16

[Instructions]: # (To submit to the GitHub Actions x DEV Hackathon 2021, please fill out all sections.)


### My Workflow
Monitor upstream repos, update to the latest tagged version and commits the changes. This then trigger downstream yml files to start a new build. This runs hourly and hence new upstream releases are picked up quickly. 

### Submission Category: 

DIY Deployments


### Yaml File or Link to Code

- https://github.com/jauderho/dockerfiles/blob/main/.github/workflows/update.yml
- https://github.com/jauderho/dockerfiles/blob/main/scripts/updateDockerImages.sh
What, Why and How Code Refactoring.
Tags: programming, computerscience, beginners, webdev
Published: 2021-11-23 20:21:55

Code refactoring is a common terminology in the software engineering field.

### What is code refactoring?

Code refactoring is the process of enhancing and improving the code structure without changing its behavior.

### Why is code refactoring needed?

 Code refactoring is facilitating the code to be more understandable and making it extendable and maintainable. It is a gradual and continuous process. So, if there is a new feature that should be added or a change should be done in the code, it will be easier and more comfortable to extend, amend the existing code moreover it will save time, effort, and for sure money.

### How can a code be refactored? 
One of the refactoring techniques is following the pyramid of refactoring. The pyramid lower levels support the higher levels.
The first block of the pyramid is "*Flow*" which means putting the statements and variables are related to each other in a small concept together.
The next block in the pyramid is "*Methods*". It means extracting those variables and statements to be inserted into smaller methods.
After that a "*Classes*" block, in this step those small methods can be collected in a class, and after adding the related methods in the related classes, patterns can be used.
In the "*Patterns*" step using design patterns that fulfill the need can be chosen for creating classes plus applying the object orient programming concepts to provide the best and optimized interaction between classes.
At the top of the pyramid, there is the "*Architecture*" as we have obtained classes that follow patterns in addition there are packages, modules, and domains, and the architecture is stable now. 

A refactoring pyramid is a twin to test pyramid. The test pyramid covers the whole software testing levels like unit tests, component tests, integration tests, system tests, and UI tests.
While the test levels exist while code refactoring, tests guarantee unchanged code behavior and no code functionality broken.

After discussing code refactoring, now we can say that Code refactoring is very essential and crucial so do not hesitate to invest time in refactoring the written code to touch its value in the short and long run.
Top 3 browser extensions to prevent distraction 
Published: 2021-11-23 20:14:14

In the digital world, it's hard to stay focused for a long time. New notifications and social media feeds keep pushing new “interesting” content to us, effectively distracting us, and before we know it we're spending another hour meaninglessly scrolling through Instagram. Unfortunately, we often lack the willpower to resist such strong social engineering pressure. 

I myself often had this problem and was looking for a solution, in this post I would like to introduce you to the tools i use.


Best tools:

1. BlockSite: Block Websites & Stay Focused

![BlockSite ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q8fcj265wvq6yvgxniob.png)
Do you also sometimes look at social media while working hard and before you know it you've spent half an hour browsing stupid memes? There is a simple way to prevent this. BlockSite is an extension thanks to which you can block specific sites and search phrases during working hours.



2. News Feed Eradicator

![News Feed](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/991wx2hckv7pfj53s11t.png)
Another one is an app that has contributed a lot to my productivity, I use it for youtube, facebook, instagram and twitter. This app blocks feed and all recommended content on these platforms as well as recommended videos on yt. So you can focus only on consuming content related to your work or watching totrials on youtube without fear that you will find another interesting video distracting from your studies. 

Translated with www.DeepL.com/Translator (free version)
Screenshot: 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rknkkxx019t0981m3f3m.jpg)

3. SponsorBlock for YouTube - Skip Sponsorships
![SponsorBlock](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qpedcriga1mtk6iaqbye.png)

Another extension may be a bit controversial, SponsorBlock omits sponsored content from YouTube videos where a device or service is recommended, or simply intro creators to channels. I know that often such ads can last for a long part of the episode, but on the other hand they are also a source of income for the creators. So it is up to you whether you prefer to save your time or watch the commercial and support the creator. I just want you to know that this way of saving time and increasing productivity does exist. 




Check them out and let me know how they work for you and let me know what your ways of not getting distracted. 
peace!
NPM dependencies. В какую категорию импортировать пакет?
Published: 2021-11-23 20:08:38

## Какие есть категории зависимостей?

Обратимся к [официальной документации от NPM](https://docs.npmjs.com/cli/v7/configuring-npm/package-json) 

1. dependencies
2. devDependencies
3. peerDependencies
4. peerDependenciesMeta
5. bundledDependencies
6. optionalDependencies

## Отличия

1. dependencies - то, что реально нужно проекту в production режиме. Например, утилитные библиотеки react, lodash, classnames итп
2. devDependencies - нужны во время разработки (dev). К таким библиотекам могут отнестись: 
    1. библиотеки форматирования - eslint, prettier, ... 
    2. сборщики: webpack, rollup, ...
    3. babel
    4. всё, что связано с тестированием
    5. другие библиотеки, такие как storybook
3. peerDependencies - нужен для публикации своего пакета. В эту категорию попадают зависимости, без которых ваш пакет будет работать некорректно. Проекту, устанавливающему ваш пакет нужно убедиться, что у него загружены все зависимости из peerDependencies
4. peerDependenciesMeta - мета-данные для peerDependencies. Например, чтобы сделать какую-то зависимость опциональной. Хотя, тогда не понятно, зачем она находится в peerDependencies. 
5. bundledDependencies - выполняют схожую функциональность, что и обычные dependencies - входят в финальную сборку. Но они решают следующий пример: проект использует пакет1, в котором есть зависимость пакет2 внутри bundledDependencies. Если по каким-то причинам пакет2 будет снят с пубикации и до него не будет доступа, то пакет1 будет всё равно иметь эту зависимость внутри себя до тех пор, пока явно не почистить node_modules или не убрать пакет2 из зависимости пакета1. 
6. optionalDependencies - то же, что и dependencies, только в случае ошибки их подгрузки сборка не падает

> Перед тем как импортировать зависимость в свой проект, не забудьте спросить себя "А она точно мне нужна?". Может быть вам нужна какая-то малая ее часть, которую вы сможете написать самостоятельно. Но выбор между собственной имплементацией и сторонней - это уже отдельная тема.

twitter [@balaevarif](https://twitter.com/balaevarif)
ImportError: No module named Pandas
Tags: python, programming, codenewbie, tutorial
Published: 2021-11-26 21:44:58

---
title: ImportError: No module named Pandas
published: true
date: 2021-11-23 20:04:33 UTC
tags: #python #programming #codenewbie #tutorial
canonical_url: https://itsmycode.com/importerror-no-module-named-pandas/
---

ItsMyCode |

In Python, if you try to import _`pandas `_without installing the module using pip, you will get no module named pandas error. 

In this tutorial, let’s look at installing the _`pandas `_module correctly in different operating systems and solve no module named pandas error.  

## ImportError: No module named pandas

**`Pandas `** are not a built-in module (it doesn’t come with the default python installation) in Python, you need to install it explicitly using the pip installer and then use it.

If you are getting an error installing pip checkout [**pip: command not found**](https://itsmycode.com/python-pip-command-not-found-solution/) to resolve the issue.

Pandas is distributed through pip as a [wheel](http://pythonwheels.com/), which means you need to install wheel first and then pandas:

## Install pandas in OSX/Linux 

The recommended way to install the pandas module is using pip or pip3 for Python3 if you have pip installed already.

**Using Python 2**

```python
$ sudo pip install wheel
$ sudo pip install pandas
```

**Using Python 3**

```python
$ sudo pip3 install wheel
$ sudo pip3 install pandas
```

Alternatively, if you have easy\_install in your system, you can install pandas using the below command.

**Using easy install**

```python
$ sudo easy_install -U wheel
$ sudo easy_install -U pandas
```

**For CentOs**

```python
$ yum install python-wheel
$ yum install python-pandas
```

**For Ubuntu**

To install pandas module on Debian/Ubuntu :

```python
$ sudo apt-get install python-wheel
$ sudo apt-get install python-pandas
```

## Install Pandas in Windows

In the case of windows, you can use pip or pip3 based on the Python version, you have to install the pandas module.

```python
$ pip3 install wheel
$ pip3 install pandas
```

If you have not added the pip.exe to the environment variable path, you can run the below command in Python 3, which will install the pandas module. 

```python
$ py -m pip install wheel
$ py -m pip install pandas
```

The post [ImportError: No module named Pandas](https://itsmycode.com/importerror-no-module-named-pandas/) appeared first on [ItsMyCode](https://itsmycode.com).
Web Components: Progress
Published: 2021-11-23 19:49:42

## Progress Update 
For this IST 402 project, we were assigned to create a Call  To Action (CTA ) button that would  work on every platform. Essentially every well-designed website on the internet has a CTA button to allow the users to interact and navigate to other pages or components. My partner and I leveraged the class discussions to explore the various ideas for the functionality of the button and  learnt a lot.  

##Issues 
We have created a lot of our Javascript code in VSCode. At first when developing this button we didn't understand how to change the button styles and functionality based on provided attributes. We started with plain HTML and CSS.  Based on previous classes about web design with HTML and CSS, we thought we would have to make use of the constructor but found it easiest to style our button using pure CSS. We also needed to figure out conditional rendering for attributes like icon and link, which we tried to do originally using regular if statements but after doing some research on the lit element docs found a much easier inline way of computing these.

##Successes 
Learning  about all of the different components that go into a CTA button has been a very informative experience. We were able to overcome Some hurdles that had proved to be difficult during the the project like implementing the icon, capturing all the essential button states, accessibility, linking the button to the external website, and resolving merge conflicts on GitHub.

Working in an open-source environment has been extremely beneficial in getting inspiration from our team mates, and for addressing issues with code in a timely manner. Overall, working on a web component for the first time has allowed me to learn a lot about the way websites function, and about the complexity that goes into creating something as simple as a button.
Constructors
Tags: javascript, constructors, webdev, amazon
Published: 2021-11-23 19:43:23

#Some background
I am currently attending Flatiron school and here at this program they introduced their students to constructors. Although I was able to learn what a constructor is I didn't really get the shape of what a constructor is used for. This implored me to ask a friend of mine who works at Amazon currently how important constructors are. He told me that he took a similar journey as mine. He started from the ground and self-taught and moved from job to job until he landed one at Amazon. He told me the importance of constructors that I feel could benefit everyone. 

#What is a constructor?
A constructor is a special type of procedure to create an object. It prepares object made by a constructor to be used later in your code. Additionally, constructors take in arguments that are used to set variable requirements.

#Are there any rules to a constructor?
Indeed, there are 4 basic rules or principles that should be followed in order to ensure that your code is as clean as possible. 

#Rules
1. The name of the constructor should be the same as that of the class name.
2. A constructor cannot be declared as final, static, synchronized, or abstract type.
3. It cannot have an explicit return type.
4. A constructor can have an access modifier to control the access.

#Are there different types of constructors?
Certainly, there are 3 different types of Constructors. Default, No-Args, and Parameterized. 

#This is a default constructor
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a6gycnf0cri15vzr8ynx.png)
Nothing special here a default constructor is what JavaScript builds itself if the constructor is not assigned a class.

#This is a No-Args constructor
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j0rtxma62m4hjxaicldg.png)
The No-Args constructor is quite similar to the default constructor, however the main difference is the that the body of this constructor can have any code where a default constructor can not. In fact, in this example the body of this constructor is empty and there is no value assigned.

#This is a Parameterized constructor
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6u960t69uw7laccyn6nw.png)
Parameterized constructors are constructors that exist with passed arguments or parameters. 

#Key Differences between Constructors and methods. 
Some of you may have been able to point out the similarities between methods and constructors. However, there are some differences that are important. 

1. The constructor class must be the same name as the Class name.
2. Constructors do not have a return type.
3. Constructor is only called when the object is created. 

#Conclusion 
Constructors can be used within classes to contain unique data to when that new object is created. Since constructors are used to set unique data and assigning them to properties allows them to be passed to other class instances. 

[Here is the link to an article that I found that might better explain constructors by Yasir Khatri.](https://tecloger.com/constructor-in-java/)
ImportError: No module named requests
Tags: python, programming, codenewbie, tutorial
Published: 2021-11-26 21:45:32

---
title: ImportError: No module named requests
published: true
date: 2021-11-23 19:39:39 UTC
tags: #python #programming #codenewbie #tutorial
canonical_url: https://itsmycode.com/importerror-no-module-named-requests/
---

ItsMyCode |

In Python, if you try to import `Requests `without installing the module using pip, you will get **no module named requests** error. 

In this tutorial, let’s look at installing the `Requests `module correctly in different operating systems and solve no module named requests error.  

## ImportError: No module named requests

**`Requests `** are not a built-in module (it doesn’t come with the default python installation) in Python, you need to install it explicitly using the pip installer and then use it.

If you are getting an error installing pip checkout [**pip: command not found**](https://itsmycode.com/python-pip-command-not-found-solution/) to resolve the issue.

## Install Requests in OSX/Linux 

The recommended way to install the `requests `module is using pip or pip3 for Python3 if you have pip installed already.

**Using Python 2**

```python
$ sudo pip install requests 
```

**Using Python 3**

```python
$ sudo pip3 install requests 
```

Alternatively, if you have easy\_install in your system, you can install requests using the below command.

**Using easy install**

```python
$ sudo easy_install -U requests
```

**For CentOs**

```python
$ yum install python-requests
```

**For Ubuntu**

To install requests module on Debian/Ubuntu for Python2:

```python
$ sudo apt-get install python-requests
```

And for Python3, the command is:

```python
$ sudo apt-get install python3-requests
```

## Install Requests in Windows

In the case of windows, you can use pip or pip3 based on the Python version you have to install the `requests `module.

```python
$ pip3 install requests
```

If you have not added the pip.exe to the environment variable path, you can run the below command in Python 3, which will install the requests module. 

```python
$ py -m pip install requests
```

The post [ImportError: No module named requests](https://itsmycode.com/importerror-no-module-named-requests/) appeared first on [ItsMyCode](https://itsmycode.com).
conio.h: No such file or directory in linux distribution?
Tags: c, cpp, conio, headerfile
Published: 2021-11-23 19:39:26

### If you face this types of error then you need to do add the conio.h header file into your computer.
#### So how can you do that?
**answer:** You need to follow some steps to configure this.
**Step-1:** Open your terminal and type 
```
sudo apt-get update
```
This will ask you to enter your password.
**Step-2:** Then you need to install a tool called nautilus. Because this will allow you to open your usr directory as **open as administrator** mode. So you need to type the following command
```
sudo apt-get install nautilus-admin
```
Close your terminal.
**Step-3:** Open your file manager.Then open this path. You can find this option bottom left corner in your file manager.
![Other Locations](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/31idm4isagnfcx6qfxy8.png)
Select Computer option
![Select Computer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hx93ag0g8j4ha28aikul.png)
Then you can find root directories
![Computer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xagvit1gkmqr7yoli6t8.png)
Go to the usr directory and right click on the include directory then you will find a new option called **Open as Administrator**
![Run as Administrator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hl5052h9jv2xyyaotm2h.png)
Select this and this will ask you to enter your password. After that your file manager look like this one
![Administrator Mode](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aar1dz6b0h9frahnt6na.png) 
Then open your terminal and type
```
cd Desktop/
touch conio.h
gedit conio.h
```
Then open this [link](https://github.com/marufjs/conio.h/blob/master/conio.h) and open raw option 
![Select Raw](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ls38n1v44r2ifzmnvfmk.png)
Then copy those lines of code and paste it in the opening text editor and save it.
**Step-4:** Copy this file(conio.h) and paste it here
![Administrator Mode](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ieauhj3hk00hy3kyt9rd.png) 
## Congratulations you completed all the steps. Now you are able to use conio.h header file in your c or cpp program. 
`Happy Coding`
### Subscribe my [channel](https://www.youtube.com/channel/UCWigpkRyVFi8F6sZ4SjcDpA/) for get updated.
JS Frameworks-Boilerplates Comparison
Published: 2021-11-23 19:21:13

In Week 3 of class, our group had to install four boilerplates into our git repo: 
- Angular
- Vue
- React 
- StencilJS.

##Similarities between the Boilerplates 
Each single one of the boilerplates possesses a package.json file showing the installed dependencies and available scripts to run the boilerplate. 
Each boilerplate has basic dev tools to get it set up and running in an environment. 
Each boilerplate has README files 


## Best Boilerplate
Of all the four boilerplates, I would say the React Boilerplate is the easiest to setup and use.  It's intuitive nature makes it very easy to set up the boilerplate. For the class project, I chose react and I seemed to have a much easier time than all of my other teammates in getting it up and running.  Having never used it before, I appreciated that React had everything I needed to make changes to the main page encapsulated into one folder. React also has a  great amount of support for its components and dependences which really helps when configuring any issues incase they arise.

##Preferred Boilerplate for next project
I think I would stick to the React boilerplate because it has the highest number of people working to support it which can really make a big difference when desiring  a quick plug-and-play experience.
The only downside is that React requires adding libraries to make it a complete framework and leverage some of its advanced features. However it is still the easiest to setup and get running. 

Link to get the react boilerplate:
https://github.com/react-boilerplate/react-boilerplate

Link to my group's organization:
https://github.com/ist402groupj/boilerplates