teleren/devto huggingface dataset:
Ruby Authenticate, Bcrypt, and Salt
Published: 2022-04-11 15:59:42

This blog I will tell how to encryption you're form login using Bcrypt. This blog will user the language ruby with the frame work rails, and the appropriate gems.

1. The first step is make user your routes for signing are working. Here is an example of code found in my config folder in the routes.rb file.


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

2. Then make sure the gem file the gem bcryp is present, followed by making sure you middle ware, the piece interacting with the cookies and session is present. My middle ware is located in config folder in the application folder.


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


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

BONUS: in the dev tools go to application section and select the server, and when interaction with cookies it will render in the format of key and values.

        The preparation are complete 

3. Next we will use Bcrypt's built in features """""has_secure_password """ which utilities other built in features such as password_digest and BCrypt::Engine (salt). For you to to obtain the benefit of all the features the gem provides with regards to security, you will need to go model were the client will create and have there account displayed and place the following information. For this example I used the user model located inside the app folder in the model folder.


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

      Below  I will expand about password_digest and salt you will
      not need this information for the code work the above is
      more then enough

1. Create a function which uses take a parameter. In it a salt will be used, it will be best to put to a variable. Then in the function password_digest is used to the command hash_secret, which will take the parameter and the salt variable. This will create a 60 character encryption, greater then the salt being used only and generate a 29 character encryption


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

2. finally another function created to check the password inputted unless it is a match. in this function all the steps will be repeated with the exception of the use of returning two possibility one for granting access and other for rejection.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ui3zh98ytv6puetoq0q.png)
Django User Login and Logout View
Published: 2022-04-11 15:56:11

**Login.html**

```html
<form method="POST">
    {% csrf_token %}
    {{ form }}
    <button type="submit" class="btn btn-outline-info">LOGIN</button>
        <a href="{% url 'register' %}">SIGN UP</a>
    </form>

```
**urls.py (main project)**

```python
from django.contrib import admin
from django.urls import path
from django.contrib.auth import views as user_views

urlpatterns = [
    path('admin/', admin.site.urls),
path('login/',user_views.LoginView.as_view(template_name='app/login.html'),name='login'),
    path('logout/',user_views.LogoutView.as_view(),name='logout'),
]


```
**setting.py**

```python
LOGIN_REDIRECT_URL = 'home' ('Put your URL you want to redirect')
LOGOUT_REDIRECT_URL = 'login' ('Put your URL you want to redirect')
```
Enjoy !!
Your first service
Tags: opensource, embedded, microservices, luos
Published: 2022-04-11 15:50:50

After completing the Get started, you can grasp what a microservice is in an #edge and #embeddedsystem. However, Luos is still black magic to you.

⏩ https://docs.luos.io/tutorials/your-first-service

Let us demystify it for you by helping you build your first service code! A part 1 focused on a Luos service, and a part 2 that will allow you to create a package.


Concerned hardware in this tutorial: Arduino and ST boards.
Database Transactions - Laravel
Tags: laravel, php, webdev, database
Published: 2022-04-11 15:49:42

I found this wonderful article https://fideloper.com/laravel-database transactions that talks about Transactions and its importance in dealing with databases when entering or modifying more than one data in more than one table so that we can be confident that all the values ​​in the table are entered correctly, so I hope it will be useful to you in your next projects.

- without Transactions 

```php
// Create Account
$newAcct = Account::create([
    'accountname' => Input::get('accountname'),
]);

// Create User
$newUser = User::create([
    'username' => Input::get('username'),
    'account_id' => $newAcct->id,
]);
```

- Our Transactional Toolset

```php
// Start transaction
beginTransaction();

// Run Queries
$acct = createAccount();
$user = createUser();

// If there's an error
//    or queries don't do their job,
//    rollback!
if( !$acct || !$user )
{
    rollbackTransaction();
} else {
    // Else commit the queries
    commitTransaction();
}
```

- Basic Transactions

```php
DB::transaction(function()
{
    $newAcct = Account::create([
        'accountname' => Input::get('accountname')
    ]);

    $newUser = User::create([
        'username' => Input::get('username'),
        'account_id' => $newAcct->id,
    ]);

    if( !$newUser )
    {
        throw new \Exception('User not created for account');
    }
});
```

- Advanced Transactions

