teleren/devto huggingface dataset:
First card game
Published: 2023-05-19 16:52:05

[](https://github.com/rajcodze/python-game.git)
In this simple card game, players choose a card color from the options of Spades, Hearts, Diamonds, and Clubs. The computer also randomly selects a color from the same set. If the computer's chosen color matches the player's selection, the computer wins; otherwise, the player wins. Each time a player wins, their score increases by one point.
Database Solutions for С-Level Executives & Managers
Tags: database, topmanagemen, databasetools, dbforge
Published: 2023-05-19 16:36:15

Time is one of the most valuable resources for top managers. Therefore, the work of commands should be automated where possible. This can be achieved with the right tools. When it comes to database development and administration tools, there is nothing like the dbForge product line - https://www.devart.com/solutions/c-level-managers/

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/87fupsa11gnp5nl50ezx.png)
DEV Office Tour: Show Us Where the Magic Happens! 💻🔥
Tags: discuss, watercooler, codenewbie
Published: 2023-05-19 16:00:00

---
title: DEV Office Tour: Show Us Where the Magic Happens! 💻🔥
published: true
series: Office Tour
description: Biweekly office tour thread!
tags: discuss, watercooler, codenewbie
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
---
Hello, fellow developers, creators, and innovators! Welcome to our new biweekly Office Tour thread, where we celebrate the spaces that inspire you!

Your desk is more than just a surface — it reflects your personality, creativity, and dedication. So, let's share a glimpse of your workspace with the DEV community! 

Tell us about the essential tools that join you on your coding adventures. Is your keyboard your trusted companion, marked by countless lines of code? Do you have pens, notebooks, and sticky notes at the ready? Highlight the pieces that power your productivity, like your dual-monitor setup or laptop stand.

We also want to see the personal touches that make your workspace unique! Is there a travel memento, a cherished action figure, or a photo that brings warmth to your day? Share the little details that remind you of what truly matters and create a sense of belonging.

Let us know how your workspace influences your productivity, focus, and well-being. How does your desk setup keep you organized and efficient? Any tips or tricks for optimizing workflow you'd like to share with fellow developers?

Join the conversation in the comments — engage, provide feedback, and appreciate the variety of desks within our DEV Community. Let's celebrate the spaces that shape our creativity and drive us forward on our coding journeys.  

Happy desk touring!
RestAPI Request Models In Nim 👑
Tags: nim, webdev, api, happyx
Published: 2023-05-19 15:59:34

[HappyX](https://github.com/HapticX/happyx) provides request models since v0.20.0

You could also saw request models in Fastapi

Model declaring 🛠
```
model MyModel:
  param1: string
  param2: int = 100  # you can use default values 🍍
```

Model usage 🎈
```
get "/[m:MyModel]":  # you can't use model as arg name because model is macro
  echo m.param1
  echo m.param2
  req.answer { "response": {
    "one": m.param1,
    "two": m.param2
  }}
```

And you can send GET request using Postman:
http://......./
with JSON body:
```
{
  "param1": "123"
  "param2": 2
}
```
What was your win this week?
Tags: discuss, weeklyretro
Published: 2023-05-19 15:55:29

---
title: What was your win this week?
published: true
description: Looking back on this past week, what was something you were proud of accomplishing?
tags: discuss, weeklyretro
---

Hey folks 👋

Hope that y'all all enjoy your weekends. 

Looking back on this past week, what was something you were proud of accomplishing?

All wins count — big or small 🎉

Examples of 'wins' include:

- Starting a new project
- Fixing a tricky bug
- Dancing like a goof 🕺

---

![Jim the Bean, an odd bean-like character, dances around in circles](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zuobf4z03ezhdtrqf4ci.gif)
Top-Rated PostgreSQL GUI Tools [2023]
Tags: postgres, database, postgresqlgui, dbforgestudio
Published: 2023-05-19 15:54:22

Raising the topic of database development, management and administration, we cannot fail to mention tools with a graphical interface. Many of these solutions are adapted to perform all kinds of database tasks. This article reviews the best GUI tools developed for PostgreSQL, one of the most popular DBMS in the world - https://blog.devart.com/best-postgresql-gui-tools.html


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9qtybezjo2i8j383ujwr.png)
Teams spend too much time on infra.
Tags: cloudcomputing, automation
Published: 2023-05-19 15:48:28

