Skip to main content
-3 votes
0 answers
96 views

Mismatch in Java version or why is this error showing up? [closed]

In VS code whenever I declare an ArrayList like List<Integer> myList = new ArrayList<>(); It gives the following compilation error: incompatible types: cannot infer type arguments for ...
thewarrens's user avatar
0 votes
1 answer
123 views

Make array of Variables with osclass custom category values

How can i make an array of veriables generated using the values passed through a while loop I am using osclass for a uni project and i find no way whatsoever to make a list os usable variables from ...
Rob Wall's user avatar
1 vote
1 answer
71 views

Framing verification issue on mutable array in a typical ArrayList Insert operation

Consider the following simple ArrayList implementation: class ArrayListImpl<T(0)> { var xs: array<T> var n: nat predicate Valid() reads this { 0 <= n <= xs.Length } ...
JosEduSol's user avatar
  • 5,488
3 votes
3 answers
161 views

How to consistently retain an exact percentage of elements from a List in Java?

I'm currently filtering a Java List to keep approximately a percentage of its elements using a random approach: import java.util.List; import java.util.Random; public class Main { public static ...
user30654079's user avatar
1 vote
1 answer
84 views

Trying to create nested lists of text data based on test group and questionnaire response, then return the total number of each type of response

My macro accurately creates 2 lists of numerical data based on which group (control or exposed) a subject is in. Dim Subjects As Integer Subjects = Sheets("Participant Info").Range("C4:...
LyleBabcock's user avatar
1 vote
1 answer
62 views

Excel Macro only returns last value in an array

I have a list of 36 subjects and their ages, and whether they are in the 'Control' or "Exposed" group. I am trying split this list into two based on what group they are in. The program ...
LyleBabcock's user avatar
3 votes
3 answers
332 views

ArrayList vs LinkedList in terms of cache locality

How does cache locality impact the performance of ArrayList compared to LinkedList in Java? I've often heard that ArrayList has an advantage in terms of cache locality, but I don't fully understand ...
Marat Tim's user avatar
0 votes
1 answer
71 views

Backtracking confusion

Concerning Javascript, I've been trying to understand backtracking lately and it's really confusing. Specifically, I've been trying to understand the permutation problem, which when given an array, we ...
ContravariantMind's user avatar
3 votes
2 answers
169 views

How to retrieve individual arrays from arrays of strings stored inside an ArrayList?

I'm working on an assignment where I need to take "books" from the user(a title, an author, and ISBN number, all strings), and store these books somehow, and then do various things to these ...
Bill H's user avatar
  • 33
1 vote
1 answer
46 views

LINQ Query to find items that contain a value in an array of values

I have a text property in a class that will contain multiple words along with other properties (index, linenumber, starttime, endtime). I have an arraylist (rawdata) of that class built. I need to be ...
James Parks's user avatar
1 vote
1 answer
76 views

Java with Playwright onResponse method - can't get returned String value, IndexOutOfBoundsException

I have created a void method which prints out the required responses from an url (using Java and Playwright) but I actually need to receive these values for making junit assertions and I am trying to ...
Mina's user avatar
  • 85
2 votes
3 answers
259 views

What does this piece of code mean? new ArrayList<>(Collections.emptyList())

In some code from my company, I've read a list initialization: List<SomeClass> someClassList = new ArrayList<>(Collections.emptyList()) What does it mean? A list with 0 size ...
Corporativo's user avatar
0 votes
1 answer
61 views

Stack Overflow on Quicksort with a first element pivot in Java

For this assignment I'm supposed to test my quicksort class using a variety of different pivots and a variety of ArrayLists in different arrangements. The class works fine with a random pivot, or a ...
Drake's user avatar
  • 19
2 votes
3 answers
91 views

How to check if the user has purchased the maximum capacity?

I have a Java code for booking movie tickets. In this program, each person can only buy two tickets, a maximum of 10 tickets are sold and at the end it displays a list with the names of the people. I ...
Cleyton Melo's user avatar
0 votes
0 answers
49 views

Drools - Pulling an ArrayList<String> from a HashMap<String, Object> in drools

For the life of me I cannot pull a simple String ArrayList from my generic hashmap: HashMap<String, Object> I have been able to pull much more complicated structures such as List of objects ...
Mark Park's user avatar

15 30 50 per page
1
2 3 4 5
2305