```php
// Start transaction!
DB::beginTransaction();

try {
    // Validate, then create if valid
    $newAcct = Account::create( ['accountname' => Input::get('accountname')] );
} catch(ValidationException $e)
{
    // Rollback and then redirect
    // back to form with errors
    DB::rollback();
    return Redirect::to('/form')
        ->withErrors( $e->getErrors() )
        ->withInput();
} catch(\Exception $e)
{
    DB::rollback();
    throw $e;
}

try {
    // Validate, then create if valid
    $newUser = User::create([
        'username' => Input::get('username'),
        'account_id' => $newAcct->id
    ]);
} catch(ValidationException $e)
{
    // Rollback and then redirect
    // back to form with errors
    DB::rollback();
    return Redirect::to('/form')
        ->withErrors( $e->getErrors() )
        ->withInput();
} catch(\Exception $e)
{
    DB::rollback();
    throw $e;
}

// If we reach here, then
// data is valid and working.
// Commit the queries!
DB::commit();
```

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

I tried to present some basic points, but to go deeper, visit the source.
I hope you enjoyed with me and I adore you who search for everything new.
Should you use AWS X-Ray for all of your lambdas in AWS?
Tags: aws, lambda, xray
Published: 2022-04-11 15:39:46

---
title: Should you use AWS X-Ray for all of your lambdas in AWS?
published: true
description: 
tags: aws, lambda, xray
//cover_image: https://direct_url_to_image.jpg
---

As the title states, do you typically use X-Ray in all of your lambdas? What reasoning do you typically use for justifying one way or the other?

