Questions tagged as 'lista'

2
answers

Doubt on List that does not return the result

I have this method in Java, which queries the database and returns me a list of students. The method is querying the DB but does not return the data correctly ... public static List<alunos> teste() throws SQLException { String sq...
asked by 15.11.2016 / 01:44
4
answers

Get random element from a ListT

I have List<int> numeros Is it possible to return a random element from this list?     
asked by 09.07.2014 / 16:12
3
answers

I need to sort a list in order that seems incoum

I have a query and I want to sort this query by the code attribute. I did this: consulta.OrderBy(c => c.Codigo); Result obtained: 1.01 1.A 14.04 14.11 22.01 3.04 30.01 4.01 40.02 Expected result: 1.01 1.A 3.04 4.01 14.04 14.11 22....
asked by 19.12.2016 / 20:34
3
answers

Faster way to access properties in a list C #

I have a project that works with a large volume of data, and I need to optimize it to bring results of some calculations in a considerably small time. I know I have several aspects to take into consideration, such as the structure in which the d...
asked by 30.03.2016 / 15:15
2
answers

ArrayList versus List

What's the point in C # should we give preference to using List instead of ArrayList ?     
asked by 09.08.2017 / 15:01
1
answer

Sort list by similarity to a string

I have a list of string : AAA BBB CCC ABB ABC ACC ACD The user will type what he is looking for, he would like to take to the first positions, the most similar ones. Example: String: A Result: AAA ABB ABC ACC ACD BBB CC...
asked by 30.11.2017 / 18:37
3
answers

How to set the equality comparison between two objects present in an ArrayList?

How can I set the equality comparison behavior between two objects whose class is defined by me that are stored in an object of type ArrayList? ColorName public class NomeCor { private String nome; public String obterNome() { return no...
asked by 03.04.2017 / 02:55
2
answers

Why ArrayList instead of Stack in the implementation of Memento pattern?

As you all know, the Memento pattern is the default that saves different states of objects and then retrieves them. The intent is not to retrieve the "last" entry and then remove it? This is a stack, right? So why do examples use ArrayL...
asked by 31.12.2014 / 12:50
1
answer

How to compare two lists in Python?

I have two lists whose content refers to one file1.txt and the other one file2.txt , there are differences in the contents of the files and I want to search < only the data that is in file2.txt and is not in file1.txt , I do not care the oth...
asked by 16.02.2016 / 16:19
1
answer

Difference between "list (range (1, 10))" and "range (1, 10)"?

I asked this question here Formatting All the elements of a list in Python? . In one of the answers, @CiganoMorrisonMendez put the following excerpt: list(range(1, 10)) However, whenever I used Python , I used range(1, 10) Is...
asked by 28.10.2015 / 19:59