html – ¿Porque no se centra la grilla dentro de un container en bootstrap 5?

Estoy intentado crear una sección de artículos de un e-commerce, el problema que tengo es que estoy utilizando las grid de bootstrap, quiero que aparezcan 6 artículos por linea en Desktop pero tengo un problema y es que les tengo un margin a los artículos para que se separen un poco y se vea bien y al hacer esto no se centra respecto al contenedor. alguien sabría como poder arreglar esto?
Se que es el margin que hace que se rompa pero como podria solucionarlo y que se vea bien, tambien tengo un problema y esque lo tengo puesto que tablets se vean 3 y en moviles 2, sin embargo esto no sucede.
este es el código:

    <div class="row articles container mx-auto">
    <div class="col-lg-2 col-md-4 col-sm-6 article">
        <div class="article-img">
            <img src="https://es.stackoverflow.com/static/img/article-test.jpg" alt="">
        </div>
        <div class="article-info">
            <h3 class="article-name">Conjunto Completo</h3>
            <p class="description-article">Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorum, ea.</p>
            <div class="article-info-bottom">
                <h4 class="article-price">$2.40</h4>
                <div class="icon-container">
                    <svg class="favorite-icon" xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" class="bi bi-heart" viewBox="0 0 16 16">
                        <path d="m8 2.748-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"/>
                    </svg>
                <!-- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart-fill" viewBox="0 0 16 16">
                    <path fill-rule="evenodd" d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314z"/>
                </svg> -->
                </div>
            </div>    
        </div>    
    </div>

    <div class="col-lg-2 col-md-4 col-sm-6 article">
        <div class="article-img">
            <img src="https://es.stackoverflow.com/static/img/article-test.jpg" alt="">
        </div>
        <div class="article-info">
            <h3 class="article-name">Conjunto Completo</h3>
            <p class="description-article">Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorum, ea.</p>
            <div class="article-info-bottom">
                <h4 class="article-price">$2.40</h4>
                <div class="icon-container">
                    <svg class="favorite-icon" xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" class="bi bi-heart" viewBox="0 0 16 16">
                        <path d="m8 2.748-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"/>
                    </svg>
                <!-- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart-fill" viewBox="0 0 16 16">
                    <path fill-rule="evenodd" d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314z"/>
                </svg> -->
                </div>
            </div>    
        </div>    
    </div>

    <div class="col-lg-2 col-md-4 col-sm-6 article">
        <div class="article-img">
            <img src="https://es.stackoverflow.com/static/img/article-test.jpg" alt="">
        </div>
        <div class="article-info">
            <h3 class="article-name">Conjunto Completo</h3>
            <p class="description-article">Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorum, ea.</p>
            <div class="article-info-bottom">
                <h4 class="article-price">$2.40</h4>
                <div class="icon-container">
                    <svg class="favorite-icon" xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" class="bi bi-heart" viewBox="0 0 16 16">
                        <path d="m8 2.748-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"/>
                    </svg>
                <!-- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart-fill" viewBox="0 0 16 16">
                    <path fill-rule="evenodd" d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314z"/>
                </svg> -->
                </div>
            </div>    
        </div>    
    </div>

    <div class="col-lg-2 col-md-4 col-sm-6 article">
        <div class="article-img">
            <img src="https://es.stackoverflow.com/static/img/article-test.jpg" alt="">
        </div>
        <div class="article-info">
            <h3 class="article-name">Conjunto Completo</h3>
            <p class="description-article">Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorum, ea.</p>
            <div class="article-info-bottom">
                <h4 class="article-price">$2.40</h4>
                <div class="icon-container">
                    <svg class="favorite-icon" xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" class="bi bi-heart" viewBox="0 0 16 16">
                        <path d="m8 2.748-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"/>
                    </svg>
                <!-- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart-fill" viewBox="0 0 16 16">
                    <path fill-rule="evenodd" d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314z"/>
                </svg> -->
                </div>
            </div>    
        </div>    
    </div>

    <div class="col-lg-2 col-md-4 col-sm-6 article">
        <div class="article-img">
            <img src="https://es.stackoverflow.com/static/img/article-test.jpg" alt="">
        </div>
        <div class="article-info">
            <h3 class="article-name">Conjunto Completo</h3>
            <p class="description-article">Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorum, ea.</p>
            <div class="article-info-bottom">
                <h4 class="article-price">$2.40</h4>
                <div class="icon-container">
                    <svg class="favorite-icon" xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" class="bi bi-heart" viewBox="0 0 16 16">
                        <path d="m8 2.748-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"/>
                    </svg>
                <!-- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart-fill" viewBox="0 0 16 16">
                    <path fill-rule="evenodd" d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314z"/>
                </svg> -->
                </div>
            </div>    
        </div>    
    </div>

    <div class="col-lg-2 col-md-4 col-sm-6 article">
        <div class="article-img">
            <img src="https://es.stackoverflow.com/static/img/article-test.jpg" alt="">
        </div>
        <div class="article-info">
            <h3 class="article-name">Conjunto Completo</h3>
            <p class="description-article">Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorum, ea.</p>
            <div class="article-info-bottom">
                <h4 class="article-price">$2.40</h4>
                <div class="icon-container">
                    <svg class="favorite-icon" xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" class="bi bi-heart" viewBox="0 0 16 16">
                        <path d="m8 2.748-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"/>
                    </svg>
                <!-- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart-fill" viewBox="0 0 16 16">
                    <path fill-rule="evenodd" d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314z"/>
                </svg> -->
                </div>
            </div>    
        </div>    
    </div>

    <div class="col-lg-2 col-md-4 col-sm-6 article">
        <div class="article-img">
            <img src="https://es.stackoverflow.com/static/img/article-test.jpg" alt="">
        </div>
        <div class="article-info">
            <h3 class="article-name">Conjunto Completo</h3>
            <p class="description-article">Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorum, ea.</p>
            <div class="article-info-bottom">
                <h4 class="article-price">$2.40</h4>
                <div class="icon-container">
                    <svg class="favorite-icon" xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" class="bi bi-heart" viewBox="0 0 16 16">
                        <path d="m8 2.748-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"/>
                    </svg>
                <!-- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart-fill" viewBox="0 0 16 16">
                    <path fill-rule="evenodd" d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314z"/>
                </svg> -->
                </div>
            </div>    
        </div>    
    </div>

    <div class="col-lg-2 col-md-4 col-sm-6 article">
        <div class="article-img">
            <img src="https://es.stackoverflow.com/static/img/article-test.jpg" alt="">
        </div>
        <div class="article-info">
            <h3 class="article-name">Conjunto Completo</h3>
            <p class="description-article">Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorum, ea.</p>
            <div class="article-info-bottom">
                <h4 class="article-price">$2.40</h4>
                <div class="icon-container">
                    <svg class="favorite-icon" xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" class="bi bi-heart" viewBox="0 0 16 16">
                        <path d="m8 2.748-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"/>
                    </svg>
                <!-- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart-fill" viewBox="0 0 16 16">
                    <path fill-rule="evenodd" d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314z"/>
                </svg> -->
                </div>
            </div>    
        </div>    
    </div>

    <div class="col-lg-2 col-md-4 col-sm-6 article">
        <div class="article-img">
            <img src="https://es.stackoverflow.com/static/img/article-test.jpg" alt="">
        </div>
        <div class="article-info">
            <h3 class="article-name">Conjunto Completo</h3>
            <p class="description-article">Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorum, ea.</p>
            <div class="article-info-bottom">
                <h4 class="article-price">$2.40</h4>
                <div class="icon-container">
                    <svg class="favorite-icon" xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" class="bi bi-heart" viewBox="0 0 16 16">
                        <path d="m8 2.748-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"/>
                    </svg>
                <!-- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart-fill" viewBox="0 0 16 16">
                    <path fill-rule="evenodd" d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314z"/>
                </svg> -->
                </div>
            </div>    
        </div>    
    </div>

    <div class="col-lg-2 col-md-4 col-sm-6 article">
        <div class="article-img">
            <img src="https://es.stackoverflow.com/static/img/article-test.jpg" alt="">
        </div>
        <div class="article-info">
            <h3 class="article-name">Conjunto Completo</h3>
            <p class="description-article">Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorum, ea.</p>
            <div class="article-info-bottom">
                <h4 class="article-price">$2.40</h4>
                <div class="icon-container">
                    <svg class="favorite-icon" xmlns="http://www.w3.org/2000/svg" width="26" height="26" fill="currentColor" class="bi bi-heart" viewBox="0 0 16 16">
                        <path d="m8 2.748-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"/>
                    </svg>
                <!-- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart-fill" viewBox="0 0 16 16">
                    <path fill-rule="evenodd" d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314z"/>
                </svg> -->
                </div>
            </div>    
        </div>    
    </div>

