Hello I am developing a game and working on collision detection. For now my method does not allow to add elements dynamically, as you can see I am adding collision nodes (11,12,13,…) manually. Here is my code: I want to dynamically build a boolean isNotCollision() depending on number of elements of coll…
Tag: java
Safely convert `float` to `double` without loss of precision
I have the following head scratcher, demonstrated in jshell 11.0.12 and 17.0.1 here The same thing occurs in a simple compiled class in both versions Although 17 warns that strictfp is no longer required The JLS says this in section 5.1.2 In 14 it contained the following after the bullet list Based on my read…
Keycloak public vs confidental client
I have a frontend and backend application (angular + spring boot). The frontend is served as static web content, then it sends the REST calls to the backend API on the same port. Keycloak with OpenID protocol is used for users authentication and role management. Upon an request which requires authentication, …
What is the current version of log4j-nosql and is it save?
For obvious reasons I am trying to update log4j to version 2.15. However the submodule log4j-nosql seems to be discontinued after 2.9.1: https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-nosql/ Is updating this submodule necessary? Which submodule contains the exploit? Answer I see no evidence tha…
Java Rest API – Method to return balance on account [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 12 months ago. Improve this question I need to get the balance for a particular customer id and account id. I…
Regex match group not working even if .find() and matches() were already called
I’ve already tried adding the matcher.find() and matcher.matches() in order to query matching string values, but still its not working. I am trying to have 3 group patterns to match, and for my example here, I want to match and find group 1 of pattern enclosed in the first round parenthesis. Why is the …
JavaFX how to trigger events on Geometries?
I’m writting an JavaFX application, where i use UTM32 coordinates for my geometries, i have a dynamic stroke width dependent on my zoom level. The issue is that i can’t trigger events when my stroke width is decreased at a certain factor. If you use Intellij you can start a new fx-project and copy…
Object is modified implicitly in one method and used by another
I have two methods meth1 and meth2. meth1 takes in an input of a set set1, returns a value, and also modifies set1. Now meth2 uses this set1 to compute another return value. The issue I see with this code is that the set modification is implicit and would be missed by a coder who is not careful enough. I
Concat new characters to StringBuilder object atomically
My problem is: I have class: I need to add new characters to StringBuilder concurrently and atomically. But problem is, only last 128 characters should be in this object. I can’t use StringBuffer, because operation should be non-blocking. So,there are two operations: First: check if StringBuilder alread…
How can i pass values from sqlite database to viewpager?
There is my model. (Card with two questions) This is my Activity. Adapter pass values from ArrayList to the ViewPager. In this class I create DataBase and try to pass values from cursor to ArrayList in MainActivity, but, when I start to debug, the debugger shows me that ArrayList in MainActivity is not filled…