---
Find me on [Twitter](https://twitter.com/therealdakotal) | [LinkedIn](https://www.linkedin.com/in/dakota-lewallen/)

Sponsor me on [Github](https://github.com/iamflowz)
Como instalar o Phoenix no Linux Ubuntu 20.04?
Tags: elixir, phoenix, liveview
Published: 2022-04-11 15:31:20

Meu computador teve problemas recentemente e tive que reinstalar meu sistema operacional. Estou usando agora o Linux Ubuntu 20.04.

Eu instalei as versões mais recentes de Erlang e Elixir usando asdf, mais ou menos como está descrito neste post do [Allef Gomes](Instalação do Erlang e Elixir com ASDF no Ubuntu).

Hoje, ao fazer uma aula do [ELX PRO](https://www.elxpro.com/), percebi que estava sem o Phoenix instalado e, portanto, não podia criar um projeto com Phoenix LiveView.

As [instruções de instalação do Phoenix estão no site do projeto](https://hexdocs.pm/phoenix/installation.html). Eu já as tinha seguido antes, logo eu queria apenas um resumo e abaixo estão os comandos que tive que digitar.

# Instalando o Phoenix

## Pré-requisito

- Ter Erlang 22 ou superior instalado
- Ter Elixir 1.12 ou superior instalado

## Instalando o Phoenix

- mix local.hex
- mix archive.install hex phx_new

## Instalando o PostgreSQL

Fonte: https://www.digitalocean.com/community/tutorials/how-to-install-postgresql-on-ubuntu-20-04-quickstart-pt

- sudo apt update
- sudo apt install postgresql postgresql-contrib

## Instalando inotify-tools 

- sudo apt-get install inotify-tools

# Final

Pronto! Agora, para criar e executar um projetinho em Phoenix Live View, basta digitar algo como:

```
> mix phx.new projetinho --live --binary-id
> cd projetinho
> mix ecto.create
> mix phx.server
```

Detalhe importante: eu tive problemas com o usuário `postgres` no Ubuntu. Tive que redefinir a senha do usuário e colocar a nova senha no arquivo `config/dev.exs`. Depois disso, ainda tive que seguir os passos [neste link que o Allef me passou](https://stackoverflow.com/questions/10845998/i-forgot-the-password-i-entered-during-postgres-installation). 

Tive que colocar a linha `host  all   all  127.0.0.1/32  trust` no aqrquivo `pg_hba.conf` (fazendo `sudo gedit /etc/postgresql/12/main/pg_hba.conf`).

Depois disto, tive que reiniciar o postgres:
`> sudo /etc/init.d/postgresql restart`


Depois, foi só abrir o browser em http://localhost:4000 e minha página estava no ar localmente.

## Atualização em 15/07/2022

Tive também que mudar a senha do usuário postgres no próprio postgres

```
# sudo -u postgres psql
could not change directory to "/root"
psql (...)
Type "help" for help.

postgres=# \password
Enter new password:
Enter it again:
postgres=# \q
```
**Conhece uma forma melhor de fazer o mesmo? Compartilhe!**
Empleos en Data y Analytics LATAM — Abr 2022 - II
Published: 2022-04-11 15:28:15

Te compartimos las ofertas laborales del mes para áreas de Data, Analytics y Cloud 👨‍💻👩‍💻.

✅[Data Analyst- Cornershop by Uber (Perú, Lima)]
(https://pe.indeed.com/viewjob?jk=79a4fd19bad135c8&tk=1g0cj928hkuh4801&from=serp&vjs=3)
✅[Data Engineer- Factor IT (Colombia, Bogotá)]
(https://co.indeed.com/ver-empleo?cmp=Factor-IT&t=Data+engineer&jk=cdd0232fedfeb6d5&q=Data+Engineer&vjs=3)
✅[Data Scientist - Banco Pichincha (Ecuador, Quito)]
(https://ec.indeed.com/viewjob?jk=6820b27eb9fa44bf&tk=1g0cjehh1i7lq800&from=serp&vjs=3)
✅[Machine Learning Analyst - Perficient (Chile, Valparaíso)]
(https://cl.indeed.com/viewjob?jk=a8892a45eac5fa4a&tk=1g0cjjkp1q6ki802&from=serp&vjs=3)
✅[Data Analyst - HP (Mexico, Ciudad de México)]
(https://mx.indeed.com/viewjob?jk=4a9c4ca92224bb6b&tk=1g0cjkun0t4ri801&from=serp&vjs=3)
✅[Data Engineer- Avenue Code (Bolivia, Santa Cruz)]
(https://www.linkedin.com/jobs/view/2995107138/?eBP=NotAvailableFromMidTier&recommendedFlavor=ACTIVELY_HIRING_COMPANY&refId=ng7EK4WhTyejV9hB6qfmvQ%3D%3D&trackingId=dTcxu4J3OJjubTPE%2F27Ndg%3D%3D&trk=flagship3_search_srp_jobs)
✅[Data Scientist - Equifax (Argentina, Buenos Aires)]
(https://ar.indeed.com/viewjob?jk=900c75464f141086&tk=1g0cjobv7mfoh800&from=serp&vjs=3)
✅[Machine Learning - BairesDev (Venezuela, Caracas)]
(https://ve.indeed.com/viewjob?jk=7daeaae25443a857&tk=1g0cjppdfmfoh801&from=serp&vjs=3)
✅Preauth is hiring (Remoto)
[Data Scientist, Product Manager, Growth Manager, Operaciones/Soporte, Software Engineer.]
(https://preauth.notion.site/Preauth-is-hiring-6337f811353c4da8b33e49e5efdbd10b)

Aprende, aplica y crece en proyectos de Data y Analytics en Cloud.

Visita nuestra página:
👉🌐 datahack.la
Easy Start with SDL2
Tags: sdl2, c
Published: 2022-04-11 15:24:30

Getting setup with SDL2 can be quite difficult. Getting the editor setup is easy enough, but what is the best way to create a window? How should we handle input? How do we compile it? 

However, in an attempt to help, I've created this Github repository to easily set up a SDL2 project with a window, user input, and compilation already done. 

You can find the repository [here](https://github.com/STCollier/SDL2-Starter-Template).

The code is pretty self explanatory, but I'll go over a few things. Firstly, all the main components of the window are located in a struct called `Game`. (This struct is located in the global scope, but you can change that if you like, and pass `Game* game` as a parameters to the functions.)

With this struct, to access the window, just type `game.window`, or to access the renderer, just type `game.renderer.` (If struct is not global, do `game->window`, etc.) 

Notice that there are also two functions, `initialize()` and `handle_input()`. `initialize()` just creates a window and sets up the renderer; `handle_input()`, however, allows you to easily check user input, by typing a conditional like so: 
```c
if (game.input[**SDL_SCANCODE_KEY**]) {
    //Do something
}
```
I created another article explaining this in more detail [here](https://dev.to/stcollier/easy-and-clean-sdl2-keypress-setup-with-c-5948).

Finally, to compile (with linux), make sure you have the GCC compiler installed, go to the project directory, type `cd build` (to get into the `build` directory), and type `sh run.sh`. The compile commands are already set up in the SH file. The result should look something like this:

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

If you have some trouble setting this up, I have a visual example (no audio) linked [here](https://www.youtube.com/watch?v=-ONdG5Q47As). 

Anyways, I hoped you enjoyed this quick overview and find the repository useful. Happy coding!!
讓 Python 程式折行的方法
Tags: python
Published: 2022-04-11 14:24:50

你一定有遇過幫物件取了很棒的名字, 具有說明意義, 一看就懂, 但唯一的問題就是名字可能很長, 例如以下這幾個一看就懂的名字：

```python
>>> long_name = 10
>>> long_long_name = 20
>>> long_long_long_name = 3
```

這些名字看起來很棒, 可是當你要用在運算式中時, 就可能會變這樣：

```python
>>> a = long_name + long_long_name + long_long_long_name
>>>
```

如果你很討厭這麼長的運算式, 也可以用[脫義字元](https://docs.python.org/3/reference/lexical_analysis.html#explicit-line-joining)來取消斷行, 像是這樣：

```python
>>> a = long_name + \
... long_long_name + \
... long_long_long_name
>>>
```

但是這一個個的脫義字元實在很醜, 這時我們就可以藉助小括號：

```python
>>> a = ( long_name +
...     long_long_name +
...     long_long_long_name
... )
>>>
```

愛怎麼寫就怎麼寫：

```python
>>> a = (
...     long_name
...     + long_long_name
...     + long_long_long_name
... )
>>>
```

這是因為[配對的括號內可以加入斷行](https://docs.python.org/3/reference/lexical_analysis.html#implicit-line-joining), Python 會自動將成對的小括號內的內容接起來, 因此就可以善用小括號來幫助我們將程式碼排成適合閱讀的形式。當然, 你也可以回頭檢視一下物件名稱是不是取得過頭了, 也是改用縮寫、換個單字就會變短了, 但如果實在無法割捨, 本文介紹的方法就可以派上用場了。
Best settings for Logitech Brio 4k
Published: 2022-04-11 15:00:01

I know a lot of people who bought the Logitech Brio 4k both to use it for meetings and to use it to make video content.

However, I hear from many of them that they are not happy with the image quality.
I try to share my webcam settings to help the other users to obtain the maximum performances from this awesome webcam.

## Logitune
First of all I reccomend to you to download the official software from Logitech, it's called: [Logitune](https://www.logitech.com/en-us/video-collaboration/software/logi-tune-software.html)

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

With this software you can control everything on your webcam and you can change every settings of the Brio webcam, directly from the taskbar. 

## Settings
By default, Logitune, sets everything to "Auto".
These settings work only if you have a perfect light in the room, perfect colors behind you and much more.

From the main window of Logitune, select your Webcam and change the "Field of View" to 90.
I use the "Autofocus" enabled.

![Logitune First Screen](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3zle4upsddf4qc30gjbe.png)
 
Click on "Color Adjustment" and then on the "Adjustments" tab.
I use the default value for the "Auto exposure" but I have remove the "Auto white balance" because it is one the reason of the lower quality of the images.

I set the "White balance" to "4000" but this value depends on your light in the room and what you have behind you.

I have changed all the values of the others sliders as in the image below.

![Color Adjustments](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qjfbz9vatx1owv0n672s.png)

Try to play around with your Sharpness and Contrast settings and enjoy the new quality image.
 
## The result

This is a picture of my result with the settings above.
It's not a 4k image, but I think you can appreciate the quality and first of all the depth of the colors and of the the objects behind me.

![picture with Logitech Brio 4k](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fo81wov89abqlshdkx4z.jpg)
Paracetamol.js💊| #98: Explica este código JavaScript
Tags: javascript, webdev, spanish, beginners
Published: 2022-04-11 14:38:58

## **<center>Explica este código JavaScript</center>**

```js
const nombre = Symbol("primer nombre");
const apellido = Symbol("apellido paterno");

const persona = {
  id: 1,
  [nombre]: "Cristian",
  [apellido]: "Villca",
  peso: 82,
  estatura: 180,
};

console.log(Object.keys(persona)); //?
```

A. `[ 'id', 'peso', 'estatura' ]`
B. `[ 'id', 'nombre', 'apellido', 'peso', 'estatura' ]`
C. `[ 'nombre', 'apellido' ]`
D. Ninguno de los anteriores

Respuesta en el primer comentario.

---
Nrwl Wins | April 8, 2022
Tags: nrwl, nx
Published: 2022-04-11 14:37:29

---
title: Nrwl Wins | April 8, 2022
published: true
description: A video of Nrwl's wins for the week of April 8, 2022
tags: nrwl, nx
//cover_image: https://direct_url_to_image.jpg
---

{% embed https://twitter.com/NxDevTools/status/1512477176414711809 %}
Why is BlockChain Popular?
Published: 2022-04-11 14:36:41

Blockchain technology is a sort of structure that stores transactional records, also known as blocks, of the public in a few databases, referred to be able to as “chain, ” in a very network attached through peer-to-peer systems. Typically, this storage area is called a ‘digital ledger. ’

## What makes Blockchain Popular?

Suppose you will be transferring money towards your friends and family or friends via your bank account. You might log throughout to online bank and transfer the amount to the other person employing their account variety. When the purchase is conducted, your standard bank updates the purchase records. It looks not so complicated, right? There can be a potential matter which almost all of people neglect.

These kind of orders can be interfered with very swiftly. Individuals who are familiar having this truth happen to be often wary involving using these kind of orders, hence the progress of third-party settlement applications in new years. But this kind of vulnerability is fundamentally why Blockchain technological innovation was made.

Technologically, Blockchain is often a digital journal that is definitely gaining some sort of lot of focus and traction lately. But why knowledge it become thus popular? Well, let us dig in it in order to fathom the complete principle.

Record keeping regarding data and purchases are a essential area of the business. Usually, these details is managed internal or approved through a 3rd party like broker agents, bankers, or legal professionals increasing time, price, or when actively playing the business. Thankfully, Blockchain avoids this specific lengthy procedure and helps the faster movements of the deal, thereby saving the two time and cash.

Most folks believe Blockchain and Bitcoin can be utilized interchangeably, nevertheless in reality, honestly, that is not the circumstance. Blockchain is definitely the technological innovation capable of aiding various applications similar to multiple market sectors like finance, offer chain, manufacturing, and many others., but Bitcoin can be a currency of which relies on Blockchain technology to possibly be secure.

## Blockchain Benefits:

1. Highly Protected
By using a new digital signature function to conduct fraud-free transactions rendering it not possible to corrupt or even replace the info of an personal by the additional users with no particular digital signature.

2. Decentralized System
Conventionally, a person need the acceptance of regulatory regulators just like a government or even bank for purchases; nevertheless , with Blockchain, transactions are completed with the shared consensus of customers resulting in better, safer, and quicker transactions.

3. Automation Capacity
It truly is programmable in addition to can generate organized actions, events, in addition to payments automatically any time the conditions in the trigger are achieved.

Having these features, [blockchain certification](https://www.igmguru.com/machine-learning-ai/blockchain-developer-training/) is in high demand. There is huge demand for certified blockchain expert in the IT market.
I have found coding in python fun. But I have the urge of switching to other things/areas I lag.
Published: 2022-04-11 14:24:30

I have found coding in python fun. But I have the urge of switching to other things/areas I lag. 

I'm a complete beginner in the tech industry, I'm learning things slowly. 

I started as a dot net developer, I became a Data Analyst after deciding that .net is not my piece of cake.

I was put in a complex project where the project had microservice architecture and web api which separates the front-end and back-end. It was overwhelming for someone who has come from a Civil Engineering back ground. I was underperforming.

Long story short, I prepared for data analyst role and worked my way into a job.

During this journey I have learnt html, css , javascript,jQuery through an Udemy tutorial from Angela Yu.

I found it helpful but I didn't focus on the same and improve the existing skills, instead I went to different language, Python.

Now I feel like I have bits and pieces of knowledge. I lag in many areas. For example: VCS, git, etc.

Could someone please help me set a roadmap for me around python. ( I really enjoy working in Python) thanks in advance.
Create An Online Food Store Website Using Angular, NodeJS, Express, And MongoDB
Tags: angular, node, mongodb, webdev
Published: 2022-04-11 14:18:01

## Lesson 5 is published
[Check out the video](https://youtu.be/H2OKp84fHAI) if you love to build an e-commerce website using Angular, NodeJS, Express, And Mongo DB

{% embed https://youtu.be/H2OKp84fHAI %}

##Start from [here](https://dev.to/nasirjd/create-an-online-food-store-website-using-angular-nodejs-express-and-mongodb-52gd) if you didn't:

## You Are Going To:
    1. Create Food model
    2. Create data.ts
       1. Add sample foods
    3. Add images to assets
    4. Create Food service
    5. Create Home component
       1. Add ts
       2. Add html
       3. Add css

**The only requirement** for this course is the basic knowledge of Web Development.

Feel free to join our youtube community for having a productive relationship.

Happy Coding...