I’ve got a list of objects with LocalDateTime and int fields. Here is an example of an object from the list: How to check whether a sum of ints on a certain date (multiple entries for the same date possible) does not exceed some value for O(n) or better? forEach loop must be used, sorting is restricted. Answer I’ve done
Category: Questions
Failed to convert a value of type java.lang.String to int?
I am trying to display the total expenses in a Text view but the application keeps giving me this error. The application uses Firebase and I had the getAmount() and setAmount() initiated as String since I only needed to display. It works as Strings but the amount doesn’t get added to himself it just goes in front of the first
RegEx to find value in JSON
I need to write a RegEx on a JSON to match everything that starts with {$ and ends with } I tried with /{(.*?)}/g and it seemingly works fine but if you see the image below it also matches the other text so how do I explicitly write a RegEx for my requirement The reason for the ask is I
How to take n spaced input for multiple lines in java? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question 11 22 33 44 54 63 73 53 24 I am unable to take input in this format in java. I am comfortable with n
Trusted SSL certificate showing as self signed
I have a trusted TLS certificate deliverd by DigiCert that I’m trying to use in a java/spring application exposing rest apis. I created a .p12 file with openssl doing the following : openssl pkcs12 -export -in mycertificate.cer -certfile mycertificate_INTERMEDIATE.cer -inkey myprivate_key.key -out myCert.p12 I am able to use this file in my application to access the app through https with
lateinit property mock object has not been initialized
I’m trying to initialize (by mocking) two objects with the annotation @MockBean It seems only to work if i call the method mock(className), but since i want to use the mocked class on multiple methods i don’t want to keep repeating the same code in my test methods. This is my test class: I don’t want to use the Spring
Adding numbers to marker in mapbox android
I’m trying to figure out how to add numbers to markers programmatically in mapbox to get the result of the image below MARKERS WITH NUMBERS Here is the code of the map that displays some markers I’m searching for a way to give numbers to the markers, a proper way for me would be to add custom marker from drawable.
BigDecimal gives unexpected results for numbers larger than 7 or 0 decimal numbers
While trying to calculate a ratio of the volume of 2 objects, I noticed some weirdness in the calculation, here is a sample you can run for yourself: And the result is: There are 3 ways I could make it give me the expected result 1. If I change the decimal part from 0 to 1 (or any non-0 number):
How to right click on a link and open the link in a new tab using Selenium through Java
I am trying to right click on the Forgotten account? link on the Facebook login page using Selenium but it is not working. I am trying to send.Keys() after contextClick() but the key press is …
WSO2 IS: Custom Federated Authenticator using same form as basic authenticator
We are in the process of introducing WSO2 Identity Server in our infrastructure and there is the need to have two authentication methods but – if possible – using the same login form, without redirecting to external forms (like facebook login). The idea is that we have “normal” and “power” users where normal users will authenticate using the basic authenticator