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
votes0
answers32
viewsProblems saving two information at the same array position
Well, I’m developing an app with ionic 3. I am facing problems, because I need to show in the same column, the product and its value : Product - 350 (value) But, it is storing at position 1, the…
-
0
votes1
answer34
viewsJSON Error with Alphabetic Index
I have 2 Arrays: Array ( [0] => Array ( [0] => Amit [1] => [email protected] ) [1] => Array ( [0] => Rahul [1] => [email protected] ) ) and Array ( [0] => Array (…
-
0
votes0
answers62
viewsLoop inside the submit button
I have the submit button that must submit the grade to a class of students. But when I click the button, it only submits the grade to the last student on the list. The student list and note list are…
-
0
votes1
answer81
viewsJAVASCRIPT ARRAY (map and reduce)
How are you guys I have here this array: [ {dia:2,turno: turno1,M:1,T:0,N:0}, {dia:2,turno: turno2,M:0,T:2,N:0}, {dia:2,turno: turno3,M:0,T:0,N:1}, {dia:3,turno: turno1,M:122,T:0,N:0}, {dia:3,turno:…
-
0
votes1
answer72
viewsHow to save value entered by the user in 2 different arrays?
Okay, this code is part of an attempt to solve an exercise. My goal is to convert all values from Kelvin to Celcius or vice versa and to present all values entered by the user whether they are…
-
0
votes2
answers44
viewsWorking with Array in PHP
I would like to know how to proceed to achieve the result below in PHP. The way out today is: Array ( [0] => "0000000009999999" [1] => "20181209" [2] => "000000" [3] => "REM BASICA" [4]…
-
0
votes1
answer135
viewsC# convert Array for insertion in the database
I have a Array, some of the values of this array will be added as float others like int, my doubt is the following, as I can convert only one array not the whole list? I would have to create a…
-
0
votes2
answers302
viewsCombine arrays within array
Can someone help me by doing me the favor. I have an array in this style: $arrayTable = array( 0 => array( 'idApiUm' => 123, 'title' => 'Teste' ), 1 => array ( 'idApiDois' => 765,…
-
0
votes2
answers136
viewsHow to group array that has the same value
I have the following string that is converted into an array that represents: "Question;Matter ID;Answer": //PEGANDO AS REPOSTAS…
-
0
votes1
answer43
viewsHow to create a Pipe by filtering a list of items, where there is an array of objects in this list? Is it possible to filter this object array as well?
I’d like some help with a pipe. The purpose of the pipe is to filter into a list of vehicle advertisements some properties. For example: brand, fuel, type and etc. So far everything works, but I…
-
0
votes1
answer125
viewsShow data array
I have the following data obtained from a query: I would like to read this data and show it on the screen, but first show all the goals, then show all the challenges and so on. <?php $resultado =…
-
0
votes1
answer1097
viewsErrorexception Array to string Conversion
Hello, I’m starting a test project of my knowledge, I’m having problem in the variable line $response = $validate->$data; before I created the Rules was working normal, I tried help on the…
-
0
votes1
answer78
viewsFinalizearray Example
I’m trying to clear a vector after performing a procedure, since I need to use the same vector to make the next loop of the procedure. After a lot of research, I found the appropriate filter to…
-
0
votes1
answer54
viewsRecyclerview is displaying entire json array instead of object
Inside recyclerView everything is being displayed correctly except the "name" (Notifier > name) When I use String creatorName = hit.getString("notifier"); it shows the entire "Notifier" object.…
-
0
votes1
answer187
viewsDifferent global variables that when one is changed change the value at all
I have a class responsible for managing certain call variables clusters, these are a vetor de vetores yesterday contains a word and an associated value. But every time I make an adjustment to the…
-
0
votes0
answers103
viewsHow to send to the back end an Array inputFiles via form?
I have a form that besides the input file has other inputs like for example the input name.. select type... In the input file I need to get more than one file, I got this with help from the people…
-
0
votes2
answers113
viewsProblem with C++ code
I was writing a code and I stagnated on some problem along the way. Follow below for more details: Enunciation Afonso is in line to buy tickets to his concert favorite band. Afonso is at the end of…
-
0
votes3
answers1124
viewsHow to pass javascript array to form and get the values in php?
I have a form that creates a list of selected images before sending through an input type='file' However how can I pass the Array Javascript to the form and submit it by clicking on action? I need…
-
0
votes1
answer565
viewsPassage by struct vector reference
I have to do an exercise where I get a struct and a vector following this struct with a size N of houses (which I called in the code of QTD) entered by the user. After this the program allows to…
-
0
votes2
answers117
viewsPicking up javascript arrays for sending in the form
<script type="text/javascript"> var nomess = []; function handleFileSelect() { var output = document.getElementById("resultt"); arquivos = $("#imagem").prop("files"); var nomes =…
php javascript array multidimensional-array array-pushasked 5 years, 8 months ago Richard Barcelos 21 -
0
votes1
answer49
viewsReturn of a single element from a list to a LINQ
I’m taking elements from a list and I can’t erase the elements, I have to return them all. I found a problem at the end of this query, where you have the comment //Erro…
-
0
votes2
answers143
viewsRun function after object created by click
Below is what I managed to do: When I click on a button with the class .btn-comprar-na-pagina, it fires function below. $(function () { var itens = []; $(document).on("click",…
-
0
votes2
answers2088
viewsGroup repeated records into an array in javascript
I have a JS array with only two attributes, a state name and a city name. Example: var variavel = [{estado: 'São Paulo', cidade: 'Campinas'}, {estado: 'São Paulo', cidade: 'Santos'}, {estado: 'São…
-
0
votes1
answer1089
viewslist multiple ngFor arrays
I need to list all subcategories in a table and I’m not sure how to do this. { "message": [ { "category_id": 1, "shop_id": 1, "category_name": "Bebidas", "status_cat_css": 0, "status_cat_active": 1,…
-
0
votes1
answer65
viewsMap JSON to array-specific format for Google Charts line chart
I have a JSON in the following format: [ { "Countrys": [ "Cyprus", "Finland", "Germany", "Grenada", "Haiti", "Ireland", "North Korea", "Swaziland", "Turkmenistan", "Zambia" ], "ListDataPerYear": [ {…
-
0
votes1
answer345
viewsSet up dynamic menu
I have the following array I would like to introduce a menu with a dynamic submenu, more or less like this one I tried to do it that way <ul class="sidebar-menu" data-widget="tree"…
-
0
votes1
answer66
viewsLoad checkbox explodes
I made a code with explode to carry checkbox of banco, however, it is only loading when it contains data in the exact order of variables, for example 'Theater 1, Theater 2' carries, but 'Theater 1,…
-
0
votes2
answers90
viewsWarning: scandir(/game/c_images/album1584/): failed to open dir: not implemented in
I am having these Warning while running this code on my localhost someone could give me some solution? Thank you ^^ <?php $target = "http://localhost:8080/game/c_images/album1584/"; $weeds =…
-
0
votes1
answer181
viewsDistance between a line and a point in three-dimensional space
Let’s say there are three points in a 3D space (dots A, B and P). Let’s also say that there is a straight line through A and B. What I’m trying to do, actually, is find out if a reta AB intercept…
-
0
votes3
answers2698
viewsSeparate even and odd numbers with two vectors in C
I have the following problem: I need to read several numbers until the number typed is 0 or one of the vectors is fully filled, in case the vector must have a maximum of 10 indexes, and for each…
-
0
votes0
answers249
viewsJunk in memory when printing vector backwards
02 - Create an algorithm that asks the user to enter its name and store in an array, the program must store in another vector the name written backwards. At the end, the two vectors should be…
-
0
votes1
answer210
viewsUse of vectors and binary search in English
One of the most commonly used activities on the computer is to locate an object (number or string) in a data set. You should develop an algorithm that allows you to find a number in a vector of 100…
-
0
votes1
answer69
viewsMerge two array’s recursively without adding new keys
someone has some hint to merge two array’s but the second must replace the values of the first recursively but only of the keys that exist in the first, that is, the extra values that exist in the…
-
0
votes1
answer26
viewsError while passing index of an array
Good night. I believe my problem is simple, but I found nothing to cure it. I’m doing a CRUD in PHP, using MVC, to learn how the language works. It turns out that the Mysql database works with date…
-
0
votes1
answer56
viewsDoubt in activity with POO
Hello, basically the exercise is to have the user type numbers in an array and then I have to have the array separated into another 2 : one for pairs and the other for odd ones. I’ll leave the code…
-
0
votes1
answer114
viewsVariable does not display correct result in C
I have the following problem to solve: Write a program that reads two matrices of 10 rows and 2 columns. Each row of the matrix stores two notes of a student. The first matrix stores the notes of G1…
-
0
votes1
answer475
viewsGroup javascript object by category
I have an object in JS with information of places (Cinema, Museum, etc.) that I will use to popular in my system. Example: var places = { "type": "ABC", "features": [ { "type": "AB", "properties": {…
-
0
votes1
answer146
viewsChange the quadrants of an even-sized matrix
I get an array, and I must print it on the screen as shown in the image below. This is the current code: #include<stdio.h> int main(){ int matriz[4][4] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,…
-
0
votes1
answer27
viewsError using maximum number of vectors, and does not return to menu
I am new to programming language and would like to know if anyone can help me, here is the following problem: PS: I know the error is because I am using my object limit, but I do not want the error…
-
0
votes0
answers53
viewsOperations with Bytes vector in C#
I’m new to programming and I’m working on an RSA encryption algorithm. The key generation processes, calculations are almost ready... I have an array of bytes that receives the message typed by the…
-
0
votes1
answer722
viewsValue appears and disappears after click-Javascript
Good evening, I made a javascript logic of inputs receiving the value of an array, all right however, when you click on the button to happen the event the values appear and disappear from the input…
-
0
votes1
answer504
viewsInsert array into database using PHP and SQL
I’m trying to insert values from a array inside the database using PHP, but I’m having difficulty in the applied method. It’s the first time I use arrays for that reason. My current code is:…
-
0
votes1
answer147
viewsHow to declare a Multidimensional Array key - Javascript
Ola, I would like to know how to concatenate two keys of an array, the idea would be more or less like this: dados['azul'][i] = id; Where the Data Array has the key that is a predefined color and…
-
0
votes2
answers128
viewsWhich type is inherited from an . NET array?
If we declare a List, we are sure that your type is explicitly the System.Collections.Generic.List<T>. But when we declare one array? What is the generic type implemented behind it? Example:…
-
0
votes2
answers168
viewscalculation of media in programming c
Hello I’m putting together a code for an activity of my course but the media that needs to appear at the end if you enter a negative number only appears zero, I’m a beginner in programming so I’m…
-
0
votes1
answer157
viewsCreate array with Firebase return data
You would need to create a new array from the return of the Firebase image URL The newImgList array receives nothing. task ts. imgList: []; newImgList: any = []; constructor(...) { this.tarefaId =…
-
0
votes1
answer150
viewsPost php array Insert mysql
I have a Javascript form that sends a array, however I am not able to recover the columns and their values of the array to insert into a Mysql database with PHP. Example of array…
-
0
votes0
answers50
viewsProblems accessing array content
I wonder if any of you can help me. I am trying to read the object of the array in question and I am not able to print on the screen, as much as forach. If anyone can help me, I’d be very grateful.…
-
0
votes1
answer58
viewsKeep zeroes after the point
Good morning to you all. I have the following code: var somaR = 0; var somaN = 0; var project = [ {part: 'Renault', partNumber: 1234, project: 'X19', gap: 15.000}, {part: 'Renault', partNumber:…
-
0
votes1
answer402
viewsDoes splice remove an object from the array?
I have a question in Javascript. When I splice an array, it removes what? For example, I have an array with several objects inside, as in the example below: lixo: [ {"nome": "garrafa pet", "tipo":…