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
-
2
votes0
answers81
viewsSort in array with two dimensions in VBA
I have a array two-dimensional dynamics with: Dates of birth in the first dimension (column) and names in the second dimension: Example: Minhaarray(0,0) = "01/05/1990" Minhaarray(1,0) = "Luisa…
-
2
votes1
answer604
viewsStore Variable within a While
I’m having a simple doubt but it’s cracking my head: I have a form where there are several checkbox, the checkbox value is an id number, I would like to create something that when the user selects a…
-
2
votes2
answers202
viewsHow to optimally read a list of Arraylist dependencies?
I’m in four classes, each class has one ArrayList, where the last element depends on another ArrayList: Example Genêro->Artists->Albuns->Music To read the songs I’m doing as follows. for…
-
2
votes1
answer709
viewsAdd typed values without using array
Prepare a program that asks the user to enter 10 values, add this results and present on the screen. I could only do it with one array whole. #include <stdio.h> #include <stdlib.h> int…
-
2
votes1
answer6363
views -
2
votes1
answer148
viewsvalue of select in array
Good, Looking at this query: $sql = mysql_query("select A, B, C, D from table"); $row_sql = mysql_fetch_assoc($sql); I want to take the A column and put all the values in an array: $var =…
-
2
votes2
answers145
viewsI used an array in a method parameter and do not know how to run
import javax.swing.JOptionPane; public class Cliente { private String nome; private String telefone; private int codigo; private String rua; void setRua(String z) { rua = z; } void…
-
2
votes2
answers121
viewsWhich of these three codes is the most recommended in memory and speed?
I would like to know which of these codes would be more recommended for speed, since the three do the same job: 1 $rand_length = 1; $rand_rules = range(0, 9); shuffle($rand_rules); $rand_rules =…
-
2
votes1
answer111
viewsAlternative to PHP database?
I want to know if there’s a way to save form data, display it and edit it without using a database? Because whenever a software will do integration with database I stop because I do not understand…
-
2
votes2
answers2503
viewsHow to search for a string inside an object in an array?
I would like to search for the word "script" within an object, which would be the variable Roteiro. I started trying to figure something out after searching the Internet, but I got lost, and it…
-
2
votes1
answer1289
viewspass an array of objects to another page
scoreBoard.push({ acertosOuErros: acertoOuErro, multiplicacao: resultado }); This is my array made in javascript, I wanted to pass this array of objects to another page for me to treat it (I would…
-
2
votes1
answer1048
viewsPass an input value to an object array
I’m trying to pass on the value of one input text for an array of objects, via jQuery but not understood how to insert it in array. I tried to wear something like: var usuario =…
-
2
votes1
answer804
viewsStore all array positions in a variable?
I have an array that contains 3 positions, each of them stores a long text, how can I do to store in a single variable all these 3 positions of the array. for example: Array['Gol', 'Pallium',…
-
2
votes1
answer153
viewsAdvanced sorting of array items
I have an advanced report, which in the end processes the classification of the items, based on their score: // Variável $relatório contém dados levantados e calculados em blocos para N itens. Cada…
-
2
votes1
answer3945
viewsArray with database information
I am starting an email sending system for a customer. It has SMTP from Locaweb and they have an API for sending email. So far so good I can send the emails using their api, but I came across a…
-
2
votes2
answers985
viewsHow to convert stdClass to array recursively?
I have the following object: $a = new stdClass; $a->id = 1; $a->nome = 'wallace'; $a->parentes = new stdClass; $a->parentes->pai = 'Sidney'; $a->parentes->mae = 'Maria'; I know…
-
2
votes1
answer107
viewsCreate existing array array
I have the following line of code: $valores = implode(", ", array_values($dados)); and, by giving a var_dump(array($valores)); the following information is returned: array(1) { [0]=> string(26)…
-
2
votes1
answer395
viewsSplit two-dimensional array into 2 simple arrays - PHP
I am making adaptations in an old system and need to create a new routine to split a two-dimensional array into 2 simple arrays. Let’s say the variable $query get the array below: $query =…
-
2
votes1
answer87
viewsError when cleaning and building: "uses unchecked or unsafe Operations."
Next, I have a "Board" class in my project that at the time of Clean and Build is showing the following error: "Board.java uses unchecked or unsafe Operations." I did some research and at first it…
-
2
votes0
answers76
viewsWorking with vectors
I need to generate a vector with 100 random number positions and see what the ratio of numbers 2 to every 10 vector positions, the first part I got, but not the rest, it helps? import random as rd…
-
2
votes1
answer93
viewsProperty in javascript object
How can I do a check on a array of objects where the intention would be to eliminate duplicates however, I need to add the values of a property? Example: I have a array object: musicas = [{nome:…
-
2
votes1
answer250
viewsImplement parent class
Well, I’ve done a lot of research, I have a sense of how it works, but I couldn’t implement it, I’d like a light. I have the classes House and Building, I need to create a father class Immovable,…
-
2
votes1
answer141
viewsHow to connect two arrays?
If I have an array: Array ( [0] => Array ( [color] => azul ) [1] => Array ( [color] => branca ) [2] => Array ( [color] => prata ) [3] => Array ( [color] => preta ) [4] =>…
-
2
votes1
answer125
viewsAlimentar Array Primefaces
Good afternoon Personal, I have 2 related table, one for orders and one for order items, soon I thought to feed an array with the order item information and on the same screen put order information…
-
2
votes1
answer34
viewsInsert objects into an Array without copying them
Is there any way I can put the items in one Array without multiplying them? I am trying the following. I want to add the list items MethodList on the list toAdd, but without repeating what is on the…
-
2
votes2
answers413
viewsProblem with String.Split
My problem is this: I want to get different objects from one string, dividing them by the character ;, except those in parentheses. Example: Linha1; Linha2; L i n h a 3; (linha que não quero que…
-
2
votes1
answer49
viewsKeeping names
I want to allocate a string within any structure that I can search for these strings after. I need to enter a condition to end the name insertion. I’m thinking of a structure that runs until the end…
-
2
votes1
answer55
viewsrun updated loop with js returning another
well the code is that down here where: <html> <head> <style> #main { border:#333; border-width:2px; border-style:solid; } </style> <script type="text/javascript"> var…
-
2
votes3
answers1157
viewsComparing values from an array
I have an array and in this array I have some dates, and I need to print out the dates that are repeated. To obtain this data I created one that goes from the size of the array, and inside this one…
-
2
votes1
answer135
viewsFaster way to add an item to an array, using a structure
Structure turma Public id_turma As Integer Public nome_turma As String End Structure Structure Disciplina Public id_disciplinas As Integer Public nome_disciplina As Integer End Structure Public…
-
2
votes1
answer266
viewsIs this Bubble Sort correct?
People I’m reading book "Programming Principles and Practice using c++ (2nd Edition)" from C++ creator. There is an exercise there at the very beginning talking to do a program that sorts the data…
-
2
votes2
answers1416
viewsBreak txt file into blocks, and each block into rows
I have an "active.txt" file where you can find information blocks Ex: SACOLAO CENTER R RUA PAULINO MENDES LIMA,31 CENTRO 45820440 EUNAPOLIS BA UNIQUE PISOS E REVESTIMENTOS R PAULINO MENDES LIMA,84…
-
2
votes3
answers182
viewsForeign value when printing array
In java, I’m having trouble understanding some concepts. On a . jsp page, I have the following code: String[] arrayRegioes = request.getParameterValues("numRegiaoUsuario");//object When printing the…
-
2
votes1
answer369
viewsHow to transform a Java String into a Java Array Object?
On a . jsp page, I have the following code: String[] arrayRegioes = request.getParameterValues("numRegiaoUsuario");//objeto When I print the arrayRegioes, the value shown is:…
-
2
votes1
answer2466
viewsEmpty list matrix initialization "{ }" in C++
From what I have seen, it is possible to initialize a vector with the empty list, in C++, but not in C, so that all vector elements are 0: int meuVetor[10] = {}; // Todos os elementos 0, em C++ What…
-
2
votes2
answers125
viewsSort two-dimensional array by date index (timestamp)
I got the following array that contains file information from a folder: Array ( [name] => Apresenta__o1.ppt [server_path] => C:\wamp\www\portais\arquivos\alunos\4_45258\files\Apresenta__o1.ppt…
-
2
votes1
answer606
viewsCheck if a value is present in an array
I have a table in my database with several numbers. I take the numbers from the database, store them in a array, and do echo in a PHP table: echo "<table class='CSSTableGenerator'>"; echo…
-
2
votes2
answers131
viewsExtract key/value pair from querystring
I have this code where I get the value of a post and ajax. $string = 'nome=Alexandre+Sousa&cpf=0000000000000&email=sousa.akira%40gmail.com&site=www.uniaomaker.com.br'; $dados =…
-
2
votes2
answers402
viewsHow to mount this multidimensional array via foreach
I’ll just put the part where I’m having trouble! The array that I need, needs to be in this format. Example 1: Array ( [atributos] => Array ( [atributo] => Array ( [nome] => Tamanho [valor]…
-
2
votes1
answer205
viewsHow to script auto-complete/increment
There was a need to create a text field that would receive names of cities, however complete the word in the field when starting the first digítos. I need some idea, function with Arrays literals,…
-
2
votes1
answer3467
viewsSave php array to mysql database
I am needing to save an array in a field in the database table and would like to know how best to do this by using the serialize() and unserialize() or json_encode() and json_decode(). I know you…
-
2
votes2
answers295
viewsProblem with malloc
People, doing a small program that given any number, enter a function that divides the number into a vector and returns the number of decimal places (number of positions) that the vector has. In all…
-
2
votes1
answer259
viewsMerge php arrays by allocating combined values between the two
I have the following arrays: $corretor = array( 'Carlos', 'Andre', 'Rosinei', 'Vinicius', 'Thales' ); $comissao = array( 5, 3, 3, 3, 2 ); How do I join both, printing result as follows: Carlos - 5%…
-
2
votes1
answer92
viewsHow to match four or more arrays?
I would like to combine four or more array’s. With two array’s, I use the array_combine and I have the expected result, already with four, no. Which function should I use to combine four array’s?…
-
2
votes1
answer87
viewsImplement a vector that accepts anything
I have to implement an array that is capable of storing objects of any kind. For example: V[3]= valor_int,valor_double,valor_float,valor_String. To do this I was thinking of creating a method that…
-
2
votes2
answers875
viewsConcatenating Javascript Object
I have the following javascript array: for(var k in lista) { for(var x in lista[k]){ var donutData = [ {label: x, data: lista[k][x], color: "#3c8dbc"} ]; } } At the end I would like the donutData…
-
2
votes2
answers469
viewsWord break
I’m trying to make a line break in a Array, but I am not succeeding in trying to execute the split(), summarizing, I want to make a table of 10 rows with 2 columns that acquire the values of list…
-
2
votes3
answers1025
viewsproblem in C with rest of the division
Develop a program that scans ten elements of an A-matrix vector type. Construct a matrix B of the same type, observing the following law of formation: if the value of the index is even, the value…
-
2
votes1
answer102
views -
2
votes2
answers241
viewsOrdering of all elements of a multidimensional array (array)
I need to sort the array below in alphabetical order using the numeric key: Array ( [AM] => Array ( [1] => Array ( [localidade] => Arena da Amazonia [cidade] => MANAUS [estado] =>…