Collision Detection – The signal entered by the body will not be emitted when a rigid body will collide with a rigid body

By default, a RigidBody does not emit a signal when it collides with another RigidBody. This is usually a good thing because RigidBodies can collide frequently and emit many signals that are not of interest to you, which would have a negative impact on performance.

If you make care about detecting RigidBody the collisions you should define RigidBody.contact_monitor at true and RigidBody.contacts_reported at a value greater than 0.

From the docs on contact_monitor:

If true, the RigidBody will emit signals when it collides with another RigidBody.

Is it possible to see the numbers entered when navigating through the menus during a phone call once the call is complete?

The title explains the question by wondering if it is possible to see the numbers once the call is over.

JQuery Script – Field based on quantity entered

The advertisement

you do not do it?

Advertise almost everything here, with CPM banners, CPM ads and CPC context links. You can target relevant areas of the site and show ads based on the geographic location of the user, if you wish.

Starts at just $ 1 per CPM or $ 0.10 per CPC.

java – Arraylist overwriting previously entered values

Hi, I'm trying to create multiple client records and assign them to an arraylist so I can search for them later, but when I call the register creation method and assign them to an arraylist, I will create another register. and I ask to display the arraylist it displays the two entries created previously with the same values, thanks if you can help me!

Below the courses:

Store (main class):

public class Loja {
    public static void main(String() args) {
        Pedido pedidoInvocado = new Pedido();
        pedidoInvocado.inserirCliente();
        pedidoInvocado.listarCliente();
        pedidoInvocado.alterarCliente();
        pedidoInvocado.deletarCliente();
    }
}

Request (Where methods are created / invoked):

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Pedido {
    // Definindo atributos da classe Pedido
        private int pedidoId;
        private String dataEmissao;
        private float valorTotal;

    // Invocando Objetos
        Cliente clienteInvocado = new Cliente();
        itemPedido itemPedidoInvocado = new itemPedido();

    // Criando ArrayList
        List listaDeClientes = new ArrayList();

    // Get and Setters
        // pedidoId
            public int getPedidoId() {
                return pedidoId;
            }

            public void setPedidoId(int pedidoId) {
                this.pedidoId = pedidoId;
            }
        // dataEmissao
            public String getDataEmissao() {
                return dataEmissao;
            }

            public void setDataEmissao(String dataEmissao) {
                this.dataEmissao = dataEmissao;
            }
        // valorTotal
            public float getValorTotal() {
                return valorTotal;
            }

            public void setValorTotal(float valorTotal) {
                this.valorTotal = valorTotal;
            }

    // Metodos

        // Metodo para inserir clientes (INSERT)
            public void inserirCliente(){
                System.out.println("BEM VINDO A CRIAÇÃO DE USUARIOS, INSIRA OS DADOS REQUISITADOS LOGO A BAIXO!n");
                // Criação do Scanner
                    Scanner inputInt = new Scanner(System.in);
                // Criação da variavel Do While
                    int Escolha = 0;
                do {
                    // Invocando o metodo de ler os dados do cliente
                    clienteInvocado.atribuirCliente();
                    // Inserindo clientes e tratando erros
                    try{
                        Cliente cliente = new Cliente();
                        listaDeClientes.add(cliente);
                        System.out.println(" ");
                        System.out.println("CLIENTE CADASTRADO COM SUCESSO!n");
                        System.out.print("1 - CADASTRAR NOVAMENTE | 2 - TERMINAR CADASTROnRESPOSTA: ");
                            Escolha = inputInt.nextInt();
                    } catch (Exception err){
                        System.out.println(" ");
                        System.out.println("ERRO AO CADASTRAR CLIENTE: " + err);
                    }
                } while (Escolha != 2);
            }

        // Metodo para listar clientes (READ)
            public void listarCliente(){
                for (Cliente cliente : listaDeClientes){
                    System.out.println("ID: " + clienteInvocado.getClienteId() + " | NOME: " + clienteInvocado.getNome() + " | EMAIL: " + clienteInvocado.getEmail());
                }
            }

        // Metodo para deletar clientes por ID (DELETE)
            public void deletarCliente(){
                // Criação do scanner
                    Scanner inputInt = new Scanner(System.in);
                // Criação e atribuição das variaveis
                    System.out.print("DIGITE O ID QUE DESEJA DELETAR: ");
                        int ID = inputInt.nextInt();
                // Deletando do ArrayList
                    for (Cliente cliente : listaDeClientes){
                        if (clienteInvocado.getClienteId() == ID){
                            listaDeClientes.remove(cliente);
                        // Lista todos os clientes cadastrados novamente apos à exclusão
                            listarCliente();
                        }
                    }

            }

        // Metodo para alterar clientes por ID (UPDATE)
            public void alterarCliente(){
                // Criação do scanner
                    Scanner inputInt = new Scanner(System.in);
                // Criação e atribuição das variaveis
                    System.out.print("DIGITE O ID QUE DESEJA MODIFICAR: ");
                        int ID = inputInt.nextInt();
                // Deletando do ArrayList
                    for (Cliente cliente : listaDeClientes){
                        if (clienteInvocado.getClienteId() == ID){
                            listaDeClientes.set(ID, cliente);
                        // Lista todos os clientes cadastrados novamente apos à exclusão
                            listarCliente();
                        }
                    }
            }
}

