I’m trying to solve the problem of “count ways to reach the nth step in a staircase” with recursion. When given a number of stairs to climb, I have to calculate the number of ways to climb taking either 1 or 2 steps at a time. For example, if there are 4 stairs, we would return 5 since we would
Firebase Database encountered an OutOfMemoryError. You may need to reduce the amount of data you are syncing to the client
The database in the /users folder has almost 50,000 user records and I am not able to read the keys because it is overflowing with memory. This occurs in the java environment on the mobile device as well as in javaScript on the server with firebase functions. The database has persistence enabled. A simple datanapshot.getChildrenCount() in the /users folder is
Sorting empty and word array in java
I want to write a code which can sort char array element. But the problem is where i want to sort ‘a’ before ‘aa’ element and I don’t know how to write this part. It always sort ‘aa’ before ‘a’. At first it get inputs from user and if we write ‘0’ it will print sorted array. Answer You have
How to package JavaFX + Spring Boot application via jpackage correctly?
I’m having trouble packaging my project using jpackage by badass jlink plugin. Project contains Spring Boot, which works with JavaFX via FXVeawer. And with Spring Data application works with Database. My build.gradle: Application is packaging, but due to error Caused by: org.springframework.cglib.core.CodeGenerationException: java.lang.IllegalAccessException–>module spring.geodemo does not open spring.geodemo to unnamed module @39cd0bac does not start. I have no idea what
Duplicate code across enums .. is there an approach to centralize common code in these enums?
I have the following 3 enum’s in my project, which are all very similar. Since each enum has at least 2 common fields i.e key and code, is there any way that I can make the common: constructors getters field declarations shared to all of my enums? Without having to declare inside each one. I know no extends clause allowed
I want to be able to compare two manga’s ratings but I don’t know how to make it so I can input two titles that then grabs the scores to compare
I have the data for 10 different manga set in an array list and they go as title, rating, ongoing or not, and amount of chapters. I want to be able to input two different manga titles into a scanner and then have it compare the rating of the two to see which is higher. This is the code I
SendGrid “invalid_email” DELETE api is not deleting the data
So my code looks like this. This is copied from SendGrid’s docs. I have a similar function for deletion of spam emails and bounce emails. But this function throws an error whenever “Response response = sg.api(request);” is executed. Please help. Answer From your comments, it seems that you are getting a 404 error, which tells you that the data you
How to find Self-Closing Tags with org.w3c.dom
Does anybody know, how to find self closing tags of the XML document? I am able to get all the elements of specific type, but I am unable to find elements, that are self closing and also, I need to find elements, with no attributes. My XML file has two types of myTag tags: Pair tags, that contains another nested
Find the key value with respect to value by using comparing with each item in Map List in Java
I have a problem about finding key value with respect to value by using comparing with each item in Map List in Java. If multiple key values with the same value, I want to get the highest character value. If all key values are different, I want to get a key with the highest value. Here is my screenshot shown
Webflux collectMap resulting Mono<Map<String, Mono>>
I’m quite new in the reactive world My code looks like this: The result is of type Map<String, Mono<String>> . I would like it to be of type Map<String, String>. Any ideas? Answer I suggest to use flatMap operator before collecting the elements into a Map