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
-
0
votes1
answer74
viewsHow do I access elements of a json that contains multiple keys in python?
I’m practicing learning Apis with HG Finance , but when I filter the information through a FOR , I see that presents an error called KeyError: nome da moeda, But the code runs the same way, I’d like…
-
0
votes1
answer41
viewsHow to sort an array by two different indices?
Hello to all recently wrote this code, where it will show the list of students in the array by decreasing order of score and at the end shows the top 3. This is the code: <?php $Turma = array(…
-
0
votes0
answers38
viewsArray in Sockets
Good afternoon, I am attending ADS EAD and I say that I have a lot of difficulty learning, I have this job to deliver and I do not know how to solve. The teacher said it’s to use this structure and…
-
0
votes1
answer35
viewsRandomly generate values from a repeatless vector in C
I have the following scenario, which is a vector of questions that should be asked to the user randomly. The problem is that after I enter the first input value the array is iterated right after…
-
0
votes1
answer49
viewsCan someone help me with this exercise?
EXERCISE: Write a function that returns the number of the team that is in the lead. Leadership is determined by the team that has the most points won. If one or more teams have the same number of…
-
0
votes0
answers29
viewsinvalid types 'double[int]' for subscript array
I have to do a Florentzproton function that takes two vectors and multiplies them using another Productovetorial function (which is in another class), then multiplies the resulting vector by a…
-
0
votes0
answers59
viewsProgram that Tells how many repeated numbers you have in the column and row of an array
To simplify, I have to make this ex: **Write a program that reads two sequences of ten integer numbers and prints on screen how many of these numbers are present in the two sequences and how many…
-
0
votes1
answer130
viewsHow to change a specific value of a string in an array?
I have an array: let arr = ['Feijao, Arroz', 'Melancia', 'Banana', 'Laranja,Uva'] and would like her to become: let arr = ['Feijao, Arroz', 'Melancia', 'Banana', 'Laranja, Uva']//(consertando o erro…
-
0
votes0
answers33
viewsHow to find subsequences of a given vector, excluding given positions?
Given the vector v: [7 , 8 , 30 , -2 , 9] And the vector rem, which contains, in ascending order, the positions removed: [1 , 4] It is necessary to do a function seq(rem,n) (where n is the number of…
-
0
votes1
answer143
viewsVector comparison program C++
You guys all right? I’m beginner and I’m trying to build a program that compares two vectors and if all the elements of the two vectors are. I’ll exemplify it to get better... vector 1 = 10, 20 , 30…
-
0
votes1
answer35
viewsError accessing a struct
I created a function to read how many hours the employee worked in the week, however, I have problems effectively saving in the memory of struct. Calling the function:…
-
0
votes0
answers31
viewsReturn group of objects by referencing the item in the postgres array field
I need a collection of objects having as reference the items of an array field in postgres, duplicating the person in the relationships she participates in. I am using Rails 6 and created the field…
array postgresql ruby-on-rails ruby active-recordasked 3 years, 11 months ago Carlos Fagiani Jr 160 -
0
votes1
answer33
viewsProgram that receives a series of notes needs to disregard an invalid entry
Make a program that receives a series of student grades and then print them out. However, the program cannot accept notes greater than 100 or less than 0. If the user types a wrong note, they should…
-
0
votes0
answers70
viewsHow to discover the largest sequence between two vectors?
I have two vectors, one with 10 elements and the other with 5 elements. I need to check how many of these elements are in sequence. For example: I’m basically doing a program that draws 10 random…
-
0
votes0
answers23
viewsUse the matrix of one method in another method to change its values
I’m doing a job that involves manipulating images in java ( I use Intellij) for my degree. I present below my code and what I would like to do is apply the operations of method alineaC in the matrix…
-
0
votes1
answer115
viewsMap vector in Java
I have a data structure work in which I need to create an array and implement the interface Map of Java and, inside it, I store the ordered maps. I’ve already created the vector, but now I don’t…
-
0
votes1
answer30
viewsTransposed matrix that takes non-integer and fractional values
I’m solving an exercise where I type values for a matrix 3x3, the print and also display its transpose. The problem is that I am not able to receive fractional values, and comma numbers. The code I…
-
0
votes1
answer40
viewsQuestions about C-language loop/array
Hello! I did a basic program to calculate the averages of 4 students. The problem is that the result of it, in the final screen, appears the phrase "Insert 4 Notes student 5 here: " without having…
-
0
votes2
answers86
viewsDoubt with array and functions
The purpose of the code is to make each value of the arrays (x, y, z) have a "$" before, then before it was "exemplo" and turns "$exemplo". I tried to do it this way, but the output comes out like…
-
0
votes0
answers42
viewsreturn in the db form a field sum and also other collection values to include in the array
I want to create a query in mongodb where it returns the total value of all the houses of a certain type, and also which street of these houses. At the moment I’m just making a query that brings the…
-
0
votes1
answer28
viewsHelp with PHP Multidimensional Array?
I’m reading some API, and faced a situation with array, that I’m having a little trouble, I searched a lot in the forum before asking, however, as I have little experience I’m breaking my head. The…
-
0
votes0
answers29
viewsHow to access the value of an array within a while loop in SQL?
In the database I’m working on there are a number of salary variables that are registered as strings with entries like 0000001155,00. I’m using a combination of CAST and REPLACE to turn these…
-
0
votes1
answer86
viewsCan anyone help me choose a specific line from the matrix ? (c/c++ language)
I’m doing an activity and she says: (function - matrix and vector) Design a program that reads a 4x4 matrix and creates a 4-element vector consisting of the elements of a matrix line chosen by the…
-
0
votes1
answer35
viewsAssign an array value and a variable
I need to assign a value of a list within a variable, but I don’t know how to call it inside the function. void calcula() { setState(() { double tensaoValue = double.tryParse(tensaoController.text);…
-
0
votes0
answers24
viewsC++ Pass Array as parameter to a function
I have the following code that works correctly: typedef void(__fastcall* _PackEndFunc)(int Buffer); _PackEndFunc PackEndFunc; uintptr_t moduleBase = (uintptr_t)GetModuleHandle(L"processo.exe");…
-
0
votes0
answers34
viewsFormarray Ionic
I am receiving the information from my database and showing on screen using *ngFor, this information is products, on that screen, the customer puts the quantity in the product. However I am having…
-
0
votes1
answer39
viewsProblems to edit items within the struct
I have the following struct: typedef struct { int id; char nome[50]; int tipoUser; float vencimentos; int id_clinica; } Utilizador; I enter in the same values from the following functions : void…
-
0
votes1
answer136
viewsReturn minimum and maximum values of a vector
Encode the function minimax(v,n,a,b), that receives a vector v containing n real numbers and returns in a and b, respectively, the values minimum and maximum between those stored in v. The code I…
-
0
votes0
answers35
viewsadd values to an array in php and play the result in a dynamic table
Good morning Devs, I have a problem that I can not see the solution... Let me explain I have a system here at the company that checks the value of my product with the competitor’s product, a boy…
-
0
votes1
answer60
viewsDifficulties with Arrays
Hello, Good Afternoon. I am a computer student and I am having difficulties with a part of a code, which is for the delivery of a work of my course. void criar_cliente() { /// Número do dia do…
-
0
votes1
answer25
viewsHow to use destructuring assignment to build a new object with common attributes?
I have an array with the following objects: 0: {nome: "Ricardo Graciolli", id: "2", atendimentos: "12", horario: "12:00"} 1: {nome: "Ana Paula Germano", id: "3", atendimentos: "12", horario:…
-
0
votes1
answer37
viewsFilter string array in C and count how many repeat
The program makes car rentals, it takes license plate and the type of car, both stored in two different matrices, as I do to get only the license plates of the luxury type cars. Code I’ve made so…
-
0
votes1
answer37
viewsHow can I make this calculation be performed in all the Objects of the array and return me the value multiplied by the length of the table?
I need the calculation to be performed in all Bjects before returning the value to me by the length of the table (OBS: it’s just a challenge I’m participating, I’m not using database). function…
-
0
votes1
answer61
viewsCall function to allocate vector in C
Hello, I’m creating a program to call a function that should allocate a vector to be used in main(), but I’m having difficulty, I imagine I should use a pointer to pointer, but I don’t have much…
-
0
votes0
answers38
viewsPython: I need to get the area below a curve
This is my code: index = 0 T = np.zeros((300,1)) T[:,0] = np.linspace(0.01, 3, 300)[:] A = np.loadtxt('AAA_'+str(index)+'.txt') Tr = 1.0 idx = (abs(T-(Tr))).argmin() a = T[:idx+1] a = [i[0] for i in…
-
0
votes2
answers62
viewsI need to place coordinates from Mongodb on a map with reactJS
I’m creating a google maps heat map with reactjs, I was able to implement it and pass the coordinates manually, but I need to create the coordinates dynamically coming from the bank in Mongodb, on…
-
0
votes0
answers20
viewsHow to join values from 2 datagrid’s to only 1, even though these columns have different sizes?
string[] datasald = new string[dataGridView1.Rows.Count + dataGridView2.Rows.Count - 2]; string[] debitosald = new string[dataGridView1.Rows.Count + dataGridView2.Rows.Count - 2]; string[]…
-
0
votes2
answers221
viewsJAVA - How to compare columns of an int[][] array
I have to compare the rows and columns of an array and know if they repeat themselves. To compare the lines, it was "easy", but I’m picking to compare the columns. To solve temporarily I am…
-
0
votes2
answers58
viewsInsert values into an array with dimensions defined from a loop
Good afternoon, I am trying to save values in the form of an array from different text files, using a loop. I need the values obtained from the first iteration to be stored in the first line of the…
-
0
votes0
answers35
viewsC# - Cascade Repeat Structure
first good morning! I have a task to feed a "file tree (windows explorer style)" in object format. For this I have initially a method that lists all the files and folders in the directory root of…
-
0
votes2
answers52
viewsAdd element based on array comparison
I have two arrays: videos = [{ "id": number, "title": string, "url": string }] watched = [{ "video_id": number }] "video_id" is added when a user watches a specific video, this ID is the same as in…
-
0
votes1
answer52
viewsDoubt about creating event maps - Typescript
I am an intern and I took on a project in a language that I don’t know much about, I’m having problems creating a return of events, I tried to look for similar errors on the internet, but without…
-
0
votes1
answer36
viewsError using . length in AJAX response
I have the following ajax. var ajax = new XMLHttpRequest(); ajax.open("GET", 'http://localhost/erp/api/v1/itens.php'); ajax.responseType = "json"; ajax.send();…
-
0
votes0
answers42
viewsRepeat lines in Array: is it possible with UNNEST? or is there any other way? - Bigquery
I made this query in SQL in Bigquery (Google): SELECT FORMAT_DATE("%E4Y-%m", date) AS Mes, cliente, ARRAY_AGG( DISTINCT date ORDER BY date DESC LIMIT 2) AS date FROM…
-
0
votes1
answer27
viewsHow to put a limit to my vector?
I am doing a work, and in it I find a vector with possible values for a variable, however, the values that really meet the answer, are contained in the restriction 1.5 < R < 2 . How I would…
-
0
votes0
answers36
viewsValidation of strings in C
Good afternoon, I am learning C in college, and the following challenge has been proposed: A seller needs an algorithm that calculates the total price due for a customer. The algorithm must receive…
-
0
votes2
answers54
viewsMap array and include ID items using MAP and FILTER
I have two arrays: The first has some questions, ex: Array questions: [ { "id": 2, "question": "Questão 1:", "essay_question": false, "value": "2.00" }, { "id": 3, "question": "Questão 2:",…
-
0
votes1
answer108
viewsImplement radio Buttons using the unform library
I get the following array of an API: Array Exam: [ { id: 2, question: 'Questão 1:', essay_question: false, value: '2.00', options: [ { id: 1, option: 'Opção A', correct: false, question_id: 2, }, {…
-
0
votes0
answers21
viewsJavascript - Array of various objects, but with content
The problem in question is that I do the request, I receive the data, I push the data inside an instantiated array at the beginning of the code, but when I go to see this array, it says it’s empty,…
-
0
votes0
answers31
viewshow to traverse each row of an object array and display on the screen (PHP)
I am having a problem displaying a query(Select) of some items on the screen. It is only displaying the first line. <?php require_once 'app/Lib/Database/Connection.php'; require_once…