Skip to main content
Filter by
Sorted by
Tagged with
Best practices
0 votes
4 replies
120 views

I have a list of ranges that consist of a start and end value. I need to optimise the list by identifying any overlapping ranges and merging them so that there is no duplication on the list. I have ...
Michael's user avatar
  • 507
0 votes
3 answers
107 views

I am working on a LeetCode question. I am able to solve it using other approaches but not via this approach. I am trying to reverse a singly linked list recursively. When I run the code, my output for ...
Sakib's user avatar
  • 47
0 votes
1 answer
87 views

I have tried using both base class and interface and in both instances I am told a constructor that takes my arguments does not exist. I have two classes that are related to each other and I want to ...
horsemeat's user avatar
0 votes
1 answer
158 views

How can I make an array of variables 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
75 views

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
5 votes
3 answers
209 views

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
93 views

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
70 views

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
374 views

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
78 views

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
180 views

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
57 views

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
93 views

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
275 views

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
74 views

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
96 views

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
55 views

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
1 vote
4 answers
148 views

A total Java rookie here, I'm wondering if there's any way I could iterate over several arrays like: myArray1 myArray2 myArray3 by doing some form of "concatenation" to invoke these arrays ...
Marian Kay's user avatar
1 vote
2 answers
91 views

Currently I have the below code creating a multidimensional arraylist (but I am not married using arraylists, just need a free-to-add to array type): $Installs = new-object system.collections....
user66001's user avatar
  • 950
0 votes
0 answers
30 views

How do I extract image urls from a file arraylist and add the corresponding bitmap to a bitmap arraylist. I've blocked out what I think is close: val fileList: ArrayList<File> = imageReaderNew(...
garrettlynchirl's user avatar
0 votes
0 answers
37 views

I have two arrays both contain 12 elements. I want capture the elements with the indexes of 0, 5, 10 and store them in a new variable, but I've noticed my filtering does not work if I change some of ...
Dumile Chiwuta's user avatar
5 votes
2 answers
160 views

I made a very simple program with a GUI where the user inputs the file name and the program itself calculates the mean of a file containing numbers only. I did this by creating a function that reads ...
mtldev1642's user avatar
0 votes
1 answer
259 views

I'm working on a Spring Boot application that needs to map a JSON column in my MySQL database to a Java entity using Hibernate. I am using the @Type annotation from the Hibernate Types library, but I'...
Ay3sh's user avatar
  • 3
1 vote
1 answer
71 views