The [Nitric](https://nitric.io) team has been out there, meeting with tech leaders to understand challenges with developer experience and productivity. 

One of the most severe pain points we've discovered is that projects take 2-3 times longer than expected, leaving teams feeling like they're trapped in quicksand. The confidence to release new features on demand? - About as solid as a house of cards in a windstorm.

To dive deeper, we asked a loaded question: "We think it's around 20%, but how much time do your teams spend debugging and configuring their runtime environment (infrastructure)?"

The response was surprisingly honest. While they couldn't provide an exact percentage, it often exceeded 50%. More than half of their time was wasted battling infrastructure gremlins, which, at a glance, could be mistaken for "debugging code."

Ideally, the time spent on infrastructure tasks should be low, especially with an ops or platform team. However, in the real world, as an engineering leader, I understand that some level of debugging is inevitable. With that said, I'd still aim for a modest maximum of 10%.

We've shifted everything left, resulting in an overwhelming workload for developers and a loss of productivity. It's high time for disruption to this mode of operation.

That's where Nitric steps in. We can help you automate the toil associated with delivering software into the cloud and create a healthy and thriving environment for your developers.
Do Laravel Have Ready Made Template?
Tags: laravel, php, f
Published: 2023-05-19 15:41:24


I am using Laravel from past 2 months. I learned many concepts from Laravel, but I am confusing that which tools should I used to boost my developments.

I am not so good on frontend technology and wants to do full stack project all with Laravel, jQuery, HTML, CSS.

My actual requirement is I have a lot of different projects that's comes day by day. (Currently for most of them I am using WordPress Backend as project framework, by creating WP plugins) I want to use common area of dashboard for project (for avoiding repetitive task such as **User management, Access management, Location based access, Department based access **etc.)

I also want to have plugin type facility in Laravel like WordPress so that many of modules will work together.

Is there have any ready-made solution in Laravel ?
Starting with GitHub Actions
Tags: githubhack23, githubactions, javascript, yml
Published: 2023-05-19 15:36:53

## GitHub User Finder using GitHub API and set GitHub Actions on the repo

### Category Submission
Walky Wildcard

### App Link
[LINK](https://piyushkdas0611.github.io/github-user-search-app/)

### Screenshots

![Image light-mode screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ybeznwkh0qttnc2cbxpg.png)

![Image dark-mode screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/puxq5ua60mlr8i6ihb6t.png)

![Image github action](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b22t76bspt0kqpd3x904.jpeg)

### Description
This is an application that let anyone find any GitHub user by their username. It displays details of the GitHub user such as Name, Joining date, Followers, Repos, Following, Location, Websites, Bio, etc.

### Link to Source Code
[Source Code](https://github.com/piyushkdas0611/github-user-search-app)

### Permissive License : MIT

## Background
Well, the idea was to decrease the time of user searching in GitHub and getting the details of any user without opening GitHub.
The most important part was I wanted to try GitHub Actions for the first time. The idea of getting notification if any push or pull request is made to the repo with the commit message, drive me in making this.

### How I built it
I used HTML to structure the website, CSS to style the website, and JavaScript to code the Website, and YML to create the GitHub action. By building this I get the exposure of CI/CD and how to make the deployment process, and collaboration more interactable.

### Additional Resources/Info
- ChatGPT
- Telegram
- StackOverflow
- Grammarly
Angular Job Interview: How Important are Technical Details When Hiring a Developer?
Tags: angular, interview, webdev, job
Published: 2023-05-19 15:19:29

## Twitter Spaces vs Podcasts?

⚡ Spaces empower the whole Angular community to interact
My goal is to bring experts to you!

Florin Mateescu used this to ask Brecht Billiet and GDE Chau N Tran about importance of:

⚛️ Algorithms & data structures
🗣️ Soft skills
🐲 Years of experience

Full audio in comments
useState vs useRef in react and when to use what with example
Published: 2023-05-19 15:07:55



## The differences between useState and useRef

**Use useState when**
-You need to manage local state within a component.
-You want the component to re-render when the state changes.
-You need to store primitive values like strings, numbers, or booleans.

**Use useRef when**
-You need to store a value that should persist across renders but not trigger a re-render when it changes.
-You need to access DOM elements directly.
-You need to store mutable objects.

## Example
Let's consider a real-life example of a form with validation. In this scenario, we will use both useState and useRef to demonstrate their respective use-cases.


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


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

CODE:

```
import React, { useState, useRef } from "react";

export function App(props) {
  const [email, setEmail] = useState("");
  const [password, setPassword] = useState("");
  const [isValid, setIsValid] = useState(false);
  const emailInputRef = useRef();

  const validateForm = () => {
    setIsValid(email.includes("@") && password.length >= 8);
  };

  const handleSubmit = (e) => {
    e.preventDefault();
    if (!isValid) {
      emailInputRef.current.focus();
    } else {
      // Submit Action
    }
  };

  return (
    <form onSubmit={handleSubmit}>
      <input
        type="email"
        value={email}
        ref={emailInputRef}
        onChange={(e) => setEmail(e.target.value)}
        onBlur={validateForm}
        placeholder="Email"
      />
      <input
        type="password"
        value={password}
        onChange={(e) => setPassword(e.target.value)}
        onBlur={validateForm}
        placeholder="Password"
      />
      <button type="submit">Sign Up</button>
      {!isValid && <p style={{"color": "red"}}>Please enter a valid email and password.</p>}
    </form>
  );
}

```





In this example, we use useState to manage the email, password, and validation state. We also use useRef to create a reference to the email input element, which allows us to focus on it if the form is not valid upon submission
Uso del Algoritmo KNeighborsClassifier para Clasificar las Especies del Conjunto de Datos Iris
Tags: tutorial, python, machinelearning, scikitlearn
Published: 2023-05-19 15:06:58

El conjunto de datos Iris, ampliamente conocido en el ámbito de aprendizaje automático, comprende cuatro características de 150 flores iris de tres especies distintas. En este artículo, explicaremos cómo usar el algoritmo KNeighborsClassifier, de la biblioteca Scikit-Learn, para clasificar estas especies.

### Paso 1: Importar las bibliotecas necesarias

Antes de comenzar, necesitamos importar las bibliotecas necesarias de Python.

```python
import numpy as np
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import accuracy_score
```

### Paso 2: Cargar y explorar los datos

Cargamos el conjunto de datos Iris y observamos las características y etiquetas.

```python
iris = datasets.load_iris()

# características
X = iris.data

# etiquetas
y = iris.target

# imprimir las características y etiquetas para verificar
print(X[:5])
print(y[:5])
```

### Paso 3: Preparación de los datos

Nuestro siguiente paso es dividir los datos en conjuntos de entrenamiento y prueba.

```python
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
```

Asegúrate de estandarizar los datos. Es importante porque el algoritmo KNeighborsClassifier se basa en la distancia euclidiana, que es sensible a la escala de las características.

```python
scaler = StandardScaler()
X_train = scaler.fit_transform(X_train)
X_test = scaler.transform(X_test)
```

### Paso 4: Entrenar el modelo

Ahora, vamos a inicializar y entrenar nuestro modelo KNeighborsClassifier.

```python
# inicializar el clasificador con 3 vecinos
knn = KNeighborsClassifier(n_neighbors=3)

# ajustar los datos de entrenamiento
knn.fit(X_train, y_train)
```

### Paso 5: Hacer predicciones

Una vez que el modelo está entrenado, podemos usarlo para hacer predicciones.

```python
y_pred = knn.predict(X_test)
```

### Paso 6: Evaluar el modelo

Finalmente, evaluamos la precisión del modelo comparando las etiquetas predichas con las etiquetas reales.

```python
accuracy = accuracy_score(y_test, y_pred)
print('Precisión del modelo:', accuracy)
```

Si la precisión del modelo es alta, entonces hemos hecho un buen trabajo al clasificar las especies de flores Iris utilizando el algoritmo KNeighborsClassifier. Puedes experimentar con diferentes números de vecinos (el parámetro `n_neighbors` en `KNeighborsClassifier`) para ver si puedes mejorar la precisión del modelo.

Este es un ejemplo sencillo de cómo se puede utilizar el algoritmo KNeighborsClassifier para clasificar las especies de Iris en el conjunto de datos Iris de Scikit-Learn. Asegúrate de entender cada paso y no dudes en explorar más sobre cómo mejorar tu modelo.
React Vs Vue
Tags: webdev, react, vue, frontend
Published: 2023-05-19 15:03:57

When planning a website's development as an engineering team, we usually find it a bit daunting to choose among the varieties of technological stacks that are available for development.
Using Vue and React as a case study,there are few options to consider in choosing between these two stacks (based on my opinion).
However, others might find another reason for choosing whatever they prefer.

My thoughts on VueJS:

1. Vue has a well-organized codebase compared to React, based on my experience with both.

2. It is easier to read and understand.

3. It is fast, especially with the advent of vite, which was recently introduced.

My thought on react:

1. Fast and efficient for SPA

2. It has a very large community compared to Vue, which means you have a better chance of finding top talent and help.

3. For me, React is a bit more complex compared to Vue (this is personal).

Please feel free to also add what you think is better and the one you prefer for development. You can also add why you prefer it.
Introduction of REST Architecture
Tags: webdev, programming, javascript, rest
Published: 2023-05-19 14:40:57

An architectural design approach for creating networked applications is called REST (Representational State Transfer). It offers a collection of guidelines and rules that direct the creation of web services and API (Application Programming Interface) endpoints. Over the HTTP protocol, the backbone of the World Wide Web, REST has emerged as the architectural paradigm for creating distributed systems.
In his doctoral dissertation from 2000, Roy Fielding outlined the fundamental ideas of REST. The necessity for scalable and interoperable web systems drove Fielding, one of the key creators of the HTTP protocol, to develop REST.
_**REST is based on the following key principles:**_
### Client-Server Architecture: 
Clients and servers make up the system. Servers receive requests from clients, process them, and reply with the results. Because of this division, clients, and servers can grow independently and scale.
### Statelessness: 
Every request made by a client to a server must include all the data required to comprehend and handle it. Any client-specific context shouldn't be kept on the server between queries. As a result, servers are extremely scalable and conveniently cacheable.
### Uniform Interface: 
For the interaction between clients and servers, REST specifies a standardized set of restrictions. These cover performing operations on resources using conventional HTTP methods (GET, POST, PUT, and DELETE), identifying resources using URIs (Uniform Resource Identifiers), and navigating the application state using hypermedia (links).
### Cache ability: 
Clients or middlemen (such as proxy servers) might cache server responses to enhance performance and lighten the server's burden. By inserting cache directives in the HTTP headers, cache functionality is accomplished.
### Layered System: 
The architecture can be composed of multiple layers, where each layer provides a specific set of functionalities. This allows for flexibility and encapsulation of different components of the system.
### Stateless Communication: 
The client and server should communicate tastelessly, which means that each request from the client should provide all the details the server needs to comprehend and process it. A client-specific state is not kept on the server between requests.
These guiding concepts are used to create RESTful APIs. Clients can interact with the resources they expose via regular HTTP techniques. Resources are exposed as URLs. The formats of the responses are commonly JSON or XML, making it simple to integrate them with many platforms and programming languages.
REST guidelines can help developers build scalable, loosely linked, and interoperable systems. Because of REST's ease of use, scalability, and compatibility with the current web architecture.
AWS Artifact
Tags: cloud, devops, security, aws
Published: 2023-05-19 14:35:17

**Anotações sobre AWS Artifact para ajudar na preparação das certificações AWS.**

Até o momento as anotações são para as certificações abaixo:

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

- [Link oficial](https://aws.amazon.com/pt/artifact/)
- [FAQ](https://aws.amazon.com/pt/artifact/faq/)


##**Anotações gerais**

- Acesso aos relatórios emitidos pelo auditor da AWS
- ISO 9001:2015 Certification
- HIPPA
- **PCI - Payment Card Industry** (PCI - Setor de cartões de pagamento)
- **SOC - Service Organization Control** (SOC - Controle de organização de serviço)
- Não é um serviço AWS
- Tem que ter permissões para acessar os relatórios

---
##**Identity and access management in AWS Artifact**
[Documentação oficial](https://docs.aws.amazon.com/artifact/latest/ug/security-iam.html#report-permissions)

**Exemplo policy que libera todos os relatórios**

```
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "artifact:Get"
            ],
            "Resource": [
                "arn:aws:artifact:::report-package/*"
            ]
        }
    ]
}
```
**Exemplo policy que libera os relatórios de SOC, PCI e ISO**

```
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "artifact:Get"
            ],
            "Resource": [
                "arn:aws:artifact:::report-package/Certifications and Attestations/SOC/*",
                "arn:aws:artifact:::report-package/Certifications and Attestations/PCI/*",
                "arn:aws:artifact:::report-package/Certifications and Attestations/ISO/*"
            ]
        }
    ]
}
```


---
##**PCI DSS**
[Documentação oficial](https://aws.amazon.com/pt/compliance/pci-dss-level-1-faqs/)
Amazon Route53
Tags: aws, cloud, devops, security
Published: 2023-05-19 14:35:04

**Anotações sobre o Amazon Route53 para ajudar na preparação das certificações AWS.**

Até o momento as anotações são para as certificações abaixo:

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

- [Link oficial](https://aws.amazon.com/pt/route53/)
- [FAQ](https://aws.amazon.com/pt/route53/faqs/)

##**Anotações gerais**
- Serviço de DNS
- Envia logs para CloudWatch Logs
- Tem que adicionar a VPC na Query dos Logs

---

##**Public DNS query logging**
[Documentação oficial](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/query-logs.html)

**Logs recebidos**

- Domínio ou subdomínio que foi solicitado
- Data e hora do pedido
- Tipo de registro DNS (como A ou AAAA)
- Edge Location do Route 53 que respondeu à consulta DNS
- Código de resposta DNS, como `NoError `ou `ServFail`

**Os Logs podem ser enviados para**

- CloudWatch Logs 
- Bucket S3
- Kinesis Data Firehose


**Referências**

- [Resolver query logging](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-query-logs.html)

- [Valores que aparecem em logs de consultas do Resolver](https://docs.aws.amazon.com/pt_br/Route53/latest/DeveloperGuide/resolver-query-logs-format.html)
AWS Network Firewall
Tags: aws, cloud, devops, security
Published: 2023-05-19 14:34:48

**Anotações sobre o AWS Network Firewall para ajudar na preparação das certificações AWS.**

Até o momento as anotações são para as certificações abaixo:

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

- [Link oficial](https://aws.amazon.com/pt/network-firewall/?whats-new-cards.sort-by=item.additionalFields.postDateTime&whats-new-cards.sort-order=desc)
- [FAQ](https://aws.amazon.com/pt/network-firewall/faqs/)

##**Definição do fornecedor**
_O AWS Network Firewall é um serviço gerenciado que facilita a implantação de proteções básicas de rede para todas as suas Amazon Virtual Private Clouds (VPCs)._


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


---

##**Anotações gerais**

- Sempre associado a uma VPC
- Statefull/Stateless Firewall
- Sistema de prevenção de intrusões (IPS)
- **Não protege contra DDoS**
- Gerencia liberação ou bloqueio de URL´s
- HTTP/HTTPS
- Pode importar regras da Suricata
- Não é capaz de permitir que EC2 em uma sub-rede privada se conectem à Internet enquanto impede conexões externas.

---

##**Delete protection**

_Protege o firewall contra exclusão. Use esta configuração para proteger contra a exclusão acidental de um firewall que está em uso._

- Veem habilitado por padrão

---

##**Subnet change protection**

_Protege o firewall contra alterações nas associações de sub-rede. Use essa configuração para proteger contra a modificação acidental das associações de sub-rede de um firewall que está em uso._

- Veem habilitado por padrão

---

##**Network Firewall Policy**

- Adiciona múltiplos Role Groups e outras configurações 

---

##**Network Firewall Role Group**

- Statefull ou Stateless
- Cria as regras de bloqueio na VPC
- Pode inserir domínios como "facebook.com"
- Pode inserir ip´s diretos como "8.8.8.8" 
- Pode bloquear por protocolo (HTTP, HTTPs, ICMP)