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
votes1
answer65
viewsArray changing of order
I’m new to javascript and I’m making a little game to learn the language. The idea is simply to ask the user to tell the sequence of the pi number and, in case of error, stop the program and give a…
-
1
votes1
answer41
viewsReturn cluster in Mysql vector
I am trying to assemble a Mysql query with multiple joins, in this query has a column that may or may not come duplicated, I would like to put the duplicated rows by this column in an array, using…
-
1
votes0
answers2440
viewsHow to count repeated values within a Javascript array
I am learning in Rra Javascript, but I came across a situation that I could not solve. I’m looking to create a chart where The horizontal line will be the date (I’ve already managed to eliminate the…
-
1
votes4
answers491
viewsPrint values of a vector without line break
Hello, I’m performing a C# exercise that asks for the following: The output with even numbers should be presented without line break, but I do not understand how I can do this. My code is like this:…
-
1
votes1
answer32
viewsHow to write a variable Std::vector<Std::tuple<>> into a txt file?
I have the tuple vector written in C++, defined as: std::vector<std::tuple< float, float>> ASK_Mod; I populated it, and tried to save it in a new file . txt as defined in the function,…
-
1
votes2
answers320
viewsCreating new array with specific objects from another array - Javascript
In javascript I have an array "cardsUsuario" and I need to create a newArray only with the values of . text that will enter in the cardUsuario. At some point I need to give a . push and it will be…
-
1
votes1
answer58
viewsJoin two array
I have a form with fields products and amount which are imported by invoice: <div class="row"> <div class="form-group col-md-9"> <label for="produto_nfe">Produto</label>…
-
1
votes2
answers238
viewsAdd parameters in JSON array after form serialize
After giving the following command in Javascript: var dados = $("#form-historico").serialize(); Is it possible to add more information to the object? for example: I would like to send along with the…
-
1
votes0
answers65
viewsAre there arrays in JS, or are they just 'hidden objects'?
My teacher brought the question atoning, and he gives a lot of emphasis to the subject. After all, there are array[] in fact on Javascript or are they mere disguised objects? As I am starting, I…
-
1
votes1
answer120
viewsJavascript array problem
I am facing a problem with javascript array. I am using Google Charts and to popular the chart, an array is required containing the name and participation. function contentChart(){ var id =…
-
1
votes1
answer100
viewsInput with fgets
Hello, I’m having the following difficulty, the moment I call the function of fgets, regardless of whether on any parole, or in the registration function it does not work. At the moment when…
-
1
votes1
answer57
viewsI’m not able to create array with keys in Java
I am studying the Java language and to practice I am creating a simple login program. I have a class called Database that should save an array with the information (name and password) of the users.…
-
1
votes0
answers20
viewsIs there an adjustment to be made to define a maximum number of sent/received elements in an array via POST in php?
Following staff, I am facing a problem in a system I am working on, which I am trying to send/receive array that is not coming complete. After some tests I identified that the problem is in the…
-
1
votes1
answer218
viewsError passing numpy.core. _exceptions.Ufunctypeerror: ufunc 'subtract' Did not contain a loop Signature matching types (dtype('<U21')
Basically I have the following code: import numpy as np def localize(aux1, aux2, aux3, aux4, aux5, aux6): search = np.array([(aux1,aux2,aux3,aux4,aux5,aux6)]) B1A =…
-
1
votes1
answer67
viewsWhat’s wrong with this array of pointers in C? (incompatibility?)
Hello, recently I was doing a relatively simple test to try to unify some concepts I have been studying, and which you will see below. It is an array of pointers that I used as a parameter of a…
-
1
votes1
answer54
viewsOperation of the "Contains() method"
I have a array of strings: string[] warnings = { "INQUIRY REQUEST", "ITEM ALREADY EXISTS", "ITEM NOT FOUND", "END OF FILE", }; and I have a variable with the following value: status = " 18:46:24:97…
-
1
votes1
answer57
viewsProblems with displaying data from an array
I’m new to stackoverflow, but that I use the platform to cease my direct doubts, had never made an account. Anyway, I have an atypical problem with a PHP code. I’m making a query to the database…
-
1
votes1
answer131
viewsHow to Stop an Infinite Loop For - Vue
I’m doing a project with Vuejs and I have these two functions running through an array provided by a JSON fetch. import { api, getCep } from "@/services.js"; export default { name: 'Casos', data() {…
-
1
votes1
answer180
viewsHow to add an array inside a python Matrix
Hello I’m having a problem in python I’m taking an excel a Matrix of 15 columns and 3 rows, so I’m reading excel with pandas and did that while below to read all columns and all rows: import pandas…
-
1
votes1
answer100
viewsMultiple Rotate images on the same click
Good afternoon, I have a question. I intend that when we click on a button a random image of an 80-card deck will appear. Then if we click again on that same button, another card appears next to the…
-
1
votes1
answer852
viewsCode gives Document.getElementById error is not a Function
Uncaught TypeError: document.getELementById is not a function at inserindoValores (desafio-array.html:17) at HTMLButtonElement.onclick (desafio-array.html:48) inserindoValores @…
-
1
votes1
answer369
viewsSave an object inside an array without overwriting the old javascript
I’m learning javascript and I’ve already broken my head a lot with this,I looked at several forums and questions here on the site but I couldn’t solve the problem.I want to take the value of two…
-
1
votes2
answers159
viewsDecoding a conversation
Problem: A code has been created between friends to encode conversations. There is a code relationship between letters and numbers as shown below. It is necessary to create a function called…
-
1
votes1
answer54
viewsMy inaccessible JSON key for Node.js validation
I am developing an API in Node.js and Knex.js, but I came across a problem, the array that Knex returns in the promise has a JSON inside and is numerical that needs to be validated. However, the key…
-
1
votes2
answers78
viewsAccess vector value by index
I’m practicing a little vector, when I come across this code, of an exercise: #include <stdio.h> main () { char ex3[5] = { 'z', 'k', 'w', 'x', 'v' }; int cont1; cont1 = 2; printf ("%c…
-
1
votes2
answers33
viewsArray as a function parameter
My program stores 10 numbers in a vector and Zera the numbers that are less than 0. I am receiving these two error messages: Passing argument 1 of 'Zeranegativos' makes Pointer from integer without…
-
1
votes0
answers352
viewsHow to compare values within a single vector? IN C
I made my code as follows, as placed below. However, if I put 2 repeated numbers it says it has only 1 repeated number, if I put 4 repeated numbers, it says it has 6 repeated numbers.I no longer…
-
1
votes1
answer48
viewsVector does not print correctly
Create a program in C++. Have a vector of integers of 10 positions filled by the user. Print the sum of the components of this vector. I made the code below but it does not print the values of the…
-
1
votes3
answers1423
viewsuseState does not update - Reactjs
I’m starting in the world of Reactjs. I have a front that is consuming a tracking API, so it returns me an object with status, responseMessage and Object, an array of objects. I do the…
-
1
votes3
answers231
viewsProblem Solving in Javascript
I’m new to javascript, I’m doing some fixation exercises, but I’m having trouble in the case below. Create a function called highAlto that returns true (true) if it meets the requirements(Be 18…
-
1
votes1
answer60
viewsArray is only returning the last index
I created an array that has the following structure: $arr = array( "cabecalho" => [ "instrucoes" => array("Instrucao 1", "Instrucao 2", "Instrucao 3", "Instrucao N"), "dadosAluno" =>…
-
1
votes1
answer150
viewsMap Object Array and create new array from keys
I have an array called originalArray, this array has two fields, group and content, group is a string and content any object. Basically I want to divide this new object into an unknown number of…
-
1
votes2
answers228
viewsSeparating elements from an array for sequelize query
This id_message I send by parameter by my request, a console.log in this returns me the value of the image. const id_mensagem = [...new Set(response.data.map(mensagens => mensagens.id_mensagem))]…
-
1
votes1
answer57
viewsList the names of all objects within the array
I’m using the Angular JS chip system and I have a problem showing the name(description) of the objects inside the array. The code html that’s the one: <div layout="row" layout-xs="column">…
-
1
votes2
answers322
viewsWhy the function returns the Undefined value
I am trying to check whether an item within the array is divisible or not by another number passed as a function parameter. When an item is divisible returns that same item. If not, it returns "No…
-
1
votes1
answer58
viewsAccess JSON values via PHP
Sirs, I am trying to access the values that are inside the house "values", recovering the value and the Odd but without success, I am creating so: $json = json_decode($response); foreach…
-
1
votes0
answers297
viewsWhat does Trying to get Property non-object mean
I’ll explain my problem I am working with an API and in this api I am getting a certain fields(codigo,ncm,gtin,origin,codigo_pelo_vendor) so my idea was to use a foreach in this way foreach…
-
1
votes1
answer40
viewsObject change with javascript
My API is returning a array with the objects in the following structure: [ {id: 1, name: "Flávio", position: "SP - Atacante"}, {id: 2, name: "João", position: "SP - Goleiro"}, {id: 3, name:…
-
1
votes1
answer93
viewsSorting objects in Javascript
Good evening, I’m having a difficult to sort array in javascript, the problem is that I need to sort it first by number of characters, ( Words with more characters appears first), I’ve done that,…
-
1
votes1
answer76
viewsJava Array Storage Error
I am making a code where the user needs to define a vector of size N, and fill it, however, after informing the vector size, and informing the first value, the following error appears: Exception in…
-
1
votes1
answer398
viewsCalculation of cubic root in vectors
Hello! I am doing an exercise where it is necessary to calculate the cubic root of 10 numbers stored in a vector and transfer them from vector A (where the numbers were read) to vector B ( where…
-
1
votes2
answers170
viewsHow to place two arrays inside a single loop of repetition to populate an object?
Based in that and in that reply, I am creating an instant search box that returns results based on the items of two arrays with elements p and a of certain classes present on the page. The idea is…
-
1
votes1
answer63
viewsSave data to a variable inside the for in Laravel
I’m trying to save data from a loop inside an array, but when I do var_dump outside the for he just shows me one of the dice someone knows how to fix it ? <?php namespace App\Http\Controllers;…
-
1
votes1
answer85
viewsAbstract class to access elements from an object collection
I’m doing my first project on C#, I’m creating data from a multi-object JSON file that contains basic information from a file (Filename, Datacreation, Size). Filing cabinet jsonArquivos.json: [ {…
-
1
votes1
answer100
viewsRecursive Binary Search does not find the element at the last vector position
I made a recursive binary search code in Java. It finds the positions correctly, except when the searched element occupies the last position of the vector. I don’t know how to fix this. public…
-
1
votes1
answer38
viewsappend function only adds last item of my array
I have the following code. For some reason at the time of giving the append to show my li With my data it only shows the last item of my array. Please someone help me window.onload = initPage; async…
-
1
votes0
answers24
viewsProblem with plotweb R - interaction networks
I need to structure in R a network of interactions, but every time I want to plot the graph, this error appears: # 3. Leitura da rede quantitativa read.delim("C:/Users/almei/Dropbox/Thays/TCC/matriz…
-
1
votes1
answer47
viewsReturn array object with condition
I have a json where I need to return the object based on a condition. I need to return the corresponding object to the artist selected by the user, being it selected by name or nickname. The search…
-
1
votes3
answers136
viewsHow to count from "1" instead of "0" in a Javascript array
I’m studying vectors and I used cars and parking spaces for example. But the console.log starts from the 0 and I wanted him to tell from the 1 and even so present 4 vacancies "1, 2 , 3, 4". Code:…
-
1
votes2
answers73
viewsHow to declare that an object in a Javascript array is empty
I made a program to simulate the administration of a parking lot. The console.log presents the amount of vacancies and which cars are in this vacancy. However I did 4 vacancies with 4 cars, and I…