parsedJsonChildData (original data): [{date=null, feeForPerformance=null, feeFrequency=5}, {date=12-25-2024, feeForPerformance=23, feeFrequency=1}, {date=12-03-2025, feeForPerformance=1, feeFrequency=...
Beginercoder's user avatar
-2 votes
1 answer
88 views

I have a Class B defined as below --> Class B { private List<String> obj1; private List<A> obj2; // Need to implement hashcode() and equals() methods } In my code, I am using ...
rishi007bansod's user avatar
0 votes
1 answer
102 views

I need help, for group by my XML object class. Here my data from SQL server, my Query ( select * from TaxXMLdb ) = TIN DocEntryAR BuyerDocNum BuyerName Opt ItemCode Name DocEntryAR2 AAA 100100 5533 ...
valen's user avatar
  • 3
2 votes
3 answers
145 views

The following code is meant to loop through a txt file and create a list of recipes that each have a name, cooking time and ingredients, which are themselves put on a list try (Scanner scanner = new ...
Felix_is_coding's user avatar
0 votes
1 answer
46 views

My program has 5 classes: 1 - Abstract class Animal public abstract class Animal { } 2, 3 - Classes that extend an abstract class public class Cat extends Animal implements Comparable<Cat> { //...
Serg's user avatar
  • 13
1 vote
0 answers
56 views

I have created an Arraylist of items. Once an item is selected, it goes to a new activity for the price to be calculated once the quantity is selected. Upon clicking cart, it goes to another activity ...
Just Learning's user avatar
0 votes
0 answers
115 views

I'm not sure what happened when saving a file, but now when I try to load it I get java.io.EOFException. All of the code is in try/catch blocks but there was no error when saving the file. Opening the ...
vincatzero's user avatar
-1 votes
1 answer
69 views

This image contains Question Sorry can't provide in text as it can not be copy from the platform enter image description here This is what I tried Test cases I was Having Problem solving Test case 2 ...
Tanishq Uppal's user avatar
0 votes
1 answer
37 views

{ "item1" : [{"index":"1"},{"id":"1","name":"npm","result":"expected text1"},{"id":"2",&...
Jemi Artista's user avatar
0 votes
1 answer
53 views

on firefox or chrome. open the console let arr = [] arr.push(window.open('https://google.com')) arr.push(window.open('https://twitter.com')) arr[0].close() don't work arr[1].close() is work ...
heluanyongyong's user avatar
0 votes
0 answers
46 views

there's this thing where the program has to automatically change an item's column's value in a table based on their Type ID. Basically -Maintenance Sched Table has Type ID and No. of Days -Items Table ...
Reyes RK's user avatar
0 votes
0 answers
26 views

I try to manage an Array list of AccessCodes, which are a simple class. In the class Robot I want to get access of one element of the ArrayList and use the method getUsed(), which is defined in the ...
user28181162's user avatar
-5 votes
1 answer
109 views

I'm reading two CSV files from my computer and filling an arraylist with this data. Then I compare these two arraylists to find matches. If the CSV files contain up to 20 lines, then there are no ...
Дмитрий Сергеевич's user avatar
0 votes
2 answers
128 views

I want my program to take an integer and put every prime number up to that integer into an ArrayList. Logically I can't find why it doesn't work. import java.util.ArrayList; public class primenumbers ...
Scott Burkhart's user avatar
0 votes
1 answer
536 views

Using Zig, as a new to the language, trying to perform few simple actions on a file. I have a function with the purpose of getting a path to a file and returning path to a sorted file. The function ...
avifen's user avatar
  • 1,116
-2 votes
1 answer
92 views

I have a response. I need to get the functionAmount when functionType = limit. I have the hard coded here. How to convert this into dynamic. How to filter data from nested objects? "users": [...
TestUser's user avatar
  • 213
-2 votes
1 answer
755 views

I am trying to write an endpoint to return all the data in a seperate JSON file. This is my code for now. UserController.java import org.springframework.beans.factory.annotation.Autowired; import ...
lse23's user avatar
  • 1,847
-1 votes
1 answer
248 views

I'm writing a .vbs script for an application on Windows. The problem is that the ArrayList is used inside the script. MDSN states that the .NET Framework 4.8 installed is sufficient to use ArrayList. ...
Ivan Serdukov's user avatar
1 vote
2 answers
104 views

I want to loop through an array with an if statement and only after it has looped through the entire array execute the else. This is how i have my code now for index, nameList in enumerate(checkedName)...
PaN1NI's user avatar
  • 39
3 votes
1 answer
65 views

My code gives me this incorrect output: ['CT', 'X', 'Z'] [100, 1.0583, 1.0633] [200, 3.012, 5.873600000000001] [300, 1.79, 2.5220000000000002] ['Total', 0, 0] The reason is that 5.873600000000001 is ...
Elektvocal95's user avatar
0 votes
0 answers
41 views

I am a C# developer in my day job and I'm working on a side project in Kotlin while trying to learn the language. I am consolidating ArrayLists into a single ArrayList using a class like this. class ...
Mr. Anderson's user avatar
-3 votes
1 answer
64 views

I wanted to write a recursive function that calculates the sum of the elements in an array, but when I pass the array to the function, it thinks that I passed an integer and writes that there is no ...
noname's user avatar
  • 7
-3 votes
1 answer
55 views

java.lang.ClassCastException: android.widget.Button[] cannot be cast to android.widget.Button at &...
Muhammad Hasnain Munir's user avatar
0 votes
1 answer
81 views

I am trying to send some image files, an array and a list with Ajax, but when I read it in the maintainer, it does not pass me the values ​​of the list, the value is null. The program is developed in ...
Fernando Diaz's user avatar
1 vote
1 answer
276 views

I am migrating an application from View to Compose. The application was written in Java so I need to migrate the UI to Kotlin. I prefer to do it as gradually as possible so I'm leaving the ViewModel ...
Shaul's user avatar
  • 469
0 votes
1 answer
72 views

I would like to add multiple types of classes to a List to use it in a DataTable later on. My desire is to sort the specific columns and use buttons inside of it later on to do some actions. How do I ...
Tech RCV's user avatar
3 votes
2 answers
84 views

I am using an arraylist to hold different shape objects that are a subclass of an abstract superclass. The superclass contains two abstract methods: surface_area and volume respectively. After I add ...
Kaleb Weikel's user avatar

1
2 3 4 5
692