Questions tagged as 'lista'

2
answers

How do I know which ArrayList objects are being modified or deleted?

I have a ArrayList that is preloaded with some objects of the type of my Person class, see: ArrayList<Pessoa> listaDePessoas = new ArrayList<>(); listaDePessoas.add(new Pessoa("Joao", 29)); listaDePessoas.add(new Pessoa("Ana...
asked by 20.10.2016 / 23:22
5
answers

Remove all elements from an array that already exist in another

I have two arrays with objects in javascript: var a = [{objeto1}, {objeto2}, {objeto3}, {objeto4}, {objeto5}]; var b = [{objeto1}, {objeto2}]; How can I do what is in the array b exit the array a ?     
asked by 18.05.2017 / 19:56
2
answers

How do I know if a list is empty in Python?

I'm starting in python and always end up with some doubts in the beginning. I need to know how to test if a list is empty. As I always say, I come from PHP. So I used to do these forms: count($array) == 0 empty($array);...
asked by 15.10.2015 / 21:23
3
answers

Lists repeating last item added

I was studying about the lists in C # and I could not understand what's wrong with my code (it's probably going to be pretty basic), all items are the same as the last item added. I've simplified the code to focus on just that part of the erro...
asked by 09.10.2017 / 15:47
3
answers

Use of the split method

Good morning, excuse my ignorance by simple doubt. I'll get right to the point. I have a list of alerts List<Alertas> alertas; This list contains several messages sent to some users, I have the following methods that I can use: g...
asked by 15.08.2016 / 14:08
5
answers

How do I find the position of an item in a list?

I am writing a program that receives a specific amount of values, and returns the lowest value in the list and its position. It is as follows: quantidade = int(raw_input()) numeros = raw_input() NumerosNaLista = numeros.split() if len(NumerosN...
asked by 10.04.2016 / 00:18
2
answers

How can I "skip" elements of an array when I use "list"?

I have the following array $array = [25, 'Wallace', '26 anos', 'linguagens' => ['PHP', 'Python', 'C#'] I would like to use the list function to capture some elements directly in variables, like this: list($id, $nome, $...
asked by 13.05.2016 / 15:01
3
answers

Multidimensional array of different types

I have a view in the bank of my application where I count the user's name, his sector and the total number of records issued (tale from another table):    TotalPorUsuario (View) Table       Columns: name (string), sector (String), total (i...
asked by 15.03.2016 / 15:20
2
answers

List Comprehension for this case

How can I use list comprehension for this case: >>> a = 'A' >>> lista = [1, 2, 8, 5, 10] >>> l = [a, num for num in lista if num%2 == 0] File "<stdin>", line 1 l = [a, num for num in lista if num%2 == 0...
asked by 15.09.2016 / 16:56
1
answer

How to use Java 8 stream in an Object list []

Imagine the following scenario: A list of Object[] . Something similar to this: List<Object[]> lista = new ArrayList<>(); Object[] dados = new Object[3]; dados[0] = 1; dados[1] = 20; dados[1] = "cristiano"...
asked by 05.09.2017 / 20:47