teleren/devto huggingface dataset:
[Tutorial] Instalando o Node.JS e o Node Version Manager (NVM) no Linux (Ubuntu e derivados)
Tags: nvm, node, javascript, womakerscode
Published: 2020-09-19 15:35:09

Antes de começarmos a instalação, precisamos atualizar o sistema.

> [saiba como atualizar seu Linux aqui.](https://dev.to/womakerscode/tutorial-linux-terminal-atualizando-o-sistema-n1a)

Em seguida, vamos instalar as bibliotecas de desenvolvimento, com o comando:

```
$ sudo apt install build-essential libssl-dev
```

- **$** indica que você deve usar o **usuário comum** para fazer essa operação.

- **sudo** serve para pedir permissões de administrador temporariamente.

- **apt** do inglês, *Advanced Package Tool*, em português, Ferramenta de Empacotamento Avançada; é a ferramenta que nos ajuda na instalação, atualização e desinstalação de programas, entre outras funções.

- **install** é o comando de instalar, indicando ao apt o que fazer.

- **build-essential** é uma biblioteca que reúne diversas aplicações para compilar e instalar outros programas, que inclui, por exemplo, o make, automake, etc.

- **libssl-dev** é uma biblioteca com arquivos para desenvolvimento.

Agora faremos a instalação do **NVM** que permitirá a instalação de várias versões do Node e nos permitirá alternar entre elas, caso necessário:

```
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
```

- **curl** é uma ferramenta em linha de comando para transferência de dados com sintaxe URL.

- O parâmetro **-o-** indica que a saída do arquivo terá seu nome mantido (sem modificações).

- **https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh** é o endereço web onde está o script que queremos baixar.

- **|**, conhecido como **pipe** (tubo), que faz o encadeamento de processos. Ele permite conectar a saída padrão de um comando à entrada padrão de outro.

- **bash** é um interpretador de comandos. É ele quem vai rodar o script que baixamos.

> O número da versão pode mudar com o tempo. Acesse a página do [projeto no GitHub (clique aqui)](https://github.com/creationix/nvm) e procure pela versão mais recente, caso seja necessário.

Após a instalação do script acima, feche o terminal e abra um novo.

Execute o comando

```
$ nvm ls-remote
```

Ele vai exibir várias versões do Node e assim sabermos se o **NVM** está funcionando corretamente.

Escolha uma versão para instalar. Por exemplo:

```
$ nvm install v14.11.0
```

Caso você instale mais de uma versão e no futuro tenha necessidade de alternar entre elas utilize o comando:

```
$ nvm use <número da versão>
```

Verifique a versão do Node que foi instalada com o comando:

```
$ node -v
```
Pushing an Image to Docker Hub Repository
Tags: docker
Published: 2020-09-19 15:31:39

Login first.

```
$ docker login
```

Check the container id for uploading.

```
$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                               NAMES
9dd3857e08fb        up_django           "python manage.py ru…"   36 hours ago        Up 2 minutes        80/tcp, 0.0.0.0:8000->8000/tcp      up_django_1
```

We will push `up_django`.

```
$ docker commit 9dd3857e08fb up-django-container:ver-1
```

We will attach a tag and remote repository name to the local repository image.

```
$ docker tag up-django-container:ver-1 USERNAME/up-django-container:ver-1
```

Finally push the image.

```
$ docker push USERNAME/up-django-container:ver-1
```

We will see the repository uploaded to on the online docker hub website.
Crack the Software Interview and the perfect Resources
Tags: computerscience, career, interview, resources
Published: 2020-09-19 15:29:48

There are millions of resources out there in the world of Internet and how do we find the perfect resources to ace the Software Interview ?

At First we need One Productivity app to store the best websites and their links at one place. Don't worry i had it covered for you.

Oh yess!!! i will guide you.

### Notion (Productivity App)
PS: Not sponsored
I have been using Notion from past two weeks and  i found it Quite interesting. Notion makes my daily routine easy and manage my tasks. There are many templates or you can build it from scratch.

Take a look at this Video if you don't believe me {% youtube 536Q_kIImWk %}

So get organized Guys!!!

## Questions to ask Interviewer😂😂
Hahahhaha don't worry i had covered it for you.

[Questions to ask Interviewer](https://yangshun.github.io/tech-interview-handbook/questions-to-ask/)

just hop on the link and get Prepared.

## Best basic materials you can find about CS
The material is written by one of the DEV SDE it was a quite popular one check it out !!!

[base.cs](https://medium.com/basecs/tagged/algorithms)

## System design
System design one of the important topic if you want ace it just be prepared.

Here i am going to give you the playlist which i found very good
hope you like it.

[Playlist Link](https://www.youtube.com/playlist?list=PLMCXHnjXnTnvo6alSjVkgxV-VH6EPyvoX)


## LEET CODE PROBLEMS MUST PRACTICE

1. [Arrays](https://leetcode.com/list/5xddthot)
2. [Fast & Slow Pointers](https://leetcode.com/list/5xdd6tj3)
3. [Backtracking](https://leetcode.com/list/5xddtber)
4. [Dynamic programming](https://leetcode.com/list/5xddq6hh)
5. [merge Intervals](https://leetcode.com/list/5xddsm45)
6. [k- way Merge](https://leetcode.com/list/5xddzn17)
7. [Graph Traversal](https://leetcode.com/list/5xddklbm)
8. [In place Reversal Of LL](https://leetcode.com/list/5xddgdy1)
9. [Modified Binary Search](https://leetcode.com/list/5xdd4oz6)
10. [Sliding Window](https://leetcode.com/list/5xdd15g2)
11. [Top K elements ](https://leetcode.com/list/5xddycqi)
12. [Tree DFS](https://leetcode.com/list/5xd0xd0r)
13. [Tree BFS](https://leetcode.com/list/5xd05nws)
14. [Two Pointers](https://leetcode.com/list/5xd0hl7t)


 **Add the Lists into your Leet code account and Practice**



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

[NOTION TO-DO LINK](https://www.notion.so/f32f47b706ad4749a25951d193ebceb7?v=7f96260b0be542f2bfb2886c97316b0a)
I will give you my Notion "To-do" link where you can find all the links of materials and resources...

I am new to DEV community i am here to help others if there are any mistakes please let me know i will try to rectify it.

Thanks for reading ❤
GitHub CLI 1.0 is now available
Tags: github, git, opensource
Published: 2020-09-19 15:29:42

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


#### What is github Cli ?
GitHub cli brings pull requests, issues, and other GitHub concepts write into your Terminal.It reduces context switching, helps you focus, and enables you to more easily script and create your own workflows.

#### What is the benefit of Github cli:-
Can run entire GitHub workflow from the terminal, from issues through releases no need to open the github.com and do all those stuff that is done after commiting and pushing code.

#### How to install:-
Mac Users - ```unix
brew install gh
```
Window Users - ```window
choco install gh
```
Linux Users -```linux
sudo apt install gh
```
####Authentication:-
**Step 1:**Run the command **gh auth login** in your terminal.
```
C:\Windows\system32>gh auth login
? What account do you want to log into?  [Use arrows to move, type to filter]
> GitHub.com
  GitHub Enterprise Server
```
**Step 2:** Select the option shown in step 1.
Now press enter and enter login with browser.
```
- Logging into github.com
? How would you like to authenticate?  [Use arrows to move, type to filter]
> Login with a web browser
  Paste an authentication token
```
**Step 3:** 
You will be asked to copy one-time code and enter this code into the browser for login.
```
! First copy your one-time code: 44D6-2E80
- Press Enter to open github.com in your browser...
```
**Step 4.** Now authorize for login and give your github password.
**Step 5.** All Done.

Now you are ready to use github cli commands.

**Note:** *Github cli is written in Go lang(99.6%)*

I will post how to use the github cli commands for doing many operations in my next blog so stay tuned........
5 CSS Properties You Probably Did Not Know About
Tags: css, frontend, webdev
Published: 2020-09-19 15:23:08

I have been studying a lot of new CSS properties in order to up my game as a frontend developer.

I am fascinated by the new CSS properties I have come across and utilized in my recent projects. Therefore, I am going to share 5 CSS properties you probably didn't know about.

**1. @media (hover: none) or @media(hover: hover)**
How do you know if users are viewing your web application with a touch-screen device (e.g mobile phones) or a non-touch-screen device (e.g desktop/laptop)? 

You can determine this by using the media query above.

This is important because some CSS properties like **hover** may not be so important when applied to touch screen devices. The hover effect is not so obvious on touch screen devices.

**@media all and(hover: none) {
  *apply styles for touch screen devices e.g mobile phones*
}**

**@media all and(hover: hover) {
  *apply styles for non-touch-screen devices*
}**

The CSS property in the codepen below will only apply on *non-touch-screen devices* when users **hover** on the text. Therefore, if you are viewing this on your mobile phone, the hover effect will not work.
{% codepen https://codepen.io/timopharm/pen/bGpmMKq %}

**2. selection pseudo-class**
The selection pseudo-class lets you define custom colors and background colors that appear when users try to **copy texts** on your web applications.

{% codepen https://codepen.io/timopharm/pen/wvGYvwO %}

**3. hyphens** 
By setting the hyphens property to **auto**, texts on your webpages will be automatically hyphenated.

In the codepen below, try resizing the browser and see hyphens automatically apply to the texts
{% codepen https://codepen.io/timopharm/pen/bGpmMwe %}

**4. background-clip**
When set to **text**, the background-clip property is useful for creating linear-gradients on texts.
However, to work on the chrome browser, you need to add the *-webkit* prefix.
{% codepen https://codepen.io/timopharm/pen/vYGVjWY %}

**5 @supports**
This is a very useful CSS property. It lets you set styles that should only apply when a browser supports a CSS property.

In the codepen below, the **@supports** property will ensure that the **backdrop-filter** CSS property will only be applied on browsers that support the property. Hence, if you view the webpage with a browser that doesn't support the property e.g firefox, then the *backdrop-filter* won't be applied. You will need to set up a default property that should apply. In this case, I used background-color as the fallback property.

**Click the button to view the modal**

{% codepen https://codepen.io/timopharm/pen/wvGYjOe %}

**And that's it!**

If you find any of these CSS properties interesting, please leave a comment below. I'd also love to learn about new CSS properties that you have come across lately.

**Thanks for reading.**
Does Python has a main function?
Tags: python, beginners, python3
Published: 2020-09-19 15:03:46


## What is the main method?

If you're familiar with languages like `C`, `C++` etc you may have noticed the fact that we must need to use the `main()` method in your code. As those languages use the compiler(*compiles all code at once*) to run the code, it needs an entry point to start the compilation. But Python uses an interpreter(*compiles code line by line*), which means it doesn't need an entry point it'll simply start compilation from line 1. So, <b> Python doesn't have a main function </b>. But it has a concept called `main modules`.


## The `__name__ ` variable in Python

The `__name__` is a special predefined variable in Python which stores the name of the current module. 

### Example

Consider the following code in a file `file1.py`,

```python
# file1.py
print(__name__)
```
This code outputs,

```
__main__
```
Python by default stores the value of `__name__` variable as `__main__` (*which indicates that this is the main module *)

Now, consider the below code in a file `file2.py`,

```python
# file2.py
import file1
print(__name__)
```
I imported `file1` here and printed the `__name__`
Now, the above code outputs,
```
file1
```

## What's the point here?

As you saw above, `file1.py` doesn't have any imported code. That's why the `__name__` variable has a value of `__main__` which means it is the `main module` but in `file2.py` we have imported the `file1.py` into `file2.py`. Then the interpreter changes the `__name__` variable to the imported module name in our case its `file1`. 

> if the module doesn't have any imports, then it will be the main module.

Now if you want to do certain things only in the `main module` not in the imported code, you can do like below.

```python
def show ():
   print("Hello world")

# Only call the show method in main module 
if __name__ == "__main__" :
   show()
 
```
There's no actual reason to use this above process. Its just a feature :)
Rails Portfolio Project Flatiron School (mod3 project)!
Tags: flatironschool, rails
Published: 2020-09-19 14:53:27

Rails contains alot of magic, it provides all kinds of generators that can make live easier. As part of our project we were told to stay away from the scaffold generator. The command ‘rails new ordersystem’ already creates a big part of our project by creating the entire filestructure. 
What I learned is to be aware what version it will use during creating a new app. Two days in my project I discovered my project was using Rails 6.0.1. Our cohort lead has advised to switch to postgresql in stead of sqlite. During a live lecture he lead us through the setup and it was working without trouble on my side. Needless to say when re-initiating my project with Rails 5.2.3 I forgot to complete the ‘rails new’ command with the database option to use postgress. when I noticed that and with the break-week available I decided to start again with the correct Rails version and a Postgres database.

Different than in Sinatra, and maybe lacking in the magic, is that although having the option to configure the database automatically we have to run ‘rails db:create’ to create it.

The reason for the ‘stay away from the scaffold generator’ is that for a single model project it will generate literally everything for you to get things up and running very quick. Only the big question will be if the stuff generated is to your liking. Most likely you want things to be different and change things. Also the question will be, if you have to use generators like scaffold do you really learn how rails works.

That still leaves us with a lot more but we will use the following generators:

model
resource
controller
migration

The model generator is the simplest one. When used it will generate a database migration file and a ruby model.
rails generate User name username email
Will create:
a migration in db/migrate/20200710934260_create_users.rb

```
class CreateUsers < ActiveRecord::Migration[5.2]
  def change
    create_table :users do |t|
      t.string :name
      t.string :username
      t.string :email
      t.timestamps
    end
  end
end
```

the User model in app/models/user.rb

```
class User < ApplicationRecord
end
```

In addition of this the resource generator will generate an entry in the /config/routes.db file to all the restful routes in the UserController that will also be generated.

The controller generator will generate the controller, the views folder, the helper for the controller and two files in the assets folder for javascript and stylesheet. If you add an action to the end of the generator it will also create the view file for it.

The migration generator can be used to create a migration file either for the initial setup (create) of the table or to edit the content of the table (eg. rename column, add column)

All this creates the magic of Rails, more or less after setting up your application with this you only have to add some logic to your controller methods and you are up and running. It is a bit simplistic to state it like this as it still took me about a week to complete my project, but in big lines it is that simple.
I created Golang edit distance & string comparison library : Go-Edlib
Tags: showdev, go, algorithms, contributorswanted
Published: 2020-09-19 14:50:31

# Edit Distance?
Edit Distance is a metric used to quantify the dissimilarity between two strings by counting the amount of operation needed to transform one to another. Depending on the algorithm chosen, the operations allowed may include: addition, deletion, substitution and finally translation.

This measurement can then be used to calculate a percentage of similarity between two strings with this formula:

>(maxLength - distance) / maxLength

To illustrate this, we will look at the Levenshtein algorithm. Levensthein is one of the most known edit distance algorithm. It was created by the Soviet mathematician Vladimir Levenshtein, who considered this distance in 1965. It allows insertions, deletions or substitutions.

For example, the Levenshtein distance between “kitten” and “sitting” is 3 since, at a minimum, 3 edits are required to change one into the other.

- kitten → sitten (substitution of “s” for “k”)
- sitten → sittin (substitution of “i” for “e”)
- sittin → sitting (insertion of “g” at the end).

# What is it used for?
Edit distance can be used in several application areas such as:
- Fuzzy search algorithms
- Correction of spelling mistakes
- Word completion
- DNA sequence alignment algorithms
- Pattern matching
- And many more!

# So what is go-edlib?
Go-Edlib is a new open-source library for Golang that implements most popular edit distance algorithms and soon all of them! Currently, it includes: Levenshtein, LCS, Hamming, Damerau-Levenshtein (OSA and Adjacent transpositions algorithms), Jaro/Jaro-Winkler.
All these algorithms have been implemented in such a way as to be fully compatible with Unicode

It also includes fuzzy search algorithms based on edit distance and few others string comparisons functions.

Link: https://github.com/hbollon/go-edlib

I'm actively looking for feedback and/or contributions to improve this library or to have new functionality ideas to add! :)
PS: I would also like, if possible, opinions on the quality of my documentation and possibly points to improve
Neon Text Effect
Tags: css, html, webdev, weeklyui
Published: 2020-09-19 14:38:52

Neon Text Effect is like a transforms photoshop text in beautiful glow effects. Here made these effects using a single line of CSS properties with the help of HTML.

In this element, we used text-shadow effects which help to show effects in Neon text. We used one heading tag and CSS text-color.

Make it yours now by using it, downloading it, and please share it. we will design more elements for you.

[Source Code](https://w3hubs.com/neon-text-effect/)
🧽 How I learned to clean up after another dev...
Tags: career, javascript, webdev, motivation
Published: 2020-09-19 14:38:09

At some point in a career, you always have to pick up where someone left and then, you hit that wall and ask yourself:
> What kind of idiot wrote that?!


We all go trough that and we're all that idiot once too. 

I do think tough that there are better ways to go trough your day without all the rage that comes with it.

# 1. Keep a levelled head
No one will benefit from rage and complains. We all want to yell and express how we think the person before us screwed up, blame someone for everything wrong in the world to relieve ourselves for the delays and bugs. Take a deep breath, fix one thing at a time and move on in the project. Stop saying: 
> Someone else f'd up.

and go to:
> I'm improving a lots of things.


# 2. Learn from it.

When we learn the job, we hear a lot of things to do and not to do, but as long as someone keep us in the right track, we never really understand why a [Godclass](https://wiki.c2.com/?GodClass#:~:text=A%20%22God%20Class%22%20is%20an,Synonym%3A%20AcmePattern) is bad.


# 3. Don't bring other down.

If you can see the project you are working on as a mess on first sight, your colleagues probably can too. No one Gain from pushing each other down the mountain and you can only improve morale by trying to keep a positive attitude and showing everyone else that this can't stop you

# 4. Move on one step at a time.

No matter how large the project is and how little you know about it, the more you try to take in at the same time, the less you might understand... Ask around what should be done first, see if it work, fix as much as you can, then go to the next step. By focusing on one problem, you improving your chance of actually getting trough.

Thats it, if you feel some things are missing, don't hesitate to comment below!
Using DJL.AI For Deep Learning Based Sentiment Analysis in NiFi DataFlow
Published: 2020-09-19 14:37:33

---
title: Using DJL.AI For Deep Learning Based Sentiment Analysis in NiFi DataFlow
published: true
date: 2020-09-19 14:33:00 UTC
tags: 
canonical_url: 
---

# Using DJL.AI For Deep Learning Based Sentiment Analysis in NiFi DataFlow 

[![](https://1.bp.blogspot.com/-7PbVZouBgCY/X2YWNYrjUtI/AAAAAAAAboc/bRv5yte9VMAoLzd4R8TweMOrQrU0V5iOQCLcBGAsYHQ/w699-h579/DeepLearningExampleFlowSentimentBERT.png)](https://1.bp.blogspot.com/-7PbVZouBgCY/X2YWNYrjUtI/AAAAAAAAboc/bRv5yte9VMAoLzd4R8TweMOrQrU0V5iOQCLcBGAsYHQ/s1294/DeepLearningExampleFlowSentimentBERT.png)

  

#### Introduction:

I will be talking about this processor at Apache Con @ Home 2020 in my "Apache Deep Learning 301" talk with Dr. Ian Brooks.

Sometimes you want your Deep Learning Easy and in Java, so let's do that with DJL in a custom Apache NiFi processor running in CDP Data Hubs.

### Grab the Source:

[https://github.com/tspannhw/nifi-djlsentimentanalysis-processor](https://github.com/tspannhw/nifi-djlsentimentanalysis-processor)

### Grab the Recent Release NAR to install to your NiFi lib directories:

[https://github.com/tspannhw/nifi-djlsentimentanalysis-processor/releases/tag/1.2](https://github.com/tspannhw/nifi-djlsentimentanalysis-processor/releases/tag/beta)

### Example Run

probnegative

0.99

No value set

probnegativeperc

99.44

No value set

probpositive

0.01

No value set

probpositiveperc

0.56

No value set

rawclassification

[class: "Negative", probability: 0.99440, class: "Positive", probability: 0.00559]

#### **Demo Data Source**

https://newsapi.org/v2/everything?q=cloudera&apiKey=REGISTERFORAKEY

  

[![](https://1.bp.blogspot.com/-rV-WEDtWWpI/X2YWlr9atEI/AAAAAAAAbok/yYkMuqYJllw1e_kjPV044aZINWBk1vn5wCLcBGAsYHQ/w652-h428/djlsatest.png)](https://1.bp.blogspot.com/-rV-WEDtWWpI/X2YWlr9atEI/AAAAAAAAbok/yYkMuqYJllw1e_kjPV044aZINWBk1vn5wCLcBGAsYHQ/s2048/djlsatest.png)
  

  

#### **Reference:**

- [Deep Learning Sentiment Analysis with DJL.ai](https://docs.djl.ai/examples/docs/sentiment_analysis.html)
- [https://github.com/awslabs/djl/blob/master/mxnet/mxnet-engine/README.md](https://github.com/awslabs/djl/blob/master/mxnet/mxnet-engine/README.md)
- [https://github.com/aws-samples/djl-demo/tree/master/flink/sentiment-analysis](https://github.com/aws-samples/djl-demo/tree/master/flink/sentiment-analysis)
- [https://github.com/awslabs/djl/releases](https://github.com/awslabs/djl/releases)

### Deep Learning Note:   

The pretrained model is DistilBERT model trained by HuggingFace using PyTorch.

### Tip

Make sure you have 1-2 GB of RAM extra for your NiFi instance for running each DJL processor.   If you have a lot of text, run more nodes and/or RAM.   Make sure you have at least 8 cores per Deep Learning process.   I prefer JDK 11 for this.

**See Also:**    [https://www.datainmotion.dev/2019/12/easy-deep-learning-in-apache-nifi-with.html](https://dev.to/tspannhw/easy-deep-learning-in-apache-nifi-with-djl-2d79)