</div>

css
.article{
    margin: 20px 5px 20px 5px;
    background-color: yellow;
}

raspbian – porque no puedo hacer conexion por duckdns a mi raspberry

tengo un raspberry pi 4, en el cual estoy tratando de configurar para ingresar a ella por desde fuera de mi red local, tengo instalado lo siguiente:

  • Raspbian
  • OpenMediaVault
  • Portainer
  • en portainer duckdns desde stack

puedo acceder al portal de OMV desde mi ip local, pero si ingreso la publica no entra, el stack de duckdns funciona bien, no muestra errores en el log, pero tampoco puedo ingresar a travez del subdomino que da duckdns, ya abri puertos en el firewall de mi modem 80, 433, 22 y aun asi sigo sin lograr la conexión desde internet hacia mi raspberry, ¿alguna sugerencia?, muchas gracias por adelantado, saludos.

css – Porque eu não consigo utilizar o height: auto?

Olá

Eu estou praticando o uso de Flexbox e Grid com CSS, mas surgiu algumas duvidas.

Eu possuo uma div container com o display: grid e 3 colunas e em cada coluna eu possuo o display:flex e defini a direção como coluna e dentro de cada coluna eu possuo 2 divs.

Duvidas:

  1. Porque eu não consigo utilizar 100% na altura do container e apenas consigo utilizar 100vh ?
  2. No meu size-1 eu desejo substrair 30px dos 100% dos 50% que a div ocupa em column-1, column-2 e column-3, porque a div esta ficando maior em vez de menor ?
  3. Porque em size-2 não esta funcionando o height: auto ? Repare que a segunda div dentro da coluna não é exibida.

