Most voted "array" questions
An array (array, vector, or matrix) is an ordered data structure representing a collection of elements (values or variables), each identified by one or multiple indices.
Learn more…3,046 questions
Sort by count of
-
1
votes2
answers46
viewsHow to obtain a single object from the comparison of the smallest of the values between an array of objects?
I’m unable to make a selection that looks for which is lower price and also the shorter delivery time of a JSON. I need to return the complete object. Something like: { id: 2, price: 10, available:…
-
1
votes0
answers116
viewsHow to return a new array within the Response.json() in Node.js?
I would like to know how to return a new object array in Response.json() to be visible in Inuit. I am receiving a lot of information from an api and the goal is to return to my frontend only an…
-
1
votes0
answers46
viewsProblem with ARRAY_SEARCH function and Matrix in PHP
Hello, I’m making a PHP code that picks up a CSV file and am separating the file by "column" States. I want to make a matrix separating the states that repeat as follows:…
-
1
votes0
answers29
viewsCode returning "-Nan"
I made a code that performs 2 functions: calculates the average wage of an enterprise calculates the salary difference of each employee for the average wage When executed, an error occurs in the…
-
1
votes0
answers10
viewsSearch for content in more than one column (Ttable)
I am developing an application in Delphi 6, that I need to perform a search in more than one field in a Ttable, using only a search field. Currently, the search is being done only in a field looking…
-
1
votes1
answer39
viewshow to select an Array within an api in React?
You guys talking? All right? I have a problem in my React application with an api, you could help me? I want to show the names of the Pokemons of an api, but the array that gets the names of the…
-
1
votes0
answers50
viewsarray does not work when creating Polyline leaflet
Someone could help me, I’m having difficulty extracting latitude and longitude from a PHP array and adding leaflet (Javascript) to the map. Coordinates are correct with print but only one location…
-
1
votes0
answers42
viewsStore form data in array without database
How to store form data in an array with the $_SESSION variable in PHP, without database? <form class="needs-validation formulario" novalidate="" action="" method="POST"> <input…
-
1
votes0
answers55
viewsValueerror: Setting an array element with a Sequence
I can’t fix the error that appears in the code. I have a rotational matrix, trying to calculate rotational forces, that is, radial, axial and tangential force. Ft2 = np.zeros([janelaanalise,]) Fr2 =…
-
1
votes1
answer125
viewsHow do I, in Postman, validate that in a "data" array all elements contain a specific value in the "name" field?
Recebo como resposta de uma requisição, o seguinte response: "data": [ { "id": 148, "name": "Amrita Naik", "email": "[email protected]", "gender": "Female", "status": "Inactive",…
-
1
votes1
answer50
viewsHelp with javascript array [Snakegame.js]
I have a question about Arrays in javascript using P5.js library, I want to make a coral snake, but for this I need to assign the value of the color for each element of the array, for example:…
-
1
votes1
answer30
viewsI am trying to move a file that is inside an Array using renameTo
Hi, I’m new to java and I’m having a hard time using "renameTo". and in this activity I have to move files do not meet the following requirements Is not empty; Each row of the file has the exact…
-
1
votes1
answer127
viewsArray map and asynchronous functions
I’m using the function getStaticProps from Next.js and Axios to pick up news from Hacker News. My goal is to access the API that returns the main stories of the day (which returns a unique id of…
-
1
votes1
answer106
viewsSorting the contents of an Array
I have the following Array with the relevant data applied: Card Number Month (Validity or Maturity) Year I get this data from a API but in a "disorganized" way. I would like to treat these values to…
-
1
votes1
answer32
viewsHow to properly traverse a matrix allocated in C?
Whenever I walk through my char matrix (char**) it changes all positions with the value of the last node, example; char** string = AlocaMatriz(10,10); //retorna uma matriz char** 10x10 allocada char…
-
1
votes1
answer39
viewsCreate array from another json array in php
Guys, I have the following array coming from a url that I’m picking up via file_get_contents $urlHistorical = 'https://mfinance.com.br/api/v1/stocks/historicals/IBOV?months=3'; $dadosHistorical =…
-
1
votes0
answers62
viewsDifference between string size in Standard C and C++
I compiled the following code in C Standard and C++: #include <stdio.h> #include <string.h> char string[5] = "hello"; int main(void) { printf("string tem %lu bytes\n", sizeof(string));…
-
1
votes2
answers75
viewsConcatenate two arrays according to their respective indices
I have two arrays, the first being [a, c, e, g] and the second [b, d, f, h], for example. I want to concatenate these two arrays into a respective order, forming: [ab, cd, Ef, Gh] instead of the…
-
1
votes2
answers53
viewsHow I take information from within an Array from the index
In this example I already have the numbers of indexes of elements within an Array, but with these numbers I need to get the information out of the Main Array. This amount of indexes is variable, so…
-
1
votes0
answers66
viewsActivity Lists in C
I received the following activity in the topic of Lists in physical contiguity: "Complete the attributes of the contact list structure in the file list_contacts.h. Create a contact list file. c and…
-
1
votes1
answer104
viewsURI 1259 - Increasing and Decreasing Odd Pairs
I’m solving that URI Online Judge challenge. But my code has had the answer "Time limit exceeded", and I don’t understand exactly why. Follows code below: using System; using System.Linq; namespace…
-
1
votes1
answer37
viewsDisplay array inside the chartjs
I wonder if you could help me with the following situation: I have a column called event type , in it after completing a form will be inserted some of the 4 items: Collision, PT, THEFT, Theft. I’m…
-
1
votes1
answer41
viewsHow to include multiple texts in an array in the same function?
I’m trying to include in a array several messages that are in the same function. I receive some data and make some comparisons according to some requirements, resulting in a message that I need to…
-
1
votes1
answer28
viewsCreate table from an array by making the keys the header
Hello. In the system I am developing I have the possibility to create filters for queries, but queries do not always have as a result the same columns. The result is stored in a key-value array,…
-
1
votes1
answer66
viewsUnboundlocalerror: local variable 'res' referenced before assignment - raster image scanning error (like numpy array)
I created a program that takes raster images (created in arcmap) and recognizes their polygons (their divisions). First, what I did was turn the image into a numpy array. Follow an example image…
python python-3.x array numpy image-processingasked 3 years, 5 months ago Sara Isabel Aleixo Perestrelo 13 -
0
votes2
answers823
viewsStore values in the variable
Store values in a variable by GET Example: $id = $_GET['id']; $dados = array($id); Doubt: How to save all Ids? Because I will use these Ids to identify which product was selected. I created a…
-
0
votes1
answer162
viewsPHP array that communicates with Javascript
I have this program that puts the selected in accordance with the value: <!--inicio if option = selected--> <script…
-
0
votes2
answers3501
viewsPass javascript data to a php array
I have a little problem I’d like some ideas to solve: I have an order screen, where I select the product in a combo, enter the quantity and when I click a button, I want to enter the combo value…
-
0
votes1
answer281
viewsHow to pick up an Array on all view pages
I have a view that’s called by a master page, the problem is that step one array and the second page called, but the data does not arrive as expected. ex. //controller index class Index{ public…
-
0
votes1
answer1021
viewsHow to Build Object Array
I’m trying to build an Object Array in Javascript, but the result is not as expected. That’s how I’d like it to stay: But this is how it’s getting: That’s the code I’m using: var wo = new Array();…
-
0
votes1
answer2236
viewsIllegal string offset in php
I am trying to run the code below, but is returning the error: Warning: Illegal string offset 'name' tasks.php on line 89 <?php session_start(); if (isset($_GET['nome']) && $_GET['nome']…
-
0
votes2
answers82
viewsRemove array schedules if you do not meet a certain number of required periods
I have an array with available schedules, being these schedules in a 30 minute interval: $arrHoras = ["08:30", "09:00", "09:30", "10:00", "10:30", ... , "18:30", "19:00"]; After some filters that…
-
0
votes1
answer368
viewsSave bi-dimensional array to EEPROM memory
I’m making a program for the Arduino written in C++ to turn on and off leds when a button is pressed. I want to save in an EEPROM memory the values of the leds that are connected and the amount of…
-
0
votes2
answers2612
viewsAssign JSON values to simple variables
I’m having trouble reading a JSON I receive: {"data":{"charges":{"data":{"charges":[{"code":10006756,"dueDate":"13/09/2014","link":"https://www.teste.com.br"}]},"success":true} I need to assign…
-
0
votes1
answer390
viewsProblem with Getters and Setters of an Array
I’m having trouble accessing arrays in a Singleton class Class Info public class Info { private static Info cinfo; private String[] first_name; private String[] last_name; private String[] nickname;…
-
0
votes1
answer1608
viewsFill values in a vector and ask position and values
public class teste4 { Scanner op = new Scanner(System.in); int[] vetor = new int[10];{ for (int i = 0; i < vetor.length; i++) { System.out.println("Digite o valor da posição " + i); vetor[i] =…
-
0
votes3
answers1045
viewsSeparate values from List
I’m using List to sort some values, but I need to separate them after I manipulated the values. List<Map.Entry<String,Integer>> lista = new…
-
0
votes1
answer122
viewsError passing an object array in C++
I have the following function: int verticeEstimativaMinima(Node *grafo, int numVertices){} And in my job main, I have the following line of code: Node *grafo = new Node[numVertices]; I mean,…
-
0
votes1
answer193
viewsVariable must provide either Dimension Expression or an array initializer Syntax error on token, misplaced Construct
I am new to programming for Android and would like to troubleshoot this error: package br.pedromazer.cantoliturgico; import br.pedromazer.cantoliturgico.R.string; import android.app.Activity; import…
-
0
votes3
answers136
viewsSaving Selected HTML PHP
I have a code from a select field and I need it to be dynamically in an array the option selected by the user. Every time the user starts the page the selected option appears. Follows the code:…
-
0
votes1
answer1489
viewsupdate mysql using array
I’m having trouble inserting an array into the database... I tried this script but it only inserts the last id of the array; <?php $_conexao = mysqli_connect("localhost", "root", "",…
-
0
votes2
answers14275
viewsHow to receive an array and print your content using PHP?
I need to know how to store data from an array in a variable, using the looping below: Data collection: $sql="SELECT `devicetoken` FROM `devicetokensios` ORDER BY `index`"; $resultado =…
-
0
votes4
answers180
viewsRemove array positions that have the common name
I want to take certain positions out of mine array which have the name of common positions, and play for another array. EX: array 'id' => '147' 'nome' =>'João' 'email' => '[email protected]'…
-
0
votes4
answers1762
viewsAdd element in List (Arraylist)
I’m having trouble adding values that are in a list called Processes to the Aptos list. Always shows only the last process, and in duplicate form. Still removes all previous processes. Code below:…
-
0
votes1
answer86
viewsArray Out of Bounds reading File
I’m having a problem with my code, in my text file I should read the last line is blank, and then it should not be read, however I’m getting out of Bounds. Line for example file:…
-
0
votes1
answer155
viewsFilling array with different data, but same range in PHP
I have the following code that is working perfectly, but I need the results within the $arrayDiasSemestre are '1' to the Monday, '2' to the Tuesday and so on... $inicio = new DateTime($start_date);…
-
0
votes2
answers1770
viewsSort a struct
Do you have any way of ordering a struct in the form: struct cidadecoord { char cidade[90]; int coordx, coordy; }cidades[N]; N is worth 30 in the case, and I would like to order x and y coordinates,…
-
0
votes2
answers98
viewsCan I put an array as a parameter for another array?
for(i=0; i<=203; i++){ array2[3][i]; array1[array2][2][string]; /*string corresponde a uma string ja definida e nao relevante para a questao*/ (...) …
-
0
votes1
answer73
viewsCodeigniter not registered
I’m trying to enter some data in the database but I can’t. Some problem in the array that Codeigniter returns. Follow the Controller that the form calls: function cadastrar() {…
-
0
votes1
answer135
viewsHow to transform this array?
I have a form that in certain fields returns me several possibilities of data in a single index when I print the array. This situation can be seen in índices 3, 4, 5 e 7. Array ( [0] =>…