Questions tagged [Arrays] (807)

2
answers

How to find the next higher number in a two-dimensional array?

There is an array with the point numbers need to find the next top number with the two-dimensional array. If the number entered below is not suitable. For example, if the number should show 16.20 17.40. $mass = array(array(14.49),array(17.40),array(12.30),array(19.22); $number = 16.20; foreach ($mass as $val) { if(/*???*/)...
chad_OConnell asked April 7th 20 at 16:21
2
answers

How to pass an array from a method in java, why clean it?

I take from a database site nicknames of users with a specific value and replace the value in order to take these same nicknames. Put them in an array and pass it via return to the main class. And after the transfer I need to clear the array, so that next time again not to pass on these same nicknames. For the test I wrote ...
Frederic_Hamill asked April 7th 20 at 16:20
2
answers

Not working method Array.from?

Hi, guys. Already exhausted and can not understand why I have not activated this method. To HTMLCollection of the elements in the selector it turns out, everything is fine. But as soon as I try to turn this collection into an array, the array turns out empty. Also tried: var arr = Array.prototype.slice.call( htmlCollection...
roy.Pollich asked April 7th 20 at 16:14
1
answer

How to display some data from an array?

There is an array $test = array("id" => 123, "name" => "Name", "bbb" => "kkkk"); How to withdraw all print_r(), but other than bbb?
martin.Renn asked April 7th 20 at 16:08
0
answer

How to keep the original index of array when merging?

There is a table with the list of students, there is also a form to search by last name. The problem is that after a search, the table sequence number found student 1 appears instead of the original room to search. The following code is used to search for students by name. searchStudent(lastname) { if (lastname !== "") { ...
helmer_Romaguera asked April 7th 20 at 16:03
0
answer

Why the error Cannot read property 'length' of undefined?

error on line 1.. it is impossible so to take the length of the string..or am I referring to the element in the array to get the string? function findLongest(str) { var spl = str.split(" "); var longest = 0 for (var i = 0; i <= spl.length; i++) { if (spl[i].length > longest) { //(1) longest = spl[i].length; } ...
jaylon.Hermist asked April 7th 20 at 16:00
2
answers

A two-dimensional array in Bash?

All kind time of day! Ask for advice from experienced people. There is a bash script which carries 2 of the array. I need to get me the 1st value of one array was on a single line with the value of the 2nd array and so on. An example of my legs(as I saw) below. array=($timestamp) array2=($videoname) array3=(${array[@]}${arr...
kaia.Robert asked April 7th 20 at 15:44
2
answers

Array in Pascal?

Good day! Could not help to solve the issue (preferably in Pascal). Thanks in advance!
tanya asked April 7th 20 at 15:16
3
answers

How to replace the numeric keys of the array with appropriate values?

There is an array of $flowers = array( array("roses", 100 , 15), array("tulips", 60 , 25), array("Orchid", 180 , 7) ); How do I convert it to associative array of this type $flowers = array( array( "Name" => "rose", "Price" => 100, "Quantity" => 15 ), array( "Name" => "Tulip", "Price" => 60, "Am...
ila asked April 7th 20 at 11:34
1
answer

Machine generation of artistic patterns in vector fields?

Trying to rewrite this article: Machine learning only began to study, hence the following question arises: How to build a grid of angles and bring it through PyCharm? I am at this stage: import numpy as np import math import matplotlib.pyplot as plt width = 100 height = 100 left_x = int(width * -0.5) right_x = int(width...
Craig asked April 7th 20 at 11:13