Questions tagged as 'array'

2
answers

Result of iteration of array in a variable

Hi, what I want is to get a random value stored in a variable after iterating a loop array 10 times. The code that I've made just throws me a letter. If anyone can give me a hand with this, I would be grateful. Greetings. var palos =...
asked by 21.08.2018 / 13:43
3
answers

Sort string array alphabetically

This is a method that orders a string array using an algorithm, but apparently the code it uses shows an error in the comparison of the if public void ordenar (Array3 a) { String buffer = null; int i =0; while ( i< a.getArreglo(...
asked by 16.11.2018 / 04:06
1
answer

How do arrays work with C pointers?

I was recently given a code in C language to continue developing a new programming language and I found some instructions that caught my attention on how to declare an array and use it, but that I had seen them before. Attached an example of the...
asked by 20.01.2018 / 06:46
1
answer

How to Filter in a PHP Array? [closed]

I have a Array of which I need to filter, I am using array_filter the following way: <?php $arr = ['a' => 1, 'b' => 2, 'c' => 3, 'd' => 4]; var_dump(array_filter($arr, function($v, $k) { return $k == 'b' || $v ==...
asked by 03.04.2018 / 21:37
2
answers

Does anyone know how I can change the value of a variable from time to time?

I am simulating an investor platform and I have variables where "stock shares" are kept, the investor registers and accesses a menu where there is an option to see the quotes, what I want to do is that the quote change every 2 minutes. This is w...
asked by 28.11.2017 / 21:57
1
answer

How can I print an arrangement in an understandable way? PHP

When I use print_r($arreglo) I print everything on top, is there any way to order that?     
asked by 25.07.2016 / 15:20
1
answer

I have an error with array_merge [closed]

It's not really an error, it's a warning I'd like to eliminate. I pass the code and the error to see if anyone knows how to solve it. function brc_hidden_meta_boxes( $hidden ) { $hidden = array_merge( $hidden, array( 'slugdiv' ) );...
asked by 28.10.2016 / 19:24
0
answers

Help, summation of rows and columns of arrangement in C

I have a two-dimensional arrangement with the rand function in which it adds the total of rows but I do not know how to do it so that it also sums the total of columns in row 16 is where I want to add the total of each column include stdio...
asked by 02.01.2019 / 01:10
1
answer

Delete null values ("nan") in an array

What would be the most efficient way to replace "Nan" with zeros in a large numeric data matrix in Python using Numpy?     
asked by 11.11.2017 / 16:51
1
answer

I try to show in an array that a value is peak (it is greater than the number to its right and to its left) python [on hold]

I am learning to use binary trees, the problem is that I have a basic error that I do not know how to solve, I am new to Python: print('ingresa el rango del array:') rango=int(input()) array=[] for i in range(rango): print ('ingresa el nu...
asked by 18.09.2018 / 11:28