Questions tagged as 'array'

1
answer

How to set a byte array size dynamically?

I'm developing an application that creates a arquivo.txt and saves it to a column of my table in the database. The problem is in querying this file. What happens, when I want to make the query I have to have an array of bytes with size...
asked by 26.08.2016 / 16:15
3
answers

How to force read all the results in REST on a page?

foreach ($result as $indices) { // Aqui ele retorna 50 registros por conuslta echo $indices['Empreendimento']; // Provavelmente preciso de um loop da paginação aqui dentro // para falar para o foreach que enquanto houver paginaç...
asked by 28.11.2015 / 15:10
1
answer

Check if an element of an array is contained in each element of another array with php

I have two arrays, I need to get each element of the second array and check if it is contained in any element of the first array using, for example, the function strpos (). That is, I need to check if any string from list 2 is contained in...
asked by 01.02.2016 / 03:21
2
answers

Sort query - Language C

I'm sorting a simple, growing vector. The code works. But the following line in which left me confused: if (matriz[i] < matriz[j]) Why is the sign there smaller, not larger? If I want to change the positions, if the i position...
asked by 27.04.2015 / 21:34
2
answers

How to separate array in odd / even and calculate multiple number?

I'm doing a script to separate odd number and even number from a array entered via form option, and make specific calculation about them (to separate odd number from pair array am using explode and implode to put th...
asked by 09.05.2015 / 07:53
1
answer

Test if method removes item from list (Jasmine)

I have a method in a service that removes items older than 60 days from a list. self.removerAntigas = function () { var dataCorte = new Date(); var dataAux = dataCorte.getDate(); dataCorte.setDate(dataAux - 60);...
asked by 29.05.2015 / 18:41
1
answer

How to browse and compare two arrays in PHP

I have two arrays that return a MySQL query. I need to compare these two results so that, each time they are different, they print something on the screen. The problem is that the query that comes back from the database is an array with several...
asked by 21.11.2014 / 02:16
1
answer

Access attributes of a vector of objects of another class using C ++ pointers

I'm doing a job for college where I have to set up a program to manage a restaurant that only delivers the orders are made by phone and internet using object orientation and pointers in C ++. I'm doing the following: I use two files for ea...
asked by 19.09.2015 / 19:40
1
answer

How to organize arrays

In the Pear documentation, it defines a pattern for how to assemble the structure of an array : $some_array = array( 'foo' => 'bar', 'spam' => 'ham', ); In this way, I already use, it separates legibly the elements, but wha...
asked by 25.09.2015 / 22:35
1
answer

Check if a value is present in an array in Ruby

How to check if a certain value is contained in an array in Ruby? For example, I want to know if 'A' is present in the ['A','B','C'] vector.     
asked by 11.02.2015 / 22:57