Link an integer to two people [closed] - java

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 days ago.
This post was edited and submitted for review 23 hours ago and failed to reopen the post:
Original close reason(s) were not resolved
Improve this question
I'm currently coding a roleplay bot that should save relationships between two people as an integer.
The problem is that when I use a define normal integer: int relationship = 0;
and add something to it as soon as someone uses a specific command:
if (event.getMessage().getContentStripped().startsWith("r!kiss")) {
relationship = relationship + 3;
it adds 3 if anyone uses the command with anyone. I'd like to make the command so if userA uses the command r!kiss #userB it adds 3 to the relationship integer of userA and userB.
In a comment I got told that I would need more "structure" and I then would be able to use maps to link it to 2 people. How can I get the needed structure and how exactly can I use maps to link the int to two people then?

Related

Making a request to end points wrong [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 4 years ago.
Improve this question
I submitted my project about fetching popular movies data in Udacity, and when i saw my review there was one thing to change, "The end points are perfectly implemented and fetches the correct result every time a request is made. But there is a small problem that instead of making a request to end point top_rated you are making a request to vote_average which makes it fetch wrong result!" But when i change to top_rated, the app doesn't fetch at all what is the problem? I don't get it, it fetches perfectly like this,And I don't see in the moviesDB nothing in JSON that says top_rated..
ScreeenShot
Information about the Project>> https://docs.google.com/document/d/1ZlN1fUsCSKuInLECcJkslIqvpKlP7jWL2TP9m6UiA6I/pub?embedded=true
My project >> https://drive.google.com/open?id=1wxYsxio2kbo44anndE9_93h13pWKTk0J
What does your json look like thats coming back from the url.
It looks like you also never make a request to
http://api.themoviedb.org/3/movie/popular?api_key=[YOUR_API_KEY]
based on your code and the project it seems like you need to fetch the top rated, then add it to your movie object.
in the project description look for Stage 1 - API Hints

How to set a restriction for each phone/user on my app? [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 7 years ago.
Improve this question
I'm starting to build an app where people vote certain stuff just by clicking on happy/sad faces (kind of like grading it). The thing is that I dont want to make a log-in nor registration for my app (the reason is a long story). So is there any way that I can limit people's vote to 2 per day? Every phone/user could only vote twice a day, and that count will reset after 24h from the first vote.
You have tow options:
Limit the number of votes on the device, by saving the number of votes into persistant storage on the device with a timestamp and act accordingly.
Or (more secure, but also more difficult)
Track the installations as described here identifying app installation
And send the id with every request and validate on the server side.

Reorder the auto increment value while working in java [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have ID as primary key and enabled the auto increment in ID. Now suppose if ID are
1 ram
2 shyam
3 hari
4 sita
If I delete id and tries to add new value database will have
1 ram
2 shyam
4 sita
5 themos
But I want it to be
1 ram
2 shyam
3 sita
4 themos
I want to implement this through java code.
You have selected an auto incrementing db key and it is doing what it is supposed to do.
Any gaps in the sequence due to deletions should not be of concern to you. If they are then you have a broken db design.
Otherwise if you really must then use temp tables to move the data out and back in to do this or do some really silly complicated locking to handle delete marks to overwrite for later inserts which like I said would be silly. Oh and then deal with the consequences of cooking live data.
Much simpler to fix your broken db design.

Search by name and number both within in single search bar [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 8 years ago.
Improve this question
I want to implement a functionality in java where I can search by both by username or by employee number within a single search bar.
I am looking for a simple solution either at client side or at java side
Thanks in advance
Just perform the first search, if it gives a result use it. If not then do the second search.
If usernames must contain alphabetic characters and employee numbers cannot contain them then you could look at the contents of the string and decide which search to run based on that.

What other classes do I need? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm looking to create an application that will be used to help find a suitable University for prospective students to attend (which is based on various criteria about themselves). The application will be used by prospective students to enter details about themselves and a list of Universities will be displayed based on their profile.
I'm on the design stage (class diagram and etc) and i'm currently thinking of some Java classes I need to produce to do this. So far I've only thought of two...
University class (to hold information about Universities)
Interface class (this the GUI display)
Can someone help suggest what other class that I will need to create this application? You can suggest as many as you like.
Take every noun in your application description. Make it into a class. See if you can write a more detailed description of your app. Use those nouns as classes as well.

Categories