Questions tagged as 'array'

2
answers

Array of unique values with foreach

I have the following foreach to get the id of the devices that were used in each sector: @foreach($relatorio->Empresa->SetorEmpresa as $setor) {{ $collection[] = $setor->SetorEmpresaEdificacao->id_aparelho_ruido }} @endfo...
asked by 11.05.2016 / 19:43
2
answers

How to generate a vector using Random to assign values, but to make it never have repeated values? [duplicate]

I'm working on a Bingo in C # for a facul job and I need to do a vector of so many values and do not ever repeat those values, I'm using the following procedure to generate the raffle values ↓ public static void GeraBingo(int[] v)...
asked by 10.05.2016 / 18:35
1
answer

How to sort an array of objects in java

Hello, I have a class times where they have score (% with%), number of wins (% with%), losses (% with%), etc. Within the int method, I have an array of 20 teams and need to sort them by the score, if the score is equal, I check who has the...
asked by 15.07.2016 / 06:12
1
answer

Send array to Controller and insert into DB, with Ajax and Codeigniter

Hello, I'm not able to receive (in the controller) the array that is sent from a View via ajax. I already tested it in console.log and the array is sent but nothing happens in the controller. The input, "numdiags" defines the number of inp...
asked by 13.06.2016 / 10:58
2
answers

Calculate vector size

How to calculate the size of the vector? My code: #include <stdio.h> #include <stdlib.h> int retornaMediana(int *vetor){ int tam=0; tam = sizeof(vetor); printf("TESTE: %d, %d, %d\n\n",vetor[0],vetor[1],vetor[2]);...
asked by 26.03.2016 / 01:55
1
answer

Mount array with user permissions

I need to mount an array in PHP (LARAVEL) and I can not find a way to do it. I have a user system with roles and permissions. When I view the user, I clear all the permissions, but one below the other. Ex: > users-index > user...
asked by 20.05.2016 / 03:47
1
answer

Store vector in SQLite

I'm creating an application in C# that must have a database. At first I'm thinking of using SQlite for simplicity. But for each data inserted in my bank must have: Identifier ( int , char , bool ) ... Vector (which...
asked by 17.03.2016 / 21:02
1
answer

Struct with vector is not working

I'm trying to use vectors and struct , but it's not working. #include <stdio.h> #include <stdlib.h> typedef struct Atleta { float notas[5]; } atleta; void receberNotas(atleta* l) { int i; for(i=0; i<5; i...
asked by 28.09.2016 / 00:59
1
answer

Problem when printing the contents of a vector

How to make a punctuation store for each answer. package modulo02; import java.util.Scanner; public class vetorGabarito { public static void main(String[] args) { int pontuacao = 0, n, i, j = 0; float s = 0, maiorMedia =...
asked by 16.02.2016 / 19:55
1
answer

Pass array as parameter

I have a question regarding arrays . So I have the following code: public static void main(String[] args) { //Objetos..... ColeçãoCidades ListaCidades = new ColeçãoCidades(); //Adicionar regiões Scanner sc = new Scanner(Sys...
asked by 22.01.2016 / 13:17