Obrigado

Meu código no JSFiddle para quem deseja codificar sem utilizar um editor: Clique aqui

HTML

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="css/style.css" />
    <title>Grid Example</title>
  </head>
  <body>
    <div class="container">
      <div class="column-1">
        <div class="size-1 color-1"></div>
        <div class="size-2 color-2"></div>
      </div>
      <div class="column-2">
        <div class="size-1 color-2"></div>
        <div class="size-2 color-1"></div>
      </div>
      <div class="column-3">
        <div class="size-1 color-1"></div>
        <div class="size-2 color-2"></div>
      </div>
    </div>
  </body>
</html>

CSS

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
/* -------------------- */
html {
  height: 100%;
}
/* -------------------- */
body {
  height: 100%;
}
/* -------------------- */
/* Container */
.container {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
/* -------------------- */
/* Column 1 */
.column-1 {
  grid-column: 1 / 2;
  display: flex;
  flex-direction: column;
}
/* Column 2 */
.column-2 {
  grid-column: 2 / 3;
  display: flex;
  flex-direction: column;
}
/* Column 3 */
.column-3 {
  grid-column: 3 / 4;
  display: flex;
  flex-direction: column;
}
/* -------------------- */
/* Sizes */
.size-1 {
  height: 0;
  padding-top: calc(100% - 30px);
}
.size-2 {
  height: auto;
}
/* -------------------- */
/* Colors */
.color-1 {
  background-color: lightblue;
}
.color-2 {
  background-color: lightskyblue;
}

html – Limpar o cache do windows 10 porque não consigo ver as fontes nos navegadores?

Olá. Não consigo ver algumas modificações que fiz no meu site. Faltam algumas fontes. No meu IP não consigo ver nada. Mas de outro IP, especialmente se eu usar a opção “Nova janela anônima” de outros navegadores, posso ver a modificação em css / fontes.

Então, fiz um cache limpo no windows, também nos navegadores, com CCleaner, mas ainda não consigo ver as mudanças do meu IP, no meu site. Por que isso está acontecendo?

Alguém sabe uma solução?

Porque las fuentes son mas grandes cuando paso a produccion mi pagina con react

tengo una duda cuando ejecuto de manera local mi app de React con npm start las fuentes tienen un tamaño normal acorde pero cuando paso a produccion y ejecuto en algun servidor como github pages o netlify las fuentes son mucho mas grandes… cual podria ser la causa y solucion?

Alguém pode me dizer o porquê de dar NullException?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class GAMEMANAGER : MonoBehaviour
{

public static GAMEMANAGER inst,instance;


public bool gameover=false;
public GameObject heroi;
public Transform pos;
public int ondeEstou;
public bool jogoComecou;
public int personagem;



enum character
{
    personagem = 0,
};


void Awake()
{
    if (inst == null)
    {
        inst = this;
        DontDestroyOnLoad(this.gameObject);
    }
    else
    {
        Destroy(gameObject);           
    }

    SceneManager.sceneLoaded += Carrega;

}

void Carrega(Scene cena, LoadSceneMode modo)
{

    pos = GameObject.Find("Corpo").GetComponent<Transform>();
   
}

void Start()
{
   
}
void Update()
{

    if (gameover == true)
    {
        GameOver();
    }
   
}


void GameOver()
{
    UIManager.instance.GameOverUI();
}


void StartGame()
{
    jogoComecou = true;
    UIManager.instance.StartUI();
}

}
NullReferenceException: Object reference not set to an instance of an object
GAMEMANAGER.GameOver () (at Assets/Scripts/GAMEMANAGER.cs:68)
GAMEMANAGER.Update () (at Assets/Scripts/GAMEMANAGER.cs:60)

java – Porque estou a ter o nullPointException no codigo abaixo?

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;

public class MelhorAmigoPablo {
    public static void main(String() args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String linha = br.readLine();
        List<Participante> participantes = new ArrayList<>();
    
        while (!linha.equals("FIM")) {
            var participante = new Participante();
            var entrada = linha.split(" ");
            participante.setNome(entrada(0));
            participante.setAmigo(entrada(1).equals("SIM"));
            participante.setOrdemInscricao(participantes.size());
            var participanteExistente = participantes.stream()
                    .filter(p -> p.getNome().equals(participante.getNome()))
                    .findFirst()
                    .orElse(null);
                    
            if(participanteExistente == null) {
                participantes.add(participante);
            }
            linha = br.readLine();
        }
    
        var participantesOrdenados = participantes.stream().sorted(Comparator
                .comparing(Participante::isAmigo).reversed()
                .thenComparing(Participante::getNome)).collect(Collectors.toList());
    
        participantesOrdenados.forEach(p -> {
            if(!p.getNome().equals("Abhay")) {
                System.out.println(p.getNome());
            }
        });
    
        List<Participante> amigos = participantesOrdenados.stream().filter(Participante::isAmigo).collect(Collectors.toList());
        Participante escolhido = null;
    
        for (Participante p : amigos) {
            if(escolhido == null) {
                escolhido = p;
            } else if (escolhido.getNome().length() < p.getNome().length()) {
                escolhido = p;
            } else if (escolhido.getNome().length() == p.getNome().length()
                    && escolhido.getOrdemInscricao() > p.getOrdemInscricao()) {
                escolhido = p;
            }
        }
    
        System.out.println("");
        System.out.println("Amigo do Pablo:");
        System.out.println(escolhido.getNome());
    }
    
    public static class Participante {
        private String nome;
        private boolean amigo;
        private int ordemInscricao;
        
        public String getNome() {
            return nome;
        }
        
        public void setNome(String nome) {
            this.nome = nome;
        }
        
        public boolean isAmigo() {
            return amigo;
        }
        
        public void setAmigo(boolean amigo) {
            this.amigo = amigo;
        }
        
        public int getOrdemInscricao() {
            return ordemInscricao;
        }
        
        public void setOrdemInscricao(int ordemInscricao) {
            this.ordemInscricao = ordemInscricao;
        }
        
        @Override
        public String toString() {
            return nome;
        }
    }
}

java – ¿Porque me devuele otro refresh Token spring-oauth-2?

he estabo buscando una manera de aplicar la revocacion de un refresh token en mi aplicacion en la cual primeramente he configurado de esta manera.

package com.bolsadeideas.apirest.auth;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer;
import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer;
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerSecurityConfigurer;
import org.springframework.security.oauth2.provider.token.TokenEnhancerChain;
import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;


import java.util.Arrays;

@Configuration
@EnableAuthorizationServer
public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdapter {

    @Autowired
    private BCryptPasswordEncoder passwordEncoder;

    @Autowired
    private InfoAdicionalToken infoAdicionalToken;

    @Autowired
    @Qualifier("authenticationManager") //qualifier para elegir una  implementacion especifica de un bean por si hay otro con un mismo nombre
    private AuthenticationManager authenticationManager;

    @Override //configura la ruta
    public void configure(AuthorizationServerSecurityConfigurer security) throws Exception {
         security.tokenKeyAccess("permitAll()")
         .checkTokenAccess("isAuthenticated");
    }


    // configura y registra varios clientes del front por ejemplo aca es una applicaion de angular
    @Override
    public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
            clients.inMemory().withClient("angularapp")
            .secret(passwordEncoder.encode("dexoxidoribonucleico")) // semilla para codificar passwords
            .scopes("read","write") //permisos
            .authorizedGrantTypes("password", "refresh_token") //tipos de autenticacion soportados
            .accessTokenValiditySeconds(3600) //exp tpken
            .refreshTokenValiditySeconds(3600);
    }

    @Override
    public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
        //concatena la informacion adicional que respondera el token (de la clase infoAdicional)
        TokenEnhancerChain tokenEnhancerChain = new TokenEnhancerChain();
        tokenEnhancerChain.setTokenEnhancers(Arrays.asList(infoAdicionalToken, accessTokenConverter()));
         endpoints.authenticationManager(authenticationManager)
                .accessTokenConverter(accessTokenConverter())
                .tokenEnhancer(tokenEnhancerChain);
    }

    @Bean
    public JwtTokenStore tokenStore() {
        return new JwtTokenStore(accessTokenConverter());
    }


    @Bean
    public JwtAccessTokenConverter accessTokenConverter() {
     JwtAccessTokenConverter jwtAccessTokenConverter = new  JwtAccessTokenConverter();
     jwtAccessTokenConverter.setSigningKey("mypasswoerfortoken"); // setea la clave del token , si no se pasa esta es generada automaticamente
    return jwtAccessTokenConverter;
    }
}

