I would like to know how to do this with another way except of userinput? I don’t want to write the values I want to do this the user Answer I guess the following might help:
Tag: java
Make a POST with JPA with existing data
I have the following problem, the thing is that I have an entity: The thing is that this back is connected to an Oracle DB, in which I already have a few registered users, but these are entered through a Mockaroo script, and when I try to save a new user through a service Rest throws me this error: Of
Why can’t Nextflow handle this awk phrase?
Background: Using a csv as input, I want to combine the first two columns into a new one (separated by an underscore) and add that new column to the end of a new csv. Input: Desired output: The below awk phrase works from the command line: However, when placed within a nextflow script (below) it gives an erro…
Calling a Java variadic function from C through the JNI
I am currently working on creating some Java bindings for a C library I work on. One of our C-structs has a char buffer that is a file system path. After calling the C function, the buffer is correctly populated. I want to take the buffer and convert it to a java.nio.file.Path member on the Java object. I am …
Why this API is forbidden for an user having a JWT token containing the “correct” authority?
I am not so into Spring Security and JWT token and I have the following doubt on a project which I am working on. Basically I have this SecurityConfiguration class containing my Spring Security configuration, as you can see it is intended to handle JWT token: As you can see in the previous code I have the fol…
Detecting Apache Log4j vulnerability presence in gradle transitive dependencies
There is a recent vulnerability in log4j https://nvd.nist.gov/vuln/detail/CVE-2021-44228 which has criticality score of 10 How to check the presence of Log4j vulnerable versions in gradle so that it would list all the dependencies including the transitive dependencies? Answer We can use To list the dependency…
Convert GraphTraversal<Vertex, Map> into Java8 stream
I have a result of a query to graphDB which returns GraphTraversal<Vertex, Map<Object, List>> values. By using the default methods values.iterate().toStream() it should return a Stream of Stream<Map<Object, List>> which I can handle as a Java8 stream, but for some reason, it does not w…
How can I implement interface correctly?
I am doing homework of making a simple calculator using java and interface in java. but the class that implements java gives error saying here is the code Answer There are a couple of issues here. First, since BasicCalculator is a public class, it needs to be defined in its own file named BasicCalculator.java…
JPA Cast BigDecimal as string
I’m using JPA to query a database, but something strange happens. In some cases the cast works and compiles fine, but with a BigDecimal it doesn’t let me use the cast to make a LIKE with a String. Here is a part of the code that works: pesoObjetivo is a data type Double But when I try to perform t…
Java how to log set input
How do i log what goes in to the followin method? Using system.out is not possible, since void type is not allowed here. Answer To log what you are setting the URL as, which is what I’m assuming you are doing, you would have to set your url to a variable and log it. Alternatively you could add a print/l…