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
answer22
viewsProblem accessing data from an object in an object array
I have a Store class that has an array of type Product (which has name, code, price and quantity) and I need to access the given name of the objects of this array. The following code is giving…
-
-1
votes1
answer154
viewsHow to turn content from a file into an array in PHP
I have a file that has a array with the translations of a website. The contents of the file are similar to this: var textHome = { "home": { "btn_contact": { "pt": "contato", "en": "contact", },…
php javascript array regex file-get-contentsasked 5 years, 2 months ago Thiago da Victória Nunes 59 -
-1
votes1
answer163
viewsHow to use a function to fill all positions of the dynamically allocated vector?
Good afternoon guys, I’m seeing for the first time the C language and I’m not making progress on a job. First you are asked to create a function int receive Operator() This function will request the…
-
-1
votes1
answer47
viewsDynamic allocation in wrong scope
I dynamically allotted a vector of structures with qtdeFuncionarios positions within a if, but now I need to use it within another conditional structure and the compiler accuses scope problem. How…
-
-1
votes1
answer82
viewsHow to find an ordinary sequence of Keys in an Array?
The goal is to find the next ordinary sequence of 03 Keys within a array with broken indexes, in the example would be 4,5,6 or 7,8,9 CODE <?php $myArray = array( 'item_1', 'item_2', 'item_3',…
-
-1
votes1
answer1105
viewsImage does not appear in Flatlist React Native
Hello, I’m trying to put together a list with some elements inside it but the image element does not appear but returns the right image size. I created an array with the data I want to show, then…
-
-1
votes1
answer70
viewsHow to group array and mount select
How can I group array results and mount select. Database PHP <?php $rsPA = $mysqli->query("SELECT * FROM provas_agendadas WHERE status = 'A' "); foreach ($rsPA as $key => $rsRowPA){ $dis1[]…
-
-1
votes1
answer129
viewsProgram C exclude vector value and decrease it in one unit
Staff with a following problem I have to make a program that implements a routine that le 10 numbers of a vector and then receives a value to be searched in the vector if it finds erases this value…
-
-1
votes1
answer816
viewsPrinting an array with all elements on the same line
Why when we ride a array, as in the following code: let x = 0 let array7 = new Array for(x = 0; x < 50; x++){ array7[x] = Math.floor(Math.random() * 50 - 10 + 10) } let array8 =…
-
-1
votes2
answers49
viewsInserting information several times
Good afternoon, I am developing a small script to organize some information that are contained in a vector, the idea is to go through two vectors, when the information of each is equal, must enter a…
-
-1
votes1
answer354
views -
-1
votes1
answer63
viewsWhy can’t I save several . value in the array?
//Variaveis Globais var d = document; var Nomes = []; function processar(idTabela) //Inserir Linhas e Verificar…
-
-1
votes2
answers282
viewsArray return
I have to do a function with the name saldoDeMesesComLucro where a array of a period of months, in the function I need to find out which of those months gave a valor > 0 and make the sum of this…
-
-1
votes1
answer52
viewsDifficulty working with arrays
I have this code that returns normally using the instruction switch function getLetter(s) { switch(true) { case 'aeiou'.includes(s): console.log("A"); break; case 'bcdfg'.includes(s):…
-
-1
votes1
answer2163
viewsHow to access individual object values in array?
I’m trying to access some specific values of an object within an array, from a get method response using Xios. I’d like to access id, dateTime, sensorData etc of each array object separately, for…
-
-1
votes1
answer50
viewsTake Multidimensional Array Specific Data
Hello, I’m trying to get a specific data from an array but I’m not getting it. I can list up to one dimension but the next one doesn’t... someone gives a help please. $dados =…
-
-1
votes2
answers991
viewsTransform matrix into vector
I am doing some exercises with matrix and array, and I arrived at the following situation: static void Main(string[] args) { int linha = 3; int coluna = 3; int[,] matriz = new int[linha, coluna];…
-
-1
votes1
answer178
viewsAsyncstorage with dynamic keys does not save values
I’m trying to make a list where the user sees all the Keys he saved in the app and when he clicks on them will occur the load of the preset he made based on the key. I’m getting the bug: Typeerror:…
-
-1
votes1
answer458
viewsHow to send an array with ngmodel
I am redoing a project now in angular, and to get an array of the form I used getlist and Prod[] and Qtd[] inside the tag form, now in angular use ngmodel and not the form itself, how can I take…
-
-1
votes2
answers529
viewsChange array values using for and if
Hello, I have an array with several values. I would like to replace the values above -0.54 to 1 and the values below -0.54 to 0. Below is my results name array: array([-2.06133692, 0.3721 ,…
-
-1
votes1
answer198
viewsArray Creation in Kotlin : No value passed for Parameter array [init]
kotlin array Converti um código de java para kotlin, porém está com um erro que não consigo resolver Here is the java code public class IntroActivity extends AppCompatActivity { private ViewPager…
-
-1
votes1
answer64
viewsSeparate arrays in columns in an html table
I wanted to separate my array by columns in a table. When I enter the records you get a ',' but when I take the comma you get an Array to string Conversion error. Could you help me? How I wanted the…
-
-1
votes1
answer21
viewsSearch array data for calculations
Save Galera, I’m looking for data that is in a multidimensional array and store the data in each variable to simulate spending and flights. I cannot take data from the array and add it to the…
-
-1
votes2
answers3288
viewsAdding values from an array
Storing values in array but cannot sum values. package primeiro; import java.util.ArrayList; import java.util.Scanner; public class Testes { public static void main (String[] args) { Scanner scanner…
-
-1
votes1
answer30
viewsHow to set a fixed key for an array?
How can I set a key for an array with multiple values? The array lists all trackers (in which case there is no key defined); $trackers = array( 'udp://9.rarbg.to:2970',…
-
-1
votes1
answer33
viewsCreate a column with case_when with ranges error appears
I have this database and I intend to create a new column with this structuring (see image). For example, if the row in the Calendar_week column has a value between 36 and 45 the new Quartile column…
-
-1
votes2
answers96
viewsPython loop requesting data reentry
I have a problem in my Python code, it is giving loop. Every time I have to insert the list again to show the results. Could someone help me? Follows the code: import numpy as np import pandas as pd…
-
-1
votes1
answer80
viewsMerge array to stay 2 columns
I am with 2 separate array of 1 x 1000 and would like to stay with a single of 2 x 1000. r = array([0.56155503, 0.98218785, 0.95613911, 0.98307298, 0.55173653, 1.04626122, 1.01631092, 1.03858722,…
-
-1
votes2
answers53
viewsAdd empty items at the end of array
This is what I need to do, and I’m not up to it. I have to create an array to generate a json output with 50 items for example, but if the database contains only 30 it completes the 50 items with…
-
-1
votes2
answers1698
viewsCheck which array only has even numbers
Write a function called getValidPassword receiving a two-dimensional array as a parameter. Each array entry represents one passcode. You need to find the passcode that has no odd numbers and return…
-
-1
votes1
answer145
viewsReturning Firebase data in an Array
So I have a little problem that I can’t solve at all. I’m using the firebase database in conjunction with an ESP8266 microcontroller. The ESP8266 sends the sensor data to the firebase, and through…
-
-1
votes2
answers71
viewsThe correct way to count an array in PHP
I would like to ask a question, I have a script where I count the total of files of a directory and compare with the files of the bank, everything is working. My question is this:: When I put a code…
-
-1
votes1
answer155
viewsPHP Mysql multidimensional array
I’m having a little trouble assigning an index to encompass the items marked in the figure below in a multidimensional array I’m mounting with the database queries: I need to take from another table…
-
-1
votes1
answer128
viewsSave values from a text file to an array
I’m trying to make a code where I need to store numbers from a text file in an array. The code I have is this:: #include <stdio.h> int main() { FILE *f; int v[10]; int N=0;…
-
-1
votes1
answer127
viewsHow to render a modal on a map using React?
I have an application in React that searches products of an api, I want to render a table where each item has a button that opens the modal and updates (sends a PUT in the API) the product. Only the…
-
-1
votes1
answer95
viewserror: assignment to Expression with array type
I’m having a problem where I assign values to the matrix and to the vector but I still have the attribution error. I’m new to the forum and I still don’t know how things work right, if information…
-
-1
votes1
answer16
viewsIn D3.geo, how to obtain the data of a projection?
I am using only D3.geo, not the full D3 library, but only D3.geo. Configure projection and upload Geojson Multipolygon data. I get back the data as follows projectionVale = d3.geo.stereographic()…
-
-1
votes1
answer86
viewsInserting elements at specific array positions
Good night, I’m trying to interface a room system using React, 8 people can enter each room. I return the users contained in the API room, but I also wanted to indicate the empty spaces of the room,…
-
-1
votes6
answers1811
viewsLoop Array - Fruit
I’m trying to do an exercise, but it wasn’t the way the platform wanted, I’ve already spent a few hours trying because I’m beginner and I have no ideas how to solve, could help me? Enunciation: A…
-
-1
votes3
answers452
viewsJavascript - If and Loop
I’m trying to answer a question inside a platform, and I’m not being able to adjust the code as the algorithm wants. I am receiving the following errors : 1- You must have an if validating the…
-
-1
votes1
answer542
viewsHow to know how many times a word repeats in the array and,from the return of a function that calculates this,do new calculations?(JS)
I need to do a function that returns how many times the car board appears in the array and use this return in another function to determine a calculation. That’s my code and it’s printing "0" var…
-
-1
votes1
answer50
viewsSomeone could help me work struct with vectors and function, I’m not sure when to pass the data
typedef struct { int cod, num_hab; char sigla_esta[5], estado[30], cidade[30]; }Cidade; main() { //Variaveis Cidade cidades[max]; Estado estados[max]; Pais paises[max]; int op, i, posl, aux; int cc…
-
-1
votes2
answers77
viewsHow to delete repeated numbers within a Javascript array?
I’m a beginner in Javascript and wanted to overcome the doubt about how to delete repeated numbers within an array. The solution I want to create is to make: User type 10 numbers (without repeating)…
-
-1
votes1
answer65
viewsDynamic table with data coming from an input - js
Look, guys, all right? I created a function that prints the prime numbers according to the value entered by the user in the input. I’m having a hard time accessing this number so that the function…
-
-1
votes1
answer119
viewsJavascript: Problems running a function. How to improve code?
Hello, I am doing an introductory Javascript course and, although I can print the desired result of the exercise, the platform does not recognize my code. I would like you to help me improve the…
-
-1
votes1
answer72
viewsHow to classify a.csv file column without using PHP Sort functions?
I need your help to complete a college activity. I have to sort the rows of a.csv file according to one of the columns and display the result. I could use the array_multisort, but I need to write it…
-
-1
votes1
answer753
viewsTake data from an React Native array
I need to get data from a array of the server to display to the user. A is a show as if it were a feed of a social network, but is showing the same contents over and over again. componentDidMount =…
-
-1
votes2
answers58
viewsHow to access vectors of a class in C++
**I am familiar with pure C language because I develop embedded systems and microcontrollers. I am dedicating a lot in the studies of a new paradigm of programming that is object orientation (OOP).…
-
-1
votes1
answer29
viewsQuick Sort array implementation error
When presenting the elements of the vector, there are strange numbers that do not correspond to those entered by the user. I would like to identify where the error is. #include <iostream>…
-
-1
votes2
answers184
viewsHow to access the name and address in the Customer Class, and access description and price in the Java Product Class, being in the Box Class?
I tried to use the following commands: // Requesting the customer’s name name = input.toString(); purchase[i]. getCliente(). setNome(name); // Código do produto a ser comprado, que é o endereço da…