Questions tagged as 'array'

2
answers

regroup values from an array into a new array

I have an array of values like this: [{season:1, episode:1},{season:1, episode:2},{season:2, episode:1},{season:2, episode:2}] What I want to do is take the key season and group it in a new array like this: {"season 1":[{episo...
asked by 30.01.2018 / 18:11
1
answer

Is there any way to compare all received parameters?

I have the following method public Boolean Teste(String nome, String telefone, String...) { if(!string.IsNullOrWhiteSpace(nome) || !string.IsNullOrWhiteSpace(telefone)...) {} } Is there a way to compare all of these received values in a...
asked by 23.01.2018 / 18:08
2
answers

How to sort an Array Array alphabetically in PHP?

I have an array nxm that I will call $tabela . This array has some data inside it organized as follows: | Papel1 | Hora1 | Valor1 | Erro | B | | Papel2 | Hora2 | Valor2 | OK_Ok | A | | Papel3 | Hora3 | Valor3 | Falha | C | | Papel4...
asked by 05.03.2018 / 18:15
2
answers

How to return a vector in another vector in Java?

I'm doing a program that applies slope uplift, but the value I need to compare to know if the previous one is better than the next one is a vector double My method to find the best value returns a double vector: public double[...
asked by 27.09.2017 / 01:21
1
answer

PHP array array

I have a PHP array, as illustrated below. I know I can filter them by traversing them ( foreach , for example) and seeing if a value meets a certain criterion. But is there any simpler and faster way to do this filter? <?php $clientes = [...
asked by 14.03.2018 / 21:12
3
answers

Changing position of several DIVS with same selector in Jquery

I have a page that contains several structures with the same selector, such as: <div class="preco"> R$ 69,90 </div> <div class="preco-a-vista"> R$ 50,00 </div> As I mentioned, the above structure repeats several tim...
asked by 25.06.2018 / 03:17
2
answers

Get surplus positions from an array after comparing with another array?

I have a function (in JavaScript) that compares 2 arrays: let diferencas = []; let numD = 0; for (let a = 0; a < dados.length; a++) { if (dados[a].idEmail === results[a].idEmail) { console.log('Repetido!')...
asked by 06.09.2017 / 21:42
2
answers

String reading

char nome[100], endereco[100], sexo[100]; printf("Digite seu nome: "); scanf("%[^\n]s", nome); printf("Digite seu endereço: "); scanf("%[^\n]s", endereco); printf("Qual seu sexo: "); scanf("%[^\n]s", sexo); I have an erro...
asked by 15.08.2017 / 02:06
2
answers

How to delete both duplicate values from the array?

I get two arrays But I need them to be merged, values that are equal are removed: in array_unique( array_merge($array1, $array2) ) You can remove the duplicates, but I want to remove both duplicates. Is there a simple method, o...
asked by 15.08.2017 / 20:18
2
answers

input value with 'find' does not work

I have a list that dynamically incremented with the append of jquery, the list goes something like this: $("#questoes").append( '<li class="questao" data-id="'+questao+'">'+ '<div class="row testes">'+...
asked by 12.11.2017 / 00:34