y mi refresh token funciona bien en postman puedo obtener uno nuevo token:
introducir la descripción de la imagen aquí

lo que no entiendo es porque me devuelve otro refresh token, pense que este era fijo de alguna manera, no entiendo como debo utilizar el que me envia al hacer la renovacion, ni donde se almacena este.

LEi un poco y me decia que era un token autocontenido, péro no entiendo a que se refiere eso.

porque minha validação de formulário só funciona no primeiro elemento?

Frontend Mentor | Intro component with sign up form

<div class="left">

  <h1> Learn to code by <br> watching others</h1>
  <p> See how experienced developers solve problems in real-time.<br> Watching scripted tutorials is great,
    but understanding how <br> developers think is invaluable. </p>

</div>

<div class="right">

  <div class="top-card">
    Try it free 7 days <span> then $20/mo. thereafter</span>
  </div>
  <div class="form-container">
    <form action="#" id="form1">
      <div class="form-group" id="actv">
        <input type="text" id="firstname" name="firstname" placeholder="First Name">
        <img src="images/icon-error.svg" alt="">
        <div class="error-text" id="actv">First Name cannot be empty.</div>
      </div>
      <div class="form-group" id="actv">
        <input type="text" id="lastname" name="lastname" placeholder="Last Name">
        <img src="images/icon-error.svg" alt="">
        <div class="error-text" id="actv">Last Name cannot be empty.</div>
      </div>
      <div class="form-group" id="actv">
        <input type="email" id="email" name="email" placeholder="email@example.com">
        <img src="images/icon-error.svg" alt="">
        <div class="error-text" id="actv">Looks like this is not an email.</div>
      </div>
      <div class="form-group" id="actv">
        <input type="password" id="password" name="password" placeholder="Password">
        <img src="images/icon-error.svg" alt="">
        <div class="error-text" id="actv">Password cannot be empty.</div>
      </div>
      <button type="submit">Claim your free trial</button>
    </form>
    
    <p class="form-footer">By clicking the button, you are agreeing to our <span> Terms and Services</span></p>
  </div>

