Questions tagged as 'array'

5
answers

Get clicked item position

I have a list with registered items and one of the attributes of this item is a button to delete that item. By clicking on the button I want to know the position of the line clicked inside the list. When I know the position, I'll delete th...
asked by 01.11.2017 / 19:41
2
answers

How to initialize an array in Kotlin?

I need to initialize an array in Kotlin but I do not know how to do it, in Java I did so: int numeros[] = new int[] {0,1,3,4,5,6,7,8,9};     
asked by 19.04.2018 / 21:58
1
answer

Define array id () php

I have the following array () Array ( [camposdb] => Array ( [51] => Array ( [0] => cpf_cnpj [1] => nome_razaosocial [2] => cod_c...
asked by 08.09.2016 / 03:15
1
answer

Copy a numpy.array without modifying the original

Given a numpy.array like the following: r = np.arange(36) r.resize(6, 6) That results in: array([[ 0, 1, 2, 3, 4, 5], [ 6, 7, 8, 9, 10, 11], [12, 13, 14, 15, 16, 17], [18, 19, 20, 21, 22, 23], [2...
asked by 03.11.2016 / 23:38
1
answer

Remove duplicate elements in Array

I am getting an array by JSON , and using array_unique to remove duplicate values, however, it is displaying the following error: <b>Notice</b>: Array to string conversion in <b>/var/www/html/.... </b> on...
asked by 26.08.2015 / 17:08
3
answers

Why is array_shift considered to be a lentissima function?

According to the Manual, array_shift removes the first element from the array. I've seen a lot of criticism from the internet as to how to perform this function, since it reordered the entire index of the array with each removal, thus...
asked by 03.03.2015 / 14:22
3
answers

Group values from an array in PHP

I have a grid-shaped form that returns the following values inside an Array: array (size=3) 0 => array (size=5) 'pei_seq' => int 0 'prg_cod_barra' => string '7899619704729' (length=13) 'pei_prg_cod' => stri...
asked by 06.03.2015 / 13:50
1
answer

Select database record for variable

The code below aims to select a database record and save it in a variable for later use of the data: #!/bin/bash dbName='basedados' dbUser='utilizador' dbPass='password' row=$(echo "select file_id, file from catalogue__pdf_file WHERE is_conv...
asked by 31.03.2015 / 21:37
1
answer

Error adding value in array, repeated values

I have two arrays, A and B. I have created 3 functions in which I take a value from the beginning of array A and array B, remove the values, compare the values and if the value of A is greater than B, I add the 2 values at the end of array A,...
asked by 23.03.2018 / 21:59
7
answers

How to check if at least one item in the array has a value greater than or equal to 2

I have the following array: array[0,2,0,0]; I need to create a function that returns true if at least one item in the array has a value equal to or greater than 2     
asked by 01.11.2016 / 17:52