Posts by FearX • 130 points
17 posts
-
0
votes0
answers75
views -
0
votes3
answers2177
viewsA: Difference between a return and no return method
The difference is that the no-return method works as a service and the method with return as a function. The return method will bring another part of the code a value or object that can be used.…
-
0
votes1
answer625
viewsA: How to install java 8 on Ubuntu 19.04?
If you used the apt to install: The first step is to uninstall older versions. sudo apt remove openjdk-11* This will cause apt to search for any package that contains "openjdk-11" installed, and…
-
0
votes0
answers87
viewsQ: Springboot error while returning JSON
I am using Spring Boot on my API. Spring has the ability to convert Javabeans automatically to Jsons when returning an object. However, with this code (in my MODEL layer) I am having a…
-
0
votes1
answer105
viewsA: Implementation of the Responseerrorhandler Interface (Spring)
The solution was to generalize requests to Handler. @Component @ControllerAdvice public class RequestErrorHandler { @ExceptionHandler(HttpClientErrorException.class) @ResponseBody public void…
-
0
votes1
answer325
viewsA: CORS not being applied - Spring Boot
I wrote down the class with @Enablewebmvc and everything seemed to work smoothly. @Configuration @EnableWebMvc public class CorsConfiguration implements WebMvcConfigurer { @Override public void…
-
0
votes1
answer325
viewsQ: CORS not being applied - Spring Boot
I have a Spring Boot configuration class to handle CORS. This class theoretically allows all origins, all methods and with all headers. @Configuration public class CorsConfiguration implements…
-
0
votes1
answer105
viewsQ: Implementation of the Responseerrorhandler Interface (Spring)
Hello. I’m trying to override the Responseerrorhandler interface so I can return the entire request (status code, body etc.) in case of any answer other than 2xx. I noticed that the default Spring…
-
0
votes1
answer89
viewsQ: How to mount a Json with Jackson having the model classes?
I have the following classes: public class OnesignalRequestModel { private String app_id; private List<IDModelJson> include_player_ids; private ContentJsonModel content; public String…
-
1
votes2
answers104
viewsQ: Set final variable inside a lambda gives error, but if it is not final, gives another error
public UserEntity findByEmail(String email) { final UserEntity result; getDatabase().forEach((Long id, UserEntity user) -> { boolean isName = user.getEmail().equals(email); if (isName) { result =…
-
2
votes2
answers314
viewsA: JVM crashing at random
That’s a BUG known from Java, which was mentioned only in Java 10. This bug occurs when you try to manipulate a graphical element within some external context. In my case, it happened because of…
-
0
votes2
answers314
viewsQ: JVM crashing at random
# # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007fc501ddca87, pid=2944, tid=0x00007fc4c41ab700 # # JRE version: Java(TM) SE Runtime Environment…
-
0
votes2
answers54
viewsA: Getting id wrong
The solution was to create static attribute and set method, and when I get the ID, attribute in the class. I don’t know if it’s ideal, but it works well for what I need. private static String…
-
0
votes3
answers2058
viewsA: Always pick the last three characters without knowing the size of the string
You can get the size of it using suaString.substring(suaString.length() - 3); You will only have problems if your String is less than three characters long As the method .length() returns a number…
-
2
votes2
answers270
viewsQ: Run multiple processes on Linux with Python
I receive some Urls as parameter via MQTT, after extracting them I can execute the command for FFMPEG to record them with os.system. But it works for only one process, and I need to run N…
-
1
votes2
answers54
viewsQ: Getting id wrong
In the small project I am doing, the user enters his login and password. The system makes a POST for a URL and checks the answer. If you log in, it returns some things like the user ID, email and…
-
4
votes1
answer309
viewsQ: How to handle a JSON format string?
Let’s say I receive the following content that is stored in a String: { "client_id": 1580, "videos": 4, "remote_urls": [{ "url": "rtsp://aniceurl.com" }, { "url": "rtsp://aniceurl.com" }, { "url":…