Customer (method to obtain user inputs)

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Cliente {
    // Definindo atributos da classe Cliente
        private int clienteId;
        private String Nome;
        private String Email;

    // Get and Setters
        // clienteId
            public int getClienteId() {
                return clienteId;
            }

            public void setClienteId(int clienteId) {
                this.clienteId = clienteId;
            }
        // Nome
            public String getNome() {
                return Nome;
            }

            public void setNome(String nome) {
                Nome = nome;
            }
        // Email
            public String getEmail() {
                return Email;
            }

            public void setEmail(String email) {
                Email = email;
            }

    // Metodos
        // Metodo para o usuario definir o id, nome e email
            public void atribuirCliente(){
                // Criação do scanner
                    Scanner inputInt = new Scanner(System.in);
                    Scanner inputString = new Scanner(System.in);
                // Criação e atribuição das variaveiS
                        System.out.print("DIGITE O SEU ID: ");
                            int clienteId = inputInt.nextInt();
                        System.out.print("DIGITE O SEU NOME: ");
                            String Nome = inputString.nextLine();
                        System.out.print("DIGITE O SEU EMAIL: ");
                            String Email = inputString.nextLine();
                // Setters com os valores das variaaveis anteriores
                    this.setClienteId(clienteId);
                    this.setNome(Nome);
                    this.setEmail(Email);
            }
        }

Encryption – How can I validate that a PGP public key entered by the user is valid?

we want to encrypt the emails we send to the user with his public key.
it works fine, but the user can also type a broken / invalid public key ("asdf123") and the encryption will obviously not work.

How can I validate the fact that the user has entered a public key pgp with a correct format?

average values ​​entered in python input

I make a program that takes a value entered input (other than negative and less than 20) and calculates:
a) the highest value;
(b) the smallest value;
(c) the sum of the values;
(d) the arithmetic mean of the values;
e) the number of even numbers;
f) The number of odd numbers.
I've already done the biggest, the smallest and the biggest, but I do not know how to get the average, even and odd

valor = input('Digite um número menor que 20 que seja positivo: ') #pede para um usuário digitar um número
if not valor.isdigit():
    print('Digite apenas números positivos!')
else:
    maximo = max(valor)
    minimo = min(valor)
    soma = 0
    for valor in valor: #verifica elemento a elemento dentro de um for e faz a soma dessa lista
        soma += int(valor)
    print('O maior valor é:',maximo)
    print('O menor valor é:',minimo)
    print('A soma é:',soma)
    print('A média é:',media)

and i also want to know how i do not type a number greater than 20, and if he types, returns an error and asks him to type again

Performance – Find a perfect square smaller than a number entered (Swift)

This code is slow even with numbers less than 1,000,000. Can someone help me optimize this thing?

// Finds the highest perfect square below a certain input (int)

let target: Int = 758865 // Swap this out for testing other numbers
var smlSqr = (Int)()
let findLimit = Int(Double(target).squareRoot().rounded(.up))   // Saves CPU time, because perfect squares less than
                                                                // number a but higher than a.squareRoot is impossible.

var index = 0
var maxSqr = 0 // Final result
var candidate = 0

repeat {
    smlSqr.append(index * index)
    index += 1
} while(index < findLimit)

while candidate < smlSqr.count {
    if smlSqr(candidate) > maxSqr {
        maxSqr = smlSqr(candidate)
    }
    candidate += 1
}

print(String(maxSqr)) // For debugging, should print out 100
print(Int(Double(maxSqr).squareRoot())) // For debugging, making sure the number is actually a perfect square

I'm using Swift 5.1 on Xcode 11.
Also using a playground (if that helps)

react – Problem transmitting a value entered in TextField in SPFx and adding it to a SharePoint list

I'm doing a little project there, I want to add tulips to a SharePoint list using SharePoint Framework with React.

I use Textfield and so UI Fabrics and PnPJs to get data from lists and so on. It works well to add hard-coded states when you click the "ADD" button does not work when you try to enter a value from the text field.

Here's what the application looks like now:
enter the description of the image here

Here is the code:

EnfokamTulips.tsx:

import * as React from 'react';
import styles from './EnfokamTulips.module.scss';
import { IEnfokamTulipsProps } from './IEnfokamTulipsProps';

import AddTulips from './AddTulips'

export default class EnfokamTulips extends React.Component {
  public render(): React.ReactElement {
    return (
      
Tulips!
); } }

AddTulips.tsx:

import * as React from 'react';
import { TextField } from 'office-ui-fabric-react/lib/TextField';
import { DefaultButton } from 'office-ui-fabric-react';
import { sp, ItemAddResult } from '@pnp/sp';

export interface IEnfokamTulipsState {
    title: string;
    manufacturingCost: number;
}

this.state = {
    title: 'book',
    manufacturingCost: 2
}


function addTulipsToList(event) {

    // get all the items from a list
    sp.web.lists.getByTitle("Tulips").items.select("Title").get().then((items: any()) => {
    console.log(items);
});

// add an item to the list
    sp.web.lists.getByTitle("Tulips").items.add({
        Title: event.target.value,
        Manufacturing_x0020_cost: event.target.manufacturingCost //Internal name of column
        }).then((iar: ItemAddResult) => {
            console.log(iar);
    });
}

let addTulips = (event) => {
    return(
        
) } export default addTulips;

IEnfokamTulipsProps.ts:

export interface IEnfokamTulipsProps {
  description: string;
}

export interface IEnfokamTulipsState {
  title: string;
  manufacturingCost: number;
}

export interface TulipsLists{
  value: TulipsList();
}
export interface TulipsList{
  Title: string;
  Manufacturing_x0020_cost: number; 
}

The only thing that happens when I click on the "Add" button is this:
enter the description of the image here

All data in each column is empty.
What am I doing wrong?
What I want is that no matter what I type in the text fields, I want to pass it and show it in the list when I click on "ADD".

Any help is appreciated.

Change the input color after the user has entered X characters with JavaScript [pendente]

Good afternoon
I'm trying to make an entry, where the user types a text. What I want to do is:
Once the user has entered 100 characters, the following characters that they will have entered will be of another color.
Does anyone know how I can do it?