I am facing the OAuth issue, details are below: I am having two microservices: registration-service(https://github.com/choudharylakshyaveer/registration-service) student-service(https://github.com/choudharylakshyaveer/student-service) For these two I have added : cloud-config-server(https://github.com/choudha…
Tag: java
Spring Boot. Forward on RestController
I am implementing a mechanism for replacing short links. I need to forwarded request to another controller. I found examples how to do it in spring on models, but I don’t understand how to do it in RestControllers Example what i found (use models) Or maybe I’m looking in the wrong direction and I …
Drawing raffle numbers out of list that can have duplicates in Java
I was trying to learn programming by writing code with friends, we are all new though and are stuck with this raffle program. Players can earn multiple raffle tickets. The raffle tickets are written down in a new row in an ArrayList when they are earned. It looks like this: “PlayerA PlayerB PlayerB Play…
Optimal way to find manager phone number whose subordinates live in more than one city in a graph
I am trying Find the phone numbers of all managers whose direct report hierarchy live in more than 1 city in O(n) time complexity. Below is my approach which is using with Time Complexity O(M*N) where M is the number of managers and N is the Number of employess. Can someone please help me with O(N) solution f…
Search for all po files in a directory and its subdirectories and create a Hashmap containing the filepaths as value and its directory as key
I want to search for all .po files in a directory and add them to a HashMap. My directories looks like the following: How can I represent/search these files with the help of java-Streams and HashMap<String, List<File>>, with en/de/it.po as a List<File> type and the respective directory root …
How to store the data in the list without overwritten the data?
I am working on the json array loops to output the data so I can store them in the EmailAddressData list. I have got a problem with this line under the loops: It will overwritten the data each time I fetch it and store it. I dont know what other ways I could use to store the data. It will
Duplicate “values” for some key in map-reduce java program
I am new in mapreduce and hadoop (hadoop 3.2.3 and java 8). I am trying to separate some lines based on a symbol in a line. Example: “q1,a,q0,” should be return (‘a’,”q1,a,q0,”) as (key, value). My dataset contains ten(10) lines , five(5) for key ‘a’ and five fo…
Spring repository : Junit test succeeds on custom delete even when @Transactional is missing
I have a Spring repository that has a method like this : When testing this method in a Junit Test, it does work as intended. However, the delete does not work on our production DB. For it to work on the production DB, we had to add the @Transactional annotation to the method in the repository This is an issue
Adding two linked list ends in Infinite Loop
I’m trying to solve LeetCode problem 2. Add Two Numbers: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list. You may assume the t…
How to finish an Activity inside a dialog? I called finish(); and SecondActivity.this.finish(); but they didn’t work
In the first case, finish() works properly, but it doesn’t work inside the dialog. This code is from second Activity, in the first case when I call finish() it finishes and return back to MainActivity but in the second case inside the dialog when I call finish(); the app crashes. I can do something like…