teleren/devto huggingface dataset:
Data Structures : Introduction to Graphs
Tags: programming, beginners, algorithms
Published: 2022-10-10 20:56:27

You are probably familiar with arrays, stacks and linked lists which are linear data structures because they store the data in a sequence. Graph is a non-linear data structure just like a tree data structure. In fact tree is a special kind of data structure with some restrictions. 

Graphs have a lot of real world applications like finding the best routes in navigation apps, creating complex electrical circuits, storing useful user information on social media platforms, etc.

Before moving forward we must know the following terms:

- **Nodes**: These are the vertices of the graph that are used                 to store the data and are connected by edges.

- **Edges**: Two nodes are connected by a horizontal line called an edge. An edge can be directed or undirected. A directed edge means that we can only traverse the graph in one direction which is shown by the edge whereas an undirected edge lets us traverse in any direction.



![nodes and edges](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x31u09iamj5ib8vo8p1k.png)

Graphs are of two types:
1. **Undirected graph**: A type of graph in which the nodes are connected by undirected edges.
2. **Directed graph**: A type of graph in which the nodes are connected by directed edges.



![types of graphs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nwges5dx12rpc6z7x60t.png)

## Cycle in a Graph
When we start moving from one node and after a few moves end up back at the starting node, this means that there's a cycle in the graph.

If there is a cycle in a graph and the edges are undirected then the graph is called **Undirected Cyclic Graph**.
Similarly if the graph has a cycle but the edges are directed then it's called a **Directed Cyclic Graph**.


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

## Degree of a Graph
In case of undirected graphs the number of edges connected to a node is it's degree.
But in Directed graphs:
In-degree: Total number of incoming edges in a node.
Out-degree: Total number of outgoing edges in a node. 

Total degree of a graph = 2 x the number of edges in the graph


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

## Weights in a Graph
Weights are used to measure the cost of a traversal in a graph usually represented by edges hence known as weighted edges.
Why do we need them? Well consider this, you have to travel from city A to city B but there are multiple paths that you can use. To make the decision easier we can just calculate the time it'll take for us to reach our destination for each path and then pick the one with lowest time.

That's about the introduction to graphs but there are a lot of interesting and important topics associated with graphs like representing a graph in a language, traversal algorithms, shortest path algorithms, cycle detection algorithms, topological sort, etc.

I hope this article was helpful for you.
Thanks for reading.
Rest API PostgreSQL Nodejs
Tags: database, api, postgres, node
Published: 2022-10-10 20:35:43


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


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



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

```
npm init
```

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


```
npm install express pg dotenv
```



> serverni doimiy run holatda saqlash uchun nodemonni o'rnatamiz

```
npm install nodemon -D
```

## ----------------------------------------------


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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5u8n5r3k5udd9iiu634b.png)
⌨️ Pipe xlsx files into/from Kafka... From cli with (k)cat 🙀
Tags: tutorial, productivity, kafka, linux
Published: 2022-10-10 20:25:55

## 🪝 Teaser

What you'll discover in this post is how we could, within a [dedicated KillerCoda scenario](https://killercoda.com/opt-labs/course/kafka/kcat) :

