Checking server-side ad viewing (php) [closed] - java

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 2 years ago.
Improve this question
I have an application using php backend. Let's say this is an app for cheating views on YouTube, or something else where points are very important. I want to realize crediting points for viewing ads, but don’t know how to do it. Of course, I can send a request to the server when an advertisement has been viewed,
#Override
public void onAdOpened() {
if (sampleInterstitial != null) {
//something code
}
}
but I'm afraid that a person rummaging in the code of my application will easily find which request I am sending and will be able to easily emulate my requests for building up points. How can I avoid this? For example, is it possible to somehow check from the server whether an ad was viewed? Thanks for answers)

First of all the client cannot check the server side code , you do something like getting the ip address , time .. etc of anyone who views the ad , and inject it in a database or a file , and in this way you can know how many people did and give it credits
Your Php Ad page :
$ip = $_SERVER['REMOTE_ADDR']; // gets ip address
$time = date_default_timezone_get(); // gets time
// insert it in your file or database

Related

Which is more Efficient ? PUT or POST? [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 1 year ago.
Improve this question
I have a service A, Service B, and Service C. A database is attached to service B. My requirement is to send data from service A every second. Service B processes the received data and store it in the database. Service C fetched processed data from the database ( by interacting with Service B ) every 5 seconds.
My question is, In the interaction between A to B, Would POST request be more efficient than PUT request considering performance constraints ( RAM and CPU usage ). Note that the request from A to B is using the same URI. Additionally, while fetching data from the database ( which is also using a single URI ) will the PUT method give me additional performance efficiency over the POST method?
There are no performance benefits between POST, PUT, DELETE. It's more a question of what your backend will do. Create a new entity? You might want to use POST. Update it? Use PUT. A more detailed answer between the two can be found here.

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 create Login In Java [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 6 years ago.
Improve this question
I need to create a system that checks a file for the username and password and if it is correct, it says whether or not in a label. So far I have been able to simply make one username and password equal to the variable, but need to link it to a file somehow..
String user_pass;
String user_name;
user_name= txtUser.getText().tostring();
user_pass= txtPass.getText().tostring();
if( user_name.equals("mube123") && user_pass.equals("mubarik") ){
lblDisplay.setText("Credentials Accepted.");
}
else{
lblDisplay.setText("Please try again.");
}
Your question is a bit ambiguous and I think you need to clarify some things like:
how do clients access the file in the first place? Through a local tool / through the web browser / ... ?
where is the list of valid credentials supposed to be stored? In an identity store such as "LDAP" or "ActiveDirectory" / hardcoded in your program / in a local file?
Depending on what your answers to these questions is, the solutions you want to look at vary quite a lot. For example:
when you have a user with access to the protected file itself and
want him to prevent reading the content without the right
username+password, you need to encrypt the file.
when you have a user that wants to download the file from a webserver, you can use the existing protection mechanisms of your
webserver (e.g. ".htaccess" file protection)
Without known what your are trying to achieve, it is not possible to answer the question ;)

Extracting friends' likes data of facebook [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 6 years ago.
Improve this question
I am making a tool that will predict the likes on a certain post using the data of friends likes using information retrieval and machine learning but for that I need the data.Can anyone help me with how to get the data of my friends likes.I just want to extract which friend has likes which post?
It is easy. Just login into your website with certain permission like user_friends (for now you can try it in graph api explorer) and then you can find likes of any posts of your friends with this code:
FB.api(
'/me',
'GET',
{"fields":"id,name,friends{likes,name}"},
function(response) {
// Insert your code here
}
);
For now, you can try the following query in graph api explorer and check if that is what you want:
me?fields=id,name,friends{likes,name}

authentification in a java application [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
it's my first time in development field and i'm really stuck -_-
I'm developing a java application using netbeans IDE 7.4. I created all my frames and they are all working. I have a table in my database named (user) contains one username and password(i'm using mysql with wampserver) the activation of all the interfaces comes after the identification . now i want to add another user with limited privileges(can't use some buttons) how is it possible to do that? Do i have to create two versions of every frame for each user? and how to connect them to the database?
I would handle this with a function being called right after logging in (identification). Essentially an authorize privileges function that will enable/disable buttons accordingly.
Example,
private void authPrivs(userLevel)
{
switch(userLevel)
case "Admin":
break;
case "Limited":
buttonAdmin.setEnabled(false);
buttonAdmin2.setEnabled(false);
break;
}
Because you have already designed the GUI with admin privileges defaulted, enabling is not necessary in the switch statement. You could even make the buttons disappear with setVisible(), but that might make your GUI really ugly.
Edit: Just to clarify, I would suggest making a field in your database that stores the "userLevel" variable. Once your user logs in, pull that userLevel off his login, and pass it to authPrivs().

Categories