</div>

js:

const form = document.getElementById("form1")
const errorText = document.getElementById("actv")
const firstname = document.getElementById("firstname")
const eT = document.querySelector(".error-text")
const lastname = document.getElementById("lastname")
const email = document.querySelector("input(type=email)")
const password = document.getElementById("password")
const emailValue = email.value

form.addEventListener("submit", (e) => {
e.preventDefault();
if (firstname.value == "") {
errorText.classList.add("active");
eT.classList.add("active");
} else {
errorText.classList.remove("active");
eT.classList.remove("active");
}
});

form.addEventListener("submit", (e) => {
e.preventDefault();
if (lastname.value == "") {
errorText.classList.add("active");
eT.classList.add("active");
} else {
errorText.classList.remove("active");
eT.classList.remove("active");
}
});

form.addEventListener("submit", (e) => {
e.preventDefault();
if (password.value == "") {
errorText.classList.add("active");
eT.classList.add("active");
} else {
errorText.classList.remove("active");
eT.classList.remove("active");
}
});

form.addEventListener("submit", (e) => {
e.preventDefault();
if (email.value == "") {
errorText.classList.add("active");
eT.classList.add("active");
} else {
if (validateEmail(emailValue)) {
errorText.classList.remove("active");
eT.classList.remove("active");
} else {
errorText.classList.add("active");
eT.classList.add("active");
}
}
});

