Questions tagged as 'array'

1
answer

Save table value

I'd like to save the value assigned to a table in real time, I'll explain. I have 2 files: Main.lua dofile("tester.lua") io.write("blabla") table.insert(oi, io.read()) print(oi[1]) io.read() tester.lua oi = {} If I exe...
asked by 17.08.2014 / 22:51
1
answer

How to transform Array into different variables?

I have the following array which returns me the following values: ( [cliente] => Array ( [0] => Array ( [Code] => 1 [Name] => a...
asked by 22.10.2016 / 15:08
1
answer

How to pass an array in a WHERE condition

$this->db->set('al_reg', $matricula); $this->db->set('dataagendamento', $dataagendamento); $this->db->where('cod_lab', $laboratorio); $this->db->where('cod_horario', $horario_prova); $this->db->where('cod_data', $dat...
asked by 18.10.2016 / 15:31
1
answer

Why is it possible to access array indexes with "{}" keys?

In some tests I did with PHP, I saw that it is possible to use keys ( {} ) to access indexes of arrays . Example: $array = ['a' => 1, 'b' => 2, 'c' => ['d' => 4]] echo $array{'c'}{'d'}; // 4 echo $array{'c'}['d']; /...
asked by 04.01.2017 / 20:37
1
answer

How to add values to an array of an array in Ruby?

puts "Alunos\n\n" alunos = [["Daniel: ", "Nota: 10\n\n"],["Abima: ", "Nota: 10\n\n"], ["Wilame: ", "Nota: 10\n\n"],["Felipe: ","Nota: 10\n\n"]] puts alunos I wonder if it is possible to add a new student with a new note as a new array in the...
asked by 11.11.2018 / 21:08
1
answer

Make a generic vector in Java

How to create a dynamic vector in Java with generic programming? This vector must have an initial size of size 4 and be enlarged as new elements need to be inserted. The class must have: Standard Builder. Constructor with initial vector...
asked by 05.05.2016 / 16:23
1
answer

Dynamic memory allocation X vector

I was studying this subject in C, and in most places I'm looking for, one of the examples of using this feature is when you're going to create a vector whose size you do not know. Example: int main() { int num = 0, i = 0, *vetor; pri...
asked by 26.03.2016 / 03:44
1
answer

Create a jQuery instance from an array

I have the following array: var elementos = [$("#elemento1"), $("#elemento2"), $("#elemento3")] I need to create a function that "converts" this array into a jQuery instance, so I can use jQuery functions at all at the same time....
asked by 26.06.2016 / 21:20
2
answers

Dynamic vector allocation

The statement follows:    Make a program that reads keyboard numbers and stores them in a   vector dynamically allocated. The user will enter a sequence of   numbers, with no quantity limit. The numbers will be typed one by one   and, in case...
asked by 14.08.2018 / 18:04
2
answers

How to add option to a select by Jquery / Javascript

I'm trying to create a select that gets its options via JavaScript or jQuery, the data is stored in an array. Example: for (i = 0; i <= cidades.length; i++) { $('select').append('<option>' + cidades[i] + '</opt...
asked by 14.10.2015 / 00:42