- Literally `pipe` data to and from Kafka, from (and to) any file, with the `|` operator
- Visualize data on a cool web interface on [Redpanda Console](https://github.com/redpanda-data/console)

## 🍒 on the 🍰

We'll play with real life data from [isee.nc](https://www.isee.nc/component/phocadownload/category/10-ridet) :

[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xir0qhy83naa4tkepqbj.png)](https://www.isee.nc/component/phocadownload/category/10-ridet?download=2027:liste-etablissements)


☝️ Now... to fully enjoy this post, please be sure to really 

> 👉 deeply understand what `pipe` is, how and why it was created... and all the amazing opportunities it opened since its early ages.

## 🪄 Intro : Unix Pipeline 🦸‍♂️

Spend 5' to deeply understand how and why the `|` was created and **why it still matters (a lot) today**.

{% youtube bKzonnwoR2I %}

## 🧰 Tools (and Philosophy) 🏺

Now, you can jump start in the demo where we'll do everything from the terminal thanks to all these amazing, [`UNIX` Philosophic](https://en.wikipedia.org/wiki/Unix_philosophy) single-purposed tools : 

- [`cURL`](https://en.wikipedia.org/wiki/CURL)
- [`pipe`](https://en.wikipedia.org/wiki/Pipeline_(Unix))
- [`kcat`](https://github.com/edenhill/kcat)
- [`xls2csv`](https://github.com/xevo/xls2csv)
- [`jq`](https://stedolan.github.io/jq/)
- [`tail`](https://en.wikipedia.org/wiki/Tail_(Unix))
- [`head`](https://en.wikipedia.org/wiki/Head_(Unix))
- [`cut`](https://en.wikipedia.org/wiki/Cut_(Unix))
- [`comm`](https://en.wikipedia.org/wiki/Comm)
- [`sort`](https://en.wikipedia.org/wiki/Sort_(Unix))
- [`column`](https://man7.org/linux/man-pages/man1/column.1.html)
- [`sed`](https://en.wikipedia.org/wiki/Sed)
- [`awk`](https://en.wikipedia.org/wiki/AWK)
- [`wc`](https://en.wikipedia.org/wiki/Wc_(Unix))

## 🍿 Full demo

{% youtube t_UhRhLU2II %}

## 🔖 Resources

- [Dedicated Killercoda scenario](https://killercoda.com/opt-labs/course/kafka/kcat)
Day 10/100: DOUBLE DIGITS
Tags: devjournal, 100daysofcode, webdev, vscode
Published: 2022-10-10 20:19:06

Double DIGITS BABY🔥🔥

To commemorate this day, I did the most work I've done in a single day. Swiper was added, Pages were changed, components were optimised, styling was edited, structure was improved. Today was a good day.

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

Swiper is this cool carousel enabling library I found that can be used in ReactJs and normal JavaScript. It's easy to use and I recommend it to anyone who wants to add a carousel to their website.

So much editing, optimisation and overall improvement was done today to the overall website and also to the code itself. A truly fantastic day. 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bl5g6eoeso3zn0ybgk66.png)
Damnp, an Open-Source didactic development environment
Published: 2022-10-10 20:03:11

## What is Damnp ? 
[Damnp](https://bitbucket.org/AliasAPI/damnp/src/master/) (an acronym for Docker, AliasAPI, MariaDB, Nginx and PHP-FPM) is a didactic development environment that helps to improve your code quality, enforcing strict quality standards. By using dozens of famous linters and static analyzers, such as Jsonlint, Shellcheck, Yaml_lint and Phan, Damnp will act as an over-engineered static analyzer for bash, composer, Javascript, JSON, MySQL, PHP, and YAML.

## Why over-engineering ?

We believe that creating an environment for automatically installing many linters and static analyzers, configuring them individually to be the strictest as possible, and running all of them with one command, will help all developers. By endorsing a very strict code quality standard, Damnp intent is to reduce bugs and bad code style, helping the code review process and assisting educational purposes.

## Do you want to help ?

We are happy to have you with us, regardless of your experience : Senior,Junior or entry level. **By offering training, we also intent to help new developers who are interested in getting hands on their first project**.
Rails CLI Generation
Published: 2022-10-10 19:16:38

[Rails CLI Generation](https://guides.rubyonrails.org/command_line.html#bin-rails-generate)

Thank you Cassidy for the guidance below!

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



rails new application-name

rails g
-model: creates model and migration
-migration
-controller
-scaffold
-serializer: use singular for corresponding model. Dictates what attributes and json structure that will be returned
ActiveModel::Serializer provides some powerful yet simple-to-use tools for crafting the JSON our app returns, and it does so in a way that's consistent with Rails conventions.
To customize the JSON returned for a resource, create a serializer for that resource and list the desired attributes.
The serializer is used implicitly by Rails based on naming conventions; to override this, custom serializers can be passed explicitly.
AMS enables the use of the belongs_to and has_many macros in serializers to render associated data; these macros should be used sparingly.
By default, AMS will only nest associations one level deep in the serialized JSON. To override this, the include option can be used.
-resource: creates model, migration, controller and view files. Schema is updated/created. Controller will automatically generate 7 routes that follow REST. 


rails d (destroy)

rails s (server)

rails db (similar to rake db commands)

rails c (console)

options
--no-test-framework

Nomenclature for models, controllers, and views
-Model names are always singular, and controller names are plural

class-name:belongs_to
updates association in model, 
updates schema to
t.belongs_to :class-name, null: false, foreign_key: true

rails routes
A client sends a request to the server (this could be: a user entering a URL in a browser; a JavaScript application using fetch; etc)
That request is sent to the server where the application's router interprets the request and sends a message to the controller mapped to that route
The controller uses the model to access data from the database
The controller then uses that data to render a view (HTML or JSON)
The server returns an HTTP response, which contains the HTML or JSON data

Update a migration 
-add a column
rails generate migration add_column-name_to_table-name(s) column-name:data-type
--api
--minimal

***Combine these command templates
 npx create-react-app client --use-npm
 rails new dvd-shop --api --minimal
rails g resource Movie title year:integer length:integer director description poster_url category discount:boolean female_director:boolean --no-test-framework

Adding foreign keys to join table using CLI
rails g migration AddTaxiToRides taxi:references
What Is Hacktoberfest?
Tags: beginners, webdev, podcast
Published: 2022-10-10 15:12:32

{% spotify spotify:episode:2psHkoBqF4OQDub5YLRffk %}

## What is HTML All The Things?

HTML All The Things is a [web development podcast](https://www.htmlallthethings.com/) and [discord community](https://discord.com/invite/jweMCx9) which was started by Matt and Mike, developers based in Ontario, Canada. 

The podcast speaks to web development topics as well as running a small business, self-employment and time management. You can join them for both their successes and their struggles as they try to manage expanding their Web Development business without stretching themselves too thin.

---





## What's This One About?

Hacktoberfest 2022 is upon us, the annual open-source centric event that rewards those that contribute during the month of October. This year coders, bloggers, video producers, podcasters, and more can contribute their works to participating repos on GitHub and GitLab. In this episode, Matt and Mike discuss what Hacktoberfest is, and why you should contribute if you can.

## Show Notes/Timestamps 

**What Is Hacktoberfest? | 00:02:08**

- Month-long annual event by Digital Ocean that promotes contributing to open-source projects
- GitHub & GitLab
- Get a T-shirt or tree planted in your name
- Some projects have their own prizes for accepted PRs
- PRs cannot be spammy and must be created during Hacktoberfest (October 1 - October 31)

**Why should you participate in Octoberfest? | 00:34:00**

- Open-source projects need help
- You'll get real-world experience with git and working with others
- Your code will be reviewed, constructive feedback

**How can you participate in Hacktoberfest? | 00:48:30**

- Search for the hacktoberfest tag/topic on GitHub
- Curated lists such as this one
- If you're a beginner there are issues marked as beginner or good first issue
- No code contributions such as: documentation, design, blogs, videos, podcasts

## Links

- [Hacktoberfest GitHub Tag](https://github.com/topics/hacktoberfest)
- [Compiled List of Hacktoberfest GitHub Repos](https://github.com/OtacilioN/awesome-hacktoberfest-2022)




## Thank you!

If you're enjoying the podcast consider giving us a review on [Apple Podcasts](https://podcasts.apple.com/us/podcast/html-all-things-web-development-web-design-small-business/id1412209136) or checking out our Patreon to get a shoutout on the podcast. 

**[Support us on Patreon](https://www.patreon.com/htmlallthethings)**


You can find us on all the podcast platforms out there as well as

[Instagram (@htmlallthethings)](https://www.instagram.com/htmlallthethings/)
[Twitter (@htmleverything)](https://twitter.com/htmleverything)
[TikTok](Html All The Things)
The Best Programming Advice I've Been Given, EVER
Published: 2022-10-10 18:55:34

Today I launched a youtube channel. It's been nerve racking process but I am here and I posted my first video. It's all about the best programming advice that I've ever been given. If you watch it, give me feed back, and I'll provide better content in the future!

{% embed https://youtu.be/PUS_9w9P-cM %}
Beneficios de hace Pair Programming con tu Mentor
Published: 2022-10-10 18:19:37

---
title: Beneficios de hace Pair Programming con tu Mentor
published: true
description: 
tags: 
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
---

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

Hoy tuve una sesión de Mentoring Privado MUY ESPECIAL

Fue una suscripción al plan de 2 HORAS al mes,
con la petición especial de hacer un Pair Programming en esas dos horas.

Te detallo algunos beneficios de hacer Pair Programming con tu Mentor 👇

## Acceder a un Mentor con vocación

Algunas empresas no cuentan con Seniors que puedan orientar a devs juniors y mid. A veces aunque los seniors lo hagan no cuentan con vocación de Mentor.

## Ambiente Seguro

Con tu mentor, cuentas con un ambiente amable y seguro para preguntar CUALQUIER PREGUNTA sin temor a ser juzgados

Aunque no hay pregunta tonta, hay ambientes donde no siempre se puede preguntar sin ser juzgados.

## Existe una predisposición a escuchar

Con tu mentor, existe una relación de confianza entre mentor-aprendiz, por lo que los consejos, sugerencias y desacuerdos pueden ser conversados con total libertad.

## Obtienes los beneficios del pair programming

- Mejorar la productividad general a través del proceso de colaboración
- Código de mayor calidad como resultado de la revisión en tiempo real
- Mejores soluciones diseñadas a través de la colaboración compartida
- Mayor enfoque en el código y la tarea de programación sin distracciones
- Desbloqueo a los desarrolladores bloqueados
- Feedback rápido
- Mayor transferencia de conocimiento del mentor hacia los aprendices

---

Si buscas trabajo remoto, 
Si programas backend con python o ruby,
Yo puedo ser tu mentor

https://luismejiadev.gumroad.com/l/dqzzCQ
C - argc, argv
Tags: argc, argv, c
Published: 2022-10-10 13:58:06

Arguments on main are used to guide on how the program does it's job, when the programs are run in a hosted environment. 
They are also used to pass the name of the file to the program.

**A host environment** is any OS environment that satisfy the basic requirement to be called an Operating system(os) like RAM, CPU, etc ..

Declaration of arguments on main is 

```
int main(int argc, char *argv[]);
```
Exit status is used to indicate that a program completed successfully (a zero value)(exit(0);) or some error occurred (a non-zero value).

`argc` : is the number of the arguments supplied to the program.
`arv[]` : is the array pointer of arguments given to the program.

In arv[] the last value of the array or arv[argc] is null('\0').

---

## #argc and argv

Up until now we have seen that argc is the number of argument and arv[] is array pointer of all the argument that are written on the terminal.

A really good example of argc and argv is 

```
gcc main.c -o main
```
In this case the values `gcc`, `main.c`, `-o`  and `main` are arguments that are passed to the gcc program using argv[].
the value of the arguments will be like

```
argc = 4
argv[0] = gcc
argv[1] = main.c
argv[2] = -o
argv[3] = main
argv[4] = null
```
Example

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

Output

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

If we ever want to make an operation on the values of the parameter argv[] use the function `atoi()` to convert the string to an integer also don't forget to include the library `#include <stdlib.h>`.

Example

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

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

> Tip: to skip unused variable type cast the variable to `void` like `(void)UNUSED_VAR;`.

Example
If a variable in the parameter like argc, argv[] or any other variable, let's say you didn't use argc variable in the code you can skip the error of unused variable like
```
(void)argc;

```
My Journey into tech. Part 1
Tags: webdev, beginners, codenewbie
Published: 2022-10-10 17:48:12

## Why tech, why computers?

Most would wonder how a guy from a small village in Mpumalanga, South Africa got into tech. well it began when arcade games came into our area in the early 2000's and after school we would go hang out with friends and play games or watch the pros finish the whole game with a single coin.

Games were awesome, but I had questions. How do the machines actually work? Don't the characters on screen get tired?. So as a curios kid I went home and asked questions but It seemed liked my parents were clueless as well.

One of the summer holidays my friends cousin came for a visit and he brought this huge computer, a Pentium 1 I believe. Trust me, I was always the first one to show up at my friends place. The computer had games and that meant no more coins for the arcade machines.ds

Immediately after realizing how powerful a computer was, I begged my mom for a whole year to buy me one and eventually she gave in. Early 2013 I got my 1st desktop computer and me and my friends would play call of duty 3, Need for speed: Most Wanted  and GTA for hours.

The following year I was in grade 10, and there a show on television that was about gadgets and tech, and I give credit to that program because that's where I first heard the word 'coding' and I did research from there on and met a lot developers around my area who guided me.
API, CRUD, MVC - O que são todas essas siglas?
Tags: webdev, beginners, api, mvc
Published: 2022-10-10 17:42:45

Estou estudando hoje, no meu curso de ADS na FIAP o desenvolvimento e consumo de API's com CRUD feito em Java e banco de dados Oracle.
Como gosto de entender os conceitos e processos do desenvolvimento, vim compartilhar algumas definições que correm em torno desse estudo, que acredito que pode ser útil à quem também está nessa trajetória ao seu primeiro cargo de Dev. Juninho.
Nesse artigo irei abordar e definir de maneira simplificada os seguintes tópicos:

- MVC
- API
- CRUD

## MVC 
### A maior parte da web hoje é construída a partir da arquitetura/design pattern MVC, onde o site/sistema é distribuído por três elementos.

### Model-View-Controller 
Definindo de forma simplificada, podemos visualizar essa organização da seguinte forma:
* Model: Camada para o banco de dados
* View: Camada para interface, aquilo que o usuário irá visualizar.
* Controller: Camada para intermediar e conectar a interface de usuário com o banco de dados.


## API

### Aplication Programming Interface
API é um sistema responsável por fazer a ponte entre a **interface de usuário** e o **banco de dados**. É nela que é decidido como irá funcionar toda troca de dados do sistema, requisições **HTTP** e também, é nessa camada que implementamos as **regras de negócio**.
Via de regra, uma API é construída para que possa ser consumida por diferentes sistemas, mesmo que o seu desenvolvimento tenha o  escopo definido em um só sistema.
Por exemplo: A empresa **SPTrans** têm sua API do **Olho Vivo**(https://www.sptrans.com.br/desenvolvedores/api-do-olho-vivo-guia-de-referencia/) sendo utilizada por eles para monitorar os ônibus da empresa, mas também tendo seu acesso público, eu ou você conseguimos acesso as informações dos ônibus através da **API**.


## CRUD

### Create - Read  - Update - Delete
O back-end de boa parte das aplicações web hoje se baseiam nessas quatro principais operações:
* Criar
* Ler
* Atualizar
* Deletar

Através dessas operações que é feito as **querys** no **banco de dados**, geralmente feitas por **métodos HTTP**.


Espero ter ajudado com essas breves definições, qualquer dúvida estou a disposição no meu [linkedin](https://linkedin.com/in/gmatheus).
How to create new React-App?
Tags: react, node, npm, tutorial
Published: 2022-10-10 17:25:14

###Content
 
- What is React-App?
- What do we need to download to make the react-app work?
- How to run React-App?

##What is React-App?

React is a JavaScript library for creating user interfaces.React based on components.It doesn't hang even if you write code all day.It is convenient, fast and popular.The main advantage of this library is that it is assigned to a declarative approach.More informations about react you can find on [React's](https://reactjs.org/) official web-site

##What to download to make the machine work?

####Node JS
For working React we need asynchronous event-driven JavaScript which called Node JS. Node JS is not a programming language but rather an open-sourced runtime environment for JavaScript.For more information, you can visit official web-site of [Node.js](https://nodejs.org/en/download/).You can also download it from there.

####npm
[npm](https://docs.npmjs.com/about-npm) is the world's largest Software Library, package manager and installer. npm is also the most convenient library without it the React will not work normally when we use [DOM]
(https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Introduction).We will install npm in terminal.

#####Opening terminal (shortcut)
on Windows -> Ctrl + Alt + W 
on Linux -> Ctrl + Alt + T

After that, write thi code in your terminal to download npm

```
npm install -g npm
```
Make sure that you installed npm with running code
```
npm --version
```


##Running React-App
Write this code to create new React-App
```
npx create-react-app (write name of your project)
```
For instance:
```
npx create-react-app my-first-app
```
Then write:
```
cd my-first-app
```
Finally run:
```
npm start
```and you will see your first react-app (localhost:3000) with react dynamic icon like this

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