function validateEmail(email) {
const re = /^(((^<>()().,;:s@")+(.(^<>()().,;:s@")+)*)|(".+"))@((((0-9){1,3}.(0-9){1,3}.(0-9){1,3}.(0-9){1,3}))|(((a-zA-Z-0-9)+.)+(a-zA-Z){2,}))$/;
return re.test(String(email).toLowerCase());
}


css:

@import url(‘https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap’);

  • {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    }

html {
font-size: 16px;
font-family: ‘Poppins’, sans-serif;
width: 100%;
height: 100%;
}

body {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background: url(images/bg-intro-mobile.png);
background-color: hsla(0, 100%, 74%, 0.952);
}

.container {
width: 70%;
height: 75%;
display: flex;
justify-content: space-between;
align-items: center;

}

.left {
width: 40%;
height: 80%;
display: flex;
flex-direction: column;
justify-content: center;
margin-left: 100px;
}

.right {
width: 50%;
height: 85%;
}

.container .left h1 {
color: white;
display: flex;
justify-content: flex-start;
font-weight: 700;
font-size: 3rem;
margin-bottom: 25px;
line-height: 55px;
}

.container .left p {
color: white;
font-weight: 500;

}

.container .right .top-card {
background-color: hsl(248, 32%, 49%);
margin-bottom: 20px;
border-radius: 15px;
padding-left: 15px;
width: 85%;
height: 70px;
color: white;
font-weight: 600;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;

}
.container .right .top-card span {
font-weight: 400;
margin-left: 5px;
}

.container .right .form-container {
background: white;
height: 91%;
width: 85%;
border-radius: 10px;

}

.container .right .form-container .form-group {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;

}

.container .right .form-container .form-group input {
width: 80%;
height: 58px;
margin-top: 30px;
padding-left: 10px;
border-color: hsl(246, 25%, 77%);
border-style: solid;
font-size: 1rem;
font-weight: 600;

}

button {
width: 80%;
height: 42px;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
margin-left: 59px;
margin-top: 20px;
background-color: hsl(154, 59%, 51%);
border: none;
border-radius: 7px;
color: white;
text-transform: uppercase;
font-weight: 500;
font-size: 1.1rem;
cursor: pointer;
}

button:hover {
background-color: hsl(154, 91%, 71%)
}

.form-footer {
width: 80%;
height: 50px;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
margin-left: 59px;
padding-bottom: 5px;
font-weight: 600;
font-size: .75rem;
color: hsl(246, 25%, 77%);
}

.form-footer span {
color: red;
margin-left: 5px;
cursor: pointer;
}
.container .right .form-container .form-group img {
position: absolute;
display: none;
padding-left: 400px;
padding-top: 7px;

}

.container .right .form-container .form-group.active img {
position: absolute;
display: flex;
padding-left: 450px;
padding-top: 7px;
}

.error-text {
color: red;
font-size: .75rem;
margin-top: 5px;
display: none;
flex-direction: row;
justify-content: flex-end;
width: 80%;
margin-right: 15px;

}

.error-text.active {
color: red;
font-size: .75rem;
margin-top: 5px;
display: flex;
flex-direction: row;
justify-content: flex-end;
width: 80%;
margin-right: 15px;

}

.container .right .form-container .form-group.active input {
width: 80%;
margin-top: 30px;
border-color: red;
width: 80%;
height: 58px;
padding-left: 10px;
border-style: solid;
font-size: 1rem;
font-weight: 600;
}