Questions tagged [voting]

329 questions
1
vote
1 answer

AJAX + PHP voting system

I'm working on a voting system in AJAX and PHP and I've run into a bit of trouble. We're displaying a bunch of posts from our database and each post has an image next to it -- clicking the image is supposed to 1) toggle the image colour and then 2)…
Shola
  • 11
  • 4
1
vote
1 answer

Using deepstream.io for real-time voting

I made a prototype for a real-time voting system by using deepstream.io and rethinkdb as persistence store. So far, it works, and multiple browsers can stay in sync in getting the latest number of vote counts (see screenshot below), however, one…
TonyW
  • 18,375
  • 42
  • 110
  • 183
1
vote
0 answers

How can I compute the classifying function of svm in multiclass case manually without using the built in function in R?

I know that multi-class svm based on one versus one scheme is based on the voting method. The output of this sterategy is predicted label. I need to compute the amount of classification function , that in binary case, easily can be obtained by…
1
vote
1 answer

Like button (PHP/MySQL)

Here's my like button:
">
Here's the PHP: if (!empty($_POST)) { $connection = mysqli_connect("like"); …
Iphd
  • 23
  • 7
1
vote
1 answer

Non-unique many-to-many table design

I'm implementing a voting system for a php project which uses mysql. The important part is that I have to store every voting action separately for statistic reasons. The users can vote for many items multiple times, and every vote has a value (think…
1
vote
0 answers

Database design for questionbased voting system, has the normalization gone wrong?

I need to create a database system wherein normal users can create questions with, only 2, belonging answers and these questions can then get a up- or down-vote by people visiting the site. I am wondering in which way it would be best to create this…
Nenn
  • 477
  • 1
  • 4
  • 21
1
vote
1 answer

PHP Voting System Redirect Not Working

I'm attempting to build a simple PHP voting system where a website user is asked to vote on their favorite photo. Only one vote is permitted each day. When a vote is cast the PHP script will: ==== 1 -- checks the users IP address and compares it to…
Mike C
  • 11
  • 1
1
vote
2 answers

How do I make the like counter to go down when I click the dislike button and vice versa?

this is the controller with like action: def like like = Like.create(like: params[:like], user: current_user, story: @story) respond_to do|format| if like.valid? format.js else format.js {render status: 403, js: "alert('You can only…
1
vote
1 answer

acts_as_votable using ip address

I want to allow users to vote on posts without signing up, and have the vote instead tied to their ip address. I tried following this post but I need some more clarification. this is the error im getting from the posts_controller undefined method…
DavidK
  • 299
  • 1
  • 6
  • 24
1
vote
1 answer

mysql query to check if user voted

in this case i have posts table : id title description post_votes table: id post_id user_id comments table: id post_id user_id content users table: id username I have a query for my index page (logged users) select `posts`.`id`,…
user3670128
  • 47
  • 1
  • 8
1
vote
1 answer

How to differentiate scores between names using functions

I am trying to make a talent show type voting program using functions. I have the majority of it figured out. The program prompts you to enter a name, followed by five scores, if you type "Done" rather than a name, it will close. I'm using functions…
Ace Ebert
  • 71
  • 1
  • 2
  • 7
1
vote
2 answers

Algorithm for ranking with a star rating (1-5) like Amazon?

I'm a CS student doing a report on alternative voting systems. One of the best systems I believe is a ranked vote. For example.. In a presidential election, each president would be ranked 1-5. (IMO the problem with the US system is that only votes…
theCamburglar
  • 224
  • 1
  • 2
  • 10
1
vote
0 answers

How to set a rules action to write vote/ratings

How can I set an action in rules to enter a value in voting or ratings? The voting rules module settings allow for voting to be an event, but not a reaction. I select "node:vote-results" as the data to enter. However I get an error message "The…
hrf
  • 75
  • 1
  • 7
1
vote
2 answers

voting algorithm in distributed systems

assume distributed systems network. Each system measures a value. There is a correct decision to be made in consensus by all systems depending on all values. communication links may drop. Is there a voting and synchronization algorithm for this…
1
vote
2 answers

Looking for a 'pick a-or-b' voting system script

Apologies: this is my first time on stackoverflow and I'm starting with a question and seeking advice. Sorry. Caveats: I know HTML and CSS pretty well. Javascript and PHP are not completely alien, but I'm really pretty basic on those. That said, I'm…
user324455